/* PEN GK Champion Web Studio — Media-Query Responsive Web Theme */
:root {
  --bg-canvas: #eef4ff;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --ink-primary: #0f172a;
  --ink-secondary: #475569;
  --brand-blue: #1d4ed8;
  --brand-indigo: #4f46e5;
  --brand-cyan: #0891b2;
  --brand-amber: #d97706;
  --brand-emerald: #059669;
  --brand-rose: #e11d48;
  --line-soft: #cbd5e1;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 8px 24px rgba(29, 78, 216, 0.08);
}

body.dark-mode {
  --bg-canvas: #060b19;
  --bg-surface: #0f172a;
  --bg-subtle: #1e293b;
  --ink-primary: #f8fafc;
  --ink-secondary: #94a3b8;
  --line-soft: #334155;
  --shadow-lg: 0 20px 44px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 10px 26px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  background:
    radial-gradient(circle at 8% 4%, rgba(29, 78, 216, 0.14), transparent 32%),
    radial-gradient(circle at 92% 8%, rgba(217, 119, 6, 0.12), transparent 32%),
    radial-gradient(circle at 50% 100%, rgba(5, 150, 105, 0.11), transparent 38%),
    var(--bg-canvas);
  color: var(--ink-primary);
  min-height: 100vh;
}

.ml-text {
  font-family: "Noto Sans Malayalam", "Plus Jakarta Sans", sans-serif;
}

/* Full-Width Web Header */
.web-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

body.dark-mode .web-header {
  background: rgba(15, 23, 42, 0.9);
}

.web-header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.web-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.web-logo-box {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1d4ed8, #4f46e5, #0891b2);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(29, 78, 216, 0.28);
}

.web-brand-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.web-brand-sub {
  font-size: 12px;
  color: var(--ink-secondary);
  font-weight: 600;
}

.web-nav-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.web-nav-btn {
  background: transparent;
  border: 0;
  color: var(--ink-secondary);
  font-size: 13.5px;
  font-weight: 700;
  padding: 9px 15px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.web-nav-btn:hover {
  background: var(--bg-subtle);
  color: var(--ink-primary);
}

.web-nav-btn.active {
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-indigo));
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(29, 78, 216, 0.25);
}

.web-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.score-badge {
  background: linear-gradient(135deg, rgba(29, 78, 216, 0.12), rgba(8, 145, 178, 0.14));
  color: var(--brand-blue);
  border: 1px solid rgba(29, 78, 216, 0.25);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
}

body.dark-mode .score-badge {
  color: #93c5fd;
}

.tool-btn {
  background: var(--bg-subtle);
  color: var(--ink-primary);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.mobile-menu-toggle {
  display: none;
}

/* Main Website Container */
.web-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 24px 56px;
}

.tab-panel {
  display: none;
  animation: fadeInUp 0.25s ease;
}

.tab-panel.active {
  display: block;
}

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

/* Website Hero Banner */
.web-hero {
  background: linear-gradient(125deg, #1e3a8a 0%, #1d4ed8 42%, #6d28d9 82%, #be185d 100%);
  color: #ffffff;
  border-radius: var(--radius-xl);
  padding: 36px 34px;
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 28px;
  align-items: center;
  margin-bottom: 24px;
}

.hero-kicker {
  display: inline-block;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.6px;
}

.web-hero h1 {
  margin: 14px 0 10px;
  font-size: 40px;
  line-height: 1.12;
  font-weight: 800;
}

.web-hero p {
  margin: 0 0 22px;
  font-size: 15.5px;
  color: rgba(255, 255, 255, 0.92);
  max-width: 620px;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-hero-main {
  background: #facc15;
  color: #0f172a;
  border: 0;
  border-radius: 13px;
  padding: 13px 22px;
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.btn-hero-ghost {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 13px;
  padding: 13px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.hero-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.kpi-tile {
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 18px;
  padding: 16px 18px;
}

.kpi-tile span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.9;
}

.kpi-tile strong {
  display: block;
  font-size: 24px;
  font-weight: 800;
  margin-top: 4px;
}

/* Multi-Column Web Grids */
.two-col-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.quiz-workspace-grid {
  display: grid;
  grid-template-columns: 1.75fr 1fr;
  gap: 22px;
  align-items: start;
}

.surface-card {
  background: var(--bg-surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
}

.surface-card h2 {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 800;
}

.surface-card h3 {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 800;
}

.muted {
  color: var(--ink-secondary);
  font-size: 13.5px;
  line-height: 1.5;
}

/* Question Picture Frame */
.question-media-card {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  background: var(--bg-subtle);
  margin: 14px 0 18px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.question-media-card img {
  display: block;
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.question-media-caption {
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-secondary);
  background: var(--bg-surface);
}

/* Buttons & Chips */
.btn-web {
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-indigo));
  color: #ffffff;
  border: 0;
  border-radius: 12px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.btn-web:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.btn-web-alt {
  background: var(--bg-subtle);
  color: var(--ink-primary);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 11px 16px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.chip-pill {
  background: var(--bg-subtle);
  color: var(--ink-primary);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.chip-pill.active {
  background: var(--brand-blue);
  color: #ffffff;
  border-color: var(--brand-blue);
}

.bar-track {
  height: 10px;
  background: var(--bg-subtle);
  border-radius: 999px;
  overflow: hidden;
  margin: 10px 0;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-cyan));
  transition: width 0.25s ease;
}

#timerFill {
  background: linear-gradient(90deg, #10b981, #f59e0b, #ef4444);
}

.lifeline-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--bg-subtle);
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
}

.streak-tag {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #ffffff;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
}

.options-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.choice-btn {
  text-align: left;
  background: var(--bg-subtle);
  color: var(--ink-primary);
  border: 1.5px solid var(--line-soft);
  border-radius: 14px;
  padding: 15px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.choice-btn:hover:not(:disabled) {
  border-color: var(--brand-blue);
  background: rgba(29, 78, 216, 0.06);
}

.choice-btn.eliminated {
  opacity: 0.25;
  text-decoration: line-through;
  pointer-events: none;
}

.choice-btn.correct {
  background: var(--brand-emerald) !important;
  color: #ffffff !important;
  border-color: var(--brand-emerald) !important;
}

.choice-btn.wrong {
  background: var(--brand-rose) !important;
  color: #ffffff !important;
  border-color: var(--brand-rose) !important;
}

input, select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  font-size: 14px;
  background: var(--bg-subtle);
  color: var(--ink-primary);
  margin: 6px 0 14px;
}

/* Podium & Leaderboard Table */
.podium-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 16px 0 22px;
  align-items: end;
}

.podium-box {
  background: var(--bg-subtle);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: 18px 14px;
  text-align: center;
}

.podium-box.first {
  background: linear-gradient(180deg, rgba(250, 204, 21, 0.22), var(--bg-subtle));
  border-color: #eab308;
  padding-top: 26px;
}

.podium-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--brand-blue);
  margin: 8px auto;
  display: block;
}

.podium-box.first .podium-avatar {
  width: 66px;
  height: 66px;
  border-color: #eab308;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  font-size: 14px;
}

th {
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  font-weight: 800;
}

.mini-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
}

.flash-stage {
  background: linear-gradient(135deg, rgba(29, 78, 216, 0.08), rgba(109, 40, 217, 0.08));
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: 28px 22px;
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 19px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 14px;
}

.milestone-pill {
  display: inline-block;
  background: rgba(217, 119, 6, 0.14);
  color: #b45309;
  border: 1px solid rgba(217, 119, 6, 0.35);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 700;
  margin: 5px;
}

body.dark-mode .milestone-pill {
  color: #fcd34d;
}

.milestone-pill.locked {
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  border-color: var(--line-soft);
  opacity: 0.6;
}

.web-footer {
  max-width: 1320px;
  margin: 24px auto 0;
  padding: 18px 24px 36px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--ink-secondary);
}

/* MEDIA QUERIES FOR TABLETS & MOBILE DEVICES */
@media (max-width: 1024px) {
  .web-hero {
    grid-template-columns: 1fr;
    padding: 28px 24px;
  }
  .web-hero h1 {
    font-size: 32px;
  }
  .quiz-workspace-grid {
    grid-template-columns: 1fr;
  }
  .two-col-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .mobile-menu-toggle {
    display: inline-flex;
  }
  .web-nav-bar {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--line-soft);
    padding: 12px 20px;
    flex-direction: column;
    align-items: stretch;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.14);
  }
  .web-nav-bar.mobile-open {
    display: flex;
  }
}

@media (max-width: 600px) {
  .web-container {
    padding: 16px 14px 40px;
  }
  .web-hero h1 {
    font-size: 26px;
  }
  .hero-kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
  .options-2col {
    grid-template-columns: 1fr;
  }
  .podium-row {
    grid-template-columns: 1fr;
  }
  .question-media-card img {
    height: 185px;
  }
}
