:root {
  --glow: #7df9ff;
  --hot: #ff4bd8;
  --paper: #fff4c7;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #09040f; color: white; font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', system-ui, sans-serif; }
body { display: grid; place-items: center; min-height: 100vh; padding: clamp(6px, 1.5vw, 18px); }
button { font: inherit; min-width: 44px; min-height: 44px; cursor: pointer; touch-action: manipulation; }
.game-shell { position: relative; width: min(100vw - 12px, calc((100vh - 12px) * 16 / 9)); aspect-ratio: 16 / 9; overflow: hidden; border-radius: 18px; box-shadow: 0 22px 70px #000; background: #111; }
.screen-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; user-select: none; pointer-events: none; }
.hitbox { position: absolute; border: 0; background: transparent; color: transparent; border-radius: 18px; }
.hitbox:focus-visible { outline: 3px solid var(--glow); box-shadow: 0 0 18px 5px rgba(125,249,255,.45); }
.selected { outline: 2px solid rgba(255,228,92,.75); box-shadow: 0 0 18px 5px rgba(255,228,92,.38); }
.title-start { left: 35%; top: 69.5%; width: 30%; height: 9%; }
.title-how { left: 35%; top: 80.8%; width: 30%; height: 8.8%; }
.modal-backdrop { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(0,0,0,.55); padding: 3%; }
.how-card { position: relative; max-width: min(88%, 980px); max-height: 88%; }
.how-card img { display: block; width: 100%; max-height: 82vh; object-fit: contain; border-radius: 14px; box-shadow: 0 16px 50px #000; }
.close-modal { position: absolute; top: -18px; right: -18px; width: 58px; height: 58px; border-radius: 50%; border: 3px solid white; background: #ff2e63; color: white; font-size: 32px; line-height: 1; }
.select-panel { position: absolute; left: 36.1%; top: 28%; width: 27.8%; height: 48%; padding: 6.1% 1.8% 1.2%; display: flex; flex-direction: column; justify-content: flex-start; align-items: center; gap: clamp(8px, 1.25vw, 20px); text-align: center; background: transparent; border: 0; border-radius: 18px; text-shadow: 2px 2px #000; }
.select-panel h1, .select-panel h2 { margin: 0; letter-spacing: .05em; line-height: .95; }
.select-panel h1 { font-size: clamp(18px, 2.4vw, 41px); color: var(--paper); }
.select-panel h2 { font-size: clamp(28px, 4vw, 68px); color: var(--glow); }
.select-panel p { margin: 0; font-size: clamp(13px, 1.45vw, 24px); line-height: 1.1; max-width: 92%; }
.select-panel .game-button { margin-top: clamp(18px, 3vw, 48px); }
.turbo-hit { left: 4%; top: 16%; width: 27%; height: 73%; }
.hatred-hit { right: 4%; top: 16%; width: 27%; height: 73%; }
.area-label { position: absolute; top: 82%; padding: .45rem .8rem; background: rgba(0,0,0,.72); border: 2px solid white; border-radius: 999px; font-size: clamp(16px, 2vw, 32px); pointer-events: none; }
.label-turbo { left: 13%; } .label-hatred { right: 12%; }
.game-button { border: 3px solid #fff; border-radius: 999px; padding: .45rem 1rem; background: linear-gradient(180deg, #ffdf4d, #ff7a18); color: #220014; text-transform: uppercase; box-shadow: 0 6px 0 #7a2b00, 0 0 24px rgba(255,220,80,.35); }
.timer-box { position: absolute; right: 8.1%; top: 7.7%; width: 14.8%; height: 7.2%; display: grid; place-items: center; padding-left: 3.9%; font-size: clamp(21px, 2.85vw, 48px); line-height: 1; letter-spacing: .05em; text-shadow: 3px 3px #000; }
.score-box, .combo-box { position: absolute; bottom: 7.4%; min-width: 15%; padding: .3rem .65rem; background: rgba(0,0,0,.56); border: 2px solid rgba(255,255,255,.6); border-radius: 999px; font-size: clamp(14px, 1.55vw, 26px); text-align: center; text-shadow: 2px 2px #000; }
.score-box { left: 8.5%; }
.combo-box { right: 8.5%; }
.shift-target-word { position: absolute; left: 5.8%; top: 10.1%; width: 13%; height: 7%; display: grid; place-items: center; color: var(--paper); font-size: clamp(17px, 2.15vw, 36px); letter-spacing: .08em; text-align: center; z-index: 12; text-shadow: 3px 3px #000; }
.shelves { position: absolute; inset: 0; }
.shelf { position: absolute; border: 0; background: transparent; padding: 0; border-radius: 12px; }
.shelf:focus-visible { outline: 3px solid var(--glow); }
.shelf img.slot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 5px #000); }
.shelf img.icon { position: absolute; left: 50%; top: 55%; transform: translate(-50%, -50%); max-width: 58%; max-height: 58%; object-fit: contain; }
.shelf span { position: absolute; left: -10%; right: -10%; top: calc(100% + 2px); color: white; text-shadow: 2px 2px 0 #000, 0 0 5px #000; font-size: clamp(10px, .95vw, 17px); line-height: 1; text-align: center; }
.target { position: absolute; border: 0; background: transparent; padding: 0; border-radius: 16px; }
.returns-bin { left: 4.8%; top: 60%; width: 16.2%; height: 27%; }
.trash-bin { right: 4.8%; top: 60%; width: 16.2%; height: 27%; }
.target img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 8px #000); }
.current-tape { position: absolute; left: 50%; top: 73%; transform: translate(-50%, -50%); width: 16%; height: 24%; z-index: 30; cursor: pointer; pointer-events: auto; border: 0; background: transparent; padding: 0; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; color: white; text-shadow: 2px 2px #000; }
.current-tape img { display: block; max-width: 100%; max-height: 86%; object-fit: contain; filter: drop-shadow(0 9px 9px #000); pointer-events: auto; }
.current-tape span { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(10px, .95vw, 16px); }
.current-tape.armed { filter: drop-shadow(0 0 12px #ffe45c); transform: translate(-50%, -50%) scale(1.04); }
.dialogue { position: absolute; left: 32%; right: 32%; bottom: 3.2%; min-height: 6%; padding: .45% 1.2%; display: grid; place-items: center; z-index: 10; pointer-events: none; background: rgba(0,0,0,.58); border: 2px solid rgba(255,255,255,.75); border-radius: 18px; text-align: center; font-size: clamp(11px, 1.15vw, 19px); text-shadow: 2px 2px #000; }
.results-panel { position: absolute; left: 20.5%; top: 22%; width: 59%; height: 51%; padding: 2.4% 3.2%; background: rgba(255, 246, 198, .08); border: 0; border-radius: 18px; text-align: left; text-shadow: 2px 2px #000; }
.results-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0 6%; font-size: clamp(14px, 1.55vw, 26px); }
.stats-column { display: flex; flex-direction: column; gap: clamp(5px, .75vw, 13px); }
.host-comment { position: absolute; left: 8%; right: 8%; bottom: 18%; margin: 0; color: var(--paper); text-align: center; font-size: clamp(15px, 1.55vw, 26px); line-height: 1.15; z-index: 24; pointer-events: none; }
.result-actions { position: absolute; left: 0; right: 0; bottom: 7%; z-index: 35; display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; pointer-events: auto; }
.result-actions .game-button { pointer-events: auto; }
.rating-bar { position: absolute; left: 46%; top: 85.2%; width: 40%; height: 5.8%; display: flex; align-items: center; justify-content: flex-start; color: var(--paper); text-align: left; font-size: clamp(15px, 1.72vw, 29px); letter-spacing: .035em; text-shadow: 3px 3px #000; }
@media (max-width: 700px) {
  .select-panel { left: 35%; width: 30%; }
  .score-box, .combo-box { min-width: 17%; }
  .results-panel { left: 15%; top: 20%; width: 70%; height: 55%; padding: 2.1% 3%; }
  .results-stats { font-size: clamp(10px, 1.75vw, 16px); gap: 0 5%; }
  .stats-column { gap: clamp(3px, .55vw, 8px); }
  .failure-reason { font-size: clamp(9px, 1.4vw, 14px); margin-bottom: .25rem; }
  .host-comment { bottom: 19%; left: 6%; right: 6%; font-size: clamp(10px, 1.65vw, 16px); line-height: 1.05; white-space: normal; }
  .result-actions { bottom: 5%; gap: .55rem; z-index: 40; }
  .result-actions .game-button { min-height: 34px; padding: .22rem .7rem; font-size: clamp(10px, 1.6vw, 15px); border-width: 2px; box-shadow: 0 4px 0 #7a2b00, 0 0 16px rgba(255,220,80,.3); }
}
@media (max-height: 520px) {
  .results-panel { top: 18%; height: 58%; }
  .results-stats { font-size: clamp(9px, 1.55vw, 14px); }
  .host-comment { bottom: 18%; font-size: clamp(9px, 1.45vw, 14px); }
  .result-actions { bottom: 4%; }
  .result-actions .game-button { min-height: 32px; padding: .18rem .65rem; }
}
.failure-reason { margin: 0 0 .45rem; color: var(--paper); text-align: center; font-size: clamp(12px, 1.25vw, 21px); }
