/* ==========================================================================
   QuizApp theme - EasyRanna color system (user-supplied).
   Bootstrap 5.3.3 provides grid, cards, forms, alerts and badges; this file
   carries the theme variables, navbar, hero, buttons and quiz components.
   ========================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-orange: #FF9933;
  --primary-green: #28A745;
  --accent-blue: #007BFF;
  --accent-yellow: #FFC107;
  --light-bg: #F8F9FA;
  --dark-text: #2C3E50;
  --white: #FFFFFF;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--dark-text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Navbar */
.navbar {
  background: white;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  padding: 10px 0;
  transition: all 0.3s ease;
}

.navbar.scrolled {
  box-shadow: 0 4px 30px rgba(0,0,0,0.15);
}

.navbar-brand img {
  height: 50px;
  width: auto;
  transition: transform 0.3s ease;
}

.navbar-brand img:hover {
  transform: scale(1.05);
}

.nav-link {
  color: var(--dark-text) !important;
  font-weight: 600;
  margin: 0 10px;
  padding: 8px 16px !important;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-orange), var(--primary-green));
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 80%;
}

.nav-link:hover {
  color: var(--primary-green) !important;
  background: rgba(40, 167, 69, 0.05);
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, var(--primary-green) 0%, var(--accent-blue) 100%);
  color: white;
  padding: 120px 0 80px;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  border-radius: 50%;
  animation: float 20s ease-in-out infinite;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -5%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,153,51,0.2) 0%, transparent 70%);
  border-radius: 50%;
  animation: float 15s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-30px) rotate(5deg); }
}

.hero-content {
  position: relative;
  z-index: 2;
  animation: fadeInUp 1s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.3rem;
  margin-bottom: 35px;
  opacity: 0.95;
  font-weight: 400;
}

.btn-primary-custom {
  background: linear-gradient(135deg, var(--primary-orange), var(--accent-yellow));
  border: none;
  color: white;
  padding: 16px 45px;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 50px;
  transition: all 0.4s ease;
  box-shadow: 0 8px 25px rgba(255, 153, 51, 0.4);
  position: relative;
  overflow: hidden;
}

.btn-primary-custom::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s ease;
}

.btn-primary-custom:hover::before {
  left: 100%;
}

.btn-primary-custom:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(255, 153, 51, 0.5);
}

.hero-image {
  position: relative;
  z-index: 2;
  animation: fadeInRight 1s ease;
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.hero-phone-icon {
  font-size: 20rem;
  opacity: 0.15;
  color: white;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.2));
}

/* Services Section */
.services-section {
  padding: 100px 0;
  background: var(--light-bg);
  position: relative;
}

.section-title {
  font-size: 2.8rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 60px;
  background: linear-gradient(135deg, var(--primary-green), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-orange), var(--primary-green));
  border-radius: 2px;
}

.service-card {
  background: white;
  border-radius: 25px;
  padding: 45px 35px;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  height: 100%;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(40, 167, 69, 0.05), transparent);
  transition: left 0.5s ease;
}

.service-card:hover::before {
  left: 100%;
}

.service-card:hover {
  transform: translateY(-15px) scale(1.02);
  box-shadow: 0 20px 50px rgba(40, 167, 69, 0.2);
  border-color: var(--primary-green);
}

.service-icon {
  font-size: 5rem;
  margin-bottom: 25px;
  display: inline-block;
  transition: all 0.4s ease;
}

.service-card:nth-child(1) .service-icon {
  background: linear-gradient(135deg, var(--primary-orange), #FF6B35);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.service-card:nth-child(2) .service-icon {
  background: linear-gradient(135deg, var(--primary-green), #1E7E34);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.service-card:nth-child(3) .service-icon {
  background: linear-gradient(135deg, var(--accent-blue), #0056b3);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.service-card:hover .service-icon {
  transform: scale(1.15) rotate(5deg);
}

.service-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--dark-text);
}

.service-description {
  color: #666;
  line-height: 1.8;
  font-size: 1rem;
}

/* Features Section */
.features-section {
  padding: 100px 0;
  background: white;
}

.feature-box {
  text-align: center;
  padding: 30px 20px;
  transition: all 0.3s ease;
  border-radius: 15px;
}

.feature-box:hover {
  background: var(--light-bg);
  transform: translateY(-5px);
}

.feature-icon {
  font-size: 3.5rem;
  margin-bottom: 20px;
  display: inline-block;
  transition: all 0.3s ease;
}

.feature-box:nth-child(4n+1) .feature-icon { color: var(--primary-orange); }
.feature-box:nth-child(4n+2) .feature-icon { color: var(--primary-green); }
.feature-box:nth-child(4n+3) .feature-icon { color: var(--accent-blue); }
.feature-box:nth-child(4n+4) .feature-icon { color: var(--accent-yellow); }

.feature-box:hover .feature-icon {
  transform: scale(1.2) rotate(360deg);
}

.feature-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--dark-text);
}

/* Policy Pages */
.policy-section {
  padding: 100px 0;
  min-height: 100vh;
  background: var(--light-bg);
}

.policy-content {
  background: white;
  padding: 60px;
  border-radius: 25px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.policy-title {
  font-size: 2.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-green), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 35px;
  padding-bottom: 25px;
  border-bottom: 4px solid var(--primary-orange);
}

.policy-subtitle {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary-green);
  margin-top: 35px;
  margin-bottom: 18px;
}

.policy-text {
  color: #555;
  line-height: 1.9;
  margin-bottom: 18px;
  font-size: 1.05rem;
}

.policy-text ul {
  margin-top: 15px;
}

.policy-text li {
  margin-bottom: 10px;
}

/* Footer */
.footer {
  background: linear-gradient(135deg, var(--primary-green), var(--accent-blue));
  color: white;
  padding: 60px 0 20px;
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--primary-orange), var(--accent-yellow), var(--primary-orange));
}

.footer-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 25px;
}

.footer-link {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  display: block;
  margin-bottom: 12px;
  transition: all 0.3s ease;
  padding-left: 0;
}

.footer-link:hover {
  color: white;
  padding-left: 10px;
  text-decoration: none;
}

.social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  color: white;
  font-size: 1.3rem;
  margin-right: 12px;
  transition: all 0.3s ease;
}

.social-icons a:hover {
  background: var(--primary-orange);
  transform: translateY(-3px);
}

.copyright {
  text-align: center;
  padding-top: 35px;
  margin-top: 35px;
  border-top: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.8);
}

/* Utilities */
.hidden {
  display: none;
}

/* Animations */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Responsive */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.2rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .policy-content {
    padding: 35px 25px;
  }

  .policy-title {
    font-size: 2rem;
  }

  .hero-phone-icon {
    font-size: 10rem;
  }

  .service-icon {
    font-size: 4rem;
  }
}

/* ==========================================================================
   Quiz components on the EasyRanna palette. Existing markup keeps working:
   .btn/.ghost/.ok, .pill/.live/.wait/.done, .flash, .q/.opt/.good/.bad,
   .avatar, .timer, table, .empty, .grid, .foot, .card h3, .who.
   ========================================================================== */

main {
  padding: 26px 0 40px;
}

h1 {
  font-size: 24px;
  margin: 0 0 4px;
}

h2 {
  font-size: 17px;
  margin: 26px 0 10px;
}

.sub {
  color: #6c757d;
  margin: 0 0 18px;
  font-size: 14px;
}

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.card {
  background: var(--white);
  border: 1px solid #e9ecef;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 4px 16px rgba(44, 62, 80, 0.06);
}

.card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.card p {
  margin: 0 0 12px;
  color: #6c757d;
  font-size: 13.5px;
}

.pill {
  display: inline-block;
  font-size: 11px;
  letter-spacing: .6px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(44, 62, 80, 0.08);
  color: var(--dark-text);
  margin-bottom: 9px;
}

.pill.live {
  background: rgba(40, 167, 69, 0.18);
  color: var(--primary-green);
}

.pill.wait {
  background: rgba(255, 193, 7, 0.22);
  color: #856404;
}

.pill.done {
  background: rgba(220, 53, 69, 0.12);
  color: #a71d2a;
}

.btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary-orange), var(--accent-yellow));
  color: #fff;
  border: 0;
  border-radius: 9px;
  padding: 9px 15px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(1.05);
  color: #fff;
}

.btn.ghost {
  background: transparent;
  border: 1px solid #dee2e6;
  color: var(--dark-text);
}

.btn.ok {
  background: linear-gradient(135deg, var(--primary-green), #1e7e34);
}

form.stack {
  display: grid;
  gap: 12px;
  max-width: 420px;
}

label {
  display: block;
  font-size: 13px;
  color: #6c757d;
  margin-bottom: 5px;
}

.flash {
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 16px;
  font-size: 14px;
  border: 1px solid;
}

.flash.ok {
  background: rgba(40, 167, 69, 0.12);
  border-color: rgba(40, 167, 69, 0.45);
  color: #1e7e34;
}

.flash.err {
  background: rgba(220, 53, 69, 0.10);
  border-color: rgba(220, 53, 69, 0.45);
  color: #a71d2a;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid #e9ecef;
}

th {
  color: #6c757d;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .6px;
}

.foot {
  color: #6c757d;
  font-size: 12px;
  padding: 18px 0 34px;
}

.empty {
  color: #6c757d;
  font-size: 14px;
  padding: 14px;
  border: 1px dashed #dee2e6;
  border-radius: 12px;
  background: #fff;
}

.q {
  background: var(--white);
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 13px;
}

.q .opt {
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid #dee2e6;
  border-radius: 9px;
  padding: 9px 11px;
  margin-top: 8px;
  cursor: pointer;
  background: #fff;
}

.q .opt:hover {
  border-color: var(--primary-green);
}

.timer {
  font-weight: 700;
}

.opt.bad {
  border-color: #dc3545;
  background: rgba(220, 53, 69, 0.06);
}

.opt.good {
  border-color: var(--primary-green);
  background: rgba(40, 167, 69, 0.08);
}

.who {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--dark-text);
  font-size: 13px;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}

/* ==========================================================================
   Signed-in panel shell - layouts/admin + layouts/partials/sidebar.
   Dark slate sidebar, light content, sticky topbar, KPI tiles, .panel cards.
   The sidebar is a Bootstrap responsive offcanvas (static column >=992px,
   slide-in drawer below). The !important + body.admin-body prefix beats
   Bootstrap's own static-mode `background-color: transparent !important`.
   ========================================================================== */

body.admin-body {
  background: #f5f7fa;
  min-height: 100vh;
}

.admin-shell {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}

/* --- Sidebar ------------------------------------------------------------- */
.admin-sidebar {
  --bs-offcanvas-width: 272px;
  --bs-offcanvas-bg: #1f2937;
  --bs-offcanvas-border-color: transparent;
  display: flex;
  flex-direction: column;
  width: 272px;
  padding: 0;
  overflow-y: auto;
  color: #e5e7eb;
}

body.admin-body .admin-sidebar {
  background-color: #1f2937 !important;
}

@media (min-width: 992px) {
  body.admin-body .admin-sidebar {
    position: sticky !important;
    top: 0 !important;
    transform: none !important;
    visibility: visible !important;
    transition: none !important;
    width: 272px !important;
    height: 100vh !important;
    flex: 0 0 272px !important;
    border-right: 1px solid #111827 !important;
    z-index: 1020;
  }
}

/* --- Sidebar brand + nav -------------------------------------------------- */
.admin-brand {
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.admin-brand-link img {
  /* width: 44px; */
  height: 44px;
  object-fit: cover;
  border-radius: 10px;
  background: #fff;
  padding: 3px;
}

.admin-brand-link strong {
  display: block;
  color: #fff;
  font-size: 16px;
  line-height: 1.2;
}

.admin-brand-link small {
  display: block;
  color: #9ca3af;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.admin-nav {
  flex: 1;
  padding: 14px 12px;
}

.admin-nav-group {
  margin: 16px 10px 6px;
  color: #6b7280;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.admin-nav-group:first-child {
  margin-top: 0;
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin-bottom: 2px;
  border-radius: 9px;
  border-left: 3px solid transparent;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.admin-nav a i {
  width: 18px;
  text-align: center;
  font-size: 15px;
  color: #9ca3af;
}

.admin-nav a:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.admin-nav a:hover i {
  color: #fff;
}

.admin-nav a.active {
  background: rgba(40, 167, 69, 0.18);
  border-left-color: var(--primary-orange);
  color: #fff;
}

.admin-nav a.active i {
  color: var(--primary-orange);
}

.admin-brand-foot {
  padding: 14px 22px;
  color: #6b7280;
  font-size: 11px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* --- Topbar + content ----------------------------------------------------- */
.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 24px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 2px 10px rgba(17, 24, 39, 0.05);
}

.admin-page-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark-text);
  margin: 0;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-who {
  background: #f1f3f7;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 4px 14px 4px 5px;
  white-space: nowrap;
}

.admin-toggler {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 9px;
  background: #fff;
  color: var(--dark-text);
  font-size: 1.3rem;
}

.admin-content {
  flex: 1;
  padding: 24px;
}

/* --- KPI tiles + panel cards ---------------------------------------------- */
.stat-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 20px;
}

.stat-card {
  background: #fff;
  border: 1px solid #e9ecef;
  border-top: 3px solid var(--primary-green);
  border-radius: 14px;
  padding: 15px 16px;
  box-shadow: 0 4px 16px rgba(44, 62, 80, 0.06);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-card.accent-orange {
  border-top-color: var(--primary-orange);
}

.stat-card.accent-blue {
  border-top-color: var(--accent-blue);
}

.stat-card.accent-yellow {
  border-top-color: var(--accent-yellow);
}

.stat-label {
  color: #6c757d;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--dark-text);
  line-height: 1.1;
}

.panel {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(44, 62, 80, 0.06);
  margin-bottom: 18px;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid #eef1f4;
  background: #fbfcfd;
}

.panel-header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--dark-text);
}

.panel-body {
  padding: 16px;
}

.panel-body .empty {
  margin: 0;
}

@media (max-width: 575.98px) {
  .admin-content {
    padding: 16px 14px;
  }

  .admin-topbar {
    padding: 10px 14px;
    gap: 10px;
  }

  .admin-who-name {
    display: none;
  }
}

/* ==========================================================================
   Buzzer / judge controls (live rooms) + room code badges.
   ========================================================================== */
.buzz-btn {
  display: block;
  width: 100%;
  max-width: 340px;
  margin: 14px 0 6px;
  padding: 18px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #dc3545, #ff7a45);
  box-shadow: 0 8px 22px rgba(220, 53, 69, 0.35);
  cursor: pointer;
  animation: buzzPulse 1.2s ease-in-out infinite;
}

.buzz-btn:hover {
  color: #fff;
  filter: brightness(1.05);
}

@keyframes buzzPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.buzz-won {
  margin-top: 12px;
  font-weight: 700;
  color: var(--primary-green);
}

.buzz-wait {
  margin-top: 12px;
  color: #6c757d;
}

.buzz-hint {
  margin-top: 8px;
  font-size: 12.5px;
  color: #6c757d;
}

.mark-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.mark-row form {
  flex: 1;
}

.mark-right,
.mark-wrong {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  border: 0;
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
}

.mark-right {
  background: linear-gradient(135deg, var(--primary-green), #1e7e34);
}

.mark-wrong {
  background: linear-gradient(135deg, #dc3545, #a71d2a);
}

.mark-right:hover,
.mark-wrong:hover {
  color: #fff;
  filter: brightness(1.06);
}

.code-badge {
  font-family: Consolas, 'Courier New', monospace;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 3px;
  background: #1f2937;
  color: #fff;
  border-radius: 8px;
  padding: 3px 11px;
  display: inline-block;
}

/* ==========================================================================
   Ranked buzz queue (ground staff: every rank) + podium (players: top 3).
   ========================================================================== */
.queue-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: #4b5563;
  background: #eef1f5;
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

.buzz-queue,
.podium {
  list-style: none;
  margin: 0;
  padding: 0;
}

.buzz-queue {
  max-height: 320px;
  overflow-y: auto;
}

.buzz-queue-row,
.podium-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid #e6e9ee;
  border-left: 4px solid #d7dce3;
  border-radius: 10px;
  margin-bottom: 7px;
  background: #fff;
}

.buzz-queue-row .rank,
.podium-row .rank {
  font-weight: 800;
  font-size: 13px;
  color: #6b7280;
  min-width: 30px;
}

.buzz-queue-row .name,
.podium-row .name {
  flex: 1;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.buzz-queue-row .avatar,
.podium-row .avatar {
  width: 26px;
  height: 26px;
  font-size: 11px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  flex: none;
}

/* The rank currently allowed to answer out loud. */
.buzz-queue-row.is-active,
.podium-row.is-active {
  border-left-color: #ff7a45;
  background: #fff7f3;
  box-shadow: 0 2px 10px rgba(255, 122, 69, 0.18);
}

.podium-row.is-active {
  animation: buzzPulse 1.4s ease-in-out infinite;
}

.buzz-queue-row.is-right,
.podium-row.is-right {
  border-left-color: var(--primary-green);
  background: #f2fbf5;
  opacity: 0.85;
}

.buzz-queue-row.is-wrong,
.podium-row.is-wrong {
  border-left-color: #dc3545;
  background: #fdf3f4;
  opacity: 0.7;
  text-decoration: line-through;
  text-decoration-color: rgba(220, 53, 69, 0.45);
}

/* ==========================================================================
   Pagination (admin + panel listings)
   ========================================================================== */
.pager-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e6e9ee;
}

.pager-info {
  font-size: 13px;
  color: #6b7280;
}

.pager-links {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.pager-links li {
  margin: 0;
}

.pager-links a,
.pager-links span.current {
  display: inline-block;
  min-width: 32px;
  padding: 5px 9px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  border: 1px solid #dfe3e8;
  border-radius: 8px;
  color: #374151;
  background: #fff;
  text-decoration: none;
}

.pager-links a:hover {
  border-color: var(--primary-green);
  color: var(--primary-green);
}

.pager-links span.current {
  background: var(--primary-green);
  border-color: var(--primary-green);
  color: #fff;
}

.pager-links li.disabled span {
  opacity: 0.45;
}

.pager-links li.disabled span.gap {
  border-color: transparent;
  background: transparent;
}

.pager-size {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #6b7280;
}

.pager-size select {
  border: 1px solid #dfe3e8;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 13px;
  background: #fff;
}

.podium-row.is-me {
  outline: 2px solid rgba(31, 41, 55, 0.18);
  outline-offset: -2px;
}

/* ==========================================================================
   Answer sheet (buzzer press times + MCQ answer times), shared by the admin
   and ground winner screens.
   ========================================================================== */
.answer-sheet {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.answer-row {
  border: 1px solid #e6e9ee;
  border-left: 4px solid #d7dce3;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

.answer-row.is-right {
  border-left-color: var(--primary-green);
  background: #f4fbf6;
}

.answer-row.is-wrong {
  border-left-color: #dc3545;
  background: #fdf4f5;
}

.answer-row.is-none {
  background: #fafbfc;
  opacity: 0.75;
}

.answer-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.answer-text {
  font-weight: 600;
  flex: 1 1 220px;
  min-width: 0;
}

.answer-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.answer-note {
  margin: 6px 0 0;
  font-size: 13px;
  color: #6b7280;
}

/* ---- Quiz-level winners podium (admin/quizzes/:id/answers) ------------- */
.podium {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.podium-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 14px;
  text-align: center;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}

.podium-card:first-child {
  border-color: var(--primary-green, #16a34a);
  box-shadow: 0 2px 10px rgba(22, 163, 74, .12);
}

.podium-medal {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
}

.podium-card:nth-child(1) .podium-medal { background: #d4af37; }
.podium-card:nth-child(2) .podium-medal { background: #9ca3af; }
.podium-card:nth-child(3) .podium-medal { background: #b45309; }

.podium-name { font-weight: 600; }

.podium-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 12px;
  color: #6b7280;
}

.podium-score {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-green, #16a34a);
}

/* Compact "or type one" box beside the Password buttons. Leave it empty and
   the account's mobile number is used as the password. */
.password-box {
  width: 120px;
  min-width: 90px;
}

@media (max-width: 768px) {
  .password-box { width: 100px; }
}

/* ---- Ground-staff explanation window ---------------------------------- */
/* After the per-question clock runs out the question stays on every phone
   while the staff explain it, so both sides say so plainly. */
.explain-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  font-size: 14px;
  color: #4b5563;
  background: #f8faf9;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.explain-note.is-waiting {
  color: #92400e;
  background: #fffbeb;
  border-color: #fcd34d;
}

.explain-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 14px 0 0;
  padding: 14px 16px;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 10px;
  text-align: left;
}

.explain-banner strong { display: block; font-size: 16px; }
.explain-banner span { font-size: 14px; }
.explain-banner i { font-size: 22px; line-height: 1.2; }

/* ---- Live results: winner cards + answer detail (player panel) ------------
   Three collapsed cards in a row; tapping one reveals that winner's answer
   sheet in the full-width detail pane below. A player's own card is marked and
   starts open, so a placed player never needs a separate "My result" block. */
.congrats {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 0 0 16px;
  padding: 16px 18px;
  color: #14532d;
  background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
  border: 1px solid #86efac;
  border-left: 5px solid var(--primary-green, #16a34a);
  border-radius: 12px;
}

.congrats.is-effort {
  color: #1e3a8a;
  background: linear-gradient(135deg, #eff6ff, #f8fafc);
  border-color: #bfdbfe;
  border-left-color: #3b82f6;
}

.congrats-icon { font-size: 30px; line-height: 1.1; }
.congrats-text strong { display: block; font-size: 17px; }
.congrats-text span { font-size: 14px; opacity: .85; }

.winner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.winner-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 14px;
  text-align: center;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}

.winner-card:hover { border-color: #cbd5e1; box-shadow: 0 3px 12px rgba(15, 23, 42, .08); }
.winner-card:focus-visible { outline: 2px solid var(--primary-green, #16a34a); outline-offset: 2px; }
.winner-card.is-open { border-color: var(--primary-green, #16a34a); box-shadow: 0 4px 16px rgba(22, 163, 74, .18); }
.winner-card.is-me { background: #f8fffb; }

.winner-chevron { transition: transform .18s ease; }
.winner-card.is-open .winner-chevron { transform: rotate(180deg); }

.winner-cert {
  margin-top: 4px;
  padding: 3px 10px;
  font-size: 12px;
  color: #fff;
  background: var(--primary-green, #16a34a);
  border-radius: 999px;
}

.winner-detail { margin-top: 16px; }
.winner-sheet[hidden] { display: none; }

.winner-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e7eb;
}

.winner-sheet-head h3 { margin: 0; font-size: 16px; font-weight: 700; }

/* ---- Buzzer sound toggle (live room) ------------------------------------ */
.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 6px;
  padding: 3px 10px;
  font-size: 12px;
  color: #166534;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 999px;
  cursor: pointer;
  vertical-align: middle;
}

.sound-toggle:hover { background: #dcfce7; }
.sound-toggle.is-off { color: #6b7280; background: #f3f4f6; border-color: #d1d5db; }

