/* ============================================================
   THE OTHER ONE — Design System
   Aesthetic: warm ivory/amber parchment QR artifact on deep void
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600&family=Cormorant+Garamond:ital,wght@0,400;1,400&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --bg-void:        #08080c;
  --bg-glass:       rgba(10, 10, 16, 0.76);
  --bg-glass-card:  rgba(18, 16, 22, 0.92);
  --border-glass:   rgba(196, 133, 74, 0.22);
  --border-hover:   rgba(240, 195, 110, 0.55);

  --gold-primary:   #d4af5f;
  --gold-glow:      #ffc857;
  --gold-dim:       #94784a;
  --amber:          #c4854a;

  --text-main:      #f5eedb;
  --text-muted:     #a39b8b;
  --text-ghost:     #5c564c;

  --font-serif:     'Cinzel', 'Cormorant Garamond', Georgia, serif;
  --font-body:      'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-quote:     'Cormorant Garamond', Georgia, serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; user-select: none; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg-void);
  font-family: var(--font-body);
  color: var(--text-main);
}

/* ── Canvas ── */
#gameCanvas {
  position: absolute;
  inset: 0;
  width: 100vw; height: 100vh;
  display: block;
  z-index: 1;
}

/* ── HUD Layer ── */
.hud-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 24px 0;
}

.interactive { pointer-events: auto; }

/* ── Top Header ── */
.hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 12px;
}

/* Brand */
.brand { display: flex; flex-direction: column; }

.brand-title {
  font-family: var(--font-serif);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-primary);
  text-shadow: 0 0 16px rgba(212,175,95,0.45);
  white-space: nowrap;
}

.brand-subtitle {
  font-family: var(--font-quote);
  font-style: italic;
  font-size: 15px;
  color: var(--gold-light);
  letter-spacing: 0.04em;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 380px;
}

/* Proto Tabs */
.proto-tabs {
  display: flex;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 24px;
  padding: 3px;
  gap: 3px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 7px 16px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all 0.25s cubic-bezier(0.16,1,0.3,1);
}
.tab-btn:hover { color: var(--text-main); background: rgba(255,255,255,0.05); }
.tab-btn.active {
  background: linear-gradient(135deg, rgba(196,133,74,0.3), rgba(170,110,55,0.32));
  border: 1px solid rgba(240,195,110,0.5);
  color: #fff6e5;
  box-shadow: 0 0 14px rgba(196,133,74,0.35);
}
.tab-indicator {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text-ghost);
  transition: all 0.22s ease;
}
.tab-btn.active .tab-indicator {
  background: var(--gold-glow);
  box-shadow: 0 0 7px #ffc857;
}

/* Controls group */
.hud-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Icon-only buttons */
.icon-btn {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-muted);
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16,1,0.3,1);
  flex-shrink: 0;
}
.icon-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-main);
  box-shadow: 0 0 14px rgba(196,133,74,0.3);
  transform: translateY(-1px);
}
.icon-btn.glyph-view-btn.active {
  background: rgba(196,133,74,0.25);
  border-color: var(--gold-primary);
  color: #fff;
  box-shadow: 0 0 16px rgba(196,133,74,0.5);
}

/* Pulse Action Buttons & Radial Charge Meters */
.pulse-action-btn {
  position: relative;
  overflow: visible;
}
.pulse-radial-meter {
  position: absolute;
  inset: -1px;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  transform: rotate(-90deg);
  pointer-events: none;
}
.pulse-radial-meter .radial-track {
  fill: none;
  stroke: rgba(255, 200, 87, 0.12);
  stroke-width: 2.2;
}
.pulse-radial-meter .radial-progress {
  fill: none;
  stroke: var(--gold-glow);
  stroke-width: 2.2;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.08s linear, stroke 0.25s ease;
}
.pulse-action-btn.ready {
  color: #fff6e5;
  border-color: rgba(255, 200, 87, 0.7);
  box-shadow: 0 0 16px rgba(255, 200, 87, 0.45);
}
.pulse-action-btn.ready .radial-progress {
  stroke: #ffda77;
  filter: drop-shadow(0 0 4px #ffc857);
}
.pulse-action-btn.charging {
  color: var(--text-ghost);
  border-color: rgba(196, 133, 74, 0.2);
  opacity: 0.85;
}

/* ── Main View Floating Controls (Top Right) ── */
.main-floating-controls {
  position: absolute;
  top: 76px;
  right: 28px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.floating-zoom-btn {
  background: rgba(16, 14, 20, 0.72);
  border: 1px solid rgba(212, 175, 95, 0.32);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--gold-primary);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6), 0 0 10px rgba(196, 133, 74, 0.15);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.floating-zoom-btn:hover {
  border-color: var(--gold-glow);
  color: #fff6e5;
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.75), 0 0 18px rgba(255, 200, 87, 0.45);
}
.floating-zoom-btn:active {
  transform: translateY(0) scale(0.96);
}
.floating-zoom-btn.active {
  background: linear-gradient(135deg, rgba(196, 133, 74, 0.38), rgba(138, 88, 38, 0.45));
  border-color: var(--gold-glow);
  color: #fff;
  box-shadow: 0 0 20px rgba(255, 200, 87, 0.5);
}

/* Poem select */
.glass-select {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-main);
  padding: 7px 12px;
  border-radius: 18px;
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.03em;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
  max-width: 160px;
}
.glass-select option { background: #111118; color: var(--text-main); }
.glass-select:hover { border-color: var(--border-hover); }

/* ── Modals ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4,4,6,0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s cubic-bezier(0.16,1,0.3,1), visibility 0.4s;
}
.modal-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.modal-card {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 32px 38px;
  max-width: 560px;
  width: 92%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.85), 0 0 28px rgba(196,133,74,0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Victory glyph modal */
.glyph-modal-header { margin-bottom: 10px; }
.glyph-modal-title {
  font-family: var(--font-serif);
  font-size: 24px;
  letter-spacing: 0.12em;
  color: #fff;
}
.accent-glyph {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 300;
  color: var(--amber);
  text-shadow: 0 0 18px rgba(196,133,74,0.5);
}
.glyph-modal-subtitle {
  font-size: 13px;
  font-weight: 300;
  line-height: 1.5;
  color: rgba(255,255,255,0.55);
  margin-top: 6px;
}

/* Volumetric aura (victory glyph) */
.glyph-visualizer-container {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px 0 8px;
  overflow: visible;
}
.glyph-volumetric-aura {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.aura-primary {
  width: 340px; height: 340px;
  background: radial-gradient(circle, rgba(196,133,74,0.28) 0%, rgba(196,133,74,0.08) 55%, transparent 75%);
  filter: blur(40px);
  animation: auraPulse 6s ease-in-out infinite alternate;
  z-index: 1;
}
.aura-secondary {
  width: 270px; height: 270px;
  background: radial-gradient(circle, rgba(251,191,36,0.2) 0%, transparent 70%);
  filter: blur(32px);
  transform: translate(-28px,-22px);
  z-index: 1;
}
.aura-tertiary {
  width: 230px; height: 230px;
  background: radial-gradient(circle, rgba(196,133,74,0.18) 0%, transparent 70%);
  filter: blur(26px);
  transform: translate(28px,22px);
  z-index: 1;
}
@keyframes auraPulse {
  0%   { transform: scale(0.94); opacity: 0.82; }
  100% { transform: scale(1.08); opacity: 1.0; }
}
.glyph-frame {
  position: relative;
  z-index: 2;
  background: #090a0f;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(196,133,74,0.4);
  box-shadow: 0 16px 48px rgba(0,0,0,0.85), 0 0 28px rgba(196,133,74,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}
#glyphCanvas {
  display: block;
  width: 300px; height: 300px;
  max-width: 100%;
  border-radius: 10px;
  image-rendering: auto;
}

.glyph-quote {
  font-family: var(--font-quote);
  font-style: italic;
  font-size: 14px;
  color: var(--gold-glow);
  margin: 10px 0 16px;
  max-width: 420px;
}

.glyph-scan-hint {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  margin-top: 14px;
  margin-bottom: max(10px, env(safe-area-inset-bottom, 10px));
  letter-spacing: 0.03em;
  padding-bottom: 4px;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 10px;
  width: 100%;
  margin-bottom: 20px;
  background: rgba(0,0,0,0.28);
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.05);
}
.stat-item { display: flex; flex-direction: column; gap: 3px; }
.stat-val { font-size: 17px; font-weight: 600; color: var(--text-main); }
.stat-label { font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }

/* Modal actions */
.modal-actions { display: flex; gap: 12px; width: 100%; justify-content: center; flex-wrap: wrap; }

.btn-primary {
  background: linear-gradient(135deg, #a47634, #dfa64f);
  color: #1a1205;
  font-weight: 600;
  border: none;
  padding: 11px 22px;
  border-radius: 22px;
  cursor: pointer;
  font-size: 12px;
  letter-spacing: 0.08em;
  transition: all 0.22s;
}
.btn-primary:hover { box-shadow: 0 0 18px rgba(223,166,79,0.65); transform: translateY(-2px); }

.btn-secondary {
  background: rgba(255,255,255,0.07);
  color: var(--text-main);
  border: 1px solid rgba(255,255,255,0.14);
  padding: 11px 18px;
  border-radius: 22px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.22s;
  display: flex;
  align-items: center;
}
.btn-secondary:hover { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.28); }

/* Custom poem form */
.form-group { width: 100%; text-align: left; margin-bottom: 12px; }
.form-label { display: block; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 5px; }
.form-input, .form-textarea {
  width: 100%;
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
.form-textarea { height: 160px; resize: vertical; font-family: var(--font-quote); font-size: 14px; line-height: 1.5; }
.form-input:focus, .form-textarea:focus { border-color: var(--gold-glow); }

/* ── Toast ── */
.game-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: rgba(14,10,6,0.95);
  border: 1px solid rgba(196,133,74,0.6);
  box-shadow: 0 8px 28px rgba(0,0,0,0.85), 0 0 20px rgba(196,133,74,0.28);
  backdrop-filter: blur(12px);
  border-radius: 28px;
  padding: 9px 22px;
  color: #ffe2b0;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  z-index: 9999;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.game-toast.hidden { opacity: 0; transform: translateX(-50%) translateY(-10px); }

/* ============================================================
   Mobile Touch Controls
   ============================================================ */
.mobile-controls-layer {
  position: absolute;
  bottom: 28px;
  left: 0;
  width: 100%;
  display: none;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 20px;
  pointer-events: none;
  z-index: 25;
}

.joystick-zone {
  width: 120px; height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
}
.joystick-base {
  width: 108px; height: 108px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(20,18,26,0.78) 0%, rgba(8,8,12,0.92) 100%);
  border: 1.5px solid rgba(196,133,74,0.38);
  box-shadow: 0 4px 20px rgba(0,0,0,0.65), inset 0 0 14px rgba(196,133,74,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.joystick-knob {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff2d1 0%, #ffc857 40%, #be7b43 100%);
  box-shadow: 0 0 13px rgba(255,200,87,0.6), inset 0 2px 4px rgba(255,255,255,0.6);
  border: 1px solid rgba(255,250,220,0.7);
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  pointer-events: none;
}

.mobile-action-group {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}
.mobile-btn {
  background: rgba(18,14,24,0.84);
  border: 1.5px solid rgba(196,133,74,0.4);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-main);
  box-shadow: 0 4px 16px rgba(0,0,0,0.55);
  touch-action: manipulation;
  user-select: none;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
.mobile-btn:active { transform: scale(0.88); border-color: #ffc857; box-shadow: 0 0 18px rgba(255,200,87,0.6); }
.mobile-pulse-btn  {
  width: 68px; height: 68px;
  position: relative;
  background: rgba(18, 14, 24, 0.88);
  border: 1.5px solid rgba(196, 133, 74, 0.4);
  color: #fffaea;
  border-radius: 50%;
  box-shadow: none; /* No cutoff box shadow */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
.mobile-pulse-btn:active {
  background: rgba(196, 133, 74, 0.35);
  transform: scale(0.92);
}
.mobile-pulse-btn.ready {
  border-color: rgba(255, 200, 87, 0.9);
  color: #fff8e7;
}
.mobile-pulse-btn.ready .pulse-icon {
  filter: drop-shadow(0 0 5px rgba(255, 200, 87, 0.8));
}
.mobile-pulse-btn.charging {
  color: var(--text-ghost);
  border-color: rgba(196, 133, 74, 0.25);
  opacity: 0.85;
}
.mobile-pulse-radial {
  position: absolute;
  inset: -2px;
  width: calc(100% + 4px);
  height: calc(100% + 4px);
  transform: rotate(-90deg);
  pointer-events: none;
  overflow: visible;
}
.mobile-pulse-radial .radial-track {
  fill: none;
  stroke: rgba(255, 200, 87, 0.14);
  stroke-width: 3.2;
}
.mobile-pulse-radial .radial-progress {
  fill: none;
  stroke: var(--gold-glow);
  stroke-width: 3.4;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.08s linear;
}
.mobile-pulse-btn.ready .radial-progress {
  stroke: #ffda77;
}
.mobile-sneak-btn  { width: 50px; height: 50px; color: var(--text-muted); }
.mobile-sneak-btn.active { border-color: #ffc857; color: #ffc857; background: rgba(196,133,74,0.2); box-shadow: 0 0 12px rgba(255,200,87,0.4); }
.mobile-glyph-btn  { width: 50px; height: 50px; color: var(--text-muted); }
.mobile-glyph-btn.active { border-color: var(--gold-primary); color: var(--gold-glow); }

/* Pulse ring */
.pulse-ring-indicator {
  position: absolute;
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 1.5px solid rgba(255,200,87,0.55);
  animation: pulseRing 2.2s ease-in-out infinite;
  pointer-events: none;
  display: none;
}
.mobile-pulse-btn.ready .pulse-ring-indicator {
  display: block;
}
@keyframes pulseRing {
  0%   { transform: scale(1);    opacity: 0.7; }
  60%  { transform: scale(1.28); opacity: 0; }
  100% { transform: scale(1);    opacity: 0; }
}

/* Desktop Bottom HUD (Controls Overlay & Gentle Sonar Energy Indicator) */
.desktop-bottom-hud {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  z-index: 20;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.sonar-indicator-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 15, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid rgba(212, 175, 95, 0.18);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 0 10px rgba(212, 175, 95, 0.08);
  width: 170px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.15s ease, opacity 0.3s ease;
}

.sonar-indicator-container:hover {
  border-color: rgba(212, 175, 95, 0.40);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 14px rgba(212, 175, 95, 0.16);
}

.sonar-indicator-container:active {
  transform: scale(0.98);
}

.sonar-energy-track {
  position: relative;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
}

.sonar-energy-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #b88030, #eec779, #fff0d4);
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(238, 199, 121, 0.55);
  transition: width 0.08s linear;
}

.sonar-indicator-container.ready .sonar-energy-bar {
  animation: sonarPulseGlow 2.4s ease-in-out infinite alternate;
}

@keyframes sonarPulseGlow {
  0% { box-shadow: 0 0 6px rgba(238, 199, 121, 0.35); }
  100% { box-shadow: 0 0 14px rgba(255, 240, 212, 0.85); }
}

.desktop-controls-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(8, 8, 12, 0.38);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 4px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  font-family: var(--font-sans);
  font-size: 10px;
  color: rgba(180, 175, 165, 0.55);
  letter-spacing: 0.02em;
  transition: opacity 0.3s ease;
}

.control-badge {
  display: flex;
  align-items: center;
  gap: 3px;
}

.control-badge kbd {
  display: inline-block;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(212, 175, 95, 0.16);
  border-radius: 3px;
  padding: 1px 4px;
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 500;
  color: rgba(245, 235, 215, 0.65);
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.badge-label {
  font-size: 9px;
  color: rgba(180, 175, 165, 0.45);
  margin: 0 1px;
}

.badge-sub {
  font-size: 10px;
  color: rgba(230, 215, 185, 0.55);
  font-weight: 400;
  margin-left: 2px;
}

.control-dot {
  font-size: 7px;
  color: rgba(212, 175, 95, 0.25);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  .hud-layer { padding: 10px 12px 0; }
  .hud-header { flex-wrap: wrap; gap: 6px; }
  .brand { order: 1; }
  .brand-title { font-size: 19px; letter-spacing: 0.20em; }
  .brand-subtitle { font-size: 13px; max-width: 250px; }
  .proto-tabs { order: 3; width: 100%; justify-content: center; margin-top: 2px; }
  .tab-btn { padding: 6px 14px; font-size: 10px; }
  .hud-controls { order: 2; gap: 6px; }
  .glass-select { max-width: 100px; font-size: 10px; padding: 6px 8px; }
  .icon-btn { width: 32px; height: 32px; }
  #viewGlyphBtn { display: none !important; }
  .desktop-bottom-hud { display: none !important; }
  .mobile-controls-layer { display: flex !important; }
  .modal-card { padding: 18px 16px; width: 94%; max-height: 90vh; overflow-y: auto; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (hover: none) and (pointer: coarse) {
  #viewGlyphBtn { display: none !important; }
  .desktop-bottom-hud { display: none !important; }
  .mobile-controls-layer { display: flex !important; }
}

/* ============================================================
   Victory Conclusion Screen — Pure Art Gallery Mode
   Fades out virtual joystick, buttons, tabs, and brand so the
   grand conclusion screen and poem interaction has the full canvas.
   ============================================================ */
body.in-victory .mobile-controls-layer {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.5s ease;
}

body.in-victory .proto-tabs,
body.in-victory #poemSelect,
body.in-victory #customPoemBtn,
body.in-victory #viewGlyphBtn,
body.in-victory #desktopPulseBtn,
body.in-victory .desktop-bottom-hud {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.5s ease;
}

body.in-victory .brand {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.5s ease;
}
