.game-page { --game-accent: var(--coral); min-height: 100vh; background: var(--ink); color: var(--white); }
.game-page--memory { --game-accent: var(--purple); }
.game-page .grain { opacity: .025; filter: invert(1); }
.game-page .brand__mark { background: var(--game-accent); color: var(--ink); }
.game-topbar { width: var(--shell); height: 74px; margin-inline: auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-bottom: 1px solid rgba(255,255,255,.16); }
.game-topbar__center { display: flex; align-items: center; gap: 10px; font: 500 .66rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: .06em; }
.game-back { justify-self: end; font: 500 .68rem/1 var(--font-mono); text-transform: uppercase; text-underline-offset: 5px; }
.game-main { padding: clamp(65px, 8vw, 110px) 0 100px; }
.game-intro { display: grid; grid-template-columns: 1fr auto; gap: 50px; align-items: end; margin-bottom: 58px; }
.game-intro h1 { margin: 20px 0 0; font-size: clamp(5rem, 11vw, 11rem); line-height: .94; letter-spacing: -.035em; }
.game-intro h1 em { color: var(--game-accent); font-style: normal; font-weight: 500; }
.game-intro__aside { min-width: 210px; padding: 18px 0 7px; border-top: 1px solid rgba(255,255,255,.28); }
.game-intro__aside > span, .game-intro__aside p { display: block; color: rgba(255,255,255,.5); font: 500 .62rem/1.5 var(--font-mono); text-transform: uppercase; letter-spacing: .05em; }
.game-intro__aside strong { display: block; margin: 17px 0 6px; font-size: 1.3rem; }.game-intro__aside strong b { color: var(--game-accent); font-size: 2.7rem; }.game-intro__aside p { margin: 0; text-transform: none; }
.game-stage { overflow: hidden; border: 1px solid rgba(255,255,255,.2); border-radius: 18px; background: #1a1d17; box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.game-stage__bar { height: 46px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid rgba(255,255,255,.15); color: rgba(255,255,255,.55); font: 500 .62rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: .06em; }
.game-stage__bar span:last-child { color: var(--game-accent); }
.game-screen { display: none; min-height: 590px; }.game-screen.is-active { display: block; }
.start-panel, .results-panel, .countdown-panel { min-height: 590px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; max-width: 920px; margin: 0 auto; padding: clamp(40px, 8vw, 95px); }
.game-badge { margin: 0 0 22px; padding: 7px 10px; border: 1px solid var(--game-accent); border-radius: 999px; color: var(--game-accent); font: 500 .62rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: .04em; }
.start-panel h2 { max-width: 800px; margin: 0; font-size: clamp(3rem, 7vw, 7.2rem); line-height: .96; letter-spacing: -.035em; }
.start-panel > p:not(.game-badge) { max-width: 640px; margin: 28px 0 34px; color: rgba(255,255,255,.6); font-size: clamp(1rem, 1.3vw, 1.2rem); }
.game-button { min-height: 52px; display: inline-flex; align-items: center; justify-content: space-between; gap: 36px; padding: 13px 18px; border: 1px solid var(--game-accent); border-radius: 999px; background: var(--game-accent); color: var(--ink); font: 600 .7rem/1 var(--font-mono); text-transform: uppercase; cursor: pointer; transition: transform .2s var(--ease), background .2s, color .2s; }
.game-button:hover { transform: translateY(-2px); background: var(--white); border-color: var(--white); }.game-button--ghost { background: transparent; color: var(--white); border-color: rgba(255,255,255,.4); }
.countdown-panel { align-items: center; text-align: center; }.countdown-panel span { color: rgba(255,255,255,.5); font: 500 .7rem/1 var(--font-mono); text-transform: uppercase; }.countdown-panel strong { color: var(--game-accent); font-size: clamp(10rem, 30vw, 25rem); line-height: .9; letter-spacing: -.035em; }
.live-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid rgba(255,255,255,.16); }
.live-stats > div { min-height: 102px; display: flex; flex-direction: column; justify-content: center; gap: 11px; padding: 18px 24px; border-right: 1px solid rgba(255,255,255,.16); }.live-stats > div:last-child { border-right: 0; }
.live-stats span { color: rgba(255,255,255,.5); font: 500 .61rem/1 var(--font-mono); text-transform: uppercase; }.live-stats strong { color: var(--game-accent); font-size: clamp(1.5rem, 2.6vw, 2.5rem); line-height: 1; }
.live-stats strong b { font: inherit; }
.race-progress { position: relative; height: 8px; margin: 28px clamp(20px, 4vw, 52px) 0; border-radius: 99px; background: rgba(255,255,255,.1); }
.race-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--game-accent); transition: width .12s linear; }
.race-progress span { position: absolute; top: 50%; left: 0; color: var(--game-accent); font-size: 1.8rem; transform: translate(-50%, -50%) rotate(45deg); transition: left .12s linear; }
.quote { min-height: 190px; margin: 0; padding: clamp(30px, 5vw, 65px) clamp(20px, 4vw, 52px) 28px; color: rgba(255,255,255,.42); font: 400 clamp(1.15rem, 2vw, 1.75rem)/1.8 var(--font-mono); letter-spacing: -.02em; }
.quote span { transition: color .08s, background .08s; }.quote .is-correct { color: var(--white); }.quote .is-wrong { color: var(--coral); text-decoration: underline; text-decoration-thickness: 2px; }.quote .is-current { color: var(--ink); background: var(--game-accent); }
.typing-label { display: block; margin: 0 clamp(20px, 4vw, 52px) 8px; color: rgba(255,255,255,.5); font: 500 .61rem/1 var(--font-mono); text-transform: uppercase; }
.typing-input { width: calc(100% - clamp(40px, 8vw, 104px)); min-height: 102px; margin: 0 clamp(20px, 4vw, 52px) 44px; resize: vertical; border: 1px solid rgba(255,255,255,.25); border-radius: 10px; background: rgba(255,255,255,.06); padding: 18px; color: var(--white); font: 400 1rem/1.5 var(--font-mono); caret-color: var(--game-accent); }
.typing-input:focus { border-color: var(--game-accent); outline: 2px solid var(--game-accent); outline-offset: 2px; }.typing-input::placeholder { color: rgba(255,255,255,.28); }
.results-panel { align-items: center; text-align: center; }.results-panel h2 { margin: 0; color: var(--game-accent); font-size: clamp(7rem, 18vw, 15rem); line-height: .9; letter-spacing: -.035em; }.results-panel h2 small { display: block; margin-top: 10px; color: rgba(255,255,255,.6); font: 500 .72rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; }
.result-grid { width: min(100%, 620px); display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 45px; border-top: 1px solid rgba(255,255,255,.2); border-bottom: 1px solid rgba(255,255,255,.2); }.result-grid--two { grid-template-columns: repeat(2, 1fr); }
.result-grid > div { padding: 22px 12px; border-right: 1px solid rgba(255,255,255,.2); }.result-grid > div:last-child { border-right: 0; }.result-grid span { display: block; margin-bottom: 8px; color: rgba(255,255,255,.45); font: 500 .6rem/1 var(--font-mono); text-transform: uppercase; }.result-grid strong { font-size: 1.35rem; }
.share-copy { margin: 26px 0; color: rgba(255,255,255,.55); }.result-actions { display: flex; gap: 10px; }.copy-status { min-height: 1.5em; margin: 12px 0 0; color: var(--game-accent); font: 500 .65rem/1 var(--font-mono); }
.game-history { padding: clamp(80px, 10vw, 135px) 0 0; }.game-history > header { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 28px; }.game-history h2 { margin: 13px 0 0; font-size: clamp(2.8rem, 5vw, 5.8rem); line-height: .96; letter-spacing: -.035em; }
.text-button { border: 0; border-bottom: 1px solid currentColor; background: transparent; padding: 5px 0; color: rgba(255,255,255,.5); font: 500 .63rem/1 var(--font-mono); text-transform: uppercase; cursor: pointer; }
.history-list { border-top: 1px solid rgba(255,255,255,.18); }.history-row { min-height: 66px; display: grid; grid-template-columns: 1fr repeat(3, auto); gap: 40px; align-items: center; border-bottom: 1px solid rgba(255,255,255,.18); font: 500 .69rem/1.3 var(--font-mono); }.history-row span:not(:first-child) { color: rgba(255,255,255,.55); }.history-row strong { color: var(--game-accent); }.history-empty { margin: 0; padding: 30px 0; color: rgba(255,255,255,.45); }
.game-footer { min-height: 150px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(255,255,255,.18); color: rgba(255,255,255,.5); font: 500 .64rem/1 var(--font-mono); text-transform: uppercase; }.game-footer a { text-underline-offset: 5px; }
.difficulty { width: min(100%, 760px); display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 30px; }
.difficulty__button { min-height: 78px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 7px; border: 1px solid rgba(255,255,255,.22); border-radius: 9px; background: transparent; padding: 13px 16px; color: var(--white); cursor: pointer; }.difficulty__button span { font-weight: 650; }.difficulty__button small { color: rgba(255,255,255,.45); font: 500 .58rem/1 var(--font-mono); text-transform: uppercase; }.difficulty__button.is-active { border-color: var(--game-accent); background: var(--game-accent); color: var(--ink); }.difficulty__button.is-active small { color: rgba(19,21,16,.65); }
.memory-board { --columns: 4; width: min(100% - 40px, 860px); display: grid; grid-template-columns: repeat(var(--columns), minmax(0, 1fr)); gap: clamp(7px, 1vw, 12px); margin: 38px auto 50px; }
.memory-board[data-difficulty="hard"] { --columns: 6; }
.memory-card { position: relative; aspect-ratio: 1; border: 0; border-radius: 11px; background: transparent; padding: 0; cursor: pointer; perspective: 700px; }.memory-card__inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .45s var(--ease); }.memory-card.is-flipped .memory-card__inner, .memory-card.is-matched .memory-card__inner { transform: rotateY(180deg); }
.memory-card__face { position: absolute; inset: 0; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.22); border-radius: inherit; backface-visibility: hidden; }.memory-card__front { background: #242820; color: rgba(255,255,255,.34); font: 500 1rem/1 var(--font-mono); }.memory-card__back { background: var(--game-accent); color: var(--ink); font: 500 clamp(1.3rem, 3vw, 2.7rem)/1 var(--font-mono); transform: rotateY(180deg); }.memory-card.is-matched .memory-card__back { background: var(--acid); box-shadow: 0 0 0 2px var(--acid), 0 0 28px rgba(217,154,58,.16); }.memory-card:focus-visible { outline: 3px solid var(--white); outline-offset: 3px; }

@media (max-width: 760px) {
    .game-topbar { width: calc(100% - 30px); height: 66px; grid-template-columns: 1fr auto; }.game-topbar__center { display: none; }.game-main { padding-top: 70px; }
    .game-intro { display: block; }.game-intro h1 { font-size: clamp(4rem, 20vw, 7.5rem); }.game-intro__aside { margin-top: 50px; }
    .game-screen, .start-panel, .results-panel, .countdown-panel { min-height: 540px; }.start-panel, .results-panel { padding: 38px 18px; }.start-panel h2 { font-size: clamp(3rem, 14vw, 4.8rem); }
    .live-stats > div { min-height: 86px; padding: 14px 10px; }.live-stats strong { font-size: 1.35rem; }.quote { min-height: 240px; font-size: 1.02rem; line-height: 1.75; }
    .result-grid { grid-template-columns: 1fr; }.result-grid--two { grid-template-columns: repeat(2, 1fr); }.result-grid:not(.result-grid--two) > div { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.2); }.result-grid:not(.result-grid--two) > div:last-child { border-bottom: 0; }
    .result-actions { width: 100%; flex-direction: column; }.result-actions .game-button { justify-content: center; }
    .game-history > header { align-items: flex-start; flex-direction: column; }.history-row { grid-template-columns: 1fr auto; gap: 8px 18px; padding: 16px 0; }.history-row span:nth-child(3), .history-row span:nth-child(4) { text-align: right; }
    .difficulty { grid-template-columns: 1fr; }.difficulty__button { min-height: 62px; }
    .memory-board { width: calc(100% - 24px); gap: 7px; margin-top: 24px; }.memory-board[data-difficulty="hard"] { --columns: 4; }
    .game-footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 16px; }
}

@media (max-width: 390px) {
    .game-back { font-size: .6rem; }.brand__mark { width: 32px; height: 32px; }.live-stats span { font-size: .53rem; }.live-stats strong { font-size: 1.1rem; }
    .typing-input { min-height: 120px; }.memory-card { border-radius: 8px; }
}
