:root {
  color-scheme: light;
  --paper: #f4f2ec;
  --white: #fffefa;
  --ink: #23241f;
  --muted: #77776f;
  --line: #e8e6de;
  --green: #39785a;
  --green-light: #e7f0e8;
  --orange: #f3a64a;
  --mono: "DM Mono", monospace;
  --sans: "DM Sans", sans-serif;
  --display: "Space Grotesk", sans-serif;
}

* { box-sizing: border-box; }

body {
  position: relative;
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
body::before, body::after {
  position: fixed;
  z-index: 0;
  width: 270px;
  height: 270px;
  border-radius: 50%;
  content: "";
  filter: blur(70px);
  opacity: .16;
  pointer-events: none;
  animation: ambient-drift 13s ease-in-out infinite;
}
body::before { top: 12vh; left: -190px; background: #a9c5a3; }
body::after { right: -190px; bottom: 5vh; background: #f2d2a0; animation-delay: -6s; }

@keyframes rise-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes letter-reveal {
  0% { opacity: 0; transform: translateY(12px) scale(.72) rotate(-8deg); }
  70% { opacity: 1; transform: translateY(-3px) scale(1.08) rotate(2deg); }
  100% { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}
@keyframes timer-warning {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@keyframes score-arrive {
  from { opacity: 0; transform: translateY(7px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes sparkle-turn {
  from { transform: rotate(0) scale(.85); }
  to { transform: rotate(45deg) scale(1); }
}
@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgb(129 167 125 / 35%); }
  50% { box-shadow: 0 0 0 5px rgb(129 167 125 / 0%); }
}
@keyframes ambient-drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(18px, -12px, 0) scale(1.04); }
}
@keyframes title-arrive {
  from { opacity: 0; transform: translateY(16px); letter-spacing: -.03em; }
  to { opacity: 1; transform: translateY(0); letter-spacing: -.065em; }
}
@keyframes answer-valid {
  0% { transform: scale(1); }
  45% { transform: scale(1.025); }
  100% { transform: scale(1); }
}
@keyframes answer-invalid {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
@keyframes feedback-pop {
  from { opacity: 0; transform: scale(.7) translateY(3px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes panel-glint {
  0% { transform: translateX(-120%) rotate(15deg); }
  100% { transform: translateX(120%) rotate(15deg); }
}

button, input { font: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid #f3a64a; outline-offset: 3px; }

.game-shell { position: relative; z-index: 1; width: min(1120px, calc(100% - 64px)); margin: 0 auto; animation: rise-in .65s cubic-bezier(.2, .7, .25, 1) both; }

.topbar {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #dfddd5;
  animation: rise-in .5s .08s both;
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  border-radius: 10px;
  background: var(--green);
  color: white;
  font: 700 14px var(--display);
  letter-spacing: -1px;
  transform: rotate(-4deg);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s;
}
.brand:hover .brand-mark { transform: rotate(5deg) scale(1.08); box-shadow: 0 5px 13px rgb(57 120 90 / 20%); }
.brand-mark span { color: #f6c76b; }
.brand-name { font: 700 16px var(--display); letter-spacing: -0.7px; }
.brand-name span { color: var(--green); }
.online-button { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid #dfddd5; border-radius: 6px; background: transparent; color: #62645b; cursor: pointer; font: 500 9px var(--mono); letter-spacing: .04em; transition: border-color .2s, color .2s, background .2s, transform .2s, box-shadow .2s; }
.online-button:hover { border-color: #a7b7a3; background: #edf1e9; color: var(--green); transform: translateY(-2px); box-shadow: 0 5px 12px rgb(57 120 90 / 9%); }
.online-button .live-dot { width: 6px; height: 6px; }
.online-button .live-dot { animation: live-pulse 2s ease-out infinite; }
.online-button > span:last-child { color: var(--green); font: 15px var(--sans); }
.live-dot, .round-indicator, .footer-dot { width: 7px; height: 7px; border-radius: 50%; background: #81a77d; }
.best-score { display: flex; align-items: center; gap: 9px; color: #77776f; font: 500 9px var(--mono); letter-spacing: .04em; }
.best-icon { color: #e9a64c; font-size: 18px; }
.best-icon { display: inline-block; animation: sparkle-turn 5s ease-in-out infinite alternate; }
.best-score strong { padding: 5px 9px; border: 1px solid #dfddd5; border-radius: 6px; color: var(--ink); font: 500 12px var(--mono); }
.best-score strong { transition: color .25s, border-color .25s, transform .25s; }

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 278px;
  gap: 64px;
  padding: 52px 0 58px;
}

.game-main { min-width: 0; }
.game-main > .eyebrow { animation: rise-in .5s .12s both; }
.heading-row { animation: rise-in .6s .18s both; }
.round-bar { animation: rise-in .45s .25s both; }
.eyebrow, .side-kicker { display: flex; align-items: center; gap: 9px; color: var(--green); font: 500 9px var(--mono); letter-spacing: .12em; }
.eyebrow-line { width: 19px; height: 1px; background: var(--green); }
.heading-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 18px 0 29px; }
h1 { margin: 0; font: 700 clamp(42px, 5.2vw, 62px)/.98 var(--display); letter-spacing: -.065em; }
h1 { animation: title-arrive .65s .2s cubic-bezier(.2, .7, .25, 1) both; }
h1 span { color: var(--green); }
.intro { max-width: 390px; margin: 15px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.letter-display {
  position: relative;
  flex: 0 0 102px;
  height: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 3px 1px 0;
  border: 1px solid #e3e0d7;
  border-radius: 16px;
  background: #efede5;
  overflow: hidden;
  transition: background .25s, transform .25s;
  box-shadow: 0 8px 24px rgb(35 36 31 / 4%);
}
.letter-display::before {
  position: absolute;
  inset: -45% auto -45% -65%;
  width: 38%;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 52%), transparent);
  content: "";
  transform: rotate(15deg);
  pointer-events: none;
}
.letter-display.is-counting::before { animation: panel-glint 1.15s ease-in-out infinite; }
.letter-spark { transform-origin: center; animation: sparkle-turn 3s ease-in-out infinite alternate; }
.letter-display.is-active { background: #e4ede3; transform: rotate(2deg); }
.letter-display.is-active .letter-value { animation: letter-reveal .42s cubic-bezier(.2, .8, .2, 1) both; }
.letter-display.is-counting { background: #f7ecda; border-color: #ead9bc; }
.letter-hint { color: #86867d; font: 500 8px var(--mono); letter-spacing: .13em; }
.letter-value { margin-top: 1px; font: 700 51px/.95 var(--display); letter-spacing: -.07em; }
.letter-display.is-active .letter-value { color: var(--green); }
.letter-display.is-active .letter-value { filter: drop-shadow(0 3px 5px rgb(57 120 90 / 15%)); }
.letter-display.is-counting .letter-value { color: #b77a2c; animation: countdown-pop 1s ease-in-out infinite; }
.letter-spark { position: absolute; top: 10px; right: 11px; color: #e5a548; font-size: 13px; }
@keyframes countdown-pop { 0%, 100% { opacity: .7; transform: scale(.86); } 50% { opacity: 1; transform: scale(1.08); } }

.round-bar { height: 49px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.round-label { display: flex; align-items: center; gap: 9px; color: #707168; font: 500 9px var(--mono); letter-spacing: .1em; }
.round-indicator { width: 6px; height: 6px; }
.round-indicator.active { background: #eaa54e; box-shadow: 0 0 0 3px #f5ead8; }
.round-indicator.complete { background: var(--green); }
.round-indicator.active { animation: live-pulse 1.5s ease-out infinite; }
.status-divider { padding: 0 5px; color: #c4c1b6; }
.timer { display: flex; position: relative; align-items: center; gap: 5px; color: var(--ink); font: 500 11px var(--mono); }
.timer-ring { width: 23px; height: 23px; transform: rotate(-90deg); }
.timer-ring circle { fill: none; stroke-width: 3; }
.timer-track { stroke: #e7e4dc; }
.timer-progress { stroke: var(--green); stroke-linecap: round; stroke-dasharray: 106.8; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear, stroke .3s; }
.timer-ring { overflow: visible; }
.timer.is-low .timer-progress { stroke: #d77954; }
.timer.is-low { color: #bd664a; animation: timer-warning 1s ease-in-out infinite; }
.timer-unit { color: #929087; font: 500 8px var(--mono); }

.categories-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 18px 0 16px; }
.category-card { min-height: 76px; padding: 12px 13px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); transition: border-color .2s, box-shadow .2s, transform .2s, background .2s; animation: rise-in .38s cubic-bezier(.2, .7, .25, 1) both; }
.category-card:nth-child(2) { animation-delay: 35ms; }
.category-card:nth-child(3) { animation-delay: 70ms; }
.category-card:nth-child(4) { animation-delay: 105ms; }
.category-card:nth-child(5) { animation-delay: 140ms; }
.category-card:nth-child(6) { animation-delay: 175ms; }
.category-card:nth-child(7) { animation-delay: 210ms; }
.category-card:nth-child(8) { animation-delay: 245ms; }
.category-card:nth-child(9) { animation-delay: 280ms; }
.category-card:nth-child(10) { animation-delay: 315ms; }
.category-card:nth-child(11) { animation-delay: 350ms; }
.category-card:hover:not(.is-excluded) { border-color: #cedac9; transform: translateY(-2px); box-shadow: 0 5px 15px rgb(35 36 31 / 5%); }
.category-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
.category-card:focus-within { border-color: #9bb49b; box-shadow: 0 0 0 3px #e9f0e7; transform: translateY(-1px); }
.category-card.is-excluded { background: #f0efe9; opacity: .62; }
.category-label { display: flex; align-items: center; justify-content: space-between; gap: 5px; color: #5f6057; font-size: 10px; font-weight: 700; }
.category-choice { display: inline-flex; min-width: 0; align-items: center; gap: 6px; cursor: pointer; }
.category-choice > span { min-width: 0; }
.category-toggle { width: 13px; height: 13px; flex: 0 0 auto; margin: 0; accent-color: var(--green); cursor: pointer; }
.category-toggle:disabled { cursor: not-allowed; }
.category-icon { margin-right: 5px; font-size: 12px; }
.category-number { color: #bbb8ae; font: 400 9px var(--mono); }
.remove-category-button { display: grid; width: 21px; height: 21px; flex: 0 0 auto; place-items: center; padding: 0; border: 0; border-radius: 5px; background: transparent; color: #929087; cursor: pointer; font-size: 17px; line-height: 1; }
.remove-category-button:hover { background: #f7e9e4; color: #bd664a; }
.remove-category-button { transition: color .18s, background .18s, transform .18s; }
.remove-category-button:hover:not(:disabled) { transform: rotate(90deg); }
.category-card input[name^="answer-"] { width: 100%; margin-top: 8px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.category-card input[name^="answer-"] { transition: color .2s, opacity .2s; }
.category-card input::placeholder { color: #b7b5ac; }
.category-card input[name^="answer-"]:disabled { cursor: not-allowed; opacity: .54; }
.category-card.is-valid { border-color: #9db89f; background: #fbfdf9; }
.category-card.is-invalid { border-color: #e4b2a0; background: #fffaf8; }
.category-card.is-valid { animation: answer-valid .42s cubic-bezier(.2, .8, .2, 1); }
.category-card.is-invalid { animation: answer-invalid .28s ease-in-out; }
.answer-feedback { float: right; font: 500 8px var(--mono); animation: feedback-pop .3s cubic-bezier(.2, .8, .2, 1) both; }
.category-card.is-valid .answer-feedback { color: var(--green); }
.category-card.is-invalid .answer-feedback { color: #bd664a; }
.add-category-controls { position: relative; margin: -3px 0 15px; }
.add-category-controls[hidden], .category-options[hidden] { display: none; }
.add-category-button { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px dashed #b8c5b4; border-radius: 6px; background: transparent; color: var(--green); cursor: pointer; font-size: 10px; font-weight: 700; transition: background .2s, border-color .2s; }
.add-category-button { transition: background .2s, border-color .2s, transform .2s; }
.add-category-button:hover:not(:disabled) { border-color: var(--green); background: #edf1e9; transform: translateY(-1px); }
.add-category-button > span { font-size: 15px; font-weight: 400; line-height: 1; }
.add-category-button:disabled { color: #929b8e; cursor: not-allowed; }
.category-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); }
.category-option { display: flex; min-width: 0; align-items: center; gap: 4px; padding: 8px; border: 1px solid transparent; border-radius: 5px; background: #f4f5ef; color: #5f6057; cursor: pointer; font-size: 10px; text-align: left; }
.category-option { animation: rise-in .2s ease-out both; transition: border-color .18s, color .18s, transform .18s, background .18s; }
.category-option:nth-child(2) { animation-delay: 25ms; }
.category-option:nth-child(3) { animation-delay: 50ms; }
.category-option:nth-child(4) { animation-delay: 75ms; }
.category-option:nth-child(5) { animation-delay: 100ms; }
.category-option:nth-child(6) { animation-delay: 125ms; }
.category-option:hover { border-color: #b8c5b4; background: #edf1e9; color: var(--green); transform: translateY(-1px); }
.category-option > span:last-child { margin-left: auto; color: var(--green); font-size: 14px; }

.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.keyboard-hint { margin: 0; color: #939188; font-size: 10px; }
kbd { padding: 3px 5px; border: 1px solid #dfddd5; border-radius: 4px; color: #77776f; font: 10px var(--mono); }
.submit-button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 18px; padding: 0 15px; border: 0; border-radius: 6px; background: var(--green); color: white; cursor: pointer; font-size: 11px; font-weight: 700; transition: background .2s, transform .2s, box-shadow .2s; }
.submit-button:hover:not(:disabled) { background: #2e654a; transform: translateY(-2px); box-shadow: 0 6px 14px rgb(57 120 90 / 22%); }
.submit-button:active:not(:disabled) { transform: translateY(0) scale(.98); }
.submit-button:disabled { background: #a9b8aa; cursor: not-allowed; }
.button-arrow { font-size: 15px; font-weight: 400; }
.game-message { min-height: 15px; margin: 11px 0 0; color: #929087; font-size: 10px; }

.side-panel { position: relative; align-self: stretch; min-height: 445px; padding: 23px 23px 18px; border-radius: 11px; background: #e9eee5; overflow: hidden; }
.side-panel { animation: rise-in .65s .2s both; }
.side-panel::before {
  position: absolute;
  top: -90px;
  right: -105px;
  width: 190px;
  height: 190px;
  border: 1px solid rgb(102 123 100 / 9%);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 22px rgb(102 123 100 / 3%), 0 0 0 44px rgb(102 123 100 / 2%);
  pointer-events: none;
}
.room-panel { position: relative; z-index: 2; margin: -6px -7px 19px; padding: 13px; border: 1px solid #d5dfd1; border-radius: 8px; background: #f5f7f1; }
.room-panel:not([hidden]) { animation: rise-in .32s cubic-bezier(.2, .7, .25, 1) both; }
.room-panel[hidden] { display: none; }
.room-panel-heading, .room-code-row { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.room-panel-heading .side-kicker { font-size: 7px; }
.room-close-button, .dialog-close-button { display: grid; width: 25px; height: 25px; place-items: center; border: 0; border-radius: 5px; background: transparent; color: #77796f; cursor: pointer; font-size: 19px; }
.room-close-button:hover, .dialog-close-button:hover { background: #ebece5; }
.room-close-button, .dialog-close-button, .copy-room-button, .join-room-button { transition: color .18s, background .18s, border-color .18s, transform .18s; }
.room-close-button:hover, .dialog-close-button:hover { transform: rotate(90deg); }
.room-code-row { margin-top: 7px; }
.room-code { color: var(--green); font: 700 21px var(--mono); letter-spacing: .12em; }
.copy-room-button { padding: 6px 7px; border: 1px solid #d9ded3; border-radius: 4px; background: white; color: #62735e; cursor: pointer; font: 500 7px var(--mono); letter-spacing: .04em; }
.copy-room-button:hover { border-color: #a7b7a3; }
.copy-room-button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 3px 8px rgb(57 120 90 / 9%); }
.join-room-button:hover:not(:disabled) { transform: translateY(-1px); }
.room-instruction { margin: 4px 0 9px; color: #85877d; font-size: 9px; line-height: 1.45; }
.player-list { display: grid; gap: 5px; max-height: 125px; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.player-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 7px; border-radius: 4px; background: white; color: #62645b; font-size: 9px; animation: rise-in .25s ease-out both; }
.player-row:nth-child(2) { animation-delay: 40ms; }
.player-row:nth-child(3) { animation-delay: 80ms; }
.player-row:nth-child(4) { animation-delay: 120ms; }
.player-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-detail { flex: 0 0 auto; color: #7b8b74; font: 500 7px var(--mono); }
.room-overlay { z-index: 6; }
.room-dialog { padding-top: 29px; }
.dialog-close-button { position: absolute; top: 14px; right: 14px; }
.dialog-label { display: flex; justify-content: space-between; gap: 8px; margin: 15px 0 6px; color: #717369; font: 500 8px var(--mono); letter-spacing: .07em; }
.dialog-label span { color: #a09e95; font-size: 7px; text-align: right; }
.room-input { width: 100%; min-height: 41px; padding: 0 11px; border: 1px solid #e2e0d8; border-radius: 5px; outline: 0; background: #fffefa; color: var(--ink); font-size: 12px; }
.room-input:focus { border-color: #9bb49b; box-shadow: 0 0 0 3px #e9f0e7; }
.room-input::placeholder { color: #aaa89f; }
.room-code-input { font: 500 13px var(--mono); letter-spacing: .12em; }
.room-dialog-message { min-height: 16px; margin: 10px 0 7px; color: var(--green); font-size: 10px; line-height: 1.5; }
.room-dialog-message.is-error { color: #ad593e; }
.room-action-button { width: 100%; justify-content: space-between; }
.join-room-button { width: 100%; margin-top: 5px; padding: 10px; border: 0; background: transparent; color: #63705f; cursor: pointer; font-size: 10px; font-weight: 700; }
.join-room-button:hover:not(:disabled) { color: var(--green); }
.join-room-button:disabled { color: #a9ada5; cursor: not-allowed; }
.room-action-button:disabled { background: #a9b8aa; }
.online-setup-note { margin: 7px 0 0; color: #77776f; font-size: 10px; line-height: 1.5; }
.online-setup-note[hidden] { display: none; }
.online-setup-note a { color: var(--green); font-weight: 700; }
.side-top { display: flex; align-items: center; justify-content: space-between; }
.side-kicker { color: #667b64; font-size: 8px; }
.side-spark { color: #dea048; font-size: 17px; }
.side-panel h2 { position: relative; z-index: 1; margin: 20px 0 20px; font: 600 22px/1.19 var(--display); letter-spacing: -.045em; }
.how-to-list { position: relative; z-index: 1; display: grid; gap: 17px; margin: 0; padding: 0; list-style: none; }
.how-to-list li { display: grid; grid-template-columns: 25px 1fr; gap: 8px; align-items: start; color: #686b60; font-size: 10px; line-height: 1.55; }
.how-to-list li { animation: rise-in .36s ease-out both; transition: color .2s, transform .2s; }
.how-to-list li:nth-child(2) { animation-delay: 70ms; }
.how-to-list li:nth-child(3) { animation-delay: 140ms; }
.how-to-list li:hover { color: var(--green); transform: translateX(3px); }
.step-number { color: #82917b; font: 500 9px var(--mono); }
.side-divider { height: 1px; margin: 21px 0 15px; background: #d6ded2; }
.scoring-heading { display: flex; justify-content: space-between; margin-bottom: 11px; color: #667b64; font: 500 8px var(--mono); letter-spacing: .12em; }
.scoring-star { color: #dda046; font-size: 13px; }
.scoring-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; color: #696b62; font-size: 10px; }
.scoring-row { transition: color .2s, transform .2s; }
.scoring-row:hover { color: var(--green); transform: translateX(3px); }
.scoring-row strong { color: var(--green); font: 500 12px var(--mono); }
.scoring-row strong small { color: #899186; font-size: 8px; }
.scoring-row .zero-score { color: #85867d; }
.dictionary-note { margin: 11px 0 0; color: #77796f; font-size: 9px; line-height: 1.5; }
.side-footer { position: absolute; right: 23px; bottom: 17px; left: 23px; display: flex; align-items: center; gap: 9px; padding-top: 12px; border-top: 1px solid #d6ded2; color: #808277; font-size: 9px; line-height: 1.5; }
.side-footer strong { color: #586b56; }
.footer-dot { flex: 0 0 6px; width: 6px; height: 6px; background: #86a27d; }
.side-decoration { position: absolute; right: -2px; bottom: 30px; color: #e2e9dd; font: 700 115px/.8 var(--display); transform: rotate(-10deg); }
.side-decoration { transform-origin: 70% 70%; animation: decoration-float 7s ease-in-out infinite; }
@keyframes decoration-float { 0%, 100% { transform: translateY(0) rotate(-10deg); } 50% { transform: translateY(-7px) rotate(-7deg); } }

.page-footer { display: flex; justify-content: space-between; padding: 16px 0 22px; border-top: 1px solid #dfddd5; color: #9a988f; font: 400 8px var(--mono); letter-spacing: .07em; }
.page-footer { animation: rise-in .45s .35s both; }
.footer-separator { padding: 0 5px; color: #d8a44e; }

.result-overlay { position: fixed; z-index: 5; inset: 0; display: grid; place-items: center; padding: 20px; background: rgb(33 35 30 / 48%); backdrop-filter: blur(5px); animation: overlay-arrive .24s ease-out both; }
.result-overlay[hidden] { display: none; }
@keyframes overlay-arrive { from { opacity: 0; backdrop-filter: blur(0); } to { opacity: 1; backdrop-filter: blur(5px); } }
.result-card { position: relative; width: min(400px, 100%); padding: 32px; border: 1px solid #ece9df; border-radius: 14px; background: var(--white); box-shadow: 0 20px 70px rgb(0 0 0 / 17%); animation: pop-in .42s cubic-bezier(.16, 1, .3, 1); }
@keyframes pop-in { 0% { opacity: 0; transform: translateY(22px) scale(.94); } 65% { opacity: 1; transform: translateY(-3px) scale(1.01); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
.result-confetti { position: absolute; top: 25px; right: 29px; color: #e5a548; font-size: 24px; }
.result-kicker { margin: 0 0 11px; color: var(--green); font: 500 9px var(--mono); letter-spacing: .14em; }
.result-card h2 { margin: 0; font: 700 32px var(--display); letter-spacing: -.05em; }
.result-copy { margin: 6px 0 17px; color: var(--muted); font-size: 12px; }
.result-score { display: flex; align-items: baseline; gap: 8px; margin-bottom: 17px; color: var(--green); }
.result-score span { font: 700 48px/.95 var(--display); letter-spacing: -.07em; animation: score-arrive .42s cubic-bezier(.2, .8, .2, 1) both; }
.result-score small { color: #87867d; font: 500 9px var(--mono); letter-spacing: .1em; }
.result-answers { display: grid; gap: 7px; margin-bottom: 22px; }
.result-answer { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 5px; background: #f4f5ef; color: #65675e; font-size: 10px; animation: rise-in .25s ease-out both; }
.result-answer:nth-child(2) { animation-delay: 45ms; }
.result-answer:nth-child(3) { animation-delay: 90ms; }
.result-answer:nth-child(4) { animation-delay: 135ms; }
.result-answer:nth-child(n+5) { animation-delay: 180ms; }
.result-answer strong { color: var(--green); font-size: 10px; }
.result-answer.invalid strong { color: #bf7055; }
.play-again-button { width: 100%; }
.result-confetti { animation: sparkle-turn .45s cubic-bezier(.2, .8, .2, 1) both, live-pulse 2.4s 0.5s ease-in-out infinite; }

@media (max-width: 760px) {
  .game-shell { width: min(100% - 38px, 540px); }
  .topbar { height: 69px; }
  .game-layout { grid-template-columns: 1fr; gap: 25px; padding: 38px 0 34px; }
  .side-panel { min-height: unset; padding-bottom: 72px; }
  .side-panel h2 { margin-top: 14px; }
  .how-to-list { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .how-to-list li { grid-template-columns: 1fr; gap: 6px; font-size: 9px; }
  .side-footer { bottom: 15px; }
  .side-decoration { bottom: 26px; }
  .page-footer { gap: 12px; font-size: 7px; }
}

@media (max-width: 420px) {
  .game-shell { width: calc(100% - 30px); }
  .best-score { gap: 5px; font-size: 8px; }
  .best-score > span:not(.best-icon) { display: none; }
  .online-button { gap: 5px; padding: 7px; font-size: 8px; }
  .heading-row { align-items: center; gap: 7px; }
  h1 { font-size: 46px; }
  .intro { max-width: 250px; font-size: 12px; }
  .letter-display { flex-basis: 82px; height: 94px; }
  .letter-value { font-size: 43px; }
  .categories-grid { gap: 7px; }
  .category-card { padding: 10px; }
  .form-footer { align-items: flex-end; }
  .keyboard-hint { max-width: 130px; line-height: 1.5; }
  .submit-button { gap: 10px; padding: 0 11px; }
  .page-footer span:last-child { text-align: right; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
