/* ============================================
   FOOTBALL QUIZ LIVE - Main Stylesheet
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --primary: #1a1a2e;
  --primary-light: #16213e;
  --accent: #0f3460;
  --gold: #e9b208;
  --gold-light: #f5d442;
  --green: #00b894;
  --green-dark: #00a381;
  --red: #e74c3c;
  --red-dark: #c0392b;
  --blue: #3498db;
  --purple: #9b59b6;
  --orange: #f39c12;
  --white: #ffffff;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;
  --font-en: 'Inter', sans-serif;
  --font-ar: 'Cairo', sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.2);
  --shadow-glow: 0 0 30px rgba(233,178,8,0.3);
  --transition: all 0.3s ease;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-en);
  background: var(--primary);
  color: var(--white);
  min-height: 100vh;
  overflow-x: hidden;
}

body[dir="rtl"] {
  font-family: var(--font-ar);
}

body[dir="rtl"] * {
  font-family: var(--font-ar);
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }

/* ============ UTILITIES ============ */

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.relative { position: relative; }

/* ============ BUTTONS ============ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); filter: brightness(1.1); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--gold); color: var(--primary); }
.btn-primary:hover { background: var(--gold-light); }
.btn-success { background: var(--green); color: var(--white); }
.btn-danger { background: var(--red); color: var(--white); }
.btn-ghost { background: rgba(255,255,255,0.1); color: var(--white); border: 1px solid rgba(255,255,255,0.2); }
.btn-ghost:hover { background: rgba(255,255,255,0.2); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 14px 32px; font-size: 1.1rem; }
.btn-xl { padding: 18px 48px; font-size: 1.3rem; border-radius: var(--radius); }
.btn-icon { padding: 8px; min-width: 36px; height: 36px; }
.btn-block { width: 100%; }

/* ============ FORMS ============ */

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gray-300);
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 0.95rem;
  font-family: inherit;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(255,255,255,0.12);
  box-shadow: 0 0 0 3px rgba(233,178,8,0.15);
}

.form-control::placeholder {
  color: var(--gray-500);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23adb5bd' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

[dir="rtl"] select.form-control {
  background-position: left 12px center;
  padding-right: 14px;
  padding-left: 36px;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* ============ CARDS ============ */

.card {
  background: var(--primary-light);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.08);
  transition: var(--transition);
}

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

.card-header h2, .card-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

/* ============ MODAL ============ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--primary-light);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: var(--shadow-lg);
  transform: scale(0.9);
  transition: transform 0.3s;
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal h2 {
  font-size: 1.3rem;
  margin-bottom: 20px;
  color: var(--gold);
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* ============ TOAST ============ */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

[dir="rtl"] .toast-container {
  right: auto;
  left: 20px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s;
  min-width: 250px;
  box-shadow: var(--shadow);
}

.toast-success { background: var(--green); color: var(--white); }
.toast-error { background: var(--red); color: var(--white); }
.toast-warning { background: var(--orange); color: var(--primary); }
.toast-info { background: var(--blue); color: var(--white); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ============ HEADER / NAV ============ */

.main-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  padding: 16px 0;
  border-bottom: 2px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 100;
}

.main-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo span {
  color: var(--white);
  font-weight: 600;
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-links a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--gray-300);
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
}

.nav-links a:hover, .nav-links a.active {
  background: rgba(255,255,255,0.1);
  color: var(--gold);
}

/* ============ HOME PAGE ============ */

.hero {
  text-align: center;
  padding: 60px 0 40px;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 900;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.2rem;
  color: var(--gray-400);
  max-width: 600px;
  margin: 0 auto 40px;
}

.sessions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.session-card {
  background: var(--primary-light);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.08);
  transition: var(--transition);
  cursor: pointer;
}

.session-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.session-card .status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-setup { background: rgba(52,152,219,0.2); color: var(--blue); }
.status-active { background: rgba(0,184,148,0.2); color: var(--green); }
.status-paused { background: rgba(243,156,18,0.2); color: var(--orange); }
.status-finished { background: rgba(155,89,182,0.2); color: var(--purple); }

/* ============ DISPLAY SCREEN ============ */

.display-screen {
  min-height: 100vh;
  background: linear-gradient(180deg, #0a0a1a 0%, #1a1a2e 50%, #0f3460 100%);
  position: relative;
  overflow: hidden;
}

.display-screen::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(233,178,8,0.05) 0%, transparent 50%),
              radial-gradient(circle at 70% 80%, rgba(15,52,96,0.1) 0%, transparent 50%);
  animation: bgFloat 20s ease-in-out infinite;
}

@keyframes bgFloat {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-2%, -1%); }
}

.display-header {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 30px 20px 20px;
}

.display-header h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gold);
  text-shadow: 0 2px 20px rgba(233,178,8,0.3);
}

.round-indicator {
  font-size: 1rem;
  color: var(--gray-400);
  margin-top: 8px;
  font-weight: 600;
}

.display-question {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 20px 40px;
  margin: 0 auto 30px;
  max-width: 1000px;
}

.display-question h2 {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.3;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
  color: var(--white);
}

.answers-board {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.answer-slot {
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, rgba(22,33,62,0.9) 0%, rgba(26,26,46,0.9) 100%);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 14px 20px;
  min-height: 64px;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.answer-slot.revealed {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(233,178,8,0.15) 0%, rgba(15,52,96,0.4) 100%);
  box-shadow: 0 0 20px rgba(233,178,8,0.15);
}

.answer-slot.just-revealed {
  animation: revealPulse 1s ease;
}

@keyframes revealPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(233,178,8,0); }
  30% { transform: scale(1.02); box-shadow: 0 0 40px rgba(233,178,8,0.4); }
  100% { transform: scale(1); box-shadow: 0 0 20px rgba(233,178,8,0.15); }
}

.answer-rank {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--gold);
  flex-shrink: 0;
  margin-right: 16px;
  border: 2px solid rgba(233,178,8,0.3);
}

[dir="rtl"] .answer-rank {
  margin-right: 0;
  margin-left: 16px;
}

.answer-text {
  flex: 1;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
}

.answer-hidden {
  font-size: 1.3rem;
  color: var(--gray-600);
  font-weight: 600;
  letter-spacing: 4px;
}

.answer-points {
  background: var(--gold);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 1rem;
  margin-left: 12px;
  flex-shrink: 0;
}

[dir="rtl"] .answer-points {
  margin-left: 0;
  margin-right: 12px;
}

.answer-team-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.85rem;
  margin-left: 12px;
  flex-shrink: 0;
  color: var(--white);
}

[dir="rtl"] .answer-team-badge {
  margin-left: 0;
  margin-right: 12px;
}

/* Scoreboard */
.scoreboard {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 30px 20px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.score-card {
  background: linear-gradient(135deg, rgba(22,33,62,0.95) 0%, rgba(26,26,46,0.95) 100%);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 16px 30px;
  text-align: center;
  min-width: 160px;
  transition: var(--transition);
}

.score-card.leading {
  border-color: var(--gold);
  box-shadow: var(--shadow-glow);
}

.score-card .team-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--gray-200);
}

.score-card .team-score {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
}

.score-card .team-color-bar {
  height: 4px;
  border-radius: 2px;
  margin-bottom: 12px;
}

/* Game status overlays */
.game-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  text-align: center;
}

.game-overlay h1 {
  font-size: 4rem;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 40px rgba(233,178,8,0.4);
  margin-bottom: 20px;
}

.game-overlay p {
  font-size: 1.5rem;
  color: var(--gray-300);
}

/* Winner celebration */
.winner-screen {
  text-align: center;
}

.winner-screen .trophy {
  font-size: 6rem;
  margin-bottom: 20px;
  animation: trophyBounce 2s ease-in-out infinite;
}

@keyframes trophyBounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-20px) rotate(-5deg); }
  75% { transform: translateY(-20px) rotate(5deg); }
}

.winner-screen h1 {
  font-size: 3.5rem;
  margin-bottom: 16px;
}

.winner-screen .winner-name {
  font-size: 2.5rem;
  color: var(--gold-light);
  font-weight: 900;
  text-shadow: 0 0 30px rgba(233,178,8,0.5);
}

.winner-screen .final-scores {
  margin-top: 40px;
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.confetti {
  position: fixed;
  top: -10px;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
  z-index: 99;
}

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

/* ============ PRESENTER SCREEN ============ */

.presenter-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  min-height: calc(100vh - 65px);
  gap: 0;
}

/* RTL presenter: keep same layout as LTR */
[dir="rtl"] .presenter-layout {
  grid-template-columns: 1fr 340px;
  direction: ltr;
}

[dir="rtl"] .presenter-main {
  direction: rtl;
}

.presenter-main {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(100vh - 65px);
}

.presenter-sidebar {
  background: rgba(0,0,0,0.3);
  border-left: 1px solid rgba(255,255,255,0.08);
  padding: 20px;
  overflow-y: auto;
  max-height: calc(100vh - 65px);
}

/* RTL sidebar stays same position - handled in presenter.html */
[dir="rtl"] .presenter-sidebar {
  direction: rtl;
}

.presenter-question {
  background: var(--primary-light);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid rgba(255,255,255,0.08);
}

.presenter-question h2 {
  font-size: 1.4rem;
  color: var(--gold);
  margin-bottom: 4px;
}

.presenter-question .question-text {
  font-size: 1.1rem;
  color: var(--gray-200);
  line-height: 1.5;
}

.presenter-notes {
  margin-top: 10px;
  padding: 10px;
  background: rgba(243,156,18,0.1);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--orange);
  font-size: 0.85rem;
  color: var(--orange);
}

[dir="rtl"] .presenter-notes {
  border-left: none;
  border-right: 3px solid var(--orange);
}

/* Presenter answer list */
.presenter-answers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.presenter-answer {
  display: flex;
  align-items: center;
  background: var(--primary-light);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  transition: var(--transition);
  gap: 12px;
}

.presenter-answer.revealed {
  border-color: var(--green);
  background: rgba(0,184,148,0.08);
}

.presenter-answer .pa-rank {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--gold);
  flex-shrink: 0;
}

.presenter-answer .pa-info {
  flex: 1;
  min-width: 0;
}

.presenter-answer .pa-answer-text {
  font-weight: 700;
  font-size: 1rem;
  color: var(--white);
}

.presenter-answer .pa-aliases {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 2px;
}

.presenter-answer .pa-points {
  background: var(--gold);
  color: var(--primary);
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.presenter-answer .pa-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.presenter-answer .pa-team-select,
.team-select {
  padding: 6px 10px;
  border-radius: 6px;
  background: #1e2a45;
  border: 1px solid rgba(255,255,255,0.2);
  color: #ffffff;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  min-width: 110px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%23e9b208' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 26px;
}

[dir="rtl"] .presenter-answer .pa-team-select,
[dir="rtl"] .team-select {
  background-position: left 8px center;
  padding-right: 10px;
  padding-left: 26px;
}

.presenter-answer .pa-team-select:focus,
.team-select:focus {
  border-color: var(--gold);
  outline: none;
  box-shadow: 0 0 0 2px rgba(233,178,8,0.2);
}

.presenter-answer .pa-team-select:hover,
.team-select:hover {
  border-color: rgba(255,255,255,0.35);
  background-color: #243250;
}

.presenter-answer .pa-team-select option,
.team-select option {
  background: #1a2340;
  color: #ffffff;
  padding: 8px 10px;
  font-size: 0.85rem;
}

.presenter-answer .pa-team-select option:checked,
.team-select option:checked {
  background: #2a4070;
  color: #f5d442;
}

.presenter-answer .pa-team-select option:hover,
.team-select option:hover {
  background: #2a4070;
}

.reveal-btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.reveal-btn.reveal { background: var(--green); color: var(--white); }
.reveal-btn.reveal:hover { background: var(--green-dark); }
.reveal-btn.unreveal { background: var(--red); color: var(--white); }
.reveal-btn.unreveal:hover { background: var(--red-dark); }

/* Sidebar scores */
.sidebar-scores {
  margin-bottom: 20px;
}

.sidebar-score-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  border: 1px solid rgba(255,255,255,0.06);
}

.sidebar-score-item .team-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sidebar-score-item .team-info {
  flex: 1;
  margin: 0 10px;
}

.sidebar-score-item .team-info .name {
  font-weight: 700;
  font-size: 0.9rem;
}

.sidebar-score-item .score-value {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--gold);
}

.sidebar-score-item .score-adjust {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}

[dir="rtl"] .sidebar-score-item .score-adjust {
  margin-left: 0;
  margin-right: 8px;
}

.score-adj-btn {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: none;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.score-adj-btn.plus { background: rgba(0,184,148,0.3); color: var(--green); }
.score-adj-btn.plus:hover { background: var(--green); color: var(--white); }
.score-adj-btn.minus { background: rgba(231,76,60,0.3); color: var(--red); }
.score-adj-btn.minus:hover { background: var(--red); color: var(--white); }

/* Presenter controls */
.presenter-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.presenter-controls .btn {
  font-size: 0.85rem;
  padding: 10px 16px;
}

/* Round nav */
.round-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.round-nav .round-label {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  min-width: 120px;
  text-align: center;
}

/* Score log */
.score-log {
  margin-top: 16px;
}

.score-log h4 {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.score-log-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 0.8rem;
  color: var(--gray-400);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.score-log-item .log-points {
  font-weight: 800;
  min-width: 40px;
}

.score-log-item .log-points.positive { color: var(--green); }
.score-log-item .log-points.negative { color: var(--red); }

/* ============ MANAGE PAGE ============ */

.manage-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 65px);
  gap: 0;
}

[dir="rtl"] .manage-layout {
  grid-template-columns: 1fr 280px;
}

.manage-sidebar {
  background: rgba(0,0,0,0.3);
  border-right: 1px solid rgba(255,255,255,0.08);
  padding: 20px;
  overflow-y: auto;
  max-height: calc(100vh - 65px);
}

[dir="rtl"] .manage-sidebar {
  border-right: none;
  border-left: 1px solid rgba(255,255,255,0.08);
}

.manage-main {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(100vh - 65px);
}

.question-list-item {
  padding: 12px;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
}

.question-list-item:hover {
  border-color: rgba(233,178,8,0.3);
  background: rgba(255,255,255,0.08);
}

.question-list-item.active {
  border-color: var(--gold);
  background: rgba(233,178,8,0.08);
}

.question-list-item .q-title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.question-list-item .q-meta {
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* Answer editor rows */
.answer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
}

.answer-row .rank-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--gold);
  flex-shrink: 0;
}

.answer-row input {
  flex: 1;
}

.answer-row .points-input {
  width: 70px;
  text-align: center;
}

.answer-row .remove-answer {
  background: rgba(231,76,60,0.2);
  color: var(--red);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.answer-row .remove-answer:hover {
  background: var(--red);
  color: var(--white);
}

/* ============ WAITING SCREEN ============ */

.waiting-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
}

.waiting-screen .pulse-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold) 0%, transparent 70%);
  animation: pulse 2s ease-in-out infinite;
  margin: 0 auto 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.1); opacity: 1; }
}

/* ============ RESPONSIVE ============ */

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

  [dir="rtl"] .presenter-layout {
    grid-template-columns: 1fr;
  }

  .presenter-sidebar {
    border-left: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    max-height: none;
  }

  .manage-layout {
    grid-template-columns: 1fr;
  }

  [dir="rtl"] .manage-layout {
    grid-template-columns: 1fr;
  }

  .display-question h2 {
    font-size: 1.5rem;
  }

  .answer-text {
    font-size: 1.1rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .nav-links { display: none; }

  .sessions-grid {
    grid-template-columns: 1fr;
  }
}

/* ============ FULLSCREEN MODE ============ */

.fullscreen-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 50;
  background: rgba(0,0,0,0.6);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.2rem;
  transition: var(--transition);
}

[dir="rtl"] .fullscreen-btn {
  right: auto;
  left: 20px;
}

.fullscreen-btn:hover {
  background: rgba(233,178,8,0.3);
  border-color: var(--gold);
}

/* ============ SETUP SPECIFIC ============ */

.setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 20px;
}

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

.team-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.team-entry input[type="color"] {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
}

.team-entry input[type="text"] {
  flex: 1;
}

.team-entry .remove-team {
  background: rgba(231,76,60,0.2);
  color: var(--red);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition);
}

.team-entry .remove-team:hover {
  background: var(--red);
  color: var(--white);
}

/* ============ COMPREHENSIVE RTL FIXES ============ */
/* Principle: Keep EXACT same visual layout as English.
   Only text direction changes. No layout flipping. */

/* Toast */
[dir="rtl"] .toast-container {
  right: 20px;
  left: auto;
}

/* Manage layout: same as English */
[dir="rtl"] .manage-layout {
  grid-template-columns: 280px 1fr;
  direction: ltr;
}

[dir="rtl"] .manage-sidebar {
  direction: rtl;
}

[dir="rtl"] .manage-main {
  direction: rtl;
}

/* Responsive */
@media (max-width: 1024px) {
  [dir="rtl"] .presenter-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  [dir="rtl"] .presenter-layout {
    grid-template-columns: 1fr;
  }
  [dir="rtl"] .manage-layout {
    grid-template-columns: 1fr;
  }
}

/* Question selector for setup */
.question-selector {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  padding: 8px;
}

.question-selector-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.question-selector-item:hover {
  background: rgba(255,255,255,0.06);
}

.question-selector-item.selected {
  background: rgba(233,178,8,0.1);
  border: 1px solid rgba(233,178,8,0.3);
}

.question-selector-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
}

/* Drag handle for reorder */
.drag-handle {
  cursor: grab;
  color: var(--gray-500);
  font-size: 1.2rem;
  padding: 4px;
}

.drag-handle:active { cursor: grabbing; }

/* ============ PAUSED OVERLAY ============ */

.paused-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.paused-overlay h2 {
  font-size: 3rem;
  color: var(--orange);
  text-shadow: 0 0 40px rgba(243,156,18,0.4);
  animation: pulse 2s ease-in-out infinite;
}

/* ============ TRANSITION ANIMATION ============ */

.round-transition-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
}

.round-transition-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.round-transition-overlay h2 {
  font-size: 3rem;
  color: var(--gold);
  animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ============ COLOR PICKER OVERRIDES ============ */
input[type="color"] {
  -webkit-appearance: none;
  border: none;
  padding: 0;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 6px;
}

/* ============ SCROLLBAR ============ */

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.25);
}

/* ============ PRINT HIDE ============ */

@media print {
  .presenter-sidebar, .main-header, .presenter-controls { display: none; }
}
