:root {
  --bg: #1a1a2e;
  --surface: #16213e;
  --card: #0f3460;
  --accent: #e94560;
  --accent2: #4ecca3;
  --text: #eaeaea;
  --text-muted: #9aa0b2;
  --border: #2a3a5c;
  --radius: 8px;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
}

*, *::before, *::after { box-sizing: border-box; }

body { margin: 0; padding: 0; min-height: 100vh; }

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

h1, h2, h3 { margin: 0 0 1rem; }
h1 { font-size: 1.8rem; color: var(--accent2); }
h2 { font-size: 1.3rem; }

/* Cards */
.question-card, .card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin-bottom: 1rem;
}

.q-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.q-label { font-weight: 600; color: var(--accent2); }

/* Fields */
.field { margin-bottom: 0.9rem; }
.field label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.3rem; }

input[type="text"], input[type="number"], textarea, select {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.5rem 0.7rem;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
}
input[type="text"]:focus, textarea:focus, input[type="number"]:focus {
  border-color: var(--accent2);
}
textarea { resize: vertical; min-height: 60px; }

/* Buttons */
button {
  cursor: pointer;
  border: none;
  border-radius: var(--radius);
  padding: 0.5rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--card);
  color: var(--text);
  transition: opacity 0.15s, background 0.15s;
}
button:hover { opacity: 0.85; }
button.primary { background: var(--accent2); color: #111; }
button.danger { background: var(--accent); color: #fff; }
button.danger-sm { background: transparent; color: var(--accent); border: 1px solid var(--accent); padding: 0.2rem 0.5rem; font-size: 0.8rem; }
button:disabled { opacity: 0.4; cursor: not-allowed; }

/* Answer rows */
.answer-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.answer-row .a-text { flex: 1; }
.a-correct-label, .a-multiple-label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
}

/* Toolbar */
.toolbar { display: flex; gap: 1rem; margin-top: 1.5rem; flex-wrap: wrap; }

/* Image preview */
.preview { max-width: 200px; max-height: 120px; border-radius: 4px; margin-top: 0.4rem; display: none; }

/* Players list */
.player-list { list-style: none; padding: 0; margin: 0; }
.player-list li {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.player-list li:last-child { border-bottom: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot.connected { background: var(--accent2); }
.dot.disconnected { background: var(--text-muted); }

/* Estimate grid */
.estimate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 1rem;
}
@media (max-width: 500px) { .estimate-grid { grid-template-columns: 1fr; } }

.estimate-cell {
  background: var(--card);
  border-radius: var(--radius);
  padding: 0.6rem 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
}
.estimate-val { font-weight: 700; color: var(--accent2); }

/* Score table */
.score-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.score-table th, .score-table td { padding: 0.5rem 0.8rem; text-align: left; border-bottom: 1px solid var(--border); }
.score-table th { color: var(--text-muted); font-size: 0.85rem; font-weight: 600; }

/* Probability slider */
.prob-row { display: flex; align-items: center; gap: 0.8rem; margin: 1rem 0; }
.prob-row input[type="range"] { flex: 1; accent-color: var(--accent2); }
.prob-val { min-width: 50px; text-align: right; font-weight: 700; color: var(--accent2); }

/* Timer bar */
.timer-bar-wrap { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; margin: 0.5rem 0; }
.timer-bar { height: 100%; background: var(--accent); transition: width 1s linear; }

/* Status messages */
.status { color: var(--text-muted); font-style: italic; margin: 0.5rem 0; }
.badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.8rem; font-weight: 700; }
.badge.green { background: #1d6b52; color: var(--accent2); }
.badge.red { background: #5c1d2e; color: var(--accent); }

/* Answer highlight */
.answer-box {
  background: var(--card);
  border: 2px solid var(--accent2);
  border-radius: var(--radius);
  padding: 1rem 1.4rem;
  font-size: 1.1rem;
  font-weight: 700;
  margin: 1rem 0;
}

/* Phase screens */
.screen { display: none; }
.screen.active { display: block; }
