/* 
 * KYU-SOUND COMPONENT SYSTEM: AKUMA-GATTAI HI-FI MINI-COMPO
 * Overkill Stacked Chassis: Brushed Black Aluminum, Hex Bolts, Amber VU, VFD & CRT
 */

:root {
  --chassis-dark: #07090e;
  --metal-base: #11141c;
  --metal-top: #1c2230;
  --metal-border: #2a3449;
  --metal-screw: #475569;
  --gold: #d4af37;
  --gold-glow: rgba(212, 175, 55, 0.4);
  --cyan: #00f0ff;
  --cyan-glow: rgba(0, 240, 255, 0.45);
  --red-lamp: #ef4444;
  --green-crt: #10b981;
  --amber-lamp: #f59e0b;
  --font-mono: 'SF Mono', 'Menlo', 'Monaco', 'Courier New', monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --dopamine-shake-x: 0px;
  --dopamine-shake-y: 0px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--chassis-dark);
  background-image: 
    radial-gradient(circle at 50% 20%, rgba(16, 24, 40, 0.8) 0%, #030407 100%),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 24px 24px, 24px 24px;
  color: #e2e8f0;
  font-family: var(--font-mono);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 12px 10px;
  overflow-x: hidden;
}

/* ========================================================
   PRE-BOOT READY SCREEN (起動準備・確実なオーディオアンロック画面)
   ======================================================== */
body.boot-ready-active {
  overflow: hidden !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  overscroll-behavior: none !important;
}

/* ★ ボタン画面表示中は画面裏の全ラック・ヘッダー・フッター・マスコットを100%消滅させ、はみ出しを完全根絶 ★ */
body.boot-ready-active .app-header,
body.boot-ready-active .compo-rack,
body.boot-ready-active .app-footer,
body.boot-ready-active .dopamine-mascot-dock,
body.boot-ready-active .dopamine-manga-layer,
body.boot-ready-active #dopamine-floating-canvas,
body.boot-ready-active .patlamp-container,
body.boot-ready-active .patlamp-light-canvas {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.ready-screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  width: 100%;
  height: 100vh;
  height: 100%;
  height: 100dvh;
  min-height: 100dvh;
  z-index: 1000000;
  background-color: #03060c;
  background: radial-gradient(circle at 50% 45%, #07101e 0%, #03060c 60%, #010205 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.45s;
}

.ready-screen-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.ready-crt-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.28) 50%);
  background-size: 100% 3px;
}

.ready-grid-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image: 
    linear-gradient(rgba(0, 240, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
}

.ready-modal-deck {
  position: relative;
  z-index: 5;
  background: linear-gradient(165deg, #141f30 0%, #0a111c 55%, #05080f 100%);
  border: 2px solid #293d56;
  border-radius: 14px;
  padding: 24px 28px 26px;
  box-shadow: 
    0 16px 50px rgba(0, 0, 0, 0.95),
    0 0 40px rgba(0, 240, 255, 0.12) inset,
    0 1px 0 rgba(255, 255, 255, 0.2) inset,
    0 0 2px #38bdf8;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 560px;
  max-width: min(560px, calc(100vw - 28px));
  animation: readyDeckEnter 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes readyDeckEnter {
  from { transform: scale(0.92) translateY(12px); opacity: 0; }
  to { transform: scale(1.0) translateY(0); opacity: 1; }
}

.ready-deck-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #1c2b3e;
  padding-bottom: 8px;
}

.ready-status-badge {
  display: flex;
  align-items: center;
  gap: 7px;
}

.ready-status-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8, 0 0 2px #fff;
  animation: readyLedPulse 1.2s infinite ease-in-out alternate;
}

@keyframes readyLedPulse {
  0% { opacity: 0.4; }
  100% { opacity: 1.0; }
}

.ready-status-text {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #94a3b8;
}

.ready-serial-tag {
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 1.2px;
  color: var(--cyan);
  background: #060b13;
  border: 1px solid #22354c;
  padding: 2px 6px;
  border-radius: 3px;
}

.ready-main-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
}

.ready-cyber-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}

.ready-logo-text-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}

.ready-logo-main {
  font-size: clamp(14px, 3.6vw, 20px);
  font-weight: 900;
  letter-spacing: clamp(1px, 0.35vw, 2.5px);
  color: #ffffff;
  text-shadow: 0 0 16px rgba(0, 240, 255, 0.7);
  line-height: 1.25;
  white-space: nowrap;
  display: block;
}

.ready-logo-sub {
  font-size: clamp(7.5px, 1.8vw, 9.5px);
  font-weight: 800;
  letter-spacing: clamp(1px, 0.25vw, 1.8px);
  color: #7dd3fc;
  white-space: nowrap;
  margin-top: 4px;
  opacity: 0.9;
}

/* The Hero READY Trigger Button */
.ready-hero-button-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  position: relative;
  padding: 6px 0;
}

.btn-ready-hero {
  position: relative;
  width: 100%;
  max-width: 380px;
  padding: 16px 28px;
  background: linear-gradient(180deg, #0284c7 0%, #0369a1 40%, #075985 80%, #0c4a6e 100%);
  border: 2px solid #38bdf8;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: 
    0 1px 0 rgba(255, 255, 255, 0.45) inset,
    0 8px 24px rgba(2, 132, 199, 0.6),
    0 0 0 2px #040812,
    0 0 25px rgba(0, 240, 255, 0.45);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.btn-ready-hero:hover {
  transform: translateY(-2px);
  border-color: #00f0ff;
  box-shadow: 
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 12px 30px rgba(2, 132, 199, 0.8),
    0 0 0 2px #040812,
    0 0 35px rgba(0, 240, 255, 0.75);
}

.btn-ready-hero:active, .btn-ready-hero.engaged {
  transform: translateY(2px) scale(0.98);
  box-shadow: 
    0 1px 0 rgba(255, 255, 255, 0.2) inset,
    0 3px 8px rgba(0, 0, 0, 0.8),
    0 0 40px #00f0ff;
  background: linear-gradient(180deg, #10b981 0%, #059669 60%, #047857 100%);
  border-color: #34d399;
}

.btn-ready-label {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 4px;
  color: #ffffff;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.8), 0 0 20px rgba(0, 240, 255, 0.8);
}

.btn-ready-subtext {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #e0f2fe;
  opacity: 0.9;
}

/* Sweeping Neon Pulse Light on Button */
.btn-ready-pulse-line {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-25deg);
  animation: readySweep 2.2s infinite ease-in-out;
  pointer-events: none;
}

@keyframes readySweep {
  0% { left: -100%; }
  60% { left: 180%; }
  100% { left: 180%; }
}

.ready-telemetry-readout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: #02050a;
  border: 1px solid #1c2b3e;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 7.5px;
  font-family: var(--font-mono);
}

.ready-telemetry-readout .tele-item .k {
  color: #64748b;
  font-weight: 700;
}

.ready-telemetry-readout .tele-item .v {
  color: var(--cyan);
  font-weight: 800;
}

/* ========================================================
   SPLASH OVERLAY (全面表示 FULL-SCREEN ARCADE BOOT)
   ======================================================== */
.qsound-splash-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  width: 100%;
  height: 100%;
  height: 100dvh;
  z-index: 999999;
  background: #000000;
  display: none;
  cursor: pointer;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.85s;
}

.qsound-splash-overlay.active {
  display: block;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.qsound-splash-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Authentic CRT Arcade Scanline & Tube Vignette Overlay */
.splash-crt-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
  background: 
    linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.22) 50%),
    linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.02)),
    radial-gradient(circle at center, transparent 65%, rgba(0, 0, 0, 0.8) 100%);
  background-size: 100% 3px, 6px 100%, 100% 100%;
}

/* 100% 画面全体にピッチリ引き伸ばす Fullscreen Image (Stretch to fit viewport) */
.splash-logo-fullscreen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  object-fit: fill; /* ★ 画面全体に100%引き伸ばし（下のはみ出し・余白を完全解消） ★ */
  display: block;
  z-index: 1;
  filter: drop-shadow(0 0 50px rgba(0, 240, 255, 0.35));
  opacity: 1;
  user-select: none;
  -webkit-user-drag: none;
}

/* ========================================================
   FULL-SCREEN DRAG & DROP OVERLAY (画面全体ドラッグ対応)
   ======================================================== */
.full-screen-drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 99990;
  background: rgba(4, 7, 14, 0.88);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: 4px dashed var(--cyan);
  box-shadow: 0 0 60px rgba(0, 240, 255, 0.45) inset;
}

.full-screen-drop-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.drop-modal-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: #090e17;
  border: 2px solid var(--cyan);
  border-radius: 8px;
  padding: 40px 60px;
  box-shadow: 0 0 40px var(--cyan-glow);
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.full-screen-drop-overlay.active .drop-modal-box {
  transform: scale(1.0);
}

.drop-glow-icon {
  font-size: 48px;
  color: var(--cyan);
  text-shadow: 0 0 20px var(--cyan);
  animation: pulse-icon 1s infinite alternate;
}

@keyframes pulse-icon {
  from { transform: scale(0.9); }
  to { transform: scale(1.15); }
}

.drop-modal-title {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #ffffff;
  text-shadow: 0 0 12px var(--cyan-glow);
}

.drop-modal-sub {
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--cyan);
  font-weight: bold;
}

/* ========================================================
   HEADER BAR
   ======================================================== */
.app-header {
  width: 100%;
  max-width: 1400px;
  padding: 6px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #1e293b;
  margin-bottom: 8px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: default;
}

.brand-badge {
  background: linear-gradient(135deg, #b91c1c, #ea580c);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 3px;
  letter-spacing: 1px;
}

.brand-title {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #cbd5e1;
}

.brand-title span.brand-sub {
  color: var(--cyan);
}

.brand-dopamine-tag {
  display: none;
}

body.dopamine-active .brand-dopamine-tag {
  display: inline;
  color: #ff007f;
  text-shadow: 0 0 10px rgba(255, 0, 127, 0.8);
}

.system-status-leds {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #64748b;
}

.status-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #334155;
}

.status-indicator-dot.on {
  background: var(--green-crt);
  box-shadow: 0 0 10px var(--green-crt);
}

/* ========================================================
   FULLSCREEN TOGGLE BUTTONS (アビオニクス＆サイバーネオン仕様)
   ======================================================== */
.btn-fullscreen-cyber {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(180deg, #162235 0%, #0a111c 100%);
  border: 1px solid #2d425c;
  color: #38bdf8;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 1.2px;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 
    0 2px 6px rgba(0, 0, 0, 0.6),
    0 1px 0 rgba(255, 255, 255, 0.1) inset;
  transition: all 0.18s ease-out;
  user-select: none;
  white-space: nowrap;
}

.btn-fullscreen-cyber .fs-icon {
  font-size: 12px;
  line-height: 1;
  color: #00f0ff;
  text-shadow: 0 0 6px #00f0ff;
}

.btn-fullscreen-cyber:hover {
  background: linear-gradient(180deg, #1e324d 0%, #0e1b2d 100%);
  border-color: #00f0ff;
  color: #ffffff;
  box-shadow: 
    0 0 14px rgba(0, 240, 255, 0.45),
    0 1px 0 rgba(255, 255, 255, 0.25) inset;
  transform: translateY(-1px);
}

.btn-fullscreen-cyber:active {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.8) inset;
}

.btn-fullscreen-cyber.is-fullscreen {
  background: linear-gradient(180deg, #064e3b 0%, #022c22 100%);
  border-color: #10b981;
  color: #6ee7b7;
  box-shadow: 
    0 0 12px rgba(16, 185, 129, 0.4),
    0 1px 0 rgba(255, 255, 255, 0.15) inset;
}

.btn-fullscreen-cyber.is-fullscreen .fs-icon {
  color: #34d399;
  text-shadow: 0 0 6px #10b981;
}

/* UNIT 2 Subhead Maximize Quick Button */
.btn-matrix-fs {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: #38bdf8;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 2px 7px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease-out;
  user-select: none;
}

.btn-matrix-fs:hover {
  background: rgba(0, 240, 255, 0.25);
  border-color: #00f0ff;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
}

.btn-matrix-fs.is-fullscreen {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #34d399;
}

/* ========================================================
   MAIN COMPONENT RACK: 2-COLUMN COCKPIT (左上操作タワー × 右側計測マトリクス)
   ======================================================== */
.compo-rack {
  width: 100%;
  max-width: 1400px;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 10px;
  align-items: stretch;
  contain: layout style;
}

@media (max-width: 1040px) {
  .compo-rack {
    grid-template-columns: 1fr;
  }
}

/* Base Rack Unit - Heavy CNC Anodized Gunmetal Chassis */
.rack-unit {
  position: relative;
  contain: layout paint style;
  background: linear-gradient(172deg, #182234 0%, #0d1522 45%, #070b13 100%);
  border: 2px solid #293a52;
  border-radius: 8px;
  padding: 8px 14px;
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.88),
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 0 0 1px #04070e,
    0 0 20px rgba(0, 240, 255, 0.04);
  display: flex;
  flex-direction: column;
}

.rack-unit .faceplate {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Machined Hex Torx Screw Details with Recessed Washer */
.hex-screw {
  position: absolute;
  width: 10px;
  height: 10px;
  background: conic-gradient(from 45deg, #475569, #94a3b8, #1e293b, #64748b, #0f172a, #94a3b8, #475569);
  border: 1px solid #0f172a;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.9), 0 0 0 1.5px #1a2538;
}

.hex-screw::after {
  content: '';
  position: absolute;
  top: 2.5px; left: 2.5px;
  width: 3.5px; height: 3.5px;
  background: #090e17;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.hex-screw.tl { top: 6px; left: 6px; }
.hex-screw.tr { top: 6px; right: 6px; }
.hex-screw.bl { bottom: 6px; left: 6px; }
.hex-screw.br { bottom: 6px; right: 6px; }

/* Side Rack Handles */
.chassis-bracket {
  position: absolute;
  top: 15%;
  bottom: 15%;
  width: 5px;
  background: linear-gradient(90deg, #334155, #1e293b);
  border-radius: 2px;
}
.chassis-bracket.left { left: 12px; }
.chassis-bracket.right { right: 12px; }

/* Unit Subhead Bar */
.unit-subhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #1e293b;
  padding-bottom: 4px;
  margin-bottom: 6px;
  font-size: 9.5px;
  letter-spacing: 0.8px;
}

.model-tag {
  background: #020408;
  border: 1px solid #27364b;
  color: var(--cyan);
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 800;
  box-shadow: 0 1px 3px rgba(0,0,0,0.7) inset, 0 0 8px rgba(0, 240, 255, 0.2);
}

.unit-desc {
  font-weight: 700;
  color: #94a3b8;
}

.lamp-amber {
  color: var(--amber-lamp);
  font-weight: bold;
}

.lamp-cyan {
  color: var(--cyan);
  font-weight: bold;
}

.unit-pill-active {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid var(--red-lamp);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: bold;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

/* ========================================================
   UNIT 2: OVERKILL MEASURING MATRIX (超高密度計測マトリクス・右側全体)
   ======================================================== */
.unit-measuring-matrix {
  display: flex;
  flex-direction: column;
}

.matrix-canvas-frame {
  width: 100%;
  height: 100%;
  min-height: 450px;
  background: #020409;
  border: 2px solid #273952;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 
    0 0 35px rgba(0, 0, 0, 0.98) inset,
    0 8px 30px rgba(0, 0, 0, 0.85),
    0 1px 0 rgba(255, 255, 255, 0.14),
    0 0 2px #38bdf8;
  position: relative;
  flex: 1;
  contain: layout paint style;
}

.canvas-matrix {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: -webkit-optimize-contrast;
  contain: strict;
  will-change: transform;
  transform: translateZ(0);
}

.radar-legend {
  font-size: 9px;
  color: var(--green-crt);
  font-weight: bold;
  letter-spacing: 1px;
}

/* ========================================================
   UNIT 1: MASTER CONTROL & TRANSPORT TOWER (画面左上操作パネル)
   ======================================================== */
.beat-sync-led {
  font-size: 9px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 2px;
  background: #000;
  border: 1px solid #334155;
  color: var(--cyan);
  transition: all 0.05s ease;
}

.transport-tower {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #070a12;
  border: 1px solid #1a2336;
  border-radius: 6px;
  padding: 6px;
}

/* 1. Q-Sound Hero Switch Deck */
.qsound-hero-deck {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  width: 100%;
}

.qsound-main-switch {
  width: 100%;
  background: #111827;
  border: 1.5px solid #334155;
  color: #94a3b8;
  padding: 5px 6px;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.switch-glow-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #334155;
  border: 1px solid #1e293b;
  box-shadow: 0 0 2px #000 inset;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.switch-labels {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 0;
}

.switch-title {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.8px;
  color: #cbd5e1;
  white-space: nowrap;
}

.switch-state {
  font-size: 7.5px;
  font-weight: bold;
  letter-spacing: 0.5px;
  color: #64748b;
  white-space: nowrap;
}

/* Q-Sound Switch ACTIVE State */
.qsound-main-switch.active {
  background: linear-gradient(180deg, #0284c7 0%, #075985 100%);
  border-color: var(--cyan);
  color: #ffffff;
  box-shadow: 0 0 16px var(--cyan-glow), 0 2px 6px rgba(0,0,0,0.6);
}

.qsound-main-switch.active .switch-glow-led {
  background: #00ffea;
  box-shadow: 0 0 10px #00f0ff, 0 0 3px #fff;
}

.qsound-main-switch.active .switch-title {
  color: #ffffff;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

.qsound-main-switch.active .switch-state {
  color: #e0f2fe;
}

/* ========================================================
   DOPAMINE OVERDRIVE SWITCH (ドパガキ仕様)
   ======================================================== */
.dopamine-main-switch {
  width: 100%;
  background: #19091f;
  border: 1.5px solid #6b21a8;
  color: #d8b4fe;
  padding: 5px 6px;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.6);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.dopamine-glow-flame {
  font-size: 11px;
  filter: drop-shadow(0 0 3px #ec4899);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.dopamine-switch-title {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.8px;
  color: #f5d0fe;
  white-space: nowrap;
}

.dopamine-switch-state {
  font-size: 7.5px;
  font-weight: bold;
  letter-spacing: 0.5px;
  color: #c084fc;
  white-space: nowrap;
}

/* ACTIVE DOPAMINE OVERDRIVE (狂乱ネオン＆レインボー) */
.dopamine-main-switch.active {
  background: linear-gradient(135deg, #ec4899 0%, #a855f7 50%, #06b6d4 100%);
  background-size: 200% 200%;
  border-color: #f43f5e;
  animation: dopamineFlow 2.5s ease infinite alternate;
  box-shadow: 0 0 16px rgba(236, 72, 153, 0.6), 0 0 24px rgba(168, 85, 247, 0.4);
}

.dopamine-main-switch.active .dopamine-glow-flame {
  animation: dopamineFlicker 0.3s infinite alternate;
}

@keyframes dopamineFlow {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

@keyframes dopamineFlicker {
  0% { transform: scale(1.0) rotate(-6deg); filter: drop-shadow(0 0 4px #fbbf24); }
  100% { transform: scale(1.35) rotate(6deg); filter: drop-shadow(0 0 12px #f43f5e); }
}

.dopamine-main-switch.active .dopamine-switch-title {
  color: #ffffff;
  text-shadow: 0 0 8px #ffffff, 0 0 14px #ec4899;
}

.dopamine-main-switch.active .dopamine-switch-state {
  color: #fdf4ff;
  text-shadow: 0 0 6px #f43f5e;
}

.jingle-aux-btn {
  grid-column: span 2;
  width: 100%;
  background: #0c121e;
  border: 1px solid #233047;
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  padding: 3.5px 8px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
}

.jingle-aux-btn:hover {
  border-color: var(--cyan);
  color: #fff;
  background: rgba(0, 240, 255, 0.1);
}

/* ========================================================
   DOPAMINE MODE OVERKILL VISUAL EFFECTS
   ======================================================== */
/* Screen Shake Animations triggered on Kick / Bass hit */
.shake-kick {
  animation: screenShakeKick 0.14s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes screenShakeKick {
  0% { transform: translate3d(0, 0, 0); }
  20% { transform: translate3d(-3px, 2px, 0) scale(1.002); }
  40% { transform: translate3d(3px, -2px, 0) scale(0.998); }
  60% { transform: translate3d(-2px, 1px, 0); }
  80% { transform: translate3d(1px, -1px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

/* ========================================================
   FULL DOPAMINE OVERDRIVE SPECIFICATION (全体ドパガキ覚醒スタイル)
   Music-Reactive Ambient Visualizer Strobe & Full-Screen GPU Shockwave Shake
   100% Hardware Accelerated GPU-Composited Layer Architecture (Zero-Paint)
   ======================================================== */
body.dopamine-active {
  position: relative;
  background-color: hsl(var(--vis-hue, 280deg), 40%, calc(4% + var(--vis-bass, 0) * 8% + var(--vis-strobe, 0) * 12%)) !important;
  background-image: 
    /* 高音チカチカ・ストロボフラッシュ */
    radial-gradient(circle at 50% 40%, hsla(var(--vis-hue, 280deg), 100%, 75%, calc(var(--vis-strobe, 0) * 0.42)) 0%, transparent 65%),
    /* 重低音バスパルス・オーロラ */
    radial-gradient(ellipse at 50% 25%, hsla(calc(var(--vis-hue, 280deg) + 60deg), 100%, 55%, calc(0.12 + var(--vis-bass, 0) * 0.45)) 0%, hsla(var(--vis-hue, 280deg), 100%, 30%, calc(0.08 + var(--vis-bass, 0) * 0.28)) 45%, transparent 85%),
    /* ビジュアライザ・ネオングリッド (高音アタックでチカチカ瞬く) */
    linear-gradient(hsla(var(--vis-hue, 280deg), 100%, 65%, calc(0.04 + var(--vis-treble, 0) * 0.16)) 1px, transparent 1px),
    linear-gradient(90deg, hsla(calc(var(--vis-hue, 280deg) + 120deg), 100%, 65%, calc(0.04 + var(--vis-treble, 0) * 0.16)) 1px, transparent 1px) !important;
  background-size: 100% 100%, 100% 100%, 36px 36px, 36px 36px !important;
  background-attachment: fixed !important;
  box-shadow: 
    inset 0 0 calc(30px + var(--vis-bass, 0) * 80px) hsla(var(--vis-hue, 280deg), 100%, 50%, calc(0.12 + var(--vis-bass, 0) * 0.40)),
    inset 0 0 calc(60px + var(--vis-strobe, 0) * 100px) hsla(calc(var(--vis-hue, 280deg) + 180deg), 100%, 65%, calc(var(--vis-strobe, 0) * 0.45));
}

/* Screen Shake on Bass Hit & Dopamine Thrills (Zero-Reflow 100% GPU Hardware Composited) */
body.dopamine-active .compo-rack,
body.dopamine-active .app-header,
body.dopamine-active .app-footer,
body.dopamine-active .system-footer,
body.dopamine-active .dopamine-mascot-dock {
  transform: translate3d(var(--dopamine-shake-x, 0px), var(--dopamine-shake-y, 0px), 0);
  transform-origin: center center;
  backface-visibility: hidden;
}

body:not(.dopamine-active) .compo-rack,
body:not(.dopamine-active) .app-header,
body:not(.dopamine-active) .app-footer,
body:not(.dopamine-active) .system-footer,
body:not(.dopamine-active) .dopamine-mascot-dock {
  transform: none !important;
}

/* 3D Cyber Horizon Floor Grid (100% GPU Hardware Accelerated Composited Layer) */
body.dopamine-active::before {
  content: '';
  position: fixed;
  bottom: -5vh;
  left: -20%;
  width: 140%;
  height: 52vh;
  background-image: 
    linear-gradient(to top, rgba(4, 1, 10, 1) 0%, rgba(4, 1, 10, 0.85) 30%, rgba(4, 1, 10, 0) 100%),
    linear-gradient(hsla(var(--vis-hue, 280deg), 100%, 60%, calc(0.24 + var(--vis-treble, 0) * 0.40)) 1.5px, transparent 1.5px),
    linear-gradient(90deg, hsla(calc(var(--vis-hue, 280deg) + 120deg), 100%, 60%, calc(0.20 + var(--vis-bass, 0) * 0.35)) 1.5px, transparent 1.5px);
  background-size: 100% 100%, 48px 48px, 48px 48px;
  transform: perspective(300px) rotateX(68deg) translate3d(0, 0, 0);
  transform-origin: bottom center;
  pointer-events: none;
  z-index: 0;
  will-change: transform, opacity;
  opacity: calc(0.55 + var(--vis-bass, 0) * 0.45 + var(--vis-strobe, 0) * 0.35);
  animation: dopamineGridDriftGpu 1.8s linear infinite;
}

@keyframes dopamineGridDriftGpu {
  0% { transform: perspective(300px) rotateX(68deg) translate3d(0, 0, 0); }
  100% { transform: perspective(300px) rotateX(68deg) translate3d(0, 48px, 0); }
}

/* Cosmic Plasma Aurora & Visualizer Kick Strobe Glow (GPU Composited Opacity & Scale, Zero-Paint) */
body.dopamine-active::after {
  content: '';
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(ellipse at 50% 15%, hsla(calc(var(--vis-hue, 280deg) + 300deg), 100%, 60%, calc(0.20 + var(--vis-bass, 0) * 0.45)) 0%, hsla(var(--vis-hue, 280deg), 100%, 55%, calc(0.12 + var(--vis-treble, 0) * 0.30)) 40%, transparent 75%),
    radial-gradient(circle at 15% 85%, hsla(calc(var(--vis-hue, 280deg) + 180deg), 100%, 50%, calc(0.15 + var(--vis-bass, 0) * 0.35)) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
  will-change: transform, opacity;
  opacity: calc(0.40 + var(--vis-bass, 0) * 0.55 + var(--vis-strobe, 0) * 0.35);
  transform: translate3d(0, 0, 0);
  animation: dopamineAuroraFloatGpu 4.5s ease-in-out infinite alternate;
}

@keyframes dopamineAuroraFloatGpu {
  0% { transform: scale(1.0) translate3d(0, 0, 0); }
  50% { transform: scale(1.04) translate3d(0, -6px, 0); }
  100% { transform: scale(0.98) translate3d(0, 4px, 0); }
}

/* Header Dopamine Glow */
body.dopamine-active .app-header {
  border-bottom: 2px solid transparent !important;
  border-image: linear-gradient(90deg, #ec4899, #a855f7, #00f0ff, #10b981, #f59e0b, #ec4899) 1 !important;
  box-shadow: 0 4px 20px rgba(236, 72, 153, 0.25);
}

body.dopamine-active .brand-title {
  background: linear-gradient(90deg, #ff007f 0%, #00f0ff 40%, #fbbf24 80%, #ff007f 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: dopamineRainbowText 4s linear infinite;
  filter: drop-shadow(0 0 10px rgba(236, 72, 153, 0.6));
}

@keyframes dopamineRainbowText {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* Rack Unit Overkill RGB Border & Neon Glow */
body.dopamine-active .rack-unit {
  border: 2px solid transparent !important;
  background-clip: padding-box, border-box !important;
  background-origin: padding-box, border-box !important;
  background-image: 
    linear-gradient(172deg, #181128 0%, #0f081c 45%, #06030c 100%),
    linear-gradient(135deg, #ec4899 0%, #a855f7 33%, #00f0ff 66%, #f59e0b 100%) !important;
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.95),
    0 0 25px rgba(236, 72, 153, 0.28),
    0 0 40px rgba(0, 240, 255, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.25) inset !important;
  animation: dopamineBorderPulse 3s ease-in-out infinite alternate;
}

@keyframes dopamineBorderPulse {
  0% { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.95), 0 0 20px rgba(236, 72, 153, 0.2), 0 0 30px rgba(0, 240, 255, 0.15); }
  100% { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.95), 0 0 35px rgba(236, 72, 153, 0.45), 0 0 50px rgba(0, 240, 255, 0.35); }
}

/* Play Button Hyper Overdrive */
body.dopamine-active .btn-hero-play {
  background: linear-gradient(135deg, #ec4899 0%, #ff0055 50%, #f59e0b 100%) !important;
  color: #ffffff !important;
  border-color: #fbbf24 !important;
  box-shadow: 0 0 16px rgba(236, 72, 153, 0.8), 0 0 30px rgba(255, 0, 85, 0.5) !important;
  text-shadow: 0 0 8px #ffffff, 0 0 14px #ff0055 !important;
  font-weight: 900 !important;
  animation: dopamineBtnPulse 1.2s infinite alternate !important;
}

@keyframes dopamineBtnPulse {
  0% { transform: scale(1.0); box-shadow: 0 0 14px rgba(236, 72, 153, 0.7); }
  100% { transform: scale(1.03); box-shadow: 0 0 25px rgba(255, 0, 85, 1.0), 0 0 40px rgba(245, 158, 11, 0.6); }
}

body.dopamine-active .btn-hero-play.playing {
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 50%, #00f0ff 100%) !important;
  border-color: #00f0ff !important;
  animation: dopaminePlaySpinGlow 1.8s linear infinite !important;
}

@keyframes dopaminePlaySpinGlow {
  0% { box-shadow: 0 0 15px #ec4899, 0 0 25px #00f0ff; }
  50% { box-shadow: 0 0 25px #00f0ff, 0 0 35px #a855f7; }
  100% { box-shadow: 0 0 15px #ec4899, 0 0 25px #00f0ff; }
}

/* Stop, Loop, and Sub Buttons */
body.dopamine-active .btn-hero-stop:hover {
  background: linear-gradient(180deg, #ef4444 0%, #991b1b 100%) !important;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.8) !important;
}

body.dopamine-active .btn-hero-loop.active {
  background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.7) !important;
}

/* Cassette Window Neon Chamber */
body.dopamine-active .cassette-window {
  border-color: rgba(236, 72, 153, 0.45) !important;
  box-shadow: 
    0 0 20px rgba(236, 72, 153, 0.3) inset,
    0 0 15px rgba(0, 240, 255, 0.2) !important;
  background: radial-gradient(circle at center, rgba(236, 72, 153, 0.08) 0%, #05020a 75%) !important;
}

body.dopamine-active .cassette-reel {
  border-color: #ec4899 !important;
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.7) !important;
}

body.dopamine-active .cassette-reel.spinning {
  animation-duration: 0.35s !important; /* 超爆速回転 */
}

body.dopamine-active .tape-badge-brand {
  color: #ff007f !important;
  text-shadow: 0 0 8px #ff007f, 0 0 14px #a855f7 !important;
  animation: dopamineFlicker 0.4s infinite alternate;
}

/* Volume Slider & Seek Bar Dopamine Flow */
body.dopamine-active .hi-fi-seek-slider {
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.4) !important;
}

body.dopamine-active .std-volume-slider-large::-webkit-slider-thumb {
  background: #ff007f !important;
  box-shadow: 0 0 14px #ff007f, 0 0 24px #a855f7 !important;
  border-color: #ffffff !important;
}

body.dopamine-active .rotary-knob {
  border-color: #ec4899 !important;
  box-shadow: 0 0 20px rgba(236, 72, 153, 0.45), 0 4px 12px rgba(0, 0, 0, 0.9) !important;
}

body.dopamine-active .knob-pointer-led {
  background: #ff007f !important;
  box-shadow: 0 0 10px #ff007f, 0 0 16px #fbbf24 !important;
}

/* Quick Seek & Step Buttons */
body.dopamine-active .btn-seek-step {
  border-color: rgba(236, 72, 153, 0.35) !important;
}
body.dopamine-active .btn-seek-step:hover {
  background: rgba(236, 72, 153, 0.25) !important;
  border-color: #ec4899 !important;
  color: #ffffff !important;
  box-shadow: 0 0 10px #ec4899 !important;
}

body.dopamine-active .beat-sync-led.active {
  background: linear-gradient(90deg, #ec4899, #f59e0b) !important;
  color: #fff !important;
  box-shadow: 0 0 16px #ec4899, 0 0 30px #f59e0b !important;
  text-shadow: 0 0 6px #fff !important;
}

/* Floating Neon Dopamine Pop-out Text on Click / Tap */
.dopamine-pop-text {
  position: fixed;
  pointer-events: none;
  z-index: 999999;
  font-family: 'Outfit', 'Montserrat', -apple-system, sans-serif;
  font-weight: 900;
  font-size: 21px;
  letter-spacing: 0.04em;
  color: #ffffff;
  text-shadow: 
    0 0 6px #fff,
    0 0 12px #ff007f,
    0 0 24px #ff0055,
    0 0 36px #00f0ff;
  -webkit-text-stroke: 1.2px rgba(0, 0, 0, 0.9);
  transform: translate(-50%, -50%) rotate(var(--pop-rot, 0deg));
  will-change: transform, opacity;
  animation: dopaminePopFloat 0.65s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
  white-space: nowrap;
  user-select: none;
}

@keyframes dopaminePopFloat {
  0% {
    opacity: 0;
    transform: translate(-50%, -10%) scale(0.4) rotate(var(--pop-rot, 0deg));
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -55px) scale(1.3) rotate(var(--pop-rot, 0deg));
  }
  70% {
    opacity: 1;
    transform: translate(-50%, -85px) scale(1.05) rotate(var(--pop-rot, 0deg));
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -115px) scale(0.9) rotate(var(--pop-rot, 0deg));
  }
}

/* ========================================================
   SLOT GOGO LAMP (JUGGLER PEKA LAMP GAKO! NOTIFICATION)
   ======================================================== */
.gogo-lamp {
  display: none;
  align-items: center;
  gap: 3px;
  background: #08030b;
  border: 1px solid #2d1238;
  border-radius: 4px;
  padding: 2px 7px;
  cursor: pointer;
  user-select: none;
  transition: all 0.12s ease-out;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.8) inset;
}

body.dopamine-active .gogo-lamp {
  display: inline-flex;
}

.gogo-lamp .gogo-star {
  font-size: 10px;
  color: #3b1847;
  transition: all 0.12s ease-out;
}

.gogo-lamp .gogo-label {
  font-family: 'Arial Black', Impact, sans-serif;
  font-size: 11px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.5px;
  color: #4a225a;
  transition: all 0.12s ease-out;
}

.gogo-lamp .gogo-chance {
  font-family: 'Share Tech Mono', monospace;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #3a1645;
  transition: all 0.12s ease-out;
}

/* GOGO! CHANCE 激熱点灯 (ペカッ！！) */
.gogo-lamp.is-peka,
.gogo-lamp:hover {
  background: radial-gradient(circle at center, #3b0764 0%, #150224 100%);
  border-color: #f43f5e;
  box-shadow: 
    0 0 16px rgba(244, 63, 94, 0.8),
    0 0 30px rgba(168, 85, 247, 0.7),
    0 0 10px rgba(255, 255, 255, 0.4) inset;
  transform: scale(1.06);
  animation: gogoPekaStrobe 0.18s infinite alternate;
}

.gogo-lamp.is-peka .gogo-star,
.gogo-lamp:hover .gogo-star {
  color: #ff0055;
  text-shadow: 0 0 8px #ff0055, 0 0 14px #ff0055;
}

.gogo-lamp.is-peka .gogo-label,
.gogo-lamp:hover .gogo-label {
  color: #ffffff;
  text-shadow: 
    0 0 6px #ff0055,
    0 0 14px #ff0055,
    0 0 24px #e11d48;
}

.gogo-lamp.is-peka .gogo-chance,
.gogo-lamp:hover .gogo-chance {
  color: #ffd700;
  text-shadow: 0 0 6px #ffd700, 0 0 12px #f59e0b;
}

.gogo-lamp:active {
  transform: scale(0.96);
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.9) inset;
}

@keyframes gogoPekaStrobe {
  0% { filter: brightness(1.0); }
  100% { filter: brightness(1.25); }
}

/* Realtime Dopamine Counter Badge in Header (Only displayed when Dopamine is ON) */
.dopamine-counter-badge {
  display: none;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(255, 0, 127, 0.3) 0%, rgba(168, 85, 247, 0.35) 100%);
  border: 1px solid rgba(255, 0, 127, 0.65);
  box-shadow: 0 0 12px rgba(255, 0, 127, 0.4), 0 0 20px rgba(0, 240, 255, 0.2) inset;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  animation: dopamineBadgeGlow 2s infinite alternate;
  user-select: none;
  cursor: pointer;
  transition: transform 0.1s ease;
}

body.dopamine-active .dopamine-counter-badge {
  display: inline-flex;
}

.dopamine-counter-badge:hover {
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 0 20px rgba(255, 0, 127, 0.7), 0 0 16px rgba(255, 215, 0, 0.6);
  border-color: #ffd700;
}

.dopamine-counter-badge:active {
  transform: scale(0.94);
  box-shadow: 0 0 6px rgba(255, 0, 127, 0.4) inset;
}

.dopamine-counter-badge .counter-label {
  color: #ff77c6;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.dopamine-counter-badge .counter-num {
  color: #ffd700;
  font-weight: 900;
  font-size: 13px;
  text-shadow: 0 0 8px #ffd700, 0 0 16px #ff007f;
}

.dopamine-counter-badge .counter-unit {
  color: #00f0ff;
  font-size: 10px;
  font-weight: 700;
}

@keyframes dopamineBadgeGlow {
  0% { box-shadow: 0 0 8px rgba(255, 0, 127, 0.3); border-color: rgba(255, 0, 127, 0.5); }
  100% { box-shadow: 0 0 18px rgba(255, 0, 127, 0.7), 0 0 25px rgba(255, 215, 0, 0.3); border-color: rgba(255, 215, 0, 0.8); }
}

/* ========================================================
   EMERGENCY ROTARY BEACON (画面上端マウント型 ドパガキ赤色回転灯 パトランプ)
   ======================================================== */
.patlamp-container {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: none;
  flex-direction: column;
  align-items: center;
  width: 180px;
  height: 84px;
  overflow: visible;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

body.dopamine-active .patlamp-container {
  display: flex;
  animation: patlampDropIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes patlampDropIn {
  0% {
    transform: translateX(-50%) translateY(-30px);
    opacity: 0;
  }
  100% {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

.patlamp-container:hover {
  transform: translateX(-50%) scale(1.04);
}

.patlamp-container:active {
  transform: translateX(-50%) scale(0.96) translateY(2px);
}

.patlamp-bracket {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 86px;
  height: 6px;
  background: linear-gradient(90deg, #0f172a 0%, #334155 25%, #64748b 50%, #334155 75%, #0f172a 100%);
  border-bottom: 1px solid #94a3b8;
  border-radius: 0 0 2px 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 5px;
  z-index: 10;
  pointer-events: none;
}

.patlamp-bracket-label {
  display: none;
}

.patlamp-screw {
  width: 3.5px;
  height: 3.5px;
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #cbd5e1 50%, #475569 100%);
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.patlamp-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 180px;
  height: 84px;
  pointer-events: auto;
  cursor: pointer;
  z-index: 8;
  contain: strict;
}

/* Screen-Wide Volumetric Sweeping Light Canvas (コックピット全体を舐め回す回転投光ビーム) */
.patlamp-light-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  width: 100%;
  height: 100vh;
  height: 100%;
  pointer-events: none;
  z-index: 50;
  display: none;
  contain: strict;
  transform: translateZ(0);
  will-change: transform;
}

body.dopamine-active .patlamp-light-canvas {
  display: block;
}

/* Hyper interactive click bounce for all buttons in Dopamine mode */
body.dopamine-active button:active,
body.dopamine-active .std-btn:active {
  transform: scale(0.94) !important;
  filter: brightness(1.4) drop-shadow(0 0 12px #ff007f) !important;
}

/* 2. Main Playback Cluster */
.std-playback-cluster {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #04070e;
  border: 1px solid #1c2638;
  border-radius: 4px;
  padding: 5px;
}

.playback-main-row {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 1.05fr 1.05fr;
  gap: 4px;
}

.btn-hero-loop,
.btn-hero-autonext {
  padding: 5px 2px;
  font-size: 9px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  letter-spacing: -0.3px;
}

.btn-hero-loop.active {
  border-color: #ec4899;
  color: #f472b6;
  background: rgba(236, 72, 153, 0.18);
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.45);
}

.btn-hero-autonext.active {
  border-color: #00f0ff;
  color: #38bdf8;
  background: rgba(0, 240, 255, 0.16);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.playback-sub-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.std-btn {
  background: linear-gradient(180deg, #263347 0%, #161f2e 50%, #0e141f 100%);
  border: 1px solid #33445c;
  color: #cbd5e1;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 10px;
  padding: 5px 4px;
  border-radius: 5px;
  cursor: pointer;
  box-shadow: 
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 2px 4px rgba(0,0,0,0.6),
    0 0 0 1px #05080e;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

.std-btn:hover {
  color: #fff;
  border-color: var(--cyan);
  box-shadow: 
    0 1px 0 rgba(255, 255, 255, 0.3) inset,
    0 3px 8px rgba(0,0,0,0.7),
    0 0 8px rgba(0, 240, 255, 0.3);
}

.std-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(0,0,0,0.8), 0 0 0 1px #05080e;
}

.btn-hero-play {
  background: linear-gradient(180deg, #0284c7 0%, #0369a1 60%, #075985 100%);
  border-color: #38bdf8;
  color: #ffffff;
  padding: 6px 10px;
  font-size: 11px;
  border-radius: 5px;
  box-shadow: 
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 3px 8px rgba(2, 132, 199, 0.5),
    0 0 0 1px #024368;
}

.btn-hero-play.playing {
  background: linear-gradient(180deg, #facc15 0%, #eab308 60%, #ca8a04 100%);
  border-color: #fef08a;
  color: #000;
  box-shadow: 
    0 1px 0 rgba(255, 255, 255, 0.5) inset,
    0 3px 10px rgba(234, 179, 8, 0.6),
    0 0 0 1px #854d0e;
}

.btn-hero-stop {
  background: linear-gradient(180deg, #451a1e 0%, #290f13 60%, #1c0a0c 100%);
  border-color: #991b1b;
  color: #fca5a5;
  padding: 6px 10px;
  font-size: 11px;
  border-radius: 5px;
  box-shadow: 
    0 1px 0 rgba(255, 255, 255, 0.2) inset,
    0 2px 6px rgba(0,0,0,0.6),
    0 0 0 1px #0a0405;
}

.btn-hero-stop:hover {
  border-color: #ef4444;
  color: #fff;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

/* ========================================================
   MASTER VOLUME DECK (主役級アナログ＆デジタルボリューム)
   ======================================================== */
.master-volume-deck {
  background: linear-gradient(180deg, #0e1524 0%, #060912 100%);
  border: 2px solid #273952;
  border-radius: 6px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.75), 0 1px 0 rgba(255, 255, 255, 0.08) inset;
}

.vol-deck-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #1a2538;
  padding-bottom: 4px;
}

.vol-deck-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.vol-indicator-led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

.vol-deck-tag {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #cbd5e1;
}

.vol-readout-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vol-db-display {
  font-size: 11px;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 1px;
}

.vol-percentage-large {
  font-size: 13px;
  font-weight: 900;
  color: var(--cyan);
  background: #000;
  border: 1px solid #1e293b;
  padding: 1px 6px;
  border-radius: 3px;
  min-width: 44px;
  text-align: center;
  text-shadow: 0 0 8px var(--cyan-glow);
}

.vol-cockpit-row {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 8px;
  align-items: center;
}

/* Rotary Knob */
.rotary-knob-wrap {
  position: relative;
  width: 66px;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
}

.rotary-knob-wrap:active {
  cursor: grabbing;
}

.knob-scale-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px dashed #223048;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 2px;
}

.scale-mark {
  font-size: 7px;
  color: #64748b;
  font-weight: 800;
}
.scale-mark.min { position: absolute; bottom: 3px; left: 3px; }
.scale-mark.mid { position: absolute; top: 1px; left: 50%; transform: translateX(-50%); font-size: 11px; }
.scale-mark.max { position: absolute; bottom: 3px; right: 3px; }

.rotary-knob {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: conic-gradient(from 45deg, #2d3c52 0%, #64748b 25%, #182233 45%, #64748b 70%, #1a2436 85%, #475569 100%);
  border: 1.5px solid #64748b;
  box-shadow: 
    0 6px 14px rgba(0, 0, 0, 0.95),
    0 0 0 1.5px #0a0f18,
    0 0 0 3px #223249,
    0 1px 0 rgba(255, 255, 255, 0.4) inset;
  position: relative;
  transform: rotate(0deg); /* Default for 50%: -135 + 0.50 * 270 = 0deg */
  transition: transform 0.05s ease-out;
}

.knob-pointer-led {
  position: absolute;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 3.5px;
  height: 8px;
  background: var(--cyan);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--cyan);
}

.knob-center-cap {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #475569 0%, #1e293b 55%, #0b111a 100%);
  border: 1px solid #4a5d78;
  box-shadow: 0 2px 4px rgba(0,0,0,0.8), 0 1px 0 rgba(255,255,255,0.2) inset;
}

/* Slider & Buttons */
.vol-fader-cluster {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.vol-fader-bar-wrap {
  width: 100%;
  display: flex;
  align-items: center;
}

.std-volume-slider-large {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 10px;
  background: linear-gradient(90deg, #0284c7 0%, #00f0ff 50%, #1e293b 50%);
  border-radius: 3px;
  outline: none;
  border: 1px solid #334155;
  box-shadow: 0 1px 4px rgba(0,0,0,0.8) inset;
}

.std-volume-slider-large::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 22px;
  border-radius: 3px;
  background: linear-gradient(180deg, #94a3b8 0%, #334155 100%);
  border: 1px solid #cbd5e1;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.8), 0 0 6px var(--cyan);
}

.vol-quick-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-vol-mute {
  font-size: 9px;
  padding: 5px 8px;
  font-weight: 800;
}

.std-btn-opt {
  background: #090e18;
  border: 1px solid #1e293b;
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: bold;
  padding: 5px 8px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
}

.std-btn-opt.active {
  border-color: #ec4899;
  color: #ec4899;
  background: rgba(236, 72, 153, 0.1);
  box-shadow: 0 0 8px rgba(236, 72, 153, 0.3);
}

.std-btn-opt.muted {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.btn-vol-preset {
  flex: 1;
  background: #0f172a;
  border: 1px solid #24324a;
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: bold;
  padding: 4px 2px;
  border-radius: 2px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.btn-vol-preset:hover {
  border-color: var(--cyan);
  color: #fff;
  background: rgba(0, 240, 255, 0.1);
}

.btn-vol-preset:active {
  background: var(--cyan);
  color: #000;
}

/* ========================================================
   TRACK POSITION & TIME SEEK DECK (主役級大型シークバー＆タイム表示)
   ======================================================== */
.time-seek-deck {
  background: linear-gradient(180deg, #0a0f1c 0%, #04070e 100%);
  border: 2px solid #24344d;
  border-radius: 6px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.75), 0 1px 0 rgba(255, 255, 255, 0.08) inset;
}

.seek-deck-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #1a2538;
  padding-bottom: 3px;
}

.seek-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.seek-indicator-led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green-crt);
  box-shadow: 0 0 8px var(--green-crt);
}

.seek-deck-tag {
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 1.2px;
  color: #cbd5e1;
}

.seek-time-display-group {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #000;
  border: 1px solid #1e293b;
  padding: 1px 6px;
  border-radius: 3px;
}

.vfd-big-time {
  font-size: 11.5px;
  font-weight: 900;
  color: var(--cyan);
  letter-spacing: 0.8px;
  text-shadow: 0 0 8px var(--cyan-glow);
  min-width: 32px;
  text-align: right;
}

.vfd-big-time.total {
  color: #94a3b8;
  text-shadow: none;
  text-align: left;
}

.vfd-time-separator {
  color: #475569;
  font-size: 11px;
  font-weight: bold;
}

.seek-pct-badge {
  font-size: 8.5px;
  font-weight: 900;
  color: var(--gold);
  margin-left: 3px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid var(--gold);
  padding: 1px 3px;
  border-radius: 2px;
}

/* Track Title Container */
.track-title-container {
  display: flex;
  align-items: center;
  gap: 5px;
}

.track-title-vfd {
  background: linear-gradient(180deg, #020912 0%, #01050a 100%);
  border: 1.5px solid #1c2e44;
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 800;
  color: #38bdf8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
  flex: 1;
  box-shadow: 
    0 0 12px rgba(0, 240, 255, 0.12) inset,
    0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
}

/* Large Hi-Fi Illuminated Progress Seek Bar */
.seek-slider-container {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: linear-gradient(180deg, #070d18 0%, #020409 100%);
  border: 1.5px solid #24354c;
  border-radius: 6px;
  padding: 5px 8px 6px;
  box-shadow: 
    0 2px 10px rgba(0, 0, 0, 0.8) inset,
    0 1px 0 rgba(255, 255, 255, 0.1);
}

.seek-scale-marks {
  display: flex;
  justify-content: space-between;
  font-size: 7px;
  color: #64748b;
  font-weight: 800;
  padding: 0 2px;
}

.seek-bar-track-wrap {
  width: 100%;
  display: flex;
  align-items: center;
}

.hi-fi-seek-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 9px;
  background: linear-gradient(90deg, #10b981 0%, #00f0ff 0%, #0f172a 0%);
  border-radius: 2px;
  outline: none;
  border: 1px solid #334155;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.9) inset;
  cursor: pointer;
  transition: box-shadow 0.15s;
}

.hi-fi-seek-slider:hover {
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.35) inset, 0 0 6px rgba(0, 240, 255, 0.4);
}

.hi-fi-seek-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 18px;
  border-radius: 2px;
  background: linear-gradient(180deg, #f8fafc 0%, #64748b 40%, #1e293b 100%);
  border: 1px solid #38bdf8;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.9), 0 0 8px var(--cyan);
}

/* Quick Seek Controls Row */
.seek-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.seek-quick-buttons {
  display: flex;
  gap: 3px;
}

.btn-seek-step {
  background: #0d1524;
  border: 1px solid #223048;
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 800;
  padding: 3px 5px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-seek-step:hover {
  border-color: var(--cyan);
  color: #fff;
  background: rgba(0, 240, 255, 0.1);
}

.btn-seek-step:active {
  transform: translateY(1px);
}

.format-mini-badge {
  background: #020408;
  border: 1px solid #1e293b;
  border-radius: 2px;
  padding: 2px 5px;
  font-size: 8px;
  font-weight: 900;
  color: var(--cyan);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metrics-row {
  display: flex;
  gap: 5px;
}

.metric-segment {
  background: #020408;
  border: 1px solid #1e293b;
  border-radius: 2px;
  padding: 2px 5px;
  flex: 1;
}

.seg-title {
  font-size: 6px;
  color: #64748b;
  display: block;
}

.seg-digit {
  font-size: 9px;
  font-weight: 900;
  color: var(--cyan);
}

/* 5. Motorized Cassette Door with Smoked Glass Acrylic Window */
.cassette-door {
  background: linear-gradient(180deg, #090e18 0%, #03060c 100%);
  border: 2px solid #273952;
  border-radius: 6px;
  padding: 5px;
  cursor: pointer;
  box-shadow: 
    0 1px 0 rgba(255, 255, 255, 0.1) inset,
    0 3px 10px rgba(0, 0, 0, 0.7);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.cassette-door:hover, .cassette-door.drag-active {
  border-color: var(--cyan);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.3) inset, 0 4px 16px rgba(0, 0, 0, 0.8);
}

.cassette-window {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: radial-gradient(circle at 50% 50%, #111a28 0%, #060a12 100%);
  border: 1.5px solid #1a2538;
  border-radius: 5px;
  padding: 5px 10px;
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 0 25px rgba(0, 0, 0, 0.95) inset,
    0 1px 0 rgba(255, 255, 255, 0.12);
}

/* Smoked Glass Curved Reflection Highlight (The Sex Appeal!) */
.cassette-window::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.22) 0%, 
    rgba(255, 255, 255, 0.06) 28%, 
    rgba(255, 255, 255, 0.0) 50%, 
    rgba(0, 240, 255, 0.04) 100%);
  pointer-events: none;
  border-radius: 5px;
}

.cassette-reel {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid #64748b;
  background: radial-gradient(circle, #f1f5f9 12%, #334155 24%, #0f172a 65%, #020610 100%);
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.9), 0 0 0 1px #000;
  will-change: transform;
  transform: translateZ(0);
}

.reel-teeth {
  position: absolute;
  top: 50%; left: 50%;
  width: 15px; height: 2.5px;
  background: #cbd5e1;
  transform: translate(-50%, -50%);
  border-radius: 1px;
}

.reel-teeth::after {
  content: '';
  position: absolute;
  width: 2.5px; height: 15px;
  top: 50%; left: 50%;
  background: #cbd5e1;
  transform: translate(-50%, -50%);
  border-radius: 1px;
}

.cassette-reel.spinning {
  animation: reelSpin 2.4s linear infinite;
  will-change: transform;
}

@keyframes reelSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.tape-center-bridge {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.tape-badge-brand {
  font-size: 7.5px;
  font-weight: 900;
  letter-spacing: 1.2px;
  color: var(--gold);
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid var(--gold);
  padding: 1px 5px;
  border-radius: 2px;
  display: inline-block;
}

.tape-badge-sub {
  font-size: 6.5px;
  letter-spacing: 0.8px;
  color: #94a3b8;
  display: block;
}

/* ========================================================
   MULTI-TRACK PLAYLIST QUEUE DECK (複数ファイル・フォルダ対応ラック)
   ======================================================== */
.playlist-deck {
  background: linear-gradient(180deg, #0a1120 0%, #040812 100%);
  border: 2px solid #273952;
  border-radius: 6px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 3px 10px rgba(0, 0, 0, 0.7);
}

.playlist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
  padding-bottom: 3px;
  border-bottom: 1px solid #1c2b3e;
}

.playlist-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.playlist-title {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 800;
  color: var(--cyan);
  letter-spacing: 0.8px;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}

.playlist-count-badge {
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 700;
  color: #94a3b8;
  background: #090f1a;
  border: 1px solid #2d405b;
  padding: 1px 6px;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.6) inset;
}

.playlist-tools {
  display: flex;
  align-items: center;
  gap: 3px;
}

.std-btn-pl {
  background: linear-gradient(180deg, #1b2638 0%, #0e1624 100%);
  border: 1px solid #33445c;
  color: #cbd5e1;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 3px;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15) inset, 0 1px 3px rgba(0,0,0,0.6);
  transition: all 0.15s;
}

.std-btn-pl:hover {
  border-color: var(--cyan);
  color: #fff;
  background: rgba(0, 240, 255, 0.15);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

.std-btn-pl.active {
  border-color: #10b981;
  color: #10b981;
  background: rgba(16, 185, 129, 0.18);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.45);
}

.btn-pl-clear:hover {
  border-color: #ef4444;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.18);
}

.playlist-scroll-area {
  max-height: 95px;
  min-height: 52px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #02050a;
  border: 1.5px solid #1a2738;
  border-radius: 5px;
  scrollbar-width: thin;
  scrollbar-color: #38bdf8 #02050a;
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.95) inset;
}

.playlist-scroll-area::-webkit-scrollbar {
  width: 5px;
}

.playlist-scroll-area::-webkit-scrollbar-track {
  background: #02050a;
}

.playlist-scroll-area::-webkit-scrollbar-thumb {
  background: #27384e;
  border-radius: 3px;
}

.playlist-empty-hint {
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #475569;
  text-align: center;
  border: 1px dashed #24354c;
  border-radius: 5px;
  margin: 6px;
}

.playlist-empty-hint .empty-icon {
  font-size: 18px;
  opacity: 0.7;
}

.playlist-empty-hint .empty-text {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #78909c;
}

.playlist-empty-hint .empty-sub {
  font-size: 7.5px;
  letter-spacing: 1px;
  color: #37474f;
}

.playlist-items-list {
  list-style: none;
  margin: 0;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.playlist-item {
  display: grid;
  grid-template-columns: 26px 1fr 50px 48px;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: #060b16;
  border: 1px solid #162438;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: var(--font-mono);
  font-size: 8.5px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.playlist-item:hover {
  background: #0f1a2c;
  border-color: #38bdf8;
  transform: translateX(1px);
}

.playlist-item.active {
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.16), rgba(14, 165, 233, 0.06));
  border-color: var(--cyan);
  box-shadow: 
    0 0 12px rgba(0, 240, 255, 0.3) inset,
    0 1px 0 rgba(255, 255, 255, 0.2);
}

.pl-index {
  color: #64748b;
  font-weight: 800;
  font-size: 8px;
  text-align: center;
}

.playlist-item.active .pl-index {
  color: var(--cyan);
  text-shadow: 0 0 6px var(--cyan);
}

.pl-name {
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

.playlist-item.active .pl-name {
  color: #ffffff;
  font-weight: 800;
  text-shadow: 0 0 6px var(--cyan);
}

.pl-size {
  color: #64748b;
  font-size: 7.5px;
  text-align: right;
}

.pl-status {
  color: #475569;
  font-size: 7.5px;
  font-weight: 800;
  text-align: right;
  letter-spacing: 0.5px;
}

.playlist-item.active .pl-status {
  color: #10b981;
  animation: pulsePlay 1.2s infinite ease-in-out;
}

@keyframes pulsePlay {
  0%, 100% { opacity: 1.0; }
  50% { opacity: 0.4; }
}

/* System Footer */
.system-footer {
  margin-top: 14px;
  font-size: 9px;
  color: #475569;
  letter-spacing: 1.5px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-bottom: 20px;
}

.footer-system-tag {
  opacity: 0.75;
}

.footer-developer-credit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.8px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  padding: 4px 14px 4px 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: all 0.25s ease;
  user-select: none;
}

.footer-developer-credit:hover {
  color: #00f0ff;
  border-color: rgba(0, 240, 255, 0.4);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
  transform: translateY(-1px);
}

.footer-credit-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: block;
  object-fit: cover;
  background: #ffffff;
  box-shadow: 0 0 6px rgba(255, 0, 127, 0.35);
  transition: transform 0.3s ease;
}

.footer-developer-credit:hover .footer-credit-icon {
  transform: rotate(15deg) scale(1.15);
}

.footer-credits-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Offertory Box Banner (控えめなお賽銭バナー) */
.footer-saisen-banner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 11px;
  font-weight: 600;
  color: #fbbf24;
  letter-spacing: 0.6px;
  text-decoration: none;
  background: rgba(40, 25, 12, 0.6);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 9999px;
  padding: 4px 12px 4px 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: all 0.25s ease;
  user-select: none;
  cursor: pointer;
}

.footer-saisen-banner:hover {
  color: #fef08a;
  border-color: rgba(245, 158, 11, 0.65);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
  background: rgba(50, 32, 15, 0.8);
  transform: translateY(-1px);
}

.saisen-icon {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
  filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.3));
  transition: transform 0.3s ease;
}

.footer-saisen-banner:hover .saisen-icon {
  transform: scale(1.18) rotate(-6deg);
}

.saisen-label {
  font-size: 11px;
}

/* Discreet explanation note (控えめ解説テキスト) */
.saisen-discreet-note {
  font-size: 10px;
  color: #64748b;
  letter-spacing: 0.4px;
  margin-top: 1px;
  opacity: 0.8;
  max-width: 620px;
  line-height: 1.45;
  text-align: center;
  transition: all 0.25s ease;
  user-select: none;
}

.system-footer:hover .saisen-discreet-note {
  color: #94a3b8;
  opacity: 1.0;
}

/* ========================================================
   RESPONSIVE MOBILE OPTIMIZATIONS (スマートフォン・タブレット完全対応)
   ======================================================== */
@media (max-width: 768px) {
  body {
    padding: 0 6px 20px;
  }

  /* Header Compact on Mobile */
  .app-header {
    padding: 8px 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 6px;
  }

  .brand-title {
    font-size: 13px;
    letter-spacing: 1px;
  }

  .brand-badge {
    font-size: 9px;
    padding: 2px 6px;
  }

  .system-status-leds {
    font-size: 8.5px;
  }

  /* Rack Chassis: Maximize Viewport Width */
  .rack-unit {
    padding: 8px 10px;
    border-radius: 4px;
  }

  .chassis-bracket {
    display: none; /* Hide side bracket bars on narrow screens */
  }

  .hex-screw {
    display: none; /* Hide screws to save screen real estate */
  }

  .unit-subhead {
    font-size: 8.5px;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
    padding-bottom: 4px;
  }

  /* Transport Tower */
  .transport-tower {
    padding: 8px;
    gap: 8px;
  }

  /* Touch Target Heights (Mobile Accessibility) */
  .std-btn, .btn-hero-play, .btn-hero-stop, .btn-hero-loop, .jingle-aux-btn {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
  }

  .btn-vol-mute {
    min-height: 32px;
  }

  .btn-vol-preset {
    min-height: 30px;
  }

  .btn-seek-step {
    min-height: 32px;
  }

  .std-btn-pl {
    min-height: 28px;
    padding: 4px 8px;
    font-size: 8.5px;
  }

  .playlist-item {
    min-height: 32px;
    font-size: 9px;
  }

  /* Master Volume Mobile Layout */
  .vol-cockpit-row {
    grid-template-columns: 74px 1fr;
    gap: 8px;
  }

  .rotary-knob-wrap {
    width: 70px;
    height: 70px;
    touch-action: none;
  }

  .rotary-knob {
    width: 52px;
    height: 52px;
  }

  .std-volume-slider-large {
    height: 14px;
  }

  .std-volume-slider-large::-webkit-slider-thumb {
    width: 22px;
    height: 26px;
  }

  /* Seek Deck Mobile Layout */
  .seek-controls-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .seek-quick-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
  }

  .format-mini-badge {
    max-width: 100%;
    text-align: center;
  }

  .hi-fi-seek-slider {
    height: 16px;
  }

  .hi-fi-seek-slider::-webkit-slider-thumb {
    width: 22px;
    height: 26px;
  }

  /* Cassette Deck Mobile Touch Prompt */
  .cassette-window {
    padding: 8px;
  }

  .tape-badge-brand {
    font-size: 7.5px;
  }

  .tape-badge-sub {
    font-size: 7px;
  }

  /* Measuring Matrix Mobile Sizing */
  .matrix-canvas-frame {
    min-height: 390px;
    height: 420px;
  }

  /* Fullscreen Splash Mobile HUD */
  .splash-floating-hud {
    bottom: 20px;
    padding: 8px 16px;
    max-width: 90vw;
  }

  .splash-hint {
    font-size: 10px;
    white-space: normal;
  }
}

@media (max-width: 420px) {
  .brand-title {
    font-size: 11.5px;
  }

  .brand-badge {
    font-size: 8.5px;
    padding: 2px 4px;
  }

  .vol-deck-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .vol-readout-group {
    width: 100%;
    justify-content: space-between;
  }

  .seek-deck-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .seek-time-display-group {
    width: 100%;
    justify-content: space-between;
  }

  .playback-main-row {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .playback-sub-row {
    grid-template-columns: repeat(4, 1fr);
  }

  .std-btn {
    font-size: 9px;
    padding: 6px 2px;
  }
}

/* ========================================================
   DOPAMINE MASCOT CHARACTERS & COMIC SPEECH BUBBLES
   (DJ ドパ丸 & 脳汁スライム ドパピィ ＆ 漫画オノマトペ演出)
   ======================================================== */
.dopamine-mascot-dock {
  position: fixed !important;
  bottom: 18px; /* 右下の定位置 */
  right: 18px;
  left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
  z-index: 99990;
  contain: layout style paint;
  will-change: transform;
}

/* Mascot Dock Top Controls (Voice toggle & Tombstone) */
.mascot-dock-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  pointer-events: auto;
}

/* Mascot Duo Container: 2人が右下に並ぶ */
.mascot-duo-container {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
}

.mascot-card {
  pointer-events: auto;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.9));
  transition: transform 0.18s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  user-select: none;
  position: relative;
}

.mascot-card:hover {
  transform: scale(1.08) translateY(-4px);
}

.mascot-card:active {
  transform: scale(1.22) rotate(-8deg);
}

/* 発言中（漫才で喋っているキャラ）のハイライトアクション */
.mascot-card.speaking {
  animation: mascotTalkingBounce 0.32s infinite alternate ease-in-out;
  filter: drop-shadow(0 0 16px rgba(0, 240, 255, 0.8)) drop-shadow(0 8px 24px rgba(0, 0, 0, 0.9));
}

@keyframes mascotTalkingBounce {
  0% { transform: translateY(-4px) scale(1.04); }
  100% { transform: translateY(-12px) scale(1.08, 0.98); }
}

.mascot-avatar-wrap {
  width: 82px;
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mascot-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* DJ Dopamaru Headbang & Animation */
body.dopamine-active .svg-dopamaru {
  animation: mascotBounce 0.36s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

body.dopamine-active .mascot-head-group {
  transform-origin: 60px 80px;
  animation: djHeadbang 0.36s infinite alternate ease-in-out;
}

body.dopamine-active .mascot-hand-l {
  animation: handBeatL 0.24s infinite alternate ease-in-out;
}

body.dopamine-active .mascot-hand-r {
  animation: handBeatR 0.24s infinite alternate ease-in-out 0.12s;
}

/* 発言中の口パク */
.mascot-card.speaking #dopamaru-mouth {
  animation: dopamaruMouthTalk 0.18s infinite alternate ease-in-out;
  transform-origin: 60px 78px;
}

@keyframes dopamaruMouthTalk {
  0% { transform: scaleY(0.6); }
  100% { transform: scaleY(1.4) scaleX(1.1); }
}

@keyframes mascotBounce {
  0% { transform: translateY(0) scale(1.0); }
  100% { transform: translateY(-8px) scale(1.04, 0.96); }
}

@keyframes djHeadbang {
  0% { transform: rotate(-8deg) scaleY(1.0); }
  50% { transform: rotate(0deg) scaleY(0.92); }
  100% { transform: rotate(10deg) scaleY(1.04); }
}

@keyframes handBeatL {
  0% { transform: translateY(0); }
  100% { transform: translateY(-10px) translateX(-4px); }
}

@keyframes handBeatR {
  0% { transform: translateY(0); }
  100% { transform: translateY(-10px) translateX(4px); }
}

/* Dopapy Slime Jiggle & Glow */
body.dopamine-active .svg-dopapy {
  animation: slimeBounce 0.44s infinite alternate ease-in-out;
}

body.dopamine-active .slime-body-shape {
  transform-origin: 50% 80%;
  animation: slimeJiggle 0.32s infinite alternate ease-in-out;
}

body.dopamine-active .slime-drool {
  animation: droolDrip 0.6s infinite alternate;
}

@keyframes slimeBounce {
  0% { transform: translateY(0) scale(1.0, 1.0); }
  100% { transform: translateY(-10px) scale(0.96, 1.05); }
}

@keyframes slimeJiggle {
  0% { transform: scale(1.05, 0.92) rotate(-3deg); }
  100% { transform: scale(0.94, 1.08) rotate(3deg); }
}

@keyframes droolDrip {
  0% { opacity: 0.4; transform: translateY(0) scaleY(0.8); }
  100% { opacity: 1.0; transform: translateY(4px) scaleY(1.3); }
}

/* Comic Speech Bubbles */
.mascot-speech-bubble {
  position: relative;
  background: #ffffff;
  color: #0f172a;
  border: 3px solid #111827;
  border-radius: 12px;
  padding: 6px 10px;
  font-family: 'Outfit', 'Montserrat', -apple-system, sans-serif;
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 0.02em;
  white-space: normal;
  max-width: 155px;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7), 0 0 10px rgba(255, 0, 127, 0.4);
  margin-bottom: 6px;
  transition: all 0.18s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  transform-origin: bottom center;
  pointer-events: auto;
}

/* 尻尾: ドパ丸 (左キャラ) */
.bubble-dopamaru::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid #ffffff;
}

.bubble-dopamaru::before {
  content: '';
  position: absolute;
  bottom: -11px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 10px solid #111827;
}

/* 尻尾: ドパピィ (右キャラ) */
.bubble-dopapy::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid #ffffff;
}

.bubble-dopapy::before {
  content: '';
  position: absolute;
  bottom: -11px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 10px solid #111827;
}

.mascot-speech-bubble.shouting {
  background: linear-gradient(135deg, #fffbeb 0%, #fef08a 100%);
  border-color: #ff0055;
  color: #e11d48;
  transform: scale(1.15) rotate(-3deg);
  box-shadow: 0 0 18px rgba(255, 0, 127, 0.8), 0 0 28px rgba(255, 235, 59, 0.6);
  animation: bubbleShake 0.12s infinite alternate;
}

@keyframes bubbleShake {
  0% { transform: scale(1.15) rotate(-4deg) translate(-2px, 1px); }
  100% { transform: scale(1.15) rotate(3deg) translate(2px, -1px); }
}

.bubble-text {
  display: inline-block;
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
  word-break: break-word;
}

.mascot-tag {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f8fafc;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  margin-top: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}

/* ========================================================
   MANGA ONOMATOPOEIA LAYER (漫画オノマトペ激突エフェクト)
   ======================================================== */
.dopamine-manga-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 99995;
  overflow: hidden;
}

.dopamine-manga-text {
  position: absolute;
  font-family: 'Impact', 'Outfit', 'Montserrat', sans-serif;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.08em;
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
  transform-origin: center center;
  will-change: transform, opacity;
  animation: mangaZoomBlast 0.60s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

@keyframes mangaZoomBlast {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.25) rotate(var(--manga-rot, -10deg));
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.3) rotate(var(--manga-rot, -10deg));
  }
  65% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05) rotate(var(--manga-rot, -10deg));
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -80%) scale(0.95) rotate(var(--manga-rot, -10deg));
  }
}

/* Mobile Responsiveness for Mascots & Ready Screen */
@media (max-width: 640px) {
  .ready-modal-deck {
    padding: 18px 14px 20px;
    gap: 14px;
    width: 95vw;
  }
  .btn-ready-hero {
    padding: 14px 18px;
  }
  .btn-ready-label {
    font-size: 16px;
    letter-spacing: 2.5px;
  }
  .ready-telemetry-readout {
    font-size: 7.5px;
    gap: 8px;
  }
  .mascot-avatar-wrap {
    width: 58px;
    height: 58px;
  }
  .mascot-speech-bubble {
    font-size: 9px;
    padding: 3px 6px;
    max-width: 110px;
  }
  .mascot-tag {
    font-size: 7.5px;
    padding: 1px 4px;
  }
  .dopamine-mascot-dock {
    bottom: 12px; /* モバイル用右下の定位置 */
    right: 8px;
    padding: 0;
  }
}

/* ========================================================
   ABESHI (あべし!!) DEFEAT EXPLOSION & DEADBODIES REACTION
   ======================================================== */
.mascot-card.is-dead {
  display: none !important;
  pointer-events: none !important;
}

/* Both mascots always vibrant & ready for comedy action */
.mascot-card.is-idle-dim {
  opacity: 0.92;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.7));
  transform: scale(0.96);
  transition: all 0.3s ease;
}

/* Explosive "Abeshi" Blast Animation */
.mascot-card.abeshi-exploding {
  pointer-events: none !important;
  animation: mascotAbeshiBlast 0.52s cubic-bezier(0.2, 0.8, 0.2, 1) forwards !important;
  will-change: transform, opacity, filter;
  z-index: 99999 !important;
}

@keyframes mascotAbeshiBlast {
  0% {
    transform: scale(1.0) rotate(0deg);
    filter: drop-shadow(0 0 10px #ff0055) brightness(1.2);
  }
  15% {
    transform: scale(1.6, 0.5) rotate(-16deg) translateY(10px);
    filter: drop-shadow(0 0 35px #ffff00) brightness(3);
  }
  30% {
    transform: scale(0.5, 1.9) rotate(25deg) translateY(-30px);
    filter: drop-shadow(0 0 50px #ff007f) brightness(5);
  }
  55% {
    transform: scale(2.4) rotate(720deg) translateY(-100px);
    opacity: 1;
    filter: drop-shadow(0 0 70px #00f0ff) brightness(6) blur(2px);
  }
  100% {
    transform: scale(3.8) rotate(1440deg) translateY(-260px);
    opacity: 0;
    filter: brightness(12) blur(16px);
  }
}

/* Giant "あべしッ!!" Manga Font */
.dopamine-manga-text.manga-abeshi {
  font-size: clamp(48px, 9vw, 84px) !important;
  background: linear-gradient(180deg, #ffffff 0%, #ffff00 35%, #ff0055 75%, #990022 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 20px #ff0055) drop-shadow(0 0 40px #ffff00);
  -webkit-text-stroke: 4px #000000;
  animation: abeshiZoomImpact 0.70s cubic-bezier(0.1, 0.9, 0.2, 1.3) forwards !important;
  z-index: 100000 !important;
}

@keyframes abeshiZoomImpact {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.1) rotate(var(--manga-rot, -12deg));
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.6) rotate(var(--manga-rot, -12deg));
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.15) rotate(var(--manga-rot, -12deg));
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -85%) scale(0.9) rotate(var(--manga-rot, -12deg));
  }
}

/* Scattered Abeshi Particles */
.abeshi-particle {
  position: absolute;
  pointer-events: none;
  font-size: 24px;
  will-change: transform, opacity;
  animation: abeshiParticleFly 0.65s ease-out forwards;
}

@keyframes abeshiParticleFly {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(var(--p-dx, 60px), var(--p-dy, -80px)) scale(0.2) rotate(var(--p-rot, 360deg));
  }
}

/* Discreet Tombstone Button to Revive Dead Mascots */
.mascot-tombstone {
  pointer-events: auto;
  cursor: pointer;
  background: rgba(17, 24, 39, 0.75);
  border: 1px dashed rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(4px);
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.25s ease;
  user-select: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  margin-top: auto;
}

.mascot-tombstone:hover {
  background: rgba(255, 0, 127, 0.25);
  border-color: #ff007f;
  color: #ffffff;
  transform: scale(1.1);
  box-shadow: 0 0 16px rgba(255, 0, 127, 0.6);
}

/* ========================================================
   MOBILE RESTRICTION SCREEN (スマホ起動不可・かっこいい軍事サイバーHUD)
   81-Gauge Audio Cockpit requires a desktop/PC terminal (1024px+)
   ======================================================== */
.mobile-denied-overlay {
  display: none; /* Desktop default: hidden */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  width: 100%;
  height: 100vh;
  height: 100%;
  height: 100dvh;
  z-index: 999999999;
  background: radial-gradient(circle at 50% 35%, #180509 0%, #0c0204 55%, #050002 100%);
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: none;
  font-family: var(--font-mono);
}

/* Auto-trigger on mobile screens (<= 860px) or when mobile terminal is flagged */
@media (max-width: 860px), (pointer: coarse) and (max-width: 1024px) {
  .mobile-denied-overlay {
    display: flex !important;
  }
  /* Completely lock and freeze background under mobile restriction */
  body {
    overflow: hidden !important;
    height: 100vh !important;
    height: 100dvh !important;
  }
}

body.mobile-terminal-blocked .mobile-denied-overlay {
  display: flex !important;
}

/* CRT Scanlines & Screen Vignette */
.denied-crt-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(255, 0, 60, 0.08) 50%);
  background-size: 100% 3px;
}

.denied-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  box-shadow: 0 0 100px rgba(0, 0, 0, 0.95) inset, 0 0 40px rgba(255, 0, 55, 0.25) inset;
}

.denied-radar-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image: 
    linear-gradient(rgba(255, 0, 55, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 0, 55, 0.05) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Armor Plated Tactical Card Deck */
.denied-card-deck {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 480px;
  background: linear-gradient(165deg, #1b070b 0%, #100305 50%, #080103 100%);
  border: 2px solid #ef4444;
  border-radius: 14px;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.95),
    0 0 45px rgba(239, 68, 68, 0.25),
    0 0 30px rgba(239, 68, 68, 0.15) inset;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: deniedDeckPulse 3s ease-in-out infinite;
}

@keyframes deniedDeckPulse {
  0%, 100% { border-color: #ef4444; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.95), 0 0 40px rgba(239, 68, 68, 0.25); }
  50% { border-color: #f59e0b; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.95), 0 0 55px rgba(245, 158, 11, 0.35); }
}

.denied-header-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.15);
  border-bottom: 1px solid rgba(239, 68, 68, 0.4);
}

.denied-alert-beacon {
  display: flex;
  align-items: center;
  gap: 8px;
}

.denied-beacon-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff0055;
  box-shadow: 0 0 10px #ff0055;
  animation: beaconBlink 0.8s infinite alternate;
}

@keyframes beaconBlink {
  from { opacity: 0.3; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1.3); }
}

.denied-beacon-text {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #ff4d6d;
}

.denied-err-code {
  font-size: 9px;
  font-weight: 700;
  color: #fbbf24;
  opacity: 0.85;
}

.denied-body {
  padding: 20px 18px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

/* Rotating Warning Emblem */
.denied-warning-emblem {
  position: relative;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.denied-emblem-ring {
  position: absolute;
  inset: 0;
  border: 2px dashed #ff0055;
  border-radius: 50%;
  animation: ringSpin 12s linear infinite;
}

@keyframes ringSpin {
  to { transform: rotate(360deg); }
}

.denied-emblem-icon {
  font-size: 32px;
  filter: drop-shadow(0 0 12px rgba(255, 0, 85, 0.8));
}

.denied-title-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.denied-title-sub {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #94a3b8;
}

.denied-title-main {
  font-size: clamp(18px, 5vw, 22px);
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #ffffff;
  text-shadow: 0 0 16px #ff0055, 0 0 30px #f59e0b;
  margin: 0;
}

.denied-title-jp {
  font-size: 13px;
  font-weight: 800;
  color: #fbbf24;
  letter-spacing: 0.06em;
}

.denied-message-box {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 14px;
  text-align: left;
  line-height: 1.6;
}

.denied-desc-lead {
  font-size: 11.5px;
  color: #f1f5f9;
  margin-bottom: 8px;
}

.denied-desc-lead strong {
  color: #00f0ff;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
}

.denied-desc-sub {
  font-size: 10.5px;
  color: #94a3b8;
  margin: 0;
}

/* Avionics Telemetry Specs Table */
.denied-telemetry-specs {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(8, 2, 4, 0.8);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  padding: 10px 12px;
}

.denied-spec-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
}

.denied-spec-row .spec-k {
  color: #64748b;
  font-weight: 700;
}

.denied-spec-row .spec-v {
  color: #38bdf8;
  font-weight: 800;
}

.denied-spec-row .spec-v.alert-red {
  color: #ef4444;
  text-shadow: 0 0 8px #ef4444;
}

/* Mascots comic banter box */
.denied-mascot-dialogue {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px dashed rgba(0, 240, 255, 0.3);
  border-radius: 8px;
  padding: 10px 12px;
  text-align: left;
}

.denied-mascot-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mascot-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 9px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 4px;
}

.mascot-badge.maru {
  background: #ffd700;
  color: #000;
}

.mascot-badge.papy {
  background: #ff007f;
  color: #fff;
}

.denied-mascot-row .mascot-text {
  font-size: 11px;
  color: #e2e8f0;
  line-height: 1.45;
}

/* Action: One-Tap URL Copy Button */
.denied-action-block {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.btn-copy-url {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 16px;
  border: 2px solid #00f0ff;
  border-radius: 8px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.45);
  transition: all 0.2s ease;
}

.btn-copy-url:active {
  transform: scale(0.97);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.8);
}

.copy-status-toast {
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: #10b981;
  text-shadow: 0 0 8px #10b981;
  opacity: 0;
  transform: translateY(-4px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.copy-status-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================================
   DOPAMINE CYBER CAT (マウスカーソルを追走する高精度アニメーション猫)
   ======================================================== */
.dopamine-cat-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 99990;
  display: none;
  contain: strict;
  will-change: transform;
  transform: translateZ(0);
}

body.dopamine-active .dopamine-cat-canvas {
  display: block;
}

/* ========================================================
   DOPAMINE OVERDRIVE: PACHISLOT "GEKIATSU PUSH" BUTTON GIMMICK
   (スロット・パチンコ 激熱デカPUSHボタン演出)
   ======================================================== */
.dopamine-push-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99996;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  user-select: none;
}

.push-modal-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(30, 0, 40, 0.72) 0%, rgba(5, 0, 10, 0.90) 80%);
  animation: pushBackdropPulse 0.35s ease-out forwards;
}

@keyframes pushBackdropPulse {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.push-device-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: pushDeviceEmerge 0.45s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

@keyframes pushDeviceEmerge {
  0% {
    opacity: 0;
    transform: scale(0.3) translateY(60px);
  }
  70% {
    opacity: 1;
    transform: scale(1.08) translateY(-8px);
  }
  100% {
    opacity: 1;
    transform: scale(1.0) translateY(0);
  }
}

.push-warning-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Impact', 'Outfit', sans-serif;
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.12em;
  color: #fffb00;
  -webkit-text-stroke: 2px #000;
  text-shadow: 0 0 20px #ff0055, 0 0 40px #ff0033;
  animation: warningTextVibe 0.12s infinite alternate;
}

@keyframes warningTextVibe {
  0% { transform: scale(1.0) rotate(-1.5deg); }
  100% { transform: scale(1.05) rotate(1.5deg); }
}

.btn-gekiatsu-push {
  position: relative;
  width: clamp(180px, 30vw, 240px);
  height: clamp(180px, 30vw, 240px);
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  outline: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pushButtonLevavul 0.08s infinite alternate;
}

@keyframes pushButtonLevavul {
  0% { transform: translate(-2px, 1px) rotate(-0.5deg); }
  100% { transform: translate(2px, -1px) rotate(0.5deg); }
}

.push-ring-glow {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #ff0055, #ffeb3b, #00f0ff, #9900ef, #ff0055);
  filter: blur(12px);
  animation: pushRingSpin 1.8s linear infinite;
  opacity: 0.85;
}

@keyframes pushRingSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.push-bezel {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #4a5568 0%, #1a202c 60%, #0d1117 100%);
  border: 4px solid #718096;
  box-shadow: 
    inset 0 4px 8px rgba(255, 255, 255, 0.4),
    inset 0 -6px 12px rgba(0, 0, 0, 0.8),
    0 10px 25px rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}

.push-button-core {
  width: 74%;
  height: 74%;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #ff4070 0%, #d90429 55%, #800016 100%);
  border: 3px solid rgba(255, 255, 255, 0.6);
  box-shadow: 
    inset 0 6px 12px rgba(255, 255, 255, 0.5),
    inset 0 -8px 16px rgba(0, 0, 0, 0.7),
    0 4px 15px rgba(255, 0, 85, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.btn-gekiatsu-push:hover .push-button-core {
  filter: brightness(1.15);
  box-shadow: 
    inset 0 6px 12px rgba(255, 255, 255, 0.7),
    0 0 30px #ff0055;
}

.btn-gekiatsu-push:active .push-button-core,
.btn-gekiatsu-push.is-pressed .push-button-core {
  transform: scale(0.91) translateY(8px);
  box-shadow: 
    inset 0 2px 6px rgba(0, 0, 0, 0.8),
    0 0 50px #ffeb3b,
    0 0 80px #ff0055;
  background: radial-gradient(circle at center, #ffffff 0%, #ffff00 40%, #ff0055 80%);
}

.push-label {
  font-family: 'Impact', 'Outfit', sans-serif;
  font-size: clamp(32px, 7vw, 48px);
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.1em;
  color: #ffffff;
  -webkit-text-stroke: 2px #500010;
  text-shadow: 0 0 12px #fff, 0 2px 4px rgba(0, 0, 0, 0.8);
  line-height: 1;
}

.push-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.2em;
  color: #ffe600;
  text-shadow: 0 0 8px #ff0055;
  margin-top: 4px;
}

.push-hint-text {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  color: #a0aec0;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
  animation: pushHintPulse 0.8s ease-in-out infinite alternate;
}

@keyframes pushHintPulse {
  0% { opacity: 0.6; transform: scale(0.98); }
  100% { opacity: 1; transform: scale(1.02); }
}

.push-device-wrap.push-burst {
  animation: pushDeviceBurst 0.5s cubic-bezier(0.1, 0.9, 0.2, 1.2) forwards;
}

@keyframes pushDeviceBurst {
  0% { transform: scale(1.0); opacity: 1; }
  30% { transform: scale(1.35); opacity: 1; filter: brightness(2.5); }
  100% { transform: scale(1.8); opacity: 0; filter: brightness(4); }
}

