/* games.css - play pages: stage, overlays, HUD buttons, touch controls */
.play-page { padding: calc(var(--header-h) + 24px) 0 40px; }
.play-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.play-head h1 { font-size: clamp(1.6rem, 3.4vw, 2.6rem); margin: 0; text-transform: uppercase; }
.play-wrap { width: min(100% - 24px, 1180px); margin-inline: auto; }

.game-stage {
  position: relative; width: 100%; aspect-ratio: 16 / 10; background: #000; border-radius: 14px; overflow: hidden;
  border: 1px solid rgba(255, 77, 53, .4); box-shadow: var(--shadow), 0 0 60px rgba(255, 77, 53, .1);
  display: flex; align-items: center; justify-content: center; user-select: none; -webkit-user-select: none; touch-action: none;
}
.game-stage canvas { display: block; width: 100%; height: 100%; outline: none; background: #05070d; }
.game-stage.playing canvas { cursor: none; }
.game-stage.is-fs, .game-stage.pseudo-fs { border-radius: 0; border: 0; aspect-ratio: auto; width: 100vw; height: 100vh; height: 100dvh; }
.game-stage.pseudo-fs { position: fixed; inset: 0; z-index: 1900; }
.game-stage.is-fs canvas, .game-stage.pseudo-fs canvas { width: min(100vw, calc(100vh * 1.6)); height: auto; aspect-ratio: 16 / 10; }

/* overlays */
.ov { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px; overflow: auto; background: radial-gradient(700px 400px at 50% 40%, rgba(8, 11, 18, .72), rgba(4, 6, 12, .93)); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); animation: ovin .35s ease; }
@keyframes ovin { from { opacity: 0; } }
.ov-card { width: min(100%, 620px); text-align: center; margin: auto; }
.ov-kicker { font-family: var(--font-display); font-weight: 700; letter-spacing: .26em; text-transform: uppercase; font-size: .72rem; color: var(--accent2); margin: 0 0 6px; }
.ov h1 { font-size: clamp(1.9rem, 5vw, 3.4rem); text-transform: uppercase; margin: 0 0 6px; text-shadow: 0 0 30px rgba(255, 77, 53, .4); }
.ov h2 { text-transform: uppercase; font-size: clamp(1.4rem, 3.4vw, 2.2rem); }
.ov-tag { color: #c6cdda; margin-bottom: 14px; }
.opt { border: 0; padding: 0; margin: 0 0 12px; } .opt legend { font-family: var(--font-display); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin: 0 auto 6px; padding: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg-btn { font-family: var(--font-display); font-weight: 700; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; padding: 9px 20px; background: rgba(255, 255, 255, .04); color: var(--muted); border: 0; cursor: pointer; transition: background .2s, color .2s; }
.seg-btn:hover { color: #fff; } .seg-btn[aria-pressed="true"] { background: var(--accent); color: #fff; }
.ov-controls { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; font-size: .82rem; color: var(--muted); }
.ov-controls li { display: inline-flex; gap: 6px; align-items: center; }
.ov-best { color: var(--muted); margin-bottom: 14px; } .ov-best b { color: var(--gold); font-family: var(--font-display); font-size: 1.2rem; }
.big-score { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.8rem, 9vw, 5rem); line-height: 1; margin: 4px 0 6px; background: linear-gradient(180deg, #fff, var(--gold)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.best-tag { display: inline-block; font-family: var(--font-display); font-weight: 800; letter-spacing: .16em; text-transform: uppercase; font-size: .78rem; padding: 5px 14px; border-radius: 999px; background: var(--gold); color: #231600; animation: pulse 1.2s infinite; margin: 0 0 8px; }
.ov-stats { list-style: none; margin: 12px auto; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.ov-stats li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 8px; background: rgba(255, 255, 255, .05); font-size: .88rem; } .ov-stats span { color: var(--muted); } .ov-stats b { font-family: var(--font-display); }
.xp-gain { margin: 14px auto; max-width: 420px; text-align: left; } .xp-gain span { font-family: var(--font-display); font-weight: 800; color: var(--accent2); display: block; margin-bottom: 6px; } .xp-gain small { color: var(--muted); } .xp-gain .xp-track { margin: 0 0 6px; height: 8px; }
.lvup { color: var(--gold); animation: pulse 1s infinite; }
.ach-chips { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; } .ach-chips li { padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255, 209, 102, .5); background: rgba(255, 209, 102, .1); color: var(--gold); font-family: var(--font-display); font-weight: 700; font-size: .82rem; } .ach-chips span { margin-right: 6px; }
.col-sm { }

/* stage buttons */
.stage-bar { position: absolute; top: 10px; right: 10px; z-index: 12; display: flex; gap: 6px; opacity: .75; transition: opacity .2s; }
.game-stage:hover .stage-bar, .stage-bar:focus-within { opacity: 1; }
.sbtn { font-family: var(--font-display); font-weight: 700; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; padding: 7px 12px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(8, 11, 18, .7); color: #fff; cursor: pointer; backdrop-filter: blur(6px); }
.sbtn:hover { border-color: var(--accent2); } .sbtn.off { color: var(--muted); text-decoration: line-through; }
.game-stage.playing .stage-bar { opacity: .35; } .game-stage.playing .stage-bar:hover { opacity: 1; }

/* touch controls */
.touch-ui { position: absolute; inset: auto 0 0 0; z-index: 11; display: none; justify-content: flex-end; gap: 10px; padding: 12px; pointer-events: none; flex-wrap: wrap; }
.game-stage.is-touch .touch-ui { display: flex; } .game-stage.is-touch:not(.playing) .touch-ui { display: none; }
.tbtn { pointer-events: auto; touch-action: none; min-width: 78px; height: 54px; border-radius: 14px; border: 2px solid rgba(255, 255, 255, .45); background: rgba(8, 11, 18, .55); color: #fff; font-family: var(--font-display); font-weight: 800; font-size: .74rem; letter-spacing: .06em; backdrop-filter: blur(4px); }
.tbtn.down { background: var(--accent); border-color: var(--accent); }

/* below-stage info */
.play-info { margin-top: 28px; }
.play-note { color: var(--muted); font-size: .88rem; margin: 12px 0 0; }
