/* ═══════════════ MODULAR GAME VIEWER MODULE ═══════════════ */

/* Viewer Container / Pane */
.gv-viewer-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.gv-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.gv-game-info {
  color: var(--text2);
  font-size: 14px;
}

.gv-review-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent, #68d391);
  border: 1px solid rgba(104, 211, 145, 0.4);
  background: rgba(104, 211, 145, 0.08);
  font-weight: 500;
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.gv-review-btn:hover {
  background: rgba(104, 211, 145, 0.2);
  border-color: var(--accent, #68d391);
  color: #fff;
}

#gv-share-btn {
  color: #a78bfa;
  border-color: rgba(167, 139, 250, 0.4);
  background: rgba(167, 139, 250, 0.08);
}

#gv-share-btn:hover {
  background: rgba(167, 139, 250, 0.2);
  border-color: #a78bfa;
  color: #fff;
}

#gv-share-btn.copied {
  background: rgba(74, 222, 128, 0.25) !important;
  border-color: #4ade80 !important;
  color: #4ade80 !important;
  transition: all 0.2s ease;
}

/* ═══════════════ SHARED GAME VIEW CLEAN MODE ═══════════════ */
body.shared-game-view #gv-back-btn,
body.shared-game-view #gv-theory-btn,
body.shared-game-view #gv-save-btn,
body.shared-game-view #lib-hub-home-btn,
body.shared-game-view #sr-home-btn,
body.shared-game-view #page-library-hub .topbar-right button,
#page-library-hub.shared-game-view #gv-back-btn,
#page-library-hub.shared-game-view #gv-theory-btn,
#page-library-hub.shared-game-view #gv-save-btn,
#page-library-hub.shared-game-view #lib-hub-home-btn,
#page-library-hub.shared-game-view .topbar-right button {
  display: none !important;
}

body.shared-collection-view #gv-back-btn,
#page-library-hub.shared-collection-view #gv-back-btn {
  display: inline-flex !important;
}

body.shared-collection-view #gv-smart-review-btn,
body.shared-collection-view #gv-share-btn,
#page-library-hub.shared-collection-view #gv-smart-review-btn,
#page-library-hub.shared-collection-view #gv-share-btn {
  display: none !important;
}

.gv-main {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: nowrap;
  justify-content: center;
}

/* Board Area */
.gv-board-area {
  display: flex;
  gap: 8px;
}

.gv-board-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Player Cards (Enhanced with Badges & Side Dots) */
.gv-player {
  font-size: 14px;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 2px;
}

.gv-player-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gv-side-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}
.gv-side-dot.white {
  background: #f0d9b5;
  border: 1.5px solid #d4b896;
  box-shadow: 0 0 5px rgba(240, 217, 181, 0.5);
}
.gv-side-dot.black {
  background: #272522;
  border: 1.5px solid #756d64;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}

.gv-player-name {
  font-weight: 600;
  color: var(--text);
}

.gv-player-elo {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  color: var(--text3);
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.gv-player-tray {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Captured Pieces Display (Enlarged to 20px, Lichess-style Overlap & Contrast) */
.gv-captured-pieces {
  display: flex;
  align-items: center;
  min-height: 22px;
}

.gv-captured-icon,
.captured-piece-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  margin-right: -4px; /* Lichess overlapping pawns effect */
  filter: drop-shadow(0 0 1.2px rgba(255, 255, 255, 0.55)) drop-shadow(0 1.5px 2px rgba(0, 0, 0, 0.85));
  transition: transform 0.15s ease;
}

.gv-captured-icon:last-child,
.captured-piece-icon:last-child {
  margin-right: 2px;
}

.gv-material-adv {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 4px;
  text-align: right;
  flex-shrink: 0;
  letter-spacing: 0.2px;
}

#gv-board {
  width: 650px;
  height: 650px;
}

/* Eval Bar */
.gv-eval-wrap {
  width: 16px;
  height: 650px;
  background: #333;
  margin-top: 33px; /* align with board */
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* Lila-style vertical flip when board orientation is Black */
.gv-eval-wrap.reverse {
  transform: rotateX(180deg);
}

.gv-eval-fill {
  width: 100%;
  background: #fff;
  height: 50%;
  transition: height 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.gv-eval-text {
  position: absolute;
  width: 100%;
  text-align: center;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-family: 'IBM Plex Mono', monospace;
  color: #888;
  mix-blend-mode: difference;
  pointer-events: none;
}

/* Counter-rotate text so score remains upright and vertically centered */
.gv-eval-wrap.reverse .gv-eval-text {
  transform: rotateX(180deg) translateY(-50%);
}

/* Side Panel */
.gv-side {
  width: 380px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 718px; /* board + top header + bot header */
  margin-top: 0;
}

/* Engine */
.gv-engine-panel {
  background: var(--surface2);
  border-radius: 8px;
  padding: 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
}

.gv-engine-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 8px;
  color: var(--text2);
}

.gv-engine-toggles {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gv-mode-toggle {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.gv-mode-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.72rem;
  font-family: inherit;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.gv-mode-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.05);
}

.gv-mode-btn.active {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.gv-pv {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.gv-pv-score {
  font-weight: 500;
  width: 45px;
  text-align: right;
  flex-shrink: 0;
}

.gv-pv-moves {
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
}

.gv-pv-move-item {
  cursor: pointer;
  padding: 1px 3px;
  border-radius: 3px;
  transition: background 0.12s ease, color 0.12s ease;
  user-select: none;
}

.gv-pv-move-item:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #38bdf8;
}

.gv-pv-move-num {
  color: var(--text3);
  opacity: 0.65;
  font-size: 11px;
}

/* Floating Mini-Board Hover Preview */
.gv-hover-preview {
  position: fixed;
  z-index: 10000;
  width: 220px;
  height: 220px;
  background: var(--surface2, #181b20);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.08);
  pointer-events: none;
  overflow: hidden;
}

.gv-hover-preview #gv-hover-board {
  width: 100%;
  height: 100%;
}

/* Moves List & Sub-Variation Tree */
.gv-moves-panel {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow-y: auto;
  padding: 8px 10px;
  font-family: 'IBM Plex Sans', sans-serif;
  line-height: 1.5;
}

.gv-move-tree-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gv-move-row {
  display: flex;
  padding: 2px 4px;
  align-items: center;
}

.gv-move-num {
  width: 36px;
  color: var(--text3);
  font-size: 12.5px;
  font-family: 'IBM Plex Mono', monospace;
  flex-shrink: 0;
}

.gv-move {
  flex: 1;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13.5px;
  transition: all 0.12s ease;
  user-select: none;
  display: inline-block;
}

.gv-move:hover {
  background: var(--surface2);
  color: var(--text);
}

.gv-move.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Sub-Variation Cards */
.gv-variation-block {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-left: 3px solid rgba(173, 98, 255, 0.5);
  border-radius: 5px;
  margin: 4px 0 5px 8px;
  padding: 6px 8px;
  font-size: 12.5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.15s ease;
}

.gv-variation-block:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(173, 98, 255, 0.35);
}

.gv-variation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 3px;
  margin-bottom: 2px;
}

.gv-var-label {
  font-size: 11px;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--text3);
  font-weight: 500;
}

.gv-var-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.gv-var-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text3);
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.12s ease;
  line-height: 1;
}

.gv-var-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.gv-var-promote:hover {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}

.gv-var-delete:hover {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.3);
}

.gv-var-moves-flow {
  display: inline;
  line-height: 1.7;
}

.gv-var-move {
  cursor: pointer;
  padding: 1px 5px;
  border-radius: 3px;
  display: inline-block;
  font-size: 12.5px;
  color: #cbd5e1;
  transition: all 0.1s ease;
}

.gv-var-move:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.gv-var-move.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* Position in Games Explorer Panel */
.gv-position-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  max-height: 140px;
  font-family: 'IBM Plex Sans', sans-serif;
  overflow: hidden;
}

.gv-position-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text2);
}

.gv-position-badge {
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: bold;
}

.gv-position-list {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.gv-position-empty {
  padding: 12px;
  text-align: center;
  font-size: 12px;
  color: var(--text3);
  font-style: italic;
}

.gv-position-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.gv-position-item:hover {
  background: var(--surface2);
}

.gv-position-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.gv-position-item-info {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gv-position-source-tag {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text2);
  flex-shrink: 0;
}

.gv-position-source-bot {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.gv-position-source-arena {
  background: rgba(234, 179, 8, 0.2);
  color: #facc15;
}

.gv-position-source-online {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.gv-position-source-lichess {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
}

.gv-position-players {
  font-weight: 500;
  color: var(--text1, var(--text));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gv-pos-user-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 3px;
}

.gv-pos-win {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.gv-pos-loss {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.gv-pos-draw {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  border: 1px solid rgba(203, 213, 225, 0.3);
}

.gv-position-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
}

.gv-pos-next-move {
  color: #38bdf8;
  font-weight: 600;
  background: rgba(56, 189, 248, 0.12);
  padding: 1px 5px;
  border-radius: 3px;
}

.gv-position-move-num {
  color: var(--text3);
}

.gv-pos-date {
  margin-left: auto;
  color: var(--text3);
  font-size: 10px;
}

/* Controls */
.gv-controls {
  display: flex;
  gap: 4px;
}

.gv-controls button {
  flex: 1;
  font-size: 16px;
  font-weight: bold;
  padding: 8px 0;
  border-radius: 4px;
}

/* FEN Box & Quick Copy Buttons */
.gv-fen-box {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gv-fen-box input {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text3);
  padding: 6px 8px;
  border-radius: 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  outline: none;
}

.gv-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text2);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.gv-copy-btn:hover {
  background: rgba(173, 98, 255, 0.15);
  border-color: var(--accent);
  color: #fff;
}

.gv-copy-btn.copied {
  background: rgba(34, 197, 94, 0.2);
  border-color: #4ade80;
  color: #4ade80;
}

/* Responsive Styles */
@media(max-width: 1050px) {
  .gv-viewer-pane {
    padding: 10px 8px;
  }

  .gv-main {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
  }

  .gv-board-area {
    order: 1;
    width: 100%;
    max-width: 650px;
    justify-content: center;
    gap: 6px;
  }

  .gv-board-col {
    flex: 1;
    min-width: 0;
    max-width: calc(100vw - 36px);
  }

  #gv-board {
    width: min(calc(100vw - 42px), 650px);
    height: min(calc(100vw - 42px), 650px);
    max-width: 650px;
    max-height: 650px;
  }

  .gv-eval-wrap {
    height: min(calc(100vw - 42px), 650px);
    max-height: 650px;
    width: 14px;
    margin-top: 24px;
  }

  /* Flatten side container on mobile so its child sections can be individually ordered */
  .gv-side {
    display: contents;
  }

  /* Move controls directly under the board on mobile */
  .gv-controls {
    order: 2;
    width: 100%;
    max-width: min(calc(100vw - 22px), 650px);
    display: flex;
    gap: 6px;
    margin: 4px 0 10px 0;
  }

  .gv-controls button {
    flex: 1;
    font-size: 18px;
    padding: 10px 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
  }

  .gv-controls button:hover,
  .gv-controls button:active {
    background: var(--surface2);
    border-color: var(--accent);
    color: #fff;
  }

  /* Engine panel below controls */
  .gv-engine-panel {
    order: 3;
    width: 100%;
    max-width: min(calc(100vw - 22px), 650px);
  }

  /* Moves list */
  .gv-moves-panel {
    order: 4;
    width: 100%;
    max-width: min(calc(100vw - 22px), 650px);
    max-height: 220px;
    overflow-y: auto;
  }

  /* Position explorer */
  .gv-position-panel {
    order: 5;
    width: 100%;
    max-width: min(calc(100vw - 22px), 650px);
  }

  /* FEN input */
  .gv-fen-box {
    order: 6;
    width: 100%;
    max-width: min(calc(100vw - 22px), 650px);
  }
}

/* ───────────────────────────────────────────────────────────── */
/* THEORY CHECK MODAL & REPORT                                   */
/* ───────────────────────────────────────────────────────────── */

.gv-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 7, 12, 0.78);
  backdrop-filter: blur(5px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: gvFadeIn 0.2s ease-out;
}

@keyframes gvFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.gv-modal-card {
  background: #151320;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  width: 92%;
  max-width: 580px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
  overflow: hidden;
}

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

.gv-modal-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gv-modal-badge {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
  letter-spacing: 0.5px;
}

.gv-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.gv-modal-close {
  background: none;
  border: none;
  color: var(--text2);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s;
}

.gv-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.gv-modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
}

.gv-modal-desc {
  font-size: 13px;
  color: var(--text2);
  margin: 0 0 14px 0;
}

.gv-theory-studies-scroll {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.gv-theory-studies-scroll::-webkit-scrollbar {
  width: 6px;
}
.gv-theory-studies-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.gv-theory-study-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.gv-theory-study-card:hover {
  background: rgba(168, 85, 247, 0.08);
  border-color: rgba(168, 85, 247, 0.4);
  transform: translateY(-1px);
}

.gv-theory-study-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.gv-theory-color-dot {
  font-size: 18px;
  line-height: 1;
}

.gv-theory-study-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.gv-theory-study-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gv-theory-study-meta {
  font-size: 12px;
  color: var(--text2);
  display: flex;
  gap: 8px;
  align-items: center;
}

.gv-theory-node-pill {
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  font-size: 11px;
  color: var(--text2);
  white-space: nowrap;
}

/* Report Styles */
.gv-theory-summary-card {
  padding: 14px 16px;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.gv-theory-summary-icon {
  font-size: 22px;
}

.gv-theory-summary-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gv-theory-summary-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.gv-theory-summary-sub {
  font-size: 12px;
  color: var(--text2);
}

.gv-theory-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text2);
  letter-spacing: 0.5px;
  margin: 16px 0 10px 0;
}

.gv-theory-dev-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gv-theory-dev-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.gv-theory-side-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.gv-theory-dev-desc {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.4;
}

.gv-theory-played-chip {
  display: inline-block;
  padding: 2px 7px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  border-radius: 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 12px;
}

.gv-theory-study-recommendations {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.gv-theory-alt-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.35);
  border-radius: 6px;
  color: #4ade80;
  font-size: 12px;
  font-weight: 600;
}

.gv-theory-alt-san {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
}

.gv-theory-alt-freq {
  font-size: 11px;
  opacity: 0.85;
}

.gv-theory-ok-card {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gv-theory-rejoin-notice {
  padding: 8px 12px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 6px;
  color: #93c5fd;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.gv-modal-footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* ───────────────────────────────────────────────────────────── */
/* LICHESS ACCURACY & PHASE PERFORMANCE MODAL                    */
/* ───────────────────────────────────────────────────────────── */

.gv-accuracy-card {
  max-width: 480px;
}

.gv-accuracy-progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}

.gv-accuracy-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  border-radius: 4px;
  transition: width 0.2s ease;
}

/* Accuracy Provenance Badges */
.gv-accuracy-source-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.gv-accuracy-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2px;
  transition: all 0.2s ease;
}

.gv-accuracy-source-badge .gv-badge-icon {
  font-size: 13px;
  line-height: 1;
}

.gv-accuracy-source-badge.fishnet {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}

.gv-accuracy-source-badge.local {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.15);
}

.gv-accuracy-source-badge.mixed {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}

.gv-recalc-btn {
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.08) !important;
  transition: all 0.2s ease !important;
  cursor: pointer;
}

.gv-recalc-btn:hover {
  background: rgba(56, 189, 248, 0.18) !important;
  border-color: #38bdf8 !important;
  color: #fff !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25) !important;
}

/* Exact Lichess .advice-summary recreation */
.advice-summary {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 13px;
  color: var(--text1, #e2e8f0);
}

.advice-summary__side {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 14px;
}

.advice-summary__player {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
}

.advice-summary__player .color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.advice-summary__player .color-dot.white {
  background: #fff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
}

.advice-summary__player .color-dot.black {
  background: #555;
  border: 1px solid #777;
}

.advice-summary__sections {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.advice-summary__acpl,
.advice-summary__accuracy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.advice-summary__acpl {
  color: var(--text2, #94a3b8);
}

.advice-summary__accuracy {
  align-items: flex-end;
  text-align: right;
}

.advice-summary__error {
  display: flex;
  align-items: center;
  gap: 6px;
}

.advice-summary__error.inaccuracy {
  color: #38bdf8; /* Lichess cyan */
}

.advice-summary__error.mistake {
  color: #fb923c; /* Lichess orange */
}

.advice-summary__error.blunder {
  color: #f87171; /* Lichess red */
}

.advice-summary__error.no-error {
  color: var(--text3, #64748b);
}

.advice-summary__acpl strong {
  display: inline-block;
  min-width: 14px;
  text-align: left;
}

.advice-summary__acpl-item {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text1, #e2e8f0);
  display: flex;
  align-items: center;
  gap: 6px;
}

.advice-summary__acpl-item strong {
  color: #fff;
}

.advice-summary__phase {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.advice-summary__total-acc {
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 4px;
  margin-bottom: 4px;
  width: 100%;
}

.advice-summary__total-acc strong {
  font-size: 15px;
  color: #38bdf8;
}

.advice-summary__phase.good {
  color: #4ade80; /* Lichess >= 85% */
}

.advice-summary__phase.inaccuracy {
  color: #38bdf8; /* Lichess >= 70% */
}

.advice-summary__phase.mistake {
  color: #fb923c; /* Lichess >= 55% */
}

.advice-summary__phase.blunder {
  color: #f87171; /* Lichess < 55% */
}



