/* ============================================
   COMPUTER PLAY, ANALYSIS & GAME REPORT STYLES
   ============================================ */

/* ========================
   1. MODE TABS IN LOBBY
   ======================== */
.lobby-mode-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
}

.mode-tab-btn {
  flex: 1;
  padding: 10px 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.mode-tab-btn.active {
  background: linear-gradient(135deg, var(--accent-primary), #e8960a);
  color: #111;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.mode-tab-btn:not(.active):hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

/* Mode tab content sections */
.lobby-mode-content {
  display: none;
}

.lobby-mode-content.active {
  display: block;
  animation: fadeSlideIn 0.3s ease;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================
   2. COMPUTER SETTINGS
   ======================== */
.computer-settings {
  text-align: left;
  margin-bottom: 16px;
}

.setting-group {
  margin-bottom: 16px;
}

.setting-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Difficulty Slider */
.difficulty-slider-container {
  position: relative;
  padding: 0 2px;
}

.difficulty-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg,
      #22c55e 0%, #22c55e 15%,
      #86efac 15%, #86efac 30%,
      #fbbf24 30%, #fbbf24 50%,
      #f97316 50%, #f97316 70%,
      #ef4444 70%, #ef4444 85%,
      #dc2626 85%, #dc2626 100%);
  outline: none;
  cursor: pointer;
}

.difficulty-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: 3px solid #111;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.15s;
}

.difficulty-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.difficulty-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: 3px solid #111;
  cursor: pointer;
}

.difficulty-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.difficulty-name {
  font-weight: 700;
  color: var(--accent-primary);
  font-size: 15px;
}

.difficulty-elo {
  font-family: 'Roboto Mono', monospace;
  color: var(--text-muted);
  font-size: 13px;
}

/* Color Picker */
.color-picker {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.color-option {
  flex: 1;
  padding: 12px 8px;
  border: 2px solid var(--border-color);
  background: var(--bg-body);
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  font-size: 14px;
  color: var(--text-primary);
}

.color-option.active {
  border-color: var(--accent-primary);
  background: rgba(245, 158, 11, 0.1);
}

.color-option:hover:not(.active) {
  border-color: rgba(245, 158, 11, 0.5);
}

.color-option .color-icon {
  font-size: 28px;
  display: block;
  margin-bottom: 4px;
}

.color-option .color-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ========================
   3. EVAL BAR
   ======================== */
.eval-bar {
  position: absolute;
  left: -32px;
  top: 0;
  width: 26px;
  height: 100%;
  background: #333;
  border-radius: 4px;
  overflow: hidden;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.eval-bar-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(to top, #f0f0f0, #e8e8e8);
  transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.eval-bar-score {
  position: absolute;
  top: 4px;
  left: 0;
  width: 100%;
  text-align: center;
  font-family: 'Roboto Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  z-index: 2;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  transition: top 0.3s ease, bottom 0.3s ease, color 0.3s ease;
}

/* ========================
   4. THINKING INDICATOR
   ======================== */
.computer-thinking {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(17, 24, 39, 0.9);
  border: 1px solid var(--border-color);
  padding: 6px 16px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  backdrop-filter: blur(10px);
}

.computer-thinking.active {
  opacity: 1;
}

.thinking-dots {
  display: flex;
  gap: 3px;
}

.thinking-dots span {
  width: 6px;
  height: 6px;
  background: var(--accent-primary);
  border-radius: 50%;
  animation: thinkingPulse 1.2s ease-in-out infinite;
}

.thinking-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.thinking-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes thinkingPulse {

  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }

  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

.thinking-text {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ========================
   5. GAME REPORT MODAL
   ======================== */
.report-modal-overlay {
  z-index: 5000;
}

.report-modal {
  max-width: 600px;
  width: 92%;
  max-height: 85vh;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 0;
  position: relative;
}

.report-close-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-muted);
  cursor: pointer;
  z-index: 10;
  line-height: 1;
  transition: color 0.2s;
}

.report-close-btn:hover {
  color: var(--text-primary);
}

.report-content {
  padding: 24px;
}

.report-header h2 {
  text-align: center;
  font-size: 22px;
  color: var(--text-primary);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

/* Loading State */
.report-loading {
  text-align: center;
  padding: 40px 20px;
}

.report-loading h3 {
  color: var(--text-primary);
  margin-bottom: 20px;
}

.report-loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(245, 158, 11, 0.2);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spinReport 0.8s linear infinite;
}

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

.report-progress-bar {
  width: 80%;
  max-width: 300px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  margin: 0 auto 10px;
  overflow: hidden;
}

.report-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), #e8960a);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s;
}

.report-progress-text {
  font-size: 13px;
  color: var(--text-muted);
}

/* Accuracy Section */
.report-accuracy-section {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 28px;
}

.accuracy-card {
  text-align: center;
}

.accuracy-ring {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 8px;
}

.accuracy-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.accuracy-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 8;
}

.accuracy-fill {
  fill: none;
  stroke: #22c55e;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}

.accuracy-fill.black-fill {
  stroke: #a78bfa;
}

.accuracy-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Roboto Mono', monospace;
}

.accuracy-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Classification Section */
.report-classifications {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

.classification-column h4 {
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.classification-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 12px;
}

.classification-icon {
  width: 20px;
  text-align: center;
  font-weight: 700;
  font-size: 11px;
}

.classification-label {
  width: 70px;
  color: var(--text-muted);
  font-weight: 500;
}

.classification-bar-track {
  flex: 1;
  height: 5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.classification-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.classification-count {
  width: 20px;
  text-align: right;
  font-family: 'Roboto Mono', monospace;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 12px;
}

/* Eval Chart */
.report-chart-section {
  margin-bottom: 28px;
}

.report-chart-section h3 {
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.eval-chart {
  width: 100%;
  height: 140px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: #1a1a2e;
}

/* Report Move List */
.report-moves-section h3 {
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.report-move-list {
  max-height: 250px;
  overflow-y: auto;
}

.report-move-row {
  display: flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 4px;
}

.report-move-row:nth-child(odd) {
  background: rgba(255, 255, 255, 0.02);
}

.report-move-num {
  width: 32px;
  color: var(--text-muted);
  font-size: 12px;
  font-family: 'Roboto Mono', monospace;
}

.report-move {
  flex: 1;
  padding: 4px 8px;
  font-family: 'Roboto Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
}

.report-move:hover {
  background: rgba(255, 255, 255, 0.08);
}

.report-move.empty {
  pointer-events: none;
}

.report-move.blunder {
  color: #ef4444;
}

.report-move.mistake {
  color: #f97316;
}

.report-move.inaccuracy {
  color: #fbbf24;
}

.report-move.good {
  color: #86efac;
}

.report-move.excellent {
  color: #4ade80;
}

.report-move.best {
  color: #22c55e;
}

.move-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  border-radius: 9px;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  padding: 0 4px;
}

/* ========================
   6. ANALYSIS MODE EXTRAS
   ======================== */
.analysis-controls {
  display: flex;
  gap: 6px;
  padding: 8px;
  background: var(--bg-sidebar-alt);
  border-top: 1px solid var(--border-color);
}

.analysis-btn {
  flex: 1;
  padding: 8px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s;
}

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

/* ========================
   7. RESPONSIVE
   ======================== */
@media (max-width: 950px) {
  .eval-bar {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    height: 16px;
    margin-bottom: 6px;
    border-radius: 3px;
  }

  .eval-bar-fill {
    height: 100%;
    width: 50%;
    bottom: auto;
    transition: width 0.5s;
  }

  .eval-bar-score {
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
  }

  .report-accuracy-section {
    gap: 16px;
  }

  .accuracy-ring {
    width: 80px;
    height: 80px;
  }

  .report-classifications {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .color-picker {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .lobby-mode-tabs {
    font-size: 12px;
  }

  .mode-tab-btn {
    padding: 8px 6px;
    font-size: 12px;
  }
}

/* Scrollbar for report */
.report-modal::-webkit-scrollbar {
  width: 6px;
}

.report-modal::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.3);
  border-radius: 3px;
}

.report-modal::-webkit-scrollbar-track {
  background: transparent;
}

/* ========================
   8. GAME REPORT BUTTON
   ======================== */
.btn-report {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-report:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* Report Footer */
.report-footer {
  text-align: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.btn-new-game {
  background: linear-gradient(135deg, var(--accent-primary), #e8960a);
  color: #111;
  border: none;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-new-game:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}