/* ==========================================================================
   INTERNODE ARCADE HUB - LAYOUT & NAVIGATION
   Command Deck Header, Edge Chevron Handles, Dual Slide-out Drawers
   ========================================================================== */

/* Top Command Deck Header */
.hub-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 100;
  height: var(--header-height);
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.25rem;
  gap: 1rem;
}

.header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.header-game-title {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--text-primary);
  text-transform: uppercase;
  margin: 0;
  line-height: 1;
  transition: opacity 0.22s var(--transition-normal), transform 0.22s var(--transition-normal);
}

body.toast-active .header-game-title {
  opacity: 0 !important;
  transform: scale(0.96);
  pointer-events: none;
}

/* --- High-Precision Netcode Telemetry Badge --- */
.header-net-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm, 4px);
  font-family: var(--font-mono, monospace);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #10b981;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: help;
  user-select: none;
  height: 24px;
}

.header-net-status .net-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
  animation: net-pulse 2s infinite ease-in-out;
}

.header-net-status[data-quality="excellent"] {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.35);
  color: #10b981;
}

.header-net-status[data-quality="good"] {
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.35);
  color: #06b6d4;
}

.header-net-status[data-quality="fair"] {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.35);
  color: #f59e0b;
}

.header-net-status[data-quality="poor"] {
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.35);
  color: #f43f5e;
}

.header-net-status[data-quality="offline"] {
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
}

.header-net-status[data-quality="offline"] .net-status-dot {
  animation: none;
  box-shadow: none;
  opacity: 0.5;
}

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

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


.brand-mark {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  text-transform: uppercase;
}

.brand-dot {
  width: 9px;
  height: 9px;
  background-color: var(--accent-orange);
  border-radius: 2px;
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--accent-orange);
  background: var(--accent-orange-dim);
  border: 1px solid var(--accent-orange-border);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
}

/* Nav Tabs */
.header-nav,
.footer-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.header-nav::-webkit-scrollbar,
.footer-nav::-webkit-scrollbar { display: none; }

.nav-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.nav-tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
  border-color: var(--border-subtle);
}

.nav-tab-btn.active {
  color: var(--accent-orange);
  background: rgba(255, 107, 0, 0.12);
  border-color: var(--accent-orange-border);
  box-shadow: inset 0 -2px 0 var(--accent-orange), 0 0 12px rgba(255, 107, 0, 0.2);
}

.hub-footer .nav-tab-btn.active {
  box-shadow: inset 0 2px 0 var(--accent-orange), 0 0 12px rgba(255, 107, 0, 0.2);
}


.telemetry-strip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.3rem 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-secondary);
}

.telemetry-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.telemetry-item + .telemetry-item {
  border-left: 1px solid var(--border-subtle);
  padding-left: 0.5rem;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--status-ok);
}
.status-dot.warn { background: var(--status-warn); }
.status-dot.err { background: var(--status-err); }

/* Physical Drawer Edge Tabs (100% Parity with In-Game Drawers) */
.drawer-tab,
.drawer-edge-handle {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 65;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  cursor: pointer;
  user-select: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
  padding: 0;
  outline: none;
}

.drawer-tab-left,
.drawer-edge-handle.left {
  left: 100%;
  width: 28px;
  height: 104px;
  border: 1px solid var(--border-subtle);
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.drawer-tab-right,
.drawer-edge-handle.right {
  right: 100%;
  width: 28px;
  height: 104px;
  border: 1px solid var(--border-subtle);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.drawer-tab:hover,
.drawer-edge-handle:hover {
  background: var(--bg-surface-hover);
  color: var(--accent-orange);
  border-color: var(--accent-orange-border);
}

.drawer-tab-left:hover,
.drawer-edge-handle.left:hover {
  transform: translateY(-50%) translateX(2px);
}

.drawer-tab-right:hover,
.drawer-edge-handle.right:hover {
  transform: translateY(-50%) translateX(-2px);
}

.drawer-tab[aria-expanded="true"],
.dock-drawer[data-state="expanded"] .drawer-tab,
.dock-drawer.active .drawer-tab {
  background: var(--bg-surface-elevated);
  color: var(--accent-orange);
  border-color: var(--accent-orange-border);
}

.drawer-tab .tab-icon {
  font-size: 0.85rem;
  line-height: 1;
}

.drawer-tab .tab-label,
.drawer-edge-handle .handle-label {
  font-size: 0.5625rem;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.08em;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  text-transform: uppercase;
}

.drawer-tab .tab-shortcut {
  font-size: 0.55rem;
  font-family: var(--font-mono);
  color: var(--accent-orange);
  opacity: 0.85;
  line-height: 1;
}

.drawer-tab-left .tab-arrow::before,
.drawer-edge-handle.left .chevron-icon::before {
  content: '▶';
  font-size: 0.625rem;
  line-height: 1;
}

.dock-drawer[data-state="expanded"] .drawer-tab-left .tab-arrow::before,
.dock-drawer.active .drawer-tab-left .tab-arrow::before,
.drawer-tab-left[aria-expanded="true"] .tab-arrow::before {
  content: '◀';
}

.drawer-tab-right .tab-arrow::before,
.drawer-edge-handle.right .chevron-icon::before {
  content: '◀';
  font-size: 0.625rem;
  line-height: 1;
}

.dock-drawer[data-state="expanded"] .drawer-tab-right .tab-arrow::before,
.dock-drawer.active .drawer-tab-right .tab-arrow::before,
.drawer-tab-right[aria-expanded="true"] .tab-arrow::before {
  content: '▶';
}

/* Slide-out Dock Drawers */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 14, 0.45);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.drawer-backdrop.active,
.drawer-backdrop[data-active="true"] {
  opacity: 1;
  pointer-events: auto;
}

.dock-drawer {
  position: fixed;
  top: var(--header-height);
  bottom: var(--footer-height);
  width: var(--drawer-width);
  max-width: 90vw;
  background: var(--bg-surface);
  z-index: 95;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal);
  will-change: transform;
  overflow: visible;
}

#drawer-left,
.dock-drawer.left {
  left: 0;
  border-right: 1px solid var(--border-subtle);
  transform: translateX(-100%);
}

#drawer-left[data-state="expanded"],
.dock-drawer.left.active {
  transform: translateX(0);
  box-shadow: 10px 0 35px rgba(0, 0, 0, 0.65);
}

#drawer-right,
.dock-drawer.right {
  right: 0;
  border-left: 1px solid var(--border-subtle);
  transform: translateX(100%);
}

#drawer-right[data-state="expanded"],
.dock-drawer.right.active {
  transform: translateX(0);
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.65);
}

/* Game Mode Zero-Effects: Complete Elimination of Backdrop Scrims, Overlays & Drop Shadows */
body.game-active .drawer-backdrop,
body.in-game .drawer-backdrop,
body.game-active #drawer-backdrop,
body.in-game #drawer-backdrop,
body.game-chess .drawer-backdrop,
body[data-active-game="chess"] .drawer-backdrop {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.game-active #drawer-left[data-state="expanded"],
body.game-active #drawer-right[data-state="expanded"],
body.game-active .dock-drawer.active,
body.in-game #drawer-left[data-state="expanded"],
body.in-game #drawer-right[data-state="expanded"],
body.in-game .dock-drawer.active,
body.game-chess #drawer-left[data-state="expanded"],
body.game-chess #drawer-right[data-state="expanded"],
body.game-chess .dock-drawer.active,
body[data-active-game="chess"] #drawer-left[data-state="expanded"],
body[data-active-game="chess"] #drawer-right[data-state="expanded"],
body[data-active-game="chess"] .dock-drawer.active {
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
}

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

.drawer-title {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.drawer-close-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  border: 1px solid transparent;
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition-fast);
}
.drawer-close-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--accent-orange);
  border-color: var(--border-subtle);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.drawer-section {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.drawer-section-title {
  font-size: 0.725rem;
  font-weight: 700;
  color: var(--accent-orange);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-action-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  width: 100%;
}

.btn-action-secondary:hover {
  background: var(--bg-surface-hover);
  color: var(--accent-orange);
  border-color: var(--accent-orange-border);
}

/* Main Hub Content Area */
.hub-main {
  max-width: 1360px;
  width: 100%;
  margin: 0 auto;
  padding: calc(var(--header-height) + 1.5rem) 1.5rem calc(var(--footer-height) + 1.5rem);
  min-height: 100vh;
  box-sizing: border-box;
  transition: padding var(--transition-fast);
}

/* Full-Height Dynamic Studio Mode (Zero-Scroll Creative Workstation) */
.hub-main.studio-mode {
  max-width: 100%;
  padding: calc(var(--header-height) + 0.65rem) 1rem calc(var(--footer-height) + 0.65rem);
  height: 100vh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.tab-pane {
  display: none;
  contain: layout style;
  content-visibility: auto;
  contain-intrinsic-size: 800px;
}
.tab-pane.active {
  display: block;
  contain: none;
  content-visibility: visible;
}

.tab-pane.studio-pane.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

/* Full-Height Dynamic Game Host Mode (Seamless HUD Template Hosting) */
.hub-main.game-mode {
  max-width: 100%;
  padding: var(--header-height) 0 var(--footer-height);
  height: 100vh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  transition: margin-left var(--transition-normal), margin-right var(--transition-normal);
}

@media (min-width: 1024px) {
  body.game-active.drawer-left-open .hub-main.game-mode,
  body.game-active:has(#drawer-left[data-state="expanded"]) .hub-main.game-mode {
    margin-left: var(--drawer-width);
  }
  body.game-active.drawer-right-open .hub-main.game-mode,
  body.game-active:has(#drawer-right[data-state="expanded"]) .hub-main.game-mode {
    margin-right: var(--drawer-width);
  }
}

.tab-pane.game-pane.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.game-host-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0c0e12;
  color-scheme: dark;
}

.game-host-frame {
  width: 100%;
  height: 100%;
  border: none;
  background-color: #0c0e12;
  color-scheme: dark;
  display: block;
  opacity: 0;
  transition: opacity 0.15s ease-in-out;
}

.game-host-frame.loaded {
  opacity: 1;
}

/* Footer */
.hub-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: var(--footer-height);
  min-height: var(--footer-height);
  border-top: 1px solid var(--border-subtle);
  padding: 0 1.25rem;
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
  z-index: 100;
  flex-shrink: 0;
  line-height: 1.4;
  gap: 1rem;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-width: 0;
  flex-shrink: 0;
}

.footer-brand-mark {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  text-transform: uppercase;
  transition: opacity var(--transition-fast);
  flex-shrink: 0;
}

.footer-brand-mark:hover {
  opacity: 0.85;
}

.internode-tesseract-svg {
  display: block;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  filter: drop-shadow(0 0 6px rgba(255, 0, 85, 0.45));
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.hub-footer strong {
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  transition: var(--transition-fast);
}

.footer-links a:hover {
  color: var(--accent-orange);
}

@media (max-width: 640px) {
  .hub-footer {
    flex-direction: column;
    height: auto;
    min-height: auto;
    padding: 0.5rem 1rem;
    gap: 0.4rem;
    text-align: center;
  }
}

/* Responsive Breakpoints & Adaptive Drawer Widths */
@media (max-width: 1280px) {
  :root {
    --drawer-width: 320px;
  }
}

@media (max-width: 960px) {
  :root {
    --drawer-width: min(300px, 85vw);
  }
}

@media (max-width: 768px) {
  .hub-header {
    padding: 0 0.75rem;
  }
  .telemetry-strip {
    display: none;
  }
  .drawer-tab,
  .drawer-edge-handle {
    height: 72px;
    width: 24px;
  }
  .drawer-tab .tab-label,
  .drawer-edge-handle .handle-label {
    display: none;
  }
  .hub-main {
    padding: calc(var(--header-height) + 1rem) 0.75rem calc(var(--footer-height) + 1rem);
  }
}

/* ==========================================================================
   COMMAND DECK HEADER-CENTERED TOAST NOTIFICATIONS
   Centered inside the 50px header bar across the entire suite and games
   ========================================================================== */
.hub-toast-container {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  height: var(--header-height, 50px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  pointer-events: none;
}

.hub-toast {
  background: #14171e;
  border: 1px solid var(--accent-orange);
  border-radius: var(--radius-sm, 4px);
  padding: 5px 16px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.8), 0 0 12px var(--accent-orange-dim);
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-6px) scale(0.96);
  transition: opacity 0.22s var(--transition-normal), transform 0.22s var(--transition-normal);
  white-space: nowrap;
  max-width: 90vw;
}

.hub-toast.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.hub-toast-icon {
  font-size: 0.8125rem;
  line-height: 1;
}

.hub-toast.toast-success {
  border-color: var(--status-ok, #22c55e);
  color: #86efac;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 10px rgba(34, 197, 94, 0.25);
}

.hub-toast.toast-warning {
  border-color: var(--status-warn, #f59e0b);
  color: #fde68a;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 10px rgba(245, 158, 11, 0.25);
}

.hub-toast.toast-error {
  border-color: var(--status-err, #ef4444);
  color: #fca5a5;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 10px rgba(239, 68, 68, 0.25);
}

.hub-toast.toast-info {
  border-color: var(--accent-orange, #ff6b00);
  color: #fed7aa;
}

/* ==========================================================================
   Master HUD Drawer Component Styles (Rich Game Information & Telemetry)
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.stat-card,
.stat-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
}

.stat-card-title,
.stat-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.stat-card-value,
.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
  margin-top: 0.15rem;
}

.stat-card-value.highlight,
.stat-value.highlight {
  color: var(--accent-orange);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.setting-label {
  font-size: 0.8125rem;
  font-family: var(--font-mono);
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

/* Switches */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--bg-surface-hover);
  border: 1px solid var(--border-subtle);
  transition: var(--transition-fast);
  border-radius: 24px;
}

.slider::before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-muted);
  transition: var(--transition-fast);
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-orange);
  border-color: var(--accent-orange);
}

input:checked + .slider::before {
  transform: translateX(20px);
  background-color: var(--accent-orange-solid-text);
}

/* Sleek Select */
select.select-input,
.select-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  display: inline-block;
  background-color: var(--bg-surface-elevated, #1a1a1e);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ff6b00' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 11px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-sm, 4px);
  color: var(--text-primary, #f1f3f7);
  font-family: var(--font-mono, monospace);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.45rem 2.2rem 0.45rem 0.75rem;
  cursor: pointer;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  color-scheme: dark;
}

select.select-input:focus,
.select-input:focus {
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 1px var(--accent-orange), 0 0 10px rgba(255, 107, 0, 0.25);
}

/* Control shortcuts and keymap tables */
.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

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

.kbd-shortcut {
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.15rem 0.4rem;
  font-size: 0.6875rem;
  color: var(--accent-orange);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.control-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.control-table tr td {
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

.control-table tr td:first-child {
  color: var(--accent-orange);
  font-weight: 700;
  width: 50%;
}

.btn-game-action {
  width: 100%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-fast);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.btn-game-action:hover {
  border-color: var(--accent-orange-border);
  background: var(--bg-surface-hover);
  color: var(--accent-orange);
}

.btn-game-action.btn-primary {
  background: var(--accent-orange);
  color: var(--accent-orange-solid-text);
  border-color: var(--accent-orange);
}

.btn-game-action.btn-primary:hover {
  background: var(--accent-orange-hover);
  border-color: var(--accent-orange-hover);
}

/* ==========================================================================
   CHESS DOCK DRAWER COMPONENTS (100% Parity with Internode Chess)
   ========================================================================== */
.chess-drawer-flex {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  height: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
}

.chess-drawer-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chess-section-title {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-orange);
  margin-bottom: 2px;
}

/* Match Status Banner */
.match-status-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
}

.status-text {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.winner-display {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--status-ok);
  margin-top: 4px;
}

.thinking-pulse {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--accent-orange);
  margin-top: 4px;
  animation: chessPulse 1.5s infinite;
}

@keyframes chessPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Player Cards */
.player-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.player-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.player-avatar {
  font-size: 1.5rem;
  line-height: 1;
}

.player-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.player-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.captured-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  min-height: 18px;
  margin-top: 2px;
}

.captured-piece {
  font-size: 0.9375rem;
  line-height: 1;
}

.captured-piece.piece-white {
  color: #ffffff;
  filter: drop-shadow(0 0 1px #000);
}

.captured-piece.piece-black {
  color: #0f172a;
  filter: drop-shadow(0 0 1px #fff);
}

.timer {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  background: #090c10;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  color: var(--text-primary);
  letter-spacing: 0.05em;
}

.timer.active {
  border-color: var(--accent-orange);
  box-shadow: 0 0 12px rgba(255, 107, 0, 0.35);
  color: var(--accent-orange);
}

/* Action Buttons */
.action-buttons-group {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 8px;
}

.chess-btn {
  border: 1px solid var(--border-subtle);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-transform: uppercase;
}

.chess-btn.btn-primary {
  background: var(--accent-orange);
  color: var(--accent-orange-solid-text);
  border-color: var(--accent-orange);
}

.chess-btn.btn-primary:hover:not(:disabled) {
  background: var(--accent-orange-hover);
  box-shadow: 0 0 12px rgba(255, 107, 0, 0.4);
}

.chess-btn.btn-danger {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}

.chess-btn.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
}

.chess-btn.btn-secondary {
  background: var(--bg-surface-elevated);
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

.chess-btn.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent-orange-border);
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}

.chess-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Time Control & Opponent Grids */
.time-control-grid,
.mode-toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.tc-chip,
.mode-chip {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition-fast);
  position: relative;
  user-select: none;
}

.tc-chip:hover,
.mode-chip:hover {
  border-color: var(--accent-orange);
  color: var(--text-primary);
}

.tc-chip input[type="radio"],
.mode-chip input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.tc-chip:has(input:checked),
.mode-chip:has(input:checked) {
  background: rgba(255, 107, 0, 0.16);
  border-color: var(--accent-orange);
  color: var(--accent-orange);
  font-weight: 700;
  box-shadow: 0 0 10px rgba(255, 107, 0, 0.25);
}

.mode-chip.highlight-stockfish:has(input:checked) {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
  color: var(--accent-orange-solid-text);
  box-shadow: 0 0 14px rgba(255, 107, 0, 0.4);
}

/* Sub-Settings Panels */
.sub-settings-panel {
  margin-top: 8px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sub-settings-panel label {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-weight: 600;
}

.styled-select,
.styled-input {
  width: 100%;
  background: #090c10;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.styled-select:focus,
.styled-input:focus {
  outline: none;
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 1px var(--accent-orange);
}

.llm-model-row,
.net-btn-row,
.net-input-row {
  display: flex;
  gap: 6px;
}

.input-with-toggle {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-with-toggle .styled-input {
  padding-right: 32px;
}

.input-eye-toggle-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  padding: 4px 6px;
  font-size: 0.85rem;
  line-height: 1;
  border-radius: var(--radius-sm, 4px);
  transition: color var(--transition-fast, 0.15s ease), background var(--transition-fast, 0.15s ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.input-eye-toggle-btn:hover {
  color: var(--text-primary, #ffffff);
  background: rgba(255, 255, 255, 0.08);
}

.input-eye-toggle-btn:focus-visible {
  outline: 1px solid var(--accent-orange, #ff6b00);
}

.field-security-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 5px;
  padding: 6px 8px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-sm, 4px);
  font-size: 0.6875rem;
  line-height: 1.35;
  color: var(--text-secondary, #cbd5e1);
}

.field-security-note strong {
  color: #10b981;
}

.field-security-note .security-shield-icon {
  font-size: 0.75rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* History Container & Toolbar */
.history-card-container {
  flex: 1 1 0;
  min-height: 200px;
  max-height: 45vh;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.bridge-history-panel {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.bridge-history-panel .history-row {
  display: flex;
  align-items: center;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.bridge-history-panel .history-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.bridge-history-panel .history-row:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.bridge-history-panel .history-num {
  width: 2.2rem;
  color: var(--text-tertiary);
  font-weight: 600;
}

.bridge-history-panel .history-move {
  flex: 1;
  color: var(--text-primary);
  font-weight: 500;
}

.history-toolbar {
  display: flex;
  gap: 6px;
  padding: 6px;
  background: rgba(0, 0, 0, 0.5);
  border-top: 1px solid var(--border-subtle);
}

.history-tool-btn {
  flex: 1;
  padding: 5px 6px;
  font-size: 0.6875rem;
  font-family: var(--font-mono);
  font-weight: 700;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: var(--transition-fast);
}

.history-tool-btn:hover {
  border-color: var(--accent-orange);
  color: var(--accent-orange);
  background: var(--bg-surface-hover);
}

/* Quick Actions Grid */
.drawer-actions-compact {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.side-btn {
  padding: 7px 8px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 600;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.side-btn:hover {
  border-color: var(--accent-orange);
  color: var(--accent-orange);
  background: var(--bg-surface-hover);
}




