/* Direction: Starjar — a children's board game. Butter-yellow board, dashed
   cut-out edges, chunky tiles with thick soft shadows, and one grape-purple
   accent kept for points and the main button. */
/* Completed by the platform from the short form: both modes, every
   palette token, each text-on-ground pair at its floor. To restyle, write the
   short form again (the decisions in one :root) and it is completed again. */

:root {
  --canvas: #fff5d4;
  --surface: #fffdf3;
  --surface-2: #ffe8a6;
  --border: #e3c87c;
  --border-strong: #b7ae9b;
  --ink: #3a2a10;
  --muted: #765e2c;
  --accent: #6b3fa0;
  --accent-hover: #5b3688;
  --accent-ink: #ffffff;
  --accent-text: #5b3190;
  --accent-strong: #472a76;
  --accent-soft: #ece1fb;
  --accent-border: #bca3bd;
  --success: #2f7d4f;
  --success-ink: #ffffff;
  --success-soft: #e6e7c4;
  --success-strong: #2b7349;
  --warning: #a9680f;
  --warning-ink: #ffffff;
  --warning-soft: #f5e4bc;
  --warning-strong: #8f580d;
  --danger: #b3382f;
  --danger-ink: #ffffff;
  --danger-soft: #f6dec0;
  --danger-strong: #b3382f;
  --chart-1: #6b3fa0;
  --chart-2: #b8466d;
  --chart-3: #703f08;
  --chart-4: #637904;
  --chart-5: #0b5a50;
  --chart-6: #0278b5;

  --font-display: "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
  --display-weight: 800;
  --display-tracking: -0.01em;
  --radius-card: 24px;
  --radius-btn: 999px;
  --radius-input: 16px;
  --shadow-card: 0 10px 0 rgba(58, 42, 16, 0.14), 0 20px 34px rgba(58, 42, 16, 0.12);
  --card-pad: 1.3rem;
  --x-on-photo: #ffffff;
  --x-star: #f5b301;
  --x-kid-1: #0f766e;
  --x-kid-2: #a8355f;
  --x-kid-3: #245e9e;
  --font-mono: "JetBrains Mono Variable", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-sans: "Nunito", system-ui, sans-serif;
  --eyebrow-tracking: 0.08em;
}

html[data-theme="dark"] {
  --canvas: #0f0916;
  --surface: #27222d;
  --surface-2: #1b1522;
  --border: #312b37;
  --border-strong: #57535c;
  --ink: #fff5d4;
  --muted: #9f9788;
  --accent: #6b3fa0;
  --accent-hover: #815cae;
  --accent-ink: #ffffff;
  --accent-text: #9d80c0;
  --accent-strong: #9575bb;
  --accent-soft: #231534;
  --accent-border: #382154;
  --success: #2f7d4f;
  --success-ink: #ffffff;
  --success-soft: #162323;
  --success-strong: #5d9a76;
  --warning: #a9680f;
  --warning-ink: #ffffff;
  --warning-soft: #311e14;
  --warning-strong: #b67f34;
  --danger: #b3382f;
  --danger-ink: #ffffff;
  --danger-soft: #33131c;
  --danger-strong: #c9706a;
  --chart-1: #885dc1;
  --chart-2: #db648b;
  --chart-3: #b66c1a;
  --chart-4: #7e9906;
  --chart-5: #1f9484;
  --chart-6: #0197e3;
}

/* Starjar — the board texture, wiggly tiles, the tick burst, cheering columns */

/* The board is swapped whole, so the browser must not re-anchor the page. */
html,
body,
#board {
  overflow-anchor: none;
}

.board-dots {
  background-image: radial-gradient(var(--border) 1.6px, transparent 1.7px);
  background-size: 20px 20px;
}

.tile {
  border: 3px solid var(--border);
}

html:not(.reduced-motion) .tile {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

html:not(.reduced-motion) .tile:hover {
  animation: sj-wiggle 0.55s ease-in-out;
}

@keyframes sj-wiggle {
  0%,
  100% {
    transform: rotate(0deg) translateY(0);
  }
  25% {
    transform: rotate(-1.2deg) translateY(-4px);
  }
  75% {
    transform: rotate(1.2deg) translateY(-4px);
  }
}

html:not(.reduced-motion) .cheer-bob {
  animation: sj-bob 2.6s ease-in-out infinite;
}

@keyframes sj-bob {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-6px) rotate(2deg);
  }
}

/* The shared family goal, drawn as a big jar that fills in grape purple. */
.goal-jar {
  display: block;
  width: 9.5rem;
  flex: none;
}

.goal-jar-lid {
  display: block;
  width: 6.2rem;
  height: 1.4rem;
  margin: 0 auto;
  border: 4px solid var(--border-strong);
  border-bottom: none;
  border-radius: 12px 12px 4px 4px;
  background: var(--surface-2);
}

.goal-jar-body {
  position: relative;
  display: block;
  height: 11.5rem;
  overflow: hidden;
  border: 5px solid var(--border-strong);
  border-radius: 14px 14px 36px 36px;
  background: var(--surface);
  box-shadow: inset 0 6px 14px rgba(0, 0, 0, 0.08);
}

.goal-jar-fill {
  position: absolute;
  inset: auto 0 0 0;
  display: block;
  background: linear-gradient(180deg, var(--accent-hover), var(--accent));
  border-radius: 10px 10px 30px 30px;
}

.goal-jar-fill::before {
  content: "";
  position: absolute;
  inset: -0.45rem 0 auto 0;
  height: 0.9rem;
  border-radius: 9999px;
  background: var(--accent-hover);
}

.goal-jar-shine {
  position: absolute;
  top: 0.9rem;
  left: 0.9rem;
  display: block;
  width: 0.9rem;
  height: 4.5rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.35);
}

html:not(.reduced-motion) .goal-bar {
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (min-width: 640px) {
  .goal-jar {
    width: 11rem;
  }
  .goal-jar-body {
    height: 14rem;
  }
}

.burst-dot {
  position: fixed;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 9999px;
  pointer-events: none;
  z-index: 70;
  animation: sj-burst 0.6s ease-out forwards;
}

@keyframes sj-burst {
  from {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  to {
    transform: translate(calc(-50% + var(--bx, 0px)), calc(-50% + var(--by, 0px))) scale(0.2);
    opacity: 0;
  }
}

.jar-pop {
  animation: sj-pop 0.5s ease-out;
}

@keyframes sj-pop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
  }
}

.star-row svg {
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.18));
}
