@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Instrument+Serif:ital@0;1&display=swap');

:root {
  color-scheme: light;
  --ground: #f7f3e9;
  --white: #fffdf8;
  --forest: #153a30;
  --green: #235142;
  --dark: #172a22;
  --muted: #59665e;
  --line: #dddcd0;
  --acid: #e5ecac;
  --serif: "Instrument Serif", Georgia, serif;
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--dark);
  background: var(--ground);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body { margin: 0; min-height: 100vh; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #638f48; outline-offset: 3px; }
.site { max-width: 1260px; padding: 0 48px; margin: auto; }
.topbar, footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar { min-height: 88px; border-bottom: 1px solid var(--line); }
.topbar a { text-decoration: none; }
.brand { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; }
.brand > span:last-child { color: var(--muted); font-weight: 500; }
.brand-mark { background: var(--forest); color: var(--acid); width: 35px; height: 35px; border-radius: 11px; display: grid; place-items: center; margin-right: 4px; }
.parent-link { font-size: 14px; }
.parent-link span { margin-left: 4px; }
main { margin: clamp(32px, 6vw, 80px) 0; }
.home { display: grid; grid-template-columns: 1.45fr 1fr; gap: 22px; align-items: stretch; }
.hero { position: relative; overflow: hidden; background: var(--forest); color: var(--white); border-radius: 26px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; padding: clamp(28px, 4.5vw, 58px); min-height: 500px; isolation: isolate; }
.hero-copy { position: relative; z-index: 1; }
.eyebrow { margin: 0 0 20px; font-size: .72rem; letter-spacing: .17em; font-weight: 700; }
.hero .eyebrow { color: var(--acid); }
h1, h2, p { margin-top: 0; }
h1, h2 { font-family: var(--serif); font-weight: 400; }
.hero h1 { margin: 0 0 15px; font-size: clamp(4.25rem, 7.8vw, 7.5rem); line-height: .9; letter-spacing: -.025em; }
.hero h1 em { color: var(--acid); }
.hero-copy > p:last-child { max-width: 19rem; line-height: 1.55; color: #e4eadf; margin-bottom: 0; }
.hero-details { display: flex; flex-wrap: wrap; gap: 12px 22px; color: #e4eadf; font-size: .81rem; position: relative; z-index: 1; }
.hero-details span::before { content: '✦'; color: var(--acid); margin-right: 7px; }
.art { position: absolute; inset: auto 0 55px auto; width: min(53%, 330px); height: 240px; pointer-events: none; }
.orbit { position: absolute; inset: -15px -54px 0 15px; border: 1px solid #748d69; border-radius: 50%; transform: rotate(-29deg); opacity: .55; }
.card-front, .card-back { position: absolute; width: 43%; min-width: 94px; height: 72%; border-radius: 17px; top: 15%; left: 30%; }
.card-back { transform: translate(-25%, 6%) rotate(-24deg); background: #41735f; border: 1px solid #92ae8b; }
.card-front { color: var(--forest); background: var(--acid); transform: rotate(15deg); display: grid; grid-template-rows: auto 1fr auto; align-items: center; padding: 11px 13px; box-shadow: 5px 10px 30px #0a2821a0; }
.card-front strong { font: 6.4rem/.85 var(--serif); text-align: center; }
.card-corner:last-child { justify-self: end; }
.spark { position: absolute; font-size: 2rem; color: var(--acid); }
.spark-one { right: 14%; top: 3%; }
.spark-two { left: 8%; bottom: 10%; }
.entry, .panel { background: var(--white); border: 1px solid var(--line); border-radius: 26px; padding: clamp(23px, 3vw, 42px); }
.entry { display: flex; flex-direction: column; justify-content: center; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 5px; border-radius: 12px; background: var(--ground); margin-bottom: 25px; }
.mode-switch button { padding: 10px 4px; font-size: .86rem; font-weight: 700; border: 0; background: transparent; border-radius: 8px; }
.mode-switch button[aria-pressed=true] { background: var(--white); box-shadow: 0 1px 5px #26352716; }
.entry h2 { font-size: clamp(2.5rem, 4vw, 3.4rem); line-height: 1; margin-bottom: 7px; }
.entry > p { color: var(--muted); margin-bottom: 22px; font-size: .92rem; }
form, label { display: grid; gap: 12px; }
label { gap: 6px; font-size: .85rem; font-weight: 700; }
input, select { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; background: #fffefa; font-size: 1rem; }
#room-code { text-transform: uppercase; letter-spacing: .1em; }
#room-code::placeholder { text-transform: none; letter-spacing: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid transparent; border-radius: 10px; padding: 11px 17px; min-height: 46px; font-weight: 700; font-size: .91rem; }
.primary { background: var(--green); color: white; }
.primary:not(:disabled):hover { background: var(--forest); }
.secondary { background: var(--ground); border-color: var(--line); }
form .primary { margin-top: 5px; }
.game, .feedback { max-width: 860px; margin-inline: auto; }
.game-top, .game-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.game-top { margin-bottom: 18px; }
.game-meta, .round { color: var(--muted); font-size: .85rem; }
.panel h1 { font-size: clamp(2.8rem, 5vw, 4.6rem); line-height: .98; margin-bottom: 14px; }
.panel .question-title { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.game-actions { margin-top: 18px; justify-content: flex-start; }
.invite { display: inline-flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.room-code { background: var(--acid); border-radius: 10px; padding: 9px 14px; letter-spacing: .2em; font-size: clamp(1.25rem, 4vw, 1.8rem); font-weight: 700; }
.answer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.answer { display: flex; gap: 11px; align-items: center; text-align: left; padding: 13px; min-height: 61px; background: var(--ground); border: 1px solid var(--line); border-radius: 12px; font-weight: 600; }
.answer:not(:disabled):hover, .answer.selected { border-color: var(--green); background: #e9efde; }
.answer:disabled { opacity: 1; }
.answer.correct { border-color: #538252; background: #e2efda; }
.answer.incorrect { border-color: #b46759; background: #f8e4db; }
.letter { display: grid; place-items: center; flex: 0 0 29px; height: 29px; border-radius: 8px; background: var(--white); font-size: .83rem; }
.progress { height: 7px; width: 100%; accent-color: var(--green); margin-bottom: 18px; }
.notice { margin-top: 16px; background: #edf0db; border-radius: 10px; padding: 13px 15px; line-height: 1.5; }
.notice p { margin-bottom: 3px; }
.roster { list-style: none; padding: 0; margin: 0; }
.roster li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.roster li span:last-child { flex-shrink: 0; color: var(--muted); font-size: .86rem; }
.score-title { font-size: 2rem; margin: 18px 0 4px; }
.feedback { margin-top: 14px; padding: 12px 15px; background: #efe9d0; border-radius: 10px; }
footer { border-top: 1px solid var(--line); min-height: 68px; font-size: .8rem; color: var(--muted); }

@media (max-width: 850px) {
  .site { padding-inline: 24px; }
  .home { grid-template-columns: 1fr; max-width: 580px; margin: auto; gap: 14px; }
  .hero { min-height: 360px; }
  .art { bottom: 29px; }
}
@media (max-width: 500px) {
  .site { padding-inline: 15px; }
  .topbar { min-height: 65px; }
  main { margin-block: 20px; }
  .hero { min-height: 320px; border-radius: 19px; }
  .hero-copy > p:last-child { max-width: 13rem; font-size: .88rem; }
  .art { width: 39%; height: 153px; bottom: 26px; }
  .card-front, .card-back { min-width: 68px; left: 34%; border-radius: 11px; }
  .card-front { padding: 5px 7px; }
  .card-front strong { font-size: 3.8rem; }
  .spark { font-size: 1.2rem; }
  .entry, .panel { border-radius: 19px; }
  .answer-grid { grid-template-columns: 1fr; }
  footer { align-items: flex-start; justify-content: center; flex-direction: column; gap: 5px; }
}
