/* 01-base-setup.css - Theme variables (dark + light), screen switching, SETUP screen */
:root {
  --bg: #06071a;
  --surface: #0c0e28;
  --table-bg: #0e1132;
  --border: #252862;
  --border-strong: #3a3e80;
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-light: rgba(124,58,237,0.15);
  --accent-dim: #4c2a8a;
  --text: #c8c5f0;
  --text-2: #8b88c0;
  --text-3: #5a5880;
  --red: #dc2626;
  --red-light: rgba(220,38,38,0.15);
  --green: #22c55e;
  --green-light: rgba(34,197,94,0.12);
  --amber: #eab308;
  --amber-light: rgba(234,179,8,0.12);
  --white: #e8e6ff;
}

/* ═══ LIGHT MODE VARIABLES ═══ */
html[data-theme="light"] {
  --bg: #f0eeff;
  --surface: #ffffff;
  --table-bg: #f8f7ff;
  --border: #dbd6f5;
  --border-strong: #b8b0e8;
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-light: rgba(124,58,237,0.1);
  --accent-dim: #7c3aed;
  --text: #1a1535;
  --text-2: #4a4170;
  --text-3: #8b85b8;
  --red: #dc2626;
  --red-light: rgba(220,38,38,0.1);
  --green: #16a34a;
  --green-light: rgba(22,163,74,0.1);
  --amber: #d97706;
  --amber-light: rgba(217,119,6,0.1);
  --white: #1a1535;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* ═══ SCREEN MANAGEMENT ═══ */
.screen { display: none; }
.screen.active { display: flex; }

/* ═══════════════════════════
   SETUP SCREEN
═══════════════════════════ */
#setup-screen {
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  padding: 48px 16px 64px;
  background: radial-gradient(ellipse at 20% 20%, rgba(124,58,237,0.1) 0%, transparent 60%), radial-gradient(ellipse at 80% 80%, rgba(59,130,246,0.07) 0%, transparent 60%), var(--bg);
}

.setup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
  position: relative;
  width: 100%;
  max-width: 960px;
  flex-wrap: wrap;
  gap: 12px;
}
.setup-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 4px;
}
.setup-sub {
  font-size: 13px;
  color: var(--text-3);
  font-weight: 400;
}

.setup-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 28px;
  width: 100%;
  max-width: 600px;
  flex: 1 1 0;
  min-width: 0;
  box-shadow: 0 8px 60px rgba(0,0,0,0.6), inset 0 1px 0 rgba(124,58,237,0.12);
}

.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 10px;
}

.name-input-row {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.input-field {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  padding: 9px 12px;
  outline: none;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input-field:focus {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
  background: rgba(124,58,237,0.05);
}
.input-field::placeholder { color: var(--text-3); }

.btn { cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all 0.15s; border: none; outline: none; display: inline-flex; align-items: center; justify-content: center; gap: 5px; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: 3px;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 12px;
  white-space: nowrap;
}
.btn-ghost:hover { border-color: var(--border-strong); color: var(--text); background: rgba(255,255,255,0.04); }

.btn-danger {
  background: transparent;
  border: 1px solid rgba(220,38,38,0.4);
  color: var(--red);
  border-radius: 3px;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 12px;
  white-space: nowrap;
}
.btn-danger:hover { background: var(--red-light); border-color: var(--red); }

/* Bulk panel */
.bulk-panel {
  display: none;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
  animation: fadeIn 0.15s ease;
}
.bulk-panel.open { display: flex; }
.bulk-panel textarea {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--accent-dim);
  border-radius: 3px;
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  padding: 10px 12px;
  outline: none;
  resize: vertical;
  min-height: 90px;
  width: 100%;
  transition: border-color 0.15s;
}
.bulk-panel textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,58,237,0.12); }
.bulk-row-btns { display: flex; gap: 6px; }

/* Player chips */
.player-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 38px;
  padding: 8px;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  border-radius: 3px;
  margin-bottom: 6px;
  align-items: center;
}

.chips-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}

.player-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  color: #fff;
  animation: chipIn 0.18s ease;
  text-shadow:
    -1px -1px 0   rgba(0,0,0,0.4),
     1px -1px 0   rgba(0,0,0,0.4),
    -1px  1px 0   rgba(0,0,0,0.4),
     1px  1px 0   rgba(0,0,0,0.4),
     0    1px 4px rgba(0,0,0,0.5);
}
@keyframes chipIn { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.chip-remove {
  background: none;
  border: none;
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  padding: 0;
  transition: color 0.1s;
}
.chip-remove:hover { color: #fff; }

/* Settings grid */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.setting-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 5px;
}

/* Mode selector */
.mode-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
}

.mode-option {
  border: 2px solid var(--border);
  border-radius: 4px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.15s;
  background: rgba(0,0,0,0.2);
  position: relative;
}
.mode-option:hover { border-color: var(--border-strong); background: rgba(124,58,237,0.05); }
.mode-option.selected {
  background: rgba(124,58,237,0.1);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}

.mode-option-name {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 3px;
  color: var(--text);
}
.mode-option.selected .mode-option-name { color: #a78bfa; }
.mode-option-desc {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.4;
}
.mode-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  transition: all 0.15s;
}
.mode-option.selected .mode-check {
  background: var(--accent);
  border-color: var(--accent);
}
.mode-option.selected .mode-check::after {
  content: '';
  display: block;
  width: 4px;
  height: 7px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(1px, -1px);
  margin: 1px auto 0;
}

.btn-start {
  width: 100%;
  background: linear-gradient(135deg, var(--accent) 0%, #a78bfa 50%, var(--accent) 100%);
  border: none;
  border-radius: 3px;
  color: #fff;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  padding: 14px;
  transition: opacity 0.15s, transform 0.1s;
  box-shadow: 0 4px 20px rgba(124,58,237,0.35);
}
.btn-start:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-start:active { transform: translateY(0); }
