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

  body {
    font-family: 'Barlow Condensed', system-ui, -apple-system, sans-serif;
    background: #0a0a0f;
    color: #f0f0f0;
    min-height: 100vh;
    overflow-x: hidden;
  }

  .noise {
    position: fixed; inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none; z-index: 0;
  }

  /* --- Start Screen --- */
  #start-screen {
    position: relative; z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    text-align: center;
    animation: fadeIn 0.6s ease;
  }

  #start-screen h1 {
    font-family: 'Oswald', sans-serif;
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
  }

  #start-screen h1 span { color: #e10600; }

  #start-screen .subtitle {
    font-size: 1.1rem;
    color: #6a6a7a;
    margin-bottom: 2.5rem;
    font-weight: 400;
    letter-spacing: 0.05em;
  }

  .mode-cards {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .mode-card {
    background: #12121a;
    border: 2px solid #2a2a3a;
    border-radius: 16px;
    padding: 1.5rem 2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 200px;
    text-align: center;
  }

  .mode-card:hover { border-color: #e10600; transform: translateY(-2px); }
  .mode-card.selected { border-color: #e10600; background: #1a1215; }
  .mode-card .mode-icon { font-size: 2rem; margin-bottom: 0.5rem; }
  .mode-card .mode-name { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 1rem; margin-bottom: 0.25rem; letter-spacing: 0.05em; text-transform: uppercase; }
  .mode-card .mode-desc { font-size: 0.8rem; color: #6a6a7a; }

  .start-btn {
    background: linear-gradient(135deg, #e10600, #ff4d4d);
    color: #fff;
    border: none;
    padding: 1rem 3rem;
    border-radius: 50px;
    font-family: 'Oswald', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.15em;
    text-transform: uppercase;
  }

  .start-btn:hover { transform: scale(1.05); box-shadow: 0 8px 30px rgba(225, 6, 0, 0.3); }

  .circuit-count { color: #4a4a5a; font-size: 0.85rem; margin-bottom: 2rem; letter-spacing: 0.05em; }

  .footer-credits { color: #4a4a5a; font-size: 0.75rem; margin-top: 2rem; letter-spacing: 0.03em; line-height: 1.8; text-align: center; }
  .footer-credits a { color: #4a4a5a; text-decoration: underline; }

  /* --- Quiz Screen --- */
  #quiz-screen { display: none; position: relative; z-index: 1; }

  .top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: #101018;
    border-bottom: 1px solid #2a2a3a;
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .score-display {
    display: flex;
    gap: 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
  }

  .score-display .correct { color: #4ade80; }
  .score-display .wrong { color: #f87171; }
  .score-display .streak { color: #fbbf24; }

  .progress-text { font-weight: 600; color: #6a6a7a; font-size: 0.95rem; letter-spacing: 0.05em; }

  .quit-btn {
    background: none;
    border: 1px solid #2a2a3a;
    color: #6a6a7a;
    padding: 0.4rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Oswald', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: all 0.15s;
  }

  .quit-btn:hover { border-color: #f87171; color: #f87171; }

  .quiz-body {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
  }

  .image-container {
    position: relative;
    width: 100%;
    min-height: 280px;
    max-height: 400px;
    background: #12121a;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    border: 1px solid #2a2a3a;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
  }

  .image-container img {
    max-width: 100%;
    max-height: 350px;
    object-fit: contain;
    display: block;
    transition: opacity 0.3s ease;
    filter: brightness(0) invert(1);
    opacity: 0.92;
  }

  .image-container img.loading { opacity: 0; }

  .image-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2a2a3a;
    font-size: 1.2rem;
    letter-spacing: 0.05em;
  }

  .question-label {
    font-family: 'Oswald', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #ccc;
    text-align: center;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }

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

  .choice-btn {
    background: #12121a;
    border: 2px solid #2a2a3a;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    color: #e0e0e8;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    line-height: 1.3;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.02em;
  }

  .choice-btn:hover:not(.disabled) {
    border-color: #e10600;
    background: #1a1215;
    transform: translateY(-1px);
  }

  .choice-btn .choice-letter {
    display: inline-block;
    width: 1.6rem;
    height: 1.6rem;
    line-height: 1.6rem;
    text-align: center;
    background: #2a2a3a;
    border-radius: 6px;
    font-family: 'Oswald', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    margin-right: 0.75rem;
    vertical-align: middle;
    transition: background 0.15s;
  }

  .choice-btn.correct-answer {
    border-color: #4ade80;
    background: #0f2a1a;
    animation: popCorrect 0.35s ease;
  }

  .choice-btn.correct-answer .choice-letter { background: #4ade80; color: #0a0a0f; }

  .choice-btn.wrong-answer {
    border-color: #f87171;
    background: #2a0f0f;
    animation: shake 0.4s ease;
  }

  .choice-btn.wrong-answer .choice-letter { background: #f87171; color: #0a0a0f; }

  .choice-btn.disabled { cursor: default; opacity: 0.5; }
  .choice-btn.disabled.correct-answer { opacity: 1; }
  .choice-btn.disabled.wrong-answer { opacity: 1; }

  .next-container {
    text-align: center;
    margin-top: 0.5rem;
    min-height: 3.5rem;
  }

  .next-btn {
    background: linear-gradient(135deg, #e10600, #ff4d4d);
    color: #fff;
    border: none;
    padding: 0.85rem 2.5rem;
    border-radius: 50px;
    font-family: 'Oswald', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    animation: fadeIn 0.3s ease;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .next-btn:hover { transform: scale(1.05); }

  .feedback {
    text-align: center;
    font-family: 'Oswald', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    min-height: 1.8rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.1em;
  }

  .feedback.correct-fb { color: #4ade80; }
  .feedback.wrong-fb { color: #f87171; }

  /* --- Results Screen --- */
  #results-screen {
    display: none;
    position: relative; z-index: 1;
    min-height: 100vh;
    padding: 2rem;
    animation: fadeIn 0.6s ease;
  }

  .results-card {
    max-width: 500px;
    margin: 3rem auto;
    background: #12121a;
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    border: 1px solid #2a2a3a;
  }

  .results-card h2 {
    font-family: 'Oswald', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .results-card .result-subtitle {
    color: #6a6a7a;
    margin-bottom: 2rem;
    letter-spacing: 0.05em;
  }

  .big-score {
    font-family: 'Oswald', sans-serif;
    font-size: 4rem;
    font-weight: 700;
    color: #e10600;
    margin-bottom: 0.25rem;
  }

  .big-score-label { color: #6a6a7a; font-size: 0.95rem; margin-bottom: 2rem; letter-spacing: 0.1em; text-transform: uppercase; }

  .stats-row {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
  }

  .stat-item { text-align: center; }
  .stat-value { font-family: 'Oswald', sans-serif; font-size: 1.8rem; font-weight: 700; }
  .stat-label { font-size: 0.8rem; color: #6a6a7a; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
  .stat-item.green .stat-value { color: #4ade80; }
  .stat-item.red .stat-value { color: #f87171; }
  .stat-item.gold .stat-value { color: #fbbf24; }

  .results-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

  .results-actions button {
    padding: 0.85rem 2rem;
    border-radius: 50px;
    font-family: 'Oswald', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .results-actions .play-again {
    background: linear-gradient(135deg, #e10600, #ff4d4d);
    color: #fff;
  }

  .results-actions .play-again:hover { transform: scale(1.05); }

  .results-actions .back-btn {
    background: #2a2a3a;
    color: #ccc;
    border: 1px solid #3a3a4a;
  }

  .results-actions .back-btn:hover { border-color: #6a6a7a; }

  /* --- Timer Bar --- */
  .timer-bar-track {
    height: 4px;
    background: #2a2a3a;
    border-radius: 2px;
    margin-bottom: 1.5rem;
    overflow: hidden;
  }

  .timer-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ade80, #fbbf24, #f87171);
    border-radius: 2px;
    transition: width 0.1s linear;
    width: 100%;
  }

  /* --- Keyboard hint --- */
  .keyboard-hint {
    text-align: center;
    color: #3a3a4a;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    letter-spacing: 0.03em;
  }

  .keyboard-hint kbd {
    display: inline-block;
    background: #1e1e2e;
    border: 1px solid #2a2a3a;
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    font-family: 'Oswald', sans-serif;
    font-size: 0.75rem;
    margin: 0 0.1rem;
  }

  /* --- Animations --- */
  @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes popCorrect { 0% { transform: scale(1); } 50% { transform: scale(1.03); } 100% { transform: scale(1); } }
  @keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }

  /* --- Loading overlay --- */
  #loading-overlay {
    position: fixed;
    inset: 0;
    background: #0a0a0f;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 0.4s;
  }

  #loading-overlay.hidden { opacity: 0; pointer-events: none; }

  .spinner {
    width: 40px; height: 40px;
    border: 3px solid #2a2a3a;
    border-top-color: #e10600;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
  }

  @keyframes spin { to { transform: rotate(360deg); } }
