/* Direction: Flipwise — pale cream paper, rounded playful display type,
   pastel deck tints, one coral accent for due counts and the Study 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: #fdf8f0;
  --surface: #fffdf9;
  --surface-2: #f7eee1;
  --border: #ebdecc;
  --border-strong: #bbb2ab;
  --ink: #3a2e26;
  --muted: #7a6553;
  --accent: #ef6244;
  --accent-hover: #cb533a;
  --accent-ink: #210e0a;
  --accent-text: #b93d1d;
  --accent-strong: #b23b1e;
  --accent-soft: #fde3da;
  --accent-border: #f7b5a3;
  --success: #15803d;
  --success-ink: #ffffff;
  --success-soft: #e1eadb;
  --success-strong: #137638;
  --warning: #b45309;
  --warning-ink: #ffffff;
  --warning-soft: #f4e4d4;
  --warning-strong: #a64c08;
  --danger: #b91c1c;
  --danger-ink: #ffffff;
  --danger-soft: #f5ded7;
  --danger-strong: #b91c1c;
  --chart-1: #ef6244;
  --chart-2: #a68a0a;
  --chart-3: #1d9554;
  --chart-4: #139cb4;
  --chart-5: #5c6ce3;
  --chart-6: #d161c0;

  --font-display: "Baloo 2", "Trebuchet MS", sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
  --display-weight: 700;
  --display-tracking: -0.02em;
  --radius-card: 28px;
  --radius-btn: 999px;
  --radius-input: 18px;
  --shadow-card: 0 22px 44px -26px rgba(58, 46, 38, 0.38);
  --card-pad: 1.75rem;
  --x-mint: #d7eee2;
  --x-blush: #fbdfe6;
  --x-butter: #fbeec8;
  --x-sky: #dbe7fa;
  --x-lilac: #e7e0fa;
  --x-chalk: #fffdf8;
  --x-deep: #33281f;
  --x-deep-soft: #6b5a4a;
  --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: #140907;
  --surface: #2c2220;
  --surface-2: #201513;
  --border: #352b2a;
  --border-strong: #5b5351;
  --ink: #fdf8f0;
  --muted: #a09893;
  --accent: #ef6244;
  --accent-hover: #f17a60;
  --accent-ink: #210e0a;
  --accent-text: #ef6244;
  --accent-strong: #ef6244;
  --accent-soft: #441d14;
  --accent-border: #773122;
  --success: #15803d;
  --success-ink: #ffffff;
  --success-soft: #142313;
  --success-strong: #499c68;
  --warning: #b45309;
  --warning-ink: #ffffff;
  --warning-soft: #371907;
  --warning-strong: #c57a40;
  --danger: #b91c1c;
  --danger-ink: #ffffff;
  --danger-soft: #380d0c;
  --danger-strong: #d16969;
  --chart-1: #ef6244;
  --chart-2: #d2ae13;
  --chart-3: #009953;
  --chart-4: #07bfdc;
  --chart-5: #6172ea;
  --chart-6: #f07ddd;
}

/* Flipwise's own screens: stacked decks, the 3D flip, the celebration. */

.deck-stack {
  position: relative;
  z-index: 0;
}
.deck-stack::before,
.deck-stack::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -11px;
  width: 91%;
  height: 70%;
  translate: -50% 0;
  border-radius: inherit;
  background: inherit;
  opacity: 0.8;
  z-index: -1;
  transition: bottom 0.35s ease;
}
.deck-stack::after {
  bottom: -21px;
  width: 80%;
  opacity: 0.55;
}
.deck-stack:hover::before {
  bottom: -16px;
}
.deck-stack:hover::after {
  bottom: -30px;
}

.flip-card {
  perspective: 1500px;
}
.flip-inner {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.37, 0.06, 0.21, 1);
}
.flip-scope.is-flipped .flip-inner {
  transform: rotateY(180deg);
}
.flip-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.flip-face-back {
  transform: rotateY(180deg);
}

.grade-row {
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.flip-scope.is-flipped .grade-row {
  opacity: 1;
  pointer-events: auto;
}

.confetti {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 0;
  pointer-events: none;
}
.confetti span {
  position: absolute;
  top: 0;
  width: 0.55rem;
  height: 0.85rem;
  border-radius: 4px;
  animation: confetti-fall 2.1s cubic-bezier(0.3, 0.7, 0.4, 1) forwards;
}
.confetti span:nth-child(5n + 1) { background: var(--accent); }
.confetti span:nth-child(5n + 2) { background: var(--x-sky); }
.confetti span:nth-child(5n + 3) { background: var(--x-butter); }
.confetti span:nth-child(5n + 4) { background: var(--x-lilac); }
.confetti span:nth-child(5n + 5) { background: var(--x-mint); }
.confetti span:nth-child(1) { left: 6%; animation-delay: 0s; }
.confetti span:nth-child(2) { left: 15%; animation-delay: 0.12s; }
.confetti span:nth-child(3) { left: 24%; animation-delay: 0.26s; }
.confetti span:nth-child(4) { left: 33%; animation-delay: 0.06s; }
.confetti span:nth-child(5) { left: 42%; animation-delay: 0.34s; }
.confetti span:nth-child(6) { left: 51%; animation-delay: 0.18s; }
.confetti span:nth-child(7) { left: 60%; animation-delay: 0.4s; }
.confetti span:nth-child(8) { left: 69%; animation-delay: 0.1s; }
.confetti span:nth-child(9) { left: 78%; animation-delay: 0.3s; }
.confetti span:nth-child(10) { left: 87%; animation-delay: 0.22s; }
.confetti span:nth-child(11) { left: 94%; animation-delay: 0.46s; }
.confetti span:nth-child(12) { left: 70%; animation-delay: 0.54s; }
@keyframes confetti-fall {
  0% { transform: translateY(-26px) rotate(0deg); opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateY(320px) rotate(560deg); opacity: 0; }
}

.pop-in {
  animation: pop-in 0.55s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
@keyframes pop-in {
  0% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

.answer-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

html.reduced-motion .flip-inner,
html.reduced-motion .deck-stack::before,
html.reduced-motion .deck-stack::after,
html.reduced-motion .grade-row {
  transition: none;
}
html.reduced-motion .pop-in {
  animation: none;
}
html.reduced-motion .confetti {
  display: none;
}
