/* Alpha Swirl. Copyright © 2026 Adam Sho* and Co. All rights reserved. */

:root {
  --ink: #2a1248;
  --ink-soft: #5b3a7a;
  --paper: #fff7ee;
  --card: #fffdf9;
  --line: rgba(42, 18, 72, 0.12);
  --pink: #ff6b9a;
  --mint: #3dceb0;
  --gold: #ffd166;
  --sky: #6cb6ff;
  --violet: #a78bfa;
  --shadow: 0 18px 40px rgba(42, 18, 72, 0.18);
  --radius: 28px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Nunito", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 10% -10%, #ffd6e8 0%, transparent 55%),
    radial-gradient(900px 600px at 110% 10%, #c9f4ea 0%, transparent 50%),
    radial-gradient(800px 500px at 50% 120%, #d9c7ff 0%, transparent 55%),
    var(--paper);
  overflow-x: hidden;
  padding-bottom: calc(24px + var(--safe-bottom));
}

h1,
h2,
.ask,
.answer-name,
.btn,
.lang-btn,
.lang-toggle,
.help-btn,
.choice,
.jump-btn {
  font-family: "Fredoka", "Nunito", sans-serif;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.blobs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(8px);
  opacity: 0.45;
  animation: drift 16s ease-in-out infinite;
}

.b1 {
  width: 180px;
  height: 180px;
  background: #ffb3c7;
  top: 12%;
  left: -40px;
}

.b2 {
  width: 220px;
  height: 220px;
  background: #9de7d3;
  top: 48%;
  right: -60px;
  animation-delay: -4s;
}

.b3 {
  width: 140px;
  height: 140px;
  background: #ffe08a;
  bottom: 8%;
  left: 18%;
  animation-delay: -8s;
}

.b4 {
  width: 120px;
  height: 120px;
  background: #c4b5fd;
  top: 8%;
  right: 18%;
  animation-delay: -2s;
}

@keyframes drift {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(18px, -22px) scale(1.08);
  }
}

.float-icons {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.floater {
  position: absolute;
  width: 42px;
  height: 42px;
  opacity: 0.55;
  animation: floaty 9s ease-in-out infinite;
}

.f1 { top: 18%; left: 6%; animation-delay: -1s; }
.f2 { top: 28%; right: 8%; width: 36px; animation-delay: -3s; }
.f3 { bottom: 22%; left: 10%; width: 34px; animation-delay: -5s; }
.f4 { bottom: 16%; right: 12%; animation-delay: -2s; }
.f5 { top: 62%; left: 4%; width: 30px; animation-delay: -6s; }
.f6 { top: 72%; right: 6%; width: 46px; animation-delay: -7s; }

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0) rotate(-8deg);
  }
  50% {
    transform: translateY(-14px) rotate(8deg);
  }
}

#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

.topbar,
main,
footer {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(16px + var(--safe-top)) 20px 8px;
  max-width: 760px;
  margin: 0 auto;
  z-index: 5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.brand:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
  border-radius: 12px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  filter: drop-shadow(0 6px 10px rgba(42, 18, 72, 0.25));
}

.brand h1 {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.tagline {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.copyright {
  margin: 6px 0 0;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--ink-soft);
  line-height: 1.35;
}

.copyright-header {
  max-width: 16.5rem;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: rgba(255, 253, 249, 0.8);
  border: 2px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  appearance: none;
  flex-shrink: 0;
}

.help-btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.restart-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 14px;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-family: "Fredoka", "Nunito", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.72;
}

.restart-btn .restart-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.restart-btn:hover,
.restart-btn:focus-visible {
  opacity: 1;
  color: var(--ink);
}

.restart-btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 10px;
}

.lang-picker {
  position: relative;
  flex-shrink: 0;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 36px;
  padding: 0 8px 0 12px;
  background: rgba(255, 253, 249, 0.8);
  border: 2px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  appearance: none;
}

.lang-caret {
  width: 16px;
  height: 16px;
  transition: transform 0.15s ease;
}

.lang-picker.is-open .lang-caret {
  transform: rotate(180deg);
}

.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 88px;
  flex-direction: column;
  border: 2px solid var(--ink);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 4px 4px 0 var(--ink);
  overflow: hidden;
  z-index: 20;
}

.lang-picker.is-open .lang-menu {
  display: flex;
}

.lang-menu .lang-btn {
  width: 100%;
  text-align: left;
  padding: 10px 14px;
}

.lang-btn {
  border: 0;
  background: var(--card);
  color: var(--ink);
  font-weight: 700;
  padding: 8px 11px;
  cursor: pointer;
}

.lang-btn.is-active {
  background: var(--ink);
  color: #fff;
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 16px 24px;
}

.screen {
  display: none;
}

.screen.is-active {
  display: block;
  animation: pop-in 0.45s cubic-bezier(0.2, 0.9, 0.25, 1);
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.card {
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow), 8px 8px 0 var(--ink);
  padding: 24px 22px 26px;
}

.card h2 {
  margin: 0 0 8px;
  font-size: 1.7rem;
}

.lede {
  margin: 0 0 22px;
  color: var(--ink-soft);
  line-height: 1.45;
}

.field {
  margin-bottom: 8px;
}

.field-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-weight: 800;
}

.icon-wrap {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: var(--gold);
  border: 2px solid var(--ink);
  border-radius: 10px;
  color: var(--ink);
}

.icon-wrap svg {
  width: 16px;
  height: 16px;
}

.levels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  min-width: 0;
}

.level-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  border: 2.5px solid var(--ink);
  border-radius: 18px;
  background: #fff;
  padding: 12px 28px 12px 10px;
  cursor: pointer;
  color: inherit;
  min-height: 108px;
  min-width: 0;
  width: 100%;
  position: relative;
}

.level-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.level-arrow {
  position: absolute;
  top: 14px;
  right: 10px;
  width: 18px;
  height: 18px;
  min-width: 18px;
  color: var(--ink-soft);
  flex-shrink: 0;
  pointer-events: none;
  transition: transform 0.15s ease, color 0.15s ease;
}

.level-card:hover {
  background: #f7f3ff;
}

.level-card:hover .level-arrow {
  color: var(--ink);
  transform: translateX(2px);
}

.level-card:focus-visible {
  background: #f7f3ff;
  outline: 3px solid var(--mint);
  outline-offset: 2px;
}

.level-card strong {
  font-family: "Fredoka", "Nunito", sans-serif;
  font-size: 0.95rem;
}

.level-card small {
  color: var(--ink-soft);
  font-size: 0.75rem;
  line-height: 1.25;
}

.level-swatches {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
}

.level-swatches i {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  display: grid;
  place-items: center;
  font-style: normal;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1;
  background: #fff8f1;
}

.home-preview {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 6px;
  margin: 4px 0 28px;
  pointer-events: none;
  user-select: none;
}

.home-glyph {
  display: block;
  line-height: 1;
  font-weight: 700;
  font-size: 2.35rem;
  background: none;
  border: 0;
  box-shadow: none;
  animation: glyph-bob 5.5s ease-in-out infinite;
}

.home-glyph:nth-child(1) { color: var(--mint); font-size: 2.15rem; transform: rotate(-10deg) translateY(6px); animation-delay: -0.6s; }
.home-glyph:nth-child(2) { color: var(--gold); font-size: 2.55rem; transform: rotate(8deg) translateY(-4px); animation-delay: -1.8s; }
.home-glyph:nth-child(3) { color: var(--pink); font-size: 2.8rem; transform: rotate(-3deg); animation-delay: -3.2s; }
.home-glyph:nth-child(4) { color: var(--sky); font-size: 2.2rem; transform: rotate(12deg) translateY(8px); animation-delay: -4.4s; }
.home-glyph:nth-child(5) { color: var(--violet); font-size: 2.45rem; transform: rotate(-7deg) translateY(-2px); animation-delay: -2.5s; }

@keyframes glyph-bob {
  0%,
  100% { translate: 0 0; }
  50% { translate: 0 -7px; }
}

@media (prefers-reduced-motion: reduce) {
  .home-glyph {
    animation: none;
  }
}

.btn {
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  font-size: 1rem;
  padding: 12px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--ink);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn.primary {
  background: var(--pink);
  color: #fff;
}

.btn.ghost {
  background: #fff;
  width: 100%;
}

.btn.xl {
  width: 100%;
  padding: 16px 18px;
  font-size: 1.15rem;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: 4px 4px 0 var(--ink);
}

.play-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.round-label {
  margin: 0;
  font-weight: 800;
  white-space: nowrap;
}

.ask {
  text-align: center;
  margin: 4px 0 8px;
}

.swirl-stage {
  position: relative;
  height: 280px;
  display: grid;
  place-items: center;
  margin: 4px 0 18px;
}

.swirl-glow {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: var(--swirl, #ff6b9a);
  filter: blur(28px);
  opacity: 0.4;
  pointer-events: none;
  transition: background 0.4s ease, opacity 0.4s ease;
}

.swirl-stage.is-mixing .swirl-glow {
  background: #ffb3d4;
  opacity: 0.45;
}

.swirl,
.mini-swirl {
  --swirl: #fff8f1;
  border-radius: 50%;
  border: 4px solid var(--ink);
  background: var(--swirl);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.2),
    0 12px 0 rgba(42, 18, 72, 0.12);
}

.swirl {
  width: min(64vw, 230px);
  height: min(64vw, 230px);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.glyph-disc {
  display: grid;
  place-items: center;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  user-select: none;
}

#glyph {
  font-size: clamp(4.4rem, 18vw, 6.6rem);
}

.mini-swirl.glyph-disc {
  font-size: 2.1rem;
}

.glyph-char {
  position: relative;
  z-index: 1;
}

.glyph-mix {
  display: none;
  position: absolute;
  inset: 10%;
  pointer-events: none;
}

.swirl.is-mixing .glyph-mix {
  display: block;
}

.swirl.is-mixing .glyph-char {
  opacity: 0;
}

.mix-orbit {
  position: absolute;
  inset: 0;
  animation: spin 1.05s linear infinite;
}

.mix-orbit i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.2em;
  margin: -0.55em 0 0 -0.6em;
  font-style: normal;
  font-weight: 700;
  font-size: clamp(1.15rem, 4.2vw, 1.55rem);
  line-height: 1;
  color: var(--ink);
  transform: rotate(calc(var(--i) * 45deg)) translateY(-78px) rotate(calc(var(--i) * -45deg));
}

.mix-orbit i:nth-child(1) { color: var(--mint); }
.mix-orbit i:nth-child(2) { color: var(--gold); }
.mix-orbit i:nth-child(3) { color: var(--pink); }
.mix-orbit i:nth-child(4) { color: var(--sky); }
.mix-orbit i:nth-child(5) { color: var(--violet); }
.mix-orbit i:nth-child(6) { color: var(--pink); }
.mix-orbit i:nth-child(7) { color: var(--mint); }
.mix-orbit i:nth-child(8) { color: var(--sky); }

.swirl.is-ready {
  animation: settle 0.45s ease;
}

@keyframes settle {
  0% {
    transform: scale(0.92);
  }
  55% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.swirl-orbit {
  position: absolute;
  width: min(78vw, 280px);
  height: min(78vw, 280px);
  pointer-events: none;
  animation: spin 18s linear infinite reverse;
}

.spark {
  position: absolute;
  font-size: 1.1rem;
  color: var(--ink);
}

.s1 { top: 8%; left: 46%; }
.s2 { top: 48%; right: 4%; color: var(--pink); }
.s3 { bottom: 10%; left: 40%; color: var(--mint); }
.s4 { top: 40%; left: 2%; color: var(--sky); }

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .swirl.is-ready,
  .swirl-orbit,
  .mix-orbit {
    animation: none;
  }

  .swirl.is-mixing .glyph-mix {
    display: none;
  }

  .swirl.is-mixing .glyph-char {
    opacity: 1;
  }
}

.pips {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 0 0 6px;
}

.pips i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(42, 18, 72, 0.18);
  border: 1.5px solid var(--ink);
}

.pips i.is-done {
  background: var(--mint);
}

.pips i.is-now {
  background: var(--pink);
  transform: scale(1.25);
}

.choices {
  display: grid;
  gap: 10px;
}

.choice {
  width: 100%;
  border: 2.5px solid var(--ink);
  border-radius: 18px;
  background: #fff;
  color: inherit;
  font-weight: 700;
  font-size: 1.12rem;
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  box-shadow: 3px 3px 0 var(--ink);
}

.choice:hover,
.choice:focus-visible {
  background: #f7f3ff;
  outline: 3px solid var(--mint);
  outline-offset: 2px;
}

.choice:disabled {
  cursor: wait;
  opacity: 0.7;
}

.choice .choice-sample {
  float: right;
  font-size: 1.2rem;
  line-height: 1;
  opacity: 0.88;
}

.reveal-card {
  text-align: center;
}

.reveal-badge {
  width: 72px;
  height: 72px;
  margin: 0 auto 10px;
  border-radius: 24px;
  border: 3px solid var(--ink);
  display: grid;
  place-items: center;
  font-size: 2rem;
}

.reveal-badge.is-yes {
  background: #b8f3d8;
}

.reveal-badge.is-no {
  background: #ffd0d8;
}

.reveal-title {
  font-size: 2rem !important;
}

.guess-echo {
  color: var(--ink-soft);
  margin: 0 0 18px;
}

.answer-block {
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  background: #f4edff;
  border: 2.5px solid var(--ink);
  border-radius: 22px;
  padding: 14px;
  margin-bottom: 16px;
}

.mini-swirl {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.answer-copy {
  flex: 1;
  min-width: 0;
}

.answer-name {
  margin: 0;
  font-family: "Fredoka", "Nunito", sans-serif;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 500;
  line-height: 1.1;
  word-break: break-word;
}

.answer-say {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-weight: 800;
}

.flag-block {
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 22px;
  padding: 14px 12px 12px;
  margin-bottom: 20px;
}

.flag-label {
  margin: 0 0 10px;
  font-weight: 800;
  color: var(--ink-soft);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.flag-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 12px;
}

.flag-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 72px;
}

.flag-chip img {
  width: 56px;
  height: 42px;
  object-fit: cover;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #eee;
}

.flag-chip span {
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--ink);
}

.results-card {
  text-align: center;
}

.trophy {
  font-size: 3rem;
  filter: drop-shadow(0 6px 0 rgba(42, 18, 72, 0.12));
}

.scoreboard {
  display: grid;
  gap: 10px;
  margin: 8px 0 22px;
}

.score-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  align-items: center;
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 18px;
  padding: 12px 14px;
}

.score-row.is-winner {
  background: #fff3c4;
}

.rank {
  font-weight: 800;
  font-size: 1.35rem;
  width: 36px;
  text-align: center;
}

.score-row .pts {
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
}

.result-actions {
  display: grid;
  gap: 10px;
}

footer {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
  padding: 0 16px 12px;
}

footer .copyright {
  margin-top: 8px;
}

.sheet-link,
.brand-link {
  color: inherit;
  text-decoration: none;
}

.sheet-link {
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
}

.sheet-overlay[hidden] {
  display: none;
}

body.sheet-open {
  overflow: hidden;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(42, 18, 72, 0.48);
}

.sheet-panel {
  position: relative;
  width: 100%;
  height: 100%;
  max-height: none;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + var(--safe-top)) 18px 8px;
  flex-shrink: 0;
}

.sheet-head h2 {
  margin: 0;
  font-size: 1.7rem;
}

.sheet-close {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 2px solid var(--ink);
  background: #ffe3ea;
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.sheet-overlay .sheet-jump {
  flex-shrink: 0;
  padding: 0 16px 10px;
  margin-bottom: 0;
}

#sheet-levels {
  padding-bottom: 4px;
}

.sheet-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 20px calc(24px + var(--safe-bottom));
  -webkit-overflow-scrolling: touch;
}

.sheet-jump {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: flex-start;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.jump-btn {
  width: auto !important;
  padding: 8px 14px;
  font-size: 0.9rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.jump-btn.is-on {
  background: var(--ink);
  color: #fff;
}

.sheet-card {
  margin-bottom: 18px;
}

.sheet-card h2 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.sheet-card h2 small {
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.sheet-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.sheet-flags .flag-chip {
  width: 64px;
}

.sheet-flags .flag-chip img {
  width: 48px;
  height: 36px;
}

.letter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 10px;
}

.letter-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  padding: 10px 6px 8px;
  min-height: 92px;
}

.letter-cell .ch {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.15;
}

.letter-cell .say {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--ink-soft);
  text-align: center;
  line-height: 1.2;
}

.group-title {
  margin: 18px 0 10px;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.group-title:first-of-type {
  margin-top: 4px;
}

.sheet-page main {
  max-width: 760px;
}

@keyframes shake {
  0%,
  100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.shake {
  animation: shake 0.4s ease;
}

@media (max-width: 640px) {
  .copyright-header {
    max-width: 11rem;
    font-size: 0.62rem;
  }

  .floater.f5,
  .floater.f6 {
    display: none;
  }

  .card {
    padding: 20px 16px 22px;
    box-shadow: var(--shadow), 5px 5px 0 var(--ink);
  }

  .swirl-stage {
    height: 240px;
  }

  .answer-block {
    flex-direction: column;
    text-align: center;
  }

  .choices {
    position: sticky;
    bottom: calc(10px + var(--safe-bottom));
    z-index: 3;
    background: linear-gradient(to top, var(--card) 80%, transparent);
    padding-top: 10px;
  }

  .levels {
    grid-template-columns: 1fr;
  }

  .level-card {
    min-height: 0;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 12px 32px 12px 10px;
  }

  .level-copy {
    flex: 1;
  }

  .level-arrow {
    top: 50%;
    transform: translateY(-50%);
  }

  .level-card:hover .level-arrow {
    transform: translate(2px, -50%);
  }

  .level-swatches {
    margin: 0;
  }
}

@media (min-width: 860px) {
  .floater {
    width: 52px;
    height: 52px;
  }
}
