/* ═══════════════════════════════════════════════
   KAHOOT CLONE  -  public/css/app.css
   ═══════════════════════════════════════════════ */

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

:root {
  --k-red:    #e21b3c;
  --k-blue:   #1368ce;
  --k-yellow: #d89e00;
  --k-green:  #26890c;

  --k-red-bg:    #ff3355;
  --k-blue-bg:   #1368ce;
  --k-yellow-bg: #ffa602;
  --k-green-bg:  #26890c;

  --k-purple:    #46178f;
  --k-purple-2:  #7b2fff;
  --k-dark:      #1a1a2e;
  --k-dark-2:    #21213d;
  --k-surface:   rgba(255,255,255,0.08);
  --k-border:    rgba(255,255,255,0.15);

  --k-gold:   #ffd700;
  --k-silver: #c0c0c0;
  --k-bronze: #cd7f32;

  --radius:    8px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-btn: 0 5px 0 rgba(0,0,0,0.35);

  --transition: 0.15s ease;

  --font: 'Nunito', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--k-dark);
  color: #fff;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ─────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }

/* ── Typography ───────────────────────────── */
h1 { font-size: clamp(24px, 4vw, 36px); font-weight: 900; }
h2 { font-size: clamp(20px, 3vw, 28px); font-weight: 800; }
h3 { font-size: clamp(16px, 2vw, 20px); font-weight: 800; }
p  { line-height: 1.6; }

/* ── Layout ───────────────────────────────── */
.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 560px; margin: 0 auto; padding: 0 20px; }
.container-lg { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.muted { color: rgba(255,255,255,0.6); }
.small { font-size: 13px; }

/* ── Screens ──────────────────────────────── */
.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; flex-direction: column; animation: fadeIn 0.3s ease; }

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

/* ── Top Bar ──────────────────────────────── */
.topbar {
  background: var(--k-purple);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,0.4);
}

.logo {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.5px;
  cursor: pointer;
}
.logo .dot { color: var(--k-gold); }

/* ── Buttons ──────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius);
  padding: 12px 22px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  position: relative;
}
.btn:active { transform: translateY(3px) !important; box-shadow: 0 2px 0 rgba(0,0,0,0.35) !important; }
.btn-icon { padding: 10px; border-radius: var(--radius); }

.btn-primary  { background: var(--k-purple-2); color: #fff; box-shadow: 0 5px 0 #4a0d8f; }
.btn-primary:hover  { background: #8f3fff; transform: translateY(-2px); }

.btn-success  { background: #26890c; color: #fff; box-shadow: 0 5px 0 #155705; }
.btn-success:hover  { background: #2ea00e; transform: translateY(-2px); }

.btn-danger   { background: var(--k-red); color: #fff; box-shadow: 0 5px 0 #9e0e25; }
.btn-danger:hover   { background: #f01f42; transform: translateY(-2px); }

.btn-yellow   { background: var(--k-gold); color: #333; box-shadow: 0 5px 0 #b89800; }
.btn-yellow:hover   { background: #ffe233; transform: translateY(-2px); }

.btn-ghost    { background: rgba(255,255,255,0.12); color: #fff; border: 1.5px solid rgba(255,255,255,0.2); box-shadow: none; }
.btn-ghost:hover    { background: rgba(255,255,255,0.2); transform: translateY(-1px); }

.btn-lg  { padding: 16px 32px; font-size: 18px; border-radius: var(--radius-lg); }
.btn-sm  { padding: 8px 14px;  font-size: 13px; border-radius: 6px; }
.btn-xs  { padding: 5px 10px;  font-size: 12px; border-radius: 5px; }
.btn-block { width: 100%; }

.btn:disabled { opacity: 0.45; pointer-events: none; cursor: not-allowed; }

/* ── Inputs ───────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 12px;
  font-weight: 800;
  color: rgba(255,255,255,0.65);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.input {
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: #fff;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.input:focus { border-color: var(--k-purple-2); background: rgba(255,255,255,0.15); }
.input::placeholder { color: rgba(255,255,255,0.3); }
.input-lg { font-size: 32px; text-align: center; letter-spacing: 6px; font-weight: 900; padding: 18px; }
.input-xl { font-size: 48px; text-align: center; letter-spacing: 10px; font-weight: 900; padding: 20px; border-radius: var(--radius-lg); }
.input-white { background: #fff; color: #1a1a2e; border-color: #ddd; font-size: 32px; }
.input-white:focus { border-color: var(--k-purple-2); }

textarea.input { resize: vertical; min-height: 80px; line-height: 1.5; }

select.input { appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='rgba(255,255,255,0.6)' d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 12px; padding-right: 36px; }
select.input option { background: #2d2d5e; }

/* ── Cards ───────────────────────────────── */
.card {
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color 0.2s, background 0.2s;
}
.card:hover { border-color: rgba(255,255,255,0.25); }
.card-white { background: #fff; color: #1a1a2e; }
.card-purple { background: var(--k-purple); border-color: rgba(255,255,255,0.2); }

/* ── Badge ───────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-purple { background: rgba(123,47,255,0.25); color: #c084fc; border: 1px solid rgba(123,47,255,0.35); }
.badge-green  { background: rgba(38,137,12,0.25); color: #4ade80; border: 1px solid rgba(38,137,12,0.35); }
.badge-gold   { background: rgba(255,215,0,0.2); color: var(--k-gold); border: 1px solid rgba(255,215,0,0.35); }
.badge-red    { background: rgba(226,27,60,0.25); color: #ff6b85; border: 1px solid rgba(226,27,60,0.35); }

/* ── Divider ──────────────────────────────── */
.divider { height: 1px; background: rgba(255,255,255,0.1); margin: 16px 0; }

/* ── Alert ────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert-error   { background: rgba(226,27,60,0.2); border: 1.5px solid rgba(226,27,60,0.4); color: #ff8fa0; }
.alert-success { background: rgba(38,137,12,0.2); border: 1.5px solid rgba(38,137,12,0.4); color: #86efac; }

/* ══════════════════════════════════════════════
   HOME PAGE
   ══════════════════════════════════════════════ */
#screen-home {
  background: radial-gradient(ellipse 80% 60% at 50% 0%, #46178f, #1a1a2e 60%);
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 60px);
  padding: 40px 20px;
  text-align: center;
}

.hero-logo {
  font-size: clamp(52px, 10vw, 80px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -2px;
  margin-bottom: 16px;
  animation: float 4s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}

.hero-logo .k  { color: #ff3355; }
.hero-logo .a  { color: #ffa602; }
.hero-logo .h  { color: #26d0ce; }
.hero-logo .o1 { color: #ff3355; }
.hero-logo .o2 { color: #ffa602; }
.hero-logo .t  { color: #26d0ce; }
.hero-logo .ex { color: #7b2fff; }

.hero-sub { font-size: 18px; color: rgba(255,255,255,0.75); margin-bottom: 40px; max-width: 480px; }

.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-bottom: 60px; }

.feature-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; max-width: 600px; width: 100%; }
.feature-card { text-align: center; padding: 24px 16px; }
.feature-icon { font-size: 36px; margin-bottom: 10px; }
.feature-title { font-weight: 800; font-size: 15px; }
.feature-desc { font-size: 13px; color: rgba(255,255,255,0.55); margin-top: 4px; }

/* ══════════════════════════════════════════════
   AUTH PAGE
   ══════════════════════════════════════════════ */
#screen-auth {
  background: radial-gradient(ellipse at top, #46178f 0%, #1a1a2e 70%);
  align-items: center;
  justify-content: center;
}
.auth-card {
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  width: 100%;
  max-width: 420px;
  backdrop-filter: blur(16px);
}
.auth-logo { font-size: 32px; font-weight: 900; text-align: center; margin-bottom: 4px; }
.auth-subtitle { text-align: center; color: rgba(255,255,255,0.6); font-size: 14px; margin-bottom: 28px; }
.auth-tabs { display: flex; margin-bottom: 24px; background: rgba(255,255,255,0.06); border-radius: var(--radius); padding: 4px; }
.auth-tab { flex: 1; padding: 8px; border: none; background: none; color: rgba(255,255,255,0.55); font-family: var(--font); font-size: 14px; font-weight: 800; cursor: pointer; border-radius: 6px; transition: all 0.2s; }
.auth-tab.active { background: var(--k-purple-2); color: #fff; }

/* ══════════════════════════════════════════════
   DASHBOARD
   ══════════════════════════════════════════════ */
#screen-dashboard { background: var(--k-dark); }
.dashboard-body { flex: 1; padding: 24px 20px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title { font-size: 18px; font-weight: 900; }

.quiz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.quiz-card {
  background: var(--k-surface);
  border: 1.5px solid var(--k-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.quiz-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--k-purple-2), #26d0ce); }
.quiz-card:hover { border-color: var(--k-purple-2); transform: translateY(-3px); box-shadow: 0 8px 32px rgba(123,47,255,0.25); }
.quiz-emoji { font-size: 32px; margin-bottom: 10px; }
.quiz-title { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.quiz-meta { font-size: 13px; color: rgba(255,255,255,0.55); margin-bottom: 14px; }
.quiz-actions { display: flex; gap: 8px; }

.stats-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 28px; }
.stat-card { background: var(--k-surface); border: 1.5px solid var(--k-border); border-radius: var(--radius-lg); padding: 16px; text-align: center; }
.stat-num { font-size: 28px; font-weight: 900; color: var(--k-gold); }
.stat-label { font-size: 12px; color: rgba(255,255,255,0.55); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }

/* ══════════════════════════════════════════════
   EDITOR
   ══════════════════════════════════════════════ */
#screen-editor { background: #16163b; }
.editor-layout { display: grid; grid-template-columns: 280px 1fr; gap: 0; flex: 1; height: calc(100vh - 60px); }
.editor-sidebar { background: rgba(0,0,0,0.3); border-right: 1.5px solid rgba(255,255,255,0.08); overflow-y: auto; display: flex; flex-direction: column; }
.editor-main { overflow-y: auto; padding: 24px; }

.sidebar-header { padding: 16px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-meta input { width: 100%; background: none; border: none; color: #fff; font-family: var(--font); font-size: 15px; font-weight: 800; outline: none; padding: 4px 0; }
.sidebar-meta input::placeholder { color: rgba(255,255,255,0.3); }

.q-list { flex: 1; padding: 8px; overflow-y: auto; }
.q-item {
  padding: 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 4px;
  position: relative;
  border: 2px solid transparent;
}
.q-item:hover { background: rgba(255,255,255,0.07); }
.q-item.active { background: rgba(123,47,255,0.25); border-color: var(--k-purple-2); }
.q-item-num { font-size: 11px; font-weight: 800; color: rgba(255,255,255,0.4); text-transform: uppercase; margin-bottom: 3px; }
.q-item-text { font-size: 13px; font-weight: 700; color: #fff; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.q-item-meta { font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 4px; }
.q-item-del { position: absolute; top: 8px; right: 8px; background: rgba(226,27,60,0.2); border: none; color: #ff6b85; cursor: pointer; border-radius: 6px; width: 24px; height: 24px; font-size: 14px; display: none; align-items: center; justify-content: center; transition: all 0.15s; }
.q-item:hover .q-item-del { display: flex; }
.q-item-del:hover { background: var(--k-red); color: #fff; }

.sidebar-footer { padding: 12px; border-top: 1px solid rgba(255,255,255,0.08); }

.editor-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: rgba(255,255,255,0.35); text-align: center; gap: 12px; }
.editor-empty-icon { font-size: 56px; }

.q-editor { max-width: 680px; margin: 0 auto; }
.q-editor-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.q-editor h3 { font-size: 16px; font-weight: 900; color: var(--k-gold); }

.answers-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.answer-editor-box {
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 3px solid transparent;
  transition: all 0.2s;
  position: relative;
}
.answer-editor-box:nth-child(1) { background: rgba(226,27,60,0.15); border-color: rgba(226,27,60,0.3); }
.answer-editor-box:nth-child(2) { background: rgba(19,104,206,0.15); border-color: rgba(19,104,206,0.3); }
.answer-editor-box:nth-child(3) { background: rgba(255,166,2,0.15); border-color: rgba(255,166,2,0.3); }
.answer-editor-box:nth-child(4) { background: rgba(38,137,12,0.15); border-color: rgba(38,137,12,0.3); }
.answer-editor-box.correct:nth-child(1) { border-color: var(--k-red-bg); background: rgba(226,27,60,0.3); }
.answer-editor-box.correct:nth-child(2) { border-color: var(--k-blue-bg); background: rgba(19,104,206,0.3); }
.answer-editor-box.correct:nth-child(3) { border-color: var(--k-yellow-bg); background: rgba(255,166,2,0.3); }
.answer-editor-box.correct:nth-child(4) { border-color: var(--k-green-bg); background: rgba(38,137,12,0.3); }

.answer-editor-box input {
  background: none;
  border: none;
  border-bottom: 2px solid rgba(255,255,255,0.25);
  padding: 6px 4px;
  color: #fff;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  width: 100%;
  outline: none;
  margin-bottom: 10px;
}
.answer-editor-box input:focus { border-bottom-color: #fff; }
.answer-editor-box input::placeholder { color: rgba(255,255,255,0.3); }
.correct-toggle { background: rgba(255,255,255,0.12); border: 2px solid rgba(255,255,255,0.25); border-radius: 6px; padding: 5px 10px; color: rgba(255,255,255,0.7); font-family: var(--font); font-size: 12px; font-weight: 800; cursor: pointer; transition: all 0.2s; }
.correct-toggle.selected { background: #27ae60; border-color: #27ae60; color: #fff; }
.answer-shape { font-size: 20px; float: left; margin-right: 8px; }

/* ══════════════════════════════════════════════
   LOBBY (HOST)
   ══════════════════════════════════════════════ */
#screen-lobby {
  background: radial-gradient(ellipse at 50% 0%, #46178f 0%, #1a1a2e 65%);
  align-items: center;
}
.lobby-wrap { max-width: 720px; width: 100%; margin: 0 auto; padding: 24px 20px; }
.lobby-title { font-size: 28px; font-weight: 900; text-align: center; margin-bottom: 4px; }
.lobby-sub { text-align: center; color: rgba(255,255,255,0.6); margin-bottom: 24px; }

.pin-card {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 24px 40px;
  text-align: center;
  box-shadow: 0 12px 48px rgba(0,0,0,0.4);
  margin-bottom: 20px;
}
.pin-card-label { font-size: 13px; font-weight: 800; color: #666; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 8px; }
.pin-value { font-size: clamp(40px, 8vw, 60px); font-weight: 900; color: #1a1a2e; letter-spacing: 8px; line-height: 1; }
.pin-url { font-size: 14px; color: #888; margin-top: 8px; }

.players-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.players-count { font-size: 15px; font-weight: 800; }

.players-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; max-height: 280px; overflow-y: auto; padding: 2px; margin-bottom: 20px; }
.player-chip {
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.18);
  border-radius: 12px;
  padding: 10px 12px;
  text-align: center;
  font-weight: 800;
  font-size: 13px;
  animation: popIn 0.35s cubic-bezier(.175,.885,.32,1.275);
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.4); }
  to   { opacity: 1; transform: scale(1); }
}
.player-chip-avatar { font-size: 26px; display: block; margin-bottom: 4px; }

/* ══════════════════════════════════════════════
   JOIN SCREEN
   ══════════════════════════════════════════════ */
#screen-join {
  background: radial-gradient(ellipse at 50% 0%, #46178f 0%, #1a1a2e 70%);
  align-items: center;
  justify-content: center;
}
.join-card { max-width: 420px; width: 100%; text-align: center; padding: 24px 20px; }
.join-icon { font-size: 64px; margin-bottom: 16px; }

/* ══════════════════════════════════════════════
   WAITING (Player)
   ══════════════════════════════════════════════ */
#screen-waiting {
  background: radial-gradient(ellipse at 50% 30%, #46178f 0%, #1a1a2e 70%);
  align-items: center;
  justify-content: center;
}
.waiting-card { text-align: center; padding: 24px; }
.waiting-avatar { font-size: 80px; animation: pulse 1.5s ease-in-out infinite; margin-bottom: 16px; display: block; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.waiting-name { font-size: 28px; font-weight: 900; margin-bottom: 8px; }
.waiting-dots span { animation: dotBlink 1.4s ease-in-out infinite; }
.waiting-dots span:nth-child(2) { animation-delay: 0.2s; }
.waiting-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotBlink { 0%, 80%, 100% { opacity: 0; } 40% { opacity: 1; } }

/* ══════════════════════════════════════════════
   QUESTION SCREEN
   ══════════════════════════════════════════════ */
#screen-question { background: #1a1a2e; }
.q-topbar { padding: 14px 20px; display: flex; align-items: center; gap: 12px; background: rgba(0,0,0,0.3); border-bottom: 1px solid rgba(255,255,255,0.08); }
.q-counter { font-size: 14px; font-weight: 800; color: rgba(255,255,255,0.7); white-space: nowrap; }
.q-progress-wrap { flex: 1; height: 8px; background: rgba(255,255,255,0.15); border-radius: 4px; overflow: hidden; }
.q-progress-bar { height: 100%; background: linear-gradient(90deg, var(--k-purple-2), #26d0ce); border-radius: 4px; transition: width 0.5s ease; }

.timer-wrap { position: relative; flex-shrink: 0; }
.timer-svg { transform: rotate(-90deg); }
.timer-track { fill: none; stroke: rgba(255,255,255,0.15); stroke-width: 6; }
.timer-arc { fill: none; stroke: #26d0ce; stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 1s linear, stroke 0.4s; }
.timer-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 900; }

.q-body { flex: 1; padding: 20px; display: flex; flex-direction: column; gap: 16px; max-width: 900px; margin: 0 auto; width: 100%; }

.q-card {
  background: linear-gradient(135deg, var(--k-purple) 0%, #2575fc 100%);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  text-align: center;
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(70,23,143,0.45);
  position: relative;
  overflow: hidden;
}
.q-card::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 70% 30%, rgba(255,255,255,0.12) 0%, transparent 60%); pointer-events: none; }
.q-text { font-size: clamp(18px, 3.5vw, 26px); font-weight: 800; line-height: 1.35; }

.answers-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; flex: 1; }
.ans-btn {
  border: none;
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  font-family: var(--font);
  font-size: clamp(14px, 2.5vw, 18px);
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  transition: all var(--transition);
  box-shadow: 0 6px 0 rgba(0,0,0,0.35);
  position: relative;
  overflow: hidden;
  color: #fff;
}
.ans-btn:hover { transform: translateY(-3px); box-shadow: 0 9px 0 rgba(0,0,0,0.35); }
.ans-btn:active { transform: translateY(2px); box-shadow: 0 3px 0 rgba(0,0,0,0.35); }
.ans-btn:nth-child(1) { background: var(--k-red-bg); }
.ans-btn:nth-child(2) { background: var(--k-blue-bg); }
.ans-btn:nth-child(3) { background: var(--k-yellow-bg); }
.ans-btn:nth-child(4) { background: var(--k-green-bg); }
.ans-shape { font-size: 28px; flex-shrink: 0; }
.ans-btn.selected { opacity: 0.65; }
.ans-btn.correct  { animation: correctFlash 0.5s ease; outline: 4px solid #fff; outline-offset: 2px; }
.ans-btn.wrong    { opacity: 0.25; }
.ans-btn.disabled { pointer-events: none; }
.ans-check { position: absolute; right: 14px; font-size: 24px; }

@keyframes correctFlash { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.04); } }

.q-footer { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; font-size: 13px; color: rgba(255,255,255,0.45); }

/* ══════════════════════════════════════════════
   STATS / RESULT
   ══════════════════════════════════════════════ */
#screen-result {
  background: var(--k-dark);
  align-items: center;
  justify-content: center;
}
.result-wrap { max-width: 560px; width: 100%; text-align: center; padding: 24px 20px; }
.result-emoji { font-size: 80px; animation: bounceIn 0.5s cubic-bezier(.175,.885,.32,1.275); display: block; margin-bottom: 12px; }
@keyframes bounceIn { 0% { transform: scale(0); } 80% { transform: scale(1.1); } 100% { transform: scale(1); } }
.result-title { font-size: 32px; font-weight: 900; margin-bottom: 8px; }
.result-points { font-size: 64px; font-weight: 900; color: var(--k-gold); line-height: 1; margin-bottom: 8px; }
.result-streak { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,215,0,0.15); border: 2px solid rgba(255,215,0,0.4); border-radius: 20px; padding: 6px 16px; color: var(--k-gold); font-weight: 800; font-size: 14px; }

.scoreboard { text-align: left; margin: 20px 0; }
.score-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
.score-row:last-child { border-bottom: none; }
.score-rank { width: 32px; text-align: center; font-size: 18px; }
.score-avatar { font-size: 20px; }
.score-name { flex: 1; font-weight: 700; font-size: 14px; }
.score-bar-track { width: 90px; height: 7px; background: rgba(255,255,255,0.12); border-radius: 4px; overflow: hidden; }
.score-bar-fill { height: 100%; background: linear-gradient(90deg, var(--k-purple-2), #26d0ce); border-radius: 4px; transition: width 1s ease; }
.score-pts { font-weight: 900; color: var(--k-gold); font-size: 14px; min-width: 60px; text-align: right; }

/* ══════════════════════════════════════════════
   PODIUM
   ══════════════════════════════════════════════ */
#screen-podium {
  background: radial-gradient(ellipse at 50% 0%, #46178f 0%, #1a1a2e 65%);
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}
.podium-wrap { max-width: 700px; width: 100%; padding: 24px 20px; text-align: center; }
.podium-trophy { font-size: 64px; display: block; animation: spinIn 0.8s cubic-bezier(.175,.885,.32,1.275); margin-bottom: 8px; }
@keyframes spinIn { 0% { transform: rotate(-30deg) scale(0); opacity: 0; } 100% { transform: rotate(0) scale(1); opacity: 1; } }

.podium-bars { display: flex; align-items: flex-end; justify-content: center; gap: 12px; margin: 32px 0; }
.podium-bar { display: flex; flex-direction: column; align-items: center; animation: riseUp 0.7s ease both; }
.podium-bar:nth-child(1) { animation-delay: 0.3s; }
.podium-bar:nth-child(2) { animation-delay: 0s; }
.podium-bar:nth-child(3) { animation-delay: 0.5s; }
@keyframes riseUp { from { opacity: 0; transform: translateY(50px); } to { opacity: 1; transform: translateY(0); } }
.podium-avatar { font-size: 38px; margin-bottom: 6px; }
.podium-name { font-weight: 900; font-size: 14px; margin-bottom: 6px; max-width: 110px; word-break: break-word; text-align: center; }
.podium-score { font-size: 16px; font-weight: 900; color: var(--k-gold); margin-bottom: 8px; }
.podium-platform { width: 120px; border-radius: 10px 10px 0 0; display: flex; align-items: center; justify-content: center; font-size: 26px; }
.podium-platform.gold   { height: 140px; background: linear-gradient(180deg, #ffd700, #c9a800); box-shadow: 0 -8px 32px rgba(255,215,0,0.3); }
.podium-platform.silver { height: 100px; background: linear-gradient(180deg, #c0c0c0, #888); }
.podium-platform.bronze { height: 70px;  background: linear-gradient(180deg, #cd7f32, #9e5f1e); }

/* ══════════════════════════════════════════════
   HOST QUESTION VIEW (stats bar)
   ══════════════════════════════════════════════ */
.host-stats-bar { display: flex; gap: 8px; align-items: flex-end; justify-content: center; margin-top: 16px; min-height: 80px; }
.stat-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.stat-col-bar { width: 50px; border-radius: 6px 6px 0 0; transition: height 0.8s ease; min-height: 4px; }
.stat-col:nth-child(1) .stat-col-bar { background: var(--k-red-bg); }
.stat-col:nth-child(2) .stat-col-bar { background: var(--k-blue-bg); }
.stat-col:nth-child(3) .stat-col-bar { background: var(--k-yellow-bg); }
.stat-col:nth-child(4) .stat-col-bar { background: var(--k-green-bg); }
.stat-col-label { font-size: 11px; color: rgba(255,255,255,0.6); font-weight: 700; text-align: center; max-width: 60px; }
.stat-col-count { font-size: 20px; font-weight: 900; }

/* ══════════════════════════════════════════════
   CONFETTI
   ══════════════════════════════════════════════ */
.confetti { position: fixed; top: -30px; pointer-events: none; z-index: 9999; font-size: 22px; animation: confettiFall linear forwards; }
@keyframes confettiFall { to { transform: translateY(110vh) rotate(720deg); opacity: 0; } }

/* ══════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════ */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #2d2d5e;
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-weight: 700;
  font-size: 14px;
  max-width: 320px;
  animation: slideInRight 0.3s ease, fadeOut 0.4s ease 2.6s forwards;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.toast-error   { border-color: rgba(226,27,60,0.5); color: #ff8fa0; }
.toast-success { border-color: rgba(38,137,12,0.5); color: #86efac; }
@keyframes slideInRight { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeOut { to { opacity: 0; transform: translateX(30px); } }

/* ══════════════════════════════════════════════
   SPINNER
   ══════════════════════════════════════════════ */
.spinner { display: inline-block; width: 20px; height: 20px; border: 3px solid rgba(255,255,255,0.25); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════ */
@media (max-width: 680px) {
  .answers-grid { grid-template-columns: 1fr; }
  .editor-layout { grid-template-columns: 1fr; }
  .editor-sidebar { display: none; }
  .answers-editor { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .stats-bar { grid-template-columns: 1fr 1fr; }
}

/* ══════════════════════════════════════════════
   VERDADERO / FALSO
   ══════════════════════════════════════════════ */
.tf-btn {
  border: none;
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  font-family: var(--font);
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.08);
  border: 3px solid rgba(255,255,255,0.15);
  transition: all 0.2s;
  text-align: center;
  line-height: 1.4;
}
.tf-btn:hover { border-color: rgba(255,255,255,0.4); color: #fff; }
.tf-selected-true  { background: rgba(19,104,206,0.35); border-color: #1368ce; color: #fff; box-shadow: 0 0 20px rgba(19,104,206,0.4); }
.tf-selected-false { background: rgba(226,27,60,0.35);  border-color: #e21b3c; color: #fff; box-shadow: 0 0 20px rgba(226,27,60,0.4); }

/* ══════════════════════════════════════════════
   IMAGE UPLOAD ZONE
   ══════════════════════════════════════════════ */
.upload-zone {
  display: block;
  border: 2px dashed rgba(255,255,255,0.25);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 12px;
  overflow: hidden;
}
.upload-zone:hover {
  border-color: var(--k-purple-2);
  background: rgba(123,47,255,0.1);
}

/* ══════════════════════════════════════════════
   QUESTION IMAGE
   ══════════════════════════════════════════════ */
#q-image-wrap {
  display: none;
  margin-bottom: 12px;
}
#q-image-wrap img {
  max-height: 200px;
  max-width: 100%;
  border-radius: var(--radius-lg);
  margin: 0 auto;
  display: block;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}

/* ══════════════════════════════════════════════
   ADD QUESTION BUTTONS (sidebar)
   ══════════════════════════════════════════════ */
.add-q-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.add-q-buttons .btn { font-size: 12px; padding: 8px 10px; }

/* ══════════════════════════════════════════════
   HISTORY SCREEN
   ══════════════════════════════════════════════ */
#screen-history { background: var(--k-dark); }

.hist-card {
  background: var(--k-surface);
  border: 1.5px solid var(--k-border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.hist-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--k-purple-2), #26d0ce);
  border-radius: 4px 0 0 4px;
}
.hist-card:hover {
  border-color: var(--k-purple-2);
  background: rgba(123,47,255,0.15);
  transform: translateX(3px);
}
.hist-quiz-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 6px;
}
.hist-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
}
.hist-card-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════
   CREDITS FOOTER
   ══════════════════════════════════════════════ */
.site-footer {
  background: rgba(0,0,0,0.4);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 16px 20px;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  font-weight: 600;
}
.site-footer .brand {
  font-weight: 900;
  color: rgba(255,255,255,0.75);
}
.site-footer .brand span { color: var(--k-gold); }
.site-footer a { color: var(--k-purple-2); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
