:root {
  color-scheme: light;
  --ink: #17271f;
  --muted: #64736a;
  --paper: #f4f5ef;
  --white: #fff;
  --green: #285844;
  --green-dark: #183d2d;
  --lime: #cce86c;
  --coral: #ec795f;
  --teal: #54b6a6;
  --line: #dfe5da;
  --shadow: 0 22px 70px #203e2d12;
  font-family: ui-rounded, "SF Pro Rounded", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at 75% 3%, #e4edcf 0, transparent 28rem), var(--paper); color: var(--ink); }
button, input { font: inherit; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #a8cf45; outline-offset: 3px; }
.topbar { max-width: 1120px; margin: auto; padding: 22px 28px; display: flex; align-items: center; justify-content: space-between; }
.brand, .home-link, .mini-home { color: inherit; text-decoration: none; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 12px; background: var(--green); color: #fff; font-family: serif; }
.home-link { color: var(--muted); font-size: 13px; }
.home-link span { margin-left: 4px; color: var(--green); }
.shell { max-width: 1120px; margin: auto; padding: 28px; }
.eyebrow { margin: 0 0 16px; color: #71806f; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.setup-screen { display: grid; grid-template-columns: minmax(0, 1fr) minmax(390px, 470px); gap: 70px; align-items: center; min-height: calc(100vh - 160px); }
.intro { padding: 20px 0; }
.intro h1 { margin: 0 0 22px; font-size: clamp(42px, 6vw, 70px); line-height: 1.06; letter-spacing: -.055em; }
.intro h1 em { color: var(--green); font-style: normal; }
.intro-copy { max-width: 500px; color: var(--muted); font-size: 16px; line-height: 1.85; }
.howto { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 36px; color: #4e6253; font-size: 12px; font-weight: 700; }
.howto b { color: #a2b19e; }
.setup-card, .handoff-card, .reveal-card, .result-card { border: 1px solid #e8ece4; border-radius: 24px; background: var(--white); box-shadow: var(--shadow); }
.setup-card { padding: 30px; }
.card-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.card-heading .eyebrow { margin-bottom: 6px; }
.card-heading h2 { margin: 0; font-size: 23px; }
.sparkle { color: var(--green); font-size: 28px; }
.field-label, .choice-set legend { color: #394d3e; font-size: 12px; font-weight: 800; }
.team-fields { display: flex; align-items: center; gap: 10px; margin: 10px 0 23px; }
.team-input { display: flex; flex: 1; min-width: 0; height: 48px; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line); border-radius: 12px; }
.team-input:focus-within { outline: 3px solid #a8cf45; outline-offset: 3px; border-color: var(--green); }
.team-input input { width: 100%; min-width: 0; border: 0; background: transparent; color: var(--ink); font-weight: 700; }
.team-dot { width: 9px; height: 9px; flex: none; border-radius: 50%; }
.coral { background: var(--coral); } .teal { background: var(--teal); }
.vs { color: #99a399; font-size: 10px; font-weight: 900; }
.choice-set { margin: 20px 0; padding: 0; border: 0; }
.choice-set legend { margin-bottom: 9px; }
.segmented { display: flex; gap: 6px; }
.segmented button, .pack-choice { border: 1px solid var(--line); border-radius: 10px; background: #fff; color: #5d6a5f; font-size: 12px; font-weight: 700; cursor: pointer; }
.segmented button { flex: 1; min-height: 40px; padding: 8px; }
.segmented button.selected, .pack-choice.selected { border-color: var(--green); background: var(--green); color: #fff; }
.pack-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pack-choice { min-height: 56px; padding: 9px 10px; display: flex; flex-direction: column; gap: 3px; text-align: left; }
.pack-choice small { font-size: 10px; font-weight: 500; line-height: 1.4; opacity: .8; }
.button { border: 0; border-radius: 12px; padding: 14px 18px; font-size: 14px; font-weight: 800; cursor: pointer; transition: transform .14s, filter .14s; }
.button:hover { filter: brightness(1.04); transform: translateY(-1px); }
.primary { background: var(--green); color: white; }
.primary:hover { background: var(--green-dark); }
.primary span { margin-left: 12px; color: var(--lime); }
.secondary { border: 1px solid var(--line); background: #fff; color: var(--green); }
.success { background: var(--lime); color: #1a3725; }
.wide { width: 100%; }
.storage-note, .content-note, .privacy-hint { color: #8a978b; font-size: 11px; line-height: 1.6; }
.storage-note { margin: 11px 0 0; text-align: center; }
.text-button { border: 0; padding: 8px; background: transparent; color: var(--green); font-size: 12px; font-weight: 800; cursor: pointer; }
.clear-button { display: block; margin: 5px auto 0; color: #a25948; }
.content-note { grid-column: 1 / -1; margin: -50px 0 0; text-align: center; }
.screen[hidden] { display: none !important; }
.stage-screen { display: flex; min-height: calc(100vh - 160px); flex-direction: column; }
.stage-top { display: flex; justify-content: space-between; align-items: center; margin: 0 0 36px; }
.mini-home { border: 0; padding: 4px 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.pill { display: inline-flex; border-radius: 999px; padding: 7px 11px; background: #eef3e8; color: var(--green); font-size: 11px; font-weight: 800; }
.handoff-card, .reveal-card { width: 100%; max-width: 570px; margin: auto; padding: 55px 38px; text-align: center; }
.handoff-icon { display: grid; width: 56px; height: 56px; place-items: center; margin: 0 auto 26px; border-radius: 18px; background: #edf4e8; color: var(--green); font-size: 25px; font-weight: 900; }
.handoff-card h1, .reveal-card h1, .result-card h1 { margin: 0 0 18px; font-size: clamp(34px, 7vw, 52px); line-height: 1.12; letter-spacing: -.04em; }
.handoff-card h1 span, .result-card h1 span { color: var(--green); }
.handoff-card p:not(.eyebrow), .reveal-card > p:not(.eyebrow) { max-width: 390px; margin: 0 auto 28px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.privacy-hint { margin: 18px; text-align: center; }
.reveal-card .eyebrow { margin-bottom: 18px; }
.reveal-card .button { margin-top: 10px; }
.peek-card { max-width: 390px; margin: 0 auto 22px; padding: 18px 12px; border: 1px solid var(--line); border-radius: 15px; background: #f7f8f4; }
.peek-word { margin: 0 0 14px; color: var(--green); font-size: 34px; font-weight: 900; }
.peek-card .hint { margin-bottom: 0; }
.play-screen { max-width: 760px; margin: auto; }
.play-head { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; margin: 0 0 22px; }
.active-team { margin: 7px 0 0; font-size: 15px; font-weight: 900; }
.timer { display: flex; width: 68px; height: 68px; justify-content: center; align-items: center; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 7px #dce8d7; color: #fff; font-size: 27px; font-weight: 900; font-variant-numeric: tabular-nums; }
.timer small { margin: 6px 0 0 3px; font-size: 10px; }
.timer.urgent { background: #b8543e; box-shadow: 0 0 0 7px #f4dfd9; }
.scoreboard { justify-self: end; color: #627165; font-size: 11px; line-height: 1.8; text-align: right; }
.word-card { padding: 30px 34px; border: 1px solid #e5e9e1; border-radius: 24px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.word-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 24px; }
.muted { color: #879187; font-size: 11px; }
.word-card .eyebrow { margin-bottom: 7px; }
.word-card h1 { margin: 0 0 24px; color: var(--green); font-size: clamp(42px, 9vw, 68px); line-height: 1.1; letter-spacing: -.04em; }
.forbidden-label { margin-bottom: 9px; color: #a75c48; font-size: 11px; font-weight: 900; }
.forbidden-words { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.forbidden-words span { padding: 8px 14px; border-radius: 9px; background: #fff0eb; color: #a74f3b; font-size: 14px; font-weight: 800; }
.hint { margin: 20px 0 0; color: #849080; font-size: 11px; }
.play-message { min-height: 18px; color: #728074; font-size: 12px; text-align: center; }
.action-row { display: grid; grid-template-columns: 1fr 1.3fr; gap: 12px; }
.action-row .button { padding: 17px; font-size: 15px; }
.action-row span { margin-left: 10px; }
.foul-button { width: 100%; border: 0; padding: 14px; background: transparent; color: #b05b48; font-size: 12px; font-weight: 800; cursor: pointer; }
.score-strip { display: flex; justify-content: center; flex-wrap: wrap; gap: 18px; color: #819083; font-size: 11px; }
.pause-card .secondary { margin-top: 10px; }
.result-card { width: 100%; max-width: 650px; margin: auto; padding: 48px 38px; text-align: center; }
.result-card .eyebrow { margin-bottom: 13px; }
.result-card h1 { font-size: clamp(31px, 6vw, 46px); }
.final-scores { display: flex; justify-content: center; gap: 14px; margin: 30px 0; }
.final-score { min-width: 125px; padding: 18px 24px; border-radius: 16px; background: #f3f5ef; }
.final-score strong { display: block; color: var(--green); font-size: 38px; font-variant-numeric: tabular-nums; }
.final-score span { color: var(--muted); font-size: 12px; font-weight: 800; }
.result-caption { margin: 0 0 24px; color: var(--muted); font-size: 13px; }
.result-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.result-home { margin: 20px; text-align: center; }
.result-home a { color: var(--green); font-size: 12px; font-weight: 800; text-decoration: none; }
.share-fallback { margin: 18px auto 0; color: var(--muted); font-size: 12px; line-height: 2; }
.share-fallback input { width: min(100%, 400px); padding: 9px; border: 1px solid var(--line); border-radius: 8px; }
.toast { position: fixed; z-index: 5; bottom: 25px; left: 50%; max-width: calc(100% - 32px); padding: 12px 17px; transform: translate(-50%, 20px); border-radius: 10px; background: #17271f; color: #fff; font-size: 12px; opacity: 0; pointer-events: none; text-align: center; transition: .2s; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
footer { display: flex; max-width: 1120px; justify-content: center; align-items: center; flex-wrap: wrap; gap: 18px; margin: 10px auto 0; padding: 20px 28px 26px; border-top: 1px solid #e3e8de; color: #889388; font-size: 10px; }
footer a { color: #718274; text-decoration: none; }
footer button { border: 0; background: transparent; color: #8b938b; font-size: 10px; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 800px) {
  .setup-screen { grid-template-columns: minmax(0, 1fr); gap: 22px; max-width: 560px; min-height: auto; margin: auto; }
  .intro { padding: 18px 0 0; }
  .intro h1 { font-size: 48px; }
  .intro-copy { font-size: 14px; }
  .howto { margin-top: 20px; }
  .setup-card { padding: 24px; }
  .content-note { margin: 0; }
  .shell { padding: 18px; }
  .topbar { padding: 17px 18px; }
}
@media (max-width: 480px) {
  .intro h1 { font-size: 42px; }
  .setup-card { padding: 20px; border-radius: 19px; }
  .team-fields { gap: 6px; }
  .team-input { padding: 0 8px; }
  .team-input input { font-size: 13px; }
  .segmented { gap: 4px; }
  .segmented button { min-width: 0; padding: 9px 4px; font-size: 11px; }
  .pack-options { gap: 6px; }
  .pack-choice { min-width: 0; padding: 8px; overflow-wrap: anywhere; }
  .pack-choice small { font-size: 9px; }
  .stage-top { margin-bottom: 20px; }
  .handoff-card, .reveal-card, .result-card { padding: 38px 22px; border-radius: 20px; }
  .play-head { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .timer { width: 58px; height: 58px; font-size: 23px; }
  .scoreboard { max-width: 90px; font-size: 10px; overflow-wrap: anywhere; }
  .word-card { padding: 25px 18px; }
  .word-meta { align-items: flex-start; }
  .word-card h1 { font-size: 46px; overflow-wrap: anywhere; }
  .forbidden-words span { padding: 8px 10px; }
  .action-row { gap: 8px; }
  .action-row .button { padding: 15px 9px; font-size: 13px; }
  .final-scores { gap: 8px; }
  .final-score { min-width: 0; flex: 1; padding: 15px 12px; }
  .result-actions { flex-direction: column; }
  .result-actions .button { width: 100%; }
  footer { gap: 10px; }
}
@media (max-width: 360px) {
  .shell { padding-right: 12px; padding-left: 12px; }
  .topbar { padding-right: 12px; padding-left: 12px; }
  .pack-choice { min-height: 64px; }
  .word-card { padding-right: 14px; padding-left: 14px; }
  .word-meta { flex-direction: column; }
}
