/* Rise Online Bilgi Yarışması - Modern MMORPG Koyu Tasarım */
:root {
  --bg-deep: #05070e;
  --bg-card: rgba(13, 18, 36, 0.88);
  --border-gold: rgba(245, 158, 11, 0.4);
  --border-cyan: rgba(56, 189, 248, 0.35);
  --gold: #f59e0b;
  --gold-light: #fbbf24;
  --gold-glow: rgba(245, 158, 11, 0.5);
  --cyan: #38bdf8;
  --cyan-glow: rgba(56, 189, 248, 0.4);
  --emerald: #10b981;
  --rose: #ef4444;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(245, 158, 11, 0.18) 0%, transparent 55%),
    radial-gradient(circle at 10% 90%, rgba(56, 189, 248, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.12) 0%, transparent 45%),
    linear-gradient(180deg, rgba(8, 12, 24, 0.7) 0%, rgba(5, 7, 14, 0.95) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  position: relative;
}

/* Background Ambient Lighting & Particles */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(2px 2px at 20px 30px, #f59e0b, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 100px 150px, #38bdf8, rgba(0,0,0,0)),
    radial-gradient(1.5px 1.5px at 250px 80px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 400px 300px, #f59e0b, rgba(0,0,0,0)),
    radial-gradient(1.5px 1.5px at 550px 180px, #38bdf8, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 700px 420px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 850px 250px, #f59e0b, rgba(0,0,0,0));
  background-repeat: repeat;
  background-size: 900px 600px;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

.quiz-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 20px 20px 20px;
  max-width: 1560px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
  position: relative;
  z-index: 1;
}

/* Top Action Control Bar */
.quiz-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  padding: 8px 16px;
  box-shadow: 0 4px 25px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
}

.live-pill {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid #10b981;
  color: #34d399;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
}

/* Layout */
.quiz-layout {
  display: flex;
  gap: 20px;
  width: 100%;
  flex: 1;
}

.quiz-layout.has-sidebar {
  display: grid;
  grid-template-columns: 1fr 380px;
}

/* Stage - Stream View */
.quiz-stage-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.stage-card {
  background: var(--bg-card);
  border: 2px solid var(--border-gold);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.7), inset 0 0 35px rgba(245, 158, 11, 0.08);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stage-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #f59e0b, #38bdf8, #ec4899, #f59e0b);
  background-size: 300% 100%;
  animation: barFlow 4s linear infinite;
}

@keyframes barFlow {
  0% { background-position: 0% 0%; }
  100% { background-position: 300% 0%; }
}

.stage-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.category-tag {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid var(--border-gold);
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 14px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 0 15px rgba(245,158,11,0.2);
}

.points-tag {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--cyan);
  font-size: 0.85rem;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: 9999px;
  box-shadow: 0 0 15px rgba(56,189,248,0.2);
}

/* Giant Question Display */
.question-display-area {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 20px;
  background: radial-gradient(circle, rgba(245,158,11,0.06) 0%, transparent 70%);
  border-radius: 12px;
}

.question-text {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.35;
  color: #ffffff;
  text-shadow: 0 2px 14px rgba(0,0,0,0.9), 0 0 20px rgba(245,158,11,0.2);
}

.question-text.empty {
  font-size: 1.15rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Timer and Status Bar */
.timer-bar-wrap {
  width: 100%;
  height: 9px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.05);
}

.timer-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #10b981, #f59e0b, #ef4444);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
  transition: width 1s linear;
}

.timer-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
  font-weight: 700;
}

.countdown-badge {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 6px;
  text-shadow: 0 0 10px var(--gold-glow);
}

/* Winner Spotlight Card */
.winner-spotlight {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(6, 182, 212, 0.2) 100%);
  border: 2px solid #10b981;
  border-radius: 16px;
  padding: 18px;
  text-align: center;
  box-shadow: 0 0 40px rgba(16, 185, 129, 0.45);
  animation: popIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  display: none;
}

@keyframes popIn {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.winner-crown {
  font-size: 2.4rem;
  margin-bottom: 2px;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.winner-name {
  font-size: 1.85rem;
  font-weight: 900;
  color: #6ee7b7;
  text-shadow: 0 0 15px rgba(16, 185, 129, 0.6);
}

.winner-detail {
  color: #e2e8f0;
  font-size: 0.95rem;
  margin-top: 4px;
}

.revealed-answer-box {
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 1.05rem;
  color: #fff;
  border: 1px solid var(--border-gold);
  text-align: center;
  box-shadow: 0 0 20px rgba(245,158,11,0.25);
}

/* Bottom Grid for Feed + Leaderboard */
.stage-bottom-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
  flex: 1;
}

@media (max-width: 900px) {
  .stage-bottom-grid {
    grid-template-columns: 1fr;
  }
}

/* Live Answer Stream */
.answers-feed-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 200px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}

.feed-header {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  justify-content: space-between;
}

.answers-stream-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.answer-item {
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid rgba(255, 255, 255, 0.1);
  padding: 6px 10px;
  border-radius: 0 8px 8px 0;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.answer-item.correct {
  background: rgba(16, 185, 129, 0.2);
  border-left-color: #10b981;
}

.answer-user {
  font-weight: 700;
  color: var(--cyan);
}

.answer-text {
  color: #cbd5e1;
}

/* Host Panel */
.host-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 360px;
}

.panel-card {
  background: rgba(11, 15, 26, 0.95);
  border: 1px solid var(--border-gold);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}

.panel-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.input-text, .select-input {
  background: #060913;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 7px 10px;
  color: #fff;
  font-size: 0.88rem;
  outline: none;
  transition: all 0.2s;
}

.input-text:focus, .select-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

/* Secret Answer Box for Streamer */
.secret-answer-wrap {
  background: rgba(245, 158, 11, 0.08);
  border: 1px dashed var(--gold);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.secret-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: #fbbf24;
  display: flex;
  align-items: center;
  gap: 4px;
}

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

.btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  flex: 1;
}

.btn-primary {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid #ef4444;
  color: #fca5a5;
}

.btn-danger:hover {
  background: #ef4444;
  color: #fff;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Leaderboard */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 200px;
  overflow-y: auto;
}

.leader-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.82rem;
}

.leader-rank {
  font-weight: 800;
  color: var(--gold);
  width: 22px;
}

.leader-name {
  flex: 1;
  font-weight: 700;
}

.leader-score {
  font-weight: 800;
  color: var(--cyan);
}

/* Modal Overlay for Question Bank Editor */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 5, 12, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: #0d1224;
  border: 2px solid var(--border-gold);
  border-radius: 16px;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px;
  box-shadow: 0 15px 50px rgba(0,0,0,0.8), 0 0 30px rgba(245,158,11,0.2);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 12px;
}

.modal-tabs {
  display: flex;
  gap: 6px;
  background: rgba(0,0,0,0.3);
  padding: 4px;
  border-radius: 8px;
}

.modal-tab-btn {
  flex: 1;
  padding: 6px 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.82rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-tab-btn.active {
  background: var(--gold);
  color: #000;
}

.custom-q-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  background: rgba(0,0,0,0.3);
  padding: 8px;
  border-radius: 8px;
}

.custom-q-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  font-size: 0.8rem;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: rgba(245, 158, 11, 0.3); border-radius: 99px; }
