/* PULSE RUNWAY — neon arcade rhythm game page, menus and HUD. */
.pr-page { --blue: #4d86ff; --cyan: #38d9ff; --pink: #ff4fd8; --violet: #a77bff; --ink: #eef0ff; --panel: #0b0723d9;
  margin: 0; background: #05030f; color: var(--ink); font-family: "Eurostile", "Bank Gothic", "Segoe UI", system-ui, sans-serif; min-height: 100vh; }
.pr-page [hidden] { display: none !important; }
.pr-skip { position: absolute; left: -999px; } .pr-skip:focus { left: 8px; top: 8px; z-index: 9; background: #000; padding: 6px 10px; }
.pr-nav { height: 48px; display: flex; justify-content: space-between; align-items: center; padding: 0 18px; box-sizing: border-box; }
.pr-nav a { color: #b9c6ff; text-decoration: none; font-weight: 700; }
.pr-brand { color: #fff !important; font-weight: 900; letter-spacing: 1px; }
.pr-brand span { color: var(--pink); } .pr-brand small { margin-left: 8px; font-size: 10px; color: #8d92c8; letter-spacing: 2px; }

.pr-stage { position: relative; height: calc(100vh - 48px); height: calc(100dvh - 48px); min-height: 480px; overflow: hidden; user-select: none; -webkit-user-select: none;
  touch-action: none; box-shadow: inset 0 0 0 1px #a77bff33; }
#game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.pr-screen { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 12px; box-sizing: border-box; overflow-y: auto; }
.pr-overlay { background: #05030fb0; z-index: 5; backdrop-filter: blur(3px); }
.pr-panel { background: var(--panel); border: 1px solid #a77bff55; border-radius: 18px; padding: 22px 26px; max-width: 760px; width: 100%; box-sizing: border-box;
  box-shadow: 0 0 40px #4d86ff33, inset 0 0 30px #a77bff14; text-align: center; margin: auto; }
.pr-small { max-width: 440px; }
.pr-eyebrow { margin: 0; letter-spacing: 5px; font-size: 12px; color: var(--cyan); }
.pr-panel h1 { margin: 6px 0; font-size: clamp(38px, 9vw, 76px); letter-spacing: 6px; font-weight: 900; text-shadow: 0 0 18px var(--blue), 0 0 40px var(--violet); animation: pr-glow 2.4s ease-in-out infinite; }
.pr-panel h1 em { color: var(--pink); font-style: normal; text-shadow: 0 0 18px var(--pink), 0 0 40px var(--pink); }
.pr-panel h2 { margin: 0 0 10px; letter-spacing: 3px; text-transform: uppercase; }
@keyframes pr-glow { 50% { filter: brightness(1.35); transform: scale(1.02); } }
.pr-sub, .pr-hint, .pr-mode-desc { color: #aab3ea; margin: 6px 0; }
.pr-hint { font-size: 13px; }
kbd { background: #1c1647; border: 1px solid #a77bff77; border-radius: 5px; padding: 1px 6px; font: inherit; font-size: 12px; }

.pr-menu { display: flex; flex-direction: column; gap: 10px; max-width: 320px; margin: 16px auto 8px; }
.pr-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.pr-btn { font: inherit; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--ink); background: #1a1342; border: 2px solid #4d86ff99; border-radius: 12px;
  padding: 12px 20px; cursor: pointer; min-height: 46px; transition: transform .12s, box-shadow .12s, background .12s; touch-action: manipulation; }
.pr-btn:hover, .pr-btn:focus-visible { transform: translateY(-2px); box-shadow: 0 0 18px #4d86ffaa; background: #251b5c; outline: none; }
.pr-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.pr-primary { background: linear-gradient(135deg, #ff4fd8, #7d4dff); border-color: #ffa6f0; box-shadow: 0 0 22px #ff4fd888; font-size: 1.1em; }
.pr-primary:hover, .pr-primary:focus-visible { background: linear-gradient(135deg, #ff6fe0, #9368ff); box-shadow: 0 0 30px #ff4fd8cc; }
.pr-icon-btn { font: inherit; width: 44px; height: 44px; border-radius: 12px; border: 2px solid #a77bff99; background: #140e38cc; color: var(--ink); cursor: pointer; align-self: center; touch-action: manipulation; }

.pr-tabs { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 6px; }
.pr-tab { font: inherit; font-weight: 800; background: #140e38; color: #aab3ea; border: 1px solid #a77bff55; border-radius: 999px; padding: 8px 18px; cursor: pointer; min-height: 40px; }
.pr-tab[aria-selected="true"] { background: var(--pink); color: #12031a; border-color: #fff; box-shadow: 0 0 14px #ff4fd8aa; }
.pr-songs { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 10px 0; }
.pr-song { font: inherit; text-align: left; color: var(--ink); background: #140e38; border: 2px solid #4d86ff44; border-radius: 12px; padding: 10px 12px; cursor: pointer; min-height: 64px; }
.pr-song b { display: block; font-size: 17px; } .pr-song small { color: #aab3ea; display: block; }
.pr-song[aria-checked="true"], .pr-diff[aria-checked="true"] { border-color: var(--cyan); box-shadow: 0 0 16px #38d9ff88; background: #1d1858; }
.pr-diffs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.pr-diff { font: inherit; color: var(--ink); background: #140e38; border: 2px solid #a77bff44; border-radius: 12px; padding: 8px 6px; cursor: pointer; min-height: 62px; }
.pr-diff b { display: block; letter-spacing: 2px; text-transform: uppercase; } .pr-diff small { color: #aab3ea; display: block; font-size: 12px; }
.pr-diff[data-diff="easy"] b { color: #5dff9a; } .pr-diff[data-diff="normal"] b { color: #ffd34d; } .pr-diff[data-diff="hard"] b { color: #ff4d6d; }
.pr-custom { text-align: left; margin: 6px 0; color: #c9d0ff; } .pr-custom summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.pr-custom-grid, .pr-practice { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; text-align: left; }
.pr-practice { background: #140e3899; border-radius: 12px; padding: 10px; margin: 8px 0; align-items: center; }
.pr-custom label, .pr-practice label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.pr-custom input[type=number] { width: 100px; } .pr-check { flex-direction: row !important; align-items: center; gap: 6px !important; }
.pr-page input, .pr-page select { font: inherit; color: var(--ink); background: #0e0a2c; border: 1px solid #a77bff77; border-radius: 8px; padding: 6px; }
.pr-page input[type=range] { padding: 0; accent-color: var(--pink); width: 100%; }

.pr-game { display: block; padding: 0; pointer-events: none; overflow: hidden; }
.pr-game > * { pointer-events: none; } .pr-game .pr-icon-btn, .pr-hud { pointer-events: auto; }
.pr-hud { display: flex; gap: 10px; padding: 8px 12px; align-items: stretch; background: linear-gradient(#05030fcc, #05030f00); position: relative; z-index: 2; }
.pr-hud-box { background: #0b0723cc; border: 1px solid #a77bff55; border-radius: 10px; padding: 4px 12px; min-width: 96px; display: flex; flex-direction: column; justify-content: center; }
.pr-hud-box small { font-size: 10px; letter-spacing: 2px; color: #8d92c8; } .pr-hud-box b { font-size: clamp(18px, 3.4vw, 26px); font-variant-numeric: tabular-nums; }
.pr-hud-mid { flex: 1; gap: 5px; } .pr-hud-mid small { text-align: center; color: var(--cyan); }
.pr-progress, .pr-life { height: 8px; border-radius: 99px; background: #ffffff1f; overflow: hidden; }
.pr-progress i, .pr-life i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--pink)); box-shadow: 0 0 10px var(--pink); }
.pr-life i { background: linear-gradient(90deg, #ff4d6d, #5dff9a); width: 100%; }
#hud-acc { color: var(--cyan); }
.pr-center { position: absolute; left: 0; right: 0; top: 46%; display: flex; flex-direction: column; align-items: center; transform: translateY(-50%); text-align: center; }
.pr-judge { height: 38px; font-size: clamp(24px, 5vw, 40px); font-weight: 900; letter-spacing: 3px; opacity: 0; text-shadow: 0 0 14px currentColor; }
.pr-judge.is-on { animation: pr-judge .55s ease-out both; }
.pr-judge small { display: block; font-size: 12px; letter-spacing: 2px; opacity: .8; margin-top: -4px; }
.pr-judge[data-j="perfect"] { color: #6ff7ff; } .pr-judge[data-j="great"] { color: #5dff9a; } .pr-judge[data-j="good"] { color: #ffd34d; } .pr-judge[data-j="miss"] { color: #ff4d6d; }
@keyframes pr-judge { 0% { opacity: 0; transform: scale(.6) translateY(10px); } 15% { opacity: 1; transform: scale(1.15); } 70% { opacity: 1; transform: scale(1) translateY(-6px); } 100% { opacity: 0; transform: translateY(-22px); } }
.pr-combo b { display: block; font-size: clamp(44px, 9vw, 84px); line-height: 1; font-weight: 900; text-shadow: 0 0 20px var(--pink), 0 0 6px #fff; }
.pr-combo small { letter-spacing: 6px; color: #d9d2ff; }
.pr-combo.is-bump b { animation: pr-bump .14s ease-out; }
@keyframes pr-bump { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }
.pr-milestone { font-size: clamp(22px, 5vw, 44px); font-weight: 900; letter-spacing: 5px; color: #fff; text-shadow: 0 0 20px var(--cyan), 0 0 40px var(--pink); opacity: 0; margin-top: 6px; }
.pr-milestone.is-on { animation: pr-mile 1.1s ease-out both; }
@keyframes pr-mile { 0% { opacity: 0; transform: scale(.5); } 20% { opacity: 1; transform: scale(1.25); } 80% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: translateY(-20px); } }
.pr-count { position: absolute; left: 0; right: 0; top: 38%; text-align: center; font-size: clamp(70px, 18vw, 150px); font-weight: 900; color: #fff; text-shadow: 0 0 30px var(--pink), 0 0 60px var(--blue); }
.pr-caption { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(92%, 560px); background: #0b0723ee; border: 1px solid var(--cyan); border-radius: 12px; padding: 10px 14px; text-align: center; box-shadow: 0 0 22px #38d9ff55; }
.pr-caption b { display: block; color: var(--cyan); letter-spacing: 2px; text-transform: uppercase; } .pr-caption span { font-size: 15px; }
.pr-keys-hint { position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; margin: 0; font-size: 12px; color: #8d92c8; }

.pr-results-panel { max-width: 560px; }
.pr-grade { font-size: clamp(64px, 16vw, 120px); font-weight: 900; line-height: 1.1; color: #ffd34d; text-shadow: 0 0 30px #ff4fd8, 0 0 60px #ffd34d88; animation: pr-glow 2s ease-in-out infinite; }
.pr-grade[data-g="D"] { color: #ff4d6d; } .pr-grade[data-g="C"] { color: #ff9b4d; } .pr-grade[data-g="B"] { color: #ffd34d; } .pr-grade[data-g="A"] { color: #5dff9a; }
.pr-grade[data-g="AA"] { color: #6ff7ff; } .pr-grade[data-g="AAA"] { color: #ff8cf0; }
.pr-best { color: #ffd34d; letter-spacing: 4px; font-weight: 900; margin: 0; }
.pr-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 12px 0; }
.pr-stats div { background: #140e38; border-radius: 10px; padding: 8px; } .pr-stats dt { font-size: 11px; letter-spacing: 2px; color: #8d92c8; text-transform: uppercase; } .pr-stats dd { margin: 0; font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; }
.is-perfect dd { color: #6ff7ff; } .is-great dd { color: #5dff9a; } .is-good dd { color: #ffd34d; } .is-miss dd { color: #ff4d6d; }

.pr-field { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; text-align: left; margin: 10px 0; font-weight: 700; }
.pr-field input, .pr-field select { grid-column: 1 / -1; } .pr-field output { color: var(--cyan); }
.pr-calibrate { margin-top: 12px; border-top: 1px solid #a77bff55; padding-top: 10px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.pr-tap { width: 100%; min-height: 76px; font-size: 24px; }
.pr-touch-hint { position: absolute; left: 50%; top: 64px; transform: translateX(-50%); background: #0b0723ee; border: 1px solid var(--pink); padding: 8px 16px; border-radius: 99px; z-index: 9; }

@media (max-width: 620px) {
  .pr-panel { padding: 16px 14px; } .pr-hud { padding: 6px 8px; gap: 6px; } .pr-hud-box { min-width: 0; padding: 3px 8px; }
  .pr-keys-hint { display: none; } .pr-diff small { display: none; }
}
@media (max-height: 520px) { .pr-nav { display: none; } .pr-stage { height: 100vh; height: 100dvh; } }
@media (prefers-reduced-motion: reduce) { .pr-panel h1, .pr-grade { animation: none; } }
