/* ============================================================================
   Shpeely v0.3.0 — Researched White-First Daylight Design System
   Inspired by Stripe Dashboard, Linear Light, Notion Daylight & Apple HIG
   ============================================================================ */

:root,
[data-theme="light"] {
  --bg: #F8FAFC;
  --bg-subtle: #FFFFFF;
  --surface: #FFFFFF;
  --surface-alt: #F1F5F9;
  --surface-elevated: #F1F5F9;
  --surface-input: #FFFFFF;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --border-accent: #C7D2FE;
  --text: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --primary-soft: #EEF2FF;
  --accent: #7C3AED;
  --success: #059669;
  --success-soft: #ECFDF5;
  --emerald-soft: #ECFDF5;
  --warning: #D97706;
  --warning-soft: #FFFBEB;
  --danger: #E11D48;
  --danger-soft: #FFF1F2;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.05), 0 8px 24px -4px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 12px 32px -6px rgba(15, 23, 42, 0.12);
  --chart-bg: #FFFFFF;
  --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="dark"] {
  --bg: #0B0F19;
  --bg-subtle: #111827;
  --surface: #111827;
  --surface-alt: #1E293B;
  --surface-elevated: #1E293B;
  --surface-input: #0F172A;
  --border: rgba(148, 163, 184, 0.18);
  --border-strong: rgba(148, 163, 184, 0.3);
  --border-accent: rgba(99, 102, 241, 0.45);
  --text: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;
  --primary: #6366F1;
  --primary-hover: #4F46E5;
  --primary-soft: rgba(99, 102, 241, 0.15);
  --accent: #A855F7;
  --success: #10B981;
  --success-soft: rgba(16, 185, 129, 0.14);
  --emerald-soft: rgba(16, 185, 129, 0.14);
  --warning: #F59E0B;
  --warning-soft: rgba(245, 158, 11, 0.14);
  --danger: #F43F5E;
  --danger-soft: rgba(244, 63, 94, 0.15);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow: 0 16px 36px -12px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 20px 44px -10px rgba(0, 0, 0, 0.65);
  --chart-bg: #0F172A;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

img {
  max-width: 100%;
  height: auto;
}

body {
  min-height: 100vh;
  background: radial-gradient(circle at 12% 0%, rgba(79, 70, 229, 0.05), transparent 40%),
              radial-gradient(circle at 88% 5%, rgba(5, 150, 105, 0.04), transparent 40%),
              var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.5;
  padding-bottom: 3.5rem;
}

code, .mono-tag {
  font-family: 'JetBrains Mono', monospace;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.75rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text);
}

.brand-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  padding: 0.16rem 0.58rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--border-accent);
  font-weight: 600;
}

.brand-pill-bgg {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: rgba(217, 119, 6, 0.35);
}

.brand-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.topbar-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.group-Compiled-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

/* Container & Grids */
.container {
  max-width: 1480px;
  margin: 1.35rem auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.kpi-ribbon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  box-shadow: var(--shadow);
}

.kpi-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
}

.kpi-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.22rem;
  color: var(--text);
}

.kpi-meta {
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 500;
}

.main-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1.35rem;
  align-items: start;
}

.secondary-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 1.35rem;
  align-items: start;
}

@media (max-width: 1120px) {
  .main-grid, .secondary-grid {
    grid-template-columns: 1fr;
  }
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.35rem;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.95rem;
}

.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.69rem;
  letter-spacing: 0.09em;
  color: var(--primary);
  font-weight: 700;
}

.card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.28rem;
  font-weight: 700;
  color: var(--text);
}

.formula-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.78rem;
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  margin-bottom: 0.95rem;
  color: var(--text-secondary);
}

.formula-banner code {
  color: var(--primary);
  font-weight: 700;
}

/* Pure White Canvas Graph Wrapper */
.canvas-wrapper {
  position: relative;
  width: 100%;
  background: var(--chart-bg);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 0.65rem;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

#trajectoryCanvas {
  width: 100%;
  height: 360px;
  display: block;
  cursor: crosshair;
}

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  font-size: 0.78rem;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.14);
  z-index: 20;
  min-width: 220px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0.85rem 0 1.15rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  color: var(--text);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Inline Roster Management Box */
.roster-management-box {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}

.inline-player-form {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

@media (max-width: 720px) {
  .inline-player-form {
    grid-template-columns: 1fr;
  }
}

.roster-pill-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.roster-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.6rem 0.28rem 0.7rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.btn-pill-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}

.btn-pill-remove:hover {
  background: var(--danger);
  color: #FFFFFF;
}

/* Buttons & Inputs */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  padding: 0.52rem 0.95rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.85rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  color: var(--text);
}

.btn-sm {
  padding: 0.4rem 0.78rem;
  font-size: 0.8rem;
}

.btn-xs {
  padding: 0.25rem 0.58rem;
  font-size: 0.74rem;
  border-radius: 7px;
}

.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

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

.btn-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-danger-outline {
  background: var(--danger-soft);
  border: 1px solid rgba(225, 29, 72, 0.25);
  color: var(--danger);
  padding: 0.24rem 0.55rem;
  font-size: 0.74rem;
  border-radius: 7px;
  font-weight: 600;
  cursor: pointer;
}

.btn-danger-outline:hover {
  background: var(--danger);
  color: #FFFFFF;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-google {
  background: #FFFFFF;
  color: #0F172A;
  border: 1px solid #CBD5E1;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.btn-google:hover {
  border-color: var(--primary);
}

.google-g {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: conic-gradient(#ea4335 0 90deg, #4285f4 90deg 180deg, #34a853 180deg 270deg, #fbbc05 270deg 360deg);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

.btn-block {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.92rem;
}

.btn-row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.select-control, .input-control {
  background: var(--surface-input);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-family: inherit;
}

.select-control:focus, .input-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.full-width {
  width: 100%;
}

/* Segmented Toggle */
.segmented-toggle {
  display: inline-flex;
  background: var(--surface-elevated);
  padding: 0.22rem;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.seg-btn {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 0.36rem 0.75rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.seg-btn.active {
  background: var(--primary);
  color: #FFFFFF;
}

/* Tables */
.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.data-table th, .data-table td {
  padding: 0.6rem 0.62rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  font-size: 0.71rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--surface-elevated);
}

.delta-pos {
  color: var(--success);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
}

.delta-neg {
  color: var(--danger);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
}

/* Forms & Score Entry */
.stack-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.game-params-pill {
  font-size: 0.78rem;
  padding: 0.48rem 0.75rem;
  border-radius: 8px;
  background: var(--primary-soft);
  border: 1px solid var(--border-accent);
  color: var(--text);
}

.player-score-list {
  display: flex;
  flex-direction: column;
  gap: 0.48rem;
}

.player-score-row {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 0.65rem;
  padding: 0.48rem 0.72rem;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.player-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.87rem;
  color: var(--text);
}

/* Live Preview Panel */
.preview-panel {
  background: var(--primary-soft);
  border: 1px solid var(--border-accent);
  border-radius: 12px;
  padding: 0.85rem;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.79rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.55rem;
}

.preview-rows {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.preview-row-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  padding: 0.36rem 0.6rem;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
}

/* Recent Matches */
.recent-matches-block {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.section-subheader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
}

.section-subheader h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.muted-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.matches-feed {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 310px;
  overflow-y: auto;
}

.match-card {
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  font-size: 0.8rem;
}

.match-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.match-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.match-chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  padding: 0.16rem 0.48rem;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

/* BGG Search & Studio */
.bgg-search-bar {
  display: grid;
  grid-template-columns: 1fr 110px 110px auto;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

@media (max-width: 760px) {
  .bgg-search-bar {
    grid-template-columns: 1fr;
  }
}

.bgg-catalog-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.bgg-pill {
  font-size: 0.76rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  color: var(--text);
  transition: all 0.15s;
}

.bgg-pill:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.inline-num {
  width: 76px;
  padding: 0.28rem 0.45rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  background: var(--surface-input);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
}

.vault-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.9rem;
}

.badge-accent {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  padding: 0.24rem 0.6rem;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--border-accent);
  font-weight: 700;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.hidden {
  display: none !important;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 1.4rem;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
}

.google-profiles-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.google-profile-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.google-profile-btn:hover {
  border-color: var(--primary);
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 120;
}

.toast {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.14);
}

/* Sprint 4 (v0.4.0): Clickable Last 5 Played Games + Per-Letter Game Search Typeahead */
.recent-played-box {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.45rem;
}

.recent-played-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.38rem;
}

.recent-played-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.recent-played-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.recent-game-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  transition: all 0.14s ease;
}

.recent-game-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.recent-game-chip.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(79, 70, 229, 0.15);
}

.recent-game-chip .chip-meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
}

.game-typeahead-wrap {
  position: relative;
}

.game-typeahead-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 340px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18);
  z-index: 60;
  padding: 0.35rem;
}

.typeahead-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  padding: 0.48rem 0.65rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s ease;
}

.typeahead-item:hover,
.typeahead-item.active {
  background: var(--primary-soft);
}

.typeahead-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
}

.typeahead-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.typeahead-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
}

.typeahead-badge-local {
  background: var(--surface-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.typeahead-badge-bgg {
  background: var(--emerald-soft);
  color: var(--emerald);
  border: 1px solid rgba(5, 150, 105, 0.25);
}

/* Sprint 5 (v0.5.0): Match Result Date Badges, Inline Date Picker & Mobile Ergonomics */
html {
  scroll-behavior: smooth;
}

.match-meta-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.match-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid rgba(79, 70, 229, 0.2);
}

.match-date-inline {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.16rem 0.38rem;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  body {
    padding-bottom: 4.5rem;
    overflow-x: hidden;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 0.9rem;
    gap: 0.65rem;
  }

  .topbar-controls {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
  }

  .group-switcher-bar {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
  }

  #groupSelect {
    grid-column: 1 / -1;
    width: 100%;
  }

  .container {
    padding: 0.75rem 0.75rem 2.5rem;
  }

  .kpi-ribbon {
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
  }

  .card {
    padding: 0.95rem;
    border-radius: 12px;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .segmented-toggle {
    width: 100%;
    display: flex;
  }

  .seg-btn {
    flex: 1;
    text-align: center;
  }

  .inline-player-form {
    grid-template-columns: 1fr;
  }

  .form-row-2 {
    grid-template-columns: 1fr;
  }

  /* Prevent iOS Safari zoom on input focus by ensuring >= 16px font size on mobile */
  .input-control,
  .select-control,
  .inline-num {
    font-size: 16px;
    min-height: 42px;
  }

  .player-score-row {
    grid-template-columns: 1fr 115px;
    gap: 0.45rem;
  }

  .recent-game-chip {
    padding: 0.38rem 0.68rem;
    font-size: 0.78rem;
  }

  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border-strong);
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
    z-index: 95;
    padding: 0.35rem 0.4rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
  }

  .mobile-nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.25rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-decoration: none;
    text-align: center;
  }

  .mobile-nav-item:hover,
  .mobile-nav-item:active,
  .mobile-nav-item.active {
    background: var(--primary-soft);
    color: var(--primary);
  }
}

@media (max-width: 480px) {
  .kpi-ribbon {
    grid-template-columns: 1fr;
  }

  .match-card-top {
    flex-direction: column;
    align-items: flex-start;
  }
}

.hidden {
  display: none !important;
}

/* ============================================================================
   Public Landing Page (Shown when unauthenticated — CR-002)
   ============================================================================ */
.landing-wrapper {
  max-width: 1180px;
  margin: 2rem auto 3rem;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.landing-hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.75rem 2.5rem;
  box-shadow: var(--shadow);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.15rem;
}

.landing-badge-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.landing-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.85rem, 3.5vw, 2.75rem);
  line-height: 1.16;
  font-weight: 700;
  color: var(--text);
  max-width: 820px;
}

.landing-lead {
  font-size: 1.02rem;
  line-height: 1.68;
  color: var(--text-secondary);
  max-width: 780px;
}

.landing-cta-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.btn-google-hero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  background: var(--primary);
  color: #FFFFFF;
  border: 1px solid var(--primary);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.28);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn-google-hero:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(79, 70, 229, 0.35);
}

.btn-google-hero .google-svg-icon {
  background: #FFFFFF;
  border-radius: 50%;
  padding: 3px;
  width: 26px;
  height: 26px;
}

.landing-security-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 680px;
}

.landing-error-banner {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(225, 29, 72, 0.3);
  border-radius: 10px;
  padding: 0.65rem 1rem;
  font-size: 0.86rem;
  font-weight: 600;
  max-width: 680px;
}

.landing-pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.15rem;
}

.landing-pillar-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.landing-pillar-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.landing-pillar-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  color: var(--text);
}

.landing-pillar-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.58;
}

.auth-user-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
}

.auth-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.auth-user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  font-size: 0.78rem;
}

/* BGG Game Cover Images, Emoji Icons & Selected Game Banner (High-Presence v0.15.0) */
.game-asset-pair {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.game-emoji-thumb {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: contain;
  flex-shrink: 0;
  border: 1.5px solid var(--border-accent);
  background: var(--surface-elevated);
  filter: drop-shadow(0 4px 10px rgba(15, 23, 42, 0.22));
  transition: transform 0.15s ease, filter 0.15s ease;
}

.game-emoji-thumb:hover {
  transform: scale(1.06);
  filter: drop-shadow(0 6px 14px rgba(79, 70, 229, 0.28));
}

.game-cover-thumb {
  width: 64px;
  height: 64px;
  border-radius: 15px;
  object-fit: cover;
  border: 1.5px solid var(--border-strong);
  background: var(--surface-elevated);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.game-cover-thumb:hover {
  transform: scale(1.06);
}

.game-cover-mini {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  object-fit: cover;
  border: 1.5px solid var(--border-strong);
  background: var(--surface-elevated);
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.14);
  flex-shrink: 0;
}

.game-cover-chip {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 0.36rem;
  filter: drop-shadow(0 2px 5px rgba(15, 23, 42, 0.16));
}

.selected-game-banner {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

/* Clickable / Selectable Game Rows & Game Details Modal (v0.13.0–v0.15.0) */
.clickable-game-row {
  cursor: pointer;
  transition: background-color 0.14s ease, box-shadow 0.14s ease;
}

.clickable-game-row:hover {
  background-color: var(--primary-soft);
}

.clickable-game-trigger {
  cursor: pointer;
  transition: color 0.14s ease, transform 0.12s ease;
}

.clickable-game-trigger:hover {
  color: var(--primary);
  text-decoration: underline;
}

.game-details-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.15rem;
  padding: 1.15rem;
  border-radius: 14px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
}

.game-modal-cover-lg {
  width: 108px;
  height: 108px;
  border-radius: 22px;
  object-fit: cover;
  border: 2px solid var(--border-strong);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.22);
}

.game-modal-icon-lg {
  width: 108px;
  height: 108px;
  border-radius: 22px;
  object-fit: contain;
  border: 2px solid var(--border-accent);
  background: var(--surface);
  filter: drop-shadow(0 6px 16px rgba(15, 23, 42, 0.24));
}

.game-kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 0.65rem;
  margin-top: 0.65rem;
}

.game-kpi-box {
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.game-modal-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  background: var(--primary-soft);
  border: 1px solid var(--border-accent);
}

/* Live Upgrade Reload Notification Banner (Q-122) */
.update-available-banner {
  position: sticky;
  top: 62px;
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1440px;
  margin: 0.65rem auto 0;
  padding: 0.7rem 1.15rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.14), rgba(16, 185, 129, 0.16));
  border: 2px solid var(--primary);
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.18);
  backdrop-filter: blur(10px);
}

.update-banner-content {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--text);
}

.update-banner-icon {
  font-size: 1.2rem;
}

/* ==========================================================================
   NANO BANANA MINIMALIST UI REDESIGN (v0.17.0 — Q-123)
   Calm, spacious, 2-column layout matching nanobanana-desktop-ui.jpg
   and nanobanana-mobile-modal-ui.jpg
   ========================================================================== */
html[data-theme="light"] {
  --bg: #F3F5F8;
  --surface: #FFFFFF;
  --surface-elevated: #F8FAFC;
  --surface-subtle: #EEF2F6;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --primary: #4F6B88;
  --primary-hover: #3E566E;
  --primary-soft: #EEF2F6;
  --emerald: #059669;
  --amber: #D97706;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html[data-theme="dark"],
body[data-theme="dark"] {
  --bg: #0B0F19;
  --bg-subtle: #111827;
  --surface: #111827;
  --surface-elevated: #161F30;
  --surface-subtle: #1E293B;
  --surface-input: #0F172A;
  --border: #1E293B;
  --border-strong: #334155;
  --border-accent: rgba(99, 102, 241, 0.45);
  --text: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;
  --primary: #60A5FA;
  --primary-hover: #3B82F6;
  --primary-soft: rgba(59, 130, 246, 0.16);
  --emerald: #34D399;
  --amber: #FBBF24;
  --shadow: 0 16px 36px -12px rgba(0, 0, 0, 0.65);
  --chart-bg: #111827;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  transition: background-color 0.18s ease, color 0.18s ease;
}

html[data-theme="dark"] body,
body[data-theme="dark"] {
  background: #0B0F19;
  color: #F8FAFC;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 2rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.brand-name {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.topbar-center {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.group-pill-select {
  appearance: none;
  background: var(--surface-subtle);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.52rem 2.2rem 0.52rem 1.15rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.group-pill-select:hover,
.group-pill-select:focus {
  border-color: var(--border-strong);
  outline: none;
}

.btn-topbar-link {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.btn-topbar-link:hover {
  background: var(--surface-subtle);
  color: var(--text);
}

.container {
  max-width: 1420px;
  margin: 0 auto;
  padding: 1.5rem 2rem 3rem;
}

.nano-workspace-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.nano-right-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
}

.nano-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.5rem 1.65rem;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.05);
}

.nano-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.nano-card-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 0;
}

.nano-log-card .nano-card-title {
  margin-bottom: 1.15rem;
}

.nano-stack-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.nano-field {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.nano-field > label,
.nano-players-header {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
}

.nano-search-input-box {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 0.42rem 0.65rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.nano-search-input-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 107, 136, 0.15);
}

.nano-search-thumb {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
  cursor: pointer;
}

.nano-search-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  outline: none;
  min-width: 0;
}

.nano-search-chevron {
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}

.nano-selected-game-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.nano-date-input {
  width: 100%;
  max-width: 190px;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.88rem;
  font-family: var(--font-sans);
}

.nano-players-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}

.btn-link-subtle {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.76rem;
  cursor: pointer;
  padding: 0;
}

.btn-link-subtle:hover {
  color: var(--text);
  text-decoration: underline;
}

.nano-player-score-list {
  display: flex;
  flex-direction: column;
}

.nano-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.52rem 0;
  border-bottom: 1px solid var(--border);
}

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

.nano-player-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--text);
}

.nano-avatar-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.nano-score-input {
  width: 78px !important;
  height: 38px;
  text-align: center;
  font-size: 0.98rem;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 0.25rem 0.4rem;
}

.nano-score-input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 107, 136, 0.15);
}

.btn-nano-save {
  width: 100%;
  height: 46px;
  border: none;
  border-radius: 10px;
  background: #526B8A;
  color: #FFFFFF;
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  margin-top: 0.25rem;
}

.btn-nano-save:hover {
  background: #415772;
}

.nano-inline-player-form {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.nano-input-sm {
  flex: 1;
  padding: 0.42rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-elevated);
  color: var(--text);
  font-size: 0.82rem;
}

/* Standings & Rating Stacked Full-Width Layout (Fixes Q-125 Table Overflow) */
.nano-standings-split {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.nano-chart-col {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.nano-table-col {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-elevated);
  padding: 0.25rem 0.5rem;
}

.nano-standings-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  table-layout: auto;
}

.nano-standings-table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.nano-standings-table td {
  padding: 0.58rem 0.65rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
}

.nano-standings-table tbody tr:last-child td {
  border-bottom: none;
}

.nano-standings-table tbody tr:first-child td {
  background: var(--surface-subtle);
  font-weight: 700;
}

.nano-standings-table tbody tr:first-child td:first-child {
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}

.nano-standings-table tbody tr:first-child td:last-child {
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}

.nano-remove-player-btn {
  opacity: 0.35;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.78rem;
  margin-left: 0.35rem;
}

.nano-remove-player-btn:hover {
  opacity: 1;
  color: var(--danger);
}

.nano-matches-drawer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.nano-matches-drawer summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  list-style: none;
}

.nano-matches-drawer[open] .matches-feed {
  margin-top: 0.75rem;
}

/* Games Library Card Grid (Matches nanobanana-desktop-ui.jpg) */
.nano-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(188px, 1fr));
  gap: 1rem;
}

.nano-game-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.85rem;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.nano-game-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.nano-game-card-art {
  width: 100%;
  height: 146px;
  border-radius: 10px;
  background: var(--surface-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 0.7rem;
}

.nano-game-card-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.25rem;
}

.nano-game-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
}

.nano-game-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nano-weight-pill {
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-size: 0.73rem;
  font-weight: 700;
  padding: 0.18rem 0.48rem;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.nano-game-card-sub {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.35;
  margin-bottom: 0.6rem;
}

.nano-game-card-pills {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.nano-pill-high {
  background: #D8EAF6;
  color: #0F172A;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
}

.nano-pill-low {
  background: #F5D8D6;
  color: #0F172A;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
}

/* Minimalist Game Detail Modal (Matches nanobanana-mobile-modal-ui.jpg) */
.nano-game-modal-card {
  max-width: 680px !important;
  border-radius: 22px !important;
  padding: 1.85rem 2rem !important;
  max-height: 90vh;
  overflow-y: auto;
}

.nano-modal-header {
  margin-bottom: 1.25rem;
}

.nano-modal-header h3 {
  font-size: 1.35rem;
  font-weight: 700;
}

.nano-btn-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nano-modal-hero {
  display: flex;
  align-items: flex-start;
  gap: 1.75rem;
  margin-bottom: 1.6rem;
}

.nano-modal-cover {
  width: 162px;
  height: 162px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
  flex-shrink: 0;
}

.nano-modal-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.nano-modal-game-title {
  font-size: 1.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0;
  line-height: 1.15;
}

.nano-modal-weight-pill {
  display: inline-flex;
  align-self: flex-start;
  background: var(--surface-subtle);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
}

.nano-modal-score-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.nano-modal-score-pill-hi {
  background: #D8EAF6;
  color: #0F172A;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.38rem 0.9rem;
  border-radius: 999px;
}

.nano-modal-score-pill-lo {
  background: #F5D8D6;
  color: #0F172A;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.38rem 0.9rem;
  border-radius: 999px;
}

.nano-modal-norm-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.2rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
}

.nano-modal-norm-input {
  width: 86px;
  height: 38px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}

@media (max-width: 1024px) {
  .nano-workspace-grid {
    grid-template-columns: 1fr;
  }
  .nano-standings-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .container {
    padding: 1rem 0.85rem 4.5rem;
  }
  .nano-modal-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .nano-modal-weight-pill {
    align-self: center;
  }
  .nano-modal-score-pills,
  .nano-modal-norm-row {
    justify-content: center;
  }
}

/* ==========================================================================
   APACHE ECHARTS 5.5 & NERDY TABLETOP ANALYTICS UI (v0.18.0)
   ========================================================================== */
.tabular-mono,
.nano-standings-table td code,
.formula-code,
.elo-row-preview-badge {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.nano-chart-header-wrap {
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.85rem;
}

.nerdy-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.chart-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.chart-subcontrols {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.segmented-toggle-sm .seg-btn {
  padding: 0.26rem 0.58rem;
  font-size: 0.74rem;
}

.echarts-container {
  width: 100%;
  height: 320px;
  min-height: 300px;
  border-radius: 12px;
}

.nano-player-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  flex: 1;
}

.elo-row-preview-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.14rem 0.42rem;
  border-radius: 6px;
  background: var(--surface-subtle);
  color: var(--text-secondary);
  white-space: nowrap;
}

.elo-row-preview-badge.delta-pos {
  background: rgba(5, 150, 105, 0.12);
  color: var(--emerald);
}

.elo-row-preview-badge.delta-neg {
  background: rgba(217, 119, 6, 0.14);
  color: var(--amber);
}

.live-elo-preview-strip {
  margin-top: 0.45rem;
  font-size: 0.76rem;
}

.form-dots {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
}

.form-dot {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem;
  font-weight: 700;
}

.form-dot-w {
  background: rgba(5, 150, 105, 0.15);
  color: #059669;
  border: 1px solid rgba(5, 150, 105, 0.32);
}

.form-dot-l {
  background: rgba(148, 163, 184, 0.16);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.nano-formula-drawer {
  margin-top: 1rem;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
}

.nano-formula-drawer summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  list-style: none;
}

.formula-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.formula-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}

.formula-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.formula-code {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--surface-subtle);
  padding: 0.28rem 0.45rem;
  border-radius: 6px;
  margin-bottom: 0.35rem;
}

.nano-game-card-cover-wrap {
  width: 100%;
  height: 146px;
  border-radius: 10px;
  background: var(--surface-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 0.7rem;
}

.nano-game-card-cover {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.25rem;
}

.nano-game-card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
}

.nano-game-card-scores {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.nano-score-pill-hi {
  background: #D8EAF6;
  color: #0F172A;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}

.nano-score-pill-lo {
  background: #F5D8D6;
  color: #0F172A;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}

.nano-modal-badges {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* Dark Mode Surface Refinements & Pill Contrast (v0.20.0 — Q-125) */
html[data-theme="dark"] .nano-card,
body[data-theme="dark"] .nano-card,
html[data-theme="dark"] .modal-card,
body[data-theme="dark"] .modal-card {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .topbar,
body[data-theme="dark"] .topbar {
  background: rgba(17, 24, 39, 0.94);
  border-bottom-color: var(--border);
}

html[data-theme="dark"] .nano-pill-high,
html[data-theme="dark"] .nano-score-pill-hi,
html[data-theme="dark"] .nano-modal-score-pill-hi {
  background: rgba(56, 189, 248, 0.18);
  color: #7DD3FC;
  border: 1px solid rgba(56, 189, 248, 0.32);
}

html[data-theme="dark"] .nano-pill-low,
html[data-theme="dark"] .nano-score-pill-lo,
html[data-theme="dark"] .nano-modal-score-pill-lo {
  background: rgba(244, 63, 94, 0.18);
  color: #FDA4AF;
  border: 1px solid rgba(244, 63, 94, 0.32);
}

/* ==========================================================================
   GAME-STYLE TIGHTLY-FITTING SCORE SHEET & VERSIONING UI (v0.21.0 — Q-127)
   ========================================================================== */
.scoring-mode-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.35rem 0 0.5rem;
  flex-wrap: wrap;
}

.eurogame-sheet-wrap {
  margin-bottom: 0.65rem;
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.eurogame-sheet-scroll {
  width: 100%;
  overflow-x: auto;
}

.eurogame-sheet-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.82rem;
}

.eurogame-sheet-table th,
.eurogame-sheet-table td {
  padding: 3px 3px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  vertical-align: middle;
  box-sizing: border-box;
}

.eurogame-sheet-table th:last-child,
.eurogame-sheet-table td:last-child {
  border-right: none;
}

/* Column 1: Nano Banana Score Sheet Background Column with AI Category Icons */
.eurogame-sheet-table th.scoresheet-icon-col,
.eurogame-sheet-table td.scoresheet-icon-col {
  width: 56px;
  min-width: 56px;
  max-width: 56px;
  padding: 4px 4px;
  text-align: center;
  position: sticky;
  left: 0;
  z-index: 2;
  background-color: #0F172A;
  background-image: url('/assets/scoresheet/scoresheet-col-bg.jpg');
  background-size: cover;
  background-position: center;
  border-right: 2px solid rgba(245, 158, 11, 0.5);
  color: #F8FAFC;
}

.scoresheet-col1-header-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(245, 158, 11, 0.55);
  color: #FBBF24;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.scoresheet-cat-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.scoresheet-cat-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  object-fit: cover;
  border: 1.5px solid rgba(255, 255, 255, 0.32);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.55);
  transition: transform 0.14s ease, border-color 0.14s ease;
  display: block;
}

.scoresheet-cat-icon-btn:hover .scoresheet-cat-icon {
  transform: scale(1.08);
  border-color: #FBBF24;
}

.scoresheet-mult-pill {
  position: absolute;
  bottom: -3px;
  right: -4px;
  background: #F59E0B;
  color: #0F172A;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 0 3px;
  border-radius: 4px;
  line-height: 1.25;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Columns 2..N: Tightly-Fitting Player Columns */
.eurogame-sheet-table thead th.scoresheet-player-col {
  background: var(--surface-subtle);
  color: var(--text);
  font-weight: 700;
  font-size: 0.74rem;
  text-align: center;
  padding: 5px 3px;
  min-width: 58px;
}

.scoresheet-player-hdr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.15;
}

.scoresheet-player-name {
  font-size: 0.73rem;
  font-weight: 700;
  max-width: 68px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.euro-cat-input {
  width: 100%;
  height: 36px;
  padding: 2px 2px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
  font-weight: 700;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  box-sizing: border-box;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.euro-cat-input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.22);
}

.euro-total-row td {
  background: var(--surface-subtle);
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.92rem;
  text-align: center;
  padding: 6px 3px;
  border-bottom: none;
}

.euro-total-row td.scoresheet-icon-col {
  background-color: #0F172A;
  background-image: url('/assets/scoresheet/scoresheet-col-bg.jpg');
  background-size: cover;
  background-position: bottom center;
}

.scoresheet-sum-emblem {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 32px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.22);
  border: 1.5px solid #FBBF24;
  color: #FBBF24;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  font-weight: 800;
}

.form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 560px) {
  .form-row-2col {
    grid-template-columns: 1fr;
  }
}

.checkbox-inline-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.settings-stats-box {
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
}

.invited-emails-section {
  margin-top: 1.1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.invited-emails-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.invited-email-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  font-size: 0.84rem;
}

.modal-card-lg {
  max-width: 720px !important;
  max-height: 90vh;
  overflow-y: auto;
}

.scoring-cat-editor-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.scoring-cat-editor-row {
  display: grid;
  grid-template-columns: 42px 135px 1fr 1fr 68px 34px;
  gap: 0.4rem;
  align-items: center;
  padding: 0.35rem 0.45rem;
  border-radius: 9px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
}

@media (max-width: 640px) {
  .scoring-cat-editor-row {
    grid-template-columns: 42px 1fr 34px;
  }
}

.cat-edit-preview-thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border-strong);
}

.scoresheet-versions-panel {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.scoresheet-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.45rem;
  max-height: 175px;
  overflow-y: auto;
}

.scoresheet-version-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  font-size: 0.8rem;
}








/* ==========================================================================
   CR-003: Shpeely ("Spiili") Brand Logo & Favicon Styling
   ========================================================================== */
.brand-logo-img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.22);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.landing-logo-hero {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.55rem 1rem 0.55rem 0.65rem;
  margin-bottom: 0.85rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.landing-logo-img {
  width: 68px;
  height: 68px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
  border: 1px solid var(--border);
}

.landing-logo-text {
  display: flex;
  flex-direction: column;
  text-align: left;
  gap: 0.15rem;
}

.landing-logo-title {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
}

.landing-logo-etymology {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.landing-features-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 1.15rem 0 1.35rem;
  text-align: left;
}

@media (max-width: 640px) {
  .landing-features-row {
    grid-template-columns: 1fr;
  }
}

.landing-feature-pill {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-size: 0.82rem;
}

.landing-feature-pill strong {
  color: var(--text);
  font-weight: 700;
}

.landing-feature-pill span {
  color: var(--text-muted);
  font-size: 0.74rem;
}

.landing-footer-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1.15rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.landing-bgg-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.landing-bgg-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   CR-004: Beta Staging Banner & Release Notes Modal
   ========================================================================== */
.beta-staging-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  padding: 0.6rem 1.75rem;
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.12) 0%, rgba(16, 185, 129, 0.12) 100%);
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.beta-banner-content {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.beta-pill-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  background: var(--primary);
  color: #FFFFFF;
}

.beta-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.release-notes-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-height: 62vh;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.release-note-card {
  padding: 0.95rem 1.1rem;
  border-radius: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.release-note-pending {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-soft);
}

.release-note-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.55rem;
}

.release-version-tag {
  font-size: 0.85rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
}

.release-note-title {
  font-size: 0.94rem;
  color: var(--text);
}

.release-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.release-status-beta {
  background: rgba(245, 158, 11, 0.16);
  color: #D97706;
}

.release-status-prod {
  background: rgba(16, 185, 129, 0.16);
  color: #059669;
}

.release-highlights-list {
  margin: 0;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  font-size: 0.83rem;
  color: var(--text);
}

.release-tech-details {
  margin-top: 0.55rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.release-tech-details summary {
  cursor: pointer;
  font-weight: 600;
}

/* ==========================================================================
   Q-130: Spicy High-Converting Welcome Page Showcase & Live BGG ELO Simulator
   ========================================================================== */
.welcome-showcase-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3.5rem;
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

.welcome-hero-split {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 2.2rem;
  align-items: center;
  padding: 2.25rem 2.4rem;
  border-radius: 26px;
  background: linear-gradient(145deg, var(--surface) 0%, var(--surface-alt) 100%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg, 0 18px 42px rgba(15, 23, 42, 0.08));
  position: relative;
  overflow: hidden;
}

@media (max-width: 960px) {
  .welcome-hero-split {
    grid-template-columns: 1fr;
    padding: 1.65rem 1.35rem;
  }
}

.welcome-hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 0.9rem;
}

.welcome-Swiss-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.32rem 0.85rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid rgba(79, 70, 229, 0.2);
}

.welcome-hero-headline {
  font-size: clamp(1.95rem, 3.3vw, 2.85rem);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.035em;
  color: var(--text);
  margin: 0;
}

.welcome-gradient-text {
  background: linear-gradient(95deg, #4F46E5 0%, #D97706 55%, #10B981 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.welcome-hero-subcopy {
  font-size: 1.02rem;
  line-height: 1.58;
  color: var(--text-secondary);
  margin: 0;
}

.welcome-cta-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  margin-top: 0.35rem;
  width: 100%;
}

.welcome-google-cta {
  padding: 0.85rem 1.55rem !important;
  font-size: 1rem !important;
  border-radius: 14px !important;
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.25);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.welcome-google-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(79, 70, 229, 0.34);
}

.welcome-cta-caption {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.welcome-trust-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  margin-top: 0.45rem;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.welcome-trust-metric {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.welcome-trust-metric strong {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text);
}

.welcome-trust-metric span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.welcome-hero-visual {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.welcome-artwork-frame {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid var(--border);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.22);
  background: #0F172A;
}

.welcome-hero-art-img {
  width: 100%;
  height: 330px;
  object-fit: cover;
  display: block;
}

.welcome-floating-badge {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.86);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #F8FAFC;
  font-size: 0.75rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.32);
}

.welcome-floating-badge-top {
  top: 0.85rem;
  left: 0.85rem;
}

.welcome-floating-badge-bottom {
  bottom: 0.85rem;
  right: 0.85rem;
}

.welcome-badge-kicker {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #FBBF24;
  font-weight: 700;
}

.welcome-mini-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

@media (max-width: 620px) {
  .welcome-mini-podium {
    grid-template-columns: 1fr;
  }
}

.welcome-podium-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.48rem 0.65rem;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.76rem;
}

.welcome-podium-gold {
  border-color: rgba(245, 158, 11, 0.45);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.1) 0%, var(--surface) 100%);
}

/* Interactive ELO Simulator Card */
.welcome-simulator-card {
  padding: 1.75rem 2rem;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.welcome-sim-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.welcome-section-kicker {
  display: inline-block;
  font-size: 0.73rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-bottom: 0.2rem;
}

.welcome-section-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
}

.welcome-sim-controls {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 1.25rem;
  align-items: center;
}

@media (max-width: 820px) {
  .welcome-sim-controls {
    grid-template-columns: 1fr;
  }
}

.welcome-sim-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sim-preset-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sim-preset-pill span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.sim-preset-pill.active,
.sim-preset-pill:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.welcome-sim-slider-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.welcome-sim-slider-wrap input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
}

.welcome-sim-readout {
  display: grid;
  grid-template-columns: 0.65fr 0.65fr 1.4fr;
  gap: 0.85rem;
  align-items: stretch;
}

@media (max-width: 820px) {
  .welcome-sim-readout {
    grid-template-columns: 1fr;
  }
}

.sim-result-box {
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.2rem;
}

.sim-result-box-primary {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.07);
}

.sim-result-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 700;
}

.sim-result-value {
  font-size: 1.3rem;
  font-weight: 900;
}

.sim-result-explain {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

/* Tactile Bento Showcase Grid */
.welcome-bento-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.15rem;
}

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

.welcome-bento-card {
  padding: 1.35rem 1.45rem;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  text-align: left;
}

.welcome-bento-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.welcome-bento-card h3 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text);
}

.welcome-bento-card p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.52;
  color: var(--text-secondary);
}

.welcome-icon-parade {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: auto;
  padding-top: 0.35rem;
}

.welcome-icon-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.22rem;
  padding: 0.38rem;
  border-radius: 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.welcome-icon-chip img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
}

.welcome-mini-covers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.35rem;
}

.welcome-cover-tag {
  padding: 0.28rem 0.55rem;
  border-radius: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--text);
}

.welcome-step-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.35rem;
}

/* 3-Step Strip */
.welcome-steps-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding: 1.15rem 1.35rem;
  border-radius: 18px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

@media (max-width: 820px) {
  .welcome-steps-strip {
    grid-template-columns: 1fr;
  }
}

.welcome-step-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  text-align: left;
}

.welcome-step-num {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--primary);
  color: #FFFFFF;
  font-weight: 800;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.welcome-step-item strong {
  display: block;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.welcome-step-item p {
  margin: 0;
  font-size: 0.79rem;
  color: var(--text-muted);
  line-height: 1.42;
}

/* ==========================================================================
   Q-131: Cooperative Match Entry (Paleo Win/Loss) & Admin Central RBAC
   ========================================================================== */
.coop-match-panel {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.85rem;
  border-radius: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  margin-bottom: 0.55rem;
}

.coop-outcome-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.coop-outcome-btn {
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-weight: 800;
  font-size: 0.84rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.coop-outcome-win.active {
  border-color: #10B981;
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
}

.coop-outcome-loss.active {
  border-color: #EF4444;
  background: rgba(239, 68, 68, 0.14);
  color: #DC2626;
}

.coop-players-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.coop-players-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.coop-player-check-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.84rem;
  cursor: pointer;
}

.admin-central-panel {
  margin-top: 0.85rem;
}

/* ==========================================================================
   CR-007 / v0.8.2: Landing Page Simulator, Floating Badges & Bento Polish
   ========================================================================== */
.welcome-hero-img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  display: block;
}

.welcome-float-badge {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 0.14rem;
  padding: 0.52rem 0.78rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #F8FAFC;
  font-size: 0.75rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  z-index: 3;
}

.welcome-float-top {
  top: 0.85rem;
  left: 0.85rem;
}

.welcome-float-bottom-left {
  bottom: 0.85rem;
  left: 0.85rem;
}

.welcome-float-bottom-right {
  bottom: 0.85rem;
  right: 0.85rem;
}

@media (max-width: 640px) {
  .welcome-float-bottom-left {
    display: none;
  }
}

.float-badge-title {
  font-weight: 800;
  font-size: 0.78rem;
  color: #FFFFFF;
}

.float-badge-meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #CBD5E1;
}

.welcome-sim-games-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 0.6rem;
}

.sim-game-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.sim-game-chip img {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
}

.sim-game-chip div {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.sim-game-chip strong {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sim-game-chip span {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  color: var(--text-muted);
}

.sim-game-chip.active,
.sim-game-chip:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.14);
}

.welcome-sim-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (max-width: 900px) {
  .welcome-sim-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .welcome-sim-metrics-grid {
    grid-template-columns: 1fr;
  }
}

.sim-metric-box {
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.sim-metric-highlight {
  border-color: rgba(16, 185, 129, 0.45);
  background: var(--emerald-soft);
}

.sim-metric-label {
  font-size: 0.69rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.sim-metric-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.24rem;
  font-weight: 800;
  color: var(--text);
}

.sim-metric-sub {
  font-size: 0.73rem;
  color: var(--text-secondary);
}

.welcome-mini-scoresheet {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  margin-top: auto;
  padding-top: 0.35rem;
}

.mini-sheet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.38rem 0.6rem;
  border-radius: 9px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-size: 0.76rem;
}

.mini-sheet-icon-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  color: var(--text);
}

.mini-sheet-icon-cell img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: cover;
}

.welcome-mini-telemetry {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  margin-top: auto;
  padding-top: 0.35rem;
}

.mini-telemetry-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 0.42rem 0.65rem;
  border-radius: 9px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   CR-007: Group Settings, Player Linking (`🔗`) & Landing Invite Banner
   ========================================================================== */
.landing-invite-banner {
  margin-bottom: 1rem;
  padding: 0.9rem 1.2rem;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.14) 0%, rgba(16, 185, 129, 0.14) 100%);
  border: 1.5px solid var(--primary);
  color: var(--text);
  font-weight: 700;
  font-size: 0.92rem;
  box-shadow: var(--shadow-sm);
}

.group-settings-players-list {
  display: flex;
  flex-direction: column;
  gap: 0.48rem;
}

.group-settings-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
  padding: 0.52rem 0.68rem;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.btn-inline-link-player {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  margin-left: 0.25rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.14s ease;
}

.btn-inline-link-player:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: scale(1.06);
}

.player-linked-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.42rem;
  margin-left: 0.25rem;
  border-radius: 999px;
  background: var(--emerald-soft);
  color: var(--success);
  font-size: 0.67rem;
  font-weight: 700;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.matches-feed-expanded {
  max-height: none !important;
}

/* ==========================================================================
   Score Entry Width, Spinner Suppression & Admin Central Modal Width
   ========================================================================== */
@media (min-width: 1180px) {
  .nano-workspace-grid {
    grid-template-columns: minmax(410px, 440px) minmax(0, 1fr);
  }
}

.euro-cat-input::-webkit-outer-spin-button,
.euro-cat-input::-webkit-inner-spin-button,
.nano-score-input::-webkit-outer-spin-button,
.nano-score-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.euro-cat-input,
.nano-score-input {
  -moz-appearance: textfield;
  appearance: textfield;
}

#adminCentralModal .modal-card {
  max-width: 920px;
}

/* ==========================================================================
   Dark Mode Contrast Fixes (html[data-theme="dark"])
   ========================================================================== */
html[data-theme="dark"] .topbar {
  background: rgba(15, 23, 42, 0.88);
  border-bottom-color: rgba(148, 163, 184, 0.18);
}

html[data-theme="dark"] .nav-util-btn {
  background: #1E293B;
  color: #E2E8F0;
  border-color: rgba(148, 163, 184, 0.28);
}

html[data-theme="dark"] .nav-util-btn:hover {
  border-color: var(--primary);
  color: #FFFFFF;
}

html[data-theme="dark"] .data-table tbody tr.rank-1 {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.16) 0%, rgba(30, 41, 59, 0.6) 60%);
}

html[data-theme="dark"] .match-history-card,
html[data-theme="dark"] .match-card {
  background: #1E293B;
  border-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .nano-game-card {
  background: #1E293B;
  border-color: rgba(148, 163, 184, 0.22);
}

