/* ——— PragCore DOM-Platformer Game Mode (Retro Arcade Engine) ——— */

/* Header Trigger Button */
.header-game-btn,
.header-tools > #header-game-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 30px !important;
  width: 32px;
  height: 30px;
  padding: 0 !important;
  border-radius: 9999px !important;
  background: rgba(8, 14, 28, 0.68) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
  color: #cbd5e1 !important;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  flex-shrink: 0;
}

.header-game-btn:hover {
  color: #00f2fe !important;
  border-color: rgba(0, 242, 254, 0.5) !important;
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
  transform: translateY(-1px);
}

.header-game-btn:active {
  transform: translateY(0) scale(0.95);
}

.header-game-btn.is-active {
  background: rgba(0, 242, 254, 0.16) !important;
  border-color: #00f2fe !important;
  color: #00f2fe !important;
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.5), inset 0 0 10px rgba(0, 242, 254, 0.3) !important;
}

.header-game-btn svg {
  display: block;
  pointer-events: none;
}

.header-3d-game-btn,
.header-tools > #header-3d-game-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 30px !important;
  height: 30px;
  width: auto !important;
  padding: 0 10px !important;
  border-radius: 9999px !important;
  background: rgba(8, 18, 34, 0.78) !important;
  border: 1px solid rgba(0, 242, 254, 0.34) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.14) !important;
  color: #e2e8f0 !important;
  font-size: 0.70rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  flex-shrink: 0;
}

.header-3d-game-btn .header-3d-badge {
  color: #00f2fe;
  font-weight: 800;
}

.header-3d-game-btn:hover {
  color: #ffffff !important;
  border-color: rgba(0, 242, 254, 0.65) !important;
  background: rgba(0, 242, 254, 0.14) !important;
  transform: translateY(-1px);
}

/* Fullscreen High-Performance Game Canvas */
#prag-platformer-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99990;
  pointer-events: none;
  opacity: 0;
  image-rendering: auto;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#prag-platformer-canvas.is-visible {
  opacity: 1;
}

/* Super Smash Bros Dynamic Camera Stage Transform */
.dom-runner-stage-active {
  transition: none !important;
}

body.prag-platformer-active #webgl,
body.prag-platformer-active .webgl,
body.platformer-active #webgl,
body.platformer-active .webgl {
  opacity: 0.12 !important;
  filter: blur(10px) saturate(0.25) !important;
  transition: opacity 0.4s ease, filter 0.4s ease !important;
}

body.prag-platformer-active .site-footer {
  opacity: 0.28 !important;
  transition: opacity 0.3s ease !important;
}

body.prag-platformer-active {
  overflow-x: clip !important;
  max-width: 100% !important;
}

html:has(body.prag-platformer-active) {
  overflow-x: clip !important;
  max-width: 100% !important;
}

@media (max-width: 820px), (pointer: coarse) {
  html:has(body.prag-platformer-active),
  body.prag-platformer-active {
    overflow: clip !important;
    width: 100% !important;
  }
}

/* Super Smash Bros Battle Placard HUD & Cockpit System */
#prag-platformer-hud {
  position: fixed;
  inset: 0;
  z-index: 99995;
  pointer-events: none;
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 0.65rem;
  color: #f1f5f9;
  letter-spacing: 0.04em;
  opacity: 0;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  box-sizing: border-box;
}

#prag-platformer-hud.is-visible {
  opacity: 1;
}

/* Smart Proximity Ghosting: fades battle placards if player fights near HUD dock */
#prag-platformer-hud.is-ghosted .platformer-hud-dock,
#prag-platformer-hud.is-ghosted .platformer-hud-primary,
.platformer-hud-p2.is-ghosted,
.platformer-hud-p2-join.is-ghosted {
  opacity: 0.22 !important;
}

#prag-platformer-hud.is-ghosted .platformer-hud-dock:hover,
#prag-platformer-hud.is-ghosted .platformer-hud-primary:hover,
.platformer-hud-p2.is-ghosted:hover,
.platformer-hud-p2-join.is-ghosted:hover {
  opacity: 1 !important;
}

/* Consolidated Cinema HUD Stage — Asymmetric Fighter Cards & Subordinate Control Pill */
.platformer-hud-dock {
  position: fixed;
  top: 58px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99995;
  display: inline-flex;
  align-items: center;
  height: auto;
  width: max-content;
  max-width: calc(100vw - 24px);
  gap: 10px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  clip-path: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  pointer-events: auto;
  user-select: none;
  box-sizing: border-box;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.platformer-hud-dock .platformer-hud-zoom-ctrl,
.platformer-hud-dock .platformer-hud-bgm-btn,
.platformer-hud-dock .platformer-hud-music,
#hud-music-btn,
#hud-bgm-quick-btn,
body:has(#prag-platformer-touch-controls.is-3d-mode) .prag-talking-portrait-hud {
  display: none !important;
}

.platformer-hud-dock .platformer-hud-quick-btn span,
.platformer-hud-dock .platformer-hud-pause-btn span,
.platformer-hud-dock .platformer-hud-tuck-btn span {
  display: none !important;
}

.platformer-hud-dock .platformer-hud-quick-btn,
.platformer-hud-dock .platformer-hud-pause-btn,
.platformer-hud-dock .platformer-hud-tuck-btn {
  padding: 4px 6px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
}

.platformer-hud-dock .platformer-hud-cluster-combat {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px 6px 14px;
  background: linear-gradient(155deg, rgba(12, 17, 30, 0.94) 0%, rgba(5, 7, 15, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom: 2.5px solid #38bdf8;
  border-right: none;
  border-radius: 4px;
  transform: skewX(-10deg);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

.platformer-hud-dock .platformer-hud-cluster-combat > * {
  transform: skewX(10deg);
}

.platformer-hud-dock .platformer-hud-character {
  background: none;
  border: none;
  padding: 0 2px;
  font-family: var(--font-display, -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #f8fafc;
  cursor: pointer;
}

.platformer-hud-dock .platformer-hud-dock-sep {
  display: none !important;
}

.platformer-hud-dock .platformer-hud-cluster-system,
.platformer-hud-dock .platformer-hud-secondary-compat {
  position: static !important;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: rgba(7, 10, 18, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0.84;
  transition: opacity 0.18s ease, border-color 0.18s ease;
}

.platformer-hud-dock .platformer-hud-cluster-system:hover,
.platformer-hud-dock .platformer-hud-secondary-compat:hover {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.24);
}

/* Classic Super Smash Bros Bottom Dock Placement */
.platformer-hud-dock.is-bottom-dock,
#platformer-hud-dock.is-bottom-dock {
  top: auto !important;
  bottom: 14px !important;
  box-shadow: none !important;
}

.platformer-hud-dock.is-bottom-dock .platformer-hud-tuck-tab {
  top: auto !important;
  bottom: 8px !important;
}

/* Minimalist Fighting HUD Mode */
.platformer-hud-dock.is-minimal-mode,
#platformer-hud-dock.is-minimal-mode {
  height: 30px !important;
  padding: 0 8px !important;
  background: rgba(8, 14, 26, 0.38) !important;
}

.platformer-hud-dock.is-minimal-mode .platformer-hud-dock-sep,
.platformer-hud-dock.is-minimal-mode .platformer-hud-cluster-system,
.platformer-hud-dock.is-minimal-mode .platformer-hud-secondary-compat {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.platformer-hud-dock .platformer-hud-badge {
  display: none !important;
}

.platformer-hud-secondary-compat {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
}

.platformer-hud-dock.is-bottom-dock .platformer-hud-quick-popover,
.platformer-hud-dock.is-bottom-dock .platformer-hud-popover {
  top: auto !important;
  bottom: calc(100% + 8px) !important;
}

/* Tuckable HUD Dock & Mini HUD Capsule Transitions */
.platformer-hud-dock.is-tucked {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.platformer-hud-dock.is-tucked .platformer-hud-primary,
.platformer-hud-dock.is-tucked .platformer-hud-dock-sep,
.platformer-hud-dock.is-tucked .platformer-hud-cluster-system {
  display: none !important;
}

.platformer-hud-dock.is-tucked .platformer-hud-secondary-compat {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.platformer-hud-dock.is-tucked .hud-tuck-chevron {
  transform: rotate(180deg);
}

.hud-tuck-chevron,
.hud-untuck-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Mini HUD Capsule pinned at top: 8px when HUD is tucked */
.platformer-hud-tuck-tab {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 3px 10px 3px 8px;
  background: rgba(8, 14, 26, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  font-family: var(--font-display, sans-serif);
  font-size: 0.68rem;
  font-weight: 700;
  color: #ffffff;
  cursor: default;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.platformer-hud-dock.is-tucked .platformer-hud-tuck-tab {
  display: inline-flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.platformer-hud-tuck-tab:hover {
  border-color: rgba(0, 242, 254, 0.40);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.mini-hud-content {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.mini-hud-name {
  font-family: var(--font-display, sans-serif);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ffffff;
  white-space: nowrap;
}

.mini-hud-stocks {
  font-family: var(--font-mono, monospace);
  font-size: 0.70rem;
  font-weight: 700;
  color: #00f2fe;
  white-space: nowrap;
}

.mini-hud-dmg {
  font-family: var(--font-mono, monospace);
  font-size: 0.76rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.mini-hud-p2 {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.mini-hud-p2-name {
  font-family: var(--font-mono, monospace);
  font-size: 0.62rem;
  font-weight: 800;
  color: #f87171;
}

.mini-hud-p2-stocks {
  font-family: var(--font-mono, monospace);
  font-size: 0.70rem;
  font-weight: 700;
  color: #f87171;
}

.mini-hud-p2-dmg {
  font-family: var(--font-mono, monospace);
  font-size: 0.76rem;
  font-weight: 800;
  color: #ffffff;
}

.platformer-hud-untuck-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  color: #f1f5f9;
  font-family: var(--font-mono, monospace);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
  white-space: nowrap;
}

.platformer-hud-untuck-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

.platformer-hud-tuck-tab .tuck-tab-sep {
  opacity: 0.35;
  margin: 0 1px;
}

.platformer-hud-dock .platformer-hud-primary {
  position: static;
  bottom: auto;
  left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: auto;
  flex-shrink: 0;
}

.platformer-hud-dock .platformer-hud-primary:hover {
  border-color: transparent;
  box-shadow: none;
}

.platformer-hud-dock .platformer-hud-cluster-system {
  position: static;
  top: auto;
  right: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: auto;
  flex-shrink: 0;
}

.platformer-hud-dock-sep {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 2px;
  flex-shrink: 0;
}

.platformer-hud-quick-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.platformer-hud-quick-btn,
.platformer-hud-pause-btn,
.platformer-hud-tuck-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 3px 7px;
  font-family: inherit;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.platformer-hud-quick-btn:hover,
.platformer-hud-quick-btn[aria-expanded="true"],
.platformer-hud-tuck-btn:hover {
  color: #00f2fe;
  background: rgba(0, 242, 254, 0.12);
  border-color: rgba(0, 242, 254, 0.35);
}

.platformer-hud-pause-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Non-Interrupting Quick Settings Popover */
.platformer-hud-quick-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 99997;
  display: none;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
  padding: 8px 10px;
  background: rgba(8, 14, 26, 0.50);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  font-size: 0.60rem;
  box-sizing: border-box;
}

.platformer-hud-quick-popover.is-open {
  display: flex;
}

.quick-pop-title {
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.quick-pop-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.quick-pop-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 4px 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 6px;
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.56rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.quick-pop-btn:hover,
.quick-pop-btn.is-active {
  background: rgba(0, 242, 254, 0.14);
  border-color: rgba(0, 242, 254, 0.40);
  color: #00f2fe;
}

.quick-pop-btn.quick-pop-pause {
  justify-content: center;
  margin-top: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.quick-pop-btn.quick-pop-pause:hover {
  background: rgba(0, 242, 254, 0.22);
  border-color: #00f2fe;
  color: #00f2fe;
}

/* In-Game Full Pause & Settings Modal */
.platformer-pause-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  user-select: none;
}

.platformer-pause-modal.is-open {
  display: flex;
}

.pause-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 16, 0.55);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
}

.pause-modal-sheet {
  position: relative;
  z-index: 2;
  width: 440px;
  max-width: calc(100vw - 32px);
  background: rgba(8, 14, 26, 0.55);
  backdrop-filter: blur(36px) saturate(200%);
  -webkit-backdrop-filter: blur(36px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  padding: 18px 20px;
  color: #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
}

.pause-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pause-modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #38bdf8;
  text-transform: uppercase;
}

.pause-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  animation: platformer-pulse 1.8s infinite ease-in-out;
}

.pause-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pause-close-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #ffffff;
}

.pause-modal-primary-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pause-action-primary,
.pause-action-secondary {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.pause-action-primary {
  background: #ffffff;
  color: #030712;
  border: 1px solid #ffffff;
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.25);
}

.pause-action-primary:hover {
  background: #00f2fe;
  color: #030712;
  border-color: #00f2fe;
  box-shadow: 0 4px 16px rgba(0, 242, 254, 0.45);
}

.pause-action-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.pause-action-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.pause-section-label {
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #64748b;
  text-transform: uppercase;
  margin-top: 2px;
}

.pause-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.pause-grid-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.60rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pause-grid-btn:hover {
  background: rgba(0, 242, 254, 0.10);
  border-color: rgba(0, 242, 254, 0.35);
  color: #ffffff;
}

.pause-grid-label {
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

.pause-grid-val {
  font-weight: 800;
  color: #00f2fe;
}

.pause-modal-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.pause-exit-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #94a3b8;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pause-exit-btn:hover {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.08);
}

/* Authentic Super Smash Bros P1 Battle Placard (Fallback / Standalone) */
.platformer-hud-primary {
  position: fixed;
  bottom: 16px;
  left: 24px;
  z-index: 99995;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 8px 14px 8px 10px;
  background: rgba(6, 12, 26, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 20px rgba(0, 242, 254, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.20);
  box-sizing: border-box;
  flex-shrink: 0;
  pointer-events: auto;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.platformer-hud-primary:hover {
  border-color: rgba(0, 242, 254, 0.45);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.82), 0 0 24px rgba(0, 242, 254, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

/* Expandable Actions & Telemetry Drawer (Anchored under Top System Bar) */
.platformer-hud-drawer {
  position: fixed;
  top: 52px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(4, 11, 26, 0.95);
  border: 1px solid rgba(0, 242, 254, 0.26);
  border-radius: 14px;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 24px rgba(0, 242, 254, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  min-width: 290px;
  max-width: min(340px, calc(100vw - 32px));
  z-index: 99997;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(0.97);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.platformer-hud-drawer.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.platformer-hud-drawer.is-collapsed {
  display: flex;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(0.97);
  z-index: -1;
}

.platformer-hud-drawer.is-open {
  display: flex;
}

.platformer-hud-drawer-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.platformer-hud-drawer-heading {
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #64748b;
  text-transform: uppercase;
}

.platformer-hud-drawer .platformer-hud-cluster-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.platformer-hud-drawer .platformer-hud-cluster-telemetry {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-right: none;
}

.platformer-hud-drawer .platformer-hud-cluster-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.58rem;
}

/* Tools Drawer Toggle Button */
.platformer-hud-tools-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.22);
  color: #94a3b8;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.platformer-hud-tools-toggle:hover,
.platformer-hud-tools-toggle.is-active {
  background: rgba(0, 242, 254, 0.20);
  border-color: rgba(0, 242, 254, 0.5);
  color: #00f2fe;
}

/* Persistent Semi-Transparent Controls HUD Dock (Non-Interrupting) */
#prag-platformer-controller-hud {
  position: fixed;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  z-index: 99990;
  display: flex;
  align-items: center;
  background: rgba(8, 14, 26, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 9999px;
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.10);
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 0.65rem;
  color: #e2e8f0;
  letter-spacing: 0.04em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  max-width: calc(100vw - 32px);
  box-sizing: border-box;
}

#prag-platformer-controller-hud.is-visible {
  opacity: 0.88;
}

/* Input Mode Deduplication: Never display keyboard guide when touch controls are active */
body.platformer-touch-active #prag-platformer-controller-hud,
body:has(#prag-platformer-touch-controls.force-visible:not([style*="display: none"])) #prag-platformer-controller-hud {
  display: none !important;
}

@media (hover: none) and (pointer: coarse) {
  #prag-platformer-controller-hud {
    display: none !important;
  }
}

body:has(.platformer-hud-dock.is-bottom-dock) #prag-platformer-controller-hud {
  left: 20px !important;
  transform: none !important;
}

body:has(.platformer-hud-dock.is-bottom-dock) #prag-platformer-controller-hud.is-ghosted {
  transform: scale(0.96) !important;
}

/* Smart Proximity Ghosting: drops opacity to 0.18 when player approaches */
#prag-platformer-controller-hud.is-ghosted {
  opacity: 0.18 !important;
  transform: translateX(-50%) scale(0.96);
}

#prag-platformer-controller-hud:hover,
#prag-platformer-controller-hud:focus-within {
  opacity: 0.98 !important;
}

.ctrl-hud-inner {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.26rem 0.55rem;
  pointer-events: none;
}

.ctrl-hud-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.26rem;
  padding: 0.14rem 0.38rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 9999px;
  color: #94a3b8;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.ctrl-hud-device-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.ctrl-hud-bindings {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.ctrl-hud-bindings::-webkit-scrollbar {
  display: none;
}

.ctrl-hud-item {
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.08s ease;
}

.ctrl-hud-item.is-active {
  transform: translateY(-1px);
}

.controller-keycap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.1rem 0.34rem;
  min-width: 1.1rem;
  height: 1.15rem;
  font-family: inherit;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  box-sizing: border-box;
  transition: background 0.08s ease, border-color 0.08s ease, color 0.08s ease, transform 0.08s ease, box-shadow 0.08s ease;
}

.controller-keycap.is-active,
.controller-keycap.is-pressed {
  color: #ffffff !important;
  background: rgba(0, 242, 254, 0.45) !important;
  border-color: #00f2fe !important;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
  transform: translateY(1px) scale(0.96);
}

#ctrl-k-atk.is-active, #ctrl-k-atk.is-pressed {
  background: rgba(56, 189, 248, 0.45) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
}

#ctrl-k-smash.is-active, #ctrl-k-smash.is-pressed {
  background: rgba(244, 63, 94, 0.45) !important;
  border-color: #f43f5e !important;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
}

#ctrl-k-spec.is-active, #ctrl-k-spec.is-pressed {
  background: rgba(255, 215, 0, 0.45) !important;
  border-color: #ffd700 !important;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
}

#ctrl-k-shield.is-active, #ctrl-k-shield.is-pressed {
  background: rgba(16, 185, 129, 0.45) !important;
  border-color: #10b981 !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
}

#ctrl-k-grab.is-active, #ctrl-k-grab.is-pressed {
  background: rgba(245, 158, 11, 0.45) !important;
  border-color: #f59e0b !important;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
}

.controller-action {
  font-size: 0.54rem;
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.08s ease, text-shadow 0.08s ease;
}

.ctrl-hud-item.is-active .controller-action {
  color: #ffffff !important;
  text-shadow: 0 0 6px rgba(0, 242, 254, 0.6);
}

.ctrl-hud-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  padding: 0;
  margin-left: 0.12rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9999px;
  color: #94a3b8;
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.15s, color 0.15s, transform 0.2s, border-color 0.15s;
  flex-shrink: 0;
}

.ctrl-hud-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

#prag-platformer-controller-hud.is-collapsed {
  background: rgba(8, 14, 26, 0.40);
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.10);
  padding: 0;
}

#prag-platformer-controller-hud.is-collapsed .ctrl-hud-inner {
  padding: 0.18rem 0.42rem;
  gap: 0.28rem;
}

#prag-platformer-controller-hud.is-collapsed .ctrl-hud-bindings {
  display: none;
}

#prag-platformer-controller-hud.is-collapsed .ctrl-hud-toggle {
  transform: rotate(180deg);
}

/* Semantic Pod Clusters */
.platformer-hud-cluster {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  flex-shrink: 0;
}

.platformer-hud-cluster-combat {
  padding-right: 0.45rem;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.platformer-hud-cluster-telemetry {
  padding-right: 0.45rem;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.platformer-hud-cluster-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
}

.platformer-hud-cluster-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
}

.platformer-hud-cluster-system {
  position: fixed;
  top: 14px;
  right: 24px;
  z-index: 99996;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(6, 12, 26, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 3px 6px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  pointer-events: auto;
}

.platformer-hud-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-weight: 800;
  font-size: 0.62rem;
  color: #00f2fe;
  background: rgba(0, 242, 254, 0.12);
  border: 1px solid rgba(0, 242, 254, 0.35);
  border-radius: 9999px;
  padding: 2px 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.platformer-hud-badge-title {
  display: inline-block;
  font-size: 0.60rem;
  font-weight: 800;
}

.platformer-hud-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00f2fe;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  animation: platformer-pulse 1.8s infinite ease-in-out;
}

@keyframes platformer-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.2); }
}

.platformer-hud-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #cbd5e1;
}

#hud-3d-breach-btn {
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

#hud-3d-breach-btn:hover {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.65);
  color: #ffffff;
}

#hud-3d-breach-btn .platformer-hud-val {
  color: #38bdf8;
}

.platformer-hud-val {
  font-weight: 700;
  color: #ffffff;
}

.platformer-hud-coins .platformer-hud-val {
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

.platformer-hud-sector .platformer-hud-val {
  color: #38bdf8;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Super Smash Bros Chromatic Heat Damage Counter */
.platformer-hud-damage {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 0 2px;
  background: transparent;
  border: none;
  line-height: 1;
}

.platformer-hud-damage > span:first-child {
  display: none;
}

.platformer-hud-damage .platformer-hud-val {
  font-family: var(--font-display, -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif);
  font-size: 1.85rem;
  font-weight: 900;
  font-style: italic;
  line-height: 0.95;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.92);
  transition: color 0.2s ease, text-shadow 0.2s ease, transform 0.15s ease;
}

.platformer-hud-damage .platformer-hud-val.is-danger-50 {
  color: #fde047;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95);
}

.platformer-hud-damage .platformer-hud-val.is-danger-100 {
  color: #fb923c;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95);
  animation: platformer-shake 0.3s infinite ease-in-out;
}

.platformer-hud-damage .platformer-hud-val.is-danger-150 {
  color: #f43f5e;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.95);
  animation: platformer-shake 0.12s infinite ease-in-out;
}

@keyframes platformer-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-1px); }
  75% { transform: translateX(1px); }
}

/* Stocks (Lives Remaining) Avionics Counter */
.platformer-hud-stocks {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 4px;
}

.platformer-stock-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #00f2fe;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.platformer-stock-icon svg {
  display: block;
}

.platformer-stock-icon.is-active {
  color: #00f2fe;
  filter: drop-shadow(0 0 4px rgba(0, 242, 254, 0.6));
  transform: scale(1);
}

.platformer-stock-icon.is-lost {
  color: rgba(239, 68, 68, 0.35);
  opacity: 0.3;
  transform: scale(0.8);
  filter: none;
}

/* Controls Guide Popover */
.platformer-hud-help-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.platformer-hud-help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
}

.platformer-hud-help-btn:hover,
.platformer-hud-help-btn:focus-visible {
  background: rgba(0, 242, 254, 0.2);
  border-color: #00f2fe;
  color: #ffffff;
  outline: none;
}

.platformer-hud-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  display: flex;
  opacity: 0;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
  background: rgba(4, 11, 26, 0.95);
  border: 1px solid rgba(0, 242, 254, 0.3);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  font-size: 0.65rem;
  color: #cbd5e1;
  white-space: nowrap;
  pointer-events: none;
  z-index: 99996;
  transition: opacity 0.18s ease;
}

.platformer-hud-popover span {
  display: block;
}

.platformer-hud-help-wrapper:hover .platformer-hud-popover,
.platformer-hud-help-btn:focus-visible + .platformer-hud-popover {
  display: flex;
  opacity: 1;
}

.platformer-hud-controls {
  font-size: 0.64rem;
  color: #64748b;
  padding: 0.15rem 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  letter-spacing: 0.02em;
}

.platformer-hud-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 0.15rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  color: #cbd5e1;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.platformer-hud-close:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
  color: #ffffff;
  transform: scale(1.1);
}

/* On-Screen Mobile / Touch Virtual Controls */
#prag-platformer-touch-controls {
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom, 16px));
  left: 0;
  right: 0;
  z-index: 2147483646;
  display: none;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 max(20px, env(safe-area-inset-right, 20px)) 0 max(20px, env(safe-area-inset-left, 20px));
  pointer-events: none;
}

/* Responsive Avionics HUD Breakpoints */

/* Tier 1: Laptops & Wide Desktops (< 1440px) - Hide brand ticker to keep HUD compact */
@media (max-width: 1440px) {
  .platformer-hud-cluster-brand {
    display: none !important;
  }
}

/* Tier 2: Medium Laptops & Tablets (< 1200px) - Hide non-essential telemetry (Sector, Bricks, Score, Alt) */
@media (max-width: 1200px) {
  .platformer-hud-cluster-telemetry {
    display: none !important;
  }
  #prag-platformer-hud {
    gap: 0.38rem;
    padding: 0.25rem 0.55rem;
  }
}

/* Tier 3: Compact Tablets (< 900px) */
@media (max-width: 900px) {
  #prag-platformer-hud {
    right: 16px;
    max-width: calc(100vw - 32px);
  }
  .platformer-hud-cluster-combat {
    padding-right: 0.35rem;
  }
  .platformer-hud-dock {
    padding: 3px 8px;
    gap: 0.32rem;
  }
  .platformer-hud-dock .platformer-hud-badge {
    display: none !important;
  }
  .platformer-hud-dock .p2-join-label {
    display: none !important;
  }
}

/* Tier 4: Mobile Cockpit & Touch Screens (<= 820px or pointer: coarse) */
@media (max-width: 820px), (pointer: coarse) {
  #prag-platformer-touch-controls.is-visible {
    display: flex !important;
  }
  #prag-platformer-controller-hud {
    display: none !important;
  }
  #prag-platformer-hud {
    left: 0;
    right: 0;
    max-width: 100vw;
    padding: 0.25rem 0.35rem;
    font-size: 0.60rem;
    overflow: visible;
  }
  .platformer-hud-dock {
    min-height: 48px;
    height: auto;
    width: auto !important;
    max-width: calc(100vw - 12px) !important;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 0 4px;
    gap: 6px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .platformer-hud-dock .platformer-hud-cluster-combat {
    padding: 4px 10px 4px 9px;
    gap: 6px;
  }
  .platformer-hud-dock .platformer-hud-cluster-system {
    padding: 2px 5px;
    gap: 2px;
  }
  .platformer-hud-dock::-webkit-scrollbar {
    display: none;
  }
  .platformer-hud-dock.is-bottom-dock,
  #platformer-hud-dock.is-bottom-dock {
    bottom: 6px !important;
  }
  .platformer-hud-dock .platformer-hud-p2-join,
  .platformer-hud-dock .platformer-hud-bgm-btn,
  .platformer-hud-dock #hud-3d-breach-btn .platformer-hud-val {
    display: none !important;
  }
  .platformer-hud-dock .platformer-hud-quick-btn span,
  .platformer-hud-dock .platformer-hud-pause-btn span,
  .platformer-hud-dock .platformer-hud-tuck-btn span {
    display: none !important;
  }
  .platformer-hud-dock .platformer-hud-quick-btn,
  .platformer-hud-dock .platformer-hud-pause-btn,
  .platformer-hud-dock .platformer-hud-tuck-btn,
  .platformer-hud-dock #hud-3d-breach-btn,
  .platformer-hud-dock .platformer-hud-close {
    min-width: 44px;
    width: 44px;
    min-height: 44px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .platformer-hud-dock .platformer-hud-dock-sep,
  .platformer-hud-dock .platformer-hud-damage > span:first-child {
    display: none !important;
  }
  .platformer-hud-dock .platformer-hud-badge {
    max-width: 68px;
    padding: 2px 4px !important;
  }
  @media (max-width: 520px) {
    #hud-character-badge,
    .platformer-hud-dock .platformer-hud-tools-toggle {
      display: none !important;
    }
  }
  .platformer-hud-dock .platformer-hud-stocks .platformer-stock-icon {
    width: 12px !important;
    height: 12px !important;
  }
  .platformer-hud-dock .platformer-hud-help-wrapper {
    display: none !important;
  }
  #hud-character-name {
    max-width: none !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
    font-size: 0.52rem !important;
  }
  .platformer-hud-dock .platformer-hud-damage {
    padding: 1px 6px;
    gap: 3px;
  }
  .platformer-hud-dock .platformer-hud-damage .platformer-hud-val {
    font-size: 1.05rem;
  }
  .platformer-hud-dock .platformer-hud-stocks {
    gap: 2px;
    padding: 0 2px;
  }

  .platformer-hud-primary {
    bottom: 150px;
    left: 10px;
    transform: scale(0.85);
    transform-origin: bottom left;
  }
  .platformer-hud-dock .platformer-hud-primary {
    transform: none !important;
    gap: 0.22rem;
  }

  .platformer-hud-p2,
  .platformer-hud-p2-join {
    bottom: 185px;
    right: 14px;
    transform: scale(0.85);
    transform-origin: bottom right;
  }

  .platformer-hud-cluster-system {
    top: max(10px, calc(env(safe-area-inset-top, 0px) + 8px));
    right: 8px;
  }

  .platformer-hud-drawer {
    top: 48px;
    right: 8px;
    max-width: calc(100vw - 16px);
    grid-template-areas:
      "combat system"
      "actions actions";
  }

  #prag-platformer-hud.is-visible {
    opacity: 1;
  }

  #prag-platformer-controller-hud {
    bottom: max(12px, env(safe-area-inset-bottom, 12px));
    padding: 0.18rem 0.35rem;
    font-size: 0.58rem;
    max-width: calc(100vw - 20px);
  }
  #prag-platformer-controller-hud .controller-action {
    display: none;
  }
  #prag-platformer-controller-hud .ctrl-hud-inner {
    gap: 0.28rem;
    padding: 0.16rem 0.3rem;
  }
  #prag-platformer-controller-hud .ctrl-hud-bindings {
    gap: 0.25rem;
  }
  #prag-platformer-controller-hud .controller-keycap {
    min-width: 0.95rem;
    height: 1.05rem;
    font-size: 0.54rem;
    padding: 0.08rem 0.25rem;
  }

  .platformer-hud-cluster-combat {
    grid-area: combat;
    display: flex;
    align-items: center;
    gap: 4px;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    padding-right: 4px;
  }

  .platformer-hud-cluster-system {
    grid-area: system;
    display: flex;
    align-items: center;
    gap: 3px;
    margin-left: 0;
    justify-content: flex-end;
  }

  .platformer-hud-cluster-actions {
    grid-area: actions;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 1px;
    max-width: 100%;
  }

  .platformer-hud-cluster-actions::-webkit-scrollbar {
    display: none;
  }

  .platformer-hud-cluster-telemetry,
  .platformer-hud-cluster-brand {
    display: none !important;
  }

  .platformer-hud-stat {
    flex-shrink: 0;
    padding: 0.2rem 0.45rem;
  }

  .platformer-hud-close {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    font-size: 0.85rem;
    flex-shrink: 0;
  }

  .platformer-hud-help-btn {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }

  .platformer-hud-popover {
    font-size: 0.58rem;
    padding: 6px 10px;
    max-width: calc(100vw - 32px);
  }
}

/* ——— Ergonomic Mobile Virtual Gamepad Subsystem (Low-Obstruction Glass Standard) ——— */

#prag-platformer-touch-controls {
  position: fixed;
  bottom: max(60px, calc(env(safe-area-inset-bottom, 4px) + 58px));
  left: 0;
  right: 0;
  z-index: 2147483646;
  display: none;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 max(6px, env(safe-area-inset-right, 6px)) 0 max(6px, env(safe-area-inset-left, 6px));
  pointer-events: none;
  opacity: 0.62;
  transition: opacity 0.16s cubic-bezier(0.16, 1, 0.3, 1), bottom 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

#prag-platformer-touch-controls:active,
#prag-platformer-touch-controls:has(.is-active, .is-pressed) {
  opacity: 0.95;
}

#prag-platformer-touch-controls.is-hud-tucked,
body:has(.platformer-hud-dock.is-tucked) #prag-platformer-touch-controls {
  bottom: max(6px, env(safe-area-inset-bottom, 6px));
  opacity: 0.24;
}

#prag-platformer-touch-controls.is-3d-mode {
  bottom: max(12px, env(safe-area-inset-bottom, 12px));
}

#prag-platformer-touch-controls {
  --touch-glass-alpha: 0.34;
  --touch-border-alpha: 0.44;
  --touch-btn-glass-alpha: 0.42;
  --touch-blur: 6px;
}

#prag-platformer-touch-controls.opacity-ghost {
  --touch-glass-alpha: 0.12;
  --touch-border-alpha: 0.24;
  --touch-btn-glass-alpha: 0.18;
  --touch-blur: 0px;
  opacity: 0.42;
}

#prag-platformer-touch-controls.opacity-balanced {
  --touch-glass-alpha: 0.34;
  --touch-border-alpha: 0.44;
  --touch-btn-glass-alpha: 0.42;
  --touch-blur: 6px;
}

#prag-platformer-touch-controls.opacity-solid {
  --touch-glass-alpha: 0.42;
  --touch-border-alpha: 0.48;
  --touch-btn-glass-alpha: 0.48;
  --touch-blur: 4px;
  opacity: 0.84;
}

@media (max-width: 820px), (hover: none) and (pointer: coarse), (pointer: coarse) {
  #prag-platformer-touch-controls.is-visible {
    display: flex !important;
  }
}

#prag-platformer-touch-controls.force-visible {
  display: flex !important;
}

@media (min-width: 821px) and (pointer: fine) {
  #prag-platformer-touch-controls:not(.force-visible) {
    display: none !important;
  }
}

#prag-platformer-touch-controls.is-ghosted:not(:active):not(:has(.is-active, .is-pressed)) {
  opacity: 0.36;
}

/* Hide CloudyLogs pill, feedback/chat system tray, and floating store CTA on mobile when touch controls are visible to prevent collision */
@media (max-width: 820px), (hover: none) and (pointer: coarse), (pointer: coarse) {
  body:has(#prag-platformer-touch-controls.is-visible) #prag-cloudylogs-root,
  body:has(#prag-platformer-touch-controls.is-visible) .floating-cta,
  body:has(#prag-platformer-touch-controls.is-visible) #floating-cta,
  body:has(#prag-platformer-touch-controls.is-visible) .mobile-sticky-cta,
  body:has(#prag-platformer-touch-controls.is-visible) #prag-feedback-dock,
  body:has(#prag-platformer-touch-controls.is-visible) .prag-feedback-widget,
  body:has(#prag-platformer-touch-controls.is-visible) #prag-chat-widget,
  body:has(#prag-platformer-touch-controls.is-visible) .prag-chat-widget,
  body:has(#prag-platformer-touch-controls.is-visible) .prag-system-tray,
  body:has(#prag-platformer-touch-controls.is-visible) .pragchat-hud-container,
  body:has(#prag-platformer-touch-controls.is-visible) .pf-dock {
    display: none !important;
  }
}

/* 360-Degree Analog Thumbstick Pod + 4-Way Cardinal D-Pad Hybrid */
.platformer-dpad-pod {
  position: relative;
  width: 136px;
  height: 136px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(8, 14, 26, var(--touch-glass-alpha, 0.08)) 0%, rgba(8, 15, 30, calc(var(--touch-glass-alpha, 0.08) * 0.5)) 100%);
  border: 1px solid rgba(56, 189, 248, var(--touch-border-alpha, 0.18));
  box-shadow: none;
  display: grid;
  grid-template-columns: repeat(3, 44px);
  grid-template-rows: repeat(3, 44px);
  gap: 2px;
  place-content: center;
  pointer-events: auto;
  user-select: none;
  touch-action: none;
  -webkit-touch-callout: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.platformer-dpad-pod::before {
  display: none;
}

.platformer-dpad-pod.is-active {
  border-color: rgba(0, 242, 254, 0.65);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 0 10px rgba(0, 242, 254, 0.18);
}

.platformer-dpad-btn {
  background: rgba(8, 14, 26, 0.22);
  border: 1px solid rgba(56, 189, 248, 0.36);
  color: rgba(241, 245, 249, 0.92);
  display: grid;
  place-items: center;
  user-select: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: none;
  transition: transform 0.08s ease, background 0.08s ease, border-color 0.08s ease, color 0.08s ease;
}

.platformer-dpad-btn.is-pressed,
.platformer-dpad-btn:active {
  background: rgba(0, 242, 254, 0.22);
  border-color: rgba(0, 242, 254, 0.75);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.30);
  transform: scale(0.95);
}

#touch-up {
  grid-column: 2;
  grid-row: 1;
  border-radius: 8px 8px 3px 3px;
}

#touch-left {
  grid-column: 1;
  grid-row: 2;
  border-radius: 8px 3px 3px 8px;
}

.platformer-dpad-center {
  grid-column: 2;
  grid-row: 2;
  width: 42px;
  height: 42px;
  margin: auto;
  z-index: 5;
  background: radial-gradient(circle at 36% 32%, rgba(51, 65, 85, 0.35) 0%, rgba(15, 23, 42, 0.45) 100%);
  border: 1px solid rgba(56, 189, 248, 0.32);
  border-radius: 50%;
  box-shadow: none;
  display: grid;
  place-items: center;
  pointer-events: none;
  will-change: transform;
  transition: transform 0.15s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.12s ease, box-shadow 0.12s ease;
}

.platformer-dpad-pod.is-active .platformer-dpad-center {
  transition: none;
  border-color: #00f2fe;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.50), 0 0 8px rgba(0, 242, 254, 0.35);
}

.platformer-dpad-center::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(56, 189, 248, 0.65) 0%, rgba(14, 165, 233, 0.25) 70%, rgba(8, 14, 26, 0.4) 100%);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

#touch-right {
  grid-column: 3;
  grid-row: 2;
  border-radius: 3px 8px 8px 3px;
}

#touch-down {
  grid-column: 2;
  grid-row: 3;
  border-radius: 3px 3px 8px 8px;
}

/* Action Cluster (44px+ WCAG 2.5.8 2-Row Thumb Strip) */
.platformer-action-diamond {
  position: relative;
  width: 144px;
  height: 94px;
  pointer-events: auto;
  user-select: none;
  touch-action: none;
  -webkit-touch-callout: none;
}

/* Utility Shelf (Codex & Contextual Warp) */
.platformer-touch-utility-shelf {
  position: absolute;
  top: -34px;
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

/* Deduplicate Codex: The main HUD dock is the authoritative home for Codex */
body:has(.platformer-hud-dock) .platformer-touch-utility-shelf,
body:has(#prag-platformer-hud) .platformer-touch-utility-shelf {
  display: none !important;
}

.platformer-touch-btn.codex-btn,
#touch-codex {
  position: static !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px;
  height: 24px !important;
  padding: 0 10px !important;
  border-radius: 9999px !important;
  background: rgba(8, 14, 26, 0.45) !important;
  backdrop-filter: blur(24px) saturate(190%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(190%) !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  color: #cbd5e1 !important;
  font-family: var(--font-mono, monospace);
  font-size: 0.58rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.platformer-touch-btn.codex-btn.is-pressed,
#touch-codex.is-pressed,
#touch-codex:active {
  background: rgba(255, 255, 255, 0.16) !important;
  border-color: #ffffff !important;
  color: #ffffff !important;
  transform: scale(0.94);
}

#touch-codex-badge {
  color: #38bdf8;
  font-size: 0.54rem;
  font-weight: 800;
}

.platformer-touch-btn.action-btn,
#touch-action {
  position: static !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 24px !important;
  padding: 0 12px !important;
  border-radius: 9999px !important;
  font-family: var(--font-mono, monospace);
  font-size: 0.58rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em;
  background: rgba(8, 14, 26, 0.35) !important;
  backdrop-filter: blur(24px) saturate(190%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(190%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #64748b !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15) !important;
  opacity: 0.45;
  pointer-events: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.platformer-touch-btn.action-btn.is-ready,
#touch-action.is-ready {
  opacity: 1 !important;
  pointer-events: auto !important;
  background: rgba(245, 158, 11, 0.22) !important;
  border-color: #f59e0b !important;
  color: #ffd700 !important;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
  animation: platformer-action-pulse 1.4s ease-in-out infinite;
  cursor: pointer;
}

@keyframes platformer-action-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
  }
  50% {
    transform: scale(1.04);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.7);
  }
}

/* Combat Action Buttons (Whisper-Light Hairline Circular Rings with Vector Glyphs) */
.platformer-touch-btn {
  position: absolute;
  border-radius: 50%;
  background: rgba(8, 14, 26, var(--touch-btn-glass-alpha, 0.22));
  border: 1px solid rgba(255, 255, 255, 0.36);
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0px;
  box-shadow: none;
  user-select: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s ease, background 0.08s ease, border-color 0.08s ease, box-shadow 0.08s ease;
}

.platformer-touch-btn svg {
  pointer-events: none;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.85));
}

.touch-btn-sub {
  font-family: var(--font-mono, monospace);
  font-size: 0.34rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  pointer-events: none;
  opacity: 0.92;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.90);
}

.platformer-touch-btn.is-pressed,
.platformer-touch-btn:active {
  transform: scale(0.91);
  background: rgba(255, 255, 255, 0.28) !important;
  border-color: #ffffff !important;
  color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
}

/* Row 1 (Bottom Row): GRAB, ATK, JUMP */
.platformer-touch-btn.jump-btn,
#touch-jump {
  bottom: 0px;
  right: 0px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(56, 189, 248, 0.48);
  color: #38bdf8;
}

.platformer-touch-btn.jump-btn .touch-btn-sub {
  font-size: 0.34rem;
  color: #e0f2fe;
}

.platformer-touch-btn.jump-btn.is-pressed,
.platformer-touch-btn.jump-btn:active,
#touch-jump.is-pressed {
  background: rgba(56, 189, 248, 0.25) !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
}

.platformer-touch-btn.atk-btn,
#touch-atk {
  bottom: 0px;
  right: 48px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(56, 189, 248, 0.44);
  color: #38bdf8;
}

.platformer-touch-btn.atk-btn .touch-btn-sub {
  color: #e0f2fe;
}

.platformer-touch-btn.atk-btn.is-pressed,
.platformer-touch-btn.atk-btn:active,
#touch-atk.is-pressed {
  background: rgba(56, 189, 248, 0.25) !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
}

#prag-platformer-touch-controls:not(.is-3d-mode) .platformer-touch-btn.is-3d-only {
  display: none !important;
}

.platformer-touch-btn.grab-btn,
#touch-grab {
  bottom: 0px;
  right: 96px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(250, 204, 21, 0.44);
  color: #facc15;
}

.platformer-touch-btn.grab-btn .touch-btn-sub {
  color: #fef08a;
}

.platformer-touch-btn.grab-btn.is-pressed,
.platformer-touch-btn.grab-btn:active,
#touch-grab.is-pressed {
  background: rgba(250, 204, 21, 0.25) !important;
  border-color: #facc15 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
}

/* Row 2 (Low-Profile Upper Arc): SPEC, SMASH, DEF */
.platformer-touch-btn.shield-btn,
#touch-shield {
  bottom: 48px;
  right: 0px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(129, 140, 248, 0.44);
  color: #818cf8;
}

.platformer-touch-btn.shield-btn .touch-btn-sub {
  color: #e0e7ff;
}

.platformer-touch-btn.shield-btn.is-pressed,
.platformer-touch-btn.shield-btn:active,
#touch-shield.is-pressed {
  background: rgba(129, 140, 248, 0.25) !important;
  border-color: #818cf8 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
}

.platformer-touch-btn.smash-btn,
#touch-smash {
  bottom: 48px;
  right: 48px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(244, 63, 94, 0.44);
  color: #f43f5e;
}

.platformer-touch-btn.smash-btn .touch-btn-sub {
  color: #fee2e2;
}

.platformer-touch-btn.smash-btn.is-pressed,
.platformer-touch-btn.smash-btn:active,
#touch-smash.is-pressed {
  background: rgba(244, 63, 94, 0.25) !important;
  border-color: #f43f5e !important;
  color: #ffffff !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
}

.platformer-touch-btn.spec-btn,
#touch-spec {
  bottom: 48px;
  right: 96px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(251, 191, 36, 0.44);
  color: #fbbf24;
}

.platformer-touch-btn.spec-btn .touch-btn-sub {
  color: #fef3c7;
}

.platformer-touch-btn.spec-btn.is-pressed,
.platformer-touch-btn.spec-btn:active,
#touch-spec.is-pressed {
  background: rgba(251, 191, 36, 0.25) !important;
  border-color: #fbbf24 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
}

/* 3D FPS Mode Ergonomic Thumb Trigger Layout (Clear of Center Weapon Viewmodel) */
#prag-platformer-touch-controls.is-3d-mode #touch-atk {
  bottom: 0px;
  right: 0px;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(0, 242, 254, 0.40);
  background: radial-gradient(circle at 38% 35%, rgba(14, 165, 233, 0.18) 0%, rgba(8, 15, 30, 0.30) 75%);
}

#prag-platformer-touch-controls.is-3d-mode #touch-jump {
  bottom: 0px;
  right: 48px;
  width: 44px;
  height: 44px;
}

#prag-platformer-touch-controls.is-3d-mode #touch-grab {
  bottom: 0px;
  right: 96px;
  width: 44px;
  height: 44px;
}

#prag-platformer-touch-controls.is-3d-mode #touch-shield {
  bottom: 48px;
  right: 0px;
  width: 44px;
  height: 44px;
}

#prag-platformer-touch-controls.is-3d-mode #touch-smash {
  bottom: 48px;
  right: 48px;
  width: 44px;
  height: 44px;
}

#prag-platformer-touch-controls.is-3d-mode #touch-spec {
  bottom: 48px;
  right: 96px;
  width: 44px;
  height: 44px;
}

/* Victory Celebration Modal */
#prag-platformer-victory {
  position: fixed;
  inset: 0;
  z-index: 2147483646 !important;
  display: grid;
  place-items: center;
  background: rgba(1, 4, 12, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none !important;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
  padding: 1.5rem;
}

#prag-platformer-victory.is-open {
  opacity: 1 !important;
  visibility: visible;
  pointer-events: auto !important;
}

body:has(#prag-platformer-victory.is-open) .hud-radar-dock,
body:has(#prag-platformer-gameover.is-open) .hud-radar-dock {
  opacity: 0 !important;
  pointer-events: none !important;
}

.platformer-victory-card {
  position: relative;
  z-index: 2147483647 !important;
  pointer-events: auto;
  width: min(560px, 94vw);
  background: linear-gradient(170deg, rgba(12, 16, 26, 0.96) 0%, rgba(4, 6, 12, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-top: 2px solid #fbbf24;
  border-radius: 6px;
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
  padding: 2rem 2rem 1.85rem;
  box-shadow: 0 32px 84px rgba(0, 0, 0, 0.88), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  text-align: center;
  transform: scale(0.92) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#prag-platformer-victory.is-open .platformer-victory-card {
  transform: scale(1) translateY(0);
}

.platformer-victory-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #38bdf8;
  padding: 0.28rem 0.85rem;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 9999px;
  margin-bottom: 1rem;
}

.platformer-victory-title {
  font-family: var(--font-display, -apple-system, BlinkMacSystemFont, "Inter", sans-serif);
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
  margin: 0 0 0.4rem;
  line-height: 1.15;
}

.platformer-victory-sub {
  font-family: var(--font-body, -apple-system, BlinkMacSystemFont, "Inter", sans-serif);
  font-size: 0.9rem;
  color: #94a3b8;
  margin: 0 0 1.35rem;
  line-height: 1.45;
}

.platformer-victory-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.68rem;
  margin-bottom: 1.65rem;
}

.platformer-stat-tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 76px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.75rem 0.55rem;
}

.platformer-stat-tile-val {
  display: block;
  font-family: "JetBrains Mono", "SF Mono", var(--font-mono, monospace);
  font-size: 1.05rem;
  line-height: 1.22;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.3rem;
  word-break: break-word;
}

.platformer-stat-tile:nth-child(2) .platformer-stat-tile-val {
  color: #facc15;
}

.platformer-stat-tile:nth-child(3) .platformer-stat-tile-val {
  color: #38bdf8;
  font-size: 0.92rem;
}

.platformer-stat-tile:nth-child(6) .platformer-stat-tile-val {
  font-size: 0.84rem;
  letter-spacing: -0.02em;
}

.platformer-stat-tile-lbl {
  display: block;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  font-size: 0.60rem;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.platformer-victory-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}

.platformer-btn-primary {
  padding: 0.7rem 1.35rem;
  border-radius: 10px;
  background: linear-gradient(180deg, #38bdf8 0%, #0ea5e9 100%);
  color: #030712;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: all 0.2s ease;
}

.platformer-btn-primary:hover {
  background: #ffffff;
  transform: translateY(-1px);
}

.platformer-btn-secondary {
  padding: 0.7rem 1.25rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.2s ease;
}

.platformer-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
}

/* Game Over / Out of Stocks Modal */
#prag-platformer-gameover {
  position: fixed;
  inset: 0;
  z-index: 2147483646 !important;
  display: grid;
  place-items: center;
  background: rgba(1, 4, 12, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none !important;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
  padding: 1.5rem;
}

#prag-platformer-gameover.is-open {
  opacity: 1 !important;
  visibility: visible;
  pointer-events: auto !important;
}

.platformer-gameover-card {
  border: 1px solid rgba(244, 63, 94, 0.45) !important;
  border-top: 2px solid #ef4444 !important;
  box-shadow: 0 32px 84px rgba(0, 0, 0, 0.88), inset 0 1px 0 rgba(255, 255, 255, 0.14) !important;
}

.platformer-gameover-chip {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
  color: #f87171 !important;
}

.platformer-gameover-title {
  color: #ffffff !important;
  font-style: italic;
  text-shadow: 0 6px 24px rgba(0, 0, 0, 0.9) !important;
}

.platformer-btn-retry {
  background: #ef4444 !important;
  color: #ffffff !important;
  border: 1px solid #f87171 !important;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.4) !important;
}

.platformer-btn-retry:hover {
  background: #dc2626 !important;
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.7) !important;
}

/* Stood-Upon Physical & Interactive 3D Extruded DOM Element Grounding */
.platformer-standing-on {
  outline: none !important;
  box-shadow:
    0 2px 0 rgba(0, 180, 216, 0.4),
    0 4px 16px rgba(0, 242, 254, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.45) !important;
  transform: translateY(2px) scale(0.995) !important;
  transition: box-shadow 0.15s ease, transform 0.1s ease !important;
  z-index: 10 !important;
}

/* ==========================================================================
   TRUE 3D EXTRUDED LETTER GLYPHS & UI SLABS (DOM PERSPECTIVE 3D)
   ========================================================================== */

/* Ensure site header is always locked above game canvas */
body.prag-platformer-active .site-header,
body.prag-platformer-active .pdr-header,
body.prag-platformer-active header[role="banner"] {
  z-index: 999999 !important;
}

/* 3D Typographic Container — preserve native block / inline-block display */
.platformer-3d-container {
  position: relative;
}

/* Individual 3D Extruded Letter Glyph — Authentic Raised Keycaps */
.platformer-3d-glyph {
  display: inline-block !important;
  position: relative !important;
  transform: translateY(-4px) !important;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.75),
    0 2px 0 rgba(56, 189, 248, 0.50),
    0 3px 0 rgba(14, 116, 144, 0.65),
    0 4px 0 rgba(15, 23, 42, 0.90),
    0 5px 8px rgba(0, 0, 0, 0.85) !important;
  transition: transform 0.10s cubic-bezier(0.16, 1, 0.3, 1), text-shadow 0.10s ease !important;
  will-change: transform, text-shadow;
  outline: none !important;
  box-shadow: none !important;
}

/* Tactile 3D Keycap Step Depression when Character stands on the Letter */
.platformer-3d-glyph.platformer-standing-on,
.platformer-3d-glyph.is-stepped-on {
  transform: translateY(3px) scale(0.975) !important;
  text-shadow:
    0 1px 0 #ffffff,
    0 2px 0 #00f2fe,
    0 3px 0 #0096c7,
    0 4px 0 #023e8a,
    0 5px 8px rgba(0, 0, 0, 0.95),
    0 0 20px rgba(0, 242, 254, 0.90) !important;
  outline: none !important;
  box-shadow: none !important;
}

/* Signature Glowing Hero Glyph Compositions (Taste, compiled.) */
#hero-compiled .platformer-3d-glyph,
.hero-compiled .platformer-3d-glyph {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95),
    0 2px 0 #00f2fe,
    0 3px 0 #0284c7,
    0 4px 0 #0369a1,
    0 5px 0 #075985,
    0 6px 14px rgba(0, 0, 0, 0.90),
    0 0 28px rgba(0, 242, 254, 0.85),
    0 0 54px rgba(0, 242, 254, 0.45) !important;
}

#hero-compiled .platformer-3d-glyph.is-stepped-on,
#hero-compiled .platformer-3d-glyph.platformer-standing-on,
.hero-compiled .platformer-3d-glyph.is-stepped-on,
.hero-compiled .platformer-3d-glyph.platformer-standing-on {
  transform: translateY(3.5px) scale(0.975) !important;
  text-shadow:
    0 1px 0 #ffffff,
    0 2px 0 #38bdf8,
    0 3px 0 #0284c7,
    0 4px 0 #0369a1,
    0 5px 10px rgba(0, 0, 0, 0.95),
    0 0 36px rgba(0, 242, 254, 1.0),
    0 0 64px rgba(0, 242, 254, 0.75) !important;
}

#hero-taste .platformer-3d-glyph,
.hero-title .platformer-3d-glyph {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  text-shadow:
    0 1px 0 #ffffff,
    0 2px 0 #cbd5e1,
    0 3px 0 #94a3b8,
    0 4px 0 #64748b,
    0 5px 0 #475569,
    0 6px 0 #334155,
    0 7px 0 #1e293b,
    0 8px 16px rgba(0, 0, 0, 0.90),
    0 0 24px rgba(255, 255, 255, 0.35) !important;
}

#hero-taste .platformer-3d-glyph.is-stepped-on,
#hero-taste .platformer-3d-glyph.platformer-standing-on,
.hero-title .platformer-3d-glyph.is-stepped-on,
.hero-title .platformer-3d-glyph.platformer-standing-on {
  transform: translateY(3.5px) scale(0.975) !important;
  text-shadow:
    0 1px 0 #ffffff,
    0 2px 0 #38bdf8,
    0 3px 0 #0284c7,
    0 4px 0 #0369a1,
    0 5px 10px rgba(0, 0, 0, 0.95),
    0 0 32px rgba(0, 242, 254, 0.95) !important;
}

/* Light mode 3D letter extrusion */
html[data-resolved-theme="light"] .platformer-3d-glyph {
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85),
    0 2px 0 #cbd5e1,
    0 3px 0 #94a3b8,
    0 4px 0 #64748b,
    0 5px 0 #475569,
    0 6px 8px rgba(0, 0, 0, 0.25) !important;
}

html[data-resolved-theme="light"] .platformer-3d-glyph.platformer-standing-on,
html[data-resolved-theme="light"] .platformer-3d-glyph.is-stepped-on {
  text-shadow:
    0 1px 0 #0284c7,
    0 2px 3px rgba(0, 0, 0, 0.35) !important;
}

html[data-resolved-theme="light"] #hero-compiled .platformer-3d-glyph,
html[data-theme="light"] #hero-compiled .platformer-3d-glyph {
  color: #0284c7 !important;
  -webkit-text-fill-color: #0284c7 !important;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85),
    0 2px 0 #38bdf8,
    0 3px 0 #0284c7,
    0 4px 0 #0369a1,
    0 5px 8px rgba(2, 132, 199, 0.35) !important;
}

/* True 3D Extruded UI Blocks (Buttons, Cards, Links) */
.platformer-3d-ui-block {
  transform: translateZ(8px) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08),
    0 3px 0 rgba(0, 0, 0, 0.4),
    0 6px 16px rgba(0, 0, 0, 0.5) !important;
  transition: transform 0.12s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.12s ease !important;
  will-change: transform, box-shadow;
}

/* Tactile 3D Step Depression when Character stands on the UI Block */
.platformer-3d-ui-block.platformer-standing-on,
.platformer-3d-ui-block.is-stepped-on {
  transform: translateY(2px) scale(0.995) !important;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.4),
    0 0 14px rgba(0, 242, 254, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
  outline: none !important;
}

/* Fallback for unwrapped headings */
.hero-line.platformer-standing-on,
.hero-line-inner.platformer-standing-on,
.hero-title.platformer-standing-on,
.deploy-title.platformer-standing-on,
h1.platformer-standing-on,
h2.platformer-standing-on,
h3.platformer-standing-on,
p.platformer-standing-on {
  outline: none !important;
  box-shadow: none !important;
  transform: translateY(2px) !important;
  text-shadow: 0 1px 0 rgba(0, 242, 254, 0.7), 0 2px 0 rgba(0, 180, 216, 0.5), 0 3px 0 rgba(0, 119, 182, 0.35), 0 5px 14px rgba(0, 242, 254, 0.5) !important;
  transition: transform 0.08s ease, text-shadow 0.12s ease !important;
}

a.platformer-standing-on {
  outline: none !important;
  box-shadow: 0 2px 0 rgba(56, 189, 248, 0.5), 0 4px 18px rgba(56, 189, 248, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
  transform: translateY(2px) !important;
}

button.platformer-standing-on,
.btn.platformer-standing-on {
  outline: none !important;
  box-shadow: 0 2px 0 rgba(255, 215, 0, 0.5), 0 4px 18px rgba(255, 215, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
  transform: translateY(2px) !important;
}

/* Kinetic DOM Collision Pulse when Smashed Enemies Impact DOM Elements */
.platformer-kinetic-pulse {
  outline: 2px solid rgba(0, 242, 254, 0.9) !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 26px rgba(0, 242, 254, 0.7), inset 0 0 14px rgba(0, 242, 254, 0.45) !important;
  transform: translateY(2px) scale(0.99) !important;
  transition: transform 0.08s ease-out, box-shadow 0.25s ease-out, outline 0.25s ease-out !important;
}

/* HUD System Codex Button & Brand Ticker */
.platformer-hud-codex-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  background: rgba(0, 242, 254, 0.12);
  border: 1px solid rgba(0, 242, 254, 0.4);
  border-radius: 9999px;
  color: #00f2fe;
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.platformer-hud-codex-btn:hover,
.platformer-hud-codex-btn:focus-visible {
  background: rgba(0, 242, 254, 0.24);
  border-color: #00f2fe;
  box-shadow: 0 0 14px rgba(0, 242, 254, 0.4);
  color: #ffffff;
  outline: none;
}

.hud-codex-count {
  font-size: 0.6rem;
  color: #ffd700;
}

.platformer-hud-brand-ticker {
  font-size: 0.62rem;
  color: #94a3b8;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.55rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.2s ease;
}

@media (max-width: 900px) {
  .platformer-hud-brand-ticker {
    display: none;
  }
}

/* Dynamic Crowd Reaction HUD Toast */
.platformer-hud-crowd {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.55rem;
  background: rgba(0, 242, 254, 0.12);
  border: 1px solid rgba(0, 242, 254, 0.4);
  border-radius: 9999px;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateY(-4px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.platformer-hud-crowd:not(.is-active) {
  display: none !important;
}

.platformer-hud-crowd.is-active {
  display: inline-flex;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.platformer-hud-crowd.type-cheer {
  background: rgba(255, 215, 0, 0.18);
  border-color: #ffd700;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.35);
}

.platformer-hud-crowd.type-cheer .platformer-crowd-text {
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

.platformer-hud-crowd.type-gasp {
  background: rgba(168, 85, 247, 0.18);
  border-color: #a855f7;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.35);
}

.platformer-hud-crowd.type-gasp .platformer-crowd-text {
  color: #c084fc;
}

.platformer-hud-crowd.type-woah {
  background: rgba(0, 242, 254, 0.22);
  border-color: #00f2fe;
  box-shadow: 0 0 14px rgba(0, 242, 254, 0.45);
}

.platformer-hud-crowd.type-woah .platformer-crowd-text {
  color: #00f2fe;
  text-shadow: 0 0 8px rgba(0, 242, 254, 0.6);
}

.platformer-hud-crowd.type-chant {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.45);
}

.platformer-hud-crowd.type-chant .platformer-crowd-text {
  color: #38bdf8;
  letter-spacing: 0.08em;
}

.platformer-hud-crowd.type-disappoint {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
}

.platformer-hud-crowd.type-disappoint .platformer-crowd-text {
  color: #f87171;
}

.platformer-crowd-tag {
  font-size: 0.58rem;
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.platformer-crowd-text {
  font-weight: 800;
}

@media (max-width: 768px) {
  .platformer-hud-crowd {
    font-size: 0.58rem;
    padding: 0.12rem 0.42rem;
    flex-shrink: 0;
  }
  .platformer-hud-crowd:not(.is-active) {
    display: none !important;
  }
}

/* Ambient Product Telemetry Card */
.platformer-product-inspect {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 99994;
  max-width: 380px;
  width: calc(100vw - 48px);
  background: rgba(4, 11, 26, 0.94);
  border: 1px solid rgba(0, 242, 254, 0.35);
  border-radius: 14px;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.7), 0 0 28px rgba(0, 242, 254, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  padding: 0.85rem 1.1rem;
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  color: #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

/* Strict Invariant: Never display product inspect card in the DOM game per user mandate */
.platformer-product-inspect,
body:not(.prag-platformer-active) .platformer-product-inspect,
body.prag-platformer-active .platformer-product-inspect,
.platformer-product-inspect.is-visible,
.platformer-product-inspect.is-active,
.platformer-product-inspect.is-visible.is-active {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.product-inspect-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.product-inspect-dismiss {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.45);
  font-size: 11px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.product-inspect-dismiss:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.product-inspect-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.product-inspect-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.product-inspect-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #00f2fe;
  box-shadow: 0 0 8px #00f2fe;
  animation: platformer-pulse 1.8s infinite ease-in-out;
}

.product-inspect-tier {
  font-family: var(--font-mono, monospace);
  font-size: 0.6rem;
  font-weight: 700;
  color: #ffd700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.product-inspect-verified {
  font-family: var(--font-mono, monospace);
  font-size: 0.56rem;
  font-weight: 600;
  color: #10b981;
  letter-spacing: 0.04em;
}

.product-inspect-body {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.product-inspect-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.02em;
  margin: 0;
  line-height: 1.25;
}

.product-inspect-desc {
  font-size: 0.72rem;
  color: #cbd5e1;
  line-height: 1.4;
  margin: 0;
}

.product-inspect-tech {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.15rem;
}

.tech-tag {
  font-family: var(--font-mono, monospace);
  font-size: 0.58rem;
  padding: 0.12rem 0.42rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  letter-spacing: 0.02em;
}

.product-inspect-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.15rem;
}

.product-inspect-prompt {
  font-family: var(--font-mono, monospace);
  font-size: 0.6rem;
  font-weight: 700;
  color: #00f2fe;
  letter-spacing: 0.06em;
}

.product-inspect-btn {
  background: rgba(0, 242, 254, 0.12);
  border: 1px solid rgba(0, 242, 254, 0.35);
  border-radius: 9999px;
  color: #00f2fe;
  font-family: var(--font-mono, monospace);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.22rem 0.65rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.product-inspect-btn:hover {
  background: #00f2fe;
  color: #040915;
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.4);
}

@media (max-width: 768px) {
  .platformer-product-inspect {
    bottom: 215px; /* Clear of mobile bottom touch controls */
    left: 14px;
    right: 14px;
    width: auto;
    max-width: none;
    padding: 0.45rem 0.8rem;
    border-radius: 12px;
    gap: 0.25rem;
  }
  .product-inspect-desc,
  .product-inspect-tech {
    display: none !important; /* Hide long paragraph & tags on mobile to keep screen clear */
  }
  .product-inspect-title {
    font-size: 0.85rem;
  }
  .product-inspect-footer {
    margin-top: 0;
  }
  .product-inspect-prompt {
    font-size: 0.55rem;
  }
  .product-inspect-btn {
    padding: 0.15rem 0.5rem;
    font-size: 0.58rem;
  }
}

/* Sovereign Product Architecture Codex Modal */
.platformer-codex-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s;
}

.platformer-codex-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.codex-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 4, 12, 0.88);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
}

.codex-sheet {
  position: relative;
  z-index: 1;
  width: 92%;
  max-width: 960px;
  max-height: 88vh;
  background: #040915;
  border: 1px solid rgba(0, 242, 254, 0.3);
  border-radius: 20px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.85), 0 0 32px rgba(0, 242, 254, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.96) translateY(12px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.platformer-codex-modal.is-open .codex-sheet {
  transform: scale(1) translateY(0);
}

.codex-header {
  padding: 1.2rem 1.6rem 0.9rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.codex-title-wrap {
  flex: 1;
  min-width: 0;
}

.codex-tag {
  font-family: var(--font-mono, monospace);
  font-size: 0.6rem;
  font-weight: 700;
  color: #00f2fe;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.codex-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
}

.codex-progress-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.codex-progress-bar {
  flex: 1;
  max-width: 240px;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
}

.codex-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #00f2fe 0%, #ffd700 100%);
  border-radius: 9999px;
  transition: width 0.4s ease;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.6);
}

.codex-progress-text {
  font-family: var(--font-mono, monospace);
  font-size: 0.65rem;
  color: #ffd700;
  font-weight: 700;
}

.codex-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.codex-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #ffffff;
  transform: rotate(90deg);
}

/* Brand Manifesto */
.codex-manifesto {
  padding: 0.75rem 1.6rem;
  background: rgba(0, 242, 254, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
}

.manifesto-label {
  font-family: var(--font-mono, monospace);
  font-size: 0.58rem;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.manifesto-body {
  font-size: 0.74rem;
  color: #94a3b8;
  font-style: italic;
  line-height: 1.4;
  margin: 0;
}

/* Filter Tabs */
.codex-filters {
  padding: 0.65rem 1.6rem;
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.codex-tab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  padding: 0.28rem 0.75rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.62rem;
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.codex-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.codex-tab.is-active {
  background: rgba(0, 242, 254, 0.15);
  border-color: #00f2fe;
  color: #00f2fe;
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.25);
}

/* Search Row */
.codex-search-row {
  padding: 0.65rem 1.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.codex-search-input {
  width: 100%;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-family: var(--font-mono, monospace);
  font-size: 0.7rem;
  outline: none;
  transition: all 0.2s ease;
}

.codex-search-input:focus {
  border-color: #00f2fe;
  background: rgba(0, 242, 254, 0.06);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.25);
}

/* Product Matrix Grid */
.codex-grid {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.6rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.85rem;
  min-height: 260px;
}

.codex-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.codex-card.is-unlocked {
  background: rgba(4, 16, 38, 0.65);
  border-color: rgba(0, 242, 254, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.codex-card.is-unlocked:hover {
  border-color: #00f2fe;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5), 0 0 18px rgba(0, 242, 254, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.codex-card.is-locked {
  opacity: 0.55;
  border-style: dashed;
}

.codex-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.codex-card-tier {
  font-family: var(--font-mono, monospace);
  font-size: 0.58rem;
  font-weight: 700;
  color: #ffd700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.codex-card-badge {
  font-family: var(--font-mono, monospace);
  font-size: 0.56rem;
  font-weight: 700;
  color: #10b981;
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.codex-card.is-locked .codex-card-badge {
  color: #64748b;
}

.codex-card-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.3rem;
  line-height: 1.3;
}

.codex-card-desc {
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1.4;
  margin: 0 0 0.65rem;
  flex: 1;
}

.codex-card-tech {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}

.codex-pill {
  font-family: var(--font-mono, monospace);
  font-size: 0.56rem;
  padding: 0.1rem 0.38rem;
  border-radius: 4px;
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.2);
  color: #38bdf8;
}

.codex-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.5rem;
  margin-top: auto;
}

.codex-card-invariant {
  font-family: var(--font-mono, monospace);
  font-size: 0.56rem;
  color: #10b981;
  font-weight: 600;
}

.codex-card-hint {
  font-family: var(--font-mono, monospace);
  font-size: 0.56rem;
  color: #64748b;
  font-style: italic;
}

.codex-card-link {
  font-family: var(--font-mono, monospace);
  font-size: 0.6rem;
  font-weight: 700;
  color: #00f2fe;
  text-decoration: none;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.3);
  transition: all 0.2s ease;
}

.codex-card-link:hover {
  background: #00f2fe;
  color: #040915;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.4);
}

.codex-empty {
  grid-column: 1 / -1;
  padding: 2.5rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.codex-empty-title {
  font-family: var(--font-mono, monospace);
  font-size: 0.8rem;
  font-weight: 700;
  color: #cbd5e1;
  letter-spacing: 0.06em;
}

.codex-empty-sub {
  font-size: 0.72rem;
  color: #64748b;
}

@media (max-width: 768px) {
  .codex-sheet {
    width: 96%;
    max-height: 92vh;
    border-radius: 16px;
  }
  .codex-header {
    padding: 0.9rem 1.1rem 0.65rem;
  }
  .codex-title {
    font-size: 1.1rem;
    outline: none !important;
  }
  .codex-manifesto {
    padding: 0.45rem 1.1rem;
  }
  .manifesto-body {
    font-size: 0.68rem;
    line-height: 1.35;
  }
  .codex-filters {
    padding: 0.45rem 1.1rem;
    gap: 0.3rem;
  }
  .codex-tab {
    padding: 0.22rem 0.6rem;
    font-size: 0.58rem;
  }
  .codex-search-row {
    padding: 0.45rem 1.1rem;
  }
  .codex-grid {
    padding: 0.75rem 1.1rem;
    gap: 0.65rem;
  }
  .codex-card {
    padding: 0.75rem;
  }
  .codex-card-title {
    font-size: 0.88rem;
  }
  .codex-card-desc {
    font-size: 0.68rem;
  }
}

/* Platformer Character Hero Badge (Super Smash Bros Emblem) */
.platformer-hud-character {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9999px;
  padding: 3px 9px 3px 7px;
  cursor: pointer;
  color: #ffffff;
  font-family: var(--font-mono, monospace);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: none;
  overflow: hidden;
  white-space: nowrap;
}

#hud-character-name {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: none;
}

.platformer-hud-character:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(0, 242, 254, 0.55);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
  transform: translateY(-1px);
}

.platformer-char-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
  transition: background-color 0.2s ease;
}

/* Product Lead Hero Roster Selection Modal */
#prag-platformer-roster {
  --roster-accent: #38bdf8;
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse 74% 58% at 50% 24%, color-mix(in srgb, var(--roster-accent) 14%, rgba(6, 10, 20, 0.96)), rgba(2, 3, 7, 0.97) 72%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s;
  padding: 16px;
}

#prag-platformer-roster.is-launching {
  transition: opacity 0.20s ease, visibility 0.20s;
}
#prag-platformer-roster.is-launching .platformer-roster-sheet {
  transform: translate3d(0, -10px, 0) scale(1.045);
  opacity: 0;
  transition: transform 0.22s cubic-bezier(0.32, 0, 0.67, 0), opacity 0.18s ease;
}

body:has(#prag-platformer-roster.is-open) #prag-platformer-touch-controls {
  display: none !important;
}

#prag-platformer-roster.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.platformer-roster-sheet {
  width: min(1140px, 95vw);
  max-height: 88vh;
  max-height: min(90dvh, 720px);
  display: flex;
  flex-direction: column;
  background: #070910;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
  box-sizing: border-box;
}

.platformer-roster-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: rgba(11, 14, 22, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.platformer-roster-title-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.platformer-roster-title {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: #f8fafc;
  letter-spacing: -0.015em;
}

.platformer-roster-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.platformer-roster-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: #cbd5e1;
  min-width: 36px;
  min-height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.platformer-roster-close-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.roster-body-split {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(300px, 0.92fr);
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.roster-grid-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(9, 12, 20, 0.98) 0%, rgba(5, 7, 13, 0.98) 100%);
}

.platformer-roster-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: max-content;
  align-items: stretch;
  gap: 10px;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  flex: 1;
  min-height: 0;
  align-content: start;
}

.platformer-roster-card,
.roster-random-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 10px 6px 8px;
  min-height: 112px;
  height: auto;
  width: 100%;
  box-sizing: border-box;
  background: radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.055), rgba(11, 15, 24, 0.94) 76%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: #f8fafc;
  cursor: pointer;
  text-align: center;
  font: inherit;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.roster-random-tile {
  grid-column: span 2;
  justify-content: center;
  gap: 4px;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(15, 20, 32, 0.65);
}

.roster-rnd-glyph {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: #94a3b8;
  line-height: 1;
}

.platformer-roster-card:hover,
.platformer-roster-card.is-focused,
.roster-random-tile:hover {
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--card-color, #38bdf8) 18%, transparent), rgba(17, 23, 36, 0.98) 78%);
  border-color: var(--card-color, #38bdf8);
  transform: translateY(-2px);
}

.platformer-roster-card.is-active {
  border-color: var(--card-color, #38bdf8);
  box-shadow: inset 0 0 0 1px var(--card-color, #38bdf8);
}

.roster-tile-tags {
  position: absolute;
  top: 6px;
  left: 6px;
  display: flex;
  gap: 4px;
  z-index: 2;
}

.roster-tag-p1,
.roster-tag-p2 {
  font-family: ui-monospace, monospace;
  font-size: 0.58rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}
.roster-tag-p1 { background: #38bdf8; color: #030712; }
.roster-tag-p2 { background: #f43f5e; color: #ffffff; }

.roster-portrait-box {
  width: 74px;
  height: 74px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.roster-portrait-canvas {
  width: 74px;
  height: 74px;
  display: block;
}

.roster-tile-foot {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.roster-hero-name {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.74rem;
  font-weight: 600;
  color: #f1f5f9;
  line-height: 1.18;
}

.roster-key-hints {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 9px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(6, 8, 15, 0.92);
  font-family: ui-monospace, monospace;
  font-size: 0.66rem;
  color: #64748b;
}
.roster-key-hints kbd {
  display: inline-block;
  padding: 1px 5px;
  margin-right: 3px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.62rem;
}

.roster-spotlight-pane {
  --spot-color: #38bdf8;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 20px 18px;
  background: radial-gradient(circle at 50% 24%, color-mix(in srgb, var(--spot-color) 14%, transparent), #06080f 68%);
  min-height: 0;
  overflow-y: auto;
}

.roster-stage-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(10, 14, 24, 0.78) 0%, rgba(4, 6, 12, 0.94) 100%);
  overflow: hidden;
}

.roster-vs-strip {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(5, 8, 15, 0.86);
  font-family: ui-monospace, monospace;
  font-size: 0.68rem;
  font-weight: 600;
}
.roster-vs-strip .vs-p1 { color: #38bdf8; }
.roster-vs-strip .vs-sep { color: rgba(255, 255, 255, 0.35); text-transform: uppercase; font-size: 0.6rem; }
.roster-vs-strip .vs-p2 { color: #64748b; }
.roster-vs-strip .vs-p2.is-on { color: #fb7185; }

.roster-stage-canvas {
  width: 100%;
  max-width: 360px;
  height: auto;
  aspect-ratio: 360 / 220;
  display: block;
}

.roster-spot-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 14px 0 16px;
}

.roster-spot-eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: ui-monospace, monospace;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--spot-color);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.roster-spot-dot { color: rgba(255, 255, 255, 0.25); }

.roster-spot-name {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.roster-spot-sig {
  font-family: ui-monospace, monospace;
  font-size: 0.74rem;
  color: #cbd5e1;
  padding: 6px 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  align-self: flex-start;
}

.roster-spot-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.spot-stat {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: center;
  gap: 10px;
  font-family: ui-monospace, monospace;
  font-size: 0.68rem;
  color: #94a3b8;
}

.spot-bar {
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.spot-bar i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 99px;
  background: var(--spot-color);
  transform-origin: left center;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease;
}

.roster-stage-actions {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 10px;
}

.roster-preview-btn,
.roster-confirm-btn {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 9px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.roster-preview-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
}
.roster-preview-btn:hover { background: rgba(255, 255, 255, 0.11); }

.roster-confirm-btn {
  background: var(--spot-color);
  border: 1px solid var(--spot-color);
  color: #030712;
  font-weight: 700;
}
.roster-confirm-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ——— Match Sequence Countdown & Arena Narrator HUD ——— */
#prag-platformer-countdown {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 0;
  pointer-events: none;
  z-index: 2147483645;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.16s ease, visibility 0.16s ease;
}

#prag-platformer-countdown.is-active {
  opacity: 1;
  visibility: visible;
}

#prag-platformer-countdown .platformer-countdown-card {
  transform: scaleX(0.9) scaleY(0.95);
}

#prag-platformer-countdown.is-active .platformer-countdown-card {
  transform: scaleX(1) scaleY(1);
}

@keyframes countdown-num-pop {
  0% {
    transform: scale(1.6) translateY(-10px);
    opacity: 0;
    filter: blur(8px);
  }
  40% {
    transform: scale(0.95) translateY(0);
    opacity: 1;
    filter: blur(0px);
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
    filter: blur(0px);
  }
}

/* ——— $1,000 Sovereign Bounty Easter Egg Modal ——— */
.prag-easter-egg-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100060;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 7, 15, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 1rem;
  animation: prag-modal-fade-in 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.prag-easter-egg-card {
  position: relative;
  width: min(620px, 94vw);
  background: #080c14;
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 22px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.9), 0 0 45px rgba(245, 158, 11, 0.22);
  padding: 2rem 2.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  color: #e2e8f0;
  overflow: hidden;
}

.prag-easter-egg-glint {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, #f59e0b 50%, transparent 100%);
  box-shadow: 0 0 12px #f59e0b;
}

.prag-easter-egg-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.45rem;
}

.prag-easter-egg-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.2) 0%, rgba(8, 12, 20, 0.8) 100%);
  border: 1px solid rgba(245, 158, 11, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
  margin-bottom: 0.2rem;
}

.prag-easter-egg-badge {
  font-family: var(--font-mono, monospace);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #f59e0b;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.prag-easter-egg-title {
  margin: 0;
  font-family: var(--font-display, sans-serif);
  font-size: 1.65rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  text-shadow: 0 0 24px rgba(245, 158, 11, 0.4);
}

.prag-easter-egg-subtitle {
  margin: 0;
  font-size: 0.8rem;
  color: #94a3b8;
  max-width: 440px;
  line-height: 1.4;
}

.prag-easter-egg-telemetry {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 0.85rem;
}

.prag-easter-egg-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.prag-easter-egg-stat .stat-label {
  font-family: var(--font-mono, monospace);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #64748b;
  text-transform: uppercase;
}

.prag-easter-egg-stat .stat-val {
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
  font-weight: 700;
  color: #f8fafc;
}

.prag-easter-egg-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.prag-form-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.prag-form-row label {
  font-family: var(--font-mono, monospace);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #cbd5e1;
  text-transform: uppercase;
}

.prag-input-select,
.prag-input-text {
  background: #030712;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  color: #ffffff;
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.prag-input-select:focus,
.prag-input-text:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.prag-form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.4rem;
}

.prag-btn-gold {
  flex: 1.6;
  background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
  color: #030712;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.prag-btn-gold:hover:not(:disabled) {
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.45);
}

.prag-btn-gold:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  filter: grayscale(0.4);
}

.prag-btn-ghost {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.18s ease;
}

.prag-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.prag-btn-sm {
  padding: 0.2rem 0.5rem !important;
  font-size: 0.65rem !important;
}

.prag-easter-egg-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.prag-easter-egg-close:hover {
  color: #ffffff;
}

@keyframes prag-modal-fade-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ==========================================================================
   PragAuth Identity & Cloud Progress Sync HUD and Modal Styles
   ========================================================================== */

.platformer-hud-stat.platformer-hud-auth {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.1s ease;
}

.platformer-hud-stat.platformer-hud-auth:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.platformer-auth-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 6px #f59e0b;
  flex-shrink: 0;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

/* PragAuth Modal Banner & Badges */
.prag-auth-status-container {
  margin-bottom: 1.25rem;
}

.prag-auth-verified-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(48, 209, 88, 0.08);
  border: 1px solid rgba(48, 209, 88, 0.3);
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.08);
}

.prag-auth-verified-badge .verified-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.prag-auth-verified-badge .verified-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.prag-auth-verified-badge .verified-title {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #30d158;
}

.prag-auth-verified-badge .verified-email {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  color: #f1f5f9;
}

.prag-auth-notice-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.08);
}

.prag-auth-notice-banner .auth-notice-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.1rem;
  flex-shrink: 0;
}

.prag-auth-notice-banner .auth-notice-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.prag-auth-notice-banner .auth-notice-heading {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #f59e0b;
}

.prag-auth-notice-banner .auth-notice-desc {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 0.76rem;
  color: #94a3b8;
  line-height: 1.35;
}

.prag-btn-auth-signin {
  margin-top: 0.25rem;
  align-self: flex-start;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.5);
  border-radius: 4px;
  color: #fbbf24;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.prag-btn-auth-signin:hover {
  background: #f59e0b;
  color: #000000;
  border-color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}





/* ——— Talking Portrait Banter HUD (Avionics Codec) ——— */

.prag-talking-portrait-hud {
  position: fixed;
  top: 64px;
  left: 24px;
  bottom: auto;
  transform: translateY(-8px);
  width: min(380px, calc(100vw - 48px));
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  background: rgba(8, 14, 26, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.10);
  z-index: 99996;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease;
  user-select: none;
}

/* In active combat, anchor talking portrait at top-left (or upper-center on mobile) so it never collides with bottom controls or D-pad */
body.prag-platformer-active .prag-talking-portrait-hud {
  top: 64px !important;
  bottom: auto !important;
  left: 24px !important;
  z-index: 2147483645 !important;
}

body.prag-platformer-active:has(#platformer-hud-dock:not(.is-bottom-dock):not(.is-tucked)) .prag-talking-portrait-hud {
  top: 104px !important;
}

.prag-talking-portrait-hud.is-active {
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
  transform: translateY(0);
}

.prag-talking-portrait-hud.is-ghosted {
  opacity: 0.18 !important;
  pointer-events: none !important;
  transform: scale(0.98);
}

.prag-talking-portrait-hud .talking-portrait-close-btn {
  pointer-events: auto;
}

.talking-portrait-glint {
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
  pointer-events: none;
}

.talking-portrait-avatar-frame {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: #060911;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  transition: transform 0.15s ease, border-color 0.2s ease;
}

.talking-portrait-avatar-frame.is-speaking {
  animation: talking-avatar-pulse 0.4s infinite alternate ease-in-out;
  border-color: rgba(255, 255, 255, 0.40);
}

@keyframes talking-avatar-pulse {
  0%, 100% { border-color: rgba(255, 255, 255, 0.14); }
  50% { border-color: rgba(255, 255, 255, 0.40); }
}

.talking-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.talking-portrait-halo {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.talking-portrait-live-tag {
  display: none !important;
}

.talking-portrait-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.talking-portrait-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.talking-portrait-names {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.talking-portrait-title {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #f1f5f9;
  text-transform: uppercase;
}

.talking-portrait-division {
  display: none !important;
}

.talking-portrait-equalizer {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  padding: 0 2px;
}

.talking-portrait-equalizer .eq-bar {
  width: 2.5px;
  height: 3px;
  background: var(--speaker-accent, #38bdf8);
  border-radius: 1px;
  transition: height 0.1s ease;
}

.talking-portrait-equalizer.is-active .eq-1 { animation: eq-bounce 0.35s infinite ease-in-out 0.05s; }
.talking-portrait-equalizer.is-active .eq-2 { animation: eq-bounce 0.4s infinite ease-in-out 0.15s; }
.talking-portrait-equalizer.is-active .eq-3 { animation: eq-bounce 0.32s infinite ease-in-out 0.1s; }
.talking-portrait-equalizer.is-active .eq-4 { animation: eq-bounce 0.45s infinite ease-in-out 0.2s; }

@keyframes eq-bounce {
  0%, 100% { height: 3px; }
  50% { height: 12px; }
}

.talking-portrait-text {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #f1f5f9;
  min-height: 2em;
  word-break: break-word;
}

.talking-portrait-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.15rem;
}

.talking-portrait-hint {
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 0.62rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.talking-portrait-hint .hint-key {
  display: inline-block;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  font-weight: 700;
  font-size: 0.58rem;
}

.talking-portrait-counter {
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 0.62rem;
  color: #94a3b8;
  font-weight: 600;
}

.talking-portrait-close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  color: #94a3b8;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
}

.talking-portrait-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

@media (max-width: 820px), (hover: none) and (pointer: coarse), (pointer: coarse) {
  .prag-talking-portrait-hud,
  body.prag-platformer-active .prag-talking-portrait-hud,
  body.platformer-touch-active .prag-talking-portrait-hud,
  body:has(#prag-platformer-touch-controls.is-visible) .prag-talking-portrait-hud {
    top: max(56px, calc(env(safe-area-inset-top, 0px) + 52px)) !important;
    bottom: auto !important;
    left: 10px !important;
    right: 10px !important;
    width: calc(100vw - 20px) !important;
    max-width: 420px !important;
    margin: 0 auto !important;
    padding: 0.45rem 0.7rem !important;
    gap: 0.55rem !important;
    z-index: 2147483645 !important;
  }
  body.prag-platformer-active:has(#platformer-hud-dock:not(.is-bottom-dock):not(.is-tucked)) .prag-talking-portrait-hud {
    top: max(98px, calc(env(safe-area-inset-top, 0px) + 94px)) !important;
  }
  .talking-portrait-avatar-frame {
    width: 38px;
    height: 38px;
  }
  .talking-portrait-text {
    font-size: 0.72rem;
    min-height: 1.6em;
  }
}

/* Fleet-Wide PragChat & Floating Assistant Auto-Suppression in Game Mode */
body.prag-platformer-active #pragchat-hud,
body.prag-platformer-active #pragchat-agent-hud,
body.prag-platformer-active .pragchat-trigger-btn,
body.prag-platformer-active #pragchat-drawer {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
  display: none !important;
}

/* Cinematic Fatal Finisher Kill-Cam Vignette */
.platformer-fatal-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99998;
  background: radial-gradient(circle at center, transparent 25%, rgba(185, 28, 28, 0.45) 70%, rgba(15, 5, 10, 0.94) 100%);
  animation: fatalVignettePulse 0.3s ease-out infinite alternate;
}

@keyframes fatalVignettePulse {
  0% { opacity: 0.85; }
  100% { opacity: 1.0; }
}

/* Local 2-Player Versus / Co-op Mode Selector Badge */
.platformer-hud-mode {
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.platformer-hud-mode:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

.platformer-hud-mode.is-versus {
  border-color: rgba(244, 63, 94, 0.4);
  background: rgba(244, 63, 94, 0.1);
}

.platformer-hud-mode.is-versus .platformer-hud-val {
  color: #f43f5e;
}

.platformer-hud-mode.is-coop {
  border-color: rgba(48, 209, 88, 0.4);
  background: rgba(48, 209, 88, 0.1);
}

.platformer-hud-mode.is-coop .platformer-hud-val {
  color: #30d158;
}

/* Player 2 Super Smash Bros Battle Placard (Bottom-Right) */
.platformer-hud-p2 {
  position: fixed;
  bottom: 16px;
  right: 24px;
  z-index: 99995;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 8px 14px 8px 10px;
  background: rgba(26, 8, 14, 0.92);
  border: 1px solid rgba(244, 63, 94, 0.45);
  border-radius: 18px;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 20px rgba(244, 63, 94, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.20);
  box-sizing: border-box;
  flex-shrink: 0;
  pointer-events: auto;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.platformer-hud-p2:hover {
  border-color: rgba(244, 63, 94, 0.75);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.82), 0 0 24px rgba(244, 63, 94, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.platformer-hud-p2 .platformer-hud-val {
  font-family: var(--font-display, -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif);
  font-size: 2.15rem;
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.04em;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(244, 63, 94, 0.45), 0 0 2px rgba(0, 0, 0, 0.8);
}

.platformer-hud-p2-join {
  position: fixed;
  bottom: 20px;
  right: 24px;
  z-index: 99995;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(244, 63, 94, 0.16);
  border: 1px solid rgba(244, 63, 94, 0.55);
  border-radius: 9999px;
  padding: 0.32rem 0.8rem;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", monospace;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fda4af;
  letter-spacing: 0.06em;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 12px rgba(244, 63, 94, 0.25);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.platformer-hud-dock .platformer-hud-p2-join {
  position: static !important;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(155deg, rgba(24, 10, 16, 0.92) 0%, rgba(7, 5, 11, 0.96) 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: 2.5px solid #f43f5e;
  border-radius: 4px;
  padding: 6px 14px 6px 12px;
  transform: skewX(-10deg);
  font-family: var(--font-display, -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif);
  color: #f8fafc;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.platformer-hud-dock .platformer-hud-p2-join > * {
  transform: skewX(10deg);
}

.p2-join-badge {
  font-size: 0.72rem;
  font-weight: 900;
  font-style: italic;
  color: #fda4af;
  letter-spacing: 0.04em;
}

.p2-join-copy {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
  gap: 2px;
}

.p2-join-label {
  font-size: 0.50rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(248, 250, 252, 0.78);
}

.platformer-hud-p2-join:hover {
  background: rgba(244, 63, 94, 0.24);
  border-color: rgba(244, 63, 94, 0.75);
  color: #ffffff;
  transform: skewX(-10deg) translateY(-1px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.72);
}

.platformer-p2-join-pip {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f43f5e;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
  animation: platformer-p2-pip-pulse 1.6s ease-in-out infinite;
}

@keyframes platformer-p2-pip-pulse {
  0%, 100% { opacity: 0.45; transform: skewX(10deg) scale(0.88); }
  50% { opacity: 1; transform: skewX(10deg) scale(1.25); }
}

.p2-join-hotkey {
  font-size: 0.48rem;
  color: rgba(253, 164, 175, 0.68);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.platformer-hud-p2-leave {
  background: none;
  border: 1px solid rgba(244, 63, 94, 0.35);
  border-radius: 4px;
  color: #fda4af;
  font-size: 0.58rem;
  font-family: monospace;
  padding: 1px 4px;
  cursor: pointer;
  margin-left: 4px;
  transition: all 0.12s ease;
}

.platformer-hud-p2-leave:hover {
  background: #f43f5e;
  color: #ffffff;
}

.platformer-hud-dock .platformer-hud-p2 {
  position: static !important;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(155deg, rgba(26, 9, 16, 0.94) 0%, rgba(8, 5, 11, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom: 2.5px solid #f43f5e;
  border-radius: 4px;
  padding: 6px 14px 6px 12px;
  transform: skewX(-10deg);
  font-size: 0.66rem;
  font-weight: 800;
  color: #fda4af;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.platformer-hud-dock .platformer-hud-p2 > * {
  transform: skewX(10deg);
}

.platformer-hud-dock .platformer-hud-p2 .platformer-hud-val {
  font-family: var(--font-display, -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif);
  font-size: 1.75rem;
  font-weight: 900;
  font-style: italic;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.92);
}

.platformer-p2-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f43f5e;
  border: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}

.platformer-hud-p2-stocks {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 2px;
}

.platformer-hud-p2-stocks .platformer-stock-icon {
  color: #f43f5e;
}

/* Roster Player Tabs & P2 Controls */
.platformer-roster-player-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.platformer-roster-tab {
  padding: 5px 11px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.76rem;
  font-weight: 500;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #94a3b8;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.platformer-roster-tab#tab-p1-select.is-active {
  background: rgba(56, 189, 248, 0.16);
  color: #e0f2fe;
}

.platformer-roster-tab#tab-p2-select.is-active {
  background: rgba(244, 63, 94, 0.18);
  color: #ffe4e6;
}

.platformer-roster-layer-selector {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.roster-layer-btn {
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #94a3b8;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.74rem;
  font-weight: 500;
  padding: 5px 10px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.roster-layer-btn:hover {
  color: #f8fafc;
}

.roster-layer-btn.is-active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.platformer-hud-layer.is-hd #hud-layer-val {
  color: #38bdf8;
}

.platformer-roster-p2-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: rgba(244, 63, 94, 0.05);
  border-bottom: 1px solid rgba(244, 63, 94, 0.18);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.74rem;
}

.roster-p2-pill-tag {
  color: #fda4af;
  font-weight: 600;
}

.roster-p2-type-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #e2e8f0;
  font-size: 0.72rem;
  padding: 4px 10px;
  cursor: pointer;
}

.roster-p2-type-btn.is-active {
  background: rgba(244, 63, 94, 0.22);
  border-color: #f43f5e;
  color: #ffffff;
}

.roster-p2-ai-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #fda4af;
}

.roster-ai-select {
  background: #0b0e16;
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #f1f5f9;
  font-size: 0.72rem;
  border-radius: 5px;
  padding: 2px 6px;
}

.platformer-roster-card.is-active-p2 {
  border-color: #f43f5e !important;
  box-shadow: inset 0 0 0 1px #f43f5e !important;
}

.platformer-roster-card.is-active-p2 .roster-deploy-btn {
  background: #f43f5e !important;
  border-color: #f43f5e !important;
  color: #ffffff !important;
}

/* Portrait tablet & mobile stacked layout (strictly when viewport is tall enough) */
@media (max-width: 860px) and (min-height: 501px) {
  .roster-body-split {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }
  .roster-grid-pane {
    order: 2;
    border-right: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 0;
    overflow: hidden;
  }
  .roster-spotlight-pane {
    order: 1;
    display: grid;
    grid-template-columns: 152px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 14px;
    row-gap: 10px;
    align-items: center;
    padding: 12px 14px;
    overflow: visible;
    flex-shrink: 0;
  }
  .roster-stage-wrap {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
  }
  .roster-stage-canvas {
    max-width: 100%;
    max-height: 104px;
    width: auto;
    margin: 0 auto;
  }
  .roster-vs-strip {
    flex-wrap: wrap;
    gap: 2px 5px;
    padding: 4px 6px;
    font-size: 0.6rem;
    line-height: 1.2;
    text-align: center;
  }
  .roster-spot-meta {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    gap: 4px;
    min-width: 0;
  }
  .roster-spot-eyebrow {
    font-size: 0.62rem;
    flex-wrap: wrap;
  }
  .roster-spot-name {
    font-size: 1.18rem;
  }
  .roster-spot-sig {
    font-size: 0.68rem;
    padding: 4px 8px;
    max-width: 100%;
    white-space: normal;
  }
  .roster-spot-stats {
    gap: 5px;
    margin-top: 4px;
  }
  .spot-stat {
    grid-template-columns: 46px 1fr;
    gap: 8px;
    font-size: 0.62rem;
  }
  .roster-stage-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    gap: 8px;
  }
  .platformer-roster-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: max-content;
    padding: 10px 12px 14px;
    gap: 8px;
  }
  .platformer-roster-card,
  .roster-random-tile {
    min-height: max-content;
    padding: 8px 6px 7px;
    gap: 4px;
  }
  .roster-portrait-box,
  .roster-portrait-canvas {
    width: 56px;
    height: 56px;
  }
  .roster-random-tile {
    grid-column: span 3;
  }
  .roster-key-hints {
    display: none;
  }
}

@media (max-width: 640px) and (min-height: 501px) {
  #prag-platformer-roster {
    padding: max(6px, env(safe-area-inset-top)) 6px max(6px, env(safe-area-inset-bottom));
  }
  .platformer-roster-sheet {
    width: 100%;
    max-height: 96vh;
    max-height: 96dvh;
    border-radius: 12px;
  }
  .platformer-roster-header {
    padding: 8px 10px;
    gap: 6px;
    flex-wrap: nowrap;
  }
  .platformer-roster-title {
    display: none;
  }
  .platformer-roster-title-wrap,
  .platformer-roster-controls {
    gap: 6px;
    min-width: 0;
  }
  .platformer-roster-p2-toolbar {
    flex-wrap: wrap;
    padding: 6px 10px;
    gap: 6px;
  }
  .roster-layer-btn, .platformer-roster-tab, .platformer-roster-close-btn {
    min-height: 40px;
    padding-inline: 9px;
    font-size: 0.72rem;
  }
  .roster-spotlight-pane {
    grid-template-columns: 122px minmax(0, 1fr);
    column-gap: 10px;
    row-gap: 8px;
    padding: 10px;
  }
  .roster-stage-canvas {
    max-height: 86px;
  }
  .roster-spot-name {
    font-size: 1.05rem;
  }
  .roster-spot-sig {
    font-size: 0.64rem;
    padding: 3px 6px;
  }
  .roster-preview-btn,
  .roster-confirm-btn {
    min-height: 44px;
    padding: 0 10px;
    font-size: 0.8rem;
  }
  .platformer-roster-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: max-content;
    padding: 8px 10px 12px;
    gap: 8px;
  }
  .roster-portrait-box,
  .roster-portrait-canvas {
    width: 50px;
    height: 50px;
  }
  .roster-hero-name {
    font-size: 0.7rem;
  }
  .roster-random-tile {
    grid-column: span 2;
  }
}

/* Landscape phones & short viewports: keep side-by-side split with compact stage */
@media (max-height: 500px) {
  #prag-platformer-roster {
    padding: 6px 10px;
  }
  .platformer-roster-sheet {
    width: min(980px, 98vw);
    max-height: 96vh;
    max-height: 96dvh;
  }
  .platformer-roster-header {
    padding: 6px 12px;
    gap: 8px;
  }
  .platformer-roster-title {
    font-size: 0.9rem;
  }
  .platformer-roster-p2-toolbar {
    padding: 5px 12px;
    gap: 6px;
  }
  .roster-body-split {
    grid-template-columns: minmax(0, 1.25fr) minmax(250px, 0.95fr);
    grid-template-rows: minmax(0, 1fr);
    overflow: hidden;
  }
  .roster-grid-pane {
    order: 1;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-top: none;
  }
  .platformer-roster-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: max-content;
    padding: 8px;
    gap: 6px;
  }
  .platformer-roster-card,
  .roster-random-tile {
    min-height: max-content;
    padding: 6px 4px 5px;
    gap: 3px;
  }
  .roster-random-tile {
    grid-column: span 3;
  }
  .roster-portrait-box,
  .roster-portrait-canvas {
    width: 44px;
    height: 44px;
  }
  .roster-hero-name {
    font-size: 0.66rem;
  }
  .roster-key-hints {
    display: none;
  }
  .roster-spotlight-pane {
    order: 2;
    padding: 8px 12px;
    gap: 6px;
    overflow-y: auto;
  }
  .roster-stage-canvas {
    width: auto;
    max-width: 100%;
    max-height: 112px;
    margin: 0 auto;
  }
  .roster-vs-strip {
    padding: 4px 8px;
    font-size: 0.62rem;
  }
  .roster-spot-meta {
    margin: 2px 0;
    gap: 3px;
  }
  .roster-spot-name {
    font-size: 1.05rem;
  }
  .roster-spot-sig {
    font-size: 0.64rem;
    padding: 3px 7px;
  }
  .roster-spot-stats {
    display: none;
  }
  .roster-preview-btn,
  .roster-confirm-btn {
    min-height: 38px;
    padding: 0 10px;
    font-size: 0.78rem;
  }
}

/* Dynamic Stage Hazard Elements */
.stage-hazard-ledger {
  filter: drop-shadow(0 4px 12px rgba(255, 215, 0, 0.35));
}

.stage-hazard-vortex {
  animation: vortexSpin 4s linear infinite;
}

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

.stage-hazard-surge {
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.6), inset 0 0 16px rgba(239, 68, 68, 0.4);
}

/* Stage Selection Drawer & HUD Stat */
.platformer-hud-stage {
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.platformer-hud-stage:hover {
  border-color: rgba(0, 242, 254, 0.5);
  background: rgba(0, 242, 254, 0.08);
}

.platformer-hud-challenge {
  cursor: pointer;
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.08);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.platformer-hud-challenge:hover {
  border-color: rgba(245, 158, 11, 0.7);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}

.platformer-hud-challenge .platformer-hud-val {
  color: #f59e0b;
}

.platformer-hud-quest {
  cursor: pointer;
  border-color: rgba(48, 209, 88, 0.4);
  background: rgba(48, 209, 88, 0.08);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.platformer-hud-quest:hover {
  border-color: rgba(48, 209, 88, 0.7);
  box-shadow: 0 0 12px rgba(48, 209, 88, 0.25);
}

.platformer-hud-quest .platformer-hud-val {
  color: #30d158;
}

.platformer-hud-debug {
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.platformer-hud-debug:hover {
  border-color: rgba(255, 255, 255, 0.35);
}

.platformer-hud-music {
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.platformer-hud-music:hover {
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.platformer-hud-music.is-playing {
  border-color: rgba(56, 189, 248, 0.65);
  background: rgba(56, 189, 248, 0.1);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.platformer-hud-music.is-playing .platformer-hud-val {
  color: #38bdf8;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

.platformer-hud-gamepad {
  color: #30d158;
  border-color: rgba(48, 209, 88, 0.35);
  background: rgba(48, 209, 88, 0.06);
}

.platformer-stage-drawer-overlay,
.platformer-challenge-modal-overlay,
.platformer-quest-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  background: rgba(4, 11, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.platformer-stage-drawer-overlay.is-open,
.platformer-challenge-modal-overlay.is-open,
.platformer-quest-modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.platformer-modal-card {
  width: 90%;
  max-width: 520px;
  background: rgba(8, 18, 38, 0.95);
  border: 1px solid rgba(0, 242, 254, 0.35);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 32px rgba(0, 242, 254, 0.15);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  color: #f1f5f9;
}

.stage-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.stage-select-tile {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0.8rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}

.stage-select-tile:hover {
  border-color: #00f2fe;
  background: rgba(0, 242, 254, 0.08);
  transform: translateY(-2px);
}

.stage-select-tile.is-active {
  border-color: #00f2fe;
  background: rgba(0, 242, 254, 0.14);
  box-shadow: 0 0 14px rgba(0, 242, 254, 0.25);
}

.stage-tile-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #f1f5f9;
}

.stage-tile-desc {
  font-size: 0.62rem;
  color: #94a3b8;
  line-height: 1.25;
}

.challenge-url-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
}

.challenge-url-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #00f2fe;
  font-family: monospace;
  font-size: 0.72rem;
  outline: none;
}

/* ——— Boss Battle Cinema Header ——— */
.platformer-hud-boss-bar,
#hud-boss-bar {
  position: fixed !important;
  top: 62px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 99996 !important;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(155deg, rgba(16, 7, 13, 0.94) 0%, rgba(6, 4, 10, 0.98) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-bottom: 2.5px solid #f43f5e !important;
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-radius: 3px;
  padding: 6px 22px;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.82), inset 0 1px 0 rgba(255, 255, 255, 0.16) !important;
  box-sizing: border-box;
  pointer-events: auto !important;
  width: max-content !important;
  min-width: min(440px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  height: 36px !important;
  transition: top 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, background 0.2s ease;
}

#platformer-hud-dock.is-tucked ~ #hud-boss-bar,
.platformer-hud-dock.is-tucked #hud-boss-bar {
  top: 58px !important;
}

.platformer-hud-boss-bar[style*="display: none"],
#hud-boss-bar[style*="display: none"],
.platformer-hud-boss-bar[style*="display:none"],
#hud-boss-bar[style*="display:none"] {
  display: none !important;
}

@keyframes platformer-boss-pulse {
  0%, 100% {
    border-color: rgba(255, 255, 255, 0.12);
  }
  50% {
    border-color: rgba(255, 255, 255, 0.25);
  }
}

.boss-bar-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  white-space: nowrap !important;
}

.boss-bar-tag {
  font-family: var(--font-mono, monospace);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.10em;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  text-transform: uppercase;
  white-space: nowrap;
}

.boss-bar-name {
  font-family: var(--font-display, sans-serif);
  font-size: 0.74rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.03em;
  white-space: nowrap !important;
}

.boss-bar-phase {
  display: inline-flex;
  align-items: center;
  white-space: nowrap !important;
  flex-shrink: 0;
  font-family: var(--font-mono, monospace);
  font-size: 0.62rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.boss-bar-phase.is-overclock {
  color: #f59e0b;
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
  animation: platformer-shake 0.2s infinite ease-in-out;
}

.boss-bar-phase.is-defeated {
  color: #30d158;
  text-shadow: 0 0 8px rgba(48, 209, 88, 0.6);
}

.boss-bar-center {
  flex: 1;
  min-width: 140px;
  max-width: 220px;
}

.boss-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(244, 63, 94, 0.45);
  border-radius: 2px;
  transform: skewX(-12deg);
  overflow: hidden;
  position: relative;
}

.boss-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ef4444 0%, #f59e0b 55%, #00f2fe 100%);
  border-radius: 1px;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.55);
}

.boss-bar-right {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  white-space: nowrap;
}

.boss-bar-stocks {
  display: flex;
  align-items: center;
  gap: 4px;
}

.boss-stock-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid rgba(239, 68, 68, 0.4);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.boss-stock-dot.is-active {
  background: #ef4444;
  border-color: #f87171;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.boss-stock-dot.is-lost {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  opacity: 0.3;
}

.boss-bar-damage {
  font-family: var(--font-mono, monospace);
  font-size: 0.7rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .platformer-hud-boss-bar,
  #hud-boss-bar {
    top: max(48px, calc(env(safe-area-inset-top, 0px) + 46px)) !important;
    padding: 4px 10px !important;
    gap: 6px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: calc(100vw - 16px) !important;
    height: auto !important;
    flex-wrap: wrap;
    justify-content: center;
  }
  #platformer-hud-dock.is-bottom-dock ~ #hud-boss-bar,
  #platformer-hud-dock.is-tucked ~ #hud-boss-bar,
  .platformer-hud-dock.is-tucked #hud-boss-bar {
    top: max(12px, calc(env(safe-area-inset-top, 0px) + 10px)) !important;
  }
  .boss-bar-name {
    font-size: 0.64rem !important;
    max-width: none !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
  }
  .boss-bar-phase {
    font-size: 0.56rem !important;
    letter-spacing: 0.04em !important;
  }
  .boss-bar-center {
    min-width: 48px !important;
    max-width: 82px !important;
  }
  .boss-bar-damage {
    font-size: 0.62rem !important;
  }
}

/* ——— Victory Modal Combat Grade Ranking & Apex Bonus Styles ——— */
.platformer-victory-grade-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 1.25rem 0 1.5rem;
  padding: 0.85rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
}

.platformer-victory-grade {
  font-family: var(--font-display, sans-serif);
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1;
  padding: 4px 18px;
  border-radius: 12px;
  text-shadow: 0 0 20px currentColor;
  letter-spacing: -0.05em;
}

.platformer-victory-grade.grade-s {
  color: #ffd700;
  background: rgba(255, 215, 0, 0.12);
  border: 2px solid rgba(255, 215, 0, 0.5);
  box-shadow: 0 0 24px rgba(255, 215, 0, 0.4);
}

.platformer-victory-grade.grade-a {
  color: #00f2fe;
  background: rgba(0, 242, 254, 0.12);
  border: 2px solid rgba(0, 242, 254, 0.5);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.35);
}

.platformer-victory-grade.grade-b {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.25);
}

.platformer-victory-grade.grade-c {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.platformer-grade-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.platformer-grade-tag {
  font-family: var(--font-mono, monospace);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #94a3b8;
  text-transform: uppercase;
}

.platformer-grade-title {
  font-family: var(--font-display, sans-serif);
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
}

/* ==========================================================================
   Controller Mapping Customization UI & Gamepad Diagnostic Stage
   ========================================================================== */

.platformer-hud-controller {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.platformer-hud-controller:hover,
.platformer-hud-controller:focus-visible {
  border-color: rgba(0, 242, 254, 0.6);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.25);
  transform: translateY(-1px);
}

.platformer-controller-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s;
  padding: 1.25rem;
  box-sizing: border-box;
}

.platformer-controller-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.controller-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 18, 0.65);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
}

.controller-modal-sheet {
  position: relative;
  z-index: 1;
  width: min(880px, 96vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: rgba(8, 14, 26, 0.58);
  backdrop-filter: blur(36px) saturate(200%);
  -webkit-backdrop-filter: blur(36px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  overflow: hidden;
  color: #f1f5f9;
  font-family: var(--font-mono, ui-monospace, monospace);
  animation: controller-modal-enter 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes controller-modal-enter {
  0% { transform: scale(0.94) translateY(16px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.controller-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.5rem 1.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 14, 30, 0.7);
}

.controller-modal-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.controller-modal-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #00f2fe;
  text-transform: uppercase;
}

.controller-modal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00f2fe;
  box-shadow: 0 0 8px #00f2fe;
}

.controller-modal-title {
  font-family: var(--font-display, sans-serif);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0;
  color: #ffffff;
}

.controller-modal-sub {
  font-size: 0.75rem;
  color: #94a3b8;
  margin: 0;
  letter-spacing: 0.02em;
}

.controller-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
}

.controller-modal-close:hover,
.controller-modal-close:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(0, 242, 254, 0.5);
  transform: scale(1.05);
}

/* Tab Navigation Bar */
.controller-tab-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.75rem;
  background: rgba(4, 9, 20, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow-x: auto;
}

.controller-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border-radius: 9999px;
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  font-family: var(--font-mono, monospace);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.controller-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.controller-tab-btn.is-active {
  color: #00f2fe;
  background: rgba(0, 242, 254, 0.12);
  border-color: rgba(0, 242, 254, 0.35);
  box-shadow: 0 0 14px rgba(0, 242, 254, 0.2);
}

/* Tab Body Container */
.controller-tab-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.75rem;
  max-height: 52vh;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.controller-status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  font-size: 0.72rem;
  margin-bottom: 0.5rem;
}

.controller-status-banner.is-connected {
  border-color: rgba(48, 209, 88, 0.4);
  background: rgba(48, 209, 88, 0.08);
}

.controller-status-banner.is-disconnected {
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.08);
}

.controller-status-left {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.controller-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
}

.controller-status-dot.is-active {
  background: #30d158;
  box-shadow: 0 0 8px #30d158;
}

/* Binding Table & Rows */
.controller-binding-table {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.controller-binding-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
  background: rgba(10, 16, 32, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  transition: all 0.15s ease;
}

.controller-binding-row:hover {
  background: rgba(14, 22, 44, 0.8);
  border-color: rgba(255, 255, 255, 0.12);
}

.controller-binding-row.is-active {
  background: rgba(0, 242, 254, 0.12) !important;
  border-color: rgba(0, 242, 254, 0.4) !important;
}

.controller-binding-row.is-active .controller-action-name {
  color: #00f2fe !important;
}

.controller-binding-row.is-active .controller-chip,
.controller-chip.is-active,
.controller-chip.is-pressed {
  background: rgba(0, 242, 254, 0.35) !important;
  border-color: #00f2fe !important;
  color: #ffffff !important;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.5) !important;
  transform: translateY(1px);
}

.controller-binding-row.is-listening {
  border-color: #00f2fe !important;
  background: rgba(0, 242, 254, 0.14) !important;
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.3);
  animation: controller-row-pulse 1.2s infinite alternate;
}

@keyframes controller-row-pulse {
  0% { border-color: rgba(0, 242, 254, 0.4); box-shadow: 0 0 10px rgba(0, 242, 254, 0.2); }
  100% { border-color: rgba(0, 242, 254, 0.9); box-shadow: 0 0 24px rgba(0, 242, 254, 0.45); }
}

.controller-action-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 220px;
}

.controller-action-cat {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  text-transform: uppercase;
}

.controller-action-cat.combat { color: #f43f5e; background: rgba(244, 63, 94, 0.12); }
.controller-action-cat.defense { color: #00f2fe; background: rgba(0, 242, 254, 0.12); }
.controller-action-cat.movement { color: #38bdf8; background: rgba(56, 189, 248, 0.12); }
.controller-action-cat.system { color: #a855f7; background: rgba(168, 85, 247, 0.12); }

.controller-action-name {
  font-size: 0.76rem;
  font-weight: 700;
  color: #e2e8f0;
}

.controller-chips-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  flex: 1;
  padding: 0 0.75rem;
}

.controller-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.55rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(0, 242, 254, 0.3);
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #00f2fe;
  letter-spacing: 0.04em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.controller-chip-remove {
  cursor: pointer;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.controller-chip-remove:hover {
  color: #ef4444;
}

.controller-row-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.controller-rebind-btn {
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-family: var(--font-mono, monospace);
  font-size: 0.66rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.controller-rebind-btn:hover {
  background: rgba(0, 242, 254, 0.18);
  border-color: rgba(0, 242, 254, 0.5);
  color: #00f2fe;
}

.controller-rebind-btn.is-listening {
  background: #00f2fe !important;
  border-color: #00f2fe !important;
  color: #040814 !important;
  font-weight: 800;
  animation: controller-listen-pulse 0.8s infinite alternate;
}

@keyframes controller-listen-pulse {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(1.04); opacity: 1; box-shadow: 0 0 16px rgba(0, 242, 254, 0.7); }
}

.controller-clear-btn {
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #64748b;
  font-family: var(--font-mono, monospace);
  font-size: 0.62rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.controller-clear-btn:hover {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
}

/* Presets Grid */
.controller-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 0.85rem;
}

.controller-preset-card {
  padding: 1.15rem;
  background: rgba(10, 16, 32, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.controller-preset-card:hover {
  background: rgba(14, 22, 44, 0.9);
  border-color: rgba(0, 242, 254, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.controller-preset-card.is-active {
  border-color: #00f2fe;
  background: rgba(0, 242, 254, 0.08);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.15);
}

.controller-preset-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.controller-preset-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 0.25rem;
}

.controller-preset-desc {
  font-size: 0.7rem;
  color: #94a3b8;
  line-height: 1.4;
  margin: 0;
}

.controller-preset-badges {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.controller-preset-btn {
  width: 100%;
  padding: 0.5rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-family: var(--font-mono, monospace);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.15s ease;
}

.controller-preset-btn:hover {
  background: rgba(0, 242, 254, 0.18);
  border-color: #00f2fe;
  color: #00f2fe;
}

.controller-preset-card.is-active .controller-preset-btn {
  background: rgba(48, 209, 88, 0.15);
  border-color: #30d158;
  color: #30d158;
  pointer-events: none;
}

/* Live Diagnostics Stage */
.controller-diag-box {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  padding: 0.5rem 0;
}

.controller-diag-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.controller-rumble-btn {
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  background: rgba(0, 242, 254, 0.12);
  border: 1px solid rgba(0, 242, 254, 0.35);
  color: #00f2fe;
  font-family: var(--font-mono, monospace);
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.controller-rumble-btn:hover {
  background: rgba(0, 242, 254, 0.25);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.3);
}

.controller-button-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.5rem;
}

.controller-btn-pip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.2rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #64748b;
  font-size: 0.62rem;
  font-weight: 700;
  transition: all 0.08s ease;
}

.controller-btn-pip.is-pressed,
.controller-btn-pip.is-active,
.controller-diag-btn-pip.is-pressed,
.controller-diag-btn-pip.is-active {
  background: rgba(0, 242, 254, 0.25) !important;
  border-color: #00f2fe !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(0, 242, 254, 0.5) !important;
  transform: scale(1.05);
}

.controller-sticks-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.controller-stick-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
}

.controller-stick-stage {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(2, 6, 18, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.controller-stick-pip {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #00f2fe;
  box-shadow: 0 0 10px #00f2fe;
  transform: translate(0px, 0px);
  transition: transform 0.04s linear;
}

.controller-stick-telemetry {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.7rem;
}

.controller-stick-label {
  font-weight: 800;
  color: #ffffff;
  font-size: 0.76rem;
}

/* Modal Footer */
.controller-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 14, 30, 0.8);
}

.controller-footer-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.controller-btn-reset {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  font-family: var(--font-mono, monospace);
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.controller-btn-reset:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

.controller-footer-hint {
  font-size: 0.68rem;
  color: #64748b;
}

.controller-footer-hint strong {
  color: #00f2fe;
}

.controller-footer-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.controller-save-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #30d158;
}

.controller-save-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #30d158;
  box-shadow: 0 0 6px #30d158;
}

.controller-btn-done {
  padding: 0.45rem 1.25rem;
  border-radius: 8px;
  background: #00f2fe;
  border: 1px solid #00f2fe;
  color: #040814;
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.15s ease;
}

.controller-btn-done:hover {
  background: #38bdf8;
  border-color: #38bdf8;
  box-shadow: 0 0 14px rgba(0, 242, 254, 0.4);
}

@media (max-width: 820px) {
  .controller-binding-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .controller-row-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .controller-preset-grid {
    grid-template-columns: 1fr;
  }
  .controller-sticks-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .controller-modal-header {
    padding: 1rem;
  }
  .controller-tab-bar {
    padding: 0.5rem 1rem;
  }
  .controller-tab-body {
    padding: 1rem;
  }
  .controller-modal-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 1rem;
  }
  .controller-footer-left,
  .controller-footer-right {
    justify-content: space-between;
  }
}

/* ——— Semi-Transparent Frosted Glass HUD — Daylight / Light Theme Adaptation ——— */
html[data-resolved-theme="light"] .platformer-hud-dock,
html[data-theme="light"] .platformer-hud-dock {
  background: rgba(255, 255, 255, 0.65) !important;
  border: 1px solid rgba(15, 23, 42, 0.10) !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
  color: #0f172a !important;
}

html[data-resolved-theme="light"] .platformer-hud-dock.is-bottom-dock,
html[data-theme="light"] .platformer-hud-dock.is-bottom-dock {
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
}

html[data-resolved-theme="light"] #hud-character-name,
html[data-theme="light"] #hud-character-name,
html[data-resolved-theme="light"] #hud-damage-val,
html[data-theme="light"] #hud-damage-val,
html[data-resolved-theme="light"] .platformer-hud-damage .platformer-hud-val,
html[data-theme="light"] .platformer-hud-damage .platformer-hud-val,
html[data-resolved-theme="light"] .platformer-hud-dock .platformer-hud-val,
html[data-theme="light"] .platformer-hud-dock .platformer-hud-val {
  color: #0f172a !important;
  text-shadow: none !important;
}

html[data-resolved-theme="light"] .platformer-hud-character,
html[data-theme="light"] .platformer-hud-character {
  background: rgba(0, 0, 0, 0.04) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

html[data-resolved-theme="light"] .platformer-hud-damage span:first-child,
html[data-theme="light"] .platformer-hud-damage span:first-child {
  color: #64748b !important;
}

html[data-resolved-theme="light"] .platformer-hud-stocks .platformer-stock-icon,
html[data-theme="light"] .platformer-hud-stocks .platformer-stock-icon {
  color: #0284c7 !important;
}

html[data-resolved-theme="light"] .platformer-hud-dock .platformer-hud-dock-sep,
html[data-theme="light"] .platformer-hud-dock .platformer-hud-dock-sep {
  background: rgba(15, 23, 42, 0.10) !important;
}

html[data-resolved-theme="light"] .platformer-hud-dock .platformer-hud-quick-btn,
html[data-theme="light"] .platformer-hud-dock .platformer-hud-quick-btn,
html[data-resolved-theme="light"] .platformer-hud-dock .platformer-hud-pause-btn,
html[data-theme="light"] .platformer-hud-dock .platformer-hud-pause-btn,
html[data-resolved-theme="light"] .platformer-hud-dock .platformer-hud-tuck-btn,
html[data-theme="light"] .platformer-hud-dock .platformer-hud-tuck-btn {
  background: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  color: #334155 !important;
}

html[data-resolved-theme="light"] .platformer-hud-pause-btn span,
html[data-theme="light"] .platformer-hud-pause-btn span {
  color: #334155 !important;
}

html[data-resolved-theme="light"] .platformer-hud-pause-btn svg,
html[data-theme="light"] .platformer-hud-pause-btn svg {
  fill: #334155 !important;
}

html[data-resolved-theme="light"] .platformer-hud-close svg,
html[data-theme="light"] .platformer-hud-close svg {
  stroke: #64748b !important;
}

html[data-resolved-theme="light"] .platformer-hud-dock .platformer-hud-p2-join,
html[data-theme="light"] .platformer-hud-dock .platformer-hud-p2-join {
  background: rgba(244, 63, 94, 0.08) !important;
  border-color: rgba(244, 63, 94, 0.22) !important;
}

html[data-resolved-theme="light"] .platformer-hud-p2-join .p2-join-label,
html[data-theme="light"] .platformer-hud-p2-join .p2-join-label {
  color: #e11d48 !important;
}

html[data-resolved-theme="light"] .platformer-hud-p2-join .p2-join-hotkey,
html[data-theme="light"] .platformer-hud-p2-join .p2-join-hotkey {
  color: #be123c !important;
}

html[data-resolved-theme="light"] .platformer-hud-tuck-tab,
html[data-theme="light"] .platformer-hud-tuck-tab {
  background: rgba(255, 255, 255, 0.70) !important;
  border: 1px solid rgba(15, 23, 42, 0.10) !important;
  color: #0f172a !important;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
}

html[data-resolved-theme="light"] .mini-hud-name,
html[data-theme="light"] .mini-hud-name,
html[data-resolved-theme="light"] .mini-hud-dmg,
html[data-theme="light"] .mini-hud-dmg {
  color: #0f172a !important;
}

html[data-resolved-theme="light"] .platformer-hud-untuck-btn,
html[data-theme="light"] .platformer-hud-untuck-btn {
  background: rgba(0, 0, 0, 0.05) !important;
  border-color: rgba(0, 0, 0, 0.10) !important;
  color: #0f172a !important;
}

html[data-resolved-theme="light"] .platformer-hud-boss-bar,
html[data-theme="light"] .platformer-hud-boss-bar,
html[data-resolved-theme="light"] #hud-boss-bar,
html[data-theme="light"] #hud-boss-bar {
  background: rgba(255, 255, 255, 0.72) !important;
  border: 1px solid rgba(15, 23, 42, 0.10) !important;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
}

html[data-resolved-theme="light"] #boss-bar-name,
html[data-theme="light"] #boss-bar-name,
html[data-resolved-theme="light"] #boss-bar-damage,
html[data-theme="light"] #boss-bar-damage,
html[data-resolved-theme="light"] .boss-bar-damage,
html[data-theme="light"] .boss-bar-damage {
  color: #0f172a !important;
}

html[data-resolved-theme="light"] .boss-bar-track,
html[data-theme="light"] .boss-bar-track {
  background: rgba(15, 23, 42, 0.10) !important;
}

html[data-resolved-theme="light"] #boss-bar-phase,
html[data-theme="light"] #boss-bar-phase {
  color: #64748b !important;
}

html[data-resolved-theme="light"] .boss-bar-tag,
html[data-theme="light"] .boss-bar-tag {
  background: rgba(15, 23, 42, 0.05) !important;
  border-color: rgba(15, 23, 42, 0.10) !important;
  color: #334155 !important;
}

html[data-resolved-theme="light"] .prag-talking-portrait-hud,
html[data-theme="light"] .prag-talking-portrait-hud {
  background: rgba(255, 255, 255, 0.75) !important;
  border: 1px solid rgba(15, 23, 42, 0.10) !important;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
}

html[data-resolved-theme="light"] .talking-portrait-title,
html[data-theme="light"] .talking-portrait-title {
  color: #0f172a !important;
}

html[data-resolved-theme="light"] .talking-portrait-text,
html[data-theme="light"] .talking-portrait-text {
  color: #334155 !important;
}

html[data-resolved-theme="light"] .talking-portrait-avatar-frame,
html[data-theme="light"] .talking-portrait-avatar-frame {
  background: #e2e8f0 !important;
  border-color: rgba(0, 0, 0, 0.10) !important;
}

html[data-resolved-theme="light"] .talking-portrait-nav-btn,
html[data-theme="light"] .talking-portrait-nav-btn {
  background: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  color: #334155 !important;
}

html[data-resolved-theme="light"] .talking-portrait-close-btn,
html[data-theme="light"] .talking-portrait-close-btn {
  background: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  color: #64748b !important;
}

/* Controller Guide Pill — Daylight Theme */
html[data-resolved-theme="light"] #prag-platformer-controller-hud,
html[data-theme="light"] #prag-platformer-controller-hud {
  background: rgba(255, 255, 255, 0.65) !important;
  border: 1px solid rgba(15, 23, 42, 0.10) !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
  color: #0f172a !important;
}

html[data-resolved-theme="light"] #prag-platformer-controller-hud.is-collapsed,
html[data-theme="light"] #prag-platformer-controller-hud.is-collapsed {
  background: rgba(255, 255, 255, 0.70) !important;
  border: 1px solid rgba(15, 23, 42, 0.10) !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
}

html[data-resolved-theme="light"] .ctrl-hud-badge,
html[data-theme="light"] .ctrl-hud-badge {
  background: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  color: #0f172a !important;
}

html[data-resolved-theme="light"] .controller-keycap,
html[data-theme="light"] .controller-keycap {
  background: rgba(255, 255, 255, 0.90) !important;
  border: 1px solid rgba(15, 23, 42, 0.14) !important;
  color: #0f172a !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06) !important;
}

html[data-resolved-theme="light"] .controller-action,
html[data-theme="light"] .controller-action {
  color: #475569 !important;
}

html[data-resolved-theme="light"] .ctrl-hud-toggle,
html[data-theme="light"] .ctrl-hud-toggle {
  background: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  color: #64748b !important;
}

/* Quick Settings Popover — Daylight Theme */
html[data-resolved-theme="light"] .platformer-hud-quick-popover,
html[data-theme="light"] .platformer-hud-quick-popover {
  background: rgba(255, 255, 255, 0.75) !important;
  border: 1px solid rgba(15, 23, 42, 0.10) !important;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
  color: #0f172a !important;
}

html[data-resolved-theme="light"] .quick-pop-btn,
html[data-theme="light"] .quick-pop-btn {
  background: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  color: #334155 !important;
}

html[data-resolved-theme="light"] .quick-pop-btn.is-active,
html[data-theme="light"] .quick-pop-btn.is-active {
  background: rgba(2, 132, 199, 0.12) !important;
  border-color: rgba(2, 132, 199, 0.35) !important;
  color: #0284c7 !important;
}

/* Touch Controls & Shelf — Daylight Theme */
html[data-resolved-theme="light"] #touch-codex,
html[data-theme="light"] #touch-codex,
html[data-resolved-theme="light"] .platformer-touch-btn.codex-btn,
html[data-theme="light"] .platformer-touch-btn.codex-btn {
  background: rgba(255, 255, 255, 0.70) !important;
  border: 1px solid rgba(15, 23, 42, 0.10) !important;
  color: #0f172a !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
}

html[data-resolved-theme="light"] #touch-codex-badge,
html[data-theme="light"] #touch-codex-badge {
  color: #0284c7 !important;
}

html[data-resolved-theme="light"] #touch-action,
html[data-theme="light"] #touch-action,
html[data-resolved-theme="light"] .platformer-touch-btn.action-btn,
html[data-theme="light"] .platformer-touch-btn.action-btn {
  background: rgba(255, 255, 255, 0.60) !important;
  border: 1px solid rgba(15, 23, 42, 0.10) !important;
  color: #64748b !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
}

html[data-resolved-theme="light"] .platformer-dpad-pod,
html[data-theme="light"] .platformer-dpad-pod {
  background: rgba(255, 255, 255, 0.65) !important;
  border: 1px solid rgba(15, 23, 42, 0.10) !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
}

html[data-resolved-theme="light"] .platformer-dpad-btn,
html[data-theme="light"] .platformer-dpad-btn {
  background: rgba(0, 0, 0, 0.04) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  color: #334155 !important;
}

html[data-resolved-theme="light"] .platformer-touch-btn,
html[data-theme="light"] .platformer-touch-btn {
  background: rgba(255, 255, 255, 0.68) !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  color: #0f172a !important;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
}

html[data-resolved-theme="light"] .platformer-touch-btn svg,
html[data-theme="light"] .platformer-touch-btn svg {
  filter: none !important;
}

html[data-resolved-theme="light"] .touch-btn-sub,
html[data-theme="light"] .touch-btn-sub {
  color: #334155 !important;
  text-shadow: none !important;
}

/* Modals — Daylight Theme */
html[data-resolved-theme="light"] .pause-modal-sheet,
html[data-theme="light"] .pause-modal-sheet,
html[data-resolved-theme="light"] .controller-modal-sheet,
html[data-theme="light"] .controller-modal-sheet {
  background: rgba(255, 255, 255, 0.75) !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
  color: #0f172a !important;
}

/* PragDOMRunner Optical Minimap / Tactical Radar */
.hud-radar-dock {
  position: fixed;
  top: 62px;
  right: 16px;
  z-index: 2147483640;
  width: 176px;
  background: linear-gradient(160deg, rgba(8, 12, 22, 0.88) 0%, rgba(3, 5, 11, 0.94) 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  user-select: none;
}

.hud-radar-dock.is-visible {
  opacity: 1;
  pointer-events: none;
  transform: translateY(0) scale(1);
}

.hud-radar-dock.is-visible .hud-radar-toggle,
.hud-radar-dock.is-visible .hud-radar-zoom-bar,
.hud-radar-dock.is-visible .hud-radar-zoom-btn,
.hud-radar-dock.is-visible .hud-radar-zoom {
  pointer-events: auto;
}

.hud-radar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
}

.hud-radar-label {
  font: 800 8px/1 -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.74);
  text-transform: uppercase;
  white-space: nowrap;
}

.hud-radar-zoom-bar {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.hud-radar-zoom-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  font: 700 9px/1 monospace;
  border-radius: 3px;
  padding: 2px 5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.hud-radar-zoom-btn:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(56, 189, 248, 0.55);
  color: #ffffff;
}

.hud-radar-zoom {
  appearance: none;
  font: 700 8px/1 monospace;
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.26);
  border-radius: 3px;
  padding: 2px 5px;
  cursor: pointer;
  white-space: nowrap;
}

.hud-radar-footer {
  padding: 3px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.25);
  font: 600 7px/1 monospace;
  letter-spacing: 0.10em;
  color: rgba(148, 163, 184, 0.72);
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Primary HUD Dock Desktop Zoom Segmented Pill */
.platformer-hud-zoom-ctrl {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 242, 254, 0.07);
  border: 1px solid rgba(0, 242, 254, 0.28);
  border-radius: 6px;
  overflow: hidden;
  height: 22px;
}

.platformer-hud-zoom-ctrl .hud-zoom-step-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: #00f2fe;
  font: 700 11px/1 monospace;
  padding: 0 6px;
  height: 100%;
  cursor: pointer;
  transition: background 0.15s ease;
}

.platformer-hud-zoom-ctrl .hud-zoom-step-btn:hover {
  background: rgba(0, 242, 254, 0.20);
}

.platformer-hud-zoom-ctrl .hud-zoom-reset-btn {
  appearance: none;
  border: none;
  border-left: 1px solid rgba(0, 242, 254, 0.18);
  border-right: 1px solid rgba(0, 242, 254, 0.18);
  background: transparent;
  color: #e2e8f0;
  font: 600 9px/1 monospace;
  letter-spacing: 0.04em;
  padding: 0 6px;
  height: 100%;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.platformer-hud-zoom-ctrl .hud-zoom-reset-btn:hover {
  background: rgba(0, 242, 254, 0.14);
}

.platformer-hud-zoom-ctrl .platformer-hud-val {
  color: #00f2fe;
  font-weight: 700;
}

@media (max-width: 768px), (hover: none) and (pointer: coarse) {
  .platformer-hud-zoom-ctrl,
  .hud-radar-dock,
  .hud-radar-zoom-bar,
  .hud-radar-footer,
  .ctrl-hud-item:has(#ctrl-k-zoom) {
    display: none !important;
  }
}

.hud-radar-canvas-wrap {
  position: relative;
  width: 176px;
  height: 96px;
  background: rgba(2, 4, 10, 0.55);
}

.hud-radar-canvas {
  display: block;
  width: 176px;
  height: 96px;
}

html[data-resolved-theme="light"] .hud-radar-dock,
html[data-theme="light"] .hud-radar-dock {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

html[data-resolved-theme="light"] .hud-radar-header,
html[data-theme="light"] .hud-radar-header {
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(0, 0, 0, 0.02);
}

html[data-resolved-theme="light"] .hud-radar-label,
html[data-theme="light"] .hud-radar-label {
  color: rgba(15, 23, 42, 0.75);
}

html[data-resolved-theme="light"] .hud-radar-canvas-wrap,
html[data-theme="light"] .hud-radar-canvas-wrap {
  background: rgba(240, 244, 248, 0.8);
}

/* Pre-Match Countdown Sequence Overlay — Center-Stage Smash Broadcast */
.platformer-countdown-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483645;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 0;
  background: radial-gradient(circle at 50% 50%, rgba(3, 5, 12, 0.42) 0%, rgba(3, 5, 12, 0) 68%);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.18s ease;
}

.platformer-countdown-overlay.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: none;
}

.platformer-countdown-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: min(860px, 100vw);
  background: linear-gradient(90deg, transparent 0%, rgba(4, 7, 15, 0.88) 26%, rgba(4, 7, 15, 0.88) 74%, transparent 100%);
  border: none;
  border-radius: 0;
  padding: 20px 28px;
  box-shadow: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
  text-align: center;
  transform: scaleX(0.9) scaleY(0.95);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.platformer-countdown-overlay .platformer-countdown-card {
  width: min(760px, 94vw);
  padding: 18px 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: linear-gradient(90deg, transparent 0%, rgba(3, 5, 11, 0.84) 22%, rgba(3, 5, 11, 0.84) 78%, transparent 100%);
  border-top: 1px solid color-mix(in srgb, var(--cd-accent, #38bdf8) 46%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--cd-accent, #38bdf8) 46%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.platformer-countdown-overlay.is-active .platformer-countdown-card {
  transform: scaleX(1);
}

.countdown-sub-tag {
  font: 700 10px/1 ui-monospace, "SF Mono", monospace;
  letter-spacing: 0.28em;
  color: rgba(226, 232, 240, 0.78);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.countdown-num-wrap {
  min-width: 112px;
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.countdown-num {
  font: italic 900 clamp(4.2rem, 9.5vw, 6.4rem)/0.92 -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  color: #f8fafc;
  letter-spacing: -0.04em;
  display: inline-block;
  text-shadow: 0 10px 32px rgba(0, 0, 0, 0.94), 0 0 28px color-mix(in srgb, var(--cd-accent, #38bdf8) 45%, transparent);
  animation: countdownPulse 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}

.countdown-step-3, .countdown-num.step-3 { color: #f8fafc; }
.countdown-step-2, .countdown-num.step-2 { color: #f8fafc; }
.countdown-step-1, .countdown-num.step-1 { color: color-mix(in srgb, var(--cd-accent, #38bdf8) 38%, #ffffff); }
.countdown-step-go, .countdown-num.step-go {
  color: #fef08a;
  letter-spacing: 0.03em;
  text-shadow: 0 10px 36px rgba(0, 0, 0, 0.96), 0 0 38px rgba(251, 191, 36, 0.65);
}

.countdown-hero-tag {
  font: 800 11px/1 -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0.28em;
  color: var(--cd-accent, #38bdf8);
  text-transform: uppercase;
  margin-top: 2px;
}

@media (max-width: 640px) {
  #prag-platformer-countdown,
  .platformer-countdown-overlay {
    padding-top: 0;
  }
  .platformer-countdown-card {
    padding: 14px 16px;
    gap: 3px;
    width: 96vw;
    max-width: 96vw;
  }
  .countdown-sub-tag,
  .countdown-hero-tag {
    font-size: 8px;
    letter-spacing: 0.16em;
  }
  .countdown-num-wrap {
    min-width: 64px;
    min-height: 52px;
  }
  .countdown-num {
    font-size: 3.4rem;
  }
}

@keyframes countdownPulse {
  0% { transform: scale(1.85) skewX(-8deg); opacity: 0; }
  30% { transform: scale(0.96) skewX(-6deg); opacity: 1; }
  100% { transform: scale(1.0) skewX(-6deg); opacity: 1; }
}

/* ——— Interactive 12-Tier Curriculum Academy HUD (Obsidian Depth Standard) ——— */
.prag-curriculum-hud {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: min(400px, calc(100vw - 32px));
  max-height: calc(100vh - 180px);
  z-index: 2147483640;
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: rgba(3, 3, 8, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  pointer-events: auto;
}

.prag-curriculum-hud.is-visible {
  display: flex;
}

.curriculum-hud-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.curriculum-hud-kicker {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 2px;
}

.curriculum-hud-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.25;
}

.curriculum-hud-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.curriculum-hud-progress-lbl {
  font-size: 9px;
  font-weight: 700;
  color: #38bdf8;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.curriculum-btn-icon {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: #94a3b8;
  border-radius: 6px;
  width: 22px;
  height: 22px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.curriculum-tier-strip {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 3px;
}

.curriculum-tier-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  border-radius: 4px;
  padding: 3px 0;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

.curriculum-tier-pill.is-active {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

.curriculum-tier-pill.is-done {
  border-color: rgba(16, 185, 129, 0.45);
  color: #10b981;
}

.curriculum-progress-track {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.curriculum-progress-fill {
  height: 100%;
  background: #10b981;
  transition: width 0.2s ease;
}

.curriculum-lesson-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  max-height: 240px;
}

.curriculum-lesson-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.curriculum-lesson-row.is-done {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.22);
}

.curriculum-status-icon {
  width: 14px;
  height: 14px;
  margin-top: 2px;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.35);
}

.curriculum-status-icon.is-verified {
  color: #10b981;
  filter: drop-shadow(0 0 2px rgba(16, 185, 129, 0.45));
}

.curriculum-status-icon.is-pending {
  color: rgba(255, 255, 255, 0.28);
}

.curriculum-lesson-body {
  flex: 1;
  min-width: 0;
}

.curriculum-lesson-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 2px;
}

.curriculum-lesson-id {
  font-size: 9px;
  font-weight: 700;
  color: #38bdf8;
  flex-shrink: 0;
}

.curriculum-lesson-title {
  font-size: 10px;
  font-weight: 600;
  color: #f8fafc;
  font-family: system-ui, -apple-system, sans-serif;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.curriculum-lesson-key {
  font-size: 8.5px;
  font-weight: 700;
  color: #cbd5e1;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  flex-shrink: 0;
}

.curriculum-lesson-obj {
  font-size: 9.5px;
  line-height: 1.35;
  color: #94a3b8;
  font-family: system-ui, -apple-system, sans-serif;
}

.curriculum-lesson-run-btn {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #38bdf8;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.curriculum-lesson-run-btn:hover {
  background: rgba(56, 189, 248, 0.18);
  color: #ffffff;
}

.curriculum-req-details {
  margin-top: 2px;
}

.curriculum-req-summary {
  font-size: 8.5px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  user-select: none;
  letter-spacing: 0.04em;
}

.curriculum-req-summary:hover {
  color: #94a3b8;
}

.curriculum-req-gwt {
  margin-top: 4px;
  padding: 5px 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  font-size: 8.5px;
  line-height: 1.38;
  color: #94a3b8;
  font-family: system-ui, -apple-system, sans-serif;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.curriculum-req-gwt strong {
  color: #cbd5e1;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.curriculum-hud-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.curriculum-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: #e2e8f0;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 9.5px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.04em;
}

.curriculum-btn-primary {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

/* ——— 3D Live Webpage DOM Perspective Tilt & Monolith Extrusion ——— */
body.prag-dom-3d-tilt-active {
  background-color: #030308 !important;
  overflow-x: hidden !important;
}

body.prag-dom-3d-tilt-active #main-content,
body.prag-dom-3d-tilt-active #prag-dom-stage,
body.prag-dom-3d-tilt-active main {
  transform-style: preserve-3d !important;
  will-change: transform;
}

body.prag-dom-3d-tilt-active .platform-card,
body.prag-dom-3d-tilt-active .project-card,
body.prag-dom-3d-tilt-active .feature-card,
body.prag-dom-3d-tilt-active .store-card,
body.prag-dom-3d-tilt-active .pillar,
body.prag-dom-3d-tilt-active .bento-card,
body.prag-dom-3d-tilt-active .platformer-3d-ui-block {
  transform: translateZ(36px) !important;
  border-color: rgba(56, 189, 248, 0.55) !important;
  box-shadow:
    0 10px 0 rgba(8, 15, 30, 0.96),
    0 11px 0 rgba(56, 189, 248, 0.48),
    0 22px 0 rgba(5, 10, 22, 0.94),
    0 23px 0 rgba(16, 185, 129, 0.36),
    0 34px 46px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.24) !important;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

body.prag-dom-3d-tilt-active h1,
body.prag-dom-3d-tilt-active h2,
body.prag-dom-3d-tilt-active .section-title,
body.prag-dom-3d-tilt-active .hero-title {
  transform: translateZ(24px);
  text-shadow: 0 8px 18px rgba(0, 0, 0, 0.9), 0 2px 0 rgba(56, 189, 248, 0.45);
}

.platformer-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
  .platformer-hud-dock,
  .platformer-modal-card,
  .prag-talking-portrait-hud {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

body.platformer-active #webgl,
body.platformer-active .webgl {
  opacity: 0.16 !important;
  filter: blur(8px) saturate(0.35) !important;
  transition: opacity 0.4s ease, filter 0.4s ease;
}

.cloudylogs-hdr,.cloudylogs-row,.cloudylogs-ftr,.ctrl-row-bet{display:flex;align-items:center;justify-content:space-between}
.cloudylogs-hdr{padding:10px 14px;border-bottom:1px solid rgba(255,255,255,0.08);background:rgba(255,255,255,0.02)}
.cloudylogs-grp{display:flex;align-items:center;gap:8px}.cloudylogs-grp-sm{display:flex;align-items:center;gap:6px}
.cloudylogs-pip{display:inline-block;width:6px;height:6px;border-radius:50%;background:#30d158;box-shadow:0 0 6px rgba(48,209,88,0.6)}
.cloudylogs-ttl{font-weight:700;letter-spacing:0.05em;color:#fff}
.cloudylogs-mut{color:rgba(255,255,255,0.4);font-size:10px}
.cloudylogs-btn{background:none;border:1px solid rgba(255,255,255,0.12);color:#94a3b8;border-radius:4px;padding:2px 8px;font-size:10px;cursor:pointer}
.cloudylogs-strm{flex:1;overflow-y:auto;padding:10px 14px;max-height:380px;display:flex;flex-direction:column;gap:6px}
.cloudylogs-ftr{padding:6px 14px;border-top:1px solid rgba(255,255,255,0.08);font-size:10px;color:rgba(255,255,255,0.4)}
.cloudylogs-empty{color:rgba(255,255,255,0.35);text-align:center;padding:24px 0}
.cloudylogs-entry{padding:4px 0;border-bottom:1px solid rgba(255,255,255,0.04);line-height:1.4}
.cloudylogs-ts{color:rgba(255,255,255,0.35);font-size:10px}
.cloudylogs-tag{display:inline-block;padding:1px 4px;border-radius:3px;background:rgba(255,255,255,0.06);font-weight:600;font-size:10px;margin:0 4px}
.cloudylogs-arg{color:#cbd5e1;word-break:break-all}
.ctrl-sub{margin-bottom:12px;font-family:monospace;font-size:11px;color:#94a3b8}
.ctrl-row-bet{margin-bottom:8px}.ctrl-lbl-mut{margin-bottom:8px;font-size:10px;font-weight:700;color:#94a3b8;font-family:monospace}
.ctrl-lbl-sub{font-size:10px;color:#64748b}.ctrl-cyn{color:#00f2fe;font-weight:700}.ctrl-wht{color:#fff}
.ctrl-btn-sm{padding:4px 10px;font-size:10px}.ctrl-bnum{font-size:8px;opacity:0.6}
.perk-hdr,.perk-code-row{display:flex;align-items:center;justify-content:space-between;gap:0.5rem}
.perk-kicker{font-size:0.68rem;font-weight:700;color:#00f2fe}.perk-ok{font-size:0.65rem;color:#30d158;font-weight:700}
.perk-code{font-family:monospace;font-size:0.8rem;background:rgba(0,0,0,0.4);padding:2px 8px;border-radius:4px;color:#f1f5f9;border:1px solid rgba(255,255,255,0.1)}
.perk-copy{padding:2px 8px;font-size:0.65rem;border-color:rgba(0,242,254,0.4);color:#00f2fe}
.perk-sub{font-size:0.64rem;color:#94a3b8}.perk-shr-ttl{font-size:0.68rem;font-weight:700;color:#f59e0b}
.duel-ttl{font-size:0.75rem;font-weight:700;color:#f59e0b;letter-spacing:0.06em}
.duel-desc{font-size:0.66rem;color:#94a3b8;line-height:1.4}.duel-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:0.5rem;margin-top:0.4rem}
.qst-hdr{display:flex;align-items:center;justify-content:space-between}.qst-ttl{font-size:0.75rem;font-weight:700;color:#30d158}.qst-stg-ttl{font-size:0.75rem;font-weight:700;color:#00f2fe;letter-spacing:0.06em}
.qst-prog{display:flex;align-items:baseline;justify-content:space-between;background:rgba(48,209,88,0.08);border:1px solid rgba(48,209,88,0.3);padding:0.8rem;border-radius:8px}
.qst-lbl{font-size:0.7rem;color:#f1f5f9;font-weight:700}.qst-cnt{font-size:1.1rem;color:#30d158;font-weight:900}
.qst-rew{background:rgba(0,0,0,0.4);border:1px solid rgba(255,255,255,0.1);border-radius:6px;padding:0.75rem;display:flex;align-items:center;justify-content:space-between}
.qst-rtag{font-size:0.68rem;font-weight:700;color:#94a3b8}.qst-rtag.is-done{color:#30d158}.qst-code{font-size:0.75rem;color:#00f2fe;font-family:monospace}
.ctrl-init{padding:24px;text-align:center;color:#94a3b8;font-family:monospace;font-size:12px}.txt-r{text-align:right}.controller-chip.is-off{opacity:0.4}
.ctrl-act-tag{background:rgba(0,242,254,0.15);border-color:#00f2fe;color:#00f2fe}.controller-preset-apply-btn:disabled{opacity:0.5;pointer-events:none}
.duel-hdr{display:flex;align-items:center;justify-content:space-between}.duel-copy{padding:0.3rem 0.7rem;font-size:0.65rem}.duel-sbtn{padding:0.4rem;font-size:0.65rem}
.perk-ok-mut{font-size:0.65rem;color:#94a3b8;font-weight:400}#btn-submit-bounty.is-settled{background:#30d158;border-color:#30d158;color:#000}

.pgb-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(3, 3, 8, 0.62);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  opacity: 0;
  transition: opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.pgb-backdrop.is-open { opacity: 1; }
.pgb-backdrop.is-closing { opacity: 0; transition-duration: 0.24s; }

.pgb-sheet {
  width: min(520px, 100%);
  max-height: calc(100dvh - 24px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 1.5rem 1.5rem 1.25rem;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(17, 21, 32, 0.98), rgba(9, 12, 20, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10), 0 28px 70px rgba(0, 0, 0, 0.62);
  color: #e2e8f0;
  transform: translateY(14px) scale(0.97);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.pgb-backdrop.is-open .pgb-sheet { transform: none; }
.pgb-backdrop.is-closing .pgb-sheet { transform: translateY(10px) scale(0.98); transition-duration: 0.24s; }

.pgb-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.pgb-glyph {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #27d4c8;
  background: linear-gradient(180deg, rgba(39, 212, 200, 0.16), rgba(39, 212, 200, 0.04));
  border: 1px solid rgba(39, 212, 200, 0.30);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.pgb-head-text { min-width: 0; }

.pgb-eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #27d4c8;
}

.pgb-title {
  margin: 0;
  font-size: clamp(1.3rem, 3.4vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: #ffffff;
}

.pgb-lede {
  margin: 0.85rem 0 0;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.5;
  color: rgba(241, 245, 249, 0.80);
}

.pgb-steps {
  list-style: none;
  margin: 1.1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pgb-step {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.68rem 0.8rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.45;
  color: #e2e8f0;
}

.pgb-step.is-required {
  background: rgba(39, 212, 200, 0.07);
  border-color: rgba(39, 212, 200, 0.28);
}

.pgb-step strong { color: #ffffff; font-weight: 700; }

.pgb-step-icon {
  flex: none;
  margin-top: 1px;
  color: rgba(241, 245, 249, 0.78);
}

.pgb-step.is-required .pgb-step-icon { color: #27d4c8; }

.pgb-step-text { flex: 1 1 auto; min-width: 0; }

.pgb-tag {
  flex: none;
  align-self: center;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0b0e16;
  background: #27d4c8;
}

.pgb-backdrop kbd,
.pgb-key kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
  white-space: nowrap;
  vertical-align: middle;
  line-height: 1;
}

.pgb-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.9rem;
  margin-top: 1rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(241, 245, 249, 0.76);
}

.pgb-key {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  white-space: nowrap;
}

.pgb-keys.is-touch .pgb-key { white-space: normal; }
.pgb-keys.is-touch svg { color: #27d4c8; flex: none; }

.pgb-actions {
  display: flex;
  gap: 0.7rem;
  margin-top: 1.35rem;
}

.pgb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0 1.4rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), background 0.24s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.pgb-btn:active { transform: scale(0.97); }

.pgb-btn-primary {
  flex: 1 1 auto;
  color: #030816;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: inset 0 1px 0 #ffffff, inset 0 -1.5px 0 rgba(0, 0, 0, 0.14), 0 6px 20px rgba(0, 0, 0, 0.45);
}

.pgb-btn-primary svg { color: #0d9488; }

.pgb-btn-primary:hover,
.pgb-btn-primary:focus-visible {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 #ffffff, inset 0 -2px 0 rgba(0, 0, 0, 0.2), 0 10px 28px rgba(0, 0, 0, 0.55), 0 0 0 3px rgba(39, 212, 200, 0.35);
  outline: none;
}

.pgb-btn-ghost {
  flex: 0 0 auto;
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.pgb-btn-ghost:hover,
.pgb-btn-ghost:focus-visible {
  background: rgba(255, 255, 255, 0.09);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10), 0 0 0 3px rgba(255, 255, 255, 0.16);
}

html[data-resolved-theme="light"] .pgb-backdrop,
html[data-theme="light"] .pgb-backdrop { background: rgba(15, 23, 42, 0.32); }

html[data-resolved-theme="light"] .pgb-sheet,
html[data-theme="light"] .pgb-sheet {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border-color: rgba(15, 23, 42, 0.10);
  box-shadow: inset 0 1px 0 #ffffff, 0 28px 70px rgba(15, 23, 42, 0.22);
  color: #1e293b;
}

html[data-resolved-theme="light"] .pgb-title,
html[data-theme="light"] .pgb-title,
html[data-resolved-theme="light"] .pgb-step strong,
html[data-theme="light"] .pgb-step strong { color: #0f172a; }

html[data-resolved-theme="light"] .pgb-lede,
html[data-theme="light"] .pgb-lede,
html[data-resolved-theme="light"] .pgb-step,
html[data-theme="light"] .pgb-step,
html[data-resolved-theme="light"] .pgb-keys,
html[data-theme="light"] .pgb-keys { color: #334155; }

html[data-resolved-theme="light"] .pgb-step,
html[data-theme="light"] .pgb-step {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(15, 23, 42, 0.08);
}

html[data-resolved-theme="light"] .pgb-step.is-required,
html[data-theme="light"] .pgb-step.is-required {
  background: rgba(13, 148, 136, 0.08);
  border-color: rgba(13, 148, 136, 0.30);
}

html[data-resolved-theme="light"] .pgb-eyebrow,
html[data-theme="light"] .pgb-eyebrow,
html[data-resolved-theme="light"] .pgb-glyph,
html[data-theme="light"] .pgb-glyph,
html[data-resolved-theme="light"] .pgb-step.is-required .pgb-step-icon,
html[data-theme="light"] .pgb-step.is-required .pgb-step-icon { color: #0d9488; }

html[data-resolved-theme="light"] .pgb-backdrop kbd,
html[data-theme="light"] .pgb-backdrop kbd {
  color: #0f172a;
  background: rgba(15, 23, 42, 0.06);
  border-color: rgba(15, 23, 42, 0.16);
}

html[data-resolved-theme="light"] .pgb-btn-primary,
html[data-theme="light"] .pgb-btn-primary {
  color: #ffffff;
  background: #0f172a;
  border-color: #0f172a;
}

html[data-resolved-theme="light"] .pgb-btn-primary svg,
html[data-theme="light"] .pgb-btn-primary svg { color: #5eead4; }

html[data-resolved-theme="light"] .pgb-btn-ghost,
html[data-theme="light"] .pgb-btn-ghost {
  color: #0f172a;
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.14);
}

@media (max-width: 640px), (max-height: 780px) {
  .pgb-backdrop { padding: 10px; }
  .pgb-sheet {
    max-height: calc(100dvh - 20px);
    padding: 1rem 1rem 0.9rem;
    border-radius: 18px;
  }
  .pgb-glyph { width: 38px; height: 38px; border-radius: 11px; }
  .pgb-lede { margin-top: 0.55rem; font-size: 0.85rem; line-height: 1.4; }
  .pgb-scene { height: 72px; margin-top: 0.65rem; }
  .pgb-steps {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    margin-top: 0.65rem;
    gap: 0.38rem;
  }
  .pgb-step { padding: 0.5rem 0.68rem; font-size: 0.82rem; line-height: 1.38; }
  .pgb-keys { margin-top: 0.6rem; gap: 0.35rem 0.75rem; font-size: 0.75rem; }
  .pgb-actions { margin-top: 0.75rem; flex: none; gap: 0.5rem; }
  .pgb-btn { min-height: 44px; font-size: 0.9rem; }
}

@media (max-width: 480px) {
  .pgb-actions { flex-direction: column-reverse; }
  .pgb-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .pgb-backdrop, .pgb-sheet { transition: none; }
}

/* Briefing motion: crisp staggered entrance, immediate CTA clarity */
.pgb-backdrop .pgb-anim { opacity: 0; }
.pgb-backdrop.is-open .pgb-anim {
  animation: pgbRise 0.24s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--i, 0) * 24ms + 12ms);
}
.pgb-backdrop .pgb-actions.pgb-anim,
.pgb-backdrop.is-open .pgb-actions.pgb-anim {
  opacity: 1 !important;
  animation: none !important;
}
.pgb-backdrop.is-launching { opacity: 0; transition: opacity 0.42s cubic-bezier(0.16, 1, 0.3, 1); }
.pgb-backdrop.is-launching .pgb-sheet {
  transform: scale(1.06);
  filter: blur(8px);
  opacity: 0;
  transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1), filter 0.42s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.36s cubic-bezier(0.16, 1, 0.3, 1);
}
.pgb-backdrop.is-launching .pgb-anim,
.pgb-backdrop.is-closing .pgb-anim { opacity: 1; animation: none; }

@keyframes pgbRise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.pgb-glyph { position: relative; }
.pgb-glyph::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 1px solid rgba(39, 212, 200, 0.55);
  animation: pgbBreath 2.6s cubic-bezier(0.16, 1, 0.3, 1) infinite;
  pointer-events: none;
}
@keyframes pgbBreath {
  0% { transform: scale(1); opacity: 0.8; }
  70%, 100% { transform: scale(1.38); opacity: 0; }
}

.pgb-tag { animation: pgbPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both; animation-delay: 0.18s; }
@keyframes pgbPop { from { transform: scale(0.4); opacity: 0; } to { transform: none; opacity: 1; } }

/* Mini scene: character hopping across letters to the flag */
.pgb-scene {
  position: relative;
  flex: none;
  margin-top: 0.85rem;
  height: 84px;
  border-radius: 14px;
  background:
    radial-gradient(120% 90% at 50% 120%, rgba(39, 212, 200, 0.12), transparent 60%),
    rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.pgb-track {
  position: absolute;
  left: 50%;
  bottom: 12px;
  width: 154px;
  height: 68px;
  transform: translateX(-50%);
}

.pgb-l {
  position: absolute;
  bottom: 2px;
  left: calc(var(--d) * 22px);
  width: 22px;
  text-align: center;
  font-size: 34px;
  line-height: 38px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
  text-shadow: 0 1px 0 #cbd5e1, 0 2px 0 #64748b, 0 3px 0 #334155, 0 6px 10px rgba(0, 0, 0, 0.6);
  animation: pgbDip 4s cubic-bezier(0.16, 1, 0.3, 1) infinite;
  animation-delay: calc(var(--d) * 0.5s);
}

.pgb-l-flag {
  color: #27d4c8;
  text-shadow: none;
  line-height: 0;
  bottom: 4px;
  transform-origin: 30% 100%;
  animation-name: pgbFlag;
}
.pgb-l-flag svg { width: 24px; height: 24px; }

@keyframes pgbDip {
  0% { transform: translateY(4px) scaleY(0.96); color: #e6fffd; }
  6% { transform: translateY(0); color: #ffffff; }
  100% { transform: translateY(0); }
}

@keyframes pgbFlag {
  0% { transform: rotate(-10deg) scale(1.18); color: #ffffff; }
  10% { transform: rotate(6deg) scale(1.05); color: #27d4c8; }
  18% { transform: rotate(-3deg); }
  26%, 100% { transform: none; }
}

.pgb-hero {
  position: absolute;
  left: 4px;
  bottom: 30px;
  width: 14px;
  height: 18px;
  animation: pgbHop 4s linear infinite;
}

.pgb-hero-body {
  position: absolute;
  inset: 0;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, #1b202b 0%, #0b0e16 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 3px 6px rgba(0, 0, 0, 0.55);
  transform-origin: 50% 100%;
  animation: pgbSquash 0.5s linear infinite;
  overflow: hidden;
}

.pgb-hero-visor {
  position: absolute;
  left: 2px;
  right: 2px;
  top: 1px;
  height: 7px;
  border-radius: 4px 4px 3px 3px;
  background: linear-gradient(180deg, #211711 0%, #211711 42%, #e2b290 46%, #d49d78 100%);
  box-shadow: inset 0 1px 0 rgba(120, 88, 66, 0.45);
}

.pgb-hero-tie {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 6px;
  height: 6px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #f8fafc 0 35%, #090b10 35% 65%, #f8fafc 65% 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

@keyframes pgbHop {
  0% { transform: translate(0, 0); opacity: 0; animation-timing-function: cubic-bezier(0.2, 0.7, 0.4, 1); }
  2% { opacity: 1; }
  6.25% { transform: translate(11px, -22px); animation-timing-function: cubic-bezier(0.6, 0, 0.8, 0.3); }
  12.5% { transform: translate(22px, 0px); animation-timing-function: cubic-bezier(0.2, 0.7, 0.4, 1); }
  18.75% { transform: translate(33px, -22px); animation-timing-function: cubic-bezier(0.6, 0, 0.8, 0.3); }
  25% { transform: translate(44px, 0px); animation-timing-function: cubic-bezier(0.2, 0.7, 0.4, 1); }
  31.25% { transform: translate(55px, -22px); animation-timing-function: cubic-bezier(0.6, 0, 0.8, 0.3); }
  37.5% { transform: translate(66px, 0px); animation-timing-function: cubic-bezier(0.2, 0.7, 0.4, 1); }
  43.75% { transform: translate(77px, -22px); animation-timing-function: cubic-bezier(0.6, 0, 0.8, 0.3); }
  50% { transform: translate(88px, 0px); animation-timing-function: cubic-bezier(0.2, 0.7, 0.4, 1); }
  56.25% { transform: translate(99px, -22px); animation-timing-function: cubic-bezier(0.6, 0, 0.8, 0.3); }
  62.5% { transform: translate(110px, 0px); animation-timing-function: cubic-bezier(0.2, 0.7, 0.4, 1); }
  68.75% { transform: translate(121px, -30px); animation-timing-function: cubic-bezier(0.6, 0, 0.8, 0.3); }
  75% { transform: translate(130px, 6px); }
  94% { transform: translate(130px, 6px); opacity: 1; }
  100% { transform: translate(130px, 6px); opacity: 0; }
}

@keyframes pgbSquash {
  0% { transform: scale(1.18, 0.82); }
  14% { transform: scale(1); }
  50% { transform: scale(0.92, 1.1); }
  86% { transform: scale(1); }
  100% { transform: scale(1.18, 0.82); }
}

/* Mini scene: descent through five floors to the vault */
.pgb-scene-tower { height: 78px; }
.pgb-floors {
  position: absolute;
  inset: 0 12px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  padding-bottom: 12px;
}
.pgb-floor {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  color: rgba(241, 245, 249, 0.62);
  font-variant-numeric: tabular-nums;
}
.pgb-floor.is-start { color: #ffffff; }
.pgb-floor.is-goal { color: #27d4c8; }
.pgb-floor svg { animation: pgbFlag 3.2s cubic-bezier(0.16, 1, 0.3, 1) infinite; animation-delay: 2.4s; }
.pgb-path {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 30px;
  height: 0;
  border-top: 1px dashed rgba(39, 212, 200, 0.35);
}
.pgb-runner {
  position: absolute;
  top: 25px;
  left: 10%;
  width: 11px;
  height: 11px;
  margin-left: -5px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(39, 212, 200, 0.35);
  animation: pgbRun 3.2s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
@keyframes pgbRun {
  0% { left: 10%; opacity: 0; }
  8% { opacity: 1; }
  75% { left: 90%; opacity: 1; }
  92%, 100% { left: 90%; opacity: 0; }
}

/* DOM prologue: letterbox, captions, markers */
/* Smooth HUD/Radar glide-in when cinematic curtain lifts on GO! */
#prag-platformer-hud,
#prag-platformer-controller-hud,
#prag-platformer-guide-pill,
#hud-radar,
.platformer-hud,
.platformer-hud-dock,
.hud-radar-dock {
  transition: opacity 0.44s cubic-bezier(0.16, 1, 0.3, 1), transform 0.48s cubic-bezier(0.16, 1, 0.3, 1);
}
body.pgc-cinematic #prag-platformer-hud,
body.pgc-cinematic #prag-platformer-controller-hud,
body.pgc-cinematic #prag-platformer-guide-pill,
body.pgc-cinematic #prag-platformer-touch-controls,
body.pgc-cinematic #prag-talking-portrait-hud,
body.pgc-cinematic #prag-curriculum-hud,
body.pgc-cinematic #hud-radar,
body.pgc-cinematic .platformer-hud,
body.pgc-cinematic .platformer-hud-dock,
body.pgc-cinematic .hud-radar-dock {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
body.pgc-cinematic #prag-platformer-hud,
body.pgc-cinematic .platformer-hud,
body.pgc-cinematic .platformer-hud-dock,
body.pgc-cinematic #prag-platformer-controller-hud {
  transform: translate3d(0, 24px, 0) !important;
}
body.pgc-cinematic #hud-radar,
body.pgc-cinematic .hud-radar-dock {
  transform: translate3d(24px, 0, 0) !important;
}

.pgc-prologue {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  pointer-events: none;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  --bar: clamp(56px, 13vh, 124px);
}

.pgc-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 72% 64% at 50% 50%, transparent 52%, rgba(3, 3, 8, 0.62) 100%);
  opacity: 0;
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.pgc-prologue.is-on .pgc-vignette { opacity: 1; }
.pgc-prologue[data-beat="2"] .pgc-vignette {
  background: radial-gradient(ellipse 46% 42% at 50% 50%, transparent 38%, rgba(3, 3, 8, 0.72) 100%);
}

.pgc-bar {
  position: absolute;
  left: 0;
  right: 0;
  height: var(--bar);
  background: #020306;
  display: flex;
  align-items: center;
  padding: 0 clamp(18px, 4vw, 48px);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.pgc-bar-top { top: 0; transform: translateY(-101%); }
.pgc-bar-bottom { bottom: 0; transform: translateY(101%); justify-content: center; }
.pgc-prologue.is-on .pgc-bar,
.pgc-insert .pgc-bar { transform: none; }
.pgc-prologue.is-ending .pgc-bar { transition-duration: 0.6s; }
.pgc-prologue.is-ending .pgc-vignette,
.pgc-prologue.is-ending .pgc-marker { opacity: 0; transition: opacity 0.4s ease; }

.pgc-chapter-eyebrow {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #27d4c8;
}

.pgc-skip {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 0.95rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: background 0.24s cubic-bezier(0.16, 1, 0.3, 1), transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
.pgc-skip:hover, .pgc-skip:focus-visible { background: rgba(255, 255, 255, 0.12); outline: none; }
.pgc-skip:active { transform: scale(0.96); }
.pgc-skip kbd {
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  color: rgba(241, 245, 249, 0.8);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.pgc-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 100%;
  background: #27d4c8;
  transform: scaleX(0);
  transform-origin: 0 50%;
}
.pgc-prologue.is-on .pgc-progress { animation: pgcProgress var(--pgc-dur, 7s) linear forwards; }
@keyframes pgcProgress { to { transform: scaleX(1); } }

.pgc-caption {
  margin: 0;
  max-width: 38ch;
  text-align: center;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: clamp(1.05rem, 2.2vw, 1.55rem);
  font-weight: 500;
  letter-spacing: 0.005em;
  line-height: 1.3;
  color: #f7eed7;
}
.pgc-w { display: inline-block; opacity: 0; }
.pgc-caption.is-in .pgc-w {
  animation: pgcWord 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--w) * 70ms);
}
@keyframes pgcWord {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.pgc-marker {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  opacity: 0;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}
.pgc-marker.is-on { opacity: 1; }
.pgc-ring {
  position: absolute;
  left: -30px;
  top: -30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1.5px solid rgba(39, 212, 200, 0.9);
  transform: scale(0.4);
  opacity: 0;
}
.pgc-marker.is-on .pgc-ring { animation: pgcRing 1.8s cubic-bezier(0.16, 1, 0.3, 1) infinite; }
.pgc-marker.is-on .pgc-ring-2 { animation-delay: 0.6s; }
@keyframes pgcRing {
  0% { transform: scale(0.45); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}
.pgc-chip {
  position: absolute;
  left: 0;
  top: 40px;
  transform: translateX(-50%) translateY(8px) scale(0.9);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 800;
  color: #ffffff;
  background: rgba(3, 3, 8, 0.86);
  border: 1px solid rgba(39, 212, 200, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10), 0 8px 22px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
}
.pgc-chip svg { color: #27d4c8; }
.pgc-marker.is-on .pgc-chip { transform: translateX(-50%); opacity: 1; transition-delay: 0.15s; }
.pgc-marker[data-kind="goal"] .pgc-chip { top: 92px; }
.pgc-marker[data-kind="hero"] .pgc-chip { top: -74px; }

/* 3D insertion: shutters, title card, floor map */
.pgc-insert {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: #f1f5f9;
}
.pgc-shutter {
  position: absolute;
  left: 0;
  right: 0;
  height: 50.5%;
  background: linear-gradient(180deg, #05060c, #0b0e16);
  transition: transform 0.46s cubic-bezier(0.7, 0, 0.84, 0);
}
.pgc-shutter-top { top: 0; transform: translateY(-101%); box-shadow: inset 0 -1px 0 rgba(39, 212, 200, 0.5); }
.pgc-shutter-bottom { bottom: 0; transform: translateY(101%); background: linear-gradient(0deg, #05060c, #0b0e16); box-shadow: inset 0 1px 0 rgba(39, 212, 200, 0.5); }
.pgc-insert.is-closed .pgc-shutter { transform: none; }
.pgc-insert.is-titled .pgc-shutter-top,
.pgc-insert.is-titled .pgc-shutter-bottom { box-shadow: none; }
.pgc-insert.is-opening .pgc-shutter { transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); }
.pgc-insert.is-opening .pgc-shutter-top { transform: translateY(-101%); }
.pgc-insert.is-opening .pgc-shutter-bottom { transform: translateY(101%); }

.pgc-flash {
  position: absolute;
  inset: 0;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
  animation: pgcFlash 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes pgcFlash { 0% { opacity: 0; } 18% { opacity: 0.55; } 100% { opacity: 0; } }

.pgc-insert-stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 24px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.pgc-insert.is-titled .pgc-insert-stage { opacity: 1; }
.pgc-insert.is-opening .pgc-insert-stage { opacity: 0; transform: scale(1.06); transition: opacity 0.3s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1); }

.pgc-insert-eyebrow {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #27d4c8;
}
.pgc-insert-title {
  margin: 0;
  font-size: clamp(2rem, 7vw, 4.4rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  color: #ffffff;
  white-space: nowrap;
}
.pgc-l { display: inline-block; opacity: 0; }
.pgc-insert.is-titled .pgc-l {
  animation: pgcLetter 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--l) * 34ms);
}
@keyframes pgcLetter {
  from { opacity: 0; transform: translateY(0.4em) scale(0.9); }
  to { opacity: 1; transform: none; }
}
.pgc-insert-story {
  margin: 0;
  max-width: 36ch;
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  font-weight: 600;
  color: rgba(241, 245, 249, 0.85);
  opacity: 0;
}
.pgc-insert.is-titled .pgc-insert-story { animation: pgbRise 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.38s both; }

.pgc-tower {
  position: relative;
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  width: min(360px, 86vw);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pgc-floor {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 10px;
  height: 30px;
  opacity: 0;
  transform: translateX(-14px);
}
.pgc-insert.is-mapped .pgc-floor {
  animation: pgcFloor 0.42s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--f) * 75ms);
}
@keyframes pgcFloor { to { opacity: 1; transform: none; } }
.pgc-floor-num {
  font-size: 0.82rem;
  font-weight: 800;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: rgba(241, 245, 249, 0.7);
}
.pgc-floor-bar {
  height: 22px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.pgc-floor.is-start .pgc-floor-num { color: #ffffff; }
.pgc-floor.is-start .pgc-floor-bar { border-color: rgba(255, 255, 255, 0.28); }
.pgc-floor.is-goal .pgc-floor-num { color: #27d4c8; }
.pgc-floor.is-goal .pgc-floor-bar { background: rgba(39, 212, 200, 0.10); border-color: rgba(39, 212, 200, 0.5); }
.pgc-floor-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 92px;
  font-size: 0.76rem;
  font-weight: 800;
  color: #ffffff;
}
.pgc-floor-tag.is-goal, .pgc-floor-tag.is-goal svg { color: #27d4c8; }
.pgc-floor:not(.is-start):not(.is-goal)::after { content: ""; min-width: 92px; }
.pgc-tower-path {
  position: absolute;
  left: 56px;
  top: 15px;
  bottom: 15px;
  width: 0;
  border-left: 1.5px dashed rgba(39, 212, 200, 0.7);
  transform: scaleY(0);
  transform-origin: 50% 0;
}
.pgc-insert.is-mapped .pgc-tower-path { animation: pgcPath 0.90s cubic-bezier(0.65, 0, 0.35, 1) 0.32s forwards; }
@keyframes pgcPath { to { transform: scaleY(1); } }

.pgc-insert-goal {
  margin: 0.5rem 0 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  font-size: clamp(0.88rem, 2vw, 1rem);
  font-weight: 700;
  color: #ffffff;
  background: rgba(39, 212, 200, 0.10);
  border: 1px solid rgba(39, 212, 200, 0.4);
  opacity: 0;
}
.pgc-insert-goal svg { color: #27d4c8; flex: none; }
.pgc-insert-goal kbd {
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.pgc-insert.is-mapped .pgc-insert-goal { animation: pgbRise 0.48s cubic-bezier(0.16, 1, 0.3, 1) 0.78s both; }

.pgc-insert > .pgc-skip {
  position: absolute;
  top: 16px;
  right: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.pgc-insert.is-titled > .pgc-skip { opacity: 1; }
.pgc-insert.is-opening > .pgc-skip { opacity: 0; }

@media (max-width: 480px) {
  .pgb-track { transform: translateX(-50%) scale(0.9); transform-origin: 50% 100%; }
  .pgc-chapter-eyebrow { font-size: 0.68rem; }
  .pgc-floor { grid-template-columns: 40px 1fr auto; }
  .pgc-floor-tag, .pgc-floor:not(.is-start):not(.is-goal)::after { min-width: 84px; }
}

/* ——— Cinematic Modal, Stage-Select, Victory, Game-Over, Banner & HUD Choreography ——— */
.platformer-roster-modal,
.platformer-pause-modal,
.platformer-codex-modal,
.platformer-controller-modal,
.platformer-victory-modal,
.platformer-gameover-modal,
.platformer-stage-drawer-overlay {
  transition: opacity 0.30s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.30s cubic-bezier(0.16, 1, 0.3, 1), display 0.30s;
  transition-behavior: allow-discrete;
}

.platformer-roster-modal .platformer-roster-sheet,
.platformer-pause-modal .pause-modal-sheet,
.platformer-codex-modal .codex-sheet,
.platformer-controller-modal .controller-card,
.platformer-victory-modal .platformer-victory-card,
.platformer-gameover-modal .platformer-gameover-card,
.platformer-stage-drawer-overlay .platformer-modal-card {
  transform: translate3d(0, 18px, 0) scale(0.95);
  opacity: 0;
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.30s ease;
}

.platformer-roster-modal.is-open .platformer-roster-sheet,
.platformer-pause-modal.is-open .pause-modal-sheet,
.platformer-codex-modal.is-open .codex-sheet,
.platformer-controller-modal.is-open .controller-card,
.platformer-victory-modal.is-open .platformer-victory-card,
.platformer-gameover-modal.is-open .platformer-gameover-card,
.platformer-stage-drawer-overlay.is-open .platformer-modal-card {
  transform: translate3d(0, 0, 0) scale(1);
  opacity: 1;
}

@starting-style {
  .platformer-roster-modal.is-open,
  .platformer-pause-modal.is-open,
  .platformer-codex-modal.is-open,
  .platformer-controller-modal.is-open,
  .platformer-victory-modal.is-open,
  .platformer-gameover-modal.is-open,
  .platformer-stage-drawer-overlay.is-open {
    opacity: 0;
  }
  .platformer-roster-modal.is-open .platformer-roster-sheet,
  .platformer-pause-modal.is-open .pause-modal-sheet,
  .platformer-codex-modal.is-open .codex-sheet,
  .platformer-controller-modal.is-open .controller-card,
  .platformer-victory-modal.is-open .platformer-victory-card,
  .platformer-gameover-modal.is-open .platformer-gameover-card,
  .platformer-stage-drawer-overlay.is-open .platformer-modal-card {
    transform: translate3d(0, 22px, 0) scale(0.94);
    opacity: 0;
  }
}

/* Stage Selector Modal — Zero Header Overlap & Per-Stage Cinematic Cards */
.platformer-stage-drawer-overlay {
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
  background: radial-gradient(circle at 50% 42%, rgba(14, 24, 48, 0.72) 0%, rgba(2, 4, 12, 0.90) 100%);
}
.platformer-stage-drawer-overlay .platformer-modal-card {
  max-width: 620px;
  padding: 24px 26px 26px;
  background: linear-gradient(168deg, rgba(12, 18, 34, 0.96) 0%, rgba(6, 9, 18, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 32px 84px rgba(0, 0, 0, 0.82);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", system-ui, sans-serif;
  gap: 14px;
}
.platformer-stage-drawer-overlay .qst-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}
.platformer-stage-drawer-overlay .qst-stg-ttl {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #f8fafc;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}
.platformer-stage-drawer-overlay #stage-close-btn {
  width: auto !important;
  flex: 0 0 auto;
  padding: 7px 14px;
  border-radius: 999px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e2e8f0;
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}
.platformer-stage-drawer-overlay #stage-close-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.34);
  transform: translateY(-1px);
}
.platformer-stage-drawer-overlay .duel-desc {
  margin: 0;
  font-size: 0.82rem;
  color: #94a3b8;
  letter-spacing: 0.01em;
}
.platformer-stage-drawer-overlay .stage-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 10px;
  margin-top: 2px;
}
.platformer-stage-drawer-overlay .stage-select-tile {
  --st-c: #38bdf8;
  position: relative;
  overflow: hidden;
  padding: 14px 14px 13px;
  border-radius: 12px;
  background: linear-gradient(155deg, color-mix(in srgb, var(--st-c) 14%, rgba(14, 20, 36, 0.92)) 0%, rgba(8, 12, 22, 0.96) 100%);
  border: 1px solid color-mix(in srgb, var(--st-c) 28%, rgba(255, 255, 255, 0.10));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
  gap: 5px;
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, box-shadow 0.24s ease;
}
.platformer-stage-drawer-overlay .stage-select-tile::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--st-c), transparent);
  opacity: 0.72;
}
.platformer-stage-drawer-overlay .stage-select-tile[data-stage="vault"] { --st-c: #f59e0b; }
.platformer-stage-drawer-overlay .stage-select-tile[data-stage="compiler"] { --st-c: #10b981; }
.platformer-stage-drawer-overlay .stage-select-tile[data-stage="vortex"] { --st-c: #a855f7; }
.platformer-stage-drawer-overlay .stage-select-tile[data-stage="storm"] { --st-c: #38bdf8; }
.platformer-stage-drawer-overlay .stage-select-tile[data-stage="stadium"] { --st-c: #fbbf24; }
.platformer-stage-drawer-overlay .stage-select-tile:hover,
.platformer-stage-drawer-overlay .stage-select-tile.is-active {
  transform: translateY(-3px);
  border-color: var(--st-c);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 14px 28px rgba(0, 0, 0, 0.5);
}
.platformer-stage-drawer-overlay .stage-tile-title {
  font-size: 0.80rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #ffffff;
}
.platformer-stage-drawer-overlay .stage-tile-desc {
  font-size: 0.72rem;
  color: color-mix(in srgb, var(--st-c) 45%, #cbd5e1);
}

/* Theatrical Pause, Victory & Game Over Depth + Staggered Cascades */
.platformer-pause-modal .pause-modal-backdrop {
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
}
.platformer-pause-modal .pause-modal-sheet {
  background: linear-gradient(168deg, rgba(12, 18, 32, 0.95) 0%, rgba(5, 8, 16, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 32px 84px rgba(0, 0, 0, 0.85);
}

#prag-platformer-victory {
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  background: radial-gradient(circle at 50% 38%, rgba(251, 191, 36, 0.16) 0%, rgba(12, 22, 46, 0.78) 42%, rgba(2, 4, 12, 0.94) 100%);
}
#prag-platformer-victory .platformer-victory-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(168deg, rgba(14, 21, 38, 0.96) 0%, rgba(6, 9, 18, 0.98) 100%);
  border: 1px solid rgba(251, 191, 36, 0.34);
  box-shadow: inset 0 1px 0 rgba(253, 224, 71, 0.35), 0 36px 96px rgba(0, 0, 0, 0.88);
}
#prag-platformer-victory .platformer-victory-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #fde047, #ffffff, transparent);
  opacity: 0;
}
#prag-platformer-victory.is-open .platformer-victory-card::before {
  animation: victoryBevelSweep 2.4s cubic-bezier(0.16, 1, 0.3, 1) 0.15s infinite;
}
@keyframes victoryBevelSweep {
  0% { left: -60%; opacity: 0; }
  20% { opacity: 0.95; }
  65% { left: 115%; opacity: 0.85; }
  100% { left: 115%; opacity: 0; }
}
@keyframes gradeStampIn {
  0% { transform: scale(1.72) rotate(-8deg); opacity: 0; filter: brightness(1.8); }
  62% { transform: scale(0.94) rotate(1deg); opacity: 1; filter: brightness(1.15); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; filter: brightness(1); }
}
@keyframes statTileCascade {
  0% { transform: translateY(10px) scale(0.96); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
#prag-platformer-victory.is-open .platformer-victory-grade {
  animation: gradeStampIn 0.56s cubic-bezier(0.16, 1, 0.3, 1) 0.18s both;
}
#prag-platformer-victory.is-open .platformer-stat-tile,
#prag-platformer-gameover.is-open .platformer-stat-tile {
  animation: statTileCascade 0.42s cubic-bezier(0.16, 1, 0.3, 1) both;
}
#prag-platformer-victory.is-open .platformer-stat-tile:nth-child(1),
#prag-platformer-gameover.is-open .platformer-stat-tile:nth-child(1) { animation-delay: 0.14s; }
#prag-platformer-victory.is-open .platformer-stat-tile:nth-child(2),
#prag-platformer-gameover.is-open .platformer-stat-tile:nth-child(2) { animation-delay: 0.20s; }
#prag-platformer-victory.is-open .platformer-stat-tile:nth-child(3),
#prag-platformer-gameover.is-open .platformer-stat-tile:nth-child(3) { animation-delay: 0.26s; }
#prag-platformer-victory.is-open .platformer-stat-tile:nth-child(4) { animation-delay: 0.32s; }
#prag-platformer-victory.is-open .platformer-stat-tile:nth-child(5) { animation-delay: 0.38s; }
#prag-platformer-victory.is-open .platformer-stat-tile:nth-child(6) { animation-delay: 0.44s; }

#prag-platformer-gameover {
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  background: radial-gradient(circle at 50% 42%, rgba(220, 38, 38, 0.20) 0%, rgba(18, 6, 12, 0.84) 48%, rgba(2, 3, 8, 0.96) 100%);
}
#prag-platformer-gameover .platformer-gameover-card {
  background: linear-gradient(168deg, rgba(22, 10, 16, 0.96) 0%, rgba(8, 5, 10, 0.98) 100%);
  border: 1px solid rgba(244, 63, 94, 0.36);
  box-shadow: inset 0 1px 0 rgba(251, 113, 133, 0.26), 0 36px 96px rgba(0, 0, 0, 0.90);
}

/* Cinema Stage-Shift Chapter Banner (Upper Clear Zone, Zero Overlap) */
.prag-cinema-stage-banner {
  --banner-accent: #38bdf8;
  position: fixed;
  top: 66px;
  left: 50%;
  transform: translate3d(-50%, -14px, 0) scale(0.96);
  z-index: 2147483644;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 36px;
  min-width: min(360px, 86vw);
  background: linear-gradient(90deg, transparent 0%, rgba(4, 8, 18, 0.86) 20%, rgba(4, 8, 18, 0.86) 80%, transparent 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1), transform 0.38s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.32s ease;
}
.prag-cinema-stage-banner.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate3d(-50%, 0, 0) scale(1);
}
.prag-cinema-stage-banner .pcsb-line {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--banner-accent) 50%, transparent 100%);
  opacity: 0.72;
}
.prag-cinema-stage-banner .pcsb-eyebrow {
  font: 700 9px/1 ui-monospace, "SF Mono", monospace;
  letter-spacing: 0.30em;
  color: var(--banner-accent);
  text-transform: uppercase;
  margin-top: 3px;
}
.prag-cinema-stage-banner .pcsb-title {
  font: italic 900 1.25rem/1.05 -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  letter-spacing: 0.08em;
  color: #ffffff;
  text-shadow: 0 6px 20px rgba(0, 0, 0, 0.9);
}
.prag-cinema-stage-banner .pcsb-sub {
  font: 600 10px/1.1 ui-monospace, "SF Mono", monospace;
  letter-spacing: 0.18em;
  color: #cbd5e1;
  margin-bottom: 3px;
}

/* Dramatic K.O. / Final-Stock Center Flash Banner */
.prag-cinema-ko-banner {
  --ko-accent: #fbbf24;
  position: fixed;
  top: 26%;
  left: 50%;
  transform: translate3d(-50%, -50%, 0) scale(1.38);
  z-index: 2147483644;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 44px;
  background: linear-gradient(90deg, transparent 0%, rgba(4, 6, 14, 0.84) 22%, rgba(4, 6, 14, 0.84) 78%, transparent 100%);
  border-top: 1px solid color-mix(in srgb, var(--ko-accent) 60%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--ko-accent) 60%, transparent);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, transform 0.34s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.22s ease;
}
.prag-cinema-ko-banner.is-active {
  opacity: 1;
  visibility: visible;
  transform: translate3d(-50%, -50%, 0) scale(1);
}
.prag-cinema-ko-banner .pcko-tag {
  font: 700 10px/1 ui-monospace, "SF Mono", monospace;
  letter-spacing: 0.28em;
  color: #e2e8f0;
}
.prag-cinema-ko-banner .pcko-title {
  font: italic 900 clamp(2.1rem, 5.2vw, 3.6rem)/0.96 -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  letter-spacing: 0.04em;
  color: var(--ko-accent);
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.94);
}
@media (max-height: 620px), (max-width: 640px) {
  .prag-cinema-stage-banner { top: 56px; padding: 7px 20px; min-width: min(280px, 90vw); }
  .prag-cinema-ko-banner { top: 38%; padding: 8px 24px; }
}

/* Reactive Damage HUD Pop & Shake */
@keyframes hudDmgImpact {
  0% { transform: scale(1.32) translateX(-3px); filter: brightness(1.6); }
  35% { transform: scale(1.16) translateX(3px); }
  70% { transform: scale(1.06) translateX(-1px); }
  100% { transform: scale(1) translateX(0); filter: brightness(1); }
}
.platformer-hud-val.hud-dmg-hit {
  display: inline-block;
  animation: hudDmgImpact 0.30s cubic-bezier(0.16, 1, 0.3, 1);
}

.platformer-roster-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, background-color 0.2s ease;
}
.platformer-roster-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(112deg, transparent 22%, rgba(255, 255, 255, 0.08) 48%, transparent 72%);
  transform: translateX(-115%);
  pointer-events: none;
  transition: transform 0.52s cubic-bezier(0.16, 1, 0.3, 1);
}
.platformer-roster-card:hover::after,
.platformer-roster-card:focus-visible::after {
  transform: translateX(115%);
}

#prag-platformer-countdown {
  --cd-accent: #38bdf8;
}
#prag-platformer-countdown::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--cd-accent) 75%, #ffffff) 50%, transparent 100%);
  transform: translateY(-50%) scaleX(0);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}
#prag-platformer-countdown.is-active::before {
  transform: translateY(-50%) scaleX(1);
  opacity: 0.78;
}
#prag-platformer-countdown .countdown-num {
  text-shadow: 0 12px 36px rgba(0, 0, 0, 0.88), 0 0 34px color-mix(in srgb, var(--cd-accent) 42%, transparent);
}
#prag-platformer-countdown .countdown-hero-tag {
  letter-spacing: 0.28em;
  color: var(--cd-accent);
  transition: opacity 0.24s ease, transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.platformer-hud {
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
  .pgb-backdrop .pgb-anim, .pgb-l, .pgb-hero, .pgb-hero-body, .pgb-runner, .pgb-glyph::after, .pgb-tag { animation: none !important; opacity: 1; }
  .platformer-roster-modal .platformer-roster-sheet,
  .platformer-pause-modal .pause-modal-sheet,
  .platformer-codex-modal .codex-sheet,
  .platformer-controller-modal .controller-card,
  .platformer-victory-modal .platformer-victory-card,
  .platformer-gameover-modal .platformer-gameover-card,
  .platformer-stage-drawer-overlay .platformer-modal-card {
    transform: none;
    transition: opacity 0.12s ease;
  }
  #prag-platformer-victory.is-open .platformer-victory-card::before,
  #prag-platformer-victory.is-open .platformer-victory-grade,
  #prag-platformer-victory.is-open .platformer-stat-tile,
  #prag-platformer-gameover.is-open .platformer-stat-tile,
  .platformer-hud-val.hud-dmg-hit {
    animation: none !important;
  }
  .platformer-roster-card::after,
  #prag-platformer-countdown::before {
    display: none;
  }
}
