/* Game Review UI - donnybadamo.com Brand */
:root {
  /* Core Colors - donnybadamo.com palette */
  --background: #324639;           /* Deep forest green */
  --foreground: #f0e6d6;           /* Warm cream/parchment */
  --primary: #d67a45;              /* Softer muted orange accent */
  --primary-hover: rgba(214, 122, 69, 0.9);
  --primary-foreground: #ffffff;
  
  /* Supporting Colors */
  --muted-foreground: #b8c4b8;     /* Sage green for secondary text */
  --secondary-neutral: #8a9589;    /* Neutral green-gray */
  --border: #425249;               /* Darker green for borders */
  --input: #425249;
  --accent: #425249;
  --accent-foreground: #f0e6d6;
  --ring: #d67a45;
  
  /* Derived colors */
  --bg-surface: #3a5242;
  --bg-hover: #425a4a;
  --bg-active: #4a6252;
  
  /* Status colors */
  --success: #81b64c;
  --warning: #e5a00d;
  --error: #ca3431;
  --brilliant: #1baca6;
}

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--background);
  /* Signature donnybadamo.com texture effect */
  background-image: 
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(255, 255, 255, 0.01) 2px,
      rgba(255, 255, 255, 0.01) 4px
    );
  color: var(--foreground);
  line-height: 1.6;
}

/* Site Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--foreground);
  transition: opacity 0.2s ease;
}

.site-brand:hover {
  opacity: 0.85;
}

.shamrock {
  font-size: 24px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.brand-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--foreground);
}

.page-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.header-spacer {
  width: 150px; /* Balance the header */
}

/* Page Wrapper - Full Page */
.page-wrapper {
  flex: 1;
  overflow: hidden;
}

/* Remove card-like styling - full page layout */
.review-container {
  display: flex;
  height: 100%;
  overflow: hidden;
}

/* Board and Panel Wrapper - Centers both together */
.board-panel-wrapper {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: visible;
  padding: 0;
}

/* Board Section */
.board-section {
  display: flex;
  flex-direction: column;
  padding: 4px 8px;
  background: var(--background);
  overflow: visible !important;
  justify-content: flex-start;
  align-items: center;
  flex-shrink: 0;
  box-sizing: border-box;
  /* Height includes player bars + board - calculate total height */
  height: calc(clamp(450px, min(calc(100vh - 200px), calc((100vw - 480px) * 0.70)), 900px) + 88px);
  margin-top: 20px;
  align-self: stretch;
}

.player-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  margin: 4px 0;
  width: 100%;
  /* Scale with board - use same width calculation */
  max-width: clamp(450px, min(calc(100vh - 200px), calc((100vw - 480px) * 0.85)), 900px);
}

.player-bar .player-name {
  font-weight: 600;
  font-size: 12px;
  color: var(--foreground);
}

.player-bar .player-rating {
  font-size: 11px;
  color: var(--primary);
  font-weight: 500;
  margin-left: auto;
}

.board-with-eval {
  display: flex;
  gap: 0px;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  min-height: 0;
}

.board-area {
  position: relative;
  /* Dynamic board sizing like Lichess - scales with available space, accounting for eval bar and panel */
  width: clamp(450px, min(calc(100vh - 200px), calc((100vw - 480px) * 0.70)), 900px);
  aspect-ratio: 1;
  flex-shrink: 0;
  flex-grow: 0;
  transition: width 0.3s ease;
  margin: 0;
}

.eval-bar {
  /* Scale with board - roughly 3% of board width calculation */
  width: clamp(24px, calc((min(calc(100vh - 200px), calc((100vw - 480px) * 0.70)) * 0.035)), 40px);
  /* Height matches board section total height (board + player bars) */
  height: calc(clamp(450px, min(calc(100vh - 200px), calc((100vw - 480px) * 0.70)), 900px) + 88px);
  background: linear-gradient(to bottom, #2a2a2a 0%, #2a2a2a 50%, #e8e4dc 50%, #e8e4dc 100%);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  flex-shrink: 0;
  margin-top: 20px;
  align-self: stretch;
}

.eval-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: #e8e4dc;
  transition: height 0.3s ease;
}

.eval-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
  font-size: clamp(9px, 0.8vw, 12px);
  font-weight: 700;
  color: var(--secondary-neutral);
  white-space: nowrap;
  z-index: 5;
  text-shadow: 0 0 3px rgba(255,255,255,0.5);
}

.sf-badge {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 7px;
  font-weight: 700;
  color: var(--primary);
  background: var(--accent-orange);
  padding: 1px 3px;
  border-radius: 2px;
  z-index: 5;
  letter-spacing: 0.5px;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.sf-badge:hover {
  opacity: 1;
}

.sf-badge.active {
  animation: sf-pulse 1.5s ease-in-out infinite;
}

@keyframes sf-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}


#board {
  width: 100% !important;
  height: 100% !important;
  border-radius: 4px;
  overflow: hidden;
  border: 2px solid var(--border);
  transition: width 0.3s ease, height 0.3s ease;
}

.move-arrows {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* Played move arrow (orange) - clean, visible arrow */
.move-arrows .arrow-line {
  stroke: #d67a45;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.9;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.move-arrows .arrow-head {
  fill: #d67a45;
  stroke: #b8653a;
  stroke-width: 1.5;
  opacity: 0.95;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.move-arrows .arrow-line.arrow-played {
  stroke: #d67a45;
  stroke-width: 8;
  opacity: 0.9;
}

.move-arrows .arrow-head.arrow-played {
  fill: #d67a45;
  stroke: #b8653a;
  stroke-width: 1.5;
  opacity: 0.95;
}

/* Best move arrow (green) - what should have been played */
.move-arrows .arrow-line.arrow-best {
  stroke: #52c41a;
  stroke-width: 9;
  stroke-dasharray: 8 6;
  opacity: 0.9;
  filter: drop-shadow(0 1px 3px rgba(82, 196, 26, 0.4));
}

.move-arrows .arrow-head.arrow-best {
  fill: #52c41a;
  stroke: #389e0d;
  stroke-width: 1.5;
  opacity: 0.95;
  filter: drop-shadow(0 1px 3px rgba(82, 196, 26, 0.4));
}

/* Critical best move arrow (for blunders/mistakes - more prominent) */
.move-arrows .arrow-line.arrow-best-critical {
  stroke: #52c41a;
  stroke-width: 11;
  stroke-dasharray: 10 5;
  opacity: 0.95;
  filter: drop-shadow(0 2px 4px rgba(82, 196, 26, 0.5));
}

.move-arrows .arrow-head.arrow-best-critical {
  fill: #52c41a;
  stroke: #389e0d;
  stroke-width: 2;
  opacity: 1;
  filter: drop-shadow(0 2px 4px rgba(82, 196, 26, 0.5));
}

.highlight-from {
  /* Cleaner highlight - use border instead of box-shadow */
  border: 3px solid rgba(214, 122, 69, 0.6) !important;
  box-sizing: border-box !important;
}

.highlight-to {
  /* Cleaner highlight with border and subtle background */
  border: 3px solid rgba(214, 122, 69, 0.9) !important;
  background: rgba(214, 122, 69, 0.2) !important;
  box-sizing: border-box !important;
}

.nav-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 8px 8px;
  width: 100%;
  flex-shrink: 0;
  overflow: visible !important;
  box-sizing: border-box;
  flex-wrap: nowrap;
  /* Prominent top border to show separation from scrollable content */
  border-top: 2px solid var(--border);
  background: var(--bg-surface);
  position: sticky;
  bottom: 0;
  z-index: 10;
  /* Shadow effect above button bar to indicate scrollable content above */
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.2), 
              0 -2px 6px rgba(0, 0, 0, 0.15);
  /* Slight inset shadow for depth */
  background-image: linear-gradient(to bottom, 
    rgba(66, 82, 73, 0.3) 0%,
    var(--bg-surface) 15px
  );
}

.nav-separator {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 6px;
  opacity: 0.5;
  flex-shrink: 0;
}


.nav-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--border) !important;
  border-radius: 4px;
  background: var(--bg-surface);
  font-size: 14px;
  color: var(--foreground);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex !important;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  box-sizing: border-box;
  overflow: visible;
}

.nav-btn svg {
  width: 18px;
  height: 18px;
  color: var(--foreground);
}

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

.nav-btn.play-btn {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
  min-width: 40px;
}

.nav-btn.play-btn:hover {
  background: var(--primary-hover);
}

.nav-btn.active {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

/* Voice Dropdown */
.voice-dropdown {
  position: relative;
  display: inline-block;
  z-index: 10000; /* Higher than board and other elements */
}

.voice-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border) !important;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  height: 36px;
  min-width: 36px;
  box-sizing: border-box;
  overflow: visible;
  color: var(--foreground);
  transition: all 0.2s ease;
}

.voice-btn:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
}

.voice-btn .voice-icon {
  position: relative;
  display: inline-block;
  transition: opacity 0.2s;
  opacity: 1;
  color: var(--foreground);
}

.voice-btn .voice-icon svg {
  width: 18px;
  height: 18px;
}

.voice-dropdown-menu {
  position: fixed !important; /* Use fixed to escape all parent containers */
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
  min-width: 180px;
  padding: 6px;
  z-index: 10001 !important; /* Higher than everything except password modal (10002+) */
  display: none;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 6px;
  pointer-events: auto;
  /* Ensure it's not clipped */
  overflow: visible;
  /* Position will be set dynamically via JavaScript */
}

.voice-dropdown.open .voice-dropdown-menu {
  display: flex;
}

.voice-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--foreground);
  font-size: 13px;
  position: relative;
}

.voice-option:hover {
  background: var(--bg-hover);
}

.voice-option.active {
  background: var(--bg-active);
}

.voice-option-icon {
  font-size: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--foreground);
}

.voice-option-icon svg {
  width: 16px;
  height: 16px;
}

.voice-option-name {
  flex: 1;
  font-weight: 500;
}

.voice-option-check,
.voice-option-lock {
  font-size: 12px;
  opacity: 0.7;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
}

.voice-option-lock svg {
  width: 12px;
  height: 12px;
}

.voice-option.active .voice-option-check {
  opacity: 1;
  color: var(--primary);
}

.voice-option.locked {
  opacity: 0.7;
  cursor: not-allowed;
}

.voice-option.unlocked .voice-option-lock {
  display: none;
}

.voice-option.unlocked {
  opacity: 1;
  cursor: pointer;
}

/* Arrow pointing up from button to dropdown */
.voice-dropdown-menu::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--bg-surface);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Analysis Panel - Right Side - Floating */
.analysis-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  overflow: hidden; /* Keep hidden for scrolling, but nav-controls can overflow */
  /* Height matches board section total height (board + player bars) */
  height: calc(clamp(450px, min(calc(100vh - 200px), calc((100vw - 480px) * 0.70)), 900px) + 88px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  position: relative;
  margin-top: 20px;
  width: 420px;
  flex-shrink: 0;
  align-self: stretch;
  min-height: 0;
}

/* Allow nav-controls and its children to overflow the panel */
.analysis-panel > .nav-controls {
  overflow: visible !important;
  position: relative;
  z-index: 10000;
}

/* Analysis Header - Title and Upload Button */
.analysis-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--background);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.analysis-header .analysis-move {
  margin-bottom: 0;
  flex: 1;
}

.pgn-upload-btn {
  width: 32px;
  height: 32px;
  padding: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--foreground);
  transition: all 0.2s ease;
  box-sizing: border-box;
  flex-shrink: 0;
  margin-left: 12px;
}

.pgn-upload-btn:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  color: var(--primary);
}

.pgn-upload-btn svg {
  width: 18px;
  height: 18px;
}

.analysis-panel-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden; /* Keep hidden for scrolling */
  min-height: 0;
}

/* Welcome Section (shown when no game loaded) */
.welcome-section {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--background);
}

.welcome-section .analysis-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* Game Info Table - Formatted game summary display */
.game-info-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
}

.game-info-table tr {
  border-bottom: 1px solid var(--border);
}

.game-info-table tr:last-child {
  border-bottom: none;
}

.game-info-table td {
  padding: 10px 0;
  vertical-align: top;
}

.game-info-table td.game-info-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: 100px;
  padding-right: 12px;
}

.game-info-table td.game-info-value {
  font-size: 13px;
  color: var(--foreground);
  font-weight: 500;
}

.game-info-table td.game-info-value .elo {
  font-size: 11px;
  color: var(--muted-foreground);
  font-weight: 400;
  margin-left: 4px;
}

.game-summary-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--foreground);
  padding: 8px 0;
}

/* Current Move Analysis */
.move-analysis {
  padding: 16px 20px;
  background: var(--background);
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
  flex-shrink: 0; /* Fixed - no scrolling */
  position: relative;
  overflow: visible; /* Allow button to extend if needed */
}

.analysis-move-inline {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.analysis-text-inline {
  font-size: 12px;
  color: var(--muted-foreground);
  line-height: 1.5;
  margin: 8px 0;
  width: 100%;
  box-sizing: border-box;
}

.analysis-content {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.analysis-icon {
  font-size: 28px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
}

.analysis-icon svg {
  width: 24px;
  height: 24px;
}

.analysis-details {
  flex: 1;
  min-width: 0; /* Allow flex item to shrink below content size */
}

.analysis-details p {
  margin: 0;
}

.analysis-details button {
  width: 100% !important;
  max-width: 100%;
  box-sizing: border-box;
}

.analysis-move {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.analysis-text {
  font-size: 12px;
  color: var(--muted-foreground);
  line-height: 1.5;
  margin: 8px 0;
  width: 100%;
  box-sizing: border-box;
}

.analysis-text > div {
  width: 100%;
  box-sizing: border-box;
}

.analysis-text p {
  width: 100%;
  box-sizing: border-box;
}

.analysis-eval {
  font-size: 14px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 0.375rem;
  background: var(--accent);
  color: var(--foreground);
}

.analysis-eval.winning {
  background: rgba(129, 182, 76, 0.2);
  color: var(--success);
}

.analysis-eval.losing {
  background: rgba(202, 52, 49, 0.2);
  color: var(--error);
}

.best-move-hint {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--accent);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
}

.hint-label {
  font-size: 12px;
  color: var(--muted-foreground);
}

.hint-move {
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

/* Back to Game Button (exploration mode) */
.back-to-game-btn {
  width: 100%;
  padding: 10px 16px;
  background: var(--brilliant);
  color: var(--primary-foreground);
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.back-to-game-btn:hover {
  background: #17a099;
  transform: translateY(-1px);
}

/* Demo Section (shown when no game loaded) */
.demo-section {
  padding: 16px 20px;
  text-align: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: visible;
  position: relative;
  border-top: 1px solid var(--border);
  background: var(--background);
  margin-top: 0;
}

.demo-section.hidden,
.demo-section[style*="display: none"] {
  display: none !important;
  visibility: hidden !important;
}

.demo-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.demo-text {
  font-size: 13px;
  color: var(--muted-foreground);
  line-height: 1.5;
  margin-bottom: 12px;
}

.btn-demo {
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--primary) 0%, #c0684a 100%);
  color: var(--primary-foreground);
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(214, 122, 69, 0.3);
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  visibility: visible !important;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.btn-demo::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn-demo:hover {
  background: linear-gradient(135deg, #c0684a 0%, var(--primary) 100%);
  box-shadow: 0 4px 12px rgba(214, 122, 69, 0.4);
  transform: translateY(-1px);
}

.btn-demo:hover::before {
  left: 100%;
}

.btn-demo:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(214, 122, 69, 0.3);
}

.btn-demo svg {
  width: 20px;
  height: 20px;
}

/* Key Moments */
.key-moments-section {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  margin-bottom: 4px;
  flex-shrink: 0;
  min-height: 0;
  /* Fixed height for the section, with scrollable content inside */
  height: 180px; /* Extended height: header + more rows of chips */
}

.key-moments-section h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-foreground);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0; /* Fixed header */
}

.key-moments-scroll {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: min-content;
  gap: 8px;
  padding-bottom: 6px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

.key-moments-scroll::-webkit-scrollbar {
  width: 6px;
  height: 0;
}

.key-moments-scroll::-webkit-scrollbar-track {
  background: var(--background);
  border-radius: 3px;
}

.key-moments-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.moments-placeholder {
  color: var(--muted-foreground);
  font-size: 13px;
  padding: 10px 0;
}

.moment-chip {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--background);
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid var(--border);
}

.moment-chip:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
}

.moment-chip.blunder {
  border-color: var(--error);
}

.moment-chip.mistake {
  border-color: var(--warning);
}

.moment-chip.brilliant {
  border-color: var(--brilliant);
}

.moment-chip.turning-point {
  border-color: var(--primary);
}

.moment-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.moment-chip .moment-icon {
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
  min-width: 20px;
  text-align: center;
}

.moment-chip .chip-icon {
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Blunder icons - red/X */
.moment-chip.blunder .chip-icon,
.moment-chip.missedMate .chip-icon {
  font-size: 18px;
  font-weight: 900;
  color: var(--error);
}

/* Mistake icons - orange/X */
.moment-chip.mistake .chip-icon {
  font-size: 16px;
  font-weight: 700;
  color: var(--warning);
}

/* Inaccuracy icons - yellow/question */
.moment-chip.inaccuracy .chip-icon {
  font-size: 16px;
  font-weight: 700;
  color: var(--warning);
  opacity: 0.85;
}

/* Brilliant icons - gold/star */
.moment-chip.brilliant .chip-icon {
  font-size: 16px;
  font-weight: 700;
  color: var(--brilliant);
}

/* Best move icons - green/checkmark */
.moment-chip.best .chip-icon {
  font-size: 16px;
  font-weight: 700;
  color: var(--success);
}

.moment-chip.great .chip-icon {
  font-size: 16px;
  font-weight: 700;
  color: var(--success);
}

.moment-chip.good .chip-icon {
  font-size: 15px;
  font-weight: 600;
  color: var(--success);
  opacity: 0.85;
}

.moment-chip.book .chip-icon {
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
  opacity: 0.7;
}

.moment-chip.opening .chip-icon {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.moment-chip.victory .chip-icon {
  font-size: 18px;
  font-weight: 700;
  color: var(--brilliant);
}

/* Turning point icons - blue/circular arrow */
.moment-chip.turning-point .chip-icon {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.moment-chip .chip-move {
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--foreground);
}

/* Moves Section */
.moves-section {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0 16px 12px 16px;
  min-height: 0; /* Allow flex shrinking */
}

.moves-section h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-foreground);
  margin-bottom: 8px;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0; /* Keep header fixed */
  padding-top: 8px;
}

.moves-grid {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  grid-template-columns: 32px 1fr 1fr;
  gap: 2px;
  align-content: start;
  min-height: 0; /* Allow scrolling */
}

.moves-grid::-webkit-scrollbar {
  width: 6px;
}

.moves-grid::-webkit-scrollbar-track {
  background: var(--background);
}

.moves-grid::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.move-num {
  font-size: 11px;
  color: var(--muted-foreground);
  padding: 6px 4px;
  text-align: right;
}

.move-cell {
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--foreground);
}

.move-cell:hover:not(.active) {
  background: var(--bg-hover);
  border: 1px solid var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(214, 122, 69, 0.3);
}

.move-cell.active {
  background: var(--primary);
  color: var(--primary-foreground);
  border: 1px solid var(--primary);
  box-shadow: 0 2px 8px rgba(214, 122, 69, 0.3);
}

.move-cell.active .white-dot,
.move-cell.active .black-dot {
  border-color: var(--primary-foreground);
}

.move-cell .move-san {
  flex: 1;
}

.move-cell .move-icon {
  font-size: 11px;
  font-weight: 700;
  margin-left: auto;
}

/* Piece dots to show whose move */
.piece-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
}

.white-dot {
  background: #f0e6d6;
  border-color: #8a9589;
}

.black-dot {
  background: #2a2a2a;
  border-color: #555;
}

/* White/Black move styling */
.move-cell.white-move {
  background: rgba(240, 230, 214, 0.05);
}

.move-cell.black-move {
  background: rgba(42, 42, 42, 0.15);
}

.move-cell.blunder .move-icon { color: var(--error); }
.move-cell.mistake .move-icon { color: var(--warning); }
.move-cell.inaccuracy .move-icon { color: #f39c12; }
.move-cell.best .move-icon { color: var(--success); }
.move-cell.brilliant .move-icon { color: var(--brilliant); }

.move-cell.blunder .move-icon::before { content: '??'; }
.move-cell.mistake .move-icon::before { content: '?'; }
.move-cell.inaccuracy .move-icon::before { content: '?!'; }
.move-cell.best .move-icon::before { content: '!'; }
.move-cell.brilliant .move-icon::before { content: '!!'; }

/* Best move suggestion display */
.move-suggestion {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  padding: 2px 6px;
  background: rgba(82, 196, 26, 0.15);
  border: 1px solid rgba(82, 196, 26, 0.3);
  border-radius: 3px;
  font-size: 11px;
  color: var(--success);
  opacity: 0.8;
  transition: all 0.2s ease;
}

.move-cell:hover .move-suggestion {
  opacity: 1;
  background: rgba(82, 196, 26, 0.2);
  border-color: rgba(82, 196, 26, 0.5);
}

.suggestion-label {
  font-weight: 600;
  color: var(--success);
}

.suggestion-move {
  font-family: "SF Mono", "Fira Code", monospace;
  font-weight: 600;
  color: var(--success);
}

/* Eval Graph */
.eval-graph-section {
  flex-shrink: 0; /* Fixed - no scrolling */
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  margin-top: 12px;
}

#evalGraph {
    width: 100%;
  height: 50px;
  background: var(--background);
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* Game Meta - Hidden */
.game-meta {
  display: none;
}

/* PGN Modal */
/* Password Modal */
.password-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10002; /* Higher than voice dropdown */
}

.password-modal .modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.password-modal-content {
  position: relative;
  background: var(--bg-surface);
  padding: 0;
  border-radius: 8px;
  width: 90%;
  max-width: 420px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: passwordModalSlideIn 0.3s ease-out;
  overflow: hidden;
  z-index: 10003; /* Higher than backdrop */
  transition: transform 0.3s ease;
}

.password-modal-content.shake {
  animation: passwordModalShake 0.5s ease-in-out;
}

@keyframes passwordModalShake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
  20%, 40%, 60%, 80% { transform: translateX(10px); }
}

@keyframes passwordModalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.password-modal-header {
  padding: 28px 28px 20px 28px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(214, 122, 69, 0.1) 0%, transparent 100%);
}

.password-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #c0684a 100%);
  color: var(--primary-foreground);
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(214, 122, 69, 0.3);
  animation: passwordIconPulse 2s ease-in-out infinite;
}

@keyframes passwordIconPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(214, 122, 69, 0.3);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(214, 122, 69, 0.5);
  }
}

.password-icon svg {
  width: 32px;
  height: 32px;
}

.password-modal-header h2 {
  color: var(--foreground);
  margin: 0 0 8px 0;
  font-size: 22px;
  font-weight: 700;
}

.password-subtitle {
  color: var(--muted-foreground);
  font-size: 14px;
  margin: 0;
  line-height: 1.5;
}

.password-modal-body {
  padding: 24px 28px;
}

.password-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--background);
  border: 2px solid var(--border);
  border-radius: 6px;
  color: var(--foreground);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 2px;
  text-align: center;
  transition: all 0.3s ease;
  box-sizing: border-box;
  caret-color: var(--primary);
}

.password-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(214, 122, 69, 0.2);
  transform: scale(1.02);
}

.password-input::placeholder {
  color: transparent;
}

.password-hint {
  margin-top: 12px;
  font-size: 13px;
  text-align: center;
  min-height: 20px;
  color: var(--error);
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.password-hint.show {
  opacity: 1;
}

.password-modal-footer {
  padding: 20px 28px 28px 28px;
  display: flex;
  gap: 12px;
  border-top: 1px solid var(--border);
}

.btn-password-cancel {
  flex: 1;
  padding: 12px 20px;
  background: var(--accent);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-password-cancel:hover {
  background: var(--bg-hover);
  border-color: var(--border);
}

.btn-password-submit {
  flex: 1;
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--primary) 0%, #c0684a 100%);
  color: var(--primary-foreground);
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(214, 122, 69, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-password-submit:hover {
  background: linear-gradient(135deg, #c0684a 0%, var(--primary) 100%);
  box-shadow: 0 4px 12px rgba(214, 122, 69, 0.4);
  transform: translateY(-1px);
}

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

.btn-password-submit svg {
  width: 18px;
  height: 18px;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  z-index: 10003;
  animation: toastSlideIn 0.3s ease-out;
  max-width: 400px;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast.success {
  border-left: 4px solid var(--success);
}

.toast.error {
  border-left: 4px solid var(--error);
}

.toast-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-icon svg {
  width: 24px;
  height: 24px;
}

.toast.success .toast-icon {
  color: var(--success);
}

.toast.error .toast-icon {
  color: var(--error);
}

.toast-message {
  color: var(--foreground);
  font-size: 14px;
  font-weight: 500;
  flex: 1;
}

.pgn-modal {
  position: fixed;
  top: 0;
  left: 0;
    width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: none; /* Hidden by default */
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: var(--bg-surface);
  padding: 24px;
  border-radius: 0.5rem;
  width: 90%;
  border: 1px solid var(--border);
  position: relative;
}

.modal-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.modal-close-btn:hover {
  background: var(--bg-hover);
  color: var(--foreground);
}

.modal-content h2 {
  color: var(--foreground);
  margin-bottom: 8px;
  font-size: 18px;
}

.modal-hint {
  color: var(--foreground);
  opacity: 0.7;
  font-size: 14px;
  margin-bottom: 16px;
}
  
  #pgnInput {
    width: 100%;
  height: 200px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  padding: 14px;
  color: var(--foreground);
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 12px;
  resize: none;
}

#pgnInput:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 2px rgba(214, 122, 69, 0.2);
}

#pgnInput::placeholder {
  color: var(--muted-foreground);
}

.pgn-error-message {
  display: none;
  color: #ff4444;
  font-size: 13px;
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(255, 68, 68, 0.1);
  border: 1px solid rgba(255, 68, 68, 0.3);
  border-radius: 4px;
  animation: shake 0.3s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

#pgnInput.error {
  border-color: #ff4444 !important;
  box-shadow: 0 0 0 2px rgba(255, 68, 68, 0.2);
}

.modal-buttons {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.btn-analyze {
  width: 100%;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--primary) 0%, #c0684a 100%);
  color: var(--primary-foreground);
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(214, 122, 69, 0.3);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  justify-content: center;
  gap: 8px;
}

.btn-analyze > span:first-child {
  font-size: 22px;
  line-height: 1;
}

.btn-analyze > span:last-child {
  font-size: 13px;
}

.btn-analyze::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn-analyze:hover {
  background: linear-gradient(135deg, #c0684a 0%, var(--primary) 100%);
  box-shadow: 0 4px 12px rgba(214, 122, 69, 0.4);
  transform: translateY(-1px);
}

.btn-analyze:hover::before {
  left: 100%;
}

.btn-analyze:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(214, 122, 69, 0.3);
}

.btn-cancel {
  padding: 12px 20px;
  background: var(--accent);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-cancel:hover {
  background: var(--bg-hover);
}

/* Ultrawide support - larger boards for wide screens */
@media (min-width: 1920px) {
  .board-area {
    /* On ultrawide, allow larger boards, scale with viewport height */
    width: clamp(600px, min(calc(100vh - 250px), calc((100vw - 450px) * 0.9)), 1000px);
  }
}

/* Extra wide ultrawide (3440px+) */
@media (min-width: 2560px) {
  .board-area {
    width: clamp(700px, min(calc(100vh - 300px), calc((100vw - 500px) * 0.9)), 1200px);
  }
}

/* Responsive */
@media (max-width: 1100px) {
  .board-area {
    width: clamp(400px, min(calc(100vh - 250px), calc((100vw - 350px) * 0.8)), 600px);
  }
}

@media (max-width: 991px) {
  .board-section {
    padding: 12px;
  }
  
  .board-area {
    width: min(calc(100vw - 80px), calc(100vh - 200px), 420px);
    margin: 0 auto;
  }
  
  .analysis-panel {
    width: 280px;
    right: 2px;
  }
  
  .key-moments-scroll {
    grid-template-columns: 1fr;
  }
  
  .site-header {
    padding: 10px 16px;
  }
  
  .page-title {
    font-size: 14px;
    letter-spacing: 1px;
  }
  
  .brand-name {
    font-size: 14px;
  }
}

@media (max-width: 600px) {
  .board-area {
    width: calc(100vw - 60px);
    max-width: 360px;
  }
  
  .board-with-eval {
    gap: 6px;
  }
  
  .eval-bar {
    width: 22px;
  }
  
  .player-bar {
    padding: 8px 12px;
  }
  
  .player-bar .player-name {
    font-size: 13px;
  }
  
  .nav-controls {
    gap: 6px;
    flex-wrap: wrap;
  }
  
  .nav-btn {
    min-width: 36px;
    height: 34px;
    font-size: 12px;
    padding: 0 6px;
    border: 2px solid var(--border) !important;
  }
  
  .nav-btn.play-btn {
    min-width: 50px;
  }
  
  .analysis-panel {
    width: calc(100vw - 8px);
    right: 4px;
    left: 4px;
    max-width: none;
  }
  
  .move-analysis {
    padding: 12px 14px;
  }
  
  .key-moments-section,
  .moves-section {
    padding: 10px 14px;
  }
  
  .site-header {
    padding: 8px 12px;
  }
  
  .shamrock {
    font-size: 20px;
  }
  
  .brand-name {
    font-size: 12px;
  }
  
  .page-title {
    font-size: 12px;
  }
  
  .header-spacer {
    width: 100px;
  }
}

/* Demo Loading Overlay */
.demo-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease-in-out;
}

.demo-loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  color: var(--foreground);
}

.demo-loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.demo-loading-text {
  font-size: 16px;
  font-weight: 500;
  color: var(--foreground);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

/* Sexy Loading Progress Bar */
.analysis-loading-container {
  padding: 24px;
  background: var(--bg-surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  margin: 16px 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.analysis-loading-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.analysis-loading-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
}

.analysis-loading-icon {
  font-size: 20px;
  animation: spin 2s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.analysis-loading-percent {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

/* Bootstrap Progress Bar - Custom Styled */
.analysis-progress-wrapper {
  position: relative;
  height: 32px;
  background: var(--background);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.analysis-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, 
    var(--primary) 0%, 
    rgba(214, 122, 69, 0.9) 50%,
    var(--primary) 100%);
  background-size: 200% 100%;
  animation: progress-shine 2s ease-in-out infinite;
  border-radius: 16px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 0 10px rgba(214, 122, 69, 0.5),
    0 0 20px rgba(214, 122, 69, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

@keyframes progress-shine {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.analysis-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3) 50%,
    transparent
  );
  animation: progress-glow 1.5s ease-in-out infinite;
}

@keyframes progress-glow {
  0%, 100% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
}

.analysis-loading-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted-foreground);
}

.analysis-loading-moves {
  font-weight: 500;
  color: var(--foreground);
}

.analysis-loading-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.analysis-loading-dot {
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  animation: loading-dot 1.4s ease-in-out infinite;
  opacity: 0.8;
}

.analysis-loading-dot:nth-child(1) { animation-delay: 0s; }
.analysis-loading-dot:nth-child(2) { animation-delay: 0.2s; }
.analysis-loading-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes loading-dot {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

/* Bootstrap Grid Overrides for our theme */
.container-fluid {
  padding-left: 0;
  padding-right: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.row {
  margin-left: 0;
  margin-right: 0;
  margin-top: 0;
  margin-bottom: 0;
}

[class*="col-"] {
  padding-left: 0;
  padding-right: 0;
}

/* Ensure buttons are visible and not cut off */
.nav-btn,
.voice-btn {
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 10;
  display: flex !important;
  position: relative;
  box-shadow: none !important;
  outline: none !important;
}

.voice-dropdown {
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 10000 !important; /* Keep high z-index to appear above everything */
  display: inline-block !important;
  position: relative;
  box-shadow: none !important;
  outline: none !important;
}

.nav-btn *,
.voice-btn *,
.voice-dropdown * {
  visibility: visible !important;
  opacity: 1 !important;
}

/* Prevent any parent from clipping buttons */
main,
.container-fluid,
.row,
[class*="col-"],
.board-section,
.nav-controls {
  overflow: visible !important;
}

/* Override Bootstrap button styles to match our theme */
.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
}

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


























