@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800;900&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --lime: #b8ff2c;
  --lime-soft: #d7ff86;
  --ink: #070b09;
  --panel: rgba(10, 15, 12, 0.86);
  --line: rgba(184, 255, 44, 0.24);
  --muted: #aab3ae;
  --danger: #ff625e;
  --white: #f7faf8;
}

* { box-sizing: border-box; }

html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--ink); color: var(--white); }

body { font-family: Inter, system-ui, sans-serif; }

button { font: inherit; }

#camera {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  opacity: 0;
  transition: opacity .6s ease;
  filter: saturate(.78) contrast(1.08) brightness(.58);
}

body.camera-on #camera { opacity: .76; }

.camera-shade {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 70% 45%, transparent 0 18%, rgba(4,8,5,.35) 58%, rgba(4,8,5,.82) 100%),
    linear-gradient(90deg, rgba(4,8,5,.88) 0%, rgba(4,8,5,.4) 42%, rgba(4,8,5,.38) 100%);
}

.ambient { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.ambient::before { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(184,255,44,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(184,255,44,.035) 1px, transparent 1px); background-size: 52px 52px; mask-image: linear-gradient(to bottom, transparent, #000 30%, #000); }
.ambient__line { position: absolute; height: 1px; width: 65vw; background: linear-gradient(90deg, transparent, var(--lime), transparent); opacity: .22; transform: rotate(-32deg); }
.ambient__line--one { top: 16%; right: -15%; }
.ambient__line--two { bottom: 12%; left: -18%; }
.ambient__grain { position: absolute; inset: 0; opacity: .045; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E"); }

#app { position: relative; z-index: 2; width: 100%; height: 100%; }
.screen { position: absolute; inset: 0; display: none; opacity: 0; }
.screen.is-active { display: flex; opacity: 1; animation: screen-in .55s ease both; }

.brand-bar { position: absolute; top: clamp(22px, 4vh, 52px); left: clamp(24px, 5vw, 76px); right: clamp(24px, 5vw, 76px); display: flex; align-items: center; justify-content: space-between; z-index: 2; }
.brand-logo { width: clamp(190px, 20vw, 295px); height: auto; background: var(--lime); padding: 9px 13px; border-radius: 4px; }
.event-pill { border: 1px solid rgba(184,255,44,.55); color: var(--lime); padding: 9px 18px; border-radius: 999px; font: 800 14px/1 Inter; letter-spacing: .18em; background: rgba(7,11,9,.48); }

.intro-screen { align-items: center; padding: 13vh 6vw 5vh; }
.intro-grid { width: min(1380px, 100%); margin: auto; display: grid; grid-template-columns: 1.18fr .82fr; gap: 4vw; align-items: center; }
.eyebrow { margin: 0 0 13px; color: var(--lime); font: 800 clamp(13px, 1.2vw, 18px)/1 Inter; letter-spacing: .28em; }
h1, h2 { font-family: "Barlow Condensed", Impact, sans-serif; text-transform: uppercase; margin: 0; letter-spacing: -.025em; line-height: .85; }
h1 { font-size: clamp(68px, 8vw, 126px); font-weight: 900; }
h1 span, h2 span { color: var(--lime); }
.intro-lead { color: #d7ded9; font-size: clamp(16px, 1.25vw, 21px); line-height: 1.55; max-width: 710px; margin: 28px 0 26px; }
.steps { display: flex; gap: 14px; margin: 0 0 28px; }
.step { display: flex; align-items: center; gap: 10px; padding-right: 18px; border-right: 1px solid rgba(255,255,255,.16); color: #cbd2ce; font-size: 12px; line-height: 1.25; letter-spacing: .04em; text-transform: uppercase; }
.step:last-child { border: 0; }
.step strong { display: grid; place-items: center; width: 31px; height: 31px; flex: 0 0 31px; border: 1px solid var(--lime); color: var(--lime); border-radius: 50%; }
.primary-button { border: 0; color: #071006; background: var(--lime); padding: 0 6px 0 25px; min-width: min(370px, 100%); height: 64px; display: inline-flex; justify-content: space-between; align-items: center; gap: 30px; cursor: pointer; font-weight: 900; letter-spacing: .08em; box-shadow: 0 0 34px rgba(184,255,44,.18); transition: transform .2s ease, box-shadow .2s ease; }
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 0 48px rgba(184,255,44,.35); }
.button-arrow { display: grid; place-items: center; width: 52px; height: 52px; background: #071006; color: var(--lime); font-size: 24px; }
.permission-note { margin: 12px 0 0; color: #89948d; font-size: 11px; }
.player-name-field { display: block; width: min(420px, 100%); margin: 0 0 14px; }
.player-name-field span { display: block; margin-bottom: 7px; color: var(--lime); font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.player-name-field input { width: 100%; height: 50px; border: 1px solid rgba(184,255,44,.32); border-radius: 0; outline: 0; padding: 0 15px; background: rgba(5,9,6,.7); color: #fff; font: 700 17px Inter; text-transform: uppercase; }
.player-name-field input:focus { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(184,255,44,.1); }
.player-name-field input::placeholder { color: #68736c; text-transform: none; }
.player-name-field.is-invalid input { border-color: var(--danger); animation: field-shake .28s ease; }

.gesture-demo { position: relative; width: min(520px, 42vw); height: min(590px, 76vh); justify-self: end; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.gesture-demo::before { content: ""; position: absolute; width: 72%; height: 72%; background: radial-gradient(circle, rgba(184,255,44,.16), transparent 67%); }
.gesture-orbit { position: absolute; border: 1px solid rgba(184,255,44,.25); border-radius: 50%; animation: orbit 16s linear infinite; }
.gesture-orbit::after { content: ""; position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 18px var(--lime); top: 12%; left: 12%; }
.gesture-orbit--outer { inset: 3%; }
.gesture-orbit--inner { inset: 19%; animation-direction: reverse; animation-duration: 10s; border-style: dashed; }
.gesture-hand { position: relative; z-index: 2; display: grid; place-items: center; width: 47%; height: 47%; border-radius: 50%; background: rgba(8,14,10,.74); border: 1px solid rgba(184,255,44,.45); box-shadow: inset 0 0 40px rgba(184,255,44,.06), 0 0 65px rgba(0,0,0,.35); }
.gesture-hand__icon { font-size: clamp(80px, 9vw, 145px); filter: grayscale(1) sepia(1) hue-rotate(35deg) saturate(5); animation: palm-turn-demo 2.4s ease-in-out infinite; transform-style: preserve-3d; }
.gesture-hand__pinch { position: absolute; color: var(--lime); font-size: 42px; top: 18%; right: 21%; animation: sparkle 1.2s ease-in-out infinite; }
.gesture-caption { position: relative; z-index: 3; font: 800 11px Inter; letter-spacing: .16em; color: #cdd5d0; }
.gesture-caption span { display: inline-block; width: 7px; height: 7px; background: var(--lime); border-radius: 50%; box-shadow: 0 0 9px var(--lime); margin-right: 6px; }
.pair-showcase { position: relative; z-index: 3; width: 92%; padding: 18px; background: rgba(5,9,6,.88); border: 1px solid rgba(184,255,44,.28); box-shadow: 0 20px 60px rgba(0,0,0,.42); backdrop-filter: blur(9px); transition: opacity .2s ease, transform .2s ease; }
.pair-showcase.is-changing { opacity: .25; transform: translateX(10px); }
.pair-showcase__header { display: flex; justify-content: space-between; margin-bottom: 14px; color: var(--lime); font-size: 9px; font-weight: 900; letter-spacing: .16em; }
.pair-showcase__cards { display: grid; grid-template-columns: 1fr 25px 1fr; gap: 7px; align-items: center; }
.example-card { position: relative; min-width: 0; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; padding: 12px 8px; color: #071006; background: linear-gradient(150deg, #f0f4f1, #bec7c1); text-align: center; }
.example-card--solution { background: linear-gradient(150deg, var(--lime-soft), var(--lime)); }
.example-card small { position: absolute; left: 9px; top: 8px; color: #526057; font-size: 7px; font-weight: 900; letter-spacing: .14em; }
.example-card__icon { font-size: clamp(36px, 4vw, 58px); line-height: 1; }
.example-card strong { font: 900 clamp(15px, 1.5vw, 22px)/.95 "Barlow Condensed"; }
.pair-link { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; color: #071006; background: var(--lime); font-weight: 900; }
.pair-showcase > p { margin: 10px 0 0; color: #9da7a1; font-size: 8px; font-weight: 800; letter-spacing: .12em; text-align: center; }
.pair-dots { display: flex; justify-content: center; gap: 5px; margin-top: 12px; }
.pair-dots i { width: 16px; height: 3px; background: rgba(255,255,255,.17); transition: .2s ease; }
.pair-dots i.is-active { width: 30px; background: var(--lime); box-shadow: 0 0 8px rgba(184,255,44,.5); }
.intro-ranking { position: relative; z-index: 4; align-self: flex-end; width: min(310px, 78%); padding: 13px 16px; background: rgba(5,9,6,.86); border: 1px solid rgba(184,255,44,.22); backdrop-filter: blur(8px); }
.intro-ranking__title, .result-ranking__header { display: flex; justify-content: space-between; color: var(--lime); font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.intro-ranking ol, .result-ranking ol { list-style: none; padding: 0; margin: 8px 0 0; counter-reset: rank; }
.intro-ranking li, .result-ranking li { counter-increment: rank; display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; align-items: center; min-height: 23px; border-top: 1px solid rgba(255,255,255,.07); color: #dbe1dd; font-size: 10px; text-align: left; }
.intro-ranking li::before, .result-ranking li::before { content: counter(rank, decimal-leading-zero); color: #77817b; font: 800 10px "Barlow Condensed"; }
.intro-ranking li strong, .result-ranking li strong { color: var(--lime); font: 800 14px "Barlow Condensed"; }
.ranking-empty { display: block !important; padding: 8px 0; color: #77817b !important; }
.ranking-empty::before { display: none; }

.game-screen { flex-direction: column; padding: 18px 3vw 25px; background: linear-gradient(90deg, rgba(4,8,5,.28), rgba(4,8,5,.66)); }
.game-header { display: grid; grid-template-columns: 240px 1fr 240px; align-items: center; height: 58px; }
.game-logo { width: 182px; background: var(--lime); padding: 5px 8px; border-radius: 3px; }
.game-title { justify-self: center; font: 700 clamp(15px, 1.4vw, 22px) "Barlow Condensed"; letter-spacing: .16em; }
.game-title span { color: var(--lime); }
.camera-state { justify-self: end; display: flex; align-items: center; gap: 9px; color: #b5bdb8; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.camera-state i { width: 8px; height: 8px; border-radius: 50%; background: #ffc14d; box-shadow: 0 0 10px #ffc14d; }
.camera-state.is-ready i { background: var(--lime); box-shadow: 0 0 10px var(--lime); }
.camera-state.is-error i { background: var(--danger); box-shadow: 0 0 10px var(--danger); }

.hud { height: 78px; width: min(1120px, 88vw); align-self: center; display: grid; grid-template-columns: 90px 1fr 110px 100px; gap: 20px; align-items: center; padding: 0 12px; }
.hud-block span { display: block; color: var(--muted); font-size: 9px; letter-spacing: .18em; font-weight: 700; }
.hud-block strong { display: block; color: var(--white); font: 900 34px/1 "Barlow Condensed"; }
.hud-block--score strong { color: var(--lime); }
.hud-block--pairs b { color: var(--lime); }
.timer-track { height: 4px; background: rgba(255,255,255,.13); overflow: hidden; }
.timer-track span { display: block; height: 100%; width: 100%; background: var(--lime); box-shadow: 0 0 12px var(--lime); transform-origin: left; }

.game-layout { min-height: 0; flex: 1; display: grid; grid-template-columns: 1fr; align-items: stretch; }

.board-wrap { min-width: 0; min-height: 0; position: relative; display: grid; place-items: center; }
.memory-board { width: min(1120px, 100%); height: calc(100% - 52px); max-height: 640px; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(3, 1fr); gap: clamp(8px, 1.2vw, 17px); perspective: 1200px; }
.memory-card { position: relative; min-width: 0; border: 0; background: none; padding: 0; cursor: pointer; perspective: 900px; outline: none; }
.memory-card__inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .48s cubic-bezier(.2,.75,.2,1); }
.memory-card.is-flipped .memory-card__inner, .memory-card.is-matched .memory-card__inner { transform: rotateY(180deg); }
.memory-board.is-previewing .memory-card__inner { transform: rotateY(180deg); }
.memory-card__face { position: absolute; inset: 0; backface-visibility: hidden; border: 1px solid rgba(184,255,44,.28); overflow: hidden; }
.memory-card__back { display: grid; place-items: center; background: linear-gradient(145deg, rgba(23,32,26,.97), rgba(7,11,9,.98)); box-shadow: inset 0 0 45px rgba(184,255,44,.03); }
.memory-card__back::before { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(184,255,44,.1); }
.memory-card__back::after { content: "+"; position: absolute; font: 200 88px/1 Inter; color: rgba(184,255,44,.055); }
.card-mark { display: grid; place-items: center; width: clamp(50px, 5vw, 76px); height: clamp(50px, 5vw, 76px); border: 2px solid var(--lime); color: var(--lime); font: 900 clamp(24px, 3vw, 42px) "Barlow Condensed"; transform: rotate(45deg); box-shadow: 0 0 24px rgba(184,255,44,.12); }
.card-mark span { transform: rotate(-45deg); }
.memory-card__front { transform: rotateY(180deg); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 12px; background: linear-gradient(150deg, rgba(238,244,240,.98), rgba(193,202,196,.98)); color: #071006; border-color: rgba(255,255,255,.75); }
.memory-card__front::before { content: attr(data-kind); position: absolute; top: 9px; left: 10px; color: #536058; font-size: 8px; font-weight: 900; letter-spacing: .16em; }
.card-icon { font-size: clamp(32px, 4.3vw, 64px); line-height: 1; filter: saturate(.82); }
.card-label { font: 900 clamp(17px, 1.65vw, 26px)/.95 "Barlow Condensed"; text-transform: uppercase; }
.memory-card[data-type="solution"] .memory-card__front { background: linear-gradient(150deg, var(--lime-soft), var(--lime)); }
.memory-card.is-tracked::after { content: ""; position: absolute; inset: -5px; z-index: 4; border: 3px solid var(--lime); box-shadow: 0 0 28px rgba(184,255,44,.64), inset 0 0 20px rgba(184,255,44,.16); animation: tracked .55s ease-in-out infinite alternate; pointer-events: none; }
.memory-card.is-matched { animation: match-pop .6s ease; }
.memory-card.is-matched .memory-card__front { border: 3px solid var(--lime); box-shadow: 0 0 24px rgba(184,255,44,.28); }
.memory-card:focus-visible { outline: 3px solid var(--lime); outline-offset: 4px; }
.match-toast { position: absolute; left: 50%; bottom: 3%; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; color: #071006; background: var(--lime); padding: 12px 20px; font: 900 clamp(14px, 1.4vw, 20px) "Barlow Condensed"; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; box-shadow: 0 12px 40px rgba(0,0,0,.4); transition: .25s ease; }
.match-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.match-toast.is-error { background: var(--danger); color: #fff; }
.tracking-dock { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: min(1120px, 100%); height: 40px; display: grid; grid-template-columns: 190px 1fr 190px; align-items: center; gap: 18px; padding: 0 13px; background: rgba(5,9,6,.82); border: 1px solid rgba(184,255,44,.18); backdrop-filter: blur(8px); color: #bbc4be; font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.player-indicator { display: flex; align-items: center; gap: 8px; color: #8b9690; }
.player-indicator i { width: 8px; height: 8px; border-radius: 50%; background: #ffc14d; box-shadow: 0 0 10px #ffc14d; }
.player-indicator.is-locked { color: var(--lime); }
.player-indicator.is-locked i { background: var(--lime); box-shadow: 0 0 11px var(--lime); }
.tracking-dock > #trackingMessage { text-align: center; }
.pinch-meter { display: grid; grid-template-columns: 45px 1fr; align-items: center; gap: 8px; }
.pinch-meter b { font-size: 8px; }
.pinch-meter > span { display: block; height: 6px; border: 1px solid rgba(255,255,255,.15); padding: 1px; }
.pinch-meter i { display: block; width: 0%; height: 100%; background: var(--lime); transition: width .05s linear; }
.calibration-overlay { position: absolute; inset: 0 0 52px; z-index: 12; display: none; place-items: center; align-content: center; text-align: center; background: rgba(4,8,5,.82); backdrop-filter: blur(7px); }
.calibration-overlay.is-visible { display: grid; }
.calibration-ring { display: grid; place-items: center; width: 110px; height: 110px; margin-bottom: 18px; border-radius: 50%; border: 2px solid rgba(184,255,44,.23); box-shadow: inset 0 0 35px rgba(184,255,44,.06); position: relative; }
.calibration-ring::before { content: ""; position: absolute; inset: -2px; border-radius: inherit; border: 3px solid transparent; border-top-color: var(--lime); animation: orbit 1s linear infinite; }
.calibration-ring span { color: var(--lime); font: 900 58px/1 "Barlow Condensed"; }
.calibration-overlay strong { font: 900 28px "Barlow Condensed"; letter-spacing: .08em; }
.calibration-overlay p { margin: 5px 0 0; color: #abb4ae; font-size: 12px; }
.preview-overlay { position: absolute; inset: 0 0 52px; z-index: 13; display: none; place-items: center; align-content: center; text-align: center; pointer-events: none; background: radial-gradient(circle, rgba(5,9,6,.24), rgba(5,9,6,.58)); }
.preview-overlay.is-visible { display: grid; }
.preview-overlay strong { padding: 9px 18px; color: #071006; background: var(--lime); font: 900 24px "Barlow Condensed"; letter-spacing: .1em; box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.preview-overlay span { margin-top: 12px; color: #fff; font: 900 58px/1 "Barlow Condensed"; text-shadow: 0 3px 15px #000; }
.preview-overlay p { margin: 6px 0 0; padding: 7px 12px; color: #fff; background: rgba(5,9,6,.82); font-size: 11px; font-weight: 700; text-shadow: 0 2px 8px #000; }

.hand-cursor { position: fixed; z-index: 50; width: 46px; height: 46px; margin: -23px 0 0 -23px; border: 3px solid var(--lime); border-radius: 50%; pointer-events: none; opacity: 0; transform: scale(.8); transition: opacity .15s ease, transform .1s ease; box-shadow: 0 0 22px rgba(184,255,44,.65), inset 0 0 9px rgba(184,255,44,.25); }
.hand-cursor.is-visible { opacity: 1; }
.hand-cursor.is-pinching { transform: scale(.62); background: rgba(184,255,44,.32); }
.hand-cursor span { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); left: 50%; top: 50%; transform: translate(-50%,-50%); }
.hand-cursor::after { content: attr(data-label); position: absolute; right: -8px; top: -11px; display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; color: #071006; background: var(--lime); font: 900 10px Inter; }
.hand-cursor--right { border-color: #fff; box-shadow: 0 0 22px rgba(255,255,255,.55), inset 0 0 9px rgba(255,255,255,.22); }
.hand-cursor--right span, .hand-cursor--right::after { background: #fff; }

.result-screen { align-items: center; justify-content: center; text-align: center; padding-top: 70px; background: radial-gradient(circle at center, rgba(184,255,44,.1), rgba(4,8,5,.73) 52%, rgba(4,8,5,.93)); }
.result-card { width: min(850px, 90vw); }
.result-badge { width: 82px; height: 82px; margin: 0 auto 18px; display: grid; place-items: center; color: #071006; background: var(--lime); font-size: 40px; transform: rotate(45deg); box-shadow: 0 0 48px rgba(184,255,44,.36); }
.result-badge::first-letter { transform: rotate(-45deg); }
h2 { font-size: clamp(62px, 7vw, 104px); }
.result-message { margin: 18px 0 25px; color: #d3dad6; }
.result-stats { display: grid; grid-template-columns: repeat(3,1fr); margin: 0 auto 20px; max-width: 650px; border-top: 1px solid rgba(184,255,44,.2); border-bottom: 1px solid rgba(184,255,44,.2); }
.result-stats div { padding: 16px; border-right: 1px solid rgba(184,255,44,.16); }
.result-stats div:last-child { border: 0; }
.result-stats span { display: block; color: #8d9891; font-size: 9px; letter-spacing: .16em; }
.result-stats strong { color: var(--lime); font: 900 34px "Barlow Condensed"; }
.result-slogan { color: #aab3ae; font-size: 13px; margin: 0 auto 24px; }
.result-card .primary-button { min-width: 320px; }
.result-ranking { width: min(540px, 100%); margin: 0 auto 16px; padding: 11px 16px; background: rgba(5,9,6,.65); border: 1px solid rgba(184,255,44,.18); }
.result-ranking li { min-height: 21px; }
.result-ranking li.is-current { padding-left: 4px; color: #fff; background: rgba(184,255,44,.1); }

.flash-layer { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; pointer-events: none; opacity: 0; font: 900 clamp(58px, 10vw, 150px) "Barlow Condensed"; text-transform: uppercase; text-align: center; text-shadow: 0 7px 0 #000, 0 0 40px currentColor; }
.flash-layer.is-good { color: var(--lime); animation: flash .85s ease-out; box-shadow: inset 0 0 150px rgba(184,255,44,.35); }
.flash-layer.is-bad { color: var(--danger); animation: flash .7s ease-out; box-shadow: inset 0 0 150px rgba(255,98,94,.25); }

@keyframes screen-in { from { opacity: 0; transform: scale(1.015); } }
@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes palm-turn-demo { 0%,25%,100% { transform: perspective(400px) rotateY(0deg) rotate(-4deg); } 58%,72% { transform: perspective(400px) rotateY(72deg) rotate(2deg); } }
@keyframes sparkle { 0%,100% { opacity: .25; transform: scale(.5) rotate(0); } 50% { opacity: 1; transform: scale(1.2) rotate(90deg); } }
@keyframes tracked { to { transform: scale(1.025); } }
@keyframes match-pop { 50% { transform: scale(1.05); } }
@keyframes flash { 0% { opacity: 0; transform: scale(.7); } 20% { opacity: 1; transform: scale(1.04); } 100% { opacity: 0; transform: scale(1.25); } }
@keyframes field-shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

@media (max-width: 900px), (max-height: 650px) {
  .game-screen { padding: 10px 16px 14px; }
  .game-header { grid-template-columns: 170px 1fr 180px; height: 42px; }
  .game-logo { width: 145px; }
  .hud { height: 58px; }
  .hud-block strong { font-size: 27px; }
  .game-layout { grid-template-columns: 1fr; }
  .memory-board { gap: 8px; }
  .tracking-dock { grid-template-columns: 150px 1fr 150px; }
}

@media (max-height: 800px) and (min-width: 701px) {
  .brand-bar { top: 20px; }
  .brand-logo { width: 235px; padding: 7px 10px; }
  .intro-screen { padding-top: 112px; padding-bottom: 12px; }
  .intro-lead { margin: 17px 0; font-size: 16px; }
  .steps { margin-bottom: 16px; }
  .player-name-field { margin-bottom: 10px; }
  .player-name-field input { height: 45px; }
  .primary-button { height: 57px; }
  .button-arrow { width: 47px; height: 47px; }
  .permission-note { margin-top: 7px; }
  .intro-ranking { bottom: auto; }
}

@media (max-width: 700px) {
  .intro-grid { grid-template-columns: 1fr; }
  .gesture-demo { display: none; }
  .intro-screen { padding: 120px 24px 25px; overflow-y: auto; }
  .steps { flex-wrap: wrap; }
  .game-title { display: none; }
  .game-header { grid-template-columns: 1fr 1fr; }
  .hud { width: 100%; grid-template-columns: 65px 1fr 75px 65px; gap: 7px; }
  .game-layout { grid-template-columns: 1fr; }
  .memory-board { max-height: none; }
  .tracking-dock { grid-template-columns: 1fr auto; }
  .tracking-dock > #trackingMessage { display: none; }
}

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