body
{
   background-color: #FFFFFF;
   color: #000000;
   font-family: Arial;
   font-weight: normal;
   font-size: 13px;
   line-height: 1.1875;
   margin: 0;
   padding: 0;
}
  /* ─── RESET & VARIABLES ────────────────────────────────────── */
  :root {
    --bg:        #0e0c06;
    --panel:     rgba(30,26,12,0.97);
    --panel2:    rgba(20,18,8,0.97);
    --ivory:     #f0e8cc;
    --gold:      #c9a030;
    --gold-l:    #e8c050;
    --green:     #2ecc71;
    --red:       #e74c3c;
    --muted:     rgba(240,232,204,0.4);
    --border:    rgba(201,160,48,0.22);
    --r:         10px;
  }
  *, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

  /* ─── BODY / BACKGROUND ─────────────────────────────────────── */
  html { font-size: 18px; }          /* base: 1rem = 18px on all screens */
  body {
    background-color: var(--bg);
    background-image: url("data:image/svg+xml,%3Csvg width='64' height='44' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='64' height='44' fill='%230e0c06'/%3E%3Crect x='2' y='2' width='28' height='18' fill='%23503818' rx='1'/%3E%3Crect x='34' y='2' width='28' height='18' fill='%23443010' rx='1'/%3E%3Crect x='0' y='24' width='14' height='18' fill='%23584020' rx='1'/%3E%3Crect x='18' y='24' width='28' height='18' fill='%23503818' rx='1'/%3E%3Crect x='50' y='24' width='14' height='18' fill='%23483414' rx='1'/%3E%3C/svg%3E");
    background-size: 64px 44px;
    min-height: 100dvh;
    font-family: 'Crimson Pro', Georgia, serif;
    color: var(--ivory);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 10px 24px;
    position: relative;
    overflow-x: hidden;
  }
  body::before {
    content: ''; position: fixed; inset: 0; pointer-events: none;
    background: radial-gradient(ellipse at 50% 30%, rgba(0,0,0,0) 0%, rgba(0,0,0,0.78) 100%);
  }

  /* ─── CONTAINER ─────────────────────────────────────────────── */
  .container { width: 100%; max-width: 600px; position: relative; z-index: 1; }

  /* ─── HEADER ────────────────────────────────────────────────── */
  .header { text-align: center; padding: 10px 0 8px; animation: fadeDown 0.7s ease both; }
  .header .subtitle {
    font-size: 0.6rem; letter-spacing: 7px; text-transform: uppercase;
    color: var(--gold); margin-bottom: 4px; font-weight: 300;
  }
  .header h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.9rem, 8vw, 2.8rem);
    font-weight: 700; color: var(--ivory); line-height: 1.1;
    text-shadow: 0 2px 16px rgba(0,0,0,0.6);
  }
  .header h1 em { color: var(--gold); font-style: italic; }
  .header .divider {
    display: flex; align-items: center; gap: 12px;
    margin: 8px auto 0; justify-content: center; max-width: 200px;
  }
  .header .divider::before,
  .header .divider::after {
    content: ''; flex: 1; height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
  }
  .header .divider span { color: var(--gold); font-size: 12px; }

  /* ─── HS BAR ────────────────────────────────────────────────── */
  .hs-bar {
    background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--r); margin-bottom: 10px;
    position: relative; overflow: hidden;
    animation: fadeDown 0.6s 0.05s ease both;
  }
  .hs-bar::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
  }
  .hs-bar-inner { display: flex; align-items: center; padding: 10px 14px; gap: 10px; }
  .hs-bar-trophy { font-size: 1.5rem; }
  .hs-bar-center { flex: 1; min-width: 0; }
  .hs-bar-label { font-size: 0.55rem; letter-spacing: 4px; text-transform: uppercase; color: rgba(201,160,48,0.5); display: block; }
  .hs-bar-name-display { font-family: 'Playfair Display', serif; font-size: 0.85rem; color: var(--muted); font-style: italic; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hs-bar-right { text-align: right; flex-shrink: 0; }
  .hs-bar-val {
    font-family: 'Playfair Display', serif; font-size: 1.9rem; font-weight: 700;
    background: linear-gradient(135deg, var(--gold), var(--gold-l), #fff8d0, var(--gold));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    line-height: 1; display: block;
  }
  .hs-bar-pts { font-size: 0.5rem; letter-spacing: 3px; text-transform: uppercase; color: rgba(201,160,48,0.4); display: block; }
  @keyframes hsShine { 0%{background-position:200% center} 100%{background-position:-200% center} }
  .hs-bar-val.new-record {
    background: linear-gradient(90deg, var(--gold), #fff8d0, var(--gold-l), var(--gold));
    background-size: 200% auto;
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    animation: hsShine 1.5s linear infinite;
  }
  .visitor-strip {
    display: flex; align-items: center; gap: 5px;
    padding: 6px 14px 8px; border-top: 1px solid rgba(201,160,48,0.1); justify-content: center;
  }
  #visitor-count { font-family: 'Playfair Display', serif; font-size: 0.85rem; color: var(--gold-l); }
  .visitor-label, .visitor-icon { font-size: 0.6rem; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }

  /* ─── START SCREEN ──────────────────────────────────────────── */
  .start-compact-card {
    background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--r); padding: 16px;
    display: flex; flex-direction: column; align-items: center;
    gap: 14px; position: relative; overflow: hidden;
    animation: fadeUp 0.5s ease both;
    text-align: center;
  }
  .start-compact-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
  }
  .start-info { color: var(--muted); font-size: 0.9rem; line-height: 1.6; }
  .restart-btn {
    width: 100%; padding: 16px;
    background: linear-gradient(135deg, var(--gold), var(--gold-l));
    border: none; border-radius: var(--r); color: #0e0c06;
    font-family: 'Playfair Display', serif; font-size: 1.2rem;
    font-weight: 700; letter-spacing: 1px; cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    touch-action: manipulation;
  }
  .restart-btn:active { transform: scale(0.97); }

  /* ─── SCOREBAR ──────────────────────────────────────────────── */
  .scorebar {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--r); padding: 8px 14px;
    margin-bottom: 8px; gap: 8px;
    animation: fadeDown 0.7s 0.1s ease both;
  }
  .scorebar .stat { text-align: center; flex-shrink: 0; }
  .scorebar .stat .val { font-family: 'Playfair Display', serif; font-size: 1.5rem; color: var(--gold); line-height: 1; }
  .scorebar .stat .lbl { font-size: 0.5rem; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); margin-top: 1px; }
  .progress-track { flex: 1; height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden; }
  .progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-l)); border-radius: 2px; transition: width 0.5s ease; }
  .lives-display { font-size: 1.2rem; letter-spacing: 1px; }

  /* ─── TIMER BAR ─────────────────────────────────────────────── */
  .timer-bar-wrap { margin-bottom: 8px; }
  .timer-bar-track { height: 6px; background: rgba(255,255,255,0.07); border-radius: 3px; overflow: hidden; }
  .timer-bar-fill { height: 100%; border-radius: 3px; transition: width 0.1s linear, background 0.4s ease; }
  .timer-meta { display: flex; justify-content: space-between; margin-top: 4px; }
  .timer-meta .timer-val { font-family: 'Playfair Display', serif; font-size: 0.95rem; color: var(--gold); transition: color 0.3s; }
  .timer-meta .pts-preview { font-size: 0.82rem; color: var(--muted); }
  .timer-meta .pts-preview span { color: var(--gold-l); font-weight: 600; }

  /* ─── QUESTION CARD ─────────────────────────────────────────── */
  .card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 18px 16px 16px;
    margin-bottom: 8px;
    position: relative; overflow: hidden;
    animation: fadeUp 0.4s ease both;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
  }
  .card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
  }
  .question-num {
    font-size: 0.55rem; letter-spacing: 4px; text-transform: uppercase;
    color: var(--gold); margin-bottom: 10px; opacity: 0.8;
  }
  .question-text {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.2rem, 4.8vw, 1.55rem);
    line-height: 1.5; color: var(--ivory); font-weight: 400;
  }

  /* ─── ANSWER OPTIONS ────────────────────────────────────────── */
  .options {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 8px; animation: fadeUp 0.4s 0.08s ease both;
  }
  .option-btn {
    background: var(--panel2); border: 1px solid var(--border);
    border-radius: var(--r); padding: 14px 12px;
    color: var(--ivory); font-family: 'Crimson Pro', serif;
    font-size: clamp(1rem, 3.8vw, 1.15rem);
    cursor: pointer; text-align: left;
    display: flex; align-items: flex-start; gap: 10px;
    line-height: 1.4; width: 100%;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  }
  .option-btn:active { transform: scale(0.97); }
  .option-btn .letter {
    font-family: 'Playfair Display', serif; font-size: 0.85rem;
    color: var(--gold); font-weight: 700; min-width: 18px;
    padding-top: 2px; flex-shrink: 0;
  }
  .option-btn.correct { background: rgba(46,204,113,0.18); border-color: var(--green); color: #aff0c8; }
  .option-btn.correct .letter { color: var(--green); }
  .option-btn.wrong   { background: rgba(231,76,60,0.18); border-color: var(--red); color: #faa; }
  .option-btn.wrong .letter { color: var(--red); }
  .option-btn:disabled { cursor: default; transform: none !important; }
  @keyframes pulse-correct { 0%{box-shadow:0 0 0 0 rgba(46,204,113,0.6)} 70%{box-shadow:0 0 0 16px rgba(46,204,113,0)} 100%{box-shadow:0 0 0 0 rgba(46,204,113,0)} }
  @keyframes shake-wrong { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-8px)} 75%{transform:translateX(8px)} }
  .option-btn.correct.anim { animation: pulse-correct 0.55s ease forwards; }
  .option-btn.wrong.anim   { animation: shake-wrong 0.35s ease forwards; }

  /* ─── POINTS POPUP ──────────────────────────────────────────── */
  .pts-popup { position: fixed; top: 45%; left: 50%; transform: translate(-50%,-50%); font-family: 'Playfair Display', serif; font-size: 2.8rem; font-weight: 700; pointer-events: none; z-index: 999; opacity: 0; }
  .pts-popup.show-correct { animation: ptsPop 0.9s ease forwards; color: #aff0c8; text-shadow: 0 0 20px rgba(46,204,113,0.8); }
  .pts-popup.show-wrong   { animation: ptsPopWrong 0.7s ease forwards; color: #faa; }
  @keyframes ptsPop { 0%{opacity:0;transform:translate(-50%,-20px) scale(0.5)} 20%{opacity:1;transform:translate(-50%,-70px) scale(1.2)} 70%{opacity:1;transform:translate(-50%,-90px)} 100%{opacity:0;transform:translate(-50%,-110px) scale(0.9)} }
  @keyframes ptsPopWrong { 0%{opacity:0;transform:translate(-50%,-20px) scale(0.5)} 20%{opacity:1;transform:translate(-50%,-60px) scale(1.1)} 100%{opacity:0;transform:translate(-50%,-80px)} }

  /* ─── FEEDBACK ──────────────────────────────────────────────── */
  .feedback {
    margin-top: 8px; padding: 12px 14px;
    border-radius: var(--r); font-size: 0.95rem; line-height: 1.55; display: none;
  }
  .feedback.show { display: block; animation: fadeUp 0.3s ease both; }
  .feedback.correct-fb { background: rgba(46,204,113,0.12); border: 1px solid rgba(46,204,113,0.35); color: #aff0c8; }
  .feedback.wrong-fb   { background: rgba(231,76,60,0.12); border: 1px solid rgba(231,76,60,0.35); color: #faa; }
  .feedback strong { display: block; margin-bottom: 4px; font-size: 1.05rem; }

  /* ─── NEXT BUTTON ───────────────────────────────────────────── */
  .next-btn {
    display: none; width: 100%; margin-top: 8px; padding: 15px;
    background: linear-gradient(135deg, var(--gold), var(--gold-l));
    border: none; border-radius: var(--r); color: #0e0c06;
    font-family: 'Playfair Display', serif; font-size: 1.1rem;
    font-weight: 700; letter-spacing: 1px; cursor: pointer;
    transition: transform 0.1s; touch-action: manipulation;
  }
  .next-btn.show { display: block; animation: fadeUp 0.3s ease both; }
  .next-btn:active { transform: scale(0.98); }

  /* ─── TIMEOUT ───────────────────────────────────────────────── */
  .timeout-msg {
    display: none; margin-top: 8px; padding: 12px 14px;
    border-radius: var(--r); background: rgba(201,160,48,0.08);
    border: 1px solid rgba(201,160,48,0.25); color: var(--muted);
    font-size: 0.95rem; text-align: center; font-style: italic;
  }
  .timeout-msg.show { display: block; animation: fadeUp 0.3s ease both; }

  /* ─── SOUND TOGGLE ──────────────────────────────────────────── */
  .sound-toggle {
    position: fixed; top: 12px; right: 12px; z-index: 100;
    background: rgba(14,12,6,0.75); border: 1px solid rgba(201,160,48,0.35);
    border-radius: 50%; width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 1.2rem; user-select: none;
    touch-action: manipulation;
  }

  /* ─── RESULTS ───────────────────────────────────────────────── */
  .results { display: none; text-align: center; }
  .results.show { display: block; animation: fadeUp 0.6s ease both; }
  .results-card {
    background: var(--panel); border: 1px solid rgba(201,160,48,0.3);
    border-radius: var(--r); padding: 28px 18px 24px;
    margin-bottom: 14px; position: relative; overflow: hidden;
    box-shadow: 0 16px 48px rgba(0,0,0,0.6);
  }
  .results-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
  .trophy { font-size: 3rem; margin-bottom: 10px; display: block; }
  .results h2 { font-family: 'Playfair Display', serif; font-size: 1.7rem; color: var(--ivory); margin-bottom: 8px; }
  .score-big { font-family: 'Playfair Display', serif; font-size: 4rem; color: var(--gold); line-height: 1; margin: 12px 0 4px; }
  .score-big span { font-size: 1.6rem; color: rgba(201,160,48,0.55); }
  .score-sub { font-size: 0.6rem; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
  .verdict { font-size: 1.05rem; color: var(--muted); margin-bottom: 20px; font-style: italic; line-height: 1.5; }
  .new-hs-banner {
    display: none; background: rgba(201,160,48,0.15); border: 1px solid var(--gold);
    border-radius: 6px; padding: 10px 16px; margin-bottom: 16px;
    color: var(--gold-l); font-family: 'Playfair Display', serif; font-size: 1rem; letter-spacing: 1px;
  }
  .new-hs-banner.show { display: block; animation: fadeUp 0.5s 0.3s ease both; }
  .results-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 20px; }
  .results-grid .rs { background: rgba(0,0,0,0.3); border-radius: 8px; padding: 12px 8px; border: 1px solid var(--border); }
  .results-grid .rs .val { font-family: 'Playfair Display', serif; font-size: 1.5rem; color: var(--gold); }
  .results-grid .rs .val.hs { color: var(--gold-l); }
  .results-grid .rs .lbl { font-size: 0.5rem; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
  .medals-row { display: flex; justify-content: center; gap: 10px; margin-top: 20px; opacity: 0.4; font-size: 1.3rem; letter-spacing: 6px; }

  /* ─── NAME ENTRY ────────────────────────────────────────────── */
  .name-entry { margin: 16px 0 0; padding: 16px; background: rgba(0,0,0,0.25); border: 1px solid var(--border); border-radius: var(--r); }
  .name-entry p { font-size: 0.9rem; color: var(--muted); margin-bottom: 10px; }
  .name-entry .name-row { display: flex; gap: 8px; }
  .name-entry input { flex: 1; background: rgba(0,0,0,0.4); border: 1px solid rgba(201,160,48,0.3); border-radius: 8px; padding: 12px 14px; color: var(--ivory); font-family: 'Crimson Pro', serif; font-size: 1.05rem; outline: none; transition: border-color 0.2s; }
  .name-entry input:focus { border-color: var(--gold); }
  .name-entry input::placeholder { color: rgba(240,232,204,0.2); }
  .name-entry .submit-btn { padding: 12px 18px; background: linear-gradient(135deg, var(--gold), var(--gold-l)); border: none; border-radius: 8px; color: #0e0c06; font-family: 'Playfair Display', serif; font-size: 0.95rem; font-weight: 700; cursor: pointer; white-space: nowrap; touch-action: manipulation; }
  .name-entry .submitted-msg { color: #aff0c8; font-size: 0.9rem; margin-top: 8px; display: none; }
  .name-entry .submitted-msg.show { display: block; animation: fadeUp 0.3s ease both; }

  /* ─── LEADERBOARD ───────────────────────────────────────────── */
  .leaderboard-wrap { margin-top: 16px; animation: fadeUp 0.5s 0.2s ease both; }
  .lb-title { font-family: 'Playfair Display', serif; font-size: 1rem; letter-spacing: 4px; text-transform: uppercase; color: var(--gold); text-align: center; margin-bottom: 10px; opacity: 0.85; }
  .lb-tabs { display: flex; border-radius: var(--r) var(--r) 0 0; overflow: hidden; }
  .lb-tab { flex: 1; padding: 10px 6px; background: rgba(0,0,0,0.45); border: 1px solid var(--border); border-bottom: none; color: var(--muted); font-family: 'Playfair Display', serif; font-size: 0.7rem; letter-spacing: 1px; text-transform: uppercase; cursor: pointer; text-align: center; transition: all 0.2s; user-select: none; touch-action: manipulation; }
  .lb-tab:not(:first-child) { border-left: none; }
  .lb-tab.active { background: rgba(201,160,48,0.15); color: var(--gold-l); border-bottom: 2px solid var(--gold); }
  .lb-card { background: var(--panel2); border: 1px solid var(--border); border-radius: 0 0 var(--r) var(--r); overflow: hidden; }
  .lb-row { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; padding: 11px 14px; border-bottom: 1px solid rgba(255,255,255,0.04); }
  .lb-row:last-child { border-bottom: none; }
  .lb-row.lb-header { background: rgba(0,0,0,0.3); padding: 8px 14px; }
  .lb-row.lb-me { background: rgba(201,160,48,0.1); border-left: 3px solid var(--gold); }
  .lb-row.lb-gold .lb-rank   { color: #FFD700; }
  .lb-row.lb-silver .lb-rank { color: #C0C0C0; }
  .lb-row.lb-bronze .lb-rank { color: #CD7F32; }
  .lb-rank  { font-family: 'Playfair Display', serif; font-size: 1rem; color: rgba(201,160,48,0.5); font-weight: 700; }
  .lb-name  { font-size: 1rem; color: var(--ivory); padding: 0 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lb-score { font-family: 'Playfair Display', serif; font-size: 1.05rem; color: var(--gold); text-align: right; }
  .lb-header .lb-rank, .lb-header .lb-name, .lb-header .lb-score { font-family: 'Crimson Pro', serif; font-size: 0.55rem; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); font-weight: 400; }
  .lb-loading { text-align: center; padding: 20px; color: var(--muted); font-style: italic; font-size: 0.9rem; }
  .lb-empty   { text-align: center; padding: 16px; color: var(--muted); font-style: italic; font-size: 0.9rem; }

  /* ─── SECRET BOX ────────────────────────────────────────────── */
  .lives-display { font-size: 1.2rem; line-height: 1; letter-spacing: 1px; }
  @keyframes loseLife { 0%{transform:scale(1)} 30%{transform:scale(1.5)} 100%{transform:scale(1)} }
  .life-lost { animation: loseLife 0.45s ease both; }
  .secret-box { background: #0f0e08; border: 1px solid rgba(201,160,48,0.4); border-radius: var(--r); padding: 24px 20px; width: 90%; max-width: 360px; box-shadow: 0 24px 60px rgba(0,0,0,0.8); animation: fadeUp 0.25s ease both; }
  .secret-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-family: 'Playfair Display', serif; font-size: 1.1rem; color: var(--gold); }
  .secret-close { background: none; border: none; color: var(--muted); font-size: 1.1rem; cursor: pointer; padding: 4px 8px; border-radius: 4px; }
  .secret-desc { font-size: 0.75rem; color: var(--muted); margin-bottom: 18px; letter-spacing: 1px; }
  .secret-desc kbd { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); border-radius: 3px; padding: 1px 6px; font-family: monospace; font-size: 0.75rem; }
  .secret-actions { display: flex; flex-direction: column; gap: 10px; }
  .secret-btn { padding: 12px 16px; border: none; border-radius: 6px; font-family: 'Crimson Pro', serif; font-size: 0.95rem; cursor: pointer; text-align: left; }
  .secret-btn.danger { background: rgba(231,76,60,0.15); border: 1px solid rgba(231,76,60,0.4); color: #faa; }

  /* ─── ANIMATIONS ────────────────────────────────────────────── */
  @keyframes fadeDown { from{opacity:0;transform:translateY(-18px)} to{opacity:1;transform:translateY(0)} }
  @keyframes fadeUp   { from{opacity:0;transform:translateY(18px)}  to{opacity:1;transform:translateY(0)} }
  @keyframes score-bump { 0%{transform:scale(1)} 40%{transform:scale(1.35);color:var(--gold-l)} 100%{transform:scale(1)} }
  .score-bump { animation: score-bump 0.4s ease; }
  .quiz-section { animation: fadeUp 0.45s ease both; }

  /* ─── DESKTOP TWEAKS (wider screens get slightly larger type) ── */
  @media (min-width: 480px) {
    html { font-size: 19px; }
    .options { gap: 10px; }
  }
  @media (min-width: 600px) {
    html { font-size: 20px; }
    body { padding: 16px 16px 32px; }
    .card { padding: 22px 20px; }
    .option-btn { padding: 15px 14px; }
  }
