:root {
  --bg-dark: #1e2433;
  --bg-card: #2a3344;
  --bg-card-hover: #354055;
  --accent: #00c9a7;
  --accent-dim: #00a88a;
  --text: #f5f6fa;
  --text-muted: #8b9cad;
  --danger: #ff4757;
  --correct: #2ed573;
  --wrong: #ff6b81;
}

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

body {
  font-family: 'Outfit', -apple-system, sans-serif;
  background: linear-gradient(145deg, #1e2433 0%, #252d3d 100%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* === Oyuncu ekranı === */
.app {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.screen {
  display: none;
  width: 100%;
  max-width: 480px;
}

.screen.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  background: var(--bg-card);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.06);
}

.qr-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background: rgba(0,212,170,0.1);
  border-radius: 0.5rem;
  color: var(--accent);
  font-size: 0.9rem;
}

.qr-icon { font-size: 1.25rem; }

.card h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

#team-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#team-input {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-family: inherit;
  background: #2a3344;
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 0.5rem;
  color: var(--text);
  transition: border-color 0.2s;
}

#team-input:focus {
  outline: none;
  border-color: var(--accent);
}

.btn {
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-dark);
}

.btn-primary:hover {
  background: var(--accent-dim);
  transform: translateY(-1px);
}

/* === Oyun ekranı === */
#game-screen .game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

#team-badge {
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--bg-dark);
  border-radius: 2rem;
  font-weight: 600;
  font-size: 0.9rem;
}

#question-counter {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.question-card {
  background: var(--bg-card);
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid rgba(255,255,255,0.06);
}

#question-text {
  font-size: 1.2rem;
  margin-bottom: 1.25rem;
  font-weight: 600;
  color: #f5f6fa;
  line-height: 1.5;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.option {
  padding: 1rem 1.25rem;
  background: #3a4556;
  border: 2px solid rgba(255,255,255,0.12);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1rem;
  color: #f5f6fa;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.option:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
}

.option.selected { border-color: var(--accent); background: rgba(0,212,170,0.1); }
.option.correct { border-color: var(--correct); background: rgba(46,213,115,0.15); }
.option.wrong { border-color: var(--wrong); background: rgba(255,107,129,0.15); }
.option:disabled { cursor: not-allowed; opacity: 0.8; }

.option-letter {
  width: 2rem;
  height: 2rem;
  background: rgba(0,201,167,0.25);
  color: var(--accent);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.result-message {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  display: none;
}

.result-message.show { display: block; }
.result-message.correct { background: rgba(46,213,115,0.2); color: var(--correct); }
.result-message.wrong { background: rgba(255,107,129,0.2); color: var(--wrong); }

/* === Tahta === */
.tahta-body {
  padding: 0;
  min-height: 100vh;
}

.tahta {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.tahta-header {
  margin-bottom: 1.5rem;
}

.tahta-header h1 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.qr-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: 0.5rem;
  border: 1px solid rgba(255,255,255,0.06);
}

.qr-box p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.qr-box img {
  border-radius: 0.5rem;
  background: white;
  padding: 4px;
}

.qr-box small {
  color: var(--text-muted);
  font-size: 0.8rem;
  word-break: break-all;
}

.tahta-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.btn-small {
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.2);
}

.btn-small:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
}

.btn-danger {
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  background: var(--danger);
  color: white;
}

.btn-danger:hover { opacity: 0.9; }

#tahta-question-num {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.current-question-box {
  background: var(--bg-card);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255,255,255,0.06);
}

#tahta-question-text {
  font-size: 1.15rem;
  font-weight: 600;
}

.chart-container {
  background: var(--bg-card);
  border-radius: 1rem;
  padding: 1.5rem;
  min-height: 350px;
  border: 1px solid rgba(255,255,255,0.06);
}

/* === Bekleme ekranı === */
.waiting-screen, .end-screen {
  text-align: center;
  padding: 2rem;
}

.waiting-screen h2, .end-screen h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.waiting-screen p, .end-screen p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.waiting-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(0,201,167,0.3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 1.5rem auto;
}

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

.end-screen .thank-you {
  font-size: 1.25rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

/* === Tahta - Başlat/Bitir butonları === */
.btn-start {
  background: var(--correct);
  color: #1e2433;
}

.btn-end {
  background: #e67e22;
  color: white;
}

/* === İstatistik grafikleri === */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .charts-row { grid-template-columns: 1fr; }
}

.question-stats {
  background: var(--bg-card);
  border-radius: 1rem;
  padding: 1rem;
  margin-top: 1rem;
  border: 1px solid rgba(255,255,255,0.06);
  max-height: 200px;
  overflow-y: auto;
}

.question-stats h3 {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
}

.question-stats table {
  width: 100%;
  font-size: 0.85rem;
}

.question-stats th,
.question-stats td {
  padding: 0.4rem 0.5rem;
  text-align: left;
}

.question-stats th {
  color: var(--text-muted);
  font-weight: 500;
}

.question-stats .stat-correct { color: var(--correct); }
.question-stats .stat-wrong { color: var(--wrong); }
