/* MYRIX UI Design System - Master Stylesheet Phase 2 */
.hidden {
  display: none !important;
}

:root {
  --glitch-shadow: 1px 0 0 rgba(255,0,85,0.8), -1px 0 0 rgba(0,240,255,0.8);

  --bg-dark: #080a0e;
  --panel-bg: rgba(13, 17, 23, 0.88);
  --panel-glass: rgba(18, 24, 34, 0.72);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-cyan: rgba(0, 240, 255, 0.35);
  --border-glow: 0 0 14px rgba(0, 240, 255, 0.22);
  
  --cyan-primary: #00f0ff;
  --cyan-dim: #008fa0;
  --purple-accent: #8b5cf6;
  --amber-accent: #f5a623;
  --red-danger: #ef4444;
  --green-health: #10b981;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;

  --font-display: 'Orbitron', -apple-system, sans-serif;
  --font-body: 'Rajdhani', -apple-system, sans-serif;
}

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

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: #030407;
  color: var(--text-main);
  font-family: var(--font-body);
  display: flex;
  justify-content: center;
  align-items: center;
}

#game-container {
  position: relative;
  width: 100%;
  max-width: 440px;
  height: 100vh;
  max-height: 900px;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at center, #10151f 0%, #06080b 100%);
  border-radius: 20px;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(0, 240, 255, 0.25);
  overflow: hidden;
  margin: 0 auto;
}

@media (max-width: 480px) {
  #game-container {
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }
}

/* ==========================================================================
   GLOBAL TOP NAVIGATION BAR
   ========================================================================== */
.global-nav {
  height: 52px;
  background: rgba(8, 11, 16, 0.95);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  z-index: 30;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 3px;
  color: #fff;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.tagline-badge {
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--cyan-primary);
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.25);
  padding: 2px 8px;
  border-radius: 4px;
}

.user-currency-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.currency-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(18, 24, 34, 0.6);
  border: 1px solid var(--border-subtle);
  padding: 4px 12px;
  border-radius: 4px;
}

.currency-icon {
  color: var(--cyan-primary);
  font-size: 14px;
}

.currency-val {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  color: #fff;
}

.currency-label {
  font-size: 9px;
  color: var(--text-muted);
}

.rank-pill {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--amber-accent);
  background: rgba(245, 166, 35, 0.1);
  border: 1px solid rgba(245, 166, 35, 0.3);
  padding: 4px 10px;
  border-radius: 4px;
}

/* ==========================================================================
   VIEWPORT & SWITCHING
   ========================================================================== */
#views-viewport {
  position: relative;
  flex: 1;
  width: 100%;
  overflow: hidden;
}

.app-view {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

.app-view.active {
  display: flex;
  flex-direction: column;
  opacity: 1;
}

/* ==========================================================================
   1. HOME VIEW (Section 22)
   ========================================================================== */
.home-layout {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: 70px;
}

.hero-showcase {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#living-hero-canvas {
  width: 400px;
  height: 380px;
}

.hero-meta-overlay {
  text-align: center;
  margin-top: -30px;
  z-index: 2;
}

#home-hero-name {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 900;
  letter-spacing: 6px;
  color: #fff;
  text-shadow: 0 0 16px rgba(0, 240, 255, 0.4);
}

.hero-subtext {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 6px;
}

.archetype-pill {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--cyan-primary);
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid var(--border-cyan);
  padding: 3px 10px;
  border-radius: 4px;
}

.sync-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--purple-accent);
}

.rival-floating-card {
  position: absolute;
  top: 24px;
  right: 48px;
  width: 320px;
  background: var(--panel-glass);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-cyan);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
  border-radius: 6px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.rfc-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle, #7928ca 0%, #00f0ff 100%);
  box-shadow: 0 0 10px #00f0ff;
}

.rfc-titles {
  flex: 1;
}

.rfc-label {
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.rfc-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  color: #fff;
}

.rfc-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.rfc-stat .num {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: var(--cyan-primary);
}

.rfc-stat .lbl {
  font-size: 8px;
  color: var(--text-muted);
}

.rfc-quote {
  font-size: 13px;
  font-style: italic;
  color: #e5e7eb;
  line-height: 1.35;
  background: rgba(0, 240, 255, 0.06);
  padding: 8px 10px;
  border-left: 2px solid var(--cyan-primary);
}

.rfc-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--cyan-dim);
  letter-spacing: 0.5px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan-primary);
  animation: blink 1.2s infinite;
}

.home-cta-dock {
  margin-top: 24px;
  z-index: 10;
}

.primary-play-btn {
  background: linear-gradient(90deg, #00f0ff 0%, #0088ff 100%);
  border: none;
  border-radius: 4px;
  padding: 16px 56px;
  cursor: pointer;
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.15s, box-shadow 0.15s;
}

.primary-play-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 0 45px rgba(0, 240, 255, 0.8);
}

.play-glitch {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 4px;
  color: #06090e;
}

.play-sub {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: rgba(6, 9, 14, 0.75);
}

/* ==========================================================================
   2. ARENA VIEW
   ========================================================================== */
#view-arena {
  width: 100%;
  height: 100%;
}

#battle-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 78px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 24px;
  background: linear-gradient(180deg, rgba(8, 11, 16, 0.95) 0%, rgba(8, 11, 16, 0) 100%);
  z-index: 20;
  mix-blend-mode: screen;
  pointer-events: none;
}

.hud-entity {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 240px;
}

.character-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.character-badge.right-align {
  justify-content: flex-end;
}

.char-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid var(--cyan-primary);
  border-radius: 4px;
  color: var(--cyan-primary);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
}

.char-icon.rival-icon {
  background: rgba(245, 166, 35, 0.15);
  border-color: var(--amber-accent);
  color: var(--amber-accent);
}

.char-meta {
  display: flex;
  flex-direction: column;
}

.char-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
}

.char-spirit {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.bar-container {
  display: flex;
  flex-direction: column;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar .fill {
  height: 100%;
  transition: width 0.15s ease-out;
}

.health-bar .fill {
  background: linear-gradient(90deg, #00f0ff 0%, #00b4d8 100%);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
}

.health-bar.rival-health .fill {
  background: linear-gradient(90deg, #ef4444 0%, #f5a623 100%);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.energy-bar .fill {
  background: linear-gradient(90deg, #8b5cf6 0%, #c084fc 100%);
  box-shadow: 0 0 6px rgba(139, 92, 246, 0.5);
}

.core-status {
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.core-status.right-align {
  justify-content: flex-end;
}

.core-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan-primary);
  box-shadow: 0 0 6px var(--cyan-primary);
}

.core-dot.rival {
  background: var(--red-danger);
  box-shadow: 0 0 6px var(--red-danger);
}

.hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo-mark {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 3px;
  color: #fff;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.match-clock {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.rival-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  letter-spacing: 0.8px;
  color: var(--cyan-primary);
  background: rgba(0, 240, 255, 0.08);
  padding: 2px 8px;
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 10px;
  margin-top: 3px;
}

.rival-dot {
  width: 5px;
  height: 5px;
  background: var(--cyan-primary);
  border-radius: 50%;
  animation: blink 1.2s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

#canvas-wrapper {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.combo-banner {
  position: absolute;
  top: 95px;
  left: 32px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  pointer-events: none;
  animation: popIn 0.2s ease-out;
}

.combo-banner.hidden {
  display: none;
}

#combo-number {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 900;
  color: var(--cyan-primary);
  text-shadow: 0 0 16px rgba(0, 240, 255, 0.8);
}

.combo-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #fff;
}

.dialogue-bubble {
  position: absolute;
  bottom: 125px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(12, 16, 24, 0.9);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-cyan);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
  border-radius: 6px;
  padding: 10px 18px;
  max-width: 520px;
  pointer-events: none;
  z-index: 15;
}

.dialogue-bubble.hidden {
  display: none;
}

.rival-hologram-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle, #7928ca 0%, #00f0ff 100%);
  box-shadow: 0 0 10px #00f0ff;
}

.dialogue-speaker {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  color: var(--cyan-primary);
  letter-spacing: 1px;
}

.dialogue-text {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

#combat-controls {
  position: absolute;
  bottom: 60px;
  left: 0;
  right: 0;
  height: 100px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  background: linear-gradient(0deg, rgba(8, 11, 16, 0.95) 0%, rgba(8, 11, 16, 0) 100%);
  z-index: 20;
  pointer-events: none;
}

#joystick-zone {
  width: 140px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

#joystick-base {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(18, 24, 34, 0.5);
  border: 1px solid var(--border-cyan);
  position: relative;
  touch-action: none;
}

#joystick-thumb {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--cyan-primary) 0%, rgba(0, 240, 255, 0.2) 100%);
  border: 1px solid #fff;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.action-dock {
  display: flex;
  align-items: center;
  gap: 16px;
  pointer-events: auto;
}

.abilities-group {
  display: flex;
  gap: 10px;
}

.ability-card {
  position: relative;
  width: 66px;
  height: 66px;
  background: var(--panel-glass);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.1s, border-color 0.15s;
}

.ability-card:active {
  transform: scale(0.94);
}

.ability-card.ready {
  border-color: var(--border-cyan);
}

.ability-key {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 9px;
  font-family: var(--font-display);
  color: var(--cyan-primary);
}

.ability-icon {
  font-size: 20px;
}

.ability-name {
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.ability-cost {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 8px;
  color: var(--purple-accent);
  font-weight: 800;
}

.cooldown-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  pointer-events: none;
  transform-origin: bottom;
  transform: scaleY(0);
}

.core-actions {
  display: flex;
  gap: 10px;
}

.action-btn {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(10px);
  transition: all 0.12s;
  overflow: hidden;
}

.action-btn:active {
  transform: scale(0.92);
}

.dodge-btn {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--purple-accent);
}

.dodge-btn .btn-title {
  color: var(--purple-accent);
}

.attack-btn {
  width: 78px;
  height: 78px;
  background: rgba(0, 240, 255, 0.18);
  border-color: var(--cyan-primary);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.25);
}

.attack-btn .btn-title {
  color: var(--cyan-primary);
  font-size: 13px;
}

.btn-sub {
  font-size: 9px;
  font-family: var(--font-display);
  color: var(--text-muted);
}

.btn-title {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: 1px;
}

/* ==========================================================================
   3. HEROES & SPIRIT LAB (Sections 29 & 30)
   ========================================================================== */
.spirit-lab-container {
  flex: 1;
  display: flex;
  padding: 24px 32px 80px 32px;
  gap: 28px;
}

.spirit-info-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}

.hero-toggle-bar {
  display: flex;
  gap: 12px;
}

.hero-tab-btn {
  flex: 1;
  background: rgba(18, 24, 34, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 10px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.hero-tab-btn.active {
  background: rgba(0, 240, 255, 0.12);
  border-color: var(--cyan-primary);
  color: #fff;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

.spirit-badge {
  font-size: 11px;
  font-family: var(--font-display);
  letter-spacing: 1.5px;
  color: var(--cyan-primary);
}

.lab-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  color: #fff;
}

.lab-philosophy {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
  font-style: italic;
}

.spirit-specs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(10, 14, 20, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 12px 14px;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

.spec-row strong {
  font-family: var(--font-display);
  color: #fff;
}

.lab-abilities-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lab-ability-item {
  background: rgba(18, 24, 34, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 10px 14px;
}

.lab-ability-item .ab-top {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  color: #fff;
}

.lab-ability-item .ab-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.spirit-canvas-panel {
  flex: 1.2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.panel-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header h4 {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 1.5px;
  color: #fff;
}

.panel-header .tag {
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--cyan-primary);
  background: rgba(0, 240, 255, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
}

.lab-canvas-box {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

#spirit-preview-canvas {
  width: 400px;
  height: 320px;
}

.anim-state-selector {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.anim-btn {
  background: rgba(18, 24, 34, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 6px 12px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.anim-btn:hover, .anim-btn.active {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--cyan-primary);
  color: #fff;
}

.anim-angle-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.angle-label {
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.angle-btn {
  background: rgba(14, 18, 26, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 4px 10px;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.angle-btn:hover, .angle-btn.active {
  background: rgba(139, 92, 246, 0.2);
  border-color: var(--purple-accent);
  color: #fff;
}

/* ==========================================================================
   4. VAULT (Section 32)
   ========================================================================== */
.vault-container {
  margin: 24px auto 80px auto;
  width: 90%;
  max-width: 980px;
  flex: 1;
  overflow-y: auto;
}

.vault-header {
  margin-bottom: 24px;
}

.vault-header h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 3px;
  color: #fff;
}

.vault-header .subtitle {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.vault-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.vault-card {
  background: rgba(18, 24, 34, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.15s, border-color 0.15s;
}

.vault-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-cyan);
}

.vault-card .v-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vault-card .v-rarity {
  font-size: 9px;
  letter-spacing: 1px;
  font-family: var(--font-display);
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 3px;
}

.v-rarity.Legendary { color: #f5a623; background: rgba(245, 166, 35, 0.15); }
.v-rarity.Epic { color: #c084fc; background: rgba(192, 132, 252, 0.15); }
.v-rarity.Rare { color: #38bdf8; background: rgba(56, 189, 248, 0.15); }
.v-rarity.Core { color: #9ca3af; background: rgba(156, 163, 175, 0.15); }

.vault-card .v-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  color: #fff;
}

.vault-card .v-status {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.v-status.unlocked { color: var(--green-health); }
.v-status.locked { color: var(--text-muted); }

/* ==========================================================================
   5. PROFILE (Section 33)
   ========================================================================== */
.profile-container {
  margin: 24px auto 80px auto;
  width: 90%;
  max-width: 940px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.profile-summary {
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 20px;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle, #00f0ff 0%, #121822 100%);
  border: 2px solid var(--cyan-primary);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.4);
}

.profile-meta {
  flex: 1;
}

#profile-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #fff;
}

.profile-rank {
  font-size: 12px;
  color: var(--amber-accent);
  letter-spacing: 1px;
  margin-top: 2px;
}

.career-stats-row {
  display: flex;
  gap: 16px;
}

.stat-pill {
  background: rgba(18, 24, 34, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 6px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-pill .lbl {
  font-size: 9px;
  color: var(--text-muted);
}

.stat-pill strong {
  font-family: var(--font-display);
  font-size: 16px;
  color: #fff;
}

.profile-dna-section {
  display: flex;
  gap: 32px;
  align-items: center;
}

.dna-radar-wrapper {
  width: 260px;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dna-profile-intel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dna-header-box .lbl, .dna-habit-box .lbl {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.dna-header-box .val {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--cyan-primary);
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
  margin-top: 4px;
}

.dna-habit-box p {
  font-size: 14px;
  font-weight: 600;
  color: #e5e7eb;
  margin-top: 2px;
}

/* ==========================================================================
   UNIVERSAL BOTTOM NAVIGATION (Section 23)
   ========================================================================== */
.global-bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(8, 11, 16, 0.96);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 40;
}

.nav-tab {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px 16px;
  transition: color 0.15s;
}

.nav-tab .nav-icon {
  font-size: 18px;
}

.nav-tab .nav-label {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
}

.nav-tab:hover, .nav-tab.active {
  color: var(--cyan-primary);
}

.nav-tab.active .nav-icon {
  text-shadow: 0 0 10px var(--cyan-primary);
}

/* ==========================================================================
   REPLAY THEATER (Section 28)
   ========================================================================== */
.replay-theater-box {
  width: 90%;
  max-width: 880px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.theater-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.th-title h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #fff;
}

.close-modal-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 14px;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
}

.close-modal-btn:hover {
  border-color: var(--cyan-primary);
  color: #fff;
}

.theater-stage {
  position: relative;
  background: #080a0e;
  border: 1px solid var(--border-cyan);
  border-radius: 4px;
  overflow: hidden;
}

#replay-canvas {
  width: 100%;
  height: 360px;
  display: block;
}

.tactical-callout-overlay {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(14, 18, 26, 0.9);
  border-left: 3px solid var(--amber-accent);
  padding: 6px 12px;
  border-radius: 0 4px 4px 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.callout-time {
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--amber-accent);
}

.callout-msg {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
}

.theater-timeline-bar {
  display: flex;
  align-items: center;
  gap: 16px;
}

.replay-ctrl-btn {
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid var(--cyan-primary);
  color: var(--cyan-primary);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
}

.timeline-track-wrapper {
  position: relative;
  flex: 1;
}

.timeline-slider {
  width: 100%;
  accent-color: var(--cyan-primary);
  cursor: pointer;
}

.ai-event-pins {
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 6px;
  pointer-events: none;
}

.event-pin {
  position: absolute;
  width: 3px;
  height: 10px;
  background: var(--amber-accent);
  box-shadow: 0 0 6px var(--amber-accent);
  transform: translateX(-50%);
}

.replay-timer-display {
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--text-muted);
}

.replay-secondary-btn {
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid var(--purple-accent);
  color: #fff;
  border-radius: 6px;
  padding: 14px 20px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: all 0.15s;
}

.replay-secondary-btn:hover {
  background: rgba(139, 92, 246, 0.3);
}

/* ==========================================================================
   SHARED OVERLAYS: INTRO & ANALYSIS
   ========================================================================== */
.glass-card {
  background: var(--panel-glass);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-cyan);
  box-shadow: 0 0 35px rgba(0, 240, 255, 0.18);
  border-radius: 8px;
  padding: 24px;
}

.overlay-modal {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(6, 8, 12, 0.94);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: opacity 0.3s;
}

.overlay-modal.hidden {
  display: none;
}

.intro-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 520px;
  padding: 30px;
}

.heartbeat-ring {
  width: 80px;
  height: 80px;
  border: 2px solid var(--cyan-primary);
  border-radius: 50%;
  margin-bottom: 24px;
  animation: pulseBeat 1.4s infinite;
}

@keyframes pulseBeat {
  0% { transform: scale(0.8); opacity: 0.3; box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.7); }
  50% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 20px 8px rgba(0, 240, 255, 0.4); }
  100% { transform: scale(0.8); opacity: 0.3; box-shadow: 0 0 0 0 rgba(0, 240, 255, 0); }
}

.intro-glitch {
  font-family: var(--font-display);
  font-size: 54px;
  font-weight: 900;
  letter-spacing: 12px;
  color: #fff;
  text-shadow: 0 0 20px var(--cyan-primary);
  margin-bottom: 8px;
}

.intro-quote {
  font-size: 18px;
  letter-spacing: 2px;
  color: var(--cyan-primary);
  margin-bottom: 28px;
  font-style: italic;
}

.character-select-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 30px;
  width: 100%;
}

.char-pick {
  flex: 1;
  background: var(--panel-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.char-pick.active {
  border-color: var(--cyan-primary);
  background: rgba(0, 240, 255, 0.12);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.2);
}

.pick-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #fff;
}

.pick-role {
  font-size: 10px;
  color: var(--cyan-primary);
  letter-spacing: 1px;
  margin-top: 4px;
}

.cta-pulse-button {
  background: linear-gradient(90deg, #00f0ff 0%, #00a2ff 100%);
  border: none;
  border-radius: 4px;
  padding: 16px 44px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 3px;
  color: #06090e;
  cursor: pointer;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.5);
  transition: transform 0.15s, box-shadow 0.15s;
}

.cta-pulse-button:hover {
  transform: scale(1.04);
  box-shadow: 0 0 35px rgba(0, 240, 255, 0.8);
}

.intro-controls-tip {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-top: 24px;
}

.analysis-panel {
  width: 90%;
  max-width: 940px;
  display: flex;
  flex-direction: column;
}

.analysis-header {
  text-align: center;
  margin-bottom: 24px;
  position: relative;
}

.match-outcome-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 3px;
  padding: 4px 14px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.match-outcome-tag.victory {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid var(--green-health);
  color: var(--green-health);
}

.match-outcome-tag.defeat {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid var(--red-danger);
  color: var(--red-danger);
}

.analysis-header h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 4px;
  color: #fff;
}

.analysis-header .subtitle {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-top: 4px;
}

.analysis-body {
  display: flex;
  gap: 36px;
}

.dna-visual-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.archetype-container {
  text-align: center;
  margin-bottom: 12px;
}

.archetype-container .label {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

.archetype-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--cyan-primary);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.radar-box {
  width: 260px;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dna-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  margin-top: 14px;
}

.metric-cell {
  background: rgba(18, 24, 34, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 6px 10px;
  text-align: center;
}

.metric-cell .m-name {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.metric-cell .m-val {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  margin-top: 2px;
}

.rival-intel-column {
  flex: 1.2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.rival-profile-card {
  background: rgba(18, 24, 34, 0.7);
  border: 1px solid var(--border-cyan);
  border-radius: 6px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rival-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.badge-tag {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--cyan-primary);
}

.prediction-tag {
  font-size: 11px;
  color: var(--text-muted);
}

.prediction-tag strong {
  color: var(--cyan-primary);
  font-family: var(--font-display);
}

.rival-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #fff;
}

.dialogue-quote-box {
  background: rgba(0, 240, 255, 0.08);
  border-left: 3px solid var(--cyan-primary);
  padding: 10px 14px;
  border-radius: 0 4px 4px 0;
  font-style: italic;
  font-size: 15px;
  color: #fff;
}

.intel-block .intel-label {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 2px;
}

.intel-val {
  font-size: 13px;
  font-weight: 600;
  color: #e5e7eb;
}

.warning-text { color: #f87171 !important; }
.cyan-text { color: #38bdf8 !important; }

.match-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.rematch-cta {
  flex: 1;
  background: linear-gradient(90deg, #00f0ff 0%, #0099ff 100%);
  border: none;
  border-radius: 6px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  cursor: pointer;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.45);
  transition: transform 0.15s, box-shadow 0.15s;
}

.rematch-cta:hover {
  transform: scale(1.02);
  box-shadow: 0 0 35px rgba(0, 240, 255, 0.7);
}

.rematch-icon {
  font-size: 24px;
  color: #080a0e;
  font-weight: 900;
}

.rematch-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.rematch-text .primary {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #080a0e;
}

.rematch-text .secondary {
  font-size: 9px;
  letter-spacing: 1px;
  font-weight: 700;
  color: rgba(8, 10, 14, 0.8);
}

@media (max-width: 820px) {
  .analysis-body, .spirit-lab-container, .profile-dna-section {
    flex-direction: column;
    gap: 16px;
  }
  .rival-floating-card {
    position: static;
    margin: 16px auto;
    width: 90%;
  }
}

/* ==========================================================================
   SOUND PROFILE SELECTION & AUDIO ARCHITECTURE (Section 45)
   ========================================================================== */
.sound-quick-btn {
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid var(--border-cyan);
  border-radius: 4px;
  padding: 4px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.sound-quick-btn:hover {
  background: rgba(0, 240, 255, 0.16);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}

.sound-icon {
  font-size: 13px;
}

.sound-label {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--cyan-primary);
}

.hud-center-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-sound-btn {
  background: rgba(18, 24, 34, 0.7);
  border: 1px solid var(--border-cyan);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--cyan-primary);
  pointer-events: auto;
  transition: transform 0.1s;
}

.hud-sound-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
}

.sound-matrix-card {
  width: 90%;
  max-width: 820px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px;
}

.sound-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.sound-modal-header h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 3px;
  color: #fff;
  margin-top: 4px;
}

.sound-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: -8px;
}

.sound-profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
}

.sound-card {
  background: rgba(14, 18, 26, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.sound-card:hover {
  border-color: rgba(0, 240, 255, 0.4);
  background: rgba(18, 24, 34, 0.85);
}

.sound-card.active {
  border-color: var(--cyan-primary);
  background: rgba(0, 240, 255, 0.08);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.18);
}

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

.sc-icon {
  font-size: 18px;
}

.sc-title {
  flex: 1;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #fff;
}

.sc-tag {
  font-size: 9px;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.sound-card.active .sc-tag {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--cyan-primary);
  color: var(--cyan-primary);
}

.sc-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
}

.preview-sound-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  align-self: flex-start;
  transition: all 0.15s;
}

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

.ambient-music-panel {
  background: rgba(14, 18, 26, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.amb-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.amb-sub {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: 0.2s;
  border-radius: 24px;
  border: 1px solid var(--border-subtle);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--cyan-primary);
  border-color: var(--cyan-primary);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

input:checked + .toggle-slider:before {
  transform: translateX(20px);
  background-color: #06090e;
}

.amb-buttons-row {
  display: flex;
  gap: 10px;
}

.music-preset-btn {
  flex: 1;
  background: rgba(18, 24, 34, 0.6);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.15s;
}

.music-preset-btn:hover, .music-preset-btn.active {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--cyan-primary);
  color: #fff;
}

.sound-sliders-row {
  display: flex;
  gap: 20px;
}

.slider-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.slider-label {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.volume-slider {
  width: 100%;
  accent-color: var(--cyan-primary);
  cursor: pointer;
}

/* ==========================================================================
   SPIRIT CRUSH // QUANTUM MATCH-3 MOBILE DESIGN SYSTEM (2046)
   ========================================================================== */
.quantum-mobile-hud {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 16px 8px;
  background: rgba(6, 8, 12, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  z-index: 20;
}

.hud-telemetry-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.hud-companion-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--cyan-primary);
  background: rgba(0, 240, 255, 0.06);
  border: 1px solid rgba(0, 240, 255, 0.2);
  padding: 3px 10px;
  border-radius: 12px;
}

.pulse-indicator {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan-primary);
  box-shadow: 0 0 8px var(--cyan-primary);
  animation: pulseBeat 1.4s infinite;
}

.chip-sep {
  color: rgba(255, 255, 255, 0.2);
}

.chip-status {
  color: var(--text-muted);
  font-size: 8px;
}

.hud-mode-pill-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 2px;
  gap: 2px;
}

.mode-toggle-btn {
  background: transparent;
  border: none;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-toggle-btn.active {
  background: var(--cyan-primary);
  color: #040608;
  font-weight: 800;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.hud-quick-actions {
  display: flex;
  gap: 6px;
}

.micro-hud-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.micro-hud-btn:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--cyan-primary);
}

/* Central Quantum Metrics Display */
.hud-quantum-display {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 2px;
}

.metric-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(14, 18, 26, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 8px 12px;
  backdrop-filter: blur(10px);
}

.score-card {
  align-items: flex-start;
}

.target-card {
  align-items: flex-end;
  text-align: right;
}

.metric-tag {
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.metric-num {
  text-shadow: var(--glitch-shadow);
  color: #fff;

  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.35);
  line-height: 1.1;
}

.metric-num-target {
  text-shadow: var(--glitch-shadow);
  color: #fff;

  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: var(--amber-accent);
  line-height: 1.1;
}

.metric-dial-wrapper {
  position: relative;
  width: 66px;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dial-ring-box {
  position: relative;
  width: 62px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dial-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.dial-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 3.5;
}

.dial-fill {
  fill: none;
  stroke: var(--cyan-primary);
  stroke-width: 3.5;
  stroke-dasharray: 170;
  stroke-dashoffset: 0;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px var(--cyan-primary));
  transition: stroke-dashoffset 0.4s ease;
}

.dial-center-content {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dial-val {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
  line-height: 1;
}

.dial-lbl {
  font-family: var(--font-display);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--cyan-primary);
  margin-top: 2px;
}

.echelon-stars {
  display: flex;
  gap: 4px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.15);
  margin-top: 2px;
}

.ech-star.achieved {
  color: #f59e0b;
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.8);
}

.rival-tag-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.rival-val {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
  color: var(--red-danger);
}

.rival-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 3px;
}

.rival-fill {
  height: 100%;
  background: var(--red-danger);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.7);
  transition: width 0.3s ease;
}

.turn-status-banner {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2px;
  text-align: center;
  color: var(--cyan-primary);
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 4px;
  padding: 3px 0;
  margin-top: 2px;
}

.turn-status-banner.rival-turn {
  color: var(--red-danger);
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
}

/* Canvas Area */
.match3-canvas-wrapper {
  position: relative;
  flex: 1;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 12px;
  margin-top: 78px; /* Offset for absolute HUD */
  overflow: hidden;
  touch-action: none;
}

#game-canvas {
  display: block;
  touch-action: none;
  cursor: grab;
  border-radius: 18px;
  background: radial-gradient(circle at center, rgba(14, 20, 30, 0.95) 0%, rgba(6, 8, 12, 0.98) 100%);
  box-shadow: 0 0 45px rgba(0, 0, 0, 0.95), 0 0 20px rgba(0, 240, 255, 0.08), inset 0 0 25px rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Bottom Tactical Controls */
.quantum-tactical-dock {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(6, 8, 12, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  z-index: 20;
  mix-blend-mode: screen;
  background: rgba(0, 10, 20, 0.4);
  backdrop-filter: blur(24px) contrast(1.2);
}

.quantum-burst-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: rgba(14, 18, 26, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 8px 12px;
}

.burst-telemetry {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--cyan-primary);
}

.burst-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.burst-fill {
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6, #00f0ff);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
  transition: width 0.25s ease;
}

.quantum-burst-btn {
  background: transparent;
  border: none;
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-muted);
  cursor: not-allowed;
  transition: all 0.2s;
  text-align: left;
  padding: 0;
}

.quantum-burst-btn.ready {
  color: var(--cyan-primary);
  cursor: pointer;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.8);
  animation: pulseBeat 1.2s infinite;
}

.tactical-actions-row {
  display: flex;
  gap: 6px;
}

.tactical-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: rgba(14, 18, 26, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
}

.tactical-action-btn:hover {
  border-color: var(--cyan-primary);
  background: rgba(0, 240, 255, 0.1);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

.tab-icon {
  font-size: 14px;
  color: var(--cyan-primary);
}

.tab-label {
  font-family: var(--font-display);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-top: 2px;
}

.booster-btn:hover {
  border-color: var(--cyan-primary);
  background: rgba(0, 240, 255, 0.1);
  transform: translateY(-2px);
}

.booster-icon {
  font-size: 18px;
}

.booster-title {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
}

/* Praise Popups (Candy Crush Style: SWEET, TASTY, DIVINE, SPIRIT CRUSH) */
.praise-banner {
  position: absolute;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  pointer-events: none;
  z-index: 50;
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.praise-banner.show {
  transform: translate(-50%, -50%) scale(1.15);
  opacity: 1;
}

.praise-text {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 900;
  letter-spacing: 4px;
  background: linear-gradient(135deg, #ffe600, #ff0055, #00f0ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 24px rgba(255, 0, 85, 0.7));
  text-transform: uppercase;
}

/* End of Match Modal */
.match3-end-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(6, 8, 12, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.match3-end-modal.hidden {
  display: none !important;
}

.end-modal-card {
  width: 360px;
  padding: 30px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-radius: 12px;
  border: 1px solid var(--border-cyan);
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.25);
}

.modal-badge {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--cyan-primary);
  margin-bottom: 6px;
}

#modal-result-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 2px;
}

.end-stars-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 38px;
  color: #334155;
}

.modal-star.active {
  color: #f5a623;
  text-shadow: 0 0 16px rgba(245, 166, 35, 0.8);
  animation: starPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes starPop {
  0% { transform: scale(0.3) rotate(-20deg); }
  100% { transform: scale(1.1) rotate(0); }
}

.modal-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: rgba(0, 0, 0, 0.3);
  padding: 12px;
  border-radius: 8px;
}

.modal-stat-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-stat-box .lbl {
  font-size: 9px;
  font-family: var(--font-display);
  color: var(--text-muted);
}

.modal-stat-box .val {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  color: var(--cyan-primary);
}

.modal-actions-row {
  display: flex;
  gap: 12px;
}

.modal-btn {
  flex: 1;
  padding: 12px;
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-btn.primary-btn {
  background: var(--cyan-primary);
  border: none;
  color: #080a0e;
}

.modal-btn.primary-btn:hover {
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.5);
}

.modal-btn.secondary-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.modal-btn.secondary-btn:hover {
  border-color: var(--cyan-primary);
}





/* --- LANDING PAGE CSS --- */

    
    
    
    #view-landing {
      width: 100%;
      height: 100%;
      max-height: 900px;
      background: var(--bg-dark);
      display: flex;
      flex-direction: column;
      padding: 30px 24px;
      overflow: hidden;
      color: #fff;
    }
    
    @media (max-width: 480px) {
      #landing-container { max-width: 100vw; height: 100vh; max-height: 100vh; }
    }

    .landing-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-family: 'Orbitron', sans-serif;
      font-weight: 800;
      letter-spacing: 4px;
      z-index: 10;
    }
    .landing-logo { font-size: 16px; color: #00f0ff; text-shadow: 0 0 10px rgba(0,240,255,0.5); }
    .landing-biomes { font-family: 'Orbitron', sans-serif; font-size: 9px; letter-spacing: 2px; color: rgba(255,255,255,0.5); display: flex; align-items: center; }
    
    .landing-orb-container {
      perspective: 800px;
      transform-style: preserve-3d;
      position: relative;
      flex: 1;
      display: flex;
      justify-content: center;
      align-items: center;
      min-height: 280px;
    }
    
    /* MYRIX Holographic Tesseract (Void Cube) */
          100% { transform: rotateX(-360deg) rotateY(-360deg) rotateZ(-180deg); }
    }

    
    .landing-content { text-align: center; z-index: 10; margin-top: -20px; }
    .landing-subtitle {
      font-family: var(--font-display);
      font-size: 10px;
      font-weight: 600;
      letter-spacing: 8px;
      color: var(--text-muted);
      margin-bottom: 24px;
      text-transform: uppercase;
    }
    
    .landing-headline {
      font-family: 'Orbitron', sans-serif;
      font-size: 52px;
      font-weight: 900;
      line-height: 0.95;
      letter-spacing: 1px;
      margin-bottom: 24px;
      color: #fff;
      text-transform: uppercase;
    }
    .landing-headline .modern-accent {
      color: var(--cyan-primary);
      text-shadow: 0 0 20px var(--border-cyan);
    }
    
    .landing-subtext {
      font-family: 'Rajdhani', sans-serif;
      color: rgba(255,255,255,0.7);
      font-size: 16px;
      font-weight: 500;
      margin-bottom: 40px;
      line-height: 1.6;
      letter-spacing: 1px;
    }
    
    .landing-play-btn {
      background: transparent;
      color: #00f0ff;
      width: auto;
      margin: 0 auto;
      padding: 12px 32px;
      border: 1.5px solid rgba(0, 240, 255, 0.6);
      border-radius: 40px;
      font-family: 'Orbitron', sans-serif;
      font-weight: 700;
      font-size: 12px;
      letter-spacing: 2px;
      display: inline-flex;
      justify-content: center;
      align-items: center;
      gap: 10px;
      cursor: pointer;
      text-decoration: none;
      transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
      box-shadow: 0 0 10px rgba(0,240,255,0.1), inset 0 0 5px rgba(0,240,255,0.05);
    }
    .landing-play-btn:hover, .landing-play-btn:active { 
      background: rgba(0, 240, 255, 0.1);
      color: #ffffff;
      border-color: #00f0ff;
      box-shadow: 0 0 20px rgba(0,240,255,0.4), inset 0 0 10px rgba(0,240,255,0.2);
      transform: scale(0.96);
    }
    
    .landing-footer { margin-top: 35px; font-family: 'Orbitron', sans-serif; font-size: 11px; letter-spacing: 1px; }
    .best-label { color: rgba(255,255,255,0.4); margin-right: 8px; }
    .best-score { color: #fff; font-weight: bold; }

    /* MYRIX Cyber Grid Background */
      

        
    
          50% { transform: translateY(-12px) scale(1.02); filter: drop-shadow(0 0 35px rgba(168, 85, 247, 0.7)); }
    }
    
          25% { transform: rotate(5deg) scale(1.05); }
      50% { transform: rotate(0deg) scale(1); }
      75% { transform: rotate(-5deg) scale(0.95); }
      100% { transform: rotate(0deg) scale(1); }
    }


        
        
        
    .landing-character-frame:hover 
          50% { transform: translateY(-12px); }
    }


    .landing-gem-wrapper {
      z-index: 5;
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 10px;
      animation: floatGem 4s ease-in-out infinite;
    }
    @keyframes floatGem {
      0%, 100% { transform: translateY(0); }
      50% { transform: translateY(-10px); }
    }


.micro-hud-btn {
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.micro-hud-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}
.micro-hud-btn:active {
  transform: scale(0.9);
  background: rgba(0, 240, 255, 0.3);
}
