/* Miss Marigold, the guide to today's learning (assets/today-guide.js). */

.tg {
  --tg-face: 6.5rem;
  display: grid;
  grid-template-columns: var(--tg-face) 1fr;
  align-items: center;
  gap: 0.4rem 1rem;
}

.tg-face {
  position: relative;
  width: var(--tg-face);
  height: var(--tg-face);
  padding: 0;
  border-radius: 50%;
  border: 3px solid var(--gold, #ffd88a);
  background: radial-gradient(circle at 50% 38%, #fff6dc 0%, #f4dfaa 55%, #d9b56c 100%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s;
}

.tg-face:hover { transform: scale(1.04); }
.tg-face:focus-visible { outline: 4px solid #8cc8f8; outline-offset: 3px; }

.tg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.4s;
}

.tg-glyph {
  position: absolute;
  inset: 18%;
  width: 64%;
  height: 64%;
  opacity: 0;
  transition: opacity 0.3s;
}

/* Empty while her head loads (as the planner); the flower only where it cannot. */
.tg.is-live .tg-canvas { opacity: 1; }
.tg.is-failed .tg-glyph { opacity: 1; }

.tg-count {
  position: absolute;
  top: 0.1rem;
  right: 0.1rem;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #e8594f;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 900;
  line-height: 1.5rem;
  text-align: center;
}

.tg-bubble {
  position: relative;
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: 1.1rem;
  background: #fffaf0;
  color: #2b2a24;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.tg-bubble:empty { display: none; }

.tg-inline .tg-bubble::before {
  content: "";
  position: absolute;
  left: -0.55rem;
  top: 50%;
  border: 0.6rem solid transparent;
  border-right-color: #fffaf0;
  border-left: 0;
  transform: translateY(-50%);
}

/* The fan: today's cards, a gentle arc, real links. */

.tg-fan {
  grid-column: 1 / -1;
  padding: 0.8rem 0.6rem 0.4rem;
  border-radius: 1.2rem;
  background: rgba(10, 18, 48, 0.72);
  border: 2px solid rgba(255, 216, 138, 0.45);
}

.tg-fan-title {
  margin: 0 0 0.6rem;
  text-align: center;
  font-weight: 900;
  color: var(--gold, #ffd88a);
}

.tg-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
  padding-bottom: 0.6rem;
}

.tg-card {
  --spread: calc(var(--i) - (var(--n) - 1) / 2);
  display: flex;
  flex-direction: column;
  width: 8.5rem;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 1rem;
  background: #fffaf0;
  color: #2b2a24;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  transform: rotate(calc(var(--spread) * 4deg)) translateY(calc(var(--spread) * var(--spread) * 0.25rem));
  animation: tg-deal 0.35s calc(var(--i) * 60ms) cubic-bezier(0.3, 1.4, 0.5, 1) both;
  transition: transform 0.15s;
}

.tg-card:hover,
.tg-card:focus-visible {
  transform: translateY(-0.4rem) scale(1.05);
  z-index: 1;
}

.tg-card:focus-visible { outline: 4px solid #8cc8f8; outline-offset: 2px; }
.tg-card.is-next { border-color: var(--gold, #ffd88a); }
.tg-card.is-together { border-color: #ffc896; }

.tg-card-art {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: 0.75rem 0.75rem 0 0;
  overflow: hidden;
  background: #f4e6c4;
}

.tg-card-pic { display: block; width: 100%; height: 100%; object-fit: cover; }
.tg-card-pic.is-icon { object-fit: contain; padding: 14%; box-sizing: border-box; }
.tg-card.is-done .tg-card-pic { filter: saturate(0.55) brightness(0.8); }

.tg-tick {
  position: absolute;
  right: 0.35rem;
  bottom: 0.35rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #3fae5a;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 2rem;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.tg-card-title {
  padding: 0.4rem 0.5rem 0.55rem;
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

@keyframes tg-deal {
  from { opacity: 0; transform: translateY(1.5rem) rotate(0) scale(0.8); }
}

/* Corner: a small face on free-play pages. */

.tg-corner {
  --tg-face: 4.25rem;
  position: fixed;
  right: calc(var(--stage-x, 0px) + max(0.9rem, env(safe-area-inset-right)));
  bottom: max(0.9rem, env(safe-area-inset-bottom));
  z-index: 60;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 0.6rem;
  max-width: calc(100vw - 1.8rem);
}

.tg-corner .tg-bubble { max-width: 16rem; font-size: 0.95rem; }
.tg-corner .tg-fan {
  width: min(30rem, calc(100vw - 1.8rem));
  max-height: min(60vh, 28rem);
  overflow-y: auto;
  background: #0a1230;
}

body.has-today-guide { padding-bottom: 5.5rem; }

@media (max-width: 560px) {
  .tg { --tg-face: 5rem; gap: 0.4rem 0.75rem; }
  .tg-bubble { font-size: 0.95rem; padding: 0.6rem 0.8rem; }
  .tg-card { width: calc(50% - 0.5rem); max-width: 9rem; }
  .tg-corner { --tg-face: 3.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .tg-card { animation: none; transform: none; transition: none; }
  .tg-face { transition: none; }
}
