:root {
  --bg-dark: #0a0c10;
  --bg-panel: #11141a;
  --bg-surface: #181c24;
  --border-subtle: #242a38;
  --border-bright: #3b82f6;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-purple: #8b5cf6;
  --accent-amber: #f59e0b;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'Fira Code', ui-monospace, SFMono-Regular, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Allow text selection only in interactive input fields or explicit selectable areas */
input, textarea, select, [contenteditable="true"], .selectable-text, pre, code {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

html {
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

/* Fancy Custom Scrollbars for Web version */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: #242a38; /* Matches --border-subtle */
  border-radius: 4px;
  border: 1.5px solid var(--bg-dark);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-blue);
}

/* Firefox standard scrollbar properties */
* {
  scrollbar-width: thin;
  scrollbar-color: #242a38 var(--bg-dark);
}

body.app-body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#app-root {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
}

/* Header */
.app-header {
  height: 56px;
  background-color: var(--bg-panel);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  flex-shrink: 0;
}

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

.logo-badge {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  color: #ffffff;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  padding: 5px 9px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.header-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.header-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

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

.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.status-text {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-emerald);
  font-family: var(--font-mono);
}

.fps-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 5px 10px;
  border-radius: 6px;
  color: var(--accent-cyan);
}

.btn-action {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.btn-action:hover {
  color: var(--text-main);
  border-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.1);
}

/* App Navigation Tabs Bar */
.app-tabs-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 12px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.4) transparent;
  z-index: 10;
  flex-shrink: 0;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.app-tabs-nav::-webkit-scrollbar {
  height: 4px;
  display: block;
}

.app-tabs-nav::-webkit-scrollbar-track {
  background: transparent;
}

.app-tabs-nav::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.3);
  border-radius: 4px;
}

.app-tabs-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.6);
}

.app-tabs-nav .tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  border-radius: 4px 4px 0 0;
  flex-shrink: 0;
}

.app-tabs-nav .tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.app-tabs-nav .tab-btn.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
}

.tab-icon {
  font-size: 13px;
  line-height: 1;
}

/* Full-Page Tab Viewport Layout */
.main-tab-viewport {
  display: flex;
  flex: 1;
  width: 100%;
  overflow: hidden;
  position: relative;
  background-color: var(--bg-dark);
}

.main-tab-viewport > .tab-content {
  display: none;
  width: 100%;
  height: 100%;
  flex: 1;
  overflow: hidden;
  position: relative;
}

.main-tab-viewport > .tab-content.active {
  display: flex;
  flex-direction: column;
}

/* Tab 1: 3D Viewport Specifics */
#tab-viewport {
  background-color: #06070a;
  display: none;
}

#tab-viewport.active {
  display: flex;
  flex-direction: column;
}

.canvas-container {
  flex: 1;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  cursor: grab;
  outline: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.canvas-container:active {
  cursor: grabbing;
}

#engine-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Viewport HUD */
.viewport-hud {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  gap: 8px;
  pointer-events: none;
  flex-wrap: wrap;
  z-index: 5;
}

.hud-item {
  background: rgba(17, 20, 26, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  padding: 5px 10px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
}

.hud-label {
  font-size: 8px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.hud-value {
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-main);
}

.hud-value.highlight {
  color: var(--accent-cyan);
}

.viewport-toolbar {
  position: absolute;
  bottom: 12px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 5;
}

.viewport-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.hint-text {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(17, 20, 26, 0.85);
  backdrop-filter: blur(6px);
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.08);
  font-family: var(--font-mono);
}

.btn-hud {
  pointer-events: auto;
  background: rgba(17, 20, 26, 0.85);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-hud:hover {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}

/* Console Card Drawer */
.console-card {
  height: 180px;
  max-height: 40vh;
  background-color: var(--bg-panel);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: height 0.2s ease;
}

.console-card.minimized {
  display: none;
}

.card-header {
  height: 32px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  flex-shrink: 0;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.btn-xs {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-xs:hover {
  color: var(--text-main);
  border-color: var(--text-muted);
}

.console-body {
  flex: 1;
  padding: 8px 12px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
}

.log-entry {
  color: var(--text-muted);
}

.log-entry.info { color: #38bdf8; }
.log-entry.cpp { color: #a78bfa; }
.log-entry.success { color: #4ade80; }

/* Full-Page Scroll Panes for Controls & Export */
.tab-scroll-pane {
  flex: 1;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 20px 24px;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  max-width: 1600px;
  margin: 0 auto;
}

.controls-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Full-Page Code & Editor Containers */
.editor-page-container {
  flex: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  overflow: hidden;
  gap: 10px;
}

.editor-full-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.full-page-editor {
  flex: 1;
  min-height: 250px;
  display: flex;
  background: #080a0f;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
}

.full-page-code {
  flex: 1;
  min-height: 250px;
  margin: 0;
  border-radius: 8px;
  overflow: auto;
}

.panel-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px 14px;
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Key Help Box */
.key-help-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px dashed var(--border-subtle);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: #94a3b8;
}

.key-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.key-row:last-child {
  margin-bottom: 0;
}

.key-badge {
  background: var(--bg-panel);
  border: 1px solid #334155;
  color: var(--accent-cyan);
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 10px;
}

/* Mesh Selection Grid */
.mesh-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.btn-mesh {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.15s;
}

.btn-mesh:hover {
  border-color: var(--accent-blue);
}

.btn-mesh.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--accent-blue);
  color: #93c5fd;
}

.mesh-icon {
  font-size: 15px;
  color: var(--accent-blue);
}

/* Export Buttons */
.export-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.btn-export {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 8px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}

.btn-export:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--accent-blue);
  color: #93c5fd;
}

.btn-export svg {
  stroke: var(--accent-blue);
}

/* Form inputs */
.input-select {
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 11px;
  outline: none;
}

.input-select:focus {
  border-color: var(--accent-blue);
}

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

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

.slider-val {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-main);
}

.range-input {
  accent-color: var(--accent-blue);
  width: 100%;
}

.color-picker-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.color-preset-group {
  display: flex;
  gap: 8px;
}

.color-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s;
}

.color-dot:hover {
  transform: scale(1.1);
}

.color-dot.active {
  border-color: #ffffff;
  box-shadow: 0 0 6px rgba(255,255,255,0.4);
}

/* Toggles */
.toggle-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  cursor: pointer;
}

/* Architecture FAQ / Overview */
.arch-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.arch-header {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-amber);
}

.arch-text {
  font-size: 11px;
  line-height: 1.5;
  color: #94a3b8;
}

.arch-badge {
  display: inline-block;
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  width: fit-content;
}

/* Code Viewer */
.source-header {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

.font-mono {
  font-family: var(--font-mono);
}

.code-view {
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 12px;
  overflow-x: auto;
  max-height: 480px;
  font-size: 11px;
  line-height: 1.5;
  color: #cbd5e1;
}

/* Backend Status Pill */
.backend-pill {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
}

.backend-pill.offline {
  background: rgba(239, 68, 68, 0.12) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}

.backend-pill.offline .status-dot {
  background-color: var(--accent-red);
  box-shadow: 0 0 6px var(--accent-red);
}

/* Console Tabs */
.console-tab-group {
  display: flex;
  gap: 4px;
}

.console-tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-mono);
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.console-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.console-tab-btn.active {
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
  border-color: rgba(56, 189, 248, 0.3);
}

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

/* Terminal View & Shell Exec */
.terminal-view {
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  background: #08090d;
}

.terminal-output {
  flex: 1;
  padding: 8px 12px;
  overflow-y: auto;
  min-height: 80px;
  max-height: 120px;
  font-size: 11px;
  line-height: 1.45;
}

.term-line {
  margin-bottom: 3px;
  word-break: break-all;
  white-space: pre-wrap;
}

.term-line.cmd {
  color: #38bdf8;
  font-weight: 600;
}

.term-line.stdout {
  color: #e2e8f0;
}

.term-line.stderr {
  color: #f87171;
}

.term-line.info {
  color: #38bdf8;
}

.term-line.muted {
  color: var(--text-muted);
}

.term-line.success {
  color: #4ade80;
}

.term-line.banner {
  padding: 2px 6px;
  border-radius: 3px;
  display: inline-block;
  font-size: 10px;
  margin-top: 2px;
}

.term-line.banner.ok {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.term-line.banner.err {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.3);
}

/* Quick Command Chips */
.quick-cmd-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.35);
  border-top: 1px solid var(--border-subtle);
  overflow-x: auto;
  white-space: nowrap;
}

.quick-cmd-label {
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.chip-cmd {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.chip-cmd:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

/* Terminal Input Row */
.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
}

.terminal-prompt {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-cyan);
  white-space: nowrap;
}

.terminal-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  color: #f1f5f9;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  outline: none;
}

.terminal-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.3);
}

.btn-exec {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-blue);
  border: none;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-exec:hover {
  background: #1d4ed8;
}

.btn-exec:active {
  transform: scale(0.97);
}

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

/* Native Build Grid */
.build-btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}

.btn-build {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}

.btn-build:hover {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
}

.btn-build:active {
  transform: translateY(0);
}

.btn-build-icon {
  font-size: 18px;
}

.btn-build-info {
  display: flex;
  flex-direction: column;
}

.btn-build-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
}

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

/* Toolchain Table */
.toolchain-table {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  overflow: hidden;
}

.tool-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 11px;
  font-family: var(--font-mono);
}

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

.tool-name {
  color: #94a3b8;
  font-weight: 600;
}

.tool-val {
  color: #38bdf8;
  font-weight: 500;
}

.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

/* ==========================================================================
   Mobile Touch Overlay & Virtual Joystick
   ========================================================================== */
.mobile-touch-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 15;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 16px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.mobile-touch-overlay.hidden {
  display: none !important;
}

/* Remove joystick completely from MOBA and Roulette demos */
body.moba-active #mobile-touch-overlay,
body.moba-active #joystick-left-container,
body.roulette-active #mobile-touch-overlay,
body.roulette-active #joystick-left-container,
#viewport-container:has(#moba-overlay:not([style*="display: none"])) #mobile-touch-overlay,
#viewport-container:has(#moba-overlay:not([style*="display: none"])) #joystick-left-container,
#viewport-container:has(#moba-startup-menu:not([style*="display: none"])) #mobile-touch-overlay,
#viewport-container:has(#moba-startup-menu:not([style*="display: none"])) #joystick-left-container,
#viewport-container:has(#roulette-overlay:not([style*="display: none"])) #mobile-touch-overlay,
#viewport-container:has(#roulette-overlay:not([style*="display: none"])) #joystick-left-container,
#viewport-container:has(#roulette-banner:not([style*="display: none"])) #mobile-touch-overlay,
#viewport-container:has(#roulette-banner:not([style*="display: none"])) #joystick-left-container {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* Left Joystick */
.joystick-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
  touch-action: none;
}

.joystick-base {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.75) 0%, rgba(30, 41, 59, 0.45) 100%);
  border: 2px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), inset 0 0 15px rgba(56, 189, 248, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: grab;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.joystick-base.active {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.4), inset 0 0 20px rgba(56, 189, 248, 0.25);
  cursor: grabbing;
}

.joystick-crosshair {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.j-axis {
  position: absolute;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: rgba(148, 163, 184, 0.6);
  line-height: 1;
}

.j-n { top: 6px; left: 50%; transform: translateX(-50%); }
.j-s { bottom: 6px; left: 50%; transform: translateX(-50%); }
.j-w { left: 6px; top: 50%; transform: translateY(-50%); }
.j-e { right: 6px; top: 50%; transform: translateY(-50%); }

.joystick-knob {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #38bdf8, #0284c7);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.8);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: transform 0.05s ease-out;
}

.joystick-label {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #94a3b8;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Touch Look Zone Hint */
.touch-look-hint {
  display: none !important;
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(6px);
  padding: 4px 12px;
  border-radius: 20px;
  pointer-events: none;
  opacity: 0.85;
  transition: opacity 0.4s ease;
}

.touch-look-hint.faded {
  opacity: 0;
}

.touch-look-text {
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: #cbd5e1;
  letter-spacing: 0.04em;
}

/* Mobile Action Pad (Right Side) */
.mobile-action-pad {
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: auto;
  touch-action: none;
}

.btn-touch-action {
  min-width: 64px;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #f1f5f9;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: all 0.1s ease;
}

.btn-touch-action:active,
.btn-touch-action.active {
  background: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
  transform: scale(0.95);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.6);
}

.btn-touch-shoot {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.9), rgba(185, 28, 28, 0.95)) !important;
  border: 1px solid #f87171 !important;
  color: #ffffff !important;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.5) !important;
}

.btn-touch-shoot:active,
.btn-touch-shoot.active {
  background: #dc2626 !important;
  transform: scale(0.92) !important;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.9) !important;
}

/* Floating Quick-Fire Touch Button (Mobile & Desktop) */
.fps-floating-fire-btn {
  position: absolute;
  bottom: 84px;
  right: 28px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ef4444, #b91c1c 70%, #7f1d1d);
  border: 2.5px solid #fca5a5;
  color: #ffffff;
  font-family: var(--font-mono, monospace);
  font-weight: 900;
  font-size: 11px;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.65), 0 4px 15px rgba(0, 0, 0, 0.7);
  cursor: pointer;
  z-index: 150;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.fps-floating-fire-btn .fire-icon {
  font-size: 24px;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(254, 202, 202, 0.8));
}

.fps-floating-fire-btn .fire-text {
  font-size: 10px;
  letter-spacing: 0.06em;
}

.fps-floating-fire-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 0 35px rgba(239, 68, 68, 0.85), 0 6px 20px rgba(0, 0, 0, 0.8);
}

.fps-floating-fire-btn:active,
.fps-floating-fire-btn.firing {
  transform: scale(0.92);
  background: radial-gradient(circle at 30% 30%, #f87171, #dc2626 70%, #991b1b);
  box-shadow: 0 0 45px rgba(239, 68, 68, 1.0), 0 2px 10px rgba(0, 0, 0, 0.9);
}

@media (max-width: 768px) {
  .fps-floating-fire-btn {
    bottom: 95px;
    right: 20px;
    width: 68px;
    height: 68px;
  }
}

.btn-touch-sprint.active {
  background: #f59e0b !important;
  border-color: #fbbf24 !important;
  color: #0f172a !important;
}

.btn-touch-cam {
  border-color: rgba(139, 92, 246, 0.4);
}

.btn-touch-cam:active {
  background: #7c3aed;
}

/* ==========================================================================
   Live Demo Code Editor
   ========================================================================== */
.editor-toolbar-top {
  margin-bottom: 8px;
}

.full-w {
  width: 100%;
}

.editor-action-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.btn-live-apply {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 5px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
  transition: all 0.15s ease;
}

.btn-live-apply:hover {
  background: linear-gradient(135deg, #0369a1, #1d4ed8);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.5);
  transform: translateY(-1px);
}

.btn-live-apply:active {
  transform: translateY(0);
}

.live-status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-family: var(--font-mono);
  margin-bottom: 8px;
  line-height: 1.4;
  word-break: break-word;
}

.live-status-badge.success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.live-status-badge.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.status-indicator {
  font-size: 12px;
  font-weight: 800;
}

.live-editor-container {
  display: flex;
  position: relative;
  background: #090a0f;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 6px;
  overflow: hidden;
  height: 420px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.6);
}

.editor-line-numbers {
  width: 36px;
  padding: 10px 4px 10px 0;
  text-align: right;
  background: rgba(0, 0, 0, 0.4);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  color: #475569;
  font-size: 11px;
  line-height: 1.5;
  user-select: none;
  overflow: hidden;
  white-space: pre-wrap;
}

.live-code-textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: #f1f5f9;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  padding: 10px;
  resize: none;
  outline: none;
  overflow: auto;
  tab-size: 2;
  white-space: pre;
}

.live-code-textarea::selection {
  background: rgba(56, 189, 248, 0.3);
}

/* ==========================================================================
   Mobile & Responsive Adaptations
   ========================================================================== */
@media (max-width: 768px) {
  /* Remove specified header elements on mobile to maximize screen space */
  .logo-badge,
  .logo-symbol,
  .header-title-group,
  .header-title,
  .header-sub,
  .header-left,
  .header-demo-selector-container {
    display: none !important;
  }

  /* Ensure Active Live Demo Panel in Controls & Demos is in first place and highly visible on mobile */
  #active-live-demo-panel {
    border: 2px solid #ef4444 !important;
    background: linear-gradient(135deg, rgba(160, 20, 32, 0.4), rgba(18, 22, 34, 0.95)) !important;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.35) !important;
    padding: 14px 14px !important;
    margin-bottom: 4px;
  }

  .active-demo-select-highlight {
    min-height: 44px;
    font-size: 13px !important;
    padding: 10px 12px !important;
  }

  .app-header {
    height: 44px;
    padding: 0 8px;
    justify-content: flex-end;
  }

  .header-right {
    width: 100%;
    justify-content: space-between;
    gap: 4px;
  }

  .status-pill {
    padding: 3px 6px;
    font-size: 10px;
    gap: 4px;
  }

  .fps-badge {
    padding: 3px 6px;
    font-size: 10px;
  }

  .app-tabs-nav {
    padding: 0 4px;
    gap: 1px;
  }

  .app-tabs-nav .tab-btn {
    padding: 8px 10px;
    font-size: 11px;
    gap: 4px;
  }

  .main-tab-viewport {
    height: calc(100vh - 38px);
    height: calc(100dvh - 38px);
  }

  .tab-scroll-pane {
    padding: 12px 10px;
  }

  .controls-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .editor-page-container {
    padding: 10px;
    gap: 8px;
  }

  .full-page-editor {
    min-height: 200px;
  }

  .console-card {
    height: 140px;
  }

  .joystick-base {
    width: 100px;
    height: 100px;
  }

  .joystick-knob {
    width: 38px;
    height: 38px;
  }

  .btn-touch-action {
    min-width: 52px;
    height: 36px;
    font-size: 9px;
  }

  .hint-text {
    display: none;
  }
}

/* ==========================================================================
   Project Tab & Sub-Navigation Architecture
   ========================================================================== */
.project-page-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  background: var(--bg-dark);
  overflow: hidden;
}

.project-subnav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 16px;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.project-subnav::-webkit-scrollbar {
  display: none;
}

.proj-subtab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.proj-subtab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.proj-subtab-btn.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.08);
}

.proj-subcontent {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.proj-subcontent.active {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* WASM Export Sub-Navigation Architecture */
.export-page-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  background: var(--bg-dark);
  overflow: hidden;
}

.export-subnav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 16px;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.export-subnav::-webkit-scrollbar {
  display: none;
}

.export-subtab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.export-subtab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.export-subtab-btn.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
}

.export-subcontent {
  display: none;
  flex: 1;
  overflow-y: auto;
  height: 100%;
}

.export-subcontent.active {
  display: flex;
  flex-direction: column;
}

/* Scene Objects Hierarchy Layout */
.scene-objects-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 18px;
  height: 100%;
  min-height: 520px;
}

@media (max-width: 900px) {
  .scene-objects-grid {
    grid-template-columns: 1fr;
  }
}

.hierarchy-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
}

.hierarchy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}

.hierarchy-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hierarchy-tree {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tree-item,
.hierarchy-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  position: relative;
}

.tree-item:hover,
.hierarchy-item:hover {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateX(2px);
}

.tree-item.active,
.tree-item.selected,
.hierarchy-item.active,
.hierarchy-item.selected {
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.22) 0%, rgba(59, 130, 246, 0.15) 100%);
  border-color: var(--accent-cyan);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.3), inset 0 0 0 1px rgba(56, 189, 248, 0.4);
}

.tree-item.selected::before,
.hierarchy-item.selected::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  bottom: 15%;
  width: 3px;
  background: #38bdf8;
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 8px #38bdf8;
}

.hierarchy-item-left,
.tree-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.hierarchy-badge,
.tree-item-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--bg-dark);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.hierarchy-item.selected .hierarchy-badge,
.tree-item.active .tree-item-badge {
  background: rgba(6, 182, 212, 0.3);
  color: #22d3ee;
  border-color: #06b6d4;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.3);
}

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

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

.hierarchy-item.selected .hierarchy-coord {
  color: #7dd3fc;
}

/* Selected Object Inspector Header & Renaming */
.selected-entity-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--accent-cyan);
  margin-bottom: 2px;
}

.selected-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inspector-name-input {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  outline: none;
  font-family: var(--font-sans);
  transition: all 0.15s ease;
  max-width: 220px;
}

.inspector-name-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.25);
  background: rgba(0, 0, 0, 0.55);
}

.inspector-tag-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.inspector-layer-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.mat-color-preview-circle {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  display: inline-block;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.inspector-swatch-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==========================================================================
   MATERIALS & SHADERS CATALOG STYLES
   ========================================================================== */
.materials-catalog-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.material-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.material-cat-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.mat-cat-btn {
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.mat-cat-btn:hover {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.3);
  color: var(--text-main);
}

.mat-cat-btn.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.35);
}

.mat-cost-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cost-legend-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.cost-legend-pill.safe {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.cost-legend-pill.medium {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.cost-legend-pill.heavy {
  background: rgba(244, 63, 94, 0.18);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.4);
}

/* Materials Cards Grid */
.materials-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}

.material-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.material-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}

.material-card.active-material {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.25), inset 0 0 0 1px rgba(6, 182, 212, 0.4);
}

.mat-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.mat-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mat-swatch-box {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.mat-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.mat-card-category {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.mat-card-specs-table {
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
  font-size: 11px;
}

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

.mat-spec-label {
  color: var(--text-muted);
}

.mat-spec-val {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-main);
}

.mat-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
}

.btn-mat-apply {
  flex: 1;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.btn-mat-apply:hover {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

/* Material Tuner Grid */
.mat-tuner-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 900px) {
  .mat-tuner-grid {
    grid-template-columns: 1fr;
  }
}

.mat-gpu-profiler-box {
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

.profiler-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.profiler-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.profiler-note {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  padding: 8px 10px;
  border-left: 3px solid var(--accent-cyan);
}

/* ==========================================================================
   HZB POST-PROCESSING STYLES
   ========================================================================== */
.hzb-postprocessing-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.arch-card {
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.arch-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid;
  align-self: flex-start;
}

.arch-header {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.arch-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.arch-text strong {
  color: #f1f5f9;
}

.arch-badge.active {
  background: rgba(59, 130, 246, 0.3);
  color: #bfdbfe;
  border-color: var(--accent-blue);
}

/* Object Inspector Card */
.object-inspector-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 18px;
  overflow-y: auto;
}

.inspector-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.inspector-name-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inspector-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.inspector-type-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.inspector-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 14px;
}

.inspector-section-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.inspector-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.vec3-triad {
  display: flex;
  align-items: center;
  gap: 6px;
}

.axis-input-cell {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 4px 8px;
}

.axis-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.axis-label.x { color: #f87171; }
.axis-label.y { color: #4ade80; }
.axis-label.z { color: #60a5fa; }

.axis-val {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-main);
  width: 54px;
  border: none;
  background: transparent;
  outline: none;
}

/* Player Controller & Telemetry */
.player-controller-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 960px) {
  .player-controller-grid {
    grid-template-columns: 1fr;
  }
}

.telemetry-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.telemetry-card {
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.telemetry-card.highlight {
  border-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.06);
}

.telemetry-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.telemetry-val {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.telemetry-val.emerald { color: var(--accent-emerald); }
.telemetry-val.cyan { color: var(--accent-cyan); }
.telemetry-val.amber { color: var(--accent-amber); }

/* Collision Register Table */
.collision-table-wrapper {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
}

.collision-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 12px;
}

.collision-pill-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.collision-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 12px;
}

.collision-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.collision-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.collision-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* C++ Code Bridge */
.cpp-bridge-box {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.cpp-snippet-container {
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 14px;
  overflow-x: auto;
  max-height: 480px;
}

/* ==========================================================================
   FPS SHOOTER RETICLE, HITMARKER & DAMAGE SYSTEM STYLES
   ========================================================================== */
.fps-crosshair-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 25;
}

.fps-reticle {
  position: relative;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fps-reticle-dot {
  width: 4px;
  height: 4px;
  background: #06b6d4;
  border-radius: 50%;
  box-shadow: 0 0 8px #06b6d4, 0 0 14px rgba(6, 182, 212, 0.8);
}

.fps-reticle-line {
  position: absolute;
  background: rgba(6, 182, 212, 0.75);
  box-shadow: 0 0 4px #06b6d4;
}

.fps-reticle-line.top {
  top: 0;
  width: 2px;
  height: 8px;
}
.fps-reticle-line.bottom {
  bottom: 0;
  width: 2px;
  height: 8px;
}
.fps-reticle-line.left {
  left: 0;
  height: 2px;
  width: 8px;
}
.fps-reticle-line.right {
  right: 0;
  height: 2px;
  width: 8px;
}

/* Hitmarker (Flashes X on damage event) */
.fps-hitmarker {
  position: absolute;
  width: 24px;
  height: 24px;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.05s ease-out, transform 0.05s ease-out;
  pointer-events: none;
}

.fps-hitmarker.active {
  opacity: 1;
  transform: scale(1.1);
}

.fps-hitmarker::before,
.fps-hitmarker::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 2.5px;
  background: #f43f5e;
  box-shadow: 0 0 10px #f43f5e;
  border-radius: 2px;
}

.fps-hitmarker::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.fps-hitmarker::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* Red Vignette Damage Flash Overlay */
.fps-damage-flash {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(244, 63, 94, 0.15) 0%, rgba(244, 63, 94, 0.65) 100%);
  pointer-events: none;
  opacity: 0;
  z-index: 22;
  transition: opacity 0.05s ease-out;
}

.fps-damage-flash.active {
  opacity: 1;
}

/* Pointer Lock Status Banner / Hint */
.fps-pointerlock-banner {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: #f1f5f9;
  padding: 6px 14px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  cursor: pointer;
  z-index: 30;
  transition: all 0.2s ease;
}

.fps-pointerlock-banner:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: #06b6d4;
}

/* Floating Damage Container & Text */
.damage-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 28;
}

.floating-damage {
  position: absolute;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 18px;
  color: #f59e0b;
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.8), 0 2px 4px #000;
  animation: floatDamage 0.8s ease-out forwards;
  pointer-events: none;
  user-select: none;
}

.floating-damage.critical {
  color: #f43f5e;
  font-size: 22px;
  text-shadow: 0 0 12px rgba(244, 63, 94, 0.9), 0 2px 4px #000;
}

@keyframes floatDamage {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) translateY(0) scale(0.8);
  }
  20% {
    transform: translate(-50%, -50%) translateY(-10px) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translateY(-45px) scale(1.0);
  }
}

/* Weapon HUD in Bottom Corner */
.fps-weapon-hud {
  display: none !important;
  position: absolute;
  bottom: 50px;
  right: 18px;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: var(--font-mono);
  flex-direction: column;
  gap: 4px;
  z-index: 25;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.weapon-title {
  font-size: 12px;
  font-weight: 700;
  color: #06b6d4;
  text-transform: uppercase;
}

.weapon-stats {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
}

/* Damage System Dashboard (Project Tab) */
.damage-actors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.damage-actor-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s ease;
}

.damage-actor-card.hit-flash {
  border-color: #f43f5e;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.3);
}

.damage-actor-card.destroyed {
  opacity: 0.6;
  border-color: #64748b;
}

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

.actor-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.actor-group-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.hp-bar-container {
  height: 8px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.hp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #06b6d4);
  transition: width 0.15s ease-out, background 0.2s ease;
}

.hp-bar-fill.warning {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.hp-bar-fill.danger {
  background: #ef4444;
}

.actor-hp-text {
  font-family: var(--font-mono);
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
}

.damage-events-log-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 11px;
}

.damage-events-log-table th {
  text-align: left;
  padding: 8px 12px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
}

.damage-events-log-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.damage-badge-dealt {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  background: rgba(244, 63, 94, 0.15);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

/* ==========================================================================
   Quake MAP Settings & Items Catalog Styling
   ========================================================================== */

.map-settings-layout,
.items-catalog-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
}

/* 4 Quake Maps Grid */
.quake-maps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.quake-map-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  position: relative;
}

.quake-map-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.quake-map-card.active {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 1px var(--accent-cyan), 0 8px 28px rgba(56, 189, 248, 0.15);
}

.map-card-banner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}

.banner-dm6 {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95)), radial-gradient(circle at top right, rgba(56, 189, 248, 0.25), transparent);
}

.banner-q3dm17 {
  background: linear-gradient(135deg, rgba(24, 24, 27, 0.95), rgba(9, 9, 11, 0.95)), radial-gradient(circle at top right, rgba(168, 85, 247, 0.25), transparent);
}

.banner-dm4 {
  background: linear-gradient(135deg, rgba(41, 24, 18, 0.95), rgba(17, 10, 8, 0.95)), radial-gradient(circle at top right, rgba(244, 63, 94, 0.3), transparent);
}

.banner-ztn {
  background: linear-gradient(135deg, rgba(17, 34, 48, 0.95), rgba(8, 18, 28, 0.95)), radial-gradient(circle at top right, rgba(16, 185, 129, 0.25), transparent);
}

.map-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
}

.map-spawns-count {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
}

.map-card-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.map-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.map-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.map-features-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.feat-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

/* Spawn Points List & Cards */
.spawn-points-list,
.item-spawns-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.spawn-node-card,
.item-node-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  gap: 10px;
  transition: all 0.15s ease;
}

.spawn-node-card:hover,
.item-node-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
}

.spawn-node-info,
.item-node-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.spawn-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
  white-space: nowrap;
}

.spawn-node-meta,
.item-node-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.spawn-name,
.item-node-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spawn-coords,
.item-node-coords {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.spawn-actions,
.item-node-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Quick Place Item Bar */
.place-item-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  margin-bottom: 8px;
}

.item-status-pill {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
}

.item-status-pill.ready {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.item-status-pill.respawning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Items Category Bar & Filter */
.item-category-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.item-cat-btn {
  padding: 6px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.item-cat-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.item-cat-btn.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Items Catalog Grid & Cards */
.items-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.item-element-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s ease;
  position: relative;
}

.item-element-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

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

.item-card-type-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.item-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.item-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.item-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.item-card-effect {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.item-card-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.item-card-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

/* FPS Quake-Style Player Status HUD */
.fps-player-hud {
  position: absolute;
  bottom: 20px;
  left: 20px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
  z-index: 15;
}

.hud-stat-cell {
  background: rgba(10, 14, 22, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.hud-stat-cell.health-cell {
  border-left: 3px solid #10b981;
}

.hud-stat-cell.health-cell.overheal {
  border-left: 3px solid #06b6d4;
}

.hud-stat-cell.health-cell.overheal .hud-stat-num {
  color: #22d3ee;
  text-shadow: 0 0 12px rgba(6, 182, 212, 0.6);
}

.hud-stat-cell.armor-cell {
  border-left: 3px solid #3b82f6;
}

.hud-stat-cell.armor-cell.armor-red {
  border-left: 3px solid #f43f5e;
}

.hud-stat-cell.armor-cell.armor-red .hud-stat-num {
  color: #fb7185;
}

.hud-stat-cell.ammo-cell {
  border-left: 3px solid #f59e0b;
}

.hud-stat-icon {
  font-size: 18px;
  line-height: 1;
}

.hud-stat-info {
  display: flex;
  flex-direction: column;
}

.hud-stat-name {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.hud-stat-num {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

/* Powerups List in FPS HUD */
.hud-powerups-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hud-powerup-badge {
  background: rgba(10, 14, 22, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 6px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
  animation: hudPulse 1.5s infinite alternate ease-in-out;
}

@keyframes hudPulse {
  from { opacity: 0.85; transform: scale(1); }
  to { opacity: 1.0; transform: scale(1.02); }
}

/* Item Pickup Toast Notification Overlay */
.item-pickup-toast {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 8px;
  background: rgba(10, 14, 22, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid var(--accent-cyan);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.35);
  border-radius: 8px;
  padding: 8px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  pointer-events: none;
  z-index: 25;
  animation: toastSlideDown 0.25s ease-out;
}

@keyframes toastSlideDown {
  from { opacity: 0; transform: translate(-50%, -15px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ==========================================================================
   Material Presentation Showroom HUD Overlays (Demo 08)
   ========================================================================== */
.showroom-hud-top {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(11, 15, 25, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 12px;
  padding: 10px 18px;
  z-index: 20;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: fadeInDown 0.3s ease-out;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.showroom-badge-title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.showroom-icon {
  font-size: 22px;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.5));
}

.showroom-title-text {
  display: flex;
  flex-direction: column;
}

.showroom-heading {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.06em;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.showroom-subheading {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.showroom-controls-cluster {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.showroom-btn-group {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(18, 24, 38, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 3px 6px;
}

.showroom-group-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  margin-right: 4px;
  letter-spacing: 0.05em;
}

.showroom-mode-btn,
.showroom-mesh-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.showroom-mode-btn:hover,
.showroom-mesh-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.showroom-mode-btn.active,
.showroom-mesh-btn.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.3) 0%, rgba(59, 130, 246, 0.3) 100%);
  border-color: var(--accent-cyan);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.35);
}

.showroom-turntable-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(18, 24, 38, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 4px 10px;
}

.showroom-toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  white-space: nowrap;
}

.showroom-toggle-label input[type="checkbox"] {
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

.showroom-slider {
  width: 70px;
  height: 4px;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

/* Floating Active Material Live Diagnostic Card */
.showroom-spec-card {
  position: absolute;
  top: 76px;
  left: 14px;
  width: 320px;
  background: rgba(11, 15, 25, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  padding: 14px;
  z-index: 18;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 20px rgba(56, 189, 248, 0.15);
  animation: fadeInLeft 0.25s ease-out;
  pointer-events: auto;
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

.spec-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.spec-swatch {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  background: #38bdf8;
}

.spec-title-group {
  flex: 1;
  min-width: 0;
}

.spec-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.spec-mat-name {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spec-cost-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.spec-cost-badge.med {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.4);
}

.spec-cost-badge.high {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
}

.spec-mat-category {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent-cyan);
  font-weight: 600;
}

.spec-mat-desc {
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.spec-params-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: rgba(18, 24, 38, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 8px;
}

.spec-param-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.spec-param-label {
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.spec-param-val {
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: #ffffff;
}

/* Material Quick-Jump Strip at Bottom of Viewport */
.showroom-hud-bottom {
  position: absolute;
  bottom: 14px;
  left: 14px;
  right: 14px;
  background: rgba(11, 15, 25, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 12px;
  padding: 8px 14px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.showroom-strip-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  color: var(--accent-cyan);
  letter-spacing: 0.08em;
}

.showroom-materials-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-cyan) rgba(255, 255, 255, 0.05);
}

.showroom-materials-strip::-webkit-scrollbar {
  height: 4px;
}

.showroom-materials-strip::-webkit-scrollbar-thumb {
  background: var(--accent-cyan);
  border-radius: 4px;
}

.showroom-mat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: rgba(18, 24, 38, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--text-main);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.showroom-mat-chip:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.45);
  transform: translateY(-2px);
  color: #ffffff;
}

.showroom-mat-chip.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.28) 0%, rgba(59, 130, 246, 0.28) 100%);
  border-color: var(--accent-cyan);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.4), inset 0 0 0 1px rgba(56, 189, 248, 0.3);
}

.showroom-chip-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}

.showroom-chip-badge {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

/* ==========================================
   DEMO 07 FPS STARTUP MENU & LOBBY OVERLAY
   ========================================== */
.fps-startup-overlay {
  position: absolute;
  inset: 0;
  z-index: 200;
  background: rgba(5, 8, 16, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease-out;
}

.fps-menu-card {
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(155deg, rgba(15, 23, 42, 0.96) 0%, rgba(8, 14, 28, 0.98) 100%);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 16px;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.85), 0 0 25px rgba(6, 182, 212, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
  color: #f8fafc;
}

.fps-menu-header {
  padding: 18px 24px;
  background: rgba(15, 23, 42, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fps-menu-title-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.fps-badge-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
}

.fps-menu-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 0;
  background: linear-gradient(135deg, #ffffff 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.fps-menu-sub {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
}

.fps-menu-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.fps-menu-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: #f87171;
}

.fps-menu-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
  padding: 22px 24px;
  overflow-y: auto;
}

@media (max-width: 820px) {
  .fps-menu-grid {
    grid-template-columns: 1fr;
  }
}

.fps-menu-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.fps-menu-section {
  background: rgba(18, 26, 44, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fps-section-heading {
  font-size: 13px;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.02em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.fps-badge-count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 8px;
  border-radius: 12px;
}

/* Map Grid */
.fps-map-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.fps-map-card {
  background: rgba(10, 15, 28, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.fps-map-card:hover {
  border-color: rgba(56, 189, 248, 0.5);
  transform: translateY(-2px);
  background: rgba(15, 23, 42, 0.9);
}

.fps-map-card.active {
  border-color: #06b6d4;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.35);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(59, 130, 246, 0.15));
}

.map-card-thumb {
  height: 52px;
  width: 100%;
  position: relative;
  background-size: cover;
  background-position: center;
}

.map-q3dm17 { background: linear-gradient(135deg, #1e1b4b, #312e81); }
.map-dm6 { background: linear-gradient(135deg, #450a0a, #7f1d1d); }
.map-dm4 { background: linear-gradient(135deg, #78350f, #92400e); }
.map-ztn { background: linear-gradient(135deg, #064e3b, #047857); }

.map-tag {
  position: absolute;
  top: 4px;
  right: 4px;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 800;
  background: #f59e0b;
  color: #000;
  padding: 1px 5px;
  border-radius: 3px;
}

.map-card-info {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.map-name {
  font-size: 11px;
  font-weight: 700;
  color: #f1f5f9;
}

.map-desc {
  font-size: 9px;
  color: #94a3b8;
  line-height: 1.3;
}

/* Forms & Loadouts */
.fps-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.fps-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fps-label {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fps-input, .fps-select {
  width: 100%;
  padding: 7px 10px;
  background: rgba(10, 15, 28, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  outline: none;
}

.fps-input:focus, .fps-select:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

.fps-loadout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.fps-loadout-btn {
  padding: 8px 10px;
  background: rgba(10, 15, 28, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fps-loadout-btn:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(56, 189, 248, 0.4);
  color: #fff;
}

.fps-loadout-btn.active {
  background: rgba(6, 182, 212, 0.2);
  border-color: #06b6d4;
  color: #38bdf8;
  font-weight: 700;
}

/* Lobby Players List */
.fps-lobby-players-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 140px;
  overflow-y: auto;
  padding-right: 4px;
}

.fps-lobby-player-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(10, 15, 28, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  font-size: 11px;
}

.fps-player-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fps-player-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.fps-player-status-dot.bot {
  background: #f59e0b;
  box-shadow: 0 0 6px #f59e0b;
}

.fps-player-alias {
  font-weight: 700;
  color: #f1f5f9;
}

.fps-player-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

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

.fps-secondary-btn {
  flex: 1;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.fps-secondary-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #ffffff;
}

/* Network Box */
.fps-net-status-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(10, 15, 28, 0.6);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 11px;
}

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

.net-label { color: #94a3b8; }
.net-val { font-weight: 600; color: #f1f5f9; }
.net-val.ping { color: #38bdf8; font-family: var(--font-mono); }
.net-val.ready { color: #10b981; font-weight: 700; }

/* Footer */
.fps-menu-footer {
  padding: 16px 24px;
  background: rgba(15, 23, 42, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.fps-hint-text {
  font-size: 11px;
  color: #94a3b8;
}

.fps-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.5);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.fps-start-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.7);
  background: linear-gradient(135deg, #0891b2 0%, #2563eb 100%);
}

/* 🎰 Cyber Slot Machine Overlay Styles */
.slot-machine-overlay-panel {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 340px;
  bottom: 16px;
  background: rgba(10, 15, 30, 0.92);
  border: 1.5px solid rgba(245, 158, 11, 0.45);
  border-radius: 12px;
  box-shadow: 0 0 35px rgba(0, 0, 0, 0.85), 0 0 15px rgba(245, 158, 11, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  z-index: 150;
  padding: 16px;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  animation: slideInLeft 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
  overscroll-behavior-y: contain;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.slot-machine-overlay-panel.mobile-minimized {
  transform: translateX(-115%);
  opacity: 0;
  pointer-events: none;
}

@keyframes slideInLeft {
  from { transform: translateX(-40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.slot-header {
  border-bottom: 1.5px solid rgba(245, 158, 11, 0.3);
  padding-bottom: 10px;
  margin-bottom: 14px;
}

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

.slot-header-btn {
  background: transparent;
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #94a3b8;
  border-radius: 4px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: bold;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.slot-header-btn:hover {
  background: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
  border-color: #fbbf24;
}

.slot-title {
  font-size: 16px;
  font-weight: 900;
  color: #f59e0b;
  letter-spacing: 0.1em;
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
  margin-bottom: 2px;
}

.slot-subtitle {
  font-size: 10px;
  color: #94a3b8;
}

.slot-stat-box {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.slot-stat-cell {
  display: flex;
  flex-direction: column;
}

.slot-stat-label {
  font-size: 9px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.slot-stat-value {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
}

.slot-stat-value.gold {
  color: #fbbf24;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

.slot-stat-value.win {
  color: #10b981;
  text-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.slot-paytable {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 14px;
  font-size: 10px;
}

.slot-paytable-title {
  color: #f59e0b;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  text-align: center;
}

.slot-paytable-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

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

.slot-paytable-symbol {
  display: flex;
  align-items: center;
  gap: 6px;
}

.slot-paytable-mult {
  color: #fbbf24;
  font-weight: bold;
}

.slot-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.slot-bet-selector {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.slot-bet-btn {
  flex: 1;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  font-size: 10px;
  font-weight: 800;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.slot-bet-btn.active {
  background: #f59e0b;
  border-color: #fbbf24;
  color: #0f172a;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.slot-spin-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.45);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

.slot-spin-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.6);
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.slot-spin-btn:active {
  transform: translateY(1px);
}

.slot-spin-btn:disabled {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.05);
  color: #64748b;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.slot-utility-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.slot-util-btn {
  flex: 1;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-size: 9px;
  font-weight: bold;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.slot-util-btn:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(255, 255, 255, 0.2);
}

.slot-history {
  margin-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
}

.slot-history-title {
  font-size: 10px;
  color: #94a3b8;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.slot-history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 110px;
  overflow-y: auto;
  font-size: 9px;
}

.slot-history-item {
  display: flex;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.3);
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.02);
}

.slot-history-item.win {
  border-color: rgba(16, 185, 129, 0.2);
  background: rgba(16, 185, 129, 0.05);
}

.slot-history-text {
  color: #e2e8f0;
}

.slot-history-text.win {
  color: #34d399;
}

.slot-history-payout {
  font-weight: bold;
  color: #fbbf24;
}

/* 🎰 Floating Top Banner for Slot machine Instructions */
.slot-machine-banner {
  position: absolute;
  top: 16px;
  left: 372px;
  right: 16px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 8px;
  padding: 10px 16px;
  color: #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 140;
  font-size: 11px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.slot-machine-banner.panel-closed {
  left: 16px;
}

/* 🎰 Slot Machine Desktop & Mobile Toggle Controls */
.slot-desktop-show-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid #f59e0b;
  border-radius: 8px;
  padding: 8px 16px;
  color: #fbbf24;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.05em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.75), 0 0 15px rgba(245, 158, 11, 0.3);
  cursor: pointer;
  z-index: 155;
  display: none;
  align-items: center;
  gap: 6px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.slot-desktop-show-btn:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: #fbbf24;
  color: #fef3c7;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.8), 0 0 20px rgba(245, 158, 11, 0.5);
  transform: translateY(-2px);
}

.slot-desktop-show-btn:active {
  transform: translateY(0);
}

.slot-mobile-bar {
  display: none;
}

/* 🧩 3D Sliding Puzzle Overlay Styles */
.puzzle-overlay-panel {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 340px;
  bottom: 16px;
  background: rgba(10, 15, 30, 0.92);
  border: 1.5px solid rgba(6, 182, 212, 0.45);
  border-radius: 12px;
  box-shadow: 0 0 35px rgba(0, 0, 0, 0.85), 0 0 15px rgba(6, 182, 212, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  z-index: 150;
  padding: 16px;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  animation: slideInLeft 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

.puzzle-header {
  text-align: center;
  border-bottom: 1.5px solid rgba(6, 182, 212, 0.3);
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.puzzle-title {
  font-size: 16px;
  font-weight: 900;
  color: #06b6d4;
  letter-spacing: 0.1em;
  text-shadow: 0 0 10px rgba(6, 182, 212, 0.6);
  margin-bottom: 2px;
}

.puzzle-subtitle {
  font-size: 10px;
  color: #94a3b8;
}

.puzzle-stat-box {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.puzzle-stat-cell {
  display: flex;
  flex-direction: column;
}

.puzzle-stat-label {
  font-size: 9px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.puzzle-stat-value {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
}

.puzzle-control-group {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
}

.puzzle-group-label {
  font-size: 10px;
  color: #38bdf8;
  font-weight: bold;
  text-transform: uppercase;
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}

.puzzle-grid-selector {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.puzzle-size-btn {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #94a3b8;
  padding: 6px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

.puzzle-size-btn:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.4);
  color: #e2e8f0;
}

.puzzle-size-btn.active {
  background: rgba(6, 182, 212, 0.25);
  border-color: #06b6d4;
  color: #22d3ee;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
}

.puzzle-primary-btn {
  background: linear-gradient(135deg, #0891b2 0%, #0369a1 100%);
  border: none;
  border-radius: 6px;
  color: white;
  padding: 10px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
}

.puzzle-primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(6, 182, 212, 0.35);
  background: linear-gradient(135deg, #06b6d4 0%, #0284c7 100%);
}

.puzzle-secondary-btn {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #cbd5e1;
  padding: 8px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

.puzzle-secondary-btn:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.puzzle-upload-zone {
  border: 1.5px dashed rgba(6, 182, 212, 0.35);
  border-radius: 8px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.4);
  cursor: pointer;
  transition: all 0.2s ease;
}

.puzzle-upload-zone:hover, .puzzle-upload-zone.dragover {
  border-color: #06b6d4;
  background: rgba(6, 182, 212, 0.08);
}

.puzzle-preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.puzzle-preset-card {
  height: 54px;
  border-radius: 6px;
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  background-size: cover;
  background-position: center;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s ease;
}

.puzzle-preset-card:hover {
  transform: scale(1.04);
  border-color: rgba(6, 182, 212, 0.5);
}

.puzzle-preset-card.active {
  border-color: #06b6d4;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

.preset-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(10, 15, 30, 0.85);
  font-size: 9px;
  color: #e2e8f0;
  text-align: center;
  padding: 2px 0;
  white-space: nowrap;
}

/* 🧩 Floating Top Banner for Sliding Puzzle Instructions */
.puzzle-banner {
  position: absolute;
  top: 16px;
  left: 372px;
  right: 16px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: 8px;
  padding: 10px 16px;
  color: #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 140;
  font-size: 11px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* 🟢 3D Plinko Overlay Styles */
.plinko-overlay-panel {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 340px;
  max-height: calc(100% - 32px);
  background: rgba(10, 20, 15, 0.94);
  border: 1.5px solid rgba(16, 185, 129, 0.45);
  border-radius: 12px;
  box-shadow: 0 0 35px rgba(0, 0, 0, 0.85), 0 0 15px rgba(16, 185, 129, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  z-index: 150;
  padding: 12px 14px;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  animation: slideInLeft 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(16, 185, 129, 0.4) transparent;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.plinko-overlay-panel::-webkit-scrollbar {
  width: 4px;
}
.plinko-overlay-panel::-webkit-scrollbar-thumb {
  background: rgba(16, 185, 129, 0.35);
  border-radius: 4px;
}

.plinko-overlay-panel.mobile-minimized {
  transform: translateX(-115%);
  opacity: 0;
  pointer-events: none;
}

.plinko-header {
  border-bottom: 1.5px solid rgba(16, 185, 129, 0.3);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

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

.plinko-header-btn {
  background: transparent;
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #94a3b8;
  border-radius: 4px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.plinko-header-btn:hover {
  border-color: #10b981;
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
}

.plinko-title {
  font-size: 15px;
  font-weight: 900;
  color: #10b981;
  letter-spacing: 0.08em;
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
  margin-bottom: 1px;
}

.plinko-subtitle {
  font-size: 9px;
  color: #a7f3d0;
  opacity: 0.8;
}

.plinko-stat-box {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 10px;
}

.plinko-stat-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 6px;
  background: rgba(16, 185, 129, 0.05);
  border-radius: 6px;
  border: 1px solid rgba(16, 185, 129, 0.1);
}

.plinko-stat-label {
  font-size: 8.5px;
  color: #6ee7b7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1px;
}

.plinko-stat-value {
  font-size: 14px;
  font-weight: bold;
  color: #ffffff;
}

.plinko-stat-value.green {
  color: #34d399;
  text-shadow: 0 0 8px rgba(52, 211, 153, 0.4);
}

.plinko-stat-value.gold {
  color: #fbbf24;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

.plinko-control-group {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.plinko-group-label {
  font-size: 9.5px;
  font-weight: bold;
  color: #94a3b8;
  margin-bottom: 6px;
  display: block;
}

.plinko-grid-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.plinko-size-btn, .plinko-type-btn, .plinko-effect-btn, .plinko-trail-btn {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #94a3b8;
  padding: 5px;
  font-size: 10.5px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: bold;
}

.plinko-size-btn:hover, .plinko-type-btn:hover, .plinko-effect-btn:hover, .plinko-trail-btn:hover {
  border-color: rgba(16, 185, 129, 0.5);
  color: #e2e8f0;
}

.plinko-size-btn.active, .plinko-type-btn.active, .plinko-effect-btn.active, .plinko-trail-btn.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
  color: #34d399;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.plinko-primary-btn {
  width: 100%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  color: #ffffff;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: bold;
  border-radius: 7px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3);
  transition: all 0.2s ease;
}

.plinko-primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(16, 185, 129, 0.4);
  filter: brightness(1.1);
}

.plinko-secondary-btn {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  padding: 6px;
  font-size: 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.plinko-secondary-btn:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.8);
}

/* 🟢 Floating Top Banner for Plinko Instructions */
.plinko-banner {
  position: absolute;
  top: 16px;
  left: 372px;
  right: 16px;
  background: rgba(10, 20, 15, 0.88);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 8px;
  padding: 8px 14px;
  color: #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 140;
  font-size: 11px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* 🟢 Floating Mobile FAB (Re-Open Plinko Controls) */
.plinko-mobile-fab {
  position: absolute;
  bottom: 18px;
  left: 14px;
  background: rgba(10, 20, 15, 0.92);
  border: 1.5px solid #10b981;
  border-radius: 24px;
  padding: 8px 16px;
  color: #34d399;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.05em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.75), 0 0 12px rgba(16, 185, 129, 0.35);
  cursor: pointer;
  z-index: 155;
  display: none;
  align-items: center;
  gap: 6px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.plinko-mobile-fab:active {
  transform: scale(0.95);
}

/* 🎰 Top Gameplay HUD for Roulette (Last 10 Results & Last Dropped Ball Number) */
.roulette-banner-hud {
  position: absolute;
  top: 16px;
  left: 372px;
  right: 16px;
  background: rgba(8, 20, 15, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 8px;
  padding: 6px 14px;
  color: #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  z-index: 140;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.65), 0 0 12px rgba(16, 185, 129, 0.15);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  transition: left 0.25s ease;
}

.roulette-banner-hud.panel-closed {
  left: 196px;
}

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

.roulette-hud-label {
  font-size: 9.5px;
  font-weight: 800;
  color: #6ee7b7;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.roulette-ball-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  transition: all 0.25s ease;
}

.roulette-ball-badge.large {
  min-width: 38px;
  height: 30px;
  padding: 0 8px;
  font-size: 15px;
  border-radius: 6px;
}

.roulette-ball-badge.small {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 11px;
  flex-shrink: 0;
}

.roulette-ball-badge.red {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  color: #ffffff;
  border: 1px solid #f87171;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.roulette-ball-badge.black {
  background: linear-gradient(135deg, #334155 0%, #0f172a 100%);
  color: #f1f5f9;
  border: 1px solid #64748b;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.roulette-ball-badge.green {
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  color: #ffffff;
  border: 1px solid #34d399;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.roulette-ball-badge.none {
  background: rgba(255, 255, 255, 0.06);
  color: #64748b;
  border: 1px dashed rgba(255, 255, 255, 0.2);
}

.roulette-hud-sep {
  width: 1px;
  height: 24px;
  background: rgba(16, 185, 129, 0.25);
  flex-shrink: 0;
}

.roulette-history-strip {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.roulette-history-strip::-webkit-scrollbar {
  display: none;
}

.roulette-banner-bets-btn {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-weight: bold;
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.roulette-banner-bets-btn:hover {
  background: rgba(16, 185, 129, 0.3);
  border-color: #10b981;
  color: #a7f3d0;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

/* 🎰 Desktop Show Bet UI Button */
.roulette-desktop-fab {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(8, 20, 15, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid #10b981;
  border-radius: 8px;
  padding: 8px 16px;
  color: #34d399;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.05em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.75), 0 0 15px rgba(16, 185, 129, 0.3);
  cursor: pointer;
  z-index: 155;
  display: none;
  align-items: center;
  gap: 6px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.roulette-desktop-fab:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: #34d399;
  color: #a7f3d0;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.8), 0 0 20px rgba(16, 185, 129, 0.5);
  transform: translateY(-2px);
}

.roulette-desktop-fab:active {
  transform: translateY(0);
}

/* 📱 Responsive Mobile Full-Screen Dialog Overlay */
@media (max-width: 768px) {
  .plinko-overlay-panel {
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100vw;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
    border: none;
    padding: 16px 14px 44px 14px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.95);
    background: rgba(10, 20, 15, 0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    animation: fadeIn 0.25s ease-out;
    box-sizing: border-box;
    z-index: 170;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    overscroll-behavior-y: contain;
  }

  .plinko-overlay-panel.mobile-minimized {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
  }

  .plinko-header {
    padding-bottom: 8px;
    margin-bottom: 12px;
  }

  .plinko-title {
    font-size: 15px;
    letter-spacing: 0.05em;
  }

  .plinko-subtitle {
    font-size: 9px;
  }

  .plinko-header-btn {
    width: 32px;
    height: 32px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 6px;
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.5);
    color: #34d399;
  }

  .plinko-stat-box {
    padding: 8px 10px;
    gap: 8px;
    margin-bottom: 12px;
    border-radius: 8px;
  }

  .plinko-stat-cell {
    padding: 4px 6px;
    border-radius: 6px;
  }

  .plinko-stat-label {
    font-size: 9px;
    margin-bottom: 2px;
  }

  .plinko-stat-value {
    font-size: 15px;
  }

  .plinko-control-group {
    padding-bottom: 8px;
    margin-bottom: 10px;
  }

  .plinko-group-label {
    font-size: 10px;
    margin-bottom: 5px;
  }

  .plinko-grid-selector {
    gap: 6px;
  }

  .plinko-size-btn, .plinko-type-btn, .plinko-effect-btn, .plinko-trail-btn {
    padding: 8px 10px;
    font-size: 11px;
    min-height: 36px;
  }

  .plinko-primary-btn {
    padding: 12px 14px;
    font-size: 14px;
    border-radius: 8px;
    min-height: 44px;
    letter-spacing: 0.05em;
  }

  .plinko-secondary-btn {
    padding: 10px 12px;
    font-size: 11px;
    border-radius: 6px;
    min-height: 40px;
  }

  .plinko-banner {
    left: 8px;
    right: 8px;
    top: 8px;
    padding: 6px 10px;
    font-size: 9.5px;
    border-radius: 6px;
  }

  .plinko-mobile-fab {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    white-space: nowrap;
    padding: 10px 22px;
    font-size: 12px;
    border-radius: 28px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.9), 0 0 20px rgba(16, 185, 129, 0.5);
  }

  .plinko-mobile-fab:active {
    transform: translateX(-50%) scale(0.95);
  }

  .roulette-banner-hud {
    left: 8px !important;
    right: 8px !important;
    top: 8px !important;
    padding: 6px 8px;
    gap: 6px;
    border-radius: 6px;
    justify-content: space-between;
  }

  .roulette-ball-badge.large {
    min-width: 32px;
    height: 26px;
    font-size: 13px;
    padding: 0 4px;
  }

  .roulette-ball-badge.small {
    width: 22px;
    height: 22px;
    font-size: 10px;
  }

  .roulette-hud-label {
    font-size: 8px;
  }

  .roulette-history-strip {
    gap: 3px;
    max-width: 175px;
  }

  .roulette-banner-bets-btn {
    padding: 4px 8px;
    font-size: 10px;
  }

  .roulette-desktop-fab {
    display: none !important;
  }

  /* 🎰 Slot Machine Mobile Optimization & Minimize */
  .slot-machine-overlay-panel {
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100vw;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
    border: none;
    padding: 16px 14px 44px 14px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.95);
    background: rgba(10, 15, 30, 0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    animation: fadeIn 0.25s ease-out;
    box-sizing: border-box;
    z-index: 170;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    overscroll-behavior-y: contain;
  }

  .slot-machine-overlay-panel.mobile-minimized {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
  }

  .slot-header-btn {
    width: 32px;
    height: 32px;
    font-size: 16px;
    border-radius: 6px;
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.5);
    color: #fbbf24;
  }

  .slot-machine-banner {
    left: 8px !important;
    right: 8px !important;
    top: 8px !important;
    padding: 6px 10px;
    font-size: 9.5px;
    border-radius: 6px;
    justify-content: space-between;
  }

  .slot-mobile-bar {
    position: absolute;
    bottom: 18px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    z-index: 160;
    pointer-events: none;
  }

  .slot-mobile-fab,
  .slot-mobile-spin-fab {
    pointer-events: auto;
  }

  .slot-mobile-fab {
    background: rgba(10, 15, 30, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid #f59e0b;
    border-radius: 24px;
    padding: 10px 18px;
    color: #fbbf24;
    font-weight: 800;
    font-size: 11.5px;
    letter-spacing: 0.04em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.85), 0 0 14px rgba(245, 158, 11, 0.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .slot-mobile-fab:active {
    transform: scale(0.95);
  }

  .slot-mobile-spin-fab {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    padding: 10px 22px;
    color: #0f172a;
    font-weight: 900;
    font-size: 13px;
    letter-spacing: 0.05em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    box-shadow: 0 4px 22px rgba(0, 0, 0, 0.85), 0 0 18px rgba(245, 158, 11, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .slot-mobile-spin-fab:active {
    transform: scale(0.95);
  }

  .slot-mobile-spin-fab:disabled,
  .slot-mobile-spin-fab.disabled {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.08);
    color: #64748b;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
  }

  .slot-desktop-show-btn {
    display: none !important;
  }
}

/* High-Visibility Header Embedded Active Demo Selector with Crimson/Red accents */
.header-demo-selector-container {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(140, 15, 25, 0.95), rgba(15, 18, 26, 0.95));
  border: 1.5px solid #ef4444;
  border-radius: 6px;
  padding: 5px 12px;
  min-width: 280px;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
  margin-left: 20px;
}

.header-demo-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  color: #fca5a5;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.header-demo-select {
  background-color: rgba(15, 10, 12, 0.95);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.5);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  width: 100%;
}

.header-demo-select:hover {
  border-color: #ef4444;
  background-color: rgba(30, 10, 15, 0.95);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

.header-demo-select:focus {
  border-color: #f87171;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}

/* Active Live Demo Primary Panel in Controls & Demos (Styled with crimson/red components for high visibility) */
.active-demo-panel-primary {
  background: linear-gradient(135deg, rgba(120, 15, 25, 0.35), rgba(18, 22, 34, 0.9)) !important;
  border: 1.5px solid rgba(239, 68, 68, 0.5) !important;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.18), 0 0 8px rgba(0, 0, 0, 0.5);
  position: relative;
  transition: all 0.2s ease;
}

.active-demo-panel-primary:hover {
  border-color: #ef4444 !important;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}

.active-demo-select-highlight {
  background-color: rgba(18, 10, 14, 0.95) !important;
  color: #fecaca !important;
  border: 1px solid rgba(239, 68, 68, 0.5) !important;
  font-weight: 600;
  border-radius: 6px;
  padding: 8px 10px;
  transition: all 0.2s ease;
}

.active-demo-select-highlight:focus,
.active-demo-select-highlight:hover {
  border-color: #ef4444 !important;
  background-color: rgba(30, 12, 18, 0.95) !important;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

/* Independent Scroll Configuration for API Docs Tab */
#tab-api-docs {
  height: 100% !important;
  width: 100% !important;
  overflow: hidden !important;
  display: none;
}

#tab-api-docs.active {
  display: flex !important;
  flex-direction: column !important;
}

.full-page-editor-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

#tab-api-docs .controls-scroll-area {
  flex: 1 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  height: calc(100% - 44px) !important;
  padding: 24px;
}

/* Responsive visibility for Live Demo dropdowns */
@media (max-width: 900px) {
  .header-demo-selector-container {
    display: none !important;
  }
  #active-live-demo-panel {
    display: block !important;
  }
}

@media (min-width: 901px) {
  .header-demo-selector-container {
    display: flex !important;
  }
  #active-live-demo-panel {
    display: none !important;
  }
}

/* 🎱 Demo 13: 3D Real-Physics Bingo & Diamond Drum Styles */
.bingo-overlay-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 360px;
  max-height: calc(100% - 32px);
  background: rgba(10, 18, 30, 0.94);
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.75), 0 0 24px rgba(56, 189, 248, 0.2);
  border-radius: 12px;
  backdrop-filter: blur(14px);
  z-index: 150;
  display: flex;
  flex-direction: column;
  color: #f1f5f9;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.4) transparent;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  pointer-events: auto;
}

.bingo-overlay-panel.minimized,
.bingo-overlay-panel.mobile-minimized {
  transform: translateX(120%);
  opacity: 0;
  pointer-events: none;
}

.bingo-header {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.15) 0%, transparent 100%);
}

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

.bingo-header .plinko-header-btn {
  border-color: rgba(56, 189, 248, 0.4);
  color: #93c5fd;
  width: 26px;
  height: 26px;
  font-size: 13px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.6);
  transition: all 0.2s;
  pointer-events: auto;
}

.bingo-header .plinko-header-btn:hover {
  border-color: #38bdf8;
  color: #ffffff;
  background: rgba(56, 189, 248, 0.25);
  transform: scale(1.05);
}

.bingo-title {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.05em;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bingo-subtitle {
  font-size: 10px;
  font-family: monospace;
  color: #93c5fd;
  margin-top: 2px;
  letter-spacing: 0.04em;
}

/* Callout Bar */
.bingo-callout-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 10px 14px 4px;
}

.bingo-big-ball {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-weight: 900;
  font-family: monospace;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bingo-big-ball .ball-letter {
  font-size: 11px;
  line-height: 1;
  opacity: 0.9;
}

.bingo-big-ball .ball-num {
  font-size: 20px;
  line-height: 1;
  font-weight: 900;
}

/* Ball category theme colors */
.ball-cat-B { background: radial-gradient(circle at 35% 30%, #38bdf8, #0284c7 70%, #0369a1); color: #ffffff; }
.ball-cat-I { background: radial-gradient(circle at 35% 30%, #f87171, #dc2626 70%, #991b1b); color: #ffffff; }
.ball-cat-N { background: radial-gradient(circle at 35% 30%, #ffffff, #e2e8f0 70%, #94a3b8); color: #0f172a; text-shadow: none; }
.ball-cat-G { background: radial-gradient(circle at 35% 30%, #4ade80, #16a34a 70%, #166534); color: #ffffff; }
.ball-cat-O { background: radial-gradient(circle at 35% 30%, #fb923c, #ea580c 70%, #9a3412); color: #ffffff; }
.ball-cat-none { background: #334155; color: #64748b; }

.bingo-callout-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bingo-callout-label {
  font-size: 10px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bingo-callout-text {
  font-size: 13px;
  font-weight: 700;
  color: #e2e8f0;
}

.bingo-history-strip {
  display: flex;
  gap: 5px;
  margin-top: 4px;
}

.bingo-mini-ball {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: bold;
  font-family: monospace;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* 5x5 Classic Bingo Card */
.bingo-card-container {
  padding: 10px 14px;
}

.bingo-card {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 8px;
  padding: 8px;
}

.bingo-col-header {
  font-weight: 900;
  font-size: 14px;
  font-family: monospace;
  text-align: center;
  padding: 4px 0;
  border-radius: 4px;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.bingo-cell {
  aspect-ratio: 1;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  font-family: monospace;
  color: #cbd5e1;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  user-select: none;
}

.bingo-cell:hover:not(.daubed) {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #ffffff;
  transform: scale(1.04);
}

.bingo-cell.free-cell {
  background: rgba(245, 158, 11, 0.25);
  border-color: #f59e0b;
  color: #fbbf24;
  font-size: 10px;
  font-weight: 900;
}

.bingo-cell.daubed {
  background: rgba(14, 165, 233, 0.35);
  border-color: #38bdf8;
  color: #ffffff;
}

.bingo-cell.daubed::after {
  content: '';
  position: absolute;
  width: 76%;
  height: 76%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.85) 0%, rgba(220, 38, 38, 0.7) 65%, transparent 100%);
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: screen;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
  animation: daubStamp 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.bingo-cell.winning {
  border-color: #fbbf24 !important;
  background: rgba(251, 191, 36, 0.35) !important;
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.6);
  animation: winPulse 1.2s infinite alternate;
}

@keyframes daubStamp {
  0% { transform: scale(1.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes winPulse {
  0% { box-shadow: 0 0 6px rgba(251, 191, 36, 0.4); }
  100% { box-shadow: 0 0 16px rgba(251, 191, 36, 0.9); }
}

/* Master Board 75 Numbers in Tab */
.bingo-master-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}

.bingo-master-tag {
  width: 24px;
  font-weight: 900;
  font-size: 12px;
  font-family: monospace;
  text-align: center;
  padding: 3px 0;
  border-radius: 4px;
  color: #fff;
  flex-shrink: 0;
}

.bingo-master-grid {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 3px;
  flex: 1;
}

.bingo-master-num {
  font-size: 10px;
  font-family: monospace;
  text-align: center;
  padding: 3px 0;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  color: #64748b;
  transition: all 0.2s ease;
}

.bingo-master-num.active {
  background: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
  font-weight: bold;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

/* Floating HUD banner */
.bingo-banner-hud {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(10, 18, 30, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  border-radius: 10px;
  padding: 8px 14px;
  z-index: 140;
  backdrop-filter: blur(12px);
  pointer-events: auto;
}

.bingo-win-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0f172a;
  font-weight: 900;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  display: none;
  animation: winPulse 1s infinite alternate;
}

/* Mobile responsive for Bingo overlay */
@media (max-width: 768px) {
  .bingo-overlay-panel {
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 100%;
    border-radius: 0;
    border: none;
    z-index: 1000;
  }
  .bingo-overlay-panel.minimized {
    transform: translateY(100%);
  }
  .bingo-banner-hud {
    left: 8px;
    right: 8px;
    transform: none;
    top: 8px;
    padding: 6px 10px;
    gap: 8px;
    justify-content: space-between;
  }
}

/* ==========================================================================
   DEMO 09: RETRO 3D ARCADE PONG (MODAL, HUD & VIDEO CHAT SEATS)
   ========================================================================== */

/* Mode Selection Ask Popup Modal */
.pong-modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 7, 18, 0.88);
  backdrop-filter: blur(10px);
  padding: 16px;
  animation: pongFadeIn 0.25s ease-out;
}

@keyframes pongFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.pong-modal-card {
  width: 100%;
  max-width: 580px;
  background: radial-gradient(ellipse at 50% 0%, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(56, 189, 248, 0.15);
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  color: #f8fafc;
  font-family: var(--font-sans, system-ui, sans-serif);
}

.pong-modal-header {
  text-align: center;
  position: relative;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pong-modal-title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #38bdf8 0%, #a855f7 50%, #f43f5e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 4px;
}

.pong-modal-subtitle {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
}

.pong-mode-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pong-mode-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(30, 41, 59, 0.6);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.pong-mode-card:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(56, 189, 248, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.pong-mode-card.active {
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.3) 0%, rgba(30, 41, 59, 0.85) 100%);
  border-color: #38bdf8;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
}

.pong-mode-icon {
  font-size: 28px;
  width: 46px;
  height: 46px;
  min-width: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.pong-mode-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pong-mode-title {
  font-size: 14px;
  font-weight: 700;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pong-mode-desc {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.4;
}

.pong-mode-badge {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.pong-options-subgrid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 14px;
  gap: 10px;
  flex-wrap: wrap;
}

.pong-setting-label {
  font-size: 11px;
  font-weight: 600;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pong-diff-btn-group {
  display: flex;
  gap: 4px;
}

.pong-diff-btn {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.pong-diff-btn.active {
  background: #38bdf8;
  border-color: #38bdf8;
  color: #0f172a;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.pong-video-toggle-container {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.pong-video-toggle-container input {
  cursor: pointer;
  accent-color: #38bdf8;
  width: 16px;
  height: 16px;
}

.pong-modal-footer {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.pong-btn-start {
  flex: 1;
  padding: 12px 20px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: 1px solid #38bdf8;
  border-radius: 10px;
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.4);
  transition: all 0.2s;
}

.pong-btn-start:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.6);
}

.pong-btn-cancel {
  padding: 12px 18px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.pong-btn-cancel:hover {
  background: rgba(51, 65, 85, 0.8);
  color: #ffffff;
}

/* Floating Top Banner HUD for Pong */
.pong-banner-hud {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(15, 23, 42, 0.9);
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  border-radius: 14px;
  padding: 8px 18px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(56, 189, 248, 0.15);
  backdrop-filter: blur(8px);
  pointer-events: auto;
  font-family: var(--font-mono, monospace);
}

.pong-score-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pong-score-badge {
  font-size: 22px;
  font-weight: 900;
  min-width: 30px;
  text-align: center;
}

.pong-score-badge.cyan {
  color: #38bdf8;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

.pong-score-badge.red {
  color: #f43f5e;
  text-shadow: 0 0 10px rgba(244, 63, 94, 0.6);
}

.pong-score-divider {
  font-size: 16px;
  font-weight: 900;
  color: #64748b;
}

.pong-hud-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pong-hud-mode-tag {
  font-size: 10px;
  font-weight: 800;
  color: #a855f7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pong-hud-status {
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pong-hud-btn {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f1f5f9;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
  white-space: nowrap;
}

.pong-hud-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #38bdf8;
}

/* Video Chat Seats Overlay (Left & Right or Bottom Floating) */
.pong-video-seats-container {
  position: absolute;
  top: 76px;
  left: 18px;
  right: 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  z-index: 45;
}

.pong-video-seat {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.88);
  border: 2px solid rgba(56, 189, 248, 0.4);
  border-radius: 14px;
  width: 144px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  position: relative;
  transition: all 0.2s;
}

.pong-video-seat.opponent {
  border-color: rgba(244, 63, 94, 0.4);
}

.pong-video-frame {
  position: relative;
  width: 128px;
  height: 96px;
  background: #020617;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pong-video-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pong-video-frame video.mirrored {
  transform: scaleX(-1);
}

.pong-avatar-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.pong-avatar-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.pong-seat-name {
  font-size: 11px;
  font-weight: 700;
  margin-top: 6px;
  max-width: 124px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 2px #000;
}

.pong-seat-ctrls {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  width: 100%;
}

.pong-seat-ctrl-btn {
  flex: 1;
  padding: 4px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  font-size: 10px;
  color: #cbd5e1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.pong-seat-ctrl-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #38bdf8;
}

.pong-seat-ctrl-btn.off {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fca5a5;
}

@media (max-width: 640px) {
  .pong-banner-hud {
    width: 95%;
    max-width: 360px;
    padding: 6px 12px;
    gap: 8px;
    justify-content: space-between;
  }
  .pong-video-seats-container {
    top: 64px;
    left: 8px;
    right: 8px;
  }
  .pong-video-seat {
    width: 110px;
    padding: 6px;
  }
  .pong-video-frame {
    width: 98px;
    height: 74px;
  }
}

/* ==========================================================================
   DEMO 10: MOBA 3D TRANSPARENT & MOBILE-ADAPTED STYLES
   ========================================================================== */
#moba-startup-menu,
#moba-overlay {
  pointer-events: none;
}

#moba-startup-menu * {
  box-sizing: border-box;
}

@media (max-width: 768px) {
  #moba-startup-menu {
    padding: 4px !important;
  }
  
  #moba-startup-menu .relative.w-full {
    height: 100% !important;
    max-height: 100% !important;
  }

  #moba-hero-loop-bar {
    padding: 3px 8px !important;
    margin: 2px auto !important;
    max-width: 320px !important;
  }

  #moba-btn-prev-hero,
  #moba-btn-next-hero {
    opacity: 0.95;
    touch-action: manipulation;
  }

  #moba-hud-top {
    padding: 4px 6px !important;
  }

  #moba-hud-bottom {
    padding: 1px 2px !important;
    gap: 2px !important;
    max-height: none !important;
  }

  .moba-spell-slot {
    width: 36px !important;
    height: 36px !important;
    border-radius: 4px !important;
  }

  #moba-selected-details {
    padding: 6px 8px !important;
    margin-bottom: 2px !important;
    gap: 4px !important;
  }

  #moba-col-rooms,
  #moba-col-roster {
    max-height: calc(100vh - 130px) !important;
    padding: 6px !important;
  }
}

/* ==========================================================================
   DESKTOP ONLY BOTTOM HUD RESIZING (DONT TOUCH MOBILE ARCHITECTURE)
   ========================================================================== */
@media (min-width: 769px) {
  /* Desktop bottom HUD footer height increased to 2x (comfortable 144px) */
  #moba-hud-bottom {
    height: 144px !important;
    min-height: 144px !important;
    max-height: 144px !important;
    padding: 12px 24px !important;
  }

  /* Make portrait larger to match the taller footer */
  #moba-hud-bottom .shrink-0 .relative,
  #moba-hud-bottom #moba-portrait-img {
    width: 80px !important;
    height: 80px !important;
  }

  /* Uniform size compromise for magic spells and inventory cells */
  .moba-spell-slot,
  #moba-inventory-grid > div {
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    min-height: 56px !important;
  }

  /* Font size & padding scaling for larger desktop slots */
  .moba-spell-slot span, 
  .moba-spell-slot div {
    font-size: 11px !important;
  }
  
  #moba-inventory-grid > div span {
    font-size: 11px !important;
  }

  #moba-inventory-grid > div div.absolute.top-0.right-0 {
    width: 16px !important;
    height: 16px !important;
    font-size: 11px !important;
  }
}

/* ==========================================================================
   MOBILE PORTRAIT AND MOBILE LAYOUT OVERRIDES (INVENTORY FIT & COMPACT)
   ========================================================================== */
@media (max-width: 768px) {
  /* Footer container: zero excess padding/margins to use full space */
  #moba-hud-bottom {
    padding: 1px 2px !important;
    gap: 2px !important;
  }

  /* Left cluster: packed neatly to the left without wasted padding or margins */
  #moba-footer-left-group {
    padding: 0 !important;
    margin: 0 !important;
    gap: 2px !important;
  }

  /* Compact portrait */
  #moba-hud-bottom .shrink-0 .relative,
  #moba-hud-bottom #moba-portrait-img {
    width: 28px !important;
    height: 28px !important;
  }

  /* Energy and mana bars: slim height, width strictly untouched as requested */
  #moba-hero-hp-container {
    height: 3.5px !important;
    min-height: 3.5px !important;
    max-height: 4px !important;
    border-radius: 9999px !important;
  }

  #moba-hero-mp-container {
    height: 2.5px !important;
    min-height: 2.5px !important;
    max-height: 3px !important;
    border-radius: 9999px !important;
  }

  #moba-hero-hp-bar,
  #moba-hero-mp-bar {
    height: 100% !important;
  }

  /* Compact attributes: zero wasted margin */
  #moba-hud-bottom .flex.flex-col.justify-center.border-l,
  #moba-hud-bottom .flex.flex-col.justify-center {
    border-left: none !important;
    padding-left: 1px !important;
    margin: 0 !important;
  }

  #moba-hud-bottom .grid-cols-2 {
    gap-x: 1.5px !important;
    gap-y: 0.5px !important;
  }

  #moba-hud-bottom .grid-cols-2 span {
    font-size: 7px !important;
  }

  /* For mobile devices description is an independent popup OUT from footer */
  #moba-footer-description {
    display: none !important;
  }

  /* Independent popup floating outside/above the footer */
  #moba-hud-description {
    bottom: calc(100% + 8px) !important;
    max-width: 94vw !important;
    font-size: 10.5px !important;
    padding: 3px 8px !important;
    z-index: 100 !important;
  }

  /* Magic spell slots: larger to use space */
  .moba-spell-slot {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    padding: 1px !important;
    margin: 0 !important;
    border-radius: 4px !important;
  }

  .moba-spell-slot span,
  .moba-spell-slot div {
    font-size: 7.5px !important;
  }

  /* Right cluster: inventory grid firmly anchored to the right, no margin/padding */
  #moba-footer-right-group {
    margin: 0 !important;
    margin-left: auto !important;
    padding: 0 !important;
    gap: 2px !important;
  }

  /* Inventory grid: larger cells to use space while all 6 slots stay 100% visible */
  #moba-inventory-grid {
    gap: 1px !important;
    padding: 0.5px !important;
    margin: 0 !important;
  }

  #moba-inventory-grid > div {
    width: 25px !important;
    height: 25px !important;
    min-width: 25px !important;
    min-height: 25px !important;
    font-size: 8px !important;
    border-radius: 3px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #moba-inventory-grid > div div.absolute.top-0.right-0 {
    width: 10px !important;
    height: 10px !important;
    font-size: 7px !important;
  }

  #moba-gold {
    font-size: 9px !important;
  }
}

@media (max-width: 400px) {
  /* Extra-compact mobile screens */
  #moba-hud-bottom {
    padding: 1px 1px !important;
    gap: 1.5px !important;
  }

  #moba-footer-left-group {
    gap: 1.5px !important;
  }

  .moba-spell-slot {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
  }

  #moba-inventory-grid > div {
    width: 23px !important;
    height: 23px !important;
    min-width: 23px !important;
    min-height: 23px !important;
    font-size: 7.5px !important;
  }
}

/* Retro 3D Arcade Pong Popup mobile scroll fix */
@media (max-width: 768px) {
  .pong-modal-backdrop {
    align-items: flex-start !important;
    overflow-y: auto !important;
    padding: 12px !important;
  }
  .pong-modal-card {
    max-height: 85vh !important;
    max-height: 85dvh !important;
    overflow-y: auto !important;
    padding: 16px 20px !important;
    gap: 12px !important;
  }
}












