/* ============================================================
   4K TETRIS: ULTIMATE RAY TRACING EDITION
   OKUSAN ULTRA RENDER ENGINE (OURE) STYLING
   ============================================================ */

:root {
  --bg-deep: #05070c;
  --bg-card: rgba(13, 17, 28, 0.88);
  --bg-card-border: rgba(0, 240, 255, 0.22);
  --accent-cyan: #00f0ff;
  --accent-magenta: #ff0055;
  --accent-yellow: #ffe600;
  --accent-green: #00ff66;
  --text-main: #f0f4fc;
  --text-muted: #6e7d9b;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  --font-display: 'Orbitron', 'Chakra Petch', sans-serif;
  --font-tech: 'Chakra Petch', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-mono);
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: 
    radial-gradient(circle at 50% 10%, rgba(0, 240, 255, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 80% 90%, rgba(255, 0, 85, 0.06) 0%, transparent 50%),
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 32px 32px, 32px 32px;
}

/* Scaler container: expands to full window on large screens, scales down smoothly on small screens */
#screen-scaler {
  width: 100vw;
  height: 100vh;
  position: relative;
  transform-origin: center center;
  display: flex;
  justify-content: center;
  align-items: center;
}

#game-cabinet {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  background: #090c15;
  border: 1px solid rgba(0, 240, 255, 0.35);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.9), 0 0 25px rgba(0, 240, 255, 0.15);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* ==================== TOP BAR ==================== */
#top-bar {
  height: 48px;
  background: rgba(11, 15, 26, 0.95);
  border-bottom: 1px solid rgba(0, 240, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  font-family: var(--font-tech);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Next-Gen Top Bar Brand */
.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-badge-futuristic {
  background: linear-gradient(135deg, #ff0055 0%, #aa0033 100%);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 900;
  padding: 3px 8px;
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
  border-left: 2px solid #ff3377;
  letter-spacing: 0.08rem;
  box-shadow: 0 0 12px rgba(255, 0, 85, 0.45);
  position: relative;
  overflow: hidden;
}

.brand-badge-futuristic::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(60deg, transparent 40%, rgba(255, 255, 255, 0.5) 50%, transparent 60%);
  animation: badgeGlint 4s infinite linear;
}

@keyframes badgeGlint {
  0% { transform: translateX(-100%); }
  30%, 100% { transform: translateX(100%); }
}

.brand-title-group {
  position: relative;
  display: flex;
  flex-direction: column;
}

#header-matrix-canvas {
  position: absolute;
  top: -4px;
  left: -8px;
  width: 160px;
  height: 34px;
  pointer-events: none;
  opacity: 0.45;
  z-index: 0;
  border-radius: 4px;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.18rem;
  background: linear-gradient(135deg, #ffffff 0%, #cffafe 25%, #00f0ff 60%, #ff0077 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
  position: relative;
  z-index: 1;
}

.brand-edition {
  font-family: var(--font-tech);
  font-size: 0.6rem;
  color: #7dd3fc;
  letter-spacing: 0.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: -2px;
  position: relative;
  z-index: 1;
}

.edition-dot {
  width: 5px;
  height: 5px;
  background: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent-cyan);
  animation: dotPulse 1.5s infinite alternate;
}

@keyframes dotPulse {
  0% { opacity: 0.4; }
  100% { opacity: 1; }
}

.engine-badge {
  font-size: 0.7rem;
  color: var(--text-muted);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  padding-left: 10px;
}

.header-center .field-spec {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.04rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-badge {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  display: flex;
  gap: 5px;
}

.stat-badge .lbl {
  color: var(--text-muted);
}

.stat-badge .val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-weight: 700;
}

.icon-btn {
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--accent-cyan);
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-mono);
}

.icon-btn:hover {
  background: var(--accent-cyan);
  color: #000;
}

.header-action-btn {
  font-family: var(--font-tech);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.04rem;
  padding: 3px 8px;
}

.header-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 2px;
  flex-shrink: 0;
}

.header-action-btn.bench-btn {
  border-color: rgba(0, 255, 136, 0.45);
  color: #00ff88;
  background: rgba(0, 255, 136, 0.1);
}

.header-action-btn.bench-btn:hover {
  background: #00ff88;
  color: #000;
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.6);
}

.header-action-btn.exit-btn {
  border-color: rgba(255, 0, 85, 0.45);
  color: #ff3377;
}

.header-action-btn.exit-btn:hover {
  background: var(--accent-magenta);
  color: #fff;
  box-shadow: 0 0 12px rgba(255, 0, 85, 0.6);
}

/* ==================== MAIN GAME AREA ==================== */
#main-area {
  display: flex;
  flex: 1;
  height: calc(100% - 96px);
  min-height: 0;
  box-sizing: border-box;
  padding: 8px 12px;
  gap: 12px;
}

/* LEFT: VIEWPORT (DYNAMIC EXPANSION) */
#viewport-panel {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #000;
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.9);
}

.panel-header {
  height: 28px;
  background: rgba(14, 18, 30, 0.95);
  border-bottom: 1px solid rgba(0, 240, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  font-size: 0.7rem;
}

.panel-tag {
  color: var(--text-muted);
  letter-spacing: 0.05rem;
}

.viewport-tags {
  display: flex;
  gap: 6px;
}

.tag {
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 2px;
  font-weight: 700;
}

.tag-rt {
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
}

.tag-oipe {
  background: rgba(255, 230, 0, 0.15);
  border: 1px solid var(--accent-yellow);
  color: var(--accent-yellow);
}

#viewport-container {
  flex: 1;
  position: relative;
  background: #000;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  contain: layout paint size;
  will-change: transform;
}

#gl-canvas, #fallback-canvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  position: absolute;
  top: 0;
  left: 0;
}

#viewport-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#fx-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.combo-surge-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  border: 2px solid #00f0ff;
  box-shadow: inset 0 0 35px rgba(0, 240, 255, 0.6), 0 0 25px rgba(0, 240, 255, 0.6);
  z-index: 6;
  transition: opacity 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  mix-blend-mode: screen;
}

/* Tactical Viewport HUD Corner Brackets (Zero Obstruction Framing) */
.viewport-hud-corners {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 7;
}

.hud-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: rgba(0, 240, 255, 0.45);
  border-style: solid;
  pointer-events: none;
}

.hud-corner.top-left {
  display: none; /* Dedicated top-left region for Performance Monitor - eliminates overlap */
  top: 6px;
  left: 6px;
  border-width: 2px 0 0 2px;
}

.hud-corner.top-right {
  top: 6px;
  right: 6px;
  border-width: 2px 2px 0 0;
}

.hud-corner.bottom-left {
  bottom: 6px;
  left: 6px;
  border-width: 0 0 2px 2px;
}

.hud-corner.bottom-right {
  bottom: 6px;
  right: 6px;
  border-width: 0 2px 2px 0;
}

/* Tactical Vertical Altitude Depth Tape Gauge (Tracks 0..2160m Descent) */
.depth-gauge-tape {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(4, 9, 20, 0.78);
  border: 1px solid rgba(0, 240, 255, 0.28);
  border-radius: 4px;
  padding: 5px 3px;
  pointer-events: none;
  z-index: 10;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.7), inset 0 0 8px rgba(0, 240, 255, 0.05);
}

.depth-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 4px;
}

.depth-tag {
  font-family: var(--font-tech);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.08rem;
  color: rgba(0, 240, 255, 0.65);
}

.depth-val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: 0.54rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-shadow: 0 0 5px rgba(0, 240, 255, 0.5);
}

.depth-track {
  position: relative;
  width: 14px;
  height: 180px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 2px;
  margin: 2px 0;
}

.depth-ticks {
  position: absolute;
  inset: 0;
}

.tick-mark {
  position: absolute;
  left: 0;
  width: 5px;
  height: 1px;
  background: rgba(0, 240, 255, 0.35);
}

.tick-mark.t-0 { top: 0%; }
.tick-mark.t-500 { top: 23%; width: 8px; background: rgba(0, 240, 255, 0.55); }
.tick-mark.t-1000 { top: 46%; width: 8px; background: rgba(0, 240, 255, 0.55); }
.tick-mark.t-1500 { top: 69%; width: 8px; background: rgba(0, 240, 255, 0.55); }
.tick-mark.t-2160 { bottom: 0; width: 12px; background: var(--accent-cyan); }

.depth-caret {
  position: absolute;
  right: -5px;
  top: 0%;
  transform: translateY(-50%);
  font-size: 8px;
  line-height: 1;
  color: #00f0ff;
  text-shadow: 0 0 6px #00f0ff;
  transition: top 0.08s linear;
}

.depth-zone {
  margin-top: 4px;
  font-family: var(--font-tech);
  font-size: 0.46rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.04rem;
  text-align: center;
}

/* SVG Leader Line connecting 4px piece to Magnification Callout Bubble */
.callout-line-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 65;
  overflow: visible;
}

#callout-line,
#callout-arrow-head {
  filter: drop-shadow(0 0 2px rgba(0, 240, 255, 0.25));
}

/* Real-time Magnification Callout Bubble - Translucent Cyber Glass HUD */
.zoom-bubble {
  position: absolute;
  width: 142px;
  background: rgba(6, 14, 28, 0.65);
  border: 1px solid rgba(0, 240, 255, 0.40);
  border-radius: 12px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.65), 
    0 0 20px rgba(0, 240, 255, 0.20),
    inset 0 1px 1px rgba(255, 255, 255, 0.35),
    inset 0 0 16px rgba(0, 240, 255, 0.08);
  padding: 6px 7px 5px;
  pointer-events: none;
  z-index: 70;
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  transition: opacity 0.2s ease;
  will-change: left, top;
}

.bubble-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(0, 240, 255, 0.20);
}

.bubble-tag {
  font-family: var(--font-tech);
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 0.05rem;
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.5);
}

.bubble-zoom-val {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 800;
  background: rgba(0, 240, 255, 0.15);
  color: var(--accent-cyan);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid rgba(0, 240, 255, 0.35);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.25);
}

/* Circular Magnifying Lens Barrel */
.bubble-canvas-frame {
  position: relative;
  width: 128px;
  height: 128px;
  margin: 0 auto 5px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(12, 35, 60, 0.3) 0%, rgba(2, 6, 14, 0.85) 100%);
  border: 2px solid rgba(0, 240, 255, 0.55);
  box-shadow: 
    0 0 14px rgba(0, 240, 255, 0.28),
    inset 0 2px 6px rgba(255, 255, 255, 0.45),
    inset 0 -4px 10px rgba(0, 0, 0, 0.85),
    inset 0 0 16px rgba(0, 240, 255, 0.20);
  overflow: hidden;
}

/* High-Gloss Optical Lens Reflection Sheen (対角線ガラス反射・ハイライト) */
.bubble-canvas-frame::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.30) 0%,
    rgba(255, 255, 255, 0.10) 24%,
    rgba(255, 255, 255, 0.0) 45%,
    rgba(0, 240, 255, 0.04) 75%,
    rgba(0, 240, 255, 0.16) 100%
  );
  pointer-events: none;
  mix-blend-mode: screen;
}

#zoom-canvas {
  width: 128px;
  height: 128px;
  display: block;
  border-radius: 50%;
  image-rendering: pixelated;
  background: transparent;
}

.bubble-footer {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 5px;
}

.bubble-pixel-bar {
  display: flex;
  gap: 3px;
  justify-content: space-between;
}

.pixel-pill {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  font-weight: 700;
  padding: 2px 0;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.30);
  color: #fff;
  border-radius: 2px;
}

.bubble-info-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.52rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

#zoom-type-label {
  color: #fff;
  font-weight: 700;
}

#zoom-coords-label {
  color: var(--accent-cyan);
  font-weight: 700;
}

/* In-game banners */
.banner {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(5, 7, 12, 0.92);
  border: 2px solid var(--accent-magenta);
  box-shadow: 0 0 40px rgba(255, 0, 85, 0.6);
  padding: 18px 30px;
  text-align: center;
  border-radius: 8px;
  z-index: 50;
}

.banner-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--accent-magenta);
  text-shadow: 0 0 15px var(--accent-magenta);
  letter-spacing: 0.15rem;
}

.banner-subtitle {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: 0.85rem;
  color: #fff;
  margin-top: 6px;
  letter-spacing: 0.08rem;
}

.pause-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-top: 14px;
  pointer-events: auto;
}

.pause-actions .action-btn {
  padding: 8px 26px;
  font-size: 0.84rem;
  letter-spacing: 0.08rem;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.4);
}

/* HUD Floating Toast Notification (SAVE/LOAD Feedback) */
.game-toast {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(6, 12, 24, 0.94);
  border: 1px solid var(--accent-cyan);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 15px rgba(0, 240, 255, 0.3);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08rem;
  padding: 6px 16px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 85;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.game-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.game-toast.toast-warn {
  border-color: var(--accent-yellow);
  color: var(--accent-yellow);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 15px rgba(255, 230, 0, 0.3);
}

.game-toast.toast-error {
  border-color: var(--accent-magenta);
  color: var(--accent-magenta);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 15px rgba(255, 0, 85, 0.3);
}

/* Performance Overlay (In-Game Screen HUD) */
.perf-overlay {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #060a14;
  border: 1px solid rgba(0, 240, 255, 0.45);
  box-shadow: 0 4px 28px rgba(0, 0, 0, 0.98), 0 0 14px rgba(0, 240, 255, 0.18);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.65rem;
  width: 254px;
  box-sizing: border-box;
  pointer-events: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 40;
  transition: width 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.perf-overlay.minimized {
  width: 230px;
  padding-bottom: 6px;
}

.perf-overlay.minimized .perf-body {
  display: none !important;
}

.perf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 5px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(0, 240, 255, 0.22);
}

.perf-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.perf-status-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: pulseGlow 1.8s infinite alternate;
  display: inline-block;
}

.perf-title {
  font-family: var(--font-tech);
  font-weight: 700;
  font-size: 0.65rem;
  color: var(--accent-cyan);
  letter-spacing: 0.08rem;
  line-height: 1;
}

.perf-actions {
  display: flex;
  gap: 4px;
  pointer-events: auto;
}

.perf-hud-btn {
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: var(--accent-cyan);
  font-family: var(--font-tech);
  font-size: 0.58rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
  pointer-events: auto;
  line-height: 1.2;
}

.perf-hud-btn:hover {
  background: rgba(0, 240, 255, 0.28);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
  color: #fff;
}

.perf-hud-btn.icon {
  padding: 2px 5px;
  font-size: 0.72rem;
  line-height: 1;
}

.perf-body {
  display: flex;
  flex-direction: column;
}

/* 4-Stat Live Telemetry Row */
.perf-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 7px;
}

.perf-stat-pill {
  background: rgba(12, 18, 32, 0.75);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 4px;
  padding: 3px 2px;
  text-align: center;
}

.perf-stat-pill .lbl {
  display: block;
  font-size: 0.52rem;
  color: var(--text-muted);
  letter-spacing: 0.04rem;
  margin-bottom: 1px;
}

.perf-stat-pill .val {
  display: block;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
}

/* Oscilloscope Graph Box */
.perf-graph-box {
  background: rgba(2, 5, 10, 0.90);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 4px;
  padding: 4px 6px;
  margin-bottom: 7px;
}

.perf-graph-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.53rem;
  color: var(--text-muted);
  margin-bottom: 3px;
  letter-spacing: 0.04rem;
}

.perf-target-lbl {
  color: var(--accent-cyan);
  opacity: 0.85;
}

#perf-oscilloscope-canvas {
  display: block;
  width: 100%;
  height: 52px;
  border-radius: 2px;
  background: #020509;
}

/* Hardware & RT Specs Block */
.perf-specs-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.58rem;
  color: var(--text-muted);
}

.perf-row {
  display: flex;
  justify-content: space-between;
  line-height: 1.35;
}

.perf-row span:last-child {
  color: #fff;
  font-weight: 600;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.perf-row .accent {
  color: var(--accent-cyan) !important;
}

.perf-row .accent-white {
  color: #fff !important;
}

/* In-Game Benchmark Status Panel (Active during 15s stress test) */
.hud-bench-panel {
  margin-top: 7px;
  padding: 6px 8px;
  background: rgba(255, 136, 0, 0.12);
  border: 1px solid rgba(255, 136, 0, 0.45);
  border-radius: 4px;
  pointer-events: auto;
  box-sizing: border-box;
}

.hud-bench-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: 0.58rem;
  font-weight: 700;
}

.hud-bench-phase {
  color: #ffaa00;
  letter-spacing: 0.04rem;
}

.hud-bench-time {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: 0.75rem;
  color: #ffe600;
  font-weight: 900;
}

.hud-bench-bar {
  height: 5px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}

#hud-bench-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff8800, #ff0055);
  box-shadow: 0 0 8px #ff8800;
  transition: width 0.1s linear;
}

.hud-bench-desc {
  font-size: 0.52rem;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.02rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

/* In-Game Benchmark Verdict Badge */
.hud-bench-result {
  margin-top: 7px;
  padding: 6px 8px;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.5);
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  pointer-events: auto;
  animation: glowBadge 2s infinite alternate;
  box-sizing: border-box;
}

.hud-rank-shield {
  width: 32px;
  height: 32px;
  border: 2px solid var(--accent-cyan);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 240, 255, 0.18);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
  flex-shrink: 0;
}

#hud-rank-code {
  font-family: var(--font-tech);
  font-size: 0.82rem;
  font-weight: 900;
  color: var(--accent-cyan);
  text-shadow: 0 0 6px var(--accent-cyan);
}

.hud-verdict-details {
  flex: 1;
  min-width: 0;
}

.hud-v-title {
  font-family: var(--font-tech);
  font-size: 0.62rem;
  font-weight: 900;
  color: var(--accent-cyan);
  letter-spacing: 0.04rem;
  margin-bottom: 2px;
}

.hud-v-sub {
  font-size: 0.55rem;
  color: #ccc;
  line-height: 1.25;
}

.hud-close-btn {
  background: transparent;
  border: none;
  color: #888;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  position: absolute;
  top: 4px;
  right: 4px;
  pointer-events: auto;
}

.hud-close-btn:hover {
  color: #fff;
}


/* ==================== RIGHT SIDEBAR ==================== */
#sidebar-panel {
  width: 250px;
  flex: 0 0 250px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

#sidebar-panel::-webkit-scrollbar {
  width: 4px;
}

#sidebar-panel::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.3);
  border-radius: 2px;
}

.hud-row {
  display: flex;
  gap: 8px;
}

.hud-box {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 6px;
  padding: 8px 10px;
  box-shadow: inset 0 0 15px rgba(0, 240, 255, 0.05);
}

.box-title {
  font-family: var(--font-tech);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 0.08rem;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(0, 240, 255, 0.15);
  padding-bottom: 3px;
}

.hold-box, .next-box {
  flex: 1;
}

.preview-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 4px;
}

#hold-canvas {
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
}

#next-canvas {
  width: 64px;
  height: 128px;
  image-rendering: pixelated;
}

.stats-box .stat-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.stats-box .stat-columns {
  display: flex;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 6px;
}

.stat-col {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.label {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.val-large {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02rem;
}

.val-mid {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

/* Reactor Core Overcharge 10-Cell Energy Progress Gauge */
.level-progress-wrap {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.level-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.lp-label {
  font-family: var(--font-tech);
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05rem;
}

.lp-val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.reactor-cells {
  display: flex;
  gap: 3px;
  height: 9px;
  background: rgba(0, 0, 0, 0.45);
  padding: 2px;
  border-radius: 3px;
  border: 1px solid rgba(0, 240, 255, 0.2);
}

.r-cell {
  flex: 1;
  height: 100%;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 1px;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.r-cell.charged {
  background: linear-gradient(180deg, #00f0ff, #0077ff);
  box-shadow: 0 0 5px rgba(0, 240, 255, 0.7);
}

.reactor-cells.overcharged .r-cell {
  background: linear-gradient(180deg, #ffe600, #ff8800);
  box-shadow: 0 0 8px rgba(255, 230, 0, 0.9);
  animation: reactorOverchargePulse 0.35s ease 3;
}

@keyframes reactorOverchargePulse {
  0%, 100% { opacity: 1; filter: brightness(1.2); }
  50% { opacity: 0.4; filter: brightness(2.2); }
}

/* Minimap */
.minimap-wrapper {
  background: #000;
  border: 1px solid rgba(0, 240, 255, 0.4);
  position: relative;
  width: 192px;
  height: 108px;
  margin: 0 auto;
  cursor: crosshair;
}

#minimap-canvas {
  width: 192px;
  height: 108px;
  display: block;
}

.minimap-hint {
  font-size: 0.52rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 3px;
  letter-spacing: 0.05rem;
}

/* Preset buttons */
.preset-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.preset-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  font-family: var(--font-tech);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 4px 2px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
}

.preset-btn:hover {
  background: rgba(0, 240, 255, 0.15);
  color: #fff;
}

.preset-btn.active {
  background: rgba(0, 240, 255, 0.25);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

.preset-btn.danger-btn {
  border-color: rgba(255, 0, 85, 0.5);
  color: var(--accent-magenta);
}

.preset-btn.danger-btn.active {
  background: rgba(255, 0, 85, 0.25);
  border-color: var(--accent-magenta);
  color: #fff;
  box-shadow: 0 0 10px rgba(255, 0, 85, 0.4);
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.action-btn {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(0, 119, 255, 0.2));
  border: 1px solid var(--accent-cyan);
  color: #fff;
  font-family: var(--font-tech);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 6px;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.06rem;
  transition: all 0.2s;
  text-align: center;
}

.action-btn:hover {
  background: var(--accent-cyan);
  color: #000;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.6);
}

.state-btn-group {
  display: flex;
  gap: 4px;
  width: 100%;
}

.state-btn-group .action-btn {
  flex: 1;
  padding: 5px 2px;
  font-size: 0.65rem;
}

.action-btn.state-btn {
  background: rgba(0, 240, 255, 0.12);
  border-color: rgba(0, 240, 255, 0.4);
  color: var(--accent-cyan);
}

.action-btn.state-btn:hover {
  background: var(--accent-cyan);
  color: #000;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.6);
}

.action-btn.exit-btn {
  background: rgba(255, 0, 85, 0.12);
  border-color: rgba(255, 0, 85, 0.4);
  color: #ff4d88;
}

.action-btn.exit-btn:hover {
  background: var(--accent-magenta);
  color: #fff;
  box-shadow: 0 0 12px rgba(255, 0, 85, 0.6);
}

.test-btn {
  background: rgba(255, 230, 0, 0.12);
  border-color: rgba(255, 230, 0, 0.45);
  color: var(--accent-yellow);
  padding: 8px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05rem;
  margin-top: 3px;
}

.test-btn:hover {
  background: var(--accent-yellow);
  color: #000;
  box-shadow: 0 0 15px rgba(255, 230, 0, 0.6);
}

/* ==================== BOTTOM BAR ==================== */
#bottom-bar {
  height: 48px;
  background: rgba(11, 15, 26, 0.95);
  border-top: 1px solid rgba(0, 240, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  font-size: 0.68rem;
}

.footer-telemetry {
  display: flex;
  gap: 16px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.footer-telemetry strong {
  color: #fff;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.footer-controls-guide {
  display: flex;
  gap: 10px;
  align-items: center;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.footer-controls-guide span {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

kbd {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 3px;
  padding: 1px 4px;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 0.65rem;
}

/* ==================== MODALS & BOOT ==================== */
.full-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #04060a;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.4s ease;
  overflow: hidden;
}

#matrix-rain-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.55;
}

.boot-container {
  position: relative;
  z-index: 3;
  max-width: 720px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transform: translate(var(--screen-jitter-x, 0px), var(--screen-jitter-y, 0px));
  will-change: transform;
}

/* State-of-the-Art Futuristic Boot Logo Wrap with Frosted Matrix Window */
.boot-logo-wrap {
  position: relative;
  padding: 24px 36px;
  background: linear-gradient(180deg, rgba(8, 14, 28, 0.72) 0%, rgba(4, 7, 14, 0.88) 100%);
  border: 1px solid rgba(0, 240, 255, 0.4);
  border-radius: 12px;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.95), inset 0 0 30px rgba(0, 240, 255, 0.1);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  width: 100%;
  margin-bottom: 8px;
  /* Audio-Sync Beat Jitter & Micro-Blur Kick */
  transform: translate(var(--beat-jitter-x, 0px), var(--beat-jitter-y, 0px)) scale(var(--beat-scale, 1));
  filter: blur(var(--beat-blur, 0px));
  will-change: transform, filter;
  transition: border-color 0.06s ease, box-shadow 0.06s ease;
  overflow: hidden;
}

/* Anamorphic Sci-Fi Horizontal Lens Flare Sweep */
.boot-anamorphic-flare {
  position: absolute;
  top: 50%;
  left: -20%;
  width: 140%;
  height: 3px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(0, 240, 255, 0) 20%, 
    rgba(0, 240, 255, 0.95) 47%, 
    #ffffff 50%, 
    rgba(255, 0, 85, 0.95) 53%, 
    rgba(255, 0, 85, 0) 80%, 
    transparent 100%
  );
  box-shadow: 
    0 0 16px rgba(0, 240, 255, 0.9), 
    0 0 35px rgba(255, 0, 85, 0.8),
    0 -1px 3px #ffffff,
    0 1px 3px #ffffff;
  pointer-events: none;
  opacity: var(--beat-flare-alpha, 0.55);
  transform: translateY(-50%) scaleY(var(--beat-flare-scale, 1));
  mix-blend-mode: screen;
  z-index: 4;
}

.boot-star-glint {
  position: absolute;
  width: 14px;
  height: 14px;
  background: radial-gradient(circle, #ffffff 20%, rgba(0, 240, 255, 0.85) 60%, transparent 100%);
  pointer-events: none;
  clip-path: polygon(50% 0%, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0% 50%, 38% 38%);
  animation: starGlintPulse 2.4s infinite ease-in-out;
  z-index: 5;
}

.boot-star-glint.glint-1 {
  top: 36px;
  left: 140px;
  animation-delay: 0.3s;
}

.boot-star-glint.glint-2 {
  top: 68px;
  right: 150px;
  animation-delay: 1.2s;
}

@keyframes starGlintPulse {
  0%, 100% { transform: scale(0.6) rotate(0deg); opacity: 0.3; }
  50% { transform: scale(1.3) rotate(90deg); opacity: 1; filter: drop-shadow(0 0 8px #00f0ff); }
}

.boot-logo-wrap::before, .boot-logo-wrap::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-color: var(--accent-cyan);
  border-style: solid;
}
.boot-logo-wrap::before {
  top: -2px;
  left: -2px;
  border-width: 2px 0 0 2px;
}
.boot-logo-wrap::after {
  bottom: -2px;
  right: -2px;
  border-width: 0 2px 2px 0;
}

.boot-tech-bracket {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.25rem;
  color: var(--accent-cyan);
  opacity: 0.85;
  margin-bottom: 8px;
}

.boot-logo-headline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 14px 0 24px 0;
  transform-style: preserve-3d;
  animation: gurinGurin3D 5.5s infinite ease-in-out;
  cursor: grab;
  /* Floor mirror reflection below the 3D rotating title */
  -webkit-box-reflect: below 2px linear-gradient(transparent 55%, rgba(0, 240, 255, 0.15) 85%, rgba(255, 255, 255, 0.4) 100%);
  /* Combined 3D drop shadow, Chromatic RGB Aberration Split & Dynamic Bass Glow */
  filter: drop-shadow(var(--beat-chroma-x, 0px) var(--beat-chroma-y, 0px) 0 rgba(0, 240, 255, var(--beat-chroma-alpha, 0)))
          drop-shadow(calc(-1 * var(--beat-chroma-x, 0px)) calc(-1 * var(--beat-chroma-y, 0px)) 0 rgba(255, 0, 85, var(--beat-chroma-alpha, 0)))
          drop-shadow(0 15px 30px rgba(0, 0, 0, 0.9))
          drop-shadow(0 0 var(--beat-glow-size, 15px) rgba(0, 240, 255, var(--beat-glow-alpha, 0.2)));
  will-change: filter;
}

@keyframes gurinGurin3D {
  0% {
    transform: perspective(1000px) rotateX(14deg) rotateY(-22deg) rotateZ(-3deg) translateZ(10px);
  }
  25% {
    transform: perspective(1000px) rotateX(-12deg) rotateY(18deg) rotateZ(4deg) translateZ(26px) scale(1.04);
  }
  50% {
    transform: perspective(1000px) rotateX(16deg) rotateY(24deg) rotateZ(-2deg) translateZ(12px);
  }
  75% {
    transform: perspective(1000px) rotateX(-14deg) rotateY(-18deg) rotateZ(3deg) translateZ(26px) scale(1.04);
  }
  100% {
    transform: perspective(1000px) rotateX(14deg) rotateY(-22deg) rotateZ(-3deg) translateZ(10px);
  }
}

.boot-badge-4k {
  font-family: var(--font-display);
  font-size: 2.7rem;
  font-weight: 900;
  color: #fff;
  /* High-Gloss Mirror Platinum / Chrome with Neon Accent */
  background: linear-gradient(135deg, 
    #ffffff 0%, 
    #f1f5f9 12%, 
    #94a3b8 28%, 
    #ffffff 44%, 
    #1e293b 50%, 
    #0f172a 56%, 
    #ff0055 82%, 
    #ff3377 100%
  );
  background-size: 220% 220%;
  animation: chromeShimmer 4s infinite ease-in-out;
  padding: 6px 22px;
  border-radius: 8px;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-left: 4px solid #00f0ff;
  border-right: 4px solid #ff0055;
  letter-spacing: 0.2rem;
  box-shadow: 
    0 0 25px rgba(0, 240, 255, 0.65),
    0 0 45px rgba(255, 0, 85, 0.5),
    inset 0 2px 4px rgba(255, 255, 255, 0.95),
    inset 0 -2px 6px rgba(0, 0, 0, 0.85);
  text-shadow: 
    0 1px 2px #fff,
    0 3px 6px rgba(0, 0, 0, 0.9),
    0 0 20px rgba(255, 255, 255, 0.9);
  transform: translateZ(32px);
  display: inline-block;
}

.boot-text-tetris {
  font-family: var(--font-display);
  font-size: 4.6rem;
  font-weight: 900;
  letter-spacing: 0.6rem;
  /* Ultimate Liquid Mirror Chrome Horizon Gradient */
  background: linear-gradient(175deg,
    #ffffff 0%,
    #f8fafc 16%,
    #93c5fd 30%,
    #e2e8f0 44%,
    #ffffff 48%,
    #090d16 50%,
    #1e293b 53%,
    #0284c7 66%,
    #38bdf8 78%,
    #00f0ff 88%,
    #ffffff 94%,
    #ff0055 100%
  );
  background-size: 220% 220%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: chromeShimmer 5s infinite ease-in-out;
  /* 3D Extruded Chrome Bevel & Specular Gleam Drop Shadows */
  filter: drop-shadow(0 2px 0 #ffffff)
          drop-shadow(0 4px 1px #38bdf8)
          drop-shadow(0 7px 3px rgba(0, 0, 0, 0.85))
          drop-shadow(0 12px 20px rgba(0, 240, 255, 0.7))
          drop-shadow(0 18px 40px rgba(0, 0, 0, 0.95));
  transform: translateZ(45px);
  position: relative;
  display: inline-block;
}

@keyframes chromeShimmer {
  0% {
    background-position: 0% 15%;
  }
  50% {
    background-position: 100% 85%;
  }
  100% {
    background-position: 0% 15%;
  }
}

.boot-laser-divider {
  width: 85%;
  height: 2px;
  margin: 10px auto;
  background: linear-gradient(90deg, transparent 0%, var(--accent-cyan) 50%, transparent 100%);
  box-shadow: 0 0 10px var(--accent-cyan);
  animation: laserPulse 2.5s infinite ease-in-out;
}

@keyframes laserPulse {
  0%, 100% { opacity: 0.5; transform: scaleX(0.85); }
  50% { opacity: 1; transform: scaleX(1.0); }
}

.boot-edition-tag {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.45rem;
  color: var(--accent-magenta);
  text-shadow: 0 0 15px rgba(255, 0, 85, 0.6);
}

.boot-powered {
  font-family: var(--font-tech);
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.15rem;
  margin-top: 10px;
}

.boot-micro-specs {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: #38bdf8;
  letter-spacing: 0.1rem;
  margin-top: 6px;
  opacity: 0.8;
}

.boot-specs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
  margin: 16px 0 12px 0;
}

.spec-card {
  background: rgba(14, 18, 30, 0.8);
  border: 1px solid rgba(0, 240, 255, 0.3);
  padding: 10px 6px;
  border-radius: 6px;
}

.spec-num {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.spec-label {
  font-size: 0.58rem;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 0.05rem;
}

/* Terminal Hardware Log Cascade */
.boot-terminal {
  width: 100%;
  height: 140px;
  background: rgba(2, 6, 14, 0.94);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 6px;
  padding: 8px 12px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #38bdf8;
  overflow-y: auto;
  margin-bottom: 14px;
  box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.95), 0 0 10px rgba(0, 240, 255, 0.08);
}

.boot-terminal::-webkit-scrollbar {
  width: 4px;
}
.boot-terminal::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.7);
}
.boot-terminal::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.35);
  border-radius: 2px;
}
.boot-terminal::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 240, 255, 0.7);
}

.terminal-line {
  line-height: 1.42;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.68rem;
  color: #94a3b8;
}

.terminal-line .time {
  color: #475569;
  margin-right: 6px;
}

.terminal-line .log-ok {
  color: #00ff66;
  font-weight: 700;
  text-shadow: 0 0 5px rgba(0, 255, 102, 0.6);
}

.terminal-line .log-info {
  color: #00f0ff;
  font-weight: 600;
}

.terminal-line .log-warn {
  color: #ffe600;
  font-weight: 600;
}

.terminal-line .log-sys {
  color: #ff0077;
  font-weight: 700;
}

.terminal-line .log-tele {
  color: #c084fc;
}

.boot-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.boot-sub-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}

.start-btn {
  background: linear-gradient(135deg, var(--accent-cyan), #0077ff);
  border: none;
  color: #04060a;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  padding: 12px 36px;
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 0.15rem;
  transition: all 0.2s;
}

.start-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.start-btn:not(.disabled):hover {
  transform: scale(1.04);
  box-shadow: 0 0 30px var(--accent-cyan);
}

.start-btn.load-btn {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.25), rgba(0, 119, 255, 0.45));
  border: 1px solid var(--accent-cyan);
  color: #fff;
  font-size: 0.82rem;
  padding: 8px 24px;
}

.start-btn.load-btn:hover {
  background: var(--accent-cyan);
  color: #04060a;
  box-shadow: 0 0 25px var(--accent-cyan);
}

.start-btn.fullscreen-btn {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.18), rgba(0, 119, 255, 0.32));
  border: 1px solid rgba(0, 240, 255, 0.65);
  color: #fff;
  font-family: var(--font-tech);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1rem;
  padding: 8px 22px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.2);
}

.start-btn.fullscreen-btn:hover {
  background: var(--accent-cyan);
  color: #04060a;
  box-shadow: 0 0 25px var(--accent-cyan);
  transform: scale(1.03);
}

.start-btn.fullscreen-btn.is-active {
  background: linear-gradient(135deg, rgba(0, 255, 102, 0.2), rgba(0, 240, 255, 0.3));
  border-color: #00ff66;
  color: #00ff66;
  box-shadow: 0 0 16px rgba(0, 255, 102, 0.35);
}

.start-btn.fullscreen-btn.is-active:hover {
  background: #00ff66;
  color: #04060a;
  box-shadow: 0 0 25px #00ff66;
}

.boot-fs-icon {
  font-size: 1.05rem;
  line-height: 1;
}

/* Title Screen Top-Right Quick Corner Controls */
.boot-corner-controls {
  position: absolute;
  top: 14px;
  right: 18px;
  z-index: 60;
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.boot-corner-btn {
  background: rgba(6, 12, 24, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.45);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08rem;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6), inset 0 0 10px rgba(0, 240, 255, 0.1);
  transition: all 0.2s ease;
}

.boot-corner-btn:hover {
  background: var(--accent-cyan);
  color: #04060a;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.6);
  transform: translateY(-1px);
}

.boot-corner-btn.is-active {
  border-color: #00ff66;
  color: #00ff66;
  box-shadow: 0 0 15px rgba(0, 255, 102, 0.4);
}

.boot-corner-btn.is-active:hover {
  background: #00ff66;
  color: #04060a;
}

.boot-corner-icon {
  font-size: 0.85rem;
  line-height: 1;
}

/* Q-SOUND 3D Spatial Audio Buttons (CPS-2 Style) */
.boot-qsound-corner-btn {
  border-color: rgba(255, 230, 0, 0.55);
  color: #ffe600;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6), inset 0 0 10px rgba(255, 230, 0, 0.12);
}

.boot-qsound-corner-btn:hover {
  background: #ffe600;
  color: #04060a;
  border-color: #ffe600;
  box-shadow: 0 0 20px rgba(255, 230, 0, 0.8);
}

.boot-qsound-corner-btn.qsound-active {
  border-color: #ffe600;
  background: linear-gradient(135deg, rgba(255, 230, 0, 0.22), rgba(0, 240, 255, 0.18));
  color: #ffe600;
  box-shadow: 0 0 18px rgba(255, 230, 0, 0.65), inset 0 0 12px rgba(0, 240, 255, 0.3);
}

.boot-qsound-corner-btn.qsound-active .qsound-status-text {
  color: #00f0ff;
  font-weight: 800;
  text-shadow: 0 0 8px #00f0ff;
}

.start-btn.qsound-hero-btn {
  background: linear-gradient(135deg, rgba(25, 22, 10, 0.85), rgba(10, 24, 34, 0.9));
  border: 1px solid rgba(255, 230, 0, 0.65);
  color: #ffe600;
  font-family: var(--font-tech);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1rem;
  padding: 8px 22px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 0 16px rgba(255, 230, 0, 0.25);
  box-sizing: border-box;
}

.start-btn.qsound-hero-btn:hover {
  background: linear-gradient(135deg, #ffe600, #ffb700);
  color: #04060a;
  box-shadow: 0 0 25px rgba(255, 230, 0, 0.85);
  transform: scale(1.03);
}

.start-btn.qsound-hero-btn.qsound-active {
  background: linear-gradient(135deg, rgba(255, 230, 0, 0.25), rgba(0, 240, 255, 0.22));
  border-color: #ffe600;
  color: #ffe600;
  box-shadow: 0 0 25px rgba(255, 230, 0, 0.75), inset 0 0 16px rgba(0, 240, 255, 0.35);
  animation: qsound-hero-pulse 2.2s infinite ease-in-out;
}

.start-btn.qsound-hero-btn.qsound-active:hover {
  background: #ffe600;
  color: #04060a;
  box-shadow: 0 0 30px #ffe600;
}

.start-btn.qsound-hero-btn.qsound-active .qsound-status-text {
  color: #00f0ff;
  font-weight: 800;
  text-shadow: 0 0 10px #00f0ff;
}

.qsound-hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  line-height: 1;
}

.qsound-hero-svg {
  width: 17px;
  height: 17px;
  display: block;
}

.header-action-btn.qsound-header-btn {
  border-color: rgba(255, 230, 0, 0.5);
  color: #ffe600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.header-action-btn.qsound-header-btn:hover {
  background: #ffe600;
  color: #04060a;
  box-shadow: 0 0 14px rgba(255, 230, 0, 0.8);
}

.header-action-btn.qsound-header-btn.qsound-active {
  background: linear-gradient(135deg, rgba(255, 230, 0, 0.28), rgba(0, 240, 255, 0.22));
  border-color: #ffe600;
  color: #ffe600;
  box-shadow: 0 0 14px rgba(255, 230, 0, 0.7), inset 0 0 8px rgba(0, 240, 255, 0.35);
}

@keyframes qsound-hero-pulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(255, 230, 0, 0.65), inset 0 0 14px rgba(0, 240, 255, 0.3);
    border-color: #ffe600;
  }
  50% {
    box-shadow: 0 0 32px rgba(255, 230, 0, 0.95), 0 0 15px rgba(0, 240, 255, 0.5), inset 0 0 20px rgba(0, 240, 255, 0.5);
    border-color: #fff159;
  }
}

.boot-skip-hint {
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.08rem;
}

/* Title Screen Footer: Developer Credits & Discreet Saisen Banner (Side by Side) */
.boot-footer-row {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
  max-width: 720px;
  width: 95%;
  pointer-events: auto;
  z-index: 10;
  flex-wrap: wrap;
}

.boot-dev-credit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 0;
  padding: 5px 14px;
  background: rgba(6, 12, 24, 0.72);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 20px;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7), inset 0 0 10px rgba(0, 240, 255, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}

.boot-dev-credit:hover {
  border-color: rgba(0, 240, 255, 0.6);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 12px rgba(0, 240, 255, 0.3);
}

.boot-dev-credit .dev-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 240, 255, 0.5);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
  display: block;
  object-fit: cover;
  flex-shrink: 0;
}

.boot-dev-credit .dev-text {
  font-family: var(--font-tech), "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  color: #e2e8f0;
  letter-spacing: 0.06rem;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.25);
}

/* Saisen (お賽銭) Discreet Banner (Developの横に小さく目立たなく配置) */
.boot-saisen-banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  max-width: 380px;
  background: rgba(14, 10, 6, 0.62);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 8px;
  text-decoration: none;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.65), inset 0 0 8px rgba(245, 158, 11, 0.04);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  flex-shrink: 1;
}

.boot-saisen-banner:hover {
  background: rgba(26, 18, 9, 0.88);
  border-color: rgba(251, 191, 36, 0.65);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.8), 0 0 12px rgba(245, 158, 11, 0.25);
  transform: translateY(-1px);
}

.saisen-banner-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 0 3px rgba(245, 158, 11, 0.5));
}

.saisen-svg-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.boot-saisen-banner:hover .saisen-svg-icon circle {
  animation: coinDropPulse 0.7s infinite alternate ease-in-out;
}

@keyframes coinDropPulse {
  0% { transform: translateY(0); }
  100% { transform: translateY(1.5px); }
}

.saisen-banner-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 1px;
  min-width: 0;
}

.saisen-banner-top {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}

.saisen-banner-title {
  font-family: var(--font-tech), "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  font-size: 0.64rem;
  font-weight: 700;
  color: #fbbf24;
  letter-spacing: 0.04rem;
  text-shadow: 0 0 6px rgba(245, 158, 11, 0.35);
}

.saisen-banner-badge {
  font-family: var(--font-mono);
  font-size: 0.50rem;
  font-weight: 700;
  color: #fde68a;
  background: rgba(217, 119, 6, 0.3);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 8px;
  padding: 0.5px 5px;
  letter-spacing: 0.02rem;
  transition: background 0.2s, color 0.2s;
}

.boot-saisen-banner:hover .saisen-banner-badge {
  background: rgba(245, 158, 11, 0.5);
  color: #fff;
}

.saisen-banner-desc {
  font-family: "Hiragino Kaku Gothic ProN", "Meiryo", "Yu Gothic", sans-serif;
  font-size: 0.53rem;
  line-height: 1.35;
  color: #94a3b8;
  letter-spacing: 0.01rem;
  transition: color 0.2s ease;
}

.boot-saisen-banner:hover .saisen-banner-desc {
  color: #cbd5e1;
}

/* Dialog Modals */
.modal-dialog {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 6, 12, 0.85);
  backdrop-filter: blur(6px);
  z-index: 80;
  display: flex;
  justify-content: center;
  align-items: center;
}

.dialog-content {
  background: #0d1220;
  border: 1px solid var(--accent-cyan);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 240, 255, 0.2);
  border-radius: 8px;
  width: 580px;
  max-height: 640px;
  display: flex;
  flex-direction: column;
}

.dialog-header {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0, 240, 255, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dialog-header h2 {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--accent-cyan);
}

.close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}

.dialog-body {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.setting-group {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 10px 14px;
}

.setting-group legend {
  font-family: var(--font-tech);
  font-size: 0.75rem;
  color: var(--accent-cyan);
  padding: 0 6px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 6px 0;
  font-size: 0.75rem;
}

.setting-row select, .setting-row input[type="range"] {
  background: #05070d;
  color: #fff;
  border: 1px solid rgba(0, 240, 255, 0.3);
  padding: 4px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.setting-note {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.3;
}

.about-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.dialog-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: flex-end;
}


/* Exit Confirmation Modal */
.exit-dialog {
  width: 480px;
  max-width: 90vw;
  border-color: rgba(255, 215, 0, 0.45);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.85), 0 0 25px rgba(255, 215, 0, 0.2);
}

.exit-dialog-header h2 {
  color: #ffd700;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

.exit-dialog-body {
  padding: 20px 24px;
  gap: 16px;
}

.exit-dialog-message {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exit-main-prompt {
  font-family: var(--font-display), "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.6;
  text-align: center;
  margin: 0;
}

.exit-sub-prompt {
  font-family: var(--font-tech);
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.08rem;
  line-height: 1.4;
  text-align: center;
  margin: 0;
}

.exit-tip-box {
  background: rgba(255, 215, 0, 0.06);
  border: 1px solid rgba(255, 215, 0, 0.28);
  border-radius: 6px;
  padding: 10px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.72rem;
  color: #e2e8f0;
  line-height: 1.5;
}

.exit-tip-box .tip-icon {
  font-size: 1rem;
  line-height: 1;
}

.exit-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 20px;
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.exit-dialog-footer .cancel-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #e2e8f0;
  padding: 8px 16px;
}

.exit-dialog-footer .cancel-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border-color: #fff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
}

.exit-dialog-footer .glow-red-btn {
  background: linear-gradient(135deg, rgba(255, 0, 85, 0.35), rgba(200, 0, 60, 0.5));
  border: 1px solid #ff0055;
  color: #fff;
  padding: 8px 18px;
  font-weight: 700;
  box-shadow: 0 0 16px rgba(255, 0, 85, 0.4);
}

.exit-dialog-footer .glow-red-btn:hover {
  background: #ff0055;
  color: #fff;
  box-shadow: 0 0 24px rgba(255, 0, 85, 0.8);
}

.go-dialog {
  width: 540px;
}

.go-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 10px 0;
}

.go-item {
  background: rgba(4, 7, 14, 0.75);
  border: 1px solid rgba(0, 240, 255, 0.22);
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.go-item .lbl {
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.05rem;
}

.go-item .val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
}

.go-closing-message {
  font-family: var(--font-tech);
  font-size: 0.85rem;
  color: var(--accent-cyan);
  text-align: center;
  margin-top: 10px;
  letter-spacing: 0.1rem;
}

/* Helper utility classes */
.hidden { display: none !important; }
.accent { color: var(--accent-cyan); }
.glow-cyan { color: var(--accent-cyan); text-shadow: 0 0 10px var(--accent-cyan); }
.glow-magenta { color: var(--accent-magenta); text-shadow: 0 0 10px var(--accent-magenta); }
.glow-yellow { color: var(--accent-yellow); text-shadow: 0 0 10px var(--accent-yellow); }
.neon-cyan { color: var(--accent-cyan); text-shadow: 0 0 20px var(--accent-cyan); }
.neon-white { color: #fff; text-shadow: 0 0 10px rgba(255, 255, 255, 0.8); }

/* ==================== MOBILE HARDWARE LOCKOUT // PC ONLY ==================== */
.mobile-lock-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999999;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #030509;
  font-family: var(--font-body);
}

.mobile-lock-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(ellipse at center, rgba(255, 0, 85, 0.15) 0%, rgba(3, 5, 9, 0.98) 75%),
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 100% 100%, 20px 20px, 20px 20px;
  pointer-events: none;
}

.mobile-lock-container {
  position: relative;
  z-index: 2;
  width: 90%;
  max-width: 490px;
  max-height: 94vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lock-hazard-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 0, 85, 0.18);
  border: 1px solid #ff0055;
  color: #ff0055;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 5px 14px;
  border-radius: 4px;
  box-shadow: 0 0 18px rgba(255, 0, 85, 0.4);
  letter-spacing: 0.08rem;
  margin-bottom: 12px;
}

.hazard-icon {
  font-size: 0.9rem;
  animation: hazardBlink 1s infinite alternate;
}

@keyframes hazardBlink {
  0% { opacity: 0.4; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1.1); }
}

.lock-card {
  width: 100%;
  background: linear-gradient(180deg, rgba(16, 9, 20, 0.95) 0%, rgba(6, 6, 12, 0.98) 100%);
  border: 1.5px solid rgba(255, 0, 85, 0.7);
  border-radius: 10px;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.95), 0 0 25px rgba(255, 0, 85, 0.3);
  padding: 22px 18px;
  text-align: center;
}

.lock-card-hdr .lock-sub {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #ff0055;
  letter-spacing: 0.15rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.lock-card-hdr .lock-title {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.12rem;
  line-height: 1.1;
  text-shadow: 0 0 20px rgba(255, 0, 85, 0.8), 0 0 40px rgba(255, 0, 85, 0.4);
}

.lock-card-hdr .lock-tagline {
  font-family: var(--font-tech);
  font-size: 0.68rem;
  color: #fda4af;
  letter-spacing: 0.06rem;
  margin-top: 4px;
}

.lock-stripes {
  height: 6px;
  width: 100%;
  margin: 14px 0;
  background: repeating-linear-gradient(45deg, #ff0055, #ff0055 10px, #20040f 10px, #20040f 20px);
  border-radius: 3px;
  box-shadow: 0 0 8px rgba(255, 0, 85, 0.4);
}

.lock-diag-grid {
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 12px;
  text-align: left;
}

.diag-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.62rem;
  line-height: 1.6;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.diag-row:last-child {
  border-bottom: none;
}

.d-key {
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.d-val {
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 700;
}

.d-val.danger {
  color: #ff3377;
  text-shadow: 0 0 8px #ff0055;
}

.lock-desc {
  font-size: 0.72rem;
  color: #cbd5e1;
  line-height: 1.55;
  margin-bottom: 12px;
  text-align: left;
}

.lock-desc strong {
  color: #fff;
}

.lock-instruction {
  font-family: var(--font-tech);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 4px;
  padding: 8px 10px;
  margin-bottom: 14px;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

.lock-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.copy-url-btn {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.25) 0%, rgba(0, 119, 255, 0.35) 100%);
  border: 1px solid var(--accent-cyan);
  color: #fff;
  font-family: var(--font-tech);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 0.05rem;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
  transition: all 0.2s;
}

.copy-url-btn:hover {
  background: var(--accent-cyan);
  color: #000;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.7);
}

.lock-status-btn {
  background: rgba(255, 0, 85, 0.12);
  border: 1px solid rgba(255, 0, 85, 0.4);
  color: #ff6699;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 8px;
  border-radius: 6px;
  letter-spacing: 0.08rem;
  cursor: not-allowed;
  user-select: none;
}

.force-launch-btn {
  background: linear-gradient(135deg, rgba(255, 0, 85, 0.25) 0%, rgba(255, 102, 0, 0.35) 100%);
  border: 1px solid #ff0055;
  color: #fff;
  font-family: var(--font-tech);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 0.06rem;
  box-shadow: 0 0 15px rgba(255, 0, 85, 0.35);
  transition: all 0.2s;
}

.force-launch-btn:hover {
  background: #ff0055;
  color: #fff;
  box-shadow: 0 0 30px rgba(255, 0, 85, 0.8);
}

/* ==================== READY? AUDIO UNLOCK SCREEN ==================== */
.ready-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 500;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at center, #061328 0%, #030814 60%, #010307 100%);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s ease;
  overflow: hidden;
}

.ready-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ready-grid-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(0, 240, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.05) 1px, transparent 1px);
  background-size: 36px 36px;
  animation: readyGridFlow 25s linear infinite;
}

@keyframes readyGridFlow {
  0% { transform: translateY(0); }
  100% { transform: translateY(36px); }
}

.ready-radar-sweep {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 130vmax;
  height: 130vmax;
  transform: translate(-50%, -50%);
  background: conic-gradient(from 0deg, rgba(0, 240, 255, 0.09) 0deg, transparent 55deg, transparent 360deg);
  animation: readyRadarSpin 9s linear infinite;
  pointer-events: none;
  border-radius: 50%;
}

@keyframes readyRadarSpin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.ready-vignette {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, transparent 35%, #020409 88%);
}

/* Perimeter Sci-Fi HUD Corners */
.ready-hud-frame {
  position: absolute;
  top: 24px;
  left: 24px;
  right: 24px;
  bottom: 24px;
  pointer-events: none;
  z-index: 1;
}

.ready-hud-corner {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12rem;
  color: #7dd3fc;
  padding: 4px 10px;
  background: rgba(5, 12, 24, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.12);
}

.ready-hud-corner.rh-tl { top: 0; left: 0; border-left: 3px solid var(--accent-cyan); }
.ready-hud-corner.rh-tr { top: 0; right: 0; border-right: 3px solid var(--accent-cyan); }
.ready-hud-corner.rh-bl { bottom: 0; left: 0; border-left: 3px solid var(--accent-cyan); }
.ready-hud-corner.rh-br { bottom: 0; right: 0; border-right: 3px solid var(--accent-cyan); }

.ready-container {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
}

/* Tech Metadata Badge Pill */
.ready-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 240, 255, 0.09);
  border: 1px solid rgba(0, 240, 255, 0.40);
  padding: 5px 16px;
  border-radius: 20px;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.20), inset 0 0 8px rgba(0, 240, 255, 0.10);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.ready-pulse-dot {
  width: 7px;
  height: 7px;
  background: #00ff66;
  border-radius: 50%;
  box-shadow: 0 0 8px #00ff66, 0 0 14px #00ff66;
  animation: readyDotPulse 1.3s infinite alternate ease-in-out;
}

@keyframes readyDotPulse {
  0% { opacity: 0.35; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1.15); }
}

.ready-badge-text {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.16rem;
  color: #7dd3fc;
  font-weight: 700;
}

.ready-badge-code {
  background: rgba(0, 240, 255, 0.25);
  color: #fff;
  padding: 1px 7px;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 800;
  border: 1px solid rgba(0, 240, 255, 0.5);
}

/* ==================== CUTTING-EDGE READY BUTTON UNIT ==================== */
.ready-btn {
  position: relative;
  background: linear-gradient(135deg, rgba(6, 18, 38, 0.96) 0%, rgba(12, 34, 66, 0.92) 50%, rgba(4, 12, 26, 0.98) 100%);
  border: 2px solid #00f0ff;
  min-width: 490px;
  padding: 24px 50px 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  clip-path: polygon(18px 0%, calc(100% - 18px) 0%, 100% 18px, 100% calc(100% - 18px), calc(100% - 18px) 100%, 18px 100%, 0% calc(100% - 18px), 0% 18px);
  box-shadow: 
    0 0 35px rgba(0, 240, 255, 0.45), 
    inset 0 0 30px rgba(0, 240, 255, 0.16), 
    0 20px 50px rgba(0, 0, 0, 0.90);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.ready-btn:hover {
  transform: translateY(-4px) scale(1.025);
  border-color: #ffffff;
  background: linear-gradient(135deg, rgba(8, 24, 50, 0.98) 0%, rgba(16, 44, 84, 0.95) 50%, rgba(5, 16, 36, 0.98) 100%);
  box-shadow: 
    0 0 65px rgba(0, 240, 255, 0.80), 
    inset 0 0 40px rgba(0, 240, 255, 0.35), 
    0 25px 60px rgba(0, 0, 0, 0.95);
  filter: brightness(1.12);
}

.ready-btn:active, .ready-btn.ready-engaged {
  transform: scale(0.97);
  border-color: #ffffff;
  box-shadow: 
    0 0 95px rgba(0, 240, 255, 1.0), 
    inset 0 0 55px rgba(255, 255, 255, 0.7), 
    0 0 40px #00f0ff;
  filter: brightness(1.35);
}

/* High-Velocity Laser Shimmer Beam */
.ready-shimmer-bar {
  position: absolute;
  top: 0;
  left: -120%;
  width: 70%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(0, 240, 255, 0.0) 25%, 
    rgba(0, 240, 255, 0.45) 48%, 
    rgba(255, 255, 255, 0.85) 52%, 
    rgba(0, 240, 255, 0.45) 56%, 
    transparent 100%
  );
  transform: skewX(-25deg);
  animation: readyLaserSweep 3.2s infinite cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

@keyframes readyLaserSweep {
  0% { left: -120%; }
  45% { left: 160%; }
  100% { left: 160%; }
}

/* Chamfer Reticle Corner Brackets */
.ready-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: #00f0ff;
  border-style: solid;
  pointer-events: none;
  transition: all 0.25s ease;
}

.rc-tl { top: 0; left: 0; border-width: 2px 0 0 2px; }
.rc-tr { top: 0; right: 0; border-width: 2px 2px 0 0; }
.rc-bl { bottom: 0; left: 0; border-width: 0 0 2px 2px; }
.rc-br { bottom: 0; right: 0; border-width: 0 2px 2px 0; }

.ready-btn:hover .ready-corner {
  border-color: #fff;
  box-shadow: 0 0 10px var(--accent-cyan);
}

/* Top Micro Header & Equalizer */
.ready-btn-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  border-bottom: 1px solid rgba(0, 240, 255, 0.25);
  padding-bottom: 6px;
}

.ready-sub-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.20rem;
  color: #38bdf8;
  font-weight: 700;
}

.ready-eq {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 14px;
}

.eq-bar {
  width: 3px;
  background: var(--accent-cyan);
  border-radius: 1px;
  box-shadow: 0 0 6px var(--accent-cyan);
  animation: eqBounce 1.1s infinite ease-in-out;
}

.eq-bar:nth-child(1) { height: 45%; animation-delay: 0.12s; }
.eq-bar:nth-child(2) { height: 85%; animation-delay: 0.32s; }
.eq-bar:nth-child(3) { height: 100%; animation-delay: 0.00s; }
.eq-bar:nth-child(4) { height: 65%; animation-delay: 0.44s; }
.eq-bar:nth-child(5) { height: 90%; animation-delay: 0.22s; }

@keyframes eqBounce {
  0%, 100% { transform: scaleY(0.4); opacity: 0.6; }
  50% { transform: scaleY(1.0); opacity: 1.0; }
}

/* Headline Centerpiece Typography */
.ready-headline-wrap {
  position: relative;
  margin: 4px 0 2px;
}

.ready-text-glitch {
  font-family: var(--font-display);
  font-size: 4.4rem;
  font-weight: 900;
  letter-spacing: 0.65rem;
  line-height: 1.05;
  background: linear-gradient(180deg, #ffffff 0%, #e0f2fe 35%, #00f0ff 70%, #ff0055 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 22px rgba(0, 240, 255, 0.85)) drop-shadow(0 0 45px rgba(0, 240, 255, 0.45));
  display: inline-block;
  transform: translateZ(0);
}

/* Action Command Subtitle */
.ready-action-prompt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 2px;
}

.ready-key-chip {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(0, 240, 255, 0.65);
  border-radius: 4px;
  padding: 2px 7px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 800;
  box-shadow: 0 2px 0 rgba(0, 240, 255, 0.5);
  letter-spacing: 0.05rem;
}

.ready-prompt-text {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12rem;
  color: #bae6fd;
  font-weight: 700;
}

.ready-cursor {
  font-family: var(--font-mono);
  font-weight: 900;
  color: var(--accent-cyan);
  animation: cursorBlink 0.8s infinite;
}

@keyframes cursorBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* Bottom Status Micro Bar inside Button */
.ready-btn-footer {
  display: flex;
  justify-content: space-between;
  width: 100%;
  border-top: 1px solid rgba(0, 240, 255, 0.18);
  padding-top: 6px;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.14rem;
  color: #64748b;
  font-weight: 600;
}

/* Bottom Screen Hint */
.ready-footer-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-tech);
  font-size: 0.68rem;
  letter-spacing: 0.12rem;
  color: var(--text-muted);
}

.ready-footer-hint .hint-icon {
  color: var(--accent-yellow);
  font-size: 0.8rem;
  filter: drop-shadow(0 0 6px var(--accent-yellow));
}

/* ==================== CAPCOM CPS-2 究-SOUND SPLASH SCREEN ==================== */
.qsound-splash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 490; /* Below ready-screen (500), above boot-screen */
  background: #000000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease-in-out;
  overflow: hidden;
  user-select: none;
}

.qsound-splash.active {
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
}

.qsound-splash-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000000 url('../assets/qsound-screen.png') no-repeat center center;
  background-size: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Authentic Arcade CRT Scanline & Phosphor Grid Overlay */
.qsound-splash-crt {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.42) 50%
  ), linear-gradient(
    90deg,
    rgba(255, 0, 0, 0.035),
    rgba(0, 255, 0, 0.02),
    rgba(0, 255, 0, 0.035)
  );
  background-size: 100% 3px, 6px 100%;
  pointer-events: none;
  opacity: 0.65;
}

/* ============================================================
   NUMERIC TYPOGRAPHY: STRICT TABULAR FIXED-WIDTH (MONOSPACE)
   Guarantees zero horizontal jitter and equal glyph widths
   for all numbers across HUD, Telemetry, Panels and Modals.
   ============================================================ */
.val,
.val-large,
.val-mid,
.stat-badge .val,
.perf-stat-pill .val,
.perf-row span:last-child,
.footer-telemetry,
.footer-telemetry strong,
.footer-controls-guide span,
.field-spec,
.panel-tag,
.hud-bench-time,
.hud-bench-phase,
.bubble-zoom-val,
.pixel-pill,
.bubble-info-line,
.banner-subtitle,
.go-item .val,
.d-val,
#score-val,
#level-val,
#lines-val,
#pieces-val,
#fps-val,
#frametime-val,
#coords-val,
#cam-val,
#footer-rays,
#p-fps,
#p-ft,
#p-rt,
#p-mrays,
#p-rays,
#p-dc,
#p-lights,
#p-gpu,
#hud-bench-countdown,
#go-score,
#go-lines,
#go-pieces,
#go-time,
#go-distance,
#go-fps {
  font-family: var(--font-mono) !important;
  font-variant-numeric: tabular-nums lining-nums !important;
  font-feature-settings: "tnum" 1, "zero" 1 !important;
}

/* ==================== SMALL SCREEN & NARROW VIEWPORT ADAPTATIONS ==================== */
/* When browser display surface is small, Tetris viewport narrows gracefully (狭く表示) */

@media (max-width: 960px) {
  .header-center {
    display: none;
  }
  #sidebar-panel {
    width: 215px;
    flex: 0 0 215px;
  }
  .minimap-wrapper, #minimap-canvas {
    width: 180px;
    height: 101px;
  }
}

@media (max-width: 768px) {
  .engine-badge {
    display: none;
  }
  .header-right {
    gap: 5px;
  }
  .header-action-btn {
    padding: 3px 5px;
    font-size: 0.62rem;
  }
  .stat-badge:nth-of-type(2) {
    display: none; /* Hide frametime, keep FPS */
  }
  #main-area {
    padding: 4px 6px;
    gap: 6px;
  }
  #sidebar-panel {
    width: 198px;
    flex: 0 0 198px;
    gap: 6px;
  }
  .minimap-wrapper, #minimap-canvas {
    width: 170px;
    height: 96px;
  }
  #bottom-bar {
    padding: 0 8px;
    overflow-x: auto;
  }
  .footer-controls-guide span:nth-child(n+5) {
    display: none; /* Hide extra key hints on very narrow footer */
  }
  .boot-corner-controls {
    top: 8px;
    right: 8px;
  }
  .boot-corner-btn {
    padding: 4px 10px;
    font-size: 0.62rem;
  }
}

@media (max-width: 600px) {
  #sidebar-panel {
    width: 180px;
    flex: 0 0 180px;
  }
  .minimap-wrapper, #minimap-canvas {
    width: 160px;
    height: 90px;
  }
  .stat-badge {
    padding: 2px 4px;
    font-size: 0.65rem;
  }
}

@media (max-height: 640px) {
  #top-bar {
    height: 38px;
  }
  #bottom-bar {
    height: 38px;
  }
  #main-area {
    height: calc(100% - 76px);
  }
  .depth-track {
    height: 120px;
  }
}



