@font-face{font-family:Space Grotesk;src:url('/space-grotesk.woff2') format('woff2');font-weight:300 700;font-display:swap}
@font-face{font-family:Fraunces;src:url('/fraunces.woff2') format('woff2');font-weight:100 900;font-display:swap}

:root {
  color-scheme: light;
  --ink: #331527;
  --muted: #785264;
  --berry: #741b47;
  --deep: #511434;
  --accent: #ffb6ce;
  --cream: #fff9f5;
  --line: #e8c1d2;
  --display: Fraunces, Georgia, serif;
  --shadow: 0 18px 56px #721d4220;
  font: 16px/1.45 "Space Grotesk", system-ui, sans-serif;
  color: var(--ink);
  background: #fdf0f4;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; background: radial-gradient(ellipse at 70% 0%, #ffd6e2, transparent 55%), #fdf0f4; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 3px solid #a01461; outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, p, figure, ol, ul { margin: 0; }
h1, h2 { line-height: 1.06; letter-spacing: -.04em; }
ul, ol { padding: 0; list-style: none; }
small { color: var(--muted); }
.shell { width: min(1240px, calc(100% - 64px)); margin: 0 auto; }
.site-header { border-bottom: 1px solid #e5afc4; background: #fff3f8d9; }
.topbar { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.brand { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-weight: 700; letter-spacing: -.05em; font-size: 1.05rem; }
.brand > span:first-child { display: grid; place-items: center; margin-right: 5px; border-radius: 10px; background: var(--berry); color: #fff2f7; width: 34px; height: 34px; font-size: 1.45rem; }
.brand-quiz { color: #9d396b; }
#navigation { display: flex; align-items: center; gap: 10px; }
.nav-link { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fffafb; color: var(--deep); white-space: nowrap; font-weight: 700; font-size: .85rem; }
.nav-link:hover { background: #fbe2ed; }
#app { padding: 34px 0 42px; }
.paper { border: 1px solid var(--line); background: var(--cream); border-radius: 24px; box-shadow: var(--shadow); }
.enter { animation: enter .38s cubic-bezier(.2,.76,.38,1) both; }
@keyframes enter { from { opacity: 0; transform: translateY(9px) scale(.99); } }
.center { text-align: center; }
.eyebrow { display: inline-flex; gap: 9px; align-items: center; font-size: .76rem; letter-spacing: .13em; font-weight: 700; }
.live-dot { display: inline-block; width: 8px; height: 8px; flex: 0 0 8px; vertical-align: .12em; border-radius: 50%; background: #d63378; box-shadow: 0 0 0 3px #d6337820; }

.hero { display: grid; grid-template-columns: 1.48fr 1fr; gap: 20px; }
.hero-copy { position: relative; isolation: isolate; overflow: hidden; min-height: 485px; padding: clamp(33px, 5.3vw, 72px); display: flex; flex-direction: column; justify-content: center; background: #ffc4d3 url('/mix-ups.webp') center/cover; border: 1px solid #e99db6; border-radius: 26px; box-shadow: var(--shadow); }
.hero-copy::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, #ffd9e2f7, #ffdce3e0 44%, #ffe1e52b 87%); }
.hero-copy .eyebrow { color: #6b1e44; margin-bottom: 20px; }
.hero-copy h1 { position: relative; z-index: 1; width: fit-content; white-space: nowrap; font: 800 clamp(3.4rem, 7.3vw, 7rem)/.86 var(--display); letter-spacing: -.085em; }
.hero-copy h1 em { display: inline-block; margin: .09em 0 .13em; color: #92275b; font-style: normal; }
.hero-copy p { position: relative; z-index: 1; color: #58283f; font-size: clamp(1.05rem, 1.65vw, 1.28rem); font-weight: 600; width: fit-content; }
.entry { padding: clamp(25px, 3.7vw, 48px); display: flex; flex-direction: column; justify-content: center; }
.entry-icon { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 11px; color: #892256; background: #ffdfeb; font-size: 1.55rem; margin-bottom: 15px; }
.entry h2 { font: 750 clamp(2.4rem, 4.4vw, 3.65rem)/1 var(--display); letter-spacing: -.072em; }
.entry p { color: var(--muted); margin: 10px 0 21px; max-width: 28ch; }
form label { display: block; color: var(--deep); font-size: .91rem; font-weight: 700; margin-bottom: 6px; }
input, textarea, select { width: 100%; padding: 11px 13px; border: 1px solid #d8a9bf; border-radius: 10px; background: #fffdfd; color: var(--ink); }
input::placeholder, textarea::placeholder { color: #8f6b7c; }
input:focus, textarea:focus, select:focus { border-color: var(--berry); }
.code-input { letter-spacing: .27em; font-weight: 700; font-variant-numeric: tabular-nums; }
.entry input { margin-bottom: 13px; }
.entry .button { width: 100%; }
.entry-link { width: fit-content; color: #761c48; font-size: .9rem; font-weight: 700; margin-top: 17px; }
.entry-link:hover { text-decoration: underline; }
.entry-link span { margin-left: 3px; }
.entry .form-error { color: #a71346; font-size: .87rem; font-weight: 700; margin: 8px 0 0; max-width: none; }

.button { display: inline-flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 47px; padding: 11px 17px; border: 1px solid transparent; border-radius: 11px; font-weight: 700; text-align: left; transition: background .16s, transform .16s, box-shadow .16s; }
.button span { font-size: 1.17em; }
.button:not(:disabled):hover { transform: translateY(-2px); }
.button:not(:disabled):active { transform: translateY(1px); }
.button-dark, .button-lime { color: #fff5fa; background: var(--berry); box-shadow: 0 4px 0 #521232; }
.button-dark:not(:disabled):hover, .button-lime:not(:disabled):hover { background: #8f285b; box-shadow: 0 6px 0 #521232; }
.button-outline, .button-ghost { color: var(--deep); border-color: #dca9bf; background: #fff8fa; }
.button-outline:hover, .button-ghost:hover { background: #ffe2ed; }

.round-strip { margin-top: 34px; }
.round-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.round-heading h2 { font-weight: 700; font-size: 1.05rem; }
.round-heading span { color: var(--muted); font-size: .82rem; }
.round-strip ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.color-0 { --tile: #ffc1d6; --mark: #6e1b49; --edge: #e397b4; }
.color-1 { --tile: #fbdfb9; --mark: #643712; --edge: #e4b788; }
.color-2 { --tile: #ecd8f7; --mark: #562772; --edge: #cfb4e3; }
.color-3 { --tile: #dfeecf; --mark: #324c28; --edge: #bacfa4; }
.round-chip { display: flex; align-items: center; gap: 12px; min-height: 74px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff8fa; }
.round-glyph, .avatar { flex: 0 0 auto; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--tile); color: var(--mark); font-size: 1.22rem; }
.round-chip strong, .round-chip small { display: block; }
.round-chip small { line-height: 1.2; margin-top: 3px; }

.lobby { display: grid; grid-template-columns: 1fr 1.15fr; gap: 20px; }
.lobby-invite { min-height: 510px; text-align: center; padding: 38px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.lobby-invite h1, .intro h1, .podium h1 { font: 800 clamp(2.9rem, 6.5vw, 6.3rem)/.98 var(--display); letter-spacing: -.075em; }
.lobby-invite h1 { margin: 10px 0; }
.lobby-invite p { color: var(--muted); }
.invite-code { display: flex; gap: .03em; align-items: center; font-size: clamp(2.65rem, 7vw, 6rem); font-weight: 700; letter-spacing: -.085em; line-height: 1.12; margin: 15px 0; font-variant-numeric: tabular-nums; }
.invite-code span { width: .25em; }
.qr { color: var(--ink); background: #fff; width: 150px; height: 150px; border-radius: 11px; padding: 5px; margin-bottom: 20px; border: 1px solid var(--line); }
.qr svg { width: 100%; height: 100%; }
.lobby-players { display: flex; flex-direction: column; border-radius: 24px; padding: clamp(22px, 4vw, 43px); background: linear-gradient(#fff0f4e8,#fff1f5ee), url('/mix-ups.webp') center/cover; border: 1px solid var(--line); }
.lobby-meta, .question-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lobby-players h2 { margin-top: 25px; font: 740 clamp(2rem, 4vw, 3.6rem)/1 var(--display); letter-spacing: -.06em; }
.pill { display: inline-flex; align-items: center; gap: 7px; background: #ffe4ed; border: 1px solid #e8bace; color: var(--deep); border-radius: 999px; padding: 6px 12px; font-size: .83rem; font-weight: 700; }
.people { margin: 17px 0 22px; flex: 1; min-height: 125px; }
.people ul { display: flex; flex-wrap: wrap; gap: 9px; max-height: 320px; overflow-y: auto; }
.people p { color: var(--muted); }
.player-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px 5px 5px; background: #fff9fc; border: 1px solid var(--line); border-radius: 12px; font-weight: 700; overflow-wrap: anywhere; }
.player-chip .avatar { width: 29px; height: 29px; }
.lobby-players .button { align-self: flex-start; min-width: 175px; }
.intro { position: relative; isolation: isolate; min-height: min(66vh, 640px); display: grid; justify-items: center; align-content: center; gap: 16px; padding: 45px 16px; border-radius: 25px; border: 1px solid #e6a7bf; background: #ffd8e0 url('/mix-ups.webp') center/cover; }
.intro::before { content: ''; position: absolute; z-index: -1; inset: 0; border-radius: inherit; background: radial-gradient(ellipse, #ffdee4 16%, #ffdee4b8 52%, #ffdee422); }
.intro-icon { color: var(--mark); background: var(--tile); border: 1px solid var(--edge); display: grid; place-items: center; border-radius: 18px; width: 65px; height: 65px; font-size: 2.1rem; animation: float 3.6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-7px) rotate(-5deg); } }
.intro p { color: var(--deep); font-weight: 600; }

.game { width: min(100%, 1130px); margin: 0 auto; }
.question-count { font-weight: 700; font-size: .94rem; color: var(--deep); white-space: nowrap; }
.time-row { display: flex; align-items: center; gap: 14px; margin: 13px 0 18px; }
.time-track { flex: 1; height: 10px; border-radius: 10px; background: #ead0dd; overflow: hidden; }
#timer-bar { height: 100%; transform-origin: left; background: #b82a6c; transition: transform .12s linear; border-radius: 10px; }
#timer-bar.urgent { background: #d13b4c; }
.time-number { min-width: 45px; text-align: right; font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.question-card { background: #fffdfd; padding: clamp(17px, 3.1vw, 37px); }
.makeup-slide .question-card { background: linear-gradient(90deg,#ffdee8e8,#ffdee8bc), url('/mix-ups.webp') center/cover; }
.question-body { display: grid; align-items: center; min-height: 135px; }
.question-body h1 { font-size: clamp(1.7rem, 4.2vw, 3.75rem); font-weight: 700; text-wrap: balance; }
.question-body.with-photo { grid-template-columns: 1.1fr .85fr; gap: 22px; }
.question-photo { display: grid; place-items: center; overflow: hidden; width: 100%; height: clamp(170px, 36dvh, 370px); border: 1px solid #efc8d9; border-radius: 14px; background: #fff; }
.question-photo img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.question-photo img:not([src]) { visibility: hidden; }
.centered-photo-slide .question-body { grid-template-columns: 1fr; justify-items: center; gap: 15px; }
.centered-photo-slide .question-photo { width: min(100%, 500px); height: clamp(200px, 44dvh, 420px); }
.centered-photo-slide .typed-hint { text-align: center; }
.options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 17px; }
.option { position: relative; display: flex; align-items: center; gap: 12px; min-height: 61px; padding: 11px 13px; border: 1px solid var(--edge); border-radius: 12px; color: var(--mark); background: var(--tile); font-weight: 700; text-align: left; overflow-wrap: anywhere; }
button.option:hover { filter: saturate(1.28); box-shadow: 0 3px 0 var(--edge); }
button.option:active { transform: scale(.985); }
.option-glyph { display: grid; place-items: center; flex: 0 0 32px; height: 32px; border-radius: 8px; color: #fff; background: var(--mark); font-size: 1rem; }
.option-text { flex: 1; }
.option.correct { outline: 2px solid #376433; outline-offset: 1px; }
.option.muted { filter: saturate(.6); }
.option-count { flex: 0 0 auto; }
.typed-hint { color: var(--deep); font-weight: 600; margin-top: 16px; }
.game-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; color: var(--deep); }
.game-footer > .button:only-child { margin-left: auto; }
.game-footer .live-dot { margin-right: 4px; }
.player-game { max-width: 520px; }
.player-game h1, .player-card h1, .review-heading h1 { font: 750 clamp(2.3rem, 5vw, 4.2rem)/1.03 var(--display); letter-spacing: -.067em; }
.player-game .option { min-height: 92px; }
.player-hint, .review-heading p { color: var(--muted); margin-top: 9px; }
.answer-form { margin-top: 17px; padding: 20px; }
.answer-form .button { width: 100%; margin-top: 14px; }
.answer-form small { display: block; }
.player-card { margin: min(8vh,65px) auto 0; max-width: 530px; min-height: 340px; padding: 35px 20px; display: grid; justify-items: center; align-content: center; gap: 14px; }
.status-symbol { display: grid; place-items: center; background: #ffd5e5; color: var(--berry); border-radius: 19px; width: 64px; height: 64px; font-size: 2rem; animation: float 3.6s ease-in-out infinite; }
.player-card p { color: var(--muted); max-width: 34ch; }
.personal-score { display: flex; gap: 10px; margin-top: 7px; }
.personal-score span { background: #ffe7ef; border: 1px solid var(--line); padding: 8px 12px; border-radius: 10px; }
.player-name { max-width: 210px; overflow: hidden; }

.review-heading { margin: 15px 0; }
.reference { color: var(--deep); margin: 10px 0; }
.reference summary, .all-ranks summary, .final-card summary { cursor: pointer; font-weight: 700; }
.reference p { margin: 5px 0 0 15px; }
.grading { padding: 7px 20px; max-height: 53dvh; overflow: auto; }
.grade-row { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 10px 0; }
.grade-row + .grade-row { border-top: 1px solid #f0d9e3; }
.grade-row strong, .grade-row small { display: block; overflow-wrap: anywhere; }
.verdicts { display: flex; gap: 5px; flex: 0 0 auto; }
.grade-toggle { border: 1px solid var(--line); padding: 7px 11px; border-radius: 8px; background: #fff; font-weight: 700; }
.grade-toggle.accept.selected { background: #dfecd7; border-color: #83a97b; color: #29542c; }
.grade-toggle.reject.selected { background: #fbd6df; border-color: #c57b89; color: #841e3b; }
.results-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 13px; margin-top: 15px; }
.solution, .ranking { padding: clamp(18px,3vw,32px); }
.solution h1 { font-size: clamp(1.55rem, 4.3vw, 3.95rem); margin: 9px 0; overflow-wrap: anywhere; }
.solution p { color: var(--muted); }
.solution .question-photo { margin-top: 12px; width: min(100%, 320px); height: min(26vh, 195px); }
.leaders { margin-top: 13px; display: grid; gap: 6px; }
.leaders li { display: grid; grid-template-columns: 18px 30px minmax(0,1fr) auto; gap: 7px; align-items: center; border-radius: 10px; background: #fff0f5; color: var(--deep); padding: 7px; text-align: left; }
.leaders .avatar { width: 28px; height: 28px; }
.leaders li strong { overflow-wrap: anywhere; }
.rank { text-align: center; font-weight: 700; }

.podium { position: relative; overflow: hidden; padding: 20px 0 5px; }
.podium h1 { margin: 9px 0 13px; }
.pedestals { margin: 23px auto; display: flex; justify-content: center; align-items: flex-end; gap: 8px; width: min(100%, 570px); }
.pedestal { width: 33.33%; max-width: 185px; color: var(--mark); display: grid; justify-items: center; align-content: end; overflow-wrap: anywhere; }
.pedestal strong { max-width: 100%; }
.pedestal .avatar { margin-bottom: 6px; border-radius: 50%; width: 39px; height: 39px; }
.pedestal > div { width: 100%; min-height: clamp(75px, 16vh, 155px); border: 1px solid var(--edge); border-radius: 13px 13px 0 0; margin-top: 7px; background: var(--tile); font: 700 2.2rem/1 var(--display); display: grid; place-items: center; }
.pedestal.place-1 > div { min-height: clamp(120px, 22vh, 195px); }
.pedestal.place-3 > div { min-height: clamp(52px, 12vh, 116px); }
.all-ranks { max-width: 570px; margin: 0 auto 18px; padding: 10px 14px; }
.final-card { max-width: 540px; margin: 0 auto 17px; }
.final-card img { width: 100%; border-radius: 12px; margin-top: 8px; }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i { position: absolute; width: 9px; height: 15px; left: var(--left); top: -20px; background: var(--mark); animation: fall 3.6s var(--delay) ease-out both; }
@keyframes fall { 0% { transform: rotate(0); opacity: .85; } 100% { transform: translate(35px, 63vh) rotate(var(--turn)); opacity: 0; } }
.toast { position: fixed; z-index: 3; bottom: 16px; right: 16px; max-width: min(410px, calc(100% - 32px)); padding: 12px 17px; border-radius: 11px; color: #fff; background: var(--deep); box-shadow: var(--shadow); }

.admin { max-width: 880px; margin: auto; }
.admin > h1 { font: 760 clamp(2.55rem,6vw,4.8rem)/1 var(--display); letter-spacing: -.065em; margin-bottom: 10px; }
.admin > p { color: var(--muted); margin-bottom: 18px; }
.admin-login { padding: 25px; max-width: 400px; }
.admin-login button { margin-top: 12px; }
.admin section { margin: 20px 0; }
.admin section h2 { font-size: 1.4rem; margin-bottom: 10px; }
.admin details { padding: 11px 14px; margin-bottom: 6px; border-radius: 11px; background: #fffafd; border: 1px solid var(--line); }
.admin details summary { cursor: pointer; font-weight: 700; }
.admin details form { margin-top: 12px; }
.admin-photo { display: block; max-width: 100%; max-height: 155px; margin: 0 0 10px; border-radius: 9px; }
.admin details small { display: block; margin-top: 7px; }
.admin details button { margin-top: 10px; }
.admin-message { margin-top: 10px; color: var(--deep); font-weight: 700; }

@media (min-width: 760px) {
  .side-photo-slide .question-card { display: grid; grid-template-columns: 1.1fr .85fr; align-items: center; gap: 15px 24px; }
  .side-photo-slide .question-body { display: contents; }
  .side-photo-slide .question-photo { grid-area: 1 / 2 / 3 / 3; height: clamp(260px, 49dvh, 450px); }
  .side-photo-slide .options { margin-top: 0; grid-column: 1; grid-template-columns: 1fr; gap: 7px; }
  .side-photo-slide .option { min-height: 46px; padding-block: 7px; }
}
@media (max-width: 850px) {
  .shell { width: calc(100% - 36px); }
  .hero { grid-template-columns: 1fr 1fr; gap: 12px; }
  .hero-copy { min-height: 410px; }
  .round-strip ul { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 620px) {
  .shell { width: calc(100% - 28px); }
  #app { padding-top: 17px; }
  .topbar { min-height: 56px; }
  .brand { font-size: .89rem; gap: 3px; }
  .brand > span:first-child { width: 28px; height: 28px; border-radius: 8px; font-size: 1.1rem; margin-right: 3px; }
  .desktop-icon { display: none; }
  .nav-link { font-size: .77rem; gap: 4px; padding-inline: 7px; }
  .player-name { max-width: min(23vw, 150px); white-space: nowrap; font-size: .75rem; padding: 5px 7px; }
  #navigation { gap: 5px; }
  .hero, .lobby, .results-grid { grid-template-columns: 1fr; gap: 12px; }
  .hero-copy { min-height: 202px; padding: 18px 22px; border-radius: 19px; background-position: right center; }
  .hero-copy .eyebrow { margin-bottom: 12px; }
  .hero-copy h1 { font-size: clamp(2.85rem, 12vw, 4.5rem); }
  .hero-copy p { font-size: .94rem; }
  .entry { border-radius: 19px; padding: 19px; }
  .entry-icon { display: none; }
  .entry p { margin: 7px 0 13px; }
  .round-strip { margin-top: 22px; }
  .round-chip { padding: 7px; gap: 7px; font-size: .86rem; }
  .round-glyph { width: 28px; height: 28px; }
  .lobby-invite { min-height: 0; padding: 23px 12px; }
  .question-body.with-photo { grid-template-columns: 1fr; gap: 10px; }
  .question-body { min-height: 74px; }
  .options { gap: 7px; }
  .option { gap: 7px; padding: 8px; font-size: .88rem; }
  .option-glyph { flex-basis: 24px; height: 24px; }
  .grade-toggle { padding: 5px 7px; font-size: .83rem; }
  .grading { padding: 5px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .confetti { display: none; }
}
