/* ═══════════════════════════════════════════════════════════════════
   style.css — The Stacey West Podcast Quiz 
   ═══════════════════════════════════════════════════════════════════ */

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

:root {
  --red:      #C41E3A;
  --red-d:    #9B1730;
  --red-l:    #E8293F;
  --white:    #FFFFFF;
  --off:      #F8F4F0;
  --grey:     #E8E0D8;
  --dark:     #1A1A1A;
  --mid:      #4A4A4A;
  --light:    #888888;
  --gold:     #FFD700;
  --green:    #2ECC71;
  --shadow:   0 4px 20px rgba(196,30,58,.15);
  --shadow-d: 0 8px 40px rgba(196,30,58,.25);
  --radius:   16px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body { font-family: 'Lato', sans-serif; background: var(--off); color: var(--dark); min-height: 100vh; }

/* ── HEADER ── */
.header {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-d) 100%);
  color: #fff; position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-d);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; max-width: 640px; margin: 0 auto;
}
.header-logo { display: flex; align-items: center; gap: 10px; }
.header-badge {
  width: 44px; height: 44px; background: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; box-shadow: 0 2px 8px rgba(0,0,0,.3); flex-shrink: 0;
}
.header-title { font-family: 'Oswald', sans-serif; font-size: 20px; font-weight: 700; letter-spacing: .5px; line-height: 1.1; }
.header-sub   { font-size: 11px; opacity: .85; letter-spacing: 1px; text-transform: uppercase; }
.header-nav   { display: flex; align-items: center; gap: 8px; }
.header-btn {
  background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.4);
  color: #fff; padding: 7px 14px; border-radius: 20px; font-size: 12px;
  cursor: pointer; font-family: 'Lato', sans-serif; font-weight: 700; transition: all .2s; white-space: nowrap;
}
.header-btn:hover { background: rgba(255,255,255,.35); }
.header-link {
  color: rgba(255,255,255,.75); font-size: 12px; font-weight: 700;
  text-decoration: none; letter-spacing: .5px; text-transform: uppercase; transition: color .2s;
}
.header-link:hover { color: #fff; }

/* ── LAYOUT ── */
.main { max-width: 640px; margin: 0 auto; padding: 20px 16px 60px; }

/* ── CARD ── */
.card { background: #fff; border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card-title { font-family: 'Oswald', sans-serif; font-size: 22px; font-weight: 700; color: var(--red); margin-bottom: 5px; }
.card-sub   { font-size: 14px; color: var(--light); margin-bottom: 18px; }
.card-hero  {
  background: linear-gradient(135deg, var(--red-d), var(--red));
  color: #fff; padding: 18px 22px; margin-bottom: 12px;
}
.stripe-bar {
  height: 4px; background: repeating-linear-gradient(90deg, var(--red) 0 20px, #fff 20px 40px);
  border-radius: 2px; margin-bottom: 20px;
}

/* ── INPUTS ── */
.input-label { font-size: 13px; font-weight: 700; color: var(--mid); margin-bottom: 5px; display: block; }
.input {
  width: 100%; padding: 13px 16px; border: 2px solid var(--grey); border-radius: 10px;
  font-size: 15px; font-family: 'Lato', sans-serif; outline: none; margin-bottom: 12px;
  background: var(--off); transition: border-color .2s, box-shadow .2s;
}
.input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(196,30,58,.1); background: #fff; }

/* ── BUTTONS ── */
.btn {
  padding: 13px 20px; border-radius: 10px; font-size: 15px; font-weight: 700; cursor: pointer;
  border: none; font-family: 'Lato', sans-serif; transition: all .2s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--red-l), var(--red));
  color: #fff; width: 100%; box-shadow: 0 4px 14px rgba(196,30,58,.35);
}
.btn-primary:hover  { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(196,30,58,.45); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary      { background: var(--grey); color: var(--mid); }
.btn-secondary:hover{ background: #DDD5CC; }
.btn-danger         { background: #FFE8E8; color: var(--red); border: 1px solid var(--red); }
.btn-danger:hover   { background: var(--red); color: #fff; }
.btn-sm  { padding: 8px 14px; font-size: 13px; border-radius: 8px; }
.btn-xs  { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-full{ width: 100%; }

/* ── LOGIN HERO ── */
.login-hero {
  text-align: center; padding: 36px 20px 28px;
  background: linear-gradient(160deg, var(--red-d) 0%, var(--red) 60%, var(--red-l) 100%);
  color: #fff; border-radius: var(--radius); margin-bottom: 20px;
  box-shadow: var(--shadow-d); position: relative; overflow: hidden;
}
.login-hero::before { content:''; position:absolute; top:-30px; right:-30px; width:130px; height:130px; background:rgba(255,255,255,.07); border-radius:50%; }
.login-hero::after  { content:''; position:absolute; bottom:-40px; left:-20px; width:160px; height:160px; background:rgba(255,255,255,.05); border-radius:50%; }
.login-emoji  { font-size: 54px; margin-bottom: 10px; display: block; position: relative; z-index: 1; }
.login-title  { font-family: 'Oswald', sans-serif; font-size: 30px; font-weight: 700; letter-spacing: 1px; position: relative; z-index: 1; }
.login-tagline{ font-size: 13px; opacity: .85; margin-top: 5px; letter-spacing: .5px; position: relative; z-index: 1; }

/* ── ROLE CARDS ── */
.role-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.role-card {
  border: 2px solid var(--grey); border-radius: 12px; padding: 14px 8px;
  text-align: center; cursor: pointer; transition: all .2s; background: #fff;
}
.role-card:hover  { border-color: var(--red); background: #FFF5F7; }
.role-card.active { border-color: var(--red); background: #FFF0F3; box-shadow: 0 0 0 3px rgba(196,30,58,.12); }
.role-emoji { font-size: 26px; margin-bottom: 5px; }
.role-name  { font-family: 'Oswald', sans-serif; font-size: 13px; font-weight: 600; color: var(--dark); }
.role-hint  { font-size: 10px; color: var(--light); margin-top: 2px; }

/* ── TABS ── */
.tabs { display: flex; gap: 4px; background: var(--grey); border-radius: 10px; padding: 4px; margin-bottom: 18px; }
.tab {
  flex: 1; padding: 9px 4px; border-radius: 8px; text-align: center; cursor: pointer;
  font-size: 12px; font-weight: 700; transition: all .2s; color: var(--mid);
  border: none; background: none; font-family: 'Lato', sans-serif;
}
.tab.active { background: #fff; color: var(--red); box-shadow: 0 1px 6px rgba(0,0,0,.1); }

/* ── QUESTION ── */
.q-round { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--red); font-weight: 700; margin-bottom: 4px; }
.q-meta  { font-size: 13px; color: var(--light); margin-bottom: 10px; }
.q-text  { font-family: 'Oswald', sans-serif; font-size: 21px; font-weight: 600; line-height: 1.3; margin-bottom: 22px; color: var(--dark); }
.options { display: flex; flex-direction: column; gap: 10px; }
.option  {
  padding: 14px 16px; border: 2px solid var(--grey); border-radius: 12px;
  cursor: pointer; font-size: 15px; transition: all .2s; background: #fff;
  text-align: left; font-family: 'Lato', sans-serif; font-weight: 700;
  display: flex; align-items: center; gap: 12px; width: 100%;
}
.option:hover:not([disabled]) { border-color: var(--red); background: #FFF5F7; }
.option.selected { border-color: var(--red);   background: var(--red);   color: #fff; }
.option.correct  { border-color: var(--green);  background: var(--green); color: #fff; }
.option.wrong    { border-color: #E74C3C;        background: #E74C3C;      color: #fff; }
.option[disabled]{ cursor: not-allowed; opacity: .85; }
.option-letter   {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid currentColor;
  display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0;
}

/* ── HOST-SIDE QUESTION OPTIONS ── */
.host-options { background: var(--off); border-radius: 10px; padding: 12px; margin-bottom: 16px; }
.host-option {
  padding: 7px 0; font-size: 14px; display: flex; gap: 8px;
  color: var(--dark); align-items: center;
}
.host-option-correct { color: var(--green); font-weight: 700; }
.opt-letter { font-family: 'Oswald', sans-serif; font-size: 12px; color: var(--light); width: 18px; flex-shrink: 0; }

/* ── PROGRESS ── */
.progress-wrap  { margin-bottom: 20px; }
.progress-bar   { height: 6px; background: var(--grey); border-radius: 3px; overflow: hidden; }
.progress-fill  { height: 100%; background: linear-gradient(90deg, var(--red), var(--red-l)); border-radius: 3px; transition: width .5s ease; }
.progress-label { font-size: 12px; color: var(--light); margin-bottom: 6px; display: flex; justify-content: space-between; }
.answer-progress { background: var(--off); border-radius: 10px; padding: 12px; margin-bottom: 16px; }
.ap-label { font-size: 13px; font-weight: 700; color: var(--mid); margin-bottom: 8px; }

/* ── LEADERBOARD ── */
.lb-row  {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 10px; margin-bottom: 8px; background: var(--off);
}
.lb-row.mine { background: #FFF0F3; border: 1px solid rgba(196,30,58,.2); }
.lb-rank {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.rank-gold   { background: var(--gold); color: #7A6000; }
.rank-silver { background: #C0C0C0; color: #444; }
.rank-bronze { background: #CD7F32; color: #fff; }
.rank-other  { background: var(--grey); color: var(--mid); }
.lb-info   { flex: 1; }
.lb-name   { font-weight: 700; font-size: 15px; }
.lb-detail { font-size: 11px; color: var(--light); }
.lb-score  { font-family: 'Oswald', sans-serif; font-size: 22px; font-weight: 700; color: var(--red); }
.you-tag   { font-size: 12px; color: var(--red); font-weight: 400; }
.tie-tag   { font-size: 11px; background: #f39c12; color: #000; font-weight: 700; padding: 1px 5px; border-radius: 4px; letter-spacing: .5px; vertical-align: middle; }

/* ── HOST STATS ── */
.stats-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 16px; }
.stat-card { background: #fff; border-radius: 14px; padding: 14px; text-align: center; box-shadow: var(--shadow); }
.stat-num  { font-family: 'Oswald', sans-serif; font-size: 34px; font-weight: 700; color: var(--red); line-height: 1; }
.stat-lbl  { font-size: 11px; color: var(--light); text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }

/* ── ADMIN ── */
.round-heading { font-family: 'Oswald', sans-serif; font-size: 16px; color: var(--red); margin: 14px 0 8px; }
.q-item        { background: var(--off); border-radius: 10px; padding: 13px; margin-bottom: 9px; border-left: 3px solid var(--red); }
.q-item-inner  { display: flex; align-items: flex-start; gap: 8px; }
.q-item-body   { flex: 1; min-width: 0; }
.q-item-text   { font-weight: 700; font-size: 14px; margin-bottom: 3px; word-break: break-word; }
.q-item-meta   { font-size: 12px; color: var(--light); word-break: break-word; }
.option-input-row { display: flex; gap: 8px; margin-bottom: 8px; }
.option-input-row .input { margin-bottom: 0; }

@media (max-width: 500px) {
  .q-item-inner { flex-wrap: wrap; }
  .q-item-inner > div:last-child { width: 100%; justify-content: flex-end; }
  .option { font-size: 14px; padding: 12px 14px; }
  .btn-sm { min-height: 36px; }
}

/* ── ALERTS ── */
.alert       { padding: 12px 16px; border-radius: 10px; font-size: 14px; margin-bottom: 14px; }
.alert-red   { background: #FFE8E8; color: var(--red-d); border: 1px solid rgba(196,30,58,.2); }
.alert-green { background: #E8FFE8; color: #1A6A1A; border: 1px solid rgba(46,204,113,.3); }
.mt { margin-top: 16px; }

/* ── RESULTS / ANSWERS ── */
.result-row  { padding: 10px 14px; border-radius: 8px; margin-bottom: 6px; display: flex; align-items: flex-start; gap: 10px; }
.result-ok   { background: #E8FFE8; border: 1px solid rgba(46,204,113,.4); }
.result-bad  { background: #FFE8E8; border: 1px solid rgba(196,30,58,.2); }
.result-icon { font-size: 18px; flex-shrink: 0; }
.result-body { flex: 1; }
.result-q    { font-weight: 700; font-size: 13px; }
.result-a    { font-size: 12px; color: var(--mid); margin-top: 2px; }

/* ── PLAYER WAITING / FINISH ── */
.text-center  { text-align: center; }
.pad-xl       { padding: 40px 20px; }
.waiting-icon { font-size: 52px; margin-bottom: 12px; }
.waiting-title{ font-family: 'Oswald', sans-serif; font-size: 22px; color: var(--red); font-weight: 700; }
.waiting-sub  { font-size: 14px; color: var(--light); margin-top: 6px; }
.team-badge   { margin-top: 20px; padding: 12px 16px; background: var(--off); border-radius: 10px; font-size: 13px; color: var(--mid); }
.team-badge strong { color: var(--red); }
.result-title   { font-family: 'Oswald', sans-serif; font-size: 24px; color: var(--red); font-weight: 700; }
.result-score   { font-size: 15px; color: var(--mid); margin: 8px 0 20px; }
.result-score strong { color: var(--red); font-size: 22px; }
.result-verdict { padding: 14px; background: var(--off); border-radius: 12px; font-family: 'Oswald', sans-serif; font-size: 18px; color: var(--dark); }

/* ── WINNER BLOCK ── */
.winner-block  { text-align: center; padding: 20px 0; }
.winner-trophy { font-size: 52px; }
.winner-name   { font-family: 'Oswald', sans-serif; font-size: 24px; color: var(--red); font-weight: 700; margin-top: 6px; }
.winner-sub    { font-size: 15px; color: var(--mid); margin-top: 4px; }

/* ── SETTINGS ── */
.pw-display { background: var(--off); border-radius: 10px; padding: 14px; margin-bottom: 14px; font-size: 14px; line-height: 2.2; }
.pw-display code { background: var(--grey); padding: 2px 8px; border-radius: 4px; font-size: 13px; }
.section-title { font-family: 'Oswald', sans-serif; font-size: 17px; color: var(--red); margin-bottom: 10px; }

/* ── MISC ── */
.empty-state { text-align: center; padding: 40px 20px; color: var(--light); }
.empty-icon  { font-size: 48px; margin-bottom: 12px; }
.divider     { height: 1px; background: var(--grey); margin: 14px 0; }
.hidden      { display: none !important; }
.pulse       { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.45} }

/* ── POLL BAR ANIMATION ── */
.poll-bar-animate {
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── QUIZ TIMER INLINE (player) ── */
.quiz-timer-inline {
  display: flex; align-items: center; justify-content: space-between;
  background: #1e232b; border: 1px solid #333; border-radius: 8px;
  padding: 8px 14px; margin-bottom: 12px;
}
.quiz-timer-inline-lbl { font-size: 12px; color: #888; text-transform: uppercase; letter-spacing: .5px; }
.quiz-timer-inline-num { font-family: 'Oswald', sans-serif; font-size: 26px; font-weight: 700; color: var(--red); }
.quiz-timer-urgent .quiz-timer-inline-num { color: #ffb020; }
.quiz-timer-inline-sub { font-size: 13px; color: #888; margin-bottom: 10px; text-align: center; }

/* ── CONFETTI ── */
.confetti-wrap { position: fixed; top:0; left:0; right:0; bottom:0; pointer-events:none; z-index:999; overflow:hidden; }
.cf { position:absolute; top:-12px; border-radius:2px; animation: cffall linear forwards; }
@keyframes cffall { to { transform: translateY(110vh) rotate(720deg); opacity: 0; } }
