/* ==========================================================================
   Hexxagon - Stylesheet
   Modern, tactile, responsive with 4 visual themes and specular SVG gems
   ========================================================================== */

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #121826;
  --bg-card: #1a2336;
  --border-color: #27354f;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;

  --p1-light: #ff6b8b;
  --p1-color: #e11d48;
  --p1-dark: #4c0519;
  --p1-glow: rgba(244, 63, 94, 0.6);

  --p2-light: #a5f3fc;
  --p2-color: #0284c7;
  --p2-dark: #082f49;
  --p2-glow: rgba(2, 132, 199, 0.6);

  --clone-color: #10b981;
  --clone-glow: rgba(16, 185, 129, 0.7);
  --jump-color: #f59e0b;
  --jump-glow: rgba(245, 158, 11, 0.7);

  --cell-fill: #162032;
  --cell-stroke: #25334e;
  --cell-hover: #1f2d45;

  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ================= THEMES ================= */

/* 1. Cyberpunk Neon (Default) */
body.theme-cyber {
  --bg-primary: #0a0e17;
  --bg-secondary: #121826;
  --bg-card: #1a2336;
  --border-color: #2a3a5a;
  --cell-fill: #141d2d;
  --cell-stroke: #263857;
  --cell-hover: #213049;
  --p1-light: #ff6b8b;
  --p1-color: #e11d48;
  --p1-dark: #4c0519;
  --p1-glow: rgba(244, 63, 94, 0.6);
  --p2-light: #a5f3fc;
  --p2-color: #0284c7;
  --p2-dark: #082f49;
  --p2-glow: rgba(2, 132, 199, 0.6);
}

/* 2. Original DOS 1993 Retro (Slate Marble) */
body.theme-retro {
  --bg-primary: #18191f;
  --bg-secondary: #24262e;
  --bg-card: #31343f;
  --border-color: #474b5b;
  --cell-fill: #2a2c37;
  --cell-stroke: #454958;
  --cell-hover: #3b3e4d;
  --p1-light: #f87171;
  --p1-color: #dc2626;
  --p1-dark: #450a0a;
  --p1-glow: rgba(220, 38, 38, 0.6);
  --p2-light: #ffffff;
  --p2-color: #cbd5e1;
  --p2-dark: #334155;
  --p2-glow: rgba(203, 213, 225, 0.6);
}

/* 3. Bio-Organic Spores */
body.theme-bio {
  --bg-primary: #061511;
  --bg-secondary: #0d231d;
  --bg-card: #14352c;
  --border-color: #1e4e41;
  --cell-fill: #0f2b23;
  --cell-stroke: #20594a;
  --cell-hover: #184438;
  --p1-light: #6ee7b7;
  --p1-color: #10b981;
  --p1-dark: #064e3b;
  --p1-glow: rgba(16, 185, 129, 0.6);
  --p2-light: #e9d5ff;
  --p2-color: #a855f7;
  --p2-dark: #3b0764;
  --p2-glow: rgba(168, 85, 247, 0.6);
}

/* 4. Obsidian Zen Sanctuary */
body.theme-zen {
  --bg-primary: #131417;
  --bg-secondary: #1c1d22;
  --bg-card: #282a32;
  --border-color: #3b3e4b;
  --cell-fill: #22232a;
  --cell-stroke: #3c3e4a;
  --cell-hover: #2f313a;
  --p1-light: #fde047;
  --p1-color: #eab308;
  --p1-dark: #422006;
  --p1-glow: rgba(234, 179, 8, 0.6);
  --p2-light: #f1f5f9;
  --p2-color: #94a3b8;
  --p2-dark: #1e293b;
  --p2-glow: rgba(148, 163, 184, 0.6);
}

/* ================= RESET & LAYOUT ================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  overflow-x: hidden;
  transition: background-color 0.3s ease;
}

#app {
  width: 100%;
  max-width: 1200px;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 10px 16px;
  overflow: hidden;
}

@media (min-width: 1400px) {
  #app {
    max-width: 1400px;
  }
}

/* ================= HEADER ================= */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 8px 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  margin-bottom: 8px;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.gry-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.15s ease;
}

.gry-back:hover {
  background: var(--bg-secondary);
  transform: translateY(-1px);
}

.gry-back:focus-visible {
  outline: 3px solid #22d3ee;
  outline-offset: 2px;
}

.logo-gem {
  font-size: 26px;
  line-height: 1;
}

.title-area h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

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

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

/* ================= SCOREBOARD ================= */
.scoreboard {
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.scoreboard-cards {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.player-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-radius: 10px;
  border: 2px solid transparent;
  transition: all 0.25s ease;
}

.player-card.active-player {
  background: rgba(255, 255, 255, 0.05);
}

.player-card.p1.active-player {
  border-color: var(--p1-color);
  box-shadow: 0 0 16px var(--p1-glow);
}

.player-card.p2.active-player {
  border-color: var(--p2-color);
  box-shadow: 0 0 16px var(--p2-glow);
}

.gem-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.gem-p1 {
  background: radial-gradient(circle at 35% 35%, var(--p1-light), var(--p1-color) 70%, var(--p1-dark));
  box-shadow: 0 0 8px var(--p1-glow);
}

.gem-p2 {
  background: radial-gradient(circle at 35% 35%, var(--p2-light), var(--p2-color) 70%, var(--p2-dark));
  box-shadow: 0 0 8px var(--p2-glow);
}

.player-name {
  font-size: 0.88rem;
  font-weight: 700;
}

.player-score {
  font-size: 1.45rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  margin-left: 6px;
}

.p1 .player-score { color: var(--p1-color); }
.p2 .player-score { color: var(--p2-color); }

/* Center Turn Indicator */
.turn-status {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.turn-badge {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  letter-spacing: 0.5px;
}

.thinking-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--p2-color);
  margin-top: 4px;
  animation: pulse-slow 1.2s infinite ease-in-out;
}

.thinking-indicator.hidden {
  display: none !important;
}

.spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(2, 132, 199, 0.3);
  border-top-color: var(--p2-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

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

/* Battle balance progress bar */
.battle-progress {
  width: 100%;
  height: 6px;
  display: flex;
  background: var(--bg-card);
  border-radius: 3px;
  overflow: hidden;
}

.progress-p1 {
  height: 100%;
  background: var(--p1-color);
  transition: width 0.3s ease;
}

.progress-p2 {
  height: 100%;
  background: var(--p2-color);
  transition: width 0.3s ease;
}

/* Pass Alert Banner */
.pass-banner {
  background: rgba(245, 158, 11, 0.95);
  color: #111;
  font-size: 0.88rem;
  font-weight: 800;
  text-align: center;
  padding: 6px 14px;
  border-radius: 8px;
  margin-bottom: 8px;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
  animation: pulse-warn 1.2s infinite;
  flex-shrink: 0;
}

.pass-banner.hidden {
  display: none !important;
}

@keyframes pulse-warn {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

/* ================= BOARD VIEWPORT ================= */
.board-viewport {
  flex: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at center, rgba(30, 41, 59, 0.3) 0%, rgba(10, 14, 23, 0.7) 100%);
  border-radius: 14px;
  border: 1px solid var(--border-color);
  padding: 6px;
  min-height: 200px;
}

#hex-board-svg {
  width: 100%;
  height: 100%;
  display: block;
  margin: auto;
  overflow: visible;
}

/* Hex cells */
.hex-cell {
  fill: var(--cell-fill);
  stroke: var(--cell-stroke);
  stroke-width: 1.5;
  cursor: pointer;
  transition: fill 0.15s ease, stroke 0.15s ease, transform 0.15s ease;
}

.hex-cell:hover {
  fill: var(--cell-hover);
}

.hex-cell.selected {
  stroke: #fbbf24;
  stroke-width: 2.5;
  fill: rgba(251, 191, 36, 0.12);
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.7));
}

/* Clone destination cell (distance 1) */
.hex-cell.dest-clone {
  stroke: var(--clone-color);
  stroke-width: 2;
  fill: rgba(16, 185, 129, 0.18);
  filter: url(#glow-clone);
}

.hex-cell.dest-clone:hover {
  fill: rgba(16, 185, 129, 0.32);
}

/* Jump destination cell (distance 2) */
.hex-cell.dest-jump {
  stroke: var(--jump-color);
  stroke-width: 2;
  fill: rgba(245, 158, 11, 0.18);
  filter: url(#glow-jump);
}

.hex-cell.dest-jump:hover {
  fill: rgba(245, 158, 11, 0.32);
}

/* Indicators inside destination cells */
.indicator-clone {
  fill: var(--clone-color);
  opacity: 0.85;
  box-shadow: 0 0 8px var(--clone-glow);
}

.indicator-jump {
  fill: var(--jump-color);
  opacity: 0.85;
  box-shadow: 0 0 8px var(--jump-glow);
}

/* Hint pulse */
.hint-pulse {
  animation: hint-glow 1.5s infinite ease-in-out;
}

@keyframes hint-glow {
  0%, 100% { stroke: #fbbf24; stroke-width: 2; fill: rgba(251, 191, 36, 0.2); }
  50% { stroke: #ffffff; stroke-width: 3.5; fill: rgba(251, 191, 36, 0.45); }
}

/* Pieces */
.piece {
  cursor: default;
  transform-box: fill-box;
  transform-origin: center;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

/* Only selectable pieces show pointer cursor and gentle hover illumination */
.piece.piece-selectable {
  cursor: pointer;
}

.piece.piece-selectable:hover circle.piece-body {
  filter: brightness(1.18);
}

.piece.piece-selectable:hover {
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.45));
}

/* Selected piece gets a distinct gold border and halo without jumping */
.piece-selected circle.piece-body {
  stroke: #fbbf24;
  stroke-width: 2.5;
}

.piece-selected {
  filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.85));
}

/* Targeted pieces during hover preview: smooth pulsating amber warning glow without shifting */
.piece-target-capture {
  animation: capture-pulse 0.75s infinite ease-in-out;
}

@keyframes capture-pulse {
  0%, 100% {
    filter: drop-shadow(0 0 4px #fbbf24);
  }
  50% {
    filter: drop-shadow(0 0 14px #f59e0b) brightness(1.25);
  }
}

/* ================= CONTROLS FOOTER ================= */
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  flex-shrink: 0;
  gap: 8px;
}

.footer-left, .footer-right {
  display: flex;
  gap: 8px;
}

.btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn:hover:not(:disabled) {
  background: var(--border-color);
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--p1-color);
  color: #fff;
  border-color: rgba(244, 63, 94, 0.7);
}

.btn-primary:hover:not(:disabled) {
  background: #e11d48;
}

/* Responsive Mobile Layout */
@media (max-width: 680px) {
  #app {
    padding: 6px 8px;
  }
  header {
    padding: 6px 10px;
  }
  .title-area h1 {
    font-size: 1rem;
  }
  .player-card {
    padding: 4px 8px;
  }
  .player-score {
    font-size: 1.2rem;
  }
  footer {
    flex-wrap: wrap;
    justify-content: center;
  }
  .footer-left, .footer-right {
    width: 100%;
    justify-content: space-around;
  }
  .btn {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
}

/* ================= MODALS ================= */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal.active {
  display: flex;
}

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

.modal-content {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 24px;
  width: 90%;
  max-width: 580px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  z-index: 101;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.modal-header h2 {
  font-size: 1.25rem;
  color: var(--text-main);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-main);
}

/* Rules content */
.rules-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rule-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px;
}

.rule-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.badge-clone {
  background: rgba(16, 185, 129, 0.2);
  color: var(--clone-color);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 800;
}

.badge-jump {
  background: rgba(245, 158, 11, 0.2);
  color: var(--jump-color);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 800;
}

.badge-capture {
  background: rgba(244, 63, 94, 0.2);
  color: var(--p1-color);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 800;
}

.rule-box p {
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-muted);
}

/* Stats Modal */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}

.stat-item-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
  text-align: center;
}

.stat-num {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--text-main);
}

.stat-lbl {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Win Modal Specifics */
.win-content {
  text-align: center;
  max-width: 440px;
}

.win-badge-pill {
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 800;
  margin: 10px 0 16px 0;
  padding: 4px 16px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

.final-scores {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin: 18px 0;
}

.final-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 24px;
  min-width: 120px;
}

.final-num {
  font-size: 2.2rem;
  font-weight: 900;
}

.p1-box .final-num { color: var(--p1-color); }
.p2-box .final-num { color: var(--p2-color); }

.final-lbl {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.vs-text {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--text-muted);
}

/* Confetti particles */
#confetti-canvas-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 105;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 14px;
  border-radius: 2px;
  opacity: 0.95;
  animation: fall linear forwards;
}

@keyframes fall {
  to { transform: translateY(105vh) rotate(720deg); }
}

/* ================= AI SELECTION MODAL ================= */
.ai-modal-content {
  max-width: 680px;
  width: 95%;
  max-height: 92vh;
  padding: 20px;
}

.modal-subtitle {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.ai-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.ai-tab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-tab-btn:hover {
  color: var(--text-main);
  border-color: #38bdf8;
}

.ai-tab-btn.active {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: #38bdf8;
}

.ai-view-panel.hidden {
  display: none !important;
}

.ai-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.ai-opponents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.opponent-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
}

.opponent-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.opponent-card.active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.25);
}

.opponent-card.active::after {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 8px;
  background: #38bdf8;
  color: #0b1120;
  font-size: 0.75rem;
  font-weight: 900;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.opponent-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.opponent-name {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-main);
}

.depth-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 10px;
}

.depth-badge-1 { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.depth-badge-2 { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.depth-badge-3 { background: rgba(249, 115, 22, 0.2); color: #f97316; }
.depth-badge-4 { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.depth-badge-5 { background: rgba(168, 85, 247, 0.25); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.4); }

.opponent-engine {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.opponent-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin: 0;
}

/* Custom Minimax Configurator */
.custom-ai-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px dashed var(--border-color);
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 10px;
}

.custom-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.custom-ai-title {
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--text-main);
}

.custom-ai-badge {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.custom-controls-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.custom-control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.custom-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.engine-toggle-group {
  display: flex;
  gap: 8px;
}

.engine-opt-btn {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.engine-opt-btn:hover {
  color: var(--text-main);
}

.engine-opt-btn.active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

.depth-label-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.depth-preview-pill {
  font-size: 0.78rem;
  font-weight: 800;
  color: #38bdf8;
}

.depth-pills-row {
  display: flex;
  gap: 8px;
}

.depth-pill-btn {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 0;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.depth-pill-btn:hover {
  border-color: #38bdf8;
  color: var(--text-main);
}

.depth-pill-btn.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

/* EvE Matchup View */
.eve-guide-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 14px;
}

.eve-matchup-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.eve-player-box {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.eve-player-box.p1-eve {
  border-color: rgba(225, 29, 72, 0.4);
}

.eve-player-box.p2-eve {
  border-color: rgba(2, 132, 199, 0.4);
}

.eve-player-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.eve-player-header h3 {
  font-size: 0.95rem;
  margin: 0;
}

.eve-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.eve-field label {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 700;
}

.eve-select-input {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  outline: none;
}

.eve-vs-center {
  font-weight: 900;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}

.eve-presets-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-preset-eve {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-preset-eve:hover {
  border-color: #38bdf8;
  color: #38bdf8;
}

.ai-modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}
