:root {
  /* === Core Design Tokens (NovaChess Noir Royal & Champagne Gold Identity) === */
  /* Noir Navy & Royal Plum Dark Surfaces */
  --nc-bg-app: #111020;
  --nc-bg-surface: #171326;
  --nc-bg-surface-2: #24182e;
  --nc-bg-elevated: #2e203a;
  --nc-bg-input: #0d0b19;
  --nc-border: rgba(214, 180, 219, 0.16);
  --nc-border-strong: rgba(217, 164, 65, 0.36);

  /* Typography Colors */
  --nc-text-primary: #f8f4ef;
  --nc-text-secondary: #dfd5e3;
  --nc-text-muted: #beb3c4;
  --nc-text-disabled: #7f738a;

  /* Editorial Light Surface Tokens (Warm Ivory) */
  --nc-ivory-bg: #f5f0e9;
  --nc-ivory-card: #fffaf4;
  --nc-ivory-soft: #e9e1d8;
  --nc-ivory-border: #e6ddd3;
  --nc-ivory-ink: #191522;
  --nc-ivory-muted: #625765;

  /* Semantic Status Colors (Theme-Independent) */
  --nc-gold: #d9a441;
  --nc-gold-strong: #b88428;
  --nc-gold-contrast: #171321;
  --nc-gold-soft: rgba(217, 164, 65, 0.16);
  --nc-gold-border: rgba(217, 164, 65, 0.44);
  --nc-success: #22c55e;
  --nc-success-soft: rgba(34, 197, 94, 0.16);
  --nc-warning: #f59e0b;
  --nc-warning-soft: rgba(245, 158, 11, 0.16);
  --nc-danger: #ef4444;
  --nc-danger-soft: rgba(239, 68, 68, 0.18);
  --nc-danger-border: rgba(239, 68, 68, 0.46);
  --nc-danger-text: #fecaca;
  --nc-info: #38bdf8;
  --nc-info-soft: rgba(56, 189, 248, 0.16);
  --nc-online: #22c55e;
  --nc-offline: #7f738a;

  /* Flagship Royal Gold Accent (Overridden cleanly per [data-theme]) */
  --nc-accent: #d9a441;
  --nc-accent-hover: #e5bd76;
  --nc-accent-shadow: #8c6318;
  --nc-accent-contrast: #171321;
  --nc-accent-soft: rgba(217, 164, 65, 0.17);
  --nc-accent-glow: rgba(217, 164, 65, 0.36);

  /* Typography Scale */
  --nc-font-display: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --nc-font-sans: 'DM Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --nc-font-mono: ui-monospace, 'SFMono-Regular', 'JetBrains Mono', Menlo, Consolas, monospace;
  --nc-text-xs: 0.75rem;
  --nc-text-sm: 0.8125rem;
  --nc-text-base: 0.9375rem;
  --nc-text-lg: 1.0625rem;
  --nc-text-xl: 1.25rem;
  --nc-text-2xl: 1.5rem;

  /* Spacing Scale (4px step system) */
  --nc-space-1: 4px;
  --nc-space-2: 8px;
  --nc-space-3: 12px;
  --nc-space-4: 16px;
  --nc-space-5: 20px;
  --nc-space-6: 24px;
  --nc-space-8: 32px;
  --nc-space-10: 40px;
  --nc-space-12: 48px;
  --nc-space-16: 64px;

  /* Radii, Shadows, Z-Index & Focus Ring */
  --nc-radius-sm: 6px;
  --nc-radius-md: 10px;
  --nc-radius-lg: 12px;
  --nc-radius-xl: 16px;
  --nc-radius-pill: 999px;
  --nc-shadow-sm: 0 2px 6px rgba(2, 6, 23, 0.28);
  --nc-shadow-md: 0 10px 26px rgba(2, 6, 23, 0.42);
  --nc-shadow-modal: 0 24px 60px rgba(2, 6, 23, 0.65);
  --nc-focus-ring: 0 0 0 2px var(--nc-bg-surface), 0 0 0 4px var(--nc-accent);
  --nc-z-base: 1;
  --nc-z-sticky: 20;
  --nc-z-nav: 950;
  --nc-z-float: 980;
  --nc-z-modal: 1000;
  --nc-z-toast: 2000;
  --nc-z-drag: 9999;

  /* Compatibility Token Aliases (preserve all legacy consumers) */
  --bg: var(--nc-bg-app);
  --surface: var(--nc-bg-surface);
  --surface-2: var(--nc-bg-surface-2);
  --input-bg: var(--nc-bg-input);
  --border: var(--nc-border);
  --text: var(--nc-text-primary);
  --muted: var(--nc-text-muted);
  --accent: var(--nc-accent);
  --accent-hover: var(--nc-accent-hover);
  --accent-shadow: var(--nc-accent-shadow);
  --accent-soft: var(--nc-accent-soft);
  --accent-glow: var(--nc-accent-glow);
  --gold: var(--nc-gold);
  --danger: var(--nc-danger);
  --radius: var(--nc-radius-lg);
}

[data-theme="green"] {
  --nc-accent: #22c55e;
  --nc-accent-hover: #16a34a;
  --nc-accent-shadow: #14532d;
  --nc-accent-contrast: #052e16;
  --nc-accent-soft: rgba(34, 197, 94, 0.16);
  --nc-accent-glow: rgba(34, 197, 94, 0.36);
}

[data-theme="orange"] {
  --nc-accent: #f97316;
  --nc-accent-hover: #ea580c;
  --nc-accent-shadow: #9a3412;
  --nc-accent-contrast: #ffffff;
  --nc-accent-soft: rgba(249, 115, 22, 0.17);
  --nc-accent-glow: rgba(249, 115, 22, 0.38);
}

[data-theme="red"] {
  --nc-accent: #ef4444;
  --nc-accent-hover: #dc2626;
  --nc-accent-shadow: #7f1d1d;
  --nc-accent-contrast: #ffffff;
  --nc-accent-soft: rgba(239, 68, 68, 0.17);
  --nc-accent-glow: rgba(239, 68, 68, 0.38);
}

[data-theme="dark"] {
  --nc-accent: #d9a441;
  --nc-accent-hover: #e5bd76;
  --nc-accent-shadow: #8c6318;
  --nc-accent-contrast: #171321;
  --nc-accent-soft: rgba(217, 164, 65, 0.18);
  --nc-accent-glow: rgba(217, 164, 65, 0.38);
}

[data-theme="light"] {
  --nc-bg-app: #f5f0e9;
  --nc-bg-surface: #fffaf4;
  --nc-bg-surface-2: #e9e1d8;
  --nc-bg-elevated: #fbf8f2;
  --nc-bg-input: #ffffff;
  --nc-border: rgba(33, 26, 44, 0.14);
  --nc-border-strong: rgba(33, 26, 44, 0.28);
  --nc-text-primary: #191522;
  --nc-text-secondary: #3e3447;
  --nc-text-muted: #625765;
  --nc-text-disabled: #857a85;
  --nc-accent: #24182e;
  --nc-accent-hover: #3b264d;
  --nc-accent-shadow: #111020;
  --nc-accent-contrast: #f8f4ef;
  --nc-accent-soft: rgba(36, 24, 46, 0.10);
  --nc-accent-glow: rgba(217, 164, 65, 0.32);
  --nc-gold: #a17018;
  --nc-gold-strong: #7d540d;
  --nc-gold-contrast: #ffffff;
  --nc-gold-soft: rgba(161, 112, 24, 0.14);
  --nc-gold-border: rgba(161, 112, 24, 0.38);
  --nc-danger: #dc2626;
  --nc-danger-soft: rgba(220, 38, 38, 0.12);
  --nc-danger-border: rgba(220, 38, 38, 0.42);
  --nc-danger-text: #991b1b;
  --nc-shadow-sm: 0 2px 6px rgba(25, 21, 34, 0.08);
  --nc-shadow-md: 0 10px 26px rgba(25, 21, 34, 0.12);
  --nc-shadow-modal: 0 24px 60px rgba(25, 21, 34, 0.22);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--nc-border-strong) transparent;
}

body {
  position: relative;
  font-family: var(--nc-font-sans);
  background: var(--nc-bg-app);
  color: var(--nc-text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 70% 25%, rgba(77, 44, 74, 0.42), rgba(17, 16, 32, 0.88) 62%, rgba(17, 16, 32, 0.96) 100%),
    url('../img/hero-king.jpg') center/cover no-repeat;
  opacity: 0.42;
}

[data-theme="light"] body::before {
  opacity: 0;
}

.app-shell {
  position: relative;
  z-index: 1;
}

.nc-ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.nc-btn-lbl {
  display: inline-block;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--nc-focus-ring);
}

/* Fix Chrome/Edge bright white autofill boxes in dark theme */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
select:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--input-bg) inset !important;
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--text);
  transition: background-color 9999s ease-out 0s;
}

.app-shell {
  display: grid;
  grid-template-columns: 230px minmax(460px, 680px) minmax(320px, 385px);
  gap: 16px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px 16px;
  align-items: start;
}

/* Sidebar Navigation */
.sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 4px 10px;
  border-bottom: 1px solid var(--border);
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--nc-radius-md);
  background: var(--nc-accent);
  display: grid;
  place-items: center;
  font-size: 19px;
  color: var(--nc-accent-contrast);
  box-shadow: var(--nc-shadow-sm);
  flex-shrink: 0;
}

.brand h1 { font-size: 1.05rem; font-weight: 800; letter-spacing: 0.2px; }
.brand span { font-size: 0.68rem; color: var(--gold); font-weight: 700; display: block; letter-spacing: 0.5px; }

.top-controls-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.ui-theme-swatches {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.ui-swatch-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: var(--nc-radius-sm);
  min-height: 36px;
  padding: 5px 2px;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.ui-swatch-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.ui-swatch-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.ui-swatch-btn .ui-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid var(--nc-border-strong);
}

.options-panel-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.opt-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.74rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.opt-row input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.opt-select-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 2px;
}

.profile-mini {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.profile-mini:hover { border-color: var(--accent); }
.profile-mini-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.profile-mini-name {
  font-size: 0.86rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-mini-meta {
  font-size: 0.72rem;
  color: var(--muted);
  flex-wrap: wrap;
}
.profile-mini-code {
  color: var(--gold);
  font-family: monospace;
  white-space: nowrap;
}

.nav-rail {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
}

.mobile-panel-bar {
  display: none;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.grid-time-side { display: grid; grid-template-columns: 1.3fr 1fr; gap: 8px; margin-bottom: 10px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin-bottom: 6px; }
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

.nav-btn {
  width: 100%;
  text-align: start;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
  transition: all 0.14s ease;
}

.nav-btn:hover { background: var(--surface-2); color: var(--text); }
.nav-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent-glow);
  color: var(--accent);
}
.nav-btn.nav-more-trigger {
  display: none;
}

.theme-section {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.theme-summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px;
}
.theme-summary::-webkit-details-marker { display: none; }
.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.theme-chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 0.73rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.theme-chip:hover,
.theme-chip.active { border-color: var(--accent); background: var(--accent-soft); }
.theme-chip .swatch { width: 13px; height: 13px; border-radius: 4px; display: inline-block; flex-shrink: 0; }

/* Center Arena */
.arena {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.player-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-inline-start: 3px solid transparent;
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s, transform 0.16s ease;
}
.player-bar:hover {
  border-color: var(--nc-border-strong);
  background: var(--surface-2);
}
.player-bar.turn-active {
  border-color: var(--accent);
  border-inline-start: 4px solid var(--accent);
  background: linear-gradient(90deg, var(--accent-soft), var(--surface) 68%);
  box-shadow: 0 0 0 1px var(--accent-soft), 0 6px 18px var(--accent-glow);
}
.player-bar.turn-active:hover {
  border-color: var(--accent);
  background: linear-gradient(90deg, var(--accent-soft), var(--surface-2) 72%);
  box-shadow: 0 0 0 2px var(--accent), 0 10px 24px var(--accent-glow);
  transform: translateY(-1px);
}
.player-name-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.player-turn-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border-2);
  flex-shrink: 0;
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
}
.player-bar.turn-active .player-turn-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  transform: scale(1.1);
}
.turn-pill {
  display: none;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--accent);
  color: var(--nc-accent-contrast);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.player-bar.turn-active .turn-pill {
  display: inline-flex;
}

.player-meta-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.player-name {
  font-weight: 700;
  font-size: 0.91rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.captured-strip {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 17px;
  font-size: 0.85rem;
  line-height: 1;
  color: var(--muted);
  letter-spacing: -1px;
}
.mat-adv {
  background: var(--nc-accent-soft);
  color: var(--nc-accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  padding: 2px 6px;
  border-radius: var(--nc-radius-pill);
}

.clock-box {
  background: var(--nc-bg-input);
  color: var(--nc-text-primary);
  border: 1px solid var(--nc-border);
  padding: 6px 13px;
  border-radius: var(--nc-radius-sm);
  font-family: var(--nc-font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.turn-active .clock-box {
  background: var(--nc-bg-elevated);
  color: var(--nc-text-primary);
  border-color: var(--nc-accent);
}
.clock-box.low-time {
  background: var(--nc-danger) !important;
  color: #ffffff !important;
  border-color: var(--nc-danger) !important;
}

.board-stage {
  position: relative;
  display: flex;
  gap: 10px;
  align-items: stretch;
  justify-content: center;
}

.eval-bar-wrap {
  width: 26px;
  background: var(--nc-bg-surface-2);
  border-radius: var(--nc-radius-sm);
  border: 1px solid var(--nc-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  flex-shrink: 0;
}
.eval-white-fill {
  width: 100%;
  height: 50%;
  background: linear-gradient(180deg, #f8fafc, #cbd5e1);
  transition: height 0.35s ease;
}
.eval-label {
  position: absolute;
  top: 4px;
  left: 2px;
  right: 2px;
  text-align: center;
  font-family: var(--nc-font-mono);
  font-size: 0.54rem;
  font-weight: 800;
  color: #f8fafc;
  background: rgba(11, 18, 32, 0.88);
  padding: 1px 0;
  border-radius: 3px;
}

.board-box {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  flex: 1 1 auto;
  min-width: 0;
}

.board-box.is-custom-size {
  flex: 0 0 auto;
}

#boardBox.is-custom-size .nc-board-grid {
  width: var(--nc-board-px, 520px) !important;
  max-width: 100% !important;
}

.board-resize-handle {
  position: absolute;
  right: -5px;
  bottom: -5px;
  z-index: 12;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--nc-border-strong);
  background: var(--surface);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: nwse-resize;
  touch-action: none;
  box-shadow: var(--nc-shadow-sm);
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}

.board-resize-handle:hover,
.board-resize-handle.resizing {
  background: var(--accent);
  color: var(--nc-accent-contrast);
  border-color: var(--accent);
  transform: scale(1.08);
}

.nc-board-grid {
  width: min(100%, 74vh);
  max-width: 650px;
  aspect-ratio: 1 / 1;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  border-radius: var(--nc-radius-sm);
  overflow: hidden;
  border: 2px solid var(--nc-border-strong);
  box-shadow: var(--nc-shadow-md);
  touch-action: none;
  user-select: none;
}

.nc-sq {
  position: relative;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.nc-sq-selected { box-shadow: inset 0 0 0 100px rgba(246, 246, 105, 0.55) !important; }
.nc-sq-premove { box-shadow: inset 0 0 0 100px rgba(245, 158, 11, 0.48) !important; }
.nc-sq-hint { box-shadow: inset 0 0 0 4px var(--nc-info) !important; }
.nc-sq-check {
  background: radial-gradient(circle, rgba(239,68,68,0.92) 0%, rgba(185,28,28,0.65) 55%, transparent 80%) !important;
}

.nc-piece { width: 88%; height: 88%; pointer-events: none; transition: transform 0.08s ease; }
.piece-svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.35)); }

.nc-drag-ghost {
  position: fixed;
  width: clamp(38px, 12vw, 68px);
  height: clamp(38px, 12vw, 68px);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9999;
}

.nc-legal-dot {
  position: absolute;
  width: 28%;
  height: 28%;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.28);
  pointer-events: none;
}
.nc-capture-ring {
  position: absolute;
  width: 84%;
  height: 84%;
  border-radius: 50%;
  border: 5px solid rgba(15, 23, 42, 0.28);
  pointer-events: none;
}

.nc-coord {
  position: absolute;
  font-size: 0.64rem;
  font-weight: 700;
  pointer-events: none;
  opacity: 0.85;
}
.nc-coord-rank { top: 2px; left: 4px; }
.nc-coord-file { bottom: 2px; right: 4px; }

.board-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 12px;
}
.status-banner { font-size: 0.86rem; font-weight: 700; color: var(--text); }
.toolbar-actions { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }

/* Right Panel & Hub Cards */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.panel h2 { font-size: 1.02rem; font-weight: 800; }
.hidden { display: none !important; }

.account-summary-card {
  background: var(--nc-bg-surface-2);
  border: 1px solid var(--nc-border-strong);
  border-left: 3px solid var(--nc-accent);
  border-radius: var(--nc-radius-lg);
  padding: var(--nc-space-3);
  display: flex;
  flex-direction: column;
  gap: var(--nc-space-2);
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.hub-tile {
  background: var(--nc-bg-surface-2);
  border: 1px solid var(--nc-border);
  color: var(--nc-text-primary);
  border-radius: var(--nc-radius-lg);
  padding: var(--nc-space-3);
  text-align: start;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--nc-space-1);
  min-height: 76px;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}
.hub-tile:hover {
  border-color: var(--nc-accent);
  transform: translateY(-1px);
  background: var(--nc-accent-soft);
}
.hub-tile-title {
  font-weight: 800;
  font-size: 0.85rem;
  line-height: 1.25;
  color: var(--nc-text-primary);
}
.hub-tile-sub {
  color: var(--nc-text-muted);
  font-weight: 500;
  font-size: var(--nc-text-xs);
  line-height: 1.3;
}

.lesson-card {
  background: var(--nc-bg-surface-2);
  border: 1px solid var(--nc-border);
  border-radius: var(--nc-radius-md);
  padding: var(--nc-space-3);
  margin-bottom: var(--nc-space-2);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.lesson-card:hover {
  border-color: var(--nc-accent);
  background: var(--nc-bg-elevated);
}

.tab-pills { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.pill-btn {
  background: var(--nc-bg-surface-2);
  border: 1px solid var(--nc-border);
  color: var(--nc-text-secondary);
  padding: 6px 11px;
  border-radius: var(--nc-radius-pill);
  font-size: var(--nc-text-xs);
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.pill-btn:hover { border-color: var(--nc-border-strong); color: var(--nc-text-primary); }
.pill-btn.active { background: var(--nc-accent-soft); border-color: var(--nc-accent); color: var(--nc-accent); }

.eval-graph-svg { width: 100%; height: 95px; background: var(--nc-bg-input); border-radius: var(--nc-radius-md); border: 1px solid var(--nc-border); }
.analysis-tag-blunder { color: var(--nc-danger); font-weight: 800; }
.analysis-tag-mistake { color: var(--nc-warning); font-weight: 800; }
.analysis-tag-inaccuracy { color: var(--nc-gold); font-weight: 700; }
.analysis-tag-best { color: var(--nc-success); font-weight: 700; }

.btn {
  border-radius: var(--nc-radius-md);
  padding: 9px 13px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--nc-text-primary);
  background: var(--nc-bg-surface-2);
  border: 1px solid var(--nc-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.08s ease, background 0.14s ease, border-color 0.14s ease, opacity 0.14s ease;
}
.btn:hover:not(:disabled) { background: var(--nc-bg-elevated); border-color: var(--nc-border-strong); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.48; cursor: not-allowed; }
.btn-primary {
  background: var(--nc-accent);
  border: 1px solid var(--nc-accent-hover);
  color: var(--nc-accent-contrast);
  box-shadow: var(--nc-shadow-sm);
}
.btn-primary:hover:not(:disabled) { background: var(--nc-accent-hover); border-color: var(--nc-accent-hover); }
.btn-hero {
  width: 100%;
  padding: 13px 16px;
  font-size: 1rem;
  border-radius: var(--nc-radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.btn-gold { background: var(--nc-gold); border: 1px solid var(--nc-gold-strong); color: var(--nc-gold-contrast); box-shadow: var(--nc-shadow-sm); }
.btn-gold:hover:not(:disabled) { background: var(--nc-gold-strong); color: #fff; }
.btn-danger { background: var(--nc-danger-soft); border: 1px solid var(--nc-danger-border); color: var(--nc-danger-text); }
.btn-danger:hover:not(:disabled) { background: var(--nc-danger); color: #ffffff; border-color: var(--nc-danger); }
.btn-sm { padding: 6px 10px; font-size: 0.78rem; border-radius: var(--nc-radius-sm); min-height: 32px; }
.btn-block { width: 100%; }

.move-nav-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-bottom: 6px;
}
.move-nav-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 7px;
  padding: 5px;
  font-weight: 800;
  font-size: 0.8rem;
  cursor: pointer;
}
.move-nav-btn:hover { border-color: var(--accent); color: var(--accent); }

.form-row { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.form-row label { font-size: 0.76rem; color: var(--muted); font-weight: 600; }
.input, select {
  background: var(--nc-bg-input);
  color: var(--nc-text-primary);
  border: 1px solid var(--nc-border);
  border-radius: var(--nc-radius-md);
  padding: 9px 11px;
  font-size: 0.86rem;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input::placeholder { color: var(--nc-text-disabled); }
.input:disabled, select:disabled { opacity: 0.55; cursor: not-allowed; }
.input:focus, select:focus { border-color: var(--nc-accent); box-shadow: var(--nc-focus-ring); outline: none; }

.seek-countdown-box {
  background: var(--nc-gold-soft);
  border: 1px solid var(--nc-gold-border);
  border-radius: var(--nc-radius-lg);
  padding: var(--nc-space-3);
  text-align: center;
  margin: 10px 0;
}
.seek-timer {
  font-family: var(--nc-font-mono);
  font-size: 1.9rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--nc-gold);
}
.badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
}
.tourn-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.bot-list { display: flex; flex-direction: column; gap: 7px; }
.bot-card {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: start;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 9px 10px;
  cursor: pointer;
  color: var(--text);
}
.bot-card.active { border-color: var(--accent); background: var(--accent-soft); }
.bot-avatar { font-size: 1.55rem; width: 36px; text-align: center; flex-shrink: 0; }
.bot-title { font-size: 0.88rem; display: flex; align-items: center; gap: 6px; }
.bot-desc { font-size: 0.73rem; color: var(--muted); margin-top: 2px; }
.elo-pill { background: var(--nc-gold-soft); color: var(--nc-gold); padding: 2px 7px; border-radius: var(--nc-radius-pill); font-family: var(--nc-font-mono); font-size: 0.72rem; font-weight: 700; }

/* Move List */
.move-history-wrap {
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.move-history-box {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  max-height: 210px;
  overflow-y: auto;
}
.move-row {
  display: grid;
  grid-template-columns: 34px 1fr 1fr;
  gap: 4px;
  align-items: center;
  margin-bottom: 2px;
}
.move-num { color: var(--muted); font-size: 0.76rem; text-align: right; padding-right: 6px; }
.move-san {
  background: transparent;
  border: none;
  color: var(--text);
  text-align: left;
  padding: 4px 7px;
  border-radius: 6px;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
}
.move-san:hover { background: var(--surface-2); }
.move-san.current { background: var(--accent-soft); color: var(--accent); }

/* Online Room & Chat */
.room-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-2);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.room-code { font-family: var(--nc-font-mono); font-size: 1.1rem; font-weight: 800; color: var(--nc-gold); letter-spacing: 2px; }

.chat-box {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  height: 140px;
  overflow-y: auto;
  font-size: 0.81rem;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.chat-msg.system { color: var(--muted); font-style: italic; font-size: 0.76rem; }
.chat-form { display: flex; gap: 6px; margin-top: 6px; }
.emoji-row { display: flex; gap: 6px; margin-top: 6px; }
.emoji-btn { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; cursor: pointer; font-size: 0.95rem; }

.draw-banner {
  background: var(--nc-warning-soft);
  border: 1px solid var(--nc-gold-border);
  border-radius: var(--nc-radius-md);
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}

/* Leaderboard Table */
.lb-table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }
.lb-table th, .lb-table td { padding: 8px 6px; border-bottom: 1px solid var(--border); text-align: start; }
.lb-table th { color: var(--muted); font-size: 0.75rem; }
.gold { color: var(--gold); font-weight: 800; }
.muted { color: var(--muted); }

/* Modals & Toast */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 15, 0.76);
  backdrop-filter: blur(5px);
  display: grid;
  place-items: center;
  padding: 14px;
  z-index: 1000;
}
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  width: min(94vw, 390px);
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
.modal-card.text-start { text-align: start; }
.promo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.promo-piece-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  cursor: pointer;
}
.promo-piece-btn:hover { border-color: var(--accent); }

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--nc-bg-surface-2);
  color: var(--nc-text-primary);
  padding: 10px 18px;
  border-radius: var(--nc-radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  border: 1px solid var(--nc-border-strong);
  box-shadow: var(--nc-shadow-md);
  z-index: var(--nc-z-toast);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- Laptop (1025px - 1280px) --- */
@media (max-width: 1280px) and (min-width: 1025px) {
  .app-shell {
    grid-template-columns: 205px minmax(420px, 1.35fr) minmax(290px, 345px);
    gap: 12px;
    padding: 10px 12px;
  }
  .nc-board-grid { width: min(100%, 72vh); max-width: 600px; }
  .sidebar { padding: 12px 10px; gap: 6px; }
  .nav-btn { padding: 8px 10px; font-size: 0.83rem; }
  .panel { padding: 14px; }
}

/* Compact Laptop Viewport Height (e.g. 1366x768 / 1280x720) */
@media (max-height: 780px) and (min-width: 768px) {
  .app-shell { padding: 10px 12px; }
  .arena { gap: 6px; }
  .player-bar { padding: 6px 10px; }
  .nc-board-grid { width: min(100%, 66vh); }
  .board-toolbar { padding: 7px 10px; }
}

/* --- Tablet (768px - 1024px) --- */
@media (max-width: 1024px) and (min-width: 768px) {
  .app-shell {
    grid-template-columns: minmax(360px, 1.3fr) minmax(270px, 0.75fr);
    max-width: 100%;
    padding: 10px 12px;
    gap: 12px;
  }
  .sidebar {
    grid-column: 1 / -1;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    gap: 8px;
  }
  .brand { border-bottom: none; padding: 0; }
  .profile-mini { order: 2; min-width: 210px; padding: 7px 10px; }
  .top-controls-row { order: 3; width: auto; }
  .theme-section { order: 4; margin-top: 0; padding-top: 0; border-top: none; min-width: 165px; }
  .nav-rail {
    order: 5;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    overflow-x: visible;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
  }
  .nav-btn { width: auto; flex: 0 0 auto; white-space: nowrap; justify-content: center; min-height: 40px; padding: 7px 12px; font-size: 0.82rem; }
  .nc-board-grid { width: min(100%, 68vh); max-width: 600px; }
  .panel { max-height: calc(100vh - 160px); overflow-y: auto; padding: 14px; }
}

/* --- Smartphone (<= 767px) --- */
@media (max-width: 767px) {
  .app-shell {
    grid-template-columns: 1fr;
    max-width: 100%;
    padding: 8px 8px calc(84px + env(safe-area-inset-bottom));
    gap: 10px;
  }
  .sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    gap: 7px;
  }
  .brand { border-bottom: none; padding: 0; gap: 8px; }
  .brand-logo { width: 32px; height: 32px; font-size: 16px; }
  .brand h1 { font-size: 0.96rem; }
  .brand span { font-size: 0.58rem; }
  .top-controls-row { order: 2; width: auto; gap: 5px; }
  .profile-mini {
    order: 3;
    width: 100%;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px;
  }
  .theme-section { order: 4; width: 100%; margin-top: 0; padding-top: 6px; }
  .theme-grid { grid-template-columns: repeat(3, 1fr); }
  .nav-rail {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 950;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.42);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow: visible;
    gap: 4px;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .nav-rail .nav-secondary {
    display: none !important;
  }
  .nav-more-trigger {
    display: flex !important;
  }
  .nav-btn {
    width: 100%;
    min-width: 0;
    flex-direction: column;
    white-space: nowrap;
    justify-content: center;
    align-items: center;
    gap: 3px;
    min-height: 48px;
    padding: 5px 1px;
    font-size: 0.61rem;
    letter-spacing: -0.015em;
    text-align: center;
    border-radius: 9px;
  }
  .nav-btn .nav-label {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
  }
  .arena { gap: 7px; }
  .player-bar { padding: 6px 10px; }
  .clock-box { padding: 5px 10px; font-size: 0.95rem; }
  .board-stage { gap: 6px; width: 100%; }
  .eval-bar-wrap { width: 22px; }
  .eval-label { font-size: 0.50rem; left: 1px; right: 1px; }
  .nc-board-grid {
    width: calc(100% - 16px);
    max-width: min(98vw, 66vh);
    border-width: 2px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.38);
  }
  .board-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 8px 10px;
  }
  .toolbar-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
  }
  .toolbar-actions .btn-sm { padding: 7px 4px; font-size: 0.74rem; text-align: center; }
  .panel { padding: 12px; gap: 10px; }
  .mobile-panel-bar { display: flex; }
  .btn, .pill-btn { min-height: 38px; }
  .input, select, textarea { font-size: 16px; }
  .modal-card { width: min(96vw, 410px); padding: 15px; }
  .toast {
    bottom: calc(68px + env(safe-area-inset-bottom));
    max-width: 92vw;
    text-align: center;
  }
}

/* --- Small Smartphones (<= 420px) --- */
@media (max-width: 420px) {
  .brand span { display: none; }
  .grid-time-side, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .hub-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
  .hub-tile { padding: 10px; min-height: 68px; }
  .theme-grid { grid-template-columns: 1fr 1fr; }
  .toolbar-actions { grid-template-columns: repeat(3, 1fr); }
}

/* --- Private Chess Arena Hub, Stage Stepper & Interactive Bracket --- */
.arena-hub-modal {
  width: min(98vw, 1140px);
  max-height: 92vh;
  padding: 16px;
}

.arena-hero-banner {
  background: var(--nc-bg-surface-2);
  border: 1px solid var(--nc-border-strong);
  border-top: 3px solid var(--nc-accent);
  border-radius: var(--nc-radius-lg);
  padding: 14px;
  background-size: cover;
  background-position: center;
}

.arena-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.arena-stepper {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--nc-border);
}

.arena-step {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--nc-text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  border-radius: var(--nc-radius-sm);
  background: var(--nc-bg-input);
}

.arena-step.done {
  color: var(--nc-accent);
  background: var(--nc-accent-soft);
}

.arena-step.current {
  color: var(--nc-gold);
  border: 1px solid var(--nc-gold-border);
}

.arena-tab-body {
  max-height: 54vh;
  overflow-y: auto;
}

.bracket-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.bracket-viewport {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: auto;
  max-height: 48vh;
  padding: 14px;
  cursor: grab;
  -webkit-overflow-scrolling: touch;
}

.bracket-canvas {
  display: flex;
  align-items: stretch;
  gap: 24px;
  transform-origin: top left;
  transition: transform 0.12s ease;
  width: max-content;
  min-width: 100%;
}

.bracket-round-col {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 12px;
  min-width: 215px;
}

.bracket-round-hdr {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  text-align: center;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.bracket-match-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 9px;
  font-size: 0.76rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}

.bracket-match-card.live {
  border-color: var(--nc-accent);
  box-shadow: 0 0 0 1px var(--nc-accent-soft);
}

.bracket-slot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: 3px 5px;
  border-radius: var(--nc-radius-sm);
  background: var(--nc-bg-surface-2);
}

.bracket-slot-row.winner {
  background: var(--nc-accent-soft);
  color: var(--nc-accent);
  font-weight: 800;
}

.sched-match-card {
  background: var(--nc-bg-surface-2);
  border: 1px solid var(--nc-border);
  border-left: 3px solid var(--nc-accent);
  border-radius: var(--nc-radius-md);
  padding: 10px 12px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 767px) {
  .arena-hub-modal { width: 99vw; max-height: 95vh; padding: 10px; }
  .arena-stepper { grid-template-columns: repeat(3, 1fr); }
  .arena-tab-body { max-height: 58vh; }
}

.nc-board-grid.nc-no-coords .nc-coord { display: none !important; }
.nc-board-grid.nc-no-legal .nc-legal-dot,
.nc-board-grid.nc-no-legal .nc-capture-ring { display: none !important; }

/* --- 60fps Visible Move Glide, Side-Eject Capture & Check Pulse --- */
.nc-piece-glide {
  transition: transform var(--nc-anim-ms, 420ms) cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
  z-index: 6;
}

.nc-from-trail {
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  border: 2px dashed rgba(245, 176, 65, 0.65);
  pointer-events: none;
  z-index: 2;
  animation: ncTrailFade 520ms ease-out forwards;
}

@keyframes ncTrailFade {
  0% { transform: scale(1.05); opacity: 0.9; }
  100% { transform: scale(0.55); opacity: 0; }
}

.nc-captured-fly {
  position: absolute;
  pointer-events: none;
  z-index: 40;
  will-change: transform, opacity;
  transition: transform 540ms cubic-bezier(0.22, 1, 0.36, 1), opacity 540ms ease-out;
}

.nc-sq-selected .nc-piece {
  transform: translateY(-2px) scale(1.07);
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45));
}

.nc-capture-fx {
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  border: 3px solid var(--gold);
  pointer-events: none;
  z-index: 3;
  animation: ncCaptureBurst 360ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes ncCaptureBurst {
  0% { transform: scale(0.45); opacity: 0.95; }
  100% { transform: scale(1.28); opacity: 0; }
}

.nc-sq-check {
  animation: ncCheckPulse 1.1s ease-in-out infinite alternate;
}

@keyframes ncCheckPulse {
  from { box-shadow: inset 0 0 10px rgba(239, 68, 68, 0.55); }
  to { box-shadow: inset 0 0 22px rgba(239, 68, 68, 0.95); }
}

.modal-backdrop:not(.hidden) .modal-card {
  animation: ncModalIn 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes ncModalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.player-bar.turn-active .clock-box {
  animation: ncClockBeat 2s ease-in-out infinite;
}

@keyframes ncClockBeat {
  0%, 100% { box-shadow: 0 0 0 0 var(--nc-accent-soft); }
  50% { box-shadow: 0 0 0 4px transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .nc-piece-glide, .nc-capture-fx, .nc-captured-fly, .nc-from-trail, .nc-sq-check, .modal-card, .clock-box {
    animation: none !important;
    transition: none !important;
  }
}

/* --- Reorganized Navigation Groups & Non-Intrusive Sponsor Ad Slots --- */
.nav-section-label,
.hub-section-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--nc-text-muted);
  padding: 6px 6px 2px;
}

.hub-section-label {
  padding: 0 0 6px;
}

.ad-slot {
  background: var(--nc-bg-surface-2);
  border: 1px dashed var(--nc-border-strong);
  border-radius: var(--nc-radius-md);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 70px;
}

.ad-slot-sidebar {
  margin-top: 4px;
  min-height: 86px;
}

.ad-slot-workspace {
  margin-top: 6px;
  border-top: 1px solid var(--border);
  min-height: 68px;
}

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

.ad-badge {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--nc-text-muted);
}

.ad-close-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.72rem;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
}

.ad-close-btn:hover {
  background: var(--input-bg);
  color: var(--text);
}

.ad-slot-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ad-title {
  font-size: 0.78rem;
  color: var(--text);
}

.ad-body {
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.3;
}

@media (max-width: 1024px) {
  .nav-section-label,
  .ad-slot-sidebar {
    display: none !important;
  }
}

/* --- Hide Left Sidebar & True Fullscreen Board Mode (Desktop, Tablet, Smartphone) --- */
.restore-menu-pill {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 980;
  display: none;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 99px;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.48);
  cursor: pointer;
}
.restore-menu-pill:hover {
  background: var(--accent);
  color: #fff;
}
body.hide-sidebar .restore-menu-pill,
body.board-fullscreen .restore-menu-pill {
  display: inline-flex !important;
}

.fullscreen-exit-pill {
  align-self: flex-end;
  background: var(--nc-bg-surface);
  color: var(--nc-gold);
  border: 1px solid var(--nc-gold-border);
  border-radius: var(--nc-radius-pill);
  padding: 6px 13px;
  font-size: 0.78rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

@media (min-width: 1025px) {
  body.hide-sidebar .sidebar {
    display: none !important;
  }
  body.hide-sidebar .app-shell {
    grid-template-columns: minmax(480px, 780px) minmax(320px, 400px);
    max-width: 1260px;
  }
  body.hide-sidebar .nc-board-grid {
    width: min(100%, 78vh);
    max-width: 740px;
  }
}

@media (max-width: 1024px) and (min-width: 768px) {
  body.hide-sidebar .sidebar {
    padding: 6px 10px;
  }
  body.hide-sidebar .sidebar > :not(.nav-rail) {
    display: none !important;
  }
  body.hide-sidebar .nav-rail {
    border-top: none;
    padding-top: 0;
  }
  body.hide-sidebar .nc-board-grid {
    width: min(100%, 74vh);
    max-width: 660px;
  }
}

@media (max-width: 767px) {
  body.hide-sidebar .sidebar {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    gap: 0;
  }
  body.hide-sidebar .sidebar > :not(.nav-rail) {
    display: none !important;
  }
  body.hide-sidebar .nc-board-grid {
    width: calc(100% - 14px);
    max-width: min(98vw, 70vh);
  }
}

body.board-fullscreen {
  overflow-x: hidden;
}

body.board-fullscreen .sidebar,
body.board-fullscreen .panel,
body.board-fullscreen .nav-rail {
  display: none !important;
}

body.board-fullscreen .app-shell {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100vw;
  max-width: 100vw !important;
  min-height: 100dvh;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom)) !important;
  margin: 0 auto;
}

body.board-fullscreen .arena {
  width: min(98vw, 820px);
  gap: 6px;
}

body.board-fullscreen .nc-board-grid {
  width: min(92vw, 76dvh) !important;
  max-width: 780px !important;
}

body.board-fullscreen .fullscreen-exit-pill {
  display: inline-flex !important;
}

@media (max-width: 767px) {
  body.board-fullscreen .nc-board-grid {
    width: calc(100vw - 26px) !important;
    max-width: min(97vw, 73dvh) !important;
  }
}

/* =====================================================================
 * PHASE 2: Navigation Architecture, Browsing vs Active Game Separation,
 * Game Context Bar & Mobile "More" Sheet
 * ===================================================================== */
.game-context-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}

.game-context-badge {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--accent);
}

.game-context-sub {
  font-size: 0.74rem;
  font-family: monospace;
  margin-inline-start: auto;
}

body.nc-view-browse .arena {
  display: none !important;
}

body.nc-view-browse .mobile-panel-bar {
  display: none !important;
}

@media (min-width: 1025px) {
  body.nc-view-browse .app-shell {
    grid-template-columns: 240px minmax(0, 1fr);
    max-width: 1280px;
  }
  body.nc-view-browse.hide-sidebar .app-shell {
    grid-template-columns: minmax(0, 1fr);
    max-width: 1020px;
  }
  body.nc-view-game .app-shell,
  body.nc-view-study .app-shell {
    grid-template-columns: 230px minmax(320px, auto) minmax(300px, 365px);
    max-width: 1560px;
  }
  body.nc-view-game.hide-sidebar .app-shell,
  body.nc-view-study.hide-sidebar .app-shell {
    grid-template-columns: minmax(320px, auto) minmax(300px, 385px);
    max-width: 1360px;
  }
}

@media (min-width: 900px) {
  body.nc-view-browse .hub-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
  body.nc-view-browse .bot-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-height: none !important;
    overflow-y: visible !important;
  }
}

@media (max-width: 1024px) and (min-width: 768px) {
  body.nc-view-browse .app-shell {
    grid-template-columns: 1fr;
    max-width: 100%;
  }
  body.nc-view-browse .panel {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 767px) {
  body.nc-view-browse .panel {
    min-height: calc(100dvh - 260px);
  }
  body.nc-view-game .sidebar,
  body.nc-view-study .sidebar {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    gap: 0;
  }
  body.nc-view-game .sidebar > :not(.nav-rail),
  body.nc-view-study .sidebar > :not(.nav-rail) {
    display: none;
  }
  .more-sheet-backdrop {
    align-items: flex-end;
    padding: 12px 10px calc(76px + env(safe-area-inset-bottom));
  }
  .more-sheet-card {
    width: 100%;
    max-width: 480px;
    border-radius: var(--radius);
  }
}

.more-nav-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.more-nav-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--nc-radius-md);
  min-height: 48px;
  padding: 10px 12px;
  font-size: 0.84rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  text-align: start;
}

.more-nav-item:hover,
.more-nav-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.seo-hub-footer {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--nc-radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.76rem;
  color: var(--muted);
}

.seo-hub-copy {
  margin: 0 0 8px 0;
  line-height: 1.45;
  color: var(--text-secondary);
}

.seo-lang-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
}

.seo-lang-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.seo-lang-links a:hover {
  text-decoration: underline;
}

.home-quick-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.home-dash-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 680px) {
  .home-quick-row,
  .home-dash-grid {
    grid-template-columns: 1fr;
  }
}

.home-section-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--nc-radius-md);
  padding: 12px;
}

.home-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.recent-game-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.recent-game-row:first-child {
  border-top: none;
  padding-top: 0;
}

.recent-game-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.recent-outcome-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
}

.recent-outcome-win { background: rgba(34, 197, 94, 0.16); color: var(--success, #22c55e); }
.recent-outcome-loss { background: rgba(239, 68, 68, 0.16); color: var(--danger, #ef4444); }
.recent-outcome-draw { background: rgba(148, 163, 184, 0.16); color: var(--muted); }

/* =========================================================
   NOVACHESS UNIFIED HOMEPAGE DESIGN SYSTEM (Stage 1 & 2)
   Noir Navy #111020 · Royal Plum #24182E · Champagne Gold #D9A441 · Warm Ivory #F5F0E9
   ========================================================= */
#panel-home {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.nh-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 16px;
  border-radius: var(--nc-radius-lg);
  background: rgba(23, 19, 38, 0.92);
  border: 1px solid var(--border);
  position: relative;
  z-index: var(--nc-z-sticky);
}

body.nc-view-browse .panel {
  max-height: none;
  overflow: visible;
}

[data-theme="light"] .nh-topbar {
  background: rgba(255, 250, 244, 0.94);
}

.nh-logo-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--nc-font-display);
  font-weight: 800;
  font-size: 1.08rem;
  letter-spacing: -0.4px;
  color: var(--text);
}

.nh-logo-inline b {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--gold);
  color: var(--gold);
  background: var(--gold-soft);
}

.nh-logo-inline span {
  font-weight: 500;
  color: var(--muted);
}

.nh-top-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.nh-top-nav a,
.nh-top-nav button {
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--nc-font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 2px;
  transition: color 0.15s ease;
}

.nh-top-nav a:hover,
.nh-top-nav button:hover {
  color: var(--gold);
}

.nh-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Hero Showcase with Photographic Crystal King Layer */
.nh-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--nc-radius-xl);
  background: radial-gradient(ellipse at 72% 38%, #4d2c4a 0%, #24182e 42%, #111020 82%);
  color: #f8f4ef;
  border: 1px solid rgba(217, 164, 65, 0.24);
  padding: 36px 28px 22px;
  box-shadow: var(--nc-shadow-md);
}

.nh-hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(96deg, rgba(17, 16, 32, 0.96) 0%, rgba(17, 16, 32, 0.82) 48%, rgba(17, 16, 32, 0.28) 100%),
    linear-gradient(0deg, rgba(17, 16, 32, 0.95) 0%, transparent 45%),
    url('../img/hero-king.jpg') center/cover no-repeat;
  opacity: 0.72;
  pointer-events: none;
}

[dir="rtl"] .nh-hero-bg {
  background:
    linear-gradient(-96deg, rgba(17, 16, 32, 0.96) 0%, rgba(17, 16, 32, 0.82) 48%, rgba(17, 16, 32, 0.28) 100%),
    linear-gradient(0deg, rgba(17, 16, 32, 0.95) 0%, transparent 45%),
    url('../img/hero-king.jpg') center/cover no-repeat;
}

.nh-hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 24px;
  align-items: center;
}

.nh-eyebrow {
  display: inline-block;
  color: #d9a441;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.nh-hero h2.nh-hero-title {
  font-family: var(--nc-font-display);
  font-size: clamp(2rem, 4.4vw, 3.45rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -1.6px;
  margin: 0 0 14px;
  color: #f8f4ef;
}

.nh-hero-sub {
  font-size: 0.9rem;
  line-height: 1.65;
  color: #beb3c4;
  max-width: 480px;
  margin-bottom: 20px;
}

.nh-hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.nh-btn-champagne {
  background: #d9a441;
  color: #171321;
  border: 1px solid #d9a441;
  font-family: var(--nc-font-display);
  font-weight: 800;
  padding: 12px 20px;
  border-radius: 8px;
}

.nh-btn-champagne:hover {
  background: #e5bd76;
  border-color: #e5bd76;
}

.nh-hero-visual {
  position: relative;
  min-height: 250px;
  border-radius: var(--nc-radius-lg);
  overflow: hidden;
  border: 1px solid rgba(217, 164, 65, 0.28);
  background: #171326;
  box-shadow: 0 22px 45px rgba(5, 3, 12, 0.55);
}

.nh-hero-visual img {
  width: 100%;
  height: 100%;
  min-height: 250px;
  max-height: 310px;
  object-fit: cover;
  display: block;
}

.nh-float-tag {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(23, 19, 38, 0.86);
  backdrop-filter: blur(8px);
  color: #f8f4ef;
  font-size: 0.72rem;
}

.nh-float-tag strong {
  display: block;
  color: #f8f4ef;
  font-size: 0.76rem;
}

.nh-float-tag small {
  display: block;
  color: #d9a441;
  font-size: 0.62rem;
  letter-spacing: 0.8px;
}

.nh-float-1 { inset-inline-start: 12px; top: 14px; }
.nh-float-2 { inset-inline-end: 12px; bottom: 14px; }

.nh-hero-foot {
  position: relative;
  z-index: 2;
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.76rem;
  color: #beb3c4;
}

/* Section Typography & Editorial Light / Dark Rhythm */
.nh-sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.nh-sec-head h3 {
  font-family: var(--nc-font-display);
  font-size: clamp(1.3rem, 2.5vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.6px;
  margin: 0;
  color: var(--text);
}

.nh-quick-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 12px;
}

.nh-play-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 165px;
  padding: 18px;
  border-radius: var(--nc-radius-lg);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  text-align: start;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.nh-play-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow: var(--nc-shadow-md);
}

.nh-play-card.featured {
  background: linear-gradient(145deg, #24182e 0%, #171326 100%);
  border-color: rgba(217, 164, 65, 0.45);
  color: #f8f4ef;
}

[data-theme="light"] .nh-play-card:not(.featured) {
  background: #fbf8f2;
  border-color: #e6ddd3;
}

.nh-play-card small {
  font-size: 0.66rem;
  letter-spacing: 1.2px;
  color: var(--gold);
  font-weight: 800;
}

.nh-play-card strong {
  display: block;
  font-family: var(--nc-font-display);
  font-size: 1.05rem;
  margin: 10px 0 4px;
}

.nh-play-card p {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
}

.nh-play-card.featured p {
  color: #dfd5e3;
}

/* Analysis Showcase Split Card */
.nh-analysis-split {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  border-radius: var(--nc-radius-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

[data-theme="light"] .nh-analysis-split {
  background: #e9e1d8;
}

.nh-analysis-stage {
  background: radial-gradient(circle at 50% 45%, #5b3c58 0%, #24182e 65%, #111020 100%);
  padding: 24px;
  display: grid;
  place-items: center;
}

.nh-demo-board-card {
  width: min(295px, 100%);
  background: #f7f2e9;
  color: #191522;
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 20px 45px rgba(8, 5, 16, 0.52);
  transform: rotate(-1.5deg);
}

.nh-demo-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 800;
  color: #625765;
  margin-bottom: 8px;
}

.nh-demo-badge-row span {
  background: rgba(161, 112, 24, 0.16);
  color: #8c5a08;
  padding: 2px 6px;
  border-radius: 4px;
}

.nh-mini-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  border-radius: 4px;
  overflow: hidden;
  background: #d4c1a7;
  margin-bottom: 8px;
}

.nh-mini-board span {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  color: #24182e;
}

.nh-mini-board span:nth-child(16n+1),
.nh-mini-board span:nth-child(16n+3),
.nh-mini-board span:nth-child(16n+5),
.nh-mini-board span:nth-child(16n+7),
.nh-mini-board span:nth-child(16n+10),
.nh-mini-board span:nth-child(16n+12),
.nh-mini-board span:nth-child(16n+14),
.nh-mini-board span:nth-child(16n+16) {
  background: #a78b9a;
}

.nh-mini-board .hl {
  background: #d9a441 !important;
}

.nh-analysis-copy {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.nh-analysis-copy h3 {
  font-family: var(--nc-font-display);
  font-size: 1.55rem;
  font-weight: 700;
  margin: 0;
}

.nh-analysis-copy ul {
  list-style: none;
  margin: 4px 0 8px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--nc-text-secondary);
}

/* Academy 3-Card Row */
.nh-academy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.nh-acad-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--nc-radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

[data-theme="light"] .nh-acad-card {
  background: #fffaf4;
  border-color: #e6ddd3;
}

.nh-acad-art {
  height: 92px;
  display: grid;
  place-items: center;
  font-size: 2.6rem;
  color: #f5d896;
}

.nh-acad-art.a-puzzle { background: linear-gradient(135deg, #34253c, #75516e); }
.nh-acad-art.a-open { background: linear-gradient(135deg, #4b3a49, #8d747b); }
.nh-acad-art.a-coach { background: linear-gradient(135deg, #24182e, #9c6e58); }

.nh-acad-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nh-acad-body small {
  font-size: 0.65rem;
  letter-spacing: 1.2px;
  color: var(--gold);
  font-weight: 800;
}

.nh-acad-body strong {
  font-family: var(--nc-font-display);
  font-size: 0.96rem;
}

.nh-acad-body p {
  font-size: 0.76rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
  flex: 1;
}

/* Tournament Banner Featuring Uploaded Royal Arena Hall Image */
.nh-tourn-showcase {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  border-radius: var(--nc-radius-xl);
  overflow: hidden;
  background: #171321;
  color: #f8f4ef;
  border: 1px solid rgba(217, 164, 65, 0.28);
}

.nh-tourn-photo {
  position: relative;
  min-height: 240px;
}

.nh-tourn-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nh-tourn-seal {
  position: absolute;
  inset-inline-end: 14px;
  bottom: 14px;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 1px solid #d9a441;
  background: rgba(17, 16, 32, 0.85);
  color: #e5bd76;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  line-height: 1.3;
}

.nh-tourn-copy {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.nh-tourn-copy h3 {
  font-family: var(--nc-font-display);
  font-size: 1.55rem;
  margin: 0;
  color: #f8f4ef;
}

.nh-tourn-copy p {
  font-size: 0.8rem;
  line-height: 1.55;
  color: #beb3c4;
  margin: 0;
}

/* Community & Membership Split Rows */
.nh-split-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.nh-final-cta {
  text-align: center;
  padding: 32px 20px;
  border-radius: var(--nc-radius-xl);
  background:
    radial-gradient(ellipse at 50% 110%, rgba(102, 68, 93, 0.55) 0%, rgba(33, 26, 44, 0.94) 58%, #111020 100%);
  color: #f8f4ef;
  border: 1px solid rgba(217, 164, 65, 0.3);
}

.nh-final-cta h3 {
  font-family: var(--nc-font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  margin: 6px 0 8px;
}

.nh-final-cta p {
  color: #beb3c4;
  font-size: 0.84rem;
  margin: 0 0 16px;
}

.nh-footer-cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.nh-footer-cols div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nh-footer-cols b {
  font-size: 0.68rem;
  letter-spacing: 1.2px;
  color: var(--gold);
}

.nh-footer-cols button,
.nh-footer-cols a {
  background: none;
  border: none;
  text-align: start;
  padding: 0;
  color: var(--muted);
  font-size: 0.76rem;
  cursor: pointer;
}

.nh-footer-cols button:hover,
.nh-footer-cols a:hover {
  color: var(--gold);
}

@media (max-width: 1024px) {
  .nh-hero-grid,
  .nh-quick-grid,
  .nh-analysis-split,
  .nh-tourn-showcase {
    grid-template-columns: 1fr;
  }
  .nh-academy-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .nh-topbar {
    flex-wrap: wrap;
    padding: 10px 12px;
  }
  .nh-top-nav {
    display: none;
  }
  .nh-hero {
    padding: 22px 16px 18px;
  }
  .nh-academy-grid,
  .nh-split-2,
  .nh-footer-cols {
    grid-template-columns: 1fr;
  }
  .nh-hero-visual {
    min-height: 190px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nh-play-card,
  .nh-demo-board-card {
    transition: none !important;
    transform: none !important;
  }
}
