:root {
  --paper: #f6f1e9;
  --ink: #292622;
  --muted: #8c867e;
  --line: #ded7cd;
  --acid: #d8ff4f;
  --coral: #ff8e75;
  --sky: #a6d7ff;
  --lilac: #cbb8ff;
  --mint: #9de6cb;
  --yellow: #ffe27c;
  --pink: #ffb5d3;
  --cream: #f8d9ad;
  --white: #fffdfa;
  --shadow: 0 18px 50px rgba(52, 45, 38, .09);
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; color: var(--ink); font-family: Outfit, ui-sans-serif, system-ui, sans-serif; }
button, a { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }

.app-shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 26px 0 48px; }
.topbar { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 14px; font-weight: 700; letter-spacing: .08em; text-decoration: none; }
.wordmark b { font-weight: 800; }
.wordmark-mark { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: var(--ink); color: var(--acid); font-family: 'DM Mono', monospace; font-size: 17px; }
.topbar-note, .label, .eyebrow, .how-index, #progress-label { color: var(--muted); font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: .13em; }
.topbar-note span { color: var(--coral); font-size: 15px; }

.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; padding: 72px 0 42px; }
.eyebrow { color: var(--coral); margin: 0 0 14px; }
h1 { max-width: 700px; margin: 0; font-size: clamp(42px, 7vw, 82px); letter-spacing: -.065em; line-height: .98; }
h1 em { color: #6c665f; font-style: normal; }
.lede { max-width: 450px; margin: 24px 0 0; color: #6d665e; font-size: 16px; line-height: 1.65; }
.hero-sticker { position: relative; display: grid; width: 178px; height: 178px; flex: 0 0 auto; place-items: center; transform: rotate(7deg); border-radius: 42% 58% 55% 45% / 55% 44% 56% 45%; background: var(--acid); box-shadow: 8px 10px 0 var(--ink); }
.sticker-star { position: absolute; top: 20px; right: 27px; font-size: 28px; }
.sticker-number { margin-top: 12px; font-size: 90px; font-weight: 800; letter-spacing: -.1em; line-height: .75; }
.sticker-caption { position: absolute; bottom: 25px; left: 32px; font-family: 'DM Mono', monospace; font-size: 10px; line-height: 1.3; text-transform: uppercase; }

.score-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-bottom: 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.score-row > div { display: flex; align-items: baseline; justify-content: space-between; padding: 15px 18px; border-right: 1px solid var(--line); }
.score-row > div:last-child { border-right: 0; }
.score-row strong { font-family: 'DM Mono', monospace; font-size: 18px; font-weight: 500; }

.game-card { padding: clamp(20px, 4vw, 40px); border: 1px solid var(--line); border-radius: 26px; background: var(--white); box-shadow: var(--shadow); }
.game-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.game-card h2 { margin: 8px 0 0; font-size: clamp(22px, 3vw, 32px); letter-spacing: -.04em; }
.progress-wrap { width: min(180px, 35%); padding-top: 4px; text-align: right; }
#progress-label { display: block; margin-bottom: 8px; }
.progress-track { height: 5px; overflow: hidden; border-radius: 5px; background: #ebe5db; }
#progress-bar { display: block; width: 0%; height: 100%; border-radius: inherit; background: var(--coral); transition: width .3s ease; }

.members-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.member { position: relative; min-height: 184px; padding: 15px; overflow: hidden; border: 1px solid transparent; border-radius: 20px; color: var(--ink); text-align: left; transition: transform .18s ease, border-color .18s ease, filter .18s ease, opacity .18s ease; }
.member::after { position: absolute; right: -15px; bottom: -28px; width: 98px; height: 98px; border-radius: 50%; background: rgba(255,255,255,.3); content: ''; }
.member:hover:not(:disabled) { transform: translateY(-4px) rotate(-1deg); border-color: var(--ink); }
.member:disabled { cursor: default; }
.member.is-dimmed { opacity: .44; filter: saturate(.5); }
.member.is-lit { transform: translateY(-5px) scale(1.03); border-color: var(--ink); box-shadow: 5px 6px 0 var(--ink); filter: saturate(1.15); }
.member.is-correct { animation: correct .34s ease; }
.member.is-wrong { animation: wrong .34s ease; }
.member-badge { position: relative; z-index: 1; display: grid; width: 78px; height: 78px; place-items: center; overflow: hidden; border: 2px solid var(--ink); border-radius: 44% 56% 54% 46%; background: var(--white); }
.member-badge img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.member-name { position: relative; z-index: 1; display: block; margin-top: 12px; font-size: 14px; font-weight: 800; letter-spacing: .02em; }
.member-alias { position: relative; z-index: 1; display: block; margin-top: 2px; color: rgba(41,38,34,.74); font-size: 12px; font-weight: 700; }
.member-tag { position: relative; z-index: 1; display: block; margin-top: 4px; color: rgba(41,38,34,.62); font-family: 'DM Mono', monospace; font-size: 8px; letter-spacing: .04em; text-transform: uppercase; }

.game-actions { display: flex; align-items: center; gap: 18px; padding-top: 28px; }
.primary-button { min-height: 52px; padding: 0 22px; border: 2px solid var(--ink); border-radius: 999px; background: var(--ink); color: var(--acid); font-size: 14px; font-weight: 700; transition: transform .18s ease, box-shadow .18s ease; }
.primary-button:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--acid); }
.primary-button span { display: inline-block; margin-left: 10px; font-size: 18px; }
.text-button { border: 0; background: transparent; color: var(--muted); font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: .08em; }
.text-button:hover { color: var(--ink); }

.how-to { display: grid; grid-template-columns: 90px 1fr auto; align-items: center; gap: 30px; padding-top: 26px; }
.how-to ol { display: flex; gap: 28px; margin: 0; padding: 0; list-style: none; }
.how-to li { display: flex; align-items: baseline; gap: 8px; color: var(--muted); font-size: 13px; }
.how-to li b { color: var(--ink); font-size: 17px; }
.legal-note { max-width: 250px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.4; text-align: right; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 2; padding: 12px 16px; border-radius: 999px; background: var(--ink); color: var(--acid); font-family: 'DM Mono', monospace; font-size: 11px; opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .2s ease, transform .2s ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

@keyframes correct { 50% { transform: scale(1.05); } }
@keyframes wrong { 25%, 75% { transform: translateX(-5px); } 50% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 380px) {
  .members-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  .app-shell { width: min(100% - 24px, 560px); padding-top: 18px; }
  .topbar-note { display: none; }
  .hero { align-items: flex-start; padding: 52px 0 30px; }
  .hero-sticker { width: 104px; height: 104px; border-radius: 35%; box-shadow: 5px 6px 0 var(--ink); }
  .sticker-number { font-size: 55px; }
  .sticker-star { top: 10px; right: 15px; font-size: 18px; }
  .sticker-caption { bottom: 13px; left: 17px; font-size: 7px; }
  .lede { font-size: 14px; }
  .score-row > div { display: block; padding: 12px 10px; }
  .score-row strong { display: block; margin-top: 7px; font-size: 15px; }
  .members-grid { gap: 8px; }
  .member { min-height: 136px; padding: 10px; border-radius: 15px; }
  .member-badge { width: 54px; height: 54px; }
  .member-name { margin-top: 8px; font-size: 10px; }
  .member-alias { font-size: 10px; }
  .member-tag { font-size: 6px; letter-spacing: .02em; }
  .game-card-head { margin-bottom: 20px; }
  .progress-wrap { width: 30%; }
  .how-to { display: block; }
  .how-to ol { flex-wrap: wrap; gap: 10px 20px; margin-top: 16px; }
  .legal-note { max-width: none; margin-top: 24px; text-align: left; }
}
