:root {
    --gold: #c9a84c;
    --gold-light: #f0d080;
    --red: #c0392b;
    --dark: #0a0a0a;
    --dark2: #111;
    --dark3: #1a1a1a;
    --text: #e8e0d0;
    --muted: #888;
  }

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

  body {
    background: var(--dark);
    color: var(--text);
    font-family: 'Noto Sans', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    position: relative;
  }

  /* Background texture */
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
      radial-gradient(ellipse at 20% 50%, rgba(192,57,43,0.07) 0%, transparent 60%),
      radial-gradient(ellipse at 80% 20%, rgba(201,168,76,0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
  }

  /* Diagonal stripe texture */
  body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 40px,
      rgba(255,255,255,0.012) 40px,
      rgba(255,255,255,0.012) 41px
    );
    pointer-events: none;
    z-index: 0;
  }

  .screen {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 700px;
    padding: 20px;
  }

  /* ============ INTRO SCREEN ============ */
  #intro-screen {
    text-align: center;
    animation: fadeIn 0.8s ease;
  }

  .hero-image-wrap {
    width: 220px;
    height: 220px;
    margin: 0 auto 16px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--gold);
    box-shadow: 0 0 30px rgba(201,168,76,0.35), 0 0 60px rgba(201,168,76,0.1);
    animation: pulse 3s ease-in-out infinite;
  }

  .hero-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    filter: sepia(20%) contrast(1.05);
    border-radius: 0;
  }

  .dragon-symbol {
    font-size: 72px;
    line-height: 1;
    margin-bottom: 8px;
    filter: drop-shadow(0 0 20px rgba(201,168,76,0.4));
    animation: pulse 3s ease-in-out infinite;
  }

  @keyframes pulse {
    0%, 100% { filter: drop-shadow(0 0 20px rgba(201,168,76,0.4)); }
    50% { filter: drop-shadow(0 0 35px rgba(201,168,76,0.7)); }
  }

  .main-title {
    font-family: 'Bebas Neue', cursive;
    font-size: clamp(52px, 10vw, 88px);
    letter-spacing: 6px;
    color: var(--gold);
    line-height: 1;
    text-shadow: 0 0 40px rgba(201,168,76,0.3), 3px 3px 0 rgba(0,0,0,0.8);
  }

  .sub-title {
    font-family: 'Bebas Neue', cursive;
    font-size: clamp(18px, 4vw, 26px);
    letter-spacing: 8px;
    color: var(--muted);
    margin-bottom: 30px;
  }

  .intro-quote {
    font-size: 14px;
    font-style: italic;
    color: var(--gold);
    opacity: 0.7;
    margin-bottom: 40px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
  }

  .intro-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 44px;
  }

  .stat-item {
    text-align: center;
  }

  .stat-num {
    font-family: 'Bebas Neue', cursive;
    font-size: 36px;
    color: var(--gold);
    line-height: 1;
  }

  .stat-label {
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--muted);
    text-transform: uppercase;
    margin-top: 2px;
  }

  .btn-start {
    background: var(--gold);
    color: var(--dark);
    border: none;
    font-family: 'Bebas Neue', cursive;
    font-size: 22px;
    letter-spacing: 4px;
    padding: 16px 60px;
    cursor: pointer;
    clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
    transition: all 0.2s;
    position: relative;
  }

  .btn-start:hover {
    background: var(--gold-light);
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(201,168,76,0.5);
  }

  .btn-start:active { transform: scale(0.98); }

  /* ============ QUIZ SCREEN ============ */
  #quiz-screen { display: none; }

  /* Question image — top of quiz screen, centered */
  .question-image-wrap {
    width: 100%;
    text-align: center;
    margin-bottom: 16px;
    background: var(--dark2);
    padding: 8px 0;
  }

  .question-image-wrap img {
    display: inline-block;
    max-width: 100%;
    max-height: 220px;
    width: auto;
    height: auto;
    filter: sepia(15%) contrast(1.05);
    transition: opacity 0.3s ease;
    border-radius: 0;
    margin: 0 auto;
  }

  .progress-bar-wrap {
    height: 3px;
    background: var(--dark3);
    border-radius: 2px;
    margin-bottom: 28px;
    overflow: hidden;
  }

  .progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    border-radius: 2px;
    transition: width 0.5s ease;
  }

  .quiz-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
  }

  .q-counter {
    font-family: 'Bebas Neue', cursive;
    font-size: 14px;
    letter-spacing: 3px;
    color: var(--muted);
  }

  .q-counter span {
    color: var(--gold);
    font-size: 18px;
  }

  .score-display {
    font-family: 'Bebas Neue', cursive;
    font-size: 14px;
    letter-spacing: 3px;
    color: var(--muted);
  }

  .score-display span {
    color: var(--gold);
    font-size: 18px;
  }

  .question-box {
    background: var(--dark2);
    border: 1px solid rgba(201,168,76,0.15);
    border-left: 3px solid var(--gold);
    padding: 28px 32px;
    margin-bottom: 24px;
    position: relative;
    min-height: 90px;
    display: flex;
    align-items: center;
  }

  .question-text {
    font-size: clamp(15px, 2.5vw, 18px);
    line-height: 1.5;
    font-weight: 300;
  }

  .options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
  }

  @media (max-width: 500px) {
    .options-grid { grid-template-columns: 1fr; }
  }

  .option-btn {
    background: var(--dark2);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text);
    font-family: 'Noto Sans', sans-serif;
    font-size: 14px;
    padding: 16px 18px;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.4;
    position: relative;
    overflow: hidden;
  }

  .option-btn::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 0;
    background: rgba(201,168,76,0.08);
    transition: width 0.2s;
  }

  .option-btn:hover:not(:disabled)::before { width: 100%; }
  .option-btn:hover:not(:disabled) {
    border-color: rgba(201,168,76,0.4);
    color: var(--gold-light);
  }

  .option-label {
    font-family: 'Bebas Neue', cursive;
    font-size: 16px;
    color: var(--gold);
    min-width: 20px;
    opacity: 0.6;
  }

  .option-btn.correct {
    background: rgba(39,174,96,0.15);
    border-color: #27ae60;
    color: #5dda8a;
  }

  .option-btn.correct .option-label { color: #27ae60; opacity: 1; }

  .option-btn.wrong {
    background: rgba(192,57,43,0.15);
    border-color: var(--red);
    color: #e87070;
  }

  .option-btn.wrong .option-label { color: var(--red); opacity: 1; }

  .option-btn:disabled { cursor: default; }

  .feedback-bar {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    padding: 0 4px;
    opacity: 0;
    transition: opacity 0.3s;
  }

  .feedback-bar.show { opacity: 1; }

  .feedback-icon { font-size: 20px; }

  .feedback-text { line-height: 1.4; color: var(--muted); }
  .feedback-text strong { color: var(--text); }

  /* ============ RESULTS SCREEN ============ */
  #results-screen {
    display: none;
    text-align: center;
  }

  .results-title {
    font-family: 'Bebas Neue', cursive;
    font-size: clamp(40px, 8vw, 68px);
    letter-spacing: 4px;
    color: var(--gold);
    text-shadow: 0 0 30px rgba(201,168,76,0.4);
    margin-bottom: 6px;
  }

  .grade-label {
    font-family: 'Bebas Neue', cursive;
    font-size: 14px;
    letter-spacing: 6px;
    color: var(--muted);
    margin-bottom: 36px;
  }

  .score-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 3px solid var(--gold);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    box-shadow: 0 0 30px rgba(201,168,76,0.2), inset 0 0 20px rgba(0,0,0,0.5);
    background: radial-gradient(circle, rgba(201,168,76,0.06), transparent 70%);
  }

  .score-big {
    font-family: 'Bebas Neue', cursive;
    font-size: 52px;
    color: var(--gold);
    line-height: 1;
  }

  .score-denom {
    font-size: 12px;
    letter-spacing: 2px;
    color: var(--muted);
  }

  .pct-display {
    font-family: 'Bebas Neue', cursive;
    font-size: 22px;
    color: var(--muted);
    letter-spacing: 2px;
    margin-bottom: 36px;
  }

  .result-quote {
    font-size: 14px;
    font-style: italic;
    color: var(--gold);
    opacity: 0.75;
    max-width: 420px;
    margin: 0 auto 40px;
    line-height: 1.7;
    padding: 0 16px;
    border-left: 2px solid rgba(201,168,76,0.3);
    text-align: left;
  }

  .results-breakdown {
    background: var(--dark2);
    border: 1px solid rgba(201,168,76,0.1);
    padding: 20px 24px;
    margin-bottom: 32px;
    text-align: left;
  }

  .breakdown-title {
    font-family: 'Bebas Neue', cursive;
    font-size: 13px;
    letter-spacing: 4px;
    color: var(--muted);
    margin-bottom: 16px;
  }

  .breakdown-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 13px;
    line-height: 1.4;
  }

  .breakdown-item:last-child { border-bottom: none; }

  .breakdown-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

  .breakdown-q { color: var(--muted); flex: 1; }
  .breakdown-a { color: var(--text); font-weight: 600; }
  .breakdown-correct { color: #5dda8a; }
  .breakdown-wrong { color: #e87070; }

  .btn-restart {
    background: transparent;
    color: var(--gold);
    border: 2px solid var(--gold);
    font-family: 'Bebas Neue', cursive;
    font-size: 20px;
    letter-spacing: 4px;
    padding: 14px 50px;
    cursor: pointer;
    clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
    transition: all 0.2s;
  }

  .btn-restart:hover {
    background: var(--gold);
    color: var(--dark);
    box-shadow: 0 0 30px rgba(201,168,76,0.4);
  }

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

  @keyframes slideIn {
    from { opacity: 0; transform: translateX(-12px); }
    to { opacity: 1; transform: translateX(0); }
  }

  .animate-in { animation: fadeIn 0.4s ease forwards; }
  .slide-in { animation: slideIn 0.35s ease forwards; }

  /* Timer bar */
  .timer-bar-wrap {
    height: 2px;
    background: rgba(255,255,255,0.05);
    margin-bottom: 18px;
    overflow: hidden;
  }

  .timer-bar-fill {
    height: 100%;
    background: var(--gold);
    width: 100%;
    transition: width linear;
  }

  .timer-bar-fill.warning { background: var(--red); }