
  :root {
    --bg: #0b0e1a;
    --bg2: #12172b;
    --panel: rgba(22, 28, 48, 0.92);
    --panel-2: rgba(30, 38, 64, 0.9);
    --line: rgba(255, 255, 255, 0.1);
    --text: #eef1ff;
    --muted: #9aa3c7;
    --gold: #ffd166;
    --gold-2: #ff9f43;
    --cyan: #34e1ff;
    --magenta: #ff4fd8;
    --green: #2ee66b;
    --red: #ff5470;
    --purple: #8b7cff;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    --radius: 18px;
  }

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

  html, body { min-height: 100%; }

  body {
    font-family: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
    color: var(--text);
    background:
      radial-gradient(1200px 600px at 85% -10%, rgba(139, 124, 255, 0.22), transparent 60%),
      radial-gradient(900px 500px at -10% 20%, rgba(52, 225, 255, 0.14), transparent 55%),
      radial-gradient(700px 700px at 50% 120%, rgba(255, 79, 216, 0.12), transparent 60%),
      linear-gradient(180deg, var(--bg), var(--bg2) 60%, #0a0c16);
    background-attachment: fixed;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
  }

  .wrap {
    width: min(880px, 100% - 28px);
    margin: 0 auto;
    padding: 22px 0 60px;
  }

  .screen { display: none; animation: fadeUp 0.35s ease both; }
  .screen.active { display: block; }

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

  @keyframes shake {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(4px); }
    30%, 50%, 70% { transform: translateX(-7px); }
    40%, 60% { transform: translateX(7px); }
  }

  @keyframes pop {
    0% { transform: scale(0.94); opacity: 0.4; }
    70% { transform: scale(1.03); }
    100% { transform: scale(1); opacity: 1; }
  }

  @keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 209, 102, 0.45); }
    50% { box-shadow: 0 0 30px 6px rgba(255, 209, 102, 0.25); }
  }

  @keyframes fall {
    to { transform: translateY(110vh) rotate(720deg); opacity: 0; }
  }

  @keyframes scan {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
  }

  .display {
    font-weight: 900;
    font-style: italic;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .grad-text {
    background: linear-gradient(92deg, var(--gold) 0%, var(--magenta) 45%, var(--cyan) 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: scan 6s linear infinite;
  }

  .muted { color: var(--muted); }
  .center { text-align: center; }
  .row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
  .row.between { justify-content: space-between; }
  .stack { display: flex; flex-direction: column; gap: 14px; }

  /* ---------- panels & buttons ---------- */
  .panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    backdrop-filter: blur(10px);
  }

  .btn {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 14px;
    padding: 13px 20px;
    font-size: 16px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    color: var(--text);
    background: var(--panel-2);
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease, border-color 0.12s;
    user-select: none;
  }
  .btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
  .btn:active { transform: translateY(1px) scale(0.98); }
  .btn:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

  .btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-2));
    color: #241500;
    box-shadow: 0 12px 28px rgba(255, 159, 67, 0.35);
  }
  .btn-cyan {
    background: linear-gradient(135deg, var(--cyan), #3f9dff);
    color: #04202b;
    box-shadow: 0 12px 28px rgba(52, 225, 255, 0.28);
  }
  .btn-danger {
    background: linear-gradient(135deg, var(--red), #ff7a9c);
    color: #2b0710;
  }
  .btn-ghost {
    background: transparent;
    border-color: var(--line);
    color: var(--muted);
  }
  .btn-block { width: 100%; }
  .btn-big { padding: 17px 26px; font-size: 19px; border-radius: 16px; }
  .btn-sm { padding: 9px 14px; font-size: 14px; border-radius: 12px; }

  /* ---------- bars ---------- */
  .bar {
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
  }
  .bar > i {
    display: block;
    height: 100%;
    border-radius: inherit;
    width: 0%;
    background: linear-gradient(90deg, var(--cyan), var(--purple));
    transition: width 0.4s ease;
  }
  .bar.gold > i { background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
  .bar.red > i {
    background: linear-gradient(90deg, var(--red), var(--gold), var(--red));
    background-size: 200% 100%;
    animation: scan 1.2s linear infinite;
    transition: width 0.25s linear;
  }

  /* ---------- title ---------- */
  .title-hero {
    padding: 46px 26px 34px;
    text-align: center;
    position: relative;
    overflow: hidden;
  }
  .title-hero::after {
    content: "";
    position: absolute;
    inset: auto -20% -40% -20%;
    height: 220px;
    background: radial-gradient(closest-side, rgba(255, 209, 102, 0.2), transparent);
    pointer-events: none;
  }
  .title-hero h1 {
    font-size: clamp(42px, 9vw, 84px);
    line-height: 0.95;
    margin-bottom: 10px;
  }
  .title-tag {
    font-size: clamp(15px, 3.2vw, 20px);
    color: var(--muted);
    margin-bottom: 26px;
    font-weight: 600;
  }
  .badge-row { justify-content: center; margin-bottom: 22px; }

  .badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--line);
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
  }
  .badge .flame { color: var(--gold-2); }

  /* ---------- job board ---------- */
  .rank-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 18px 20px;
    border-radius: var(--radius);
    background:
      linear-gradient(120deg, rgba(255, 209, 102, 0.16), rgba(255, 79, 216, 0.1) 55%, rgba(52, 225, 255, 0.12));
    border: 1px solid rgba(255, 209, 102, 0.28);
    margin-bottom: 16px;
  }
  .rank-name { font-size: 22px; }
  .rank-icon { font-size: 34px; }

  .section-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 22px 2px 12px;
  }
  .section-label h2 { font-size: 15px; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; }

  .job-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
  }

  .job-card {
    position: relative;
    text-align: left;
    padding: 18px;
    border-radius: 16px;
    background: var(--panel);
    border: 1px solid var(--line);
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s, box-shadow 0.15s;
    color: inherit;
    font: inherit;
    width: 100%;
    display: block;
  }
  .job-card:hover {
    transform: translateY(-4px);
    border-color: rgba(52, 225, 255, 0.45);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.35);
  }
  .job-card:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
  .job-card .icon { font-size: 30px; margin-bottom: 8px; }
  .job-card h3 { font-size: 18px; margin-bottom: 4px; }
  .job-card p { color: var(--muted); font-size: 14px; min-height: 40px; }
  .job-card .topic-tag {
    display: inline-block;
    margin-top: 10px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cyan);
    background: rgba(52, 225, 255, 0.12);
    padding: 4px 9px;
    border-radius: 999px;
  }
  .crowns {
    position: absolute;
    top: 14px;
    right: 14px;
    letter-spacing: 2px;
    font-size: 14px;
  }
  .crowns .off { opacity: 0.25; filter: grayscale(1); }

  .boss-card {
    background:
      linear-gradient(135deg, rgba(255, 84, 112, 0.18), rgba(139, 124, 255, 0.14));
    border: 1px solid rgba(255, 84, 112, 0.35);
  }
  .boss-card.locked { opacity: 0.65; filter: saturate(0.5); }

  .daily-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    background: linear-gradient(120deg, rgba(52, 225, 255, 0.14), rgba(139, 124, 255, 0.12));
    border: 1px solid rgba(52, 225, 255, 0.3);
  }

  /* ---------- gameplay ---------- */
  .hud {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
  }
  .hud-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--line);
    font-weight: 800;
    font-size: 14px;
  }
  .hearts { letter-spacing: 2px; font-size: 17px; }
  .hearts .lost { opacity: 0.22; filter: grayscale(1); }

  .timer-wrap { margin: 6px 0 18px; }

  .prompt-card {
    padding: 26px 22px;
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(40, 48, 80, 0.85), rgba(24, 30, 54, 0.92));
    border: 1px solid var(--line);
    margin-bottom: 16px;
  }
  .prompt-card .kicker {
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cyan);
    font-weight: 800;
    margin-bottom: 10px;
  }
  .prompt-card h2 {
    font-size: clamp(19px, 4.2vw, 26px);
    font-weight: 800;
    line-height: 1.35;
  }
  .prompt-card .visual {
    margin: 16px auto 4px;
    display: flex;
    justify-content: center;
  }

  .choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .choices.single-col { grid-template-columns: 1fr; }

  .choice {
    text-align: left;
    padding: 17px 18px;
    border-radius: 14px;
    font-size: 17px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.12s, transform 0.12s, background 0.12s;
  }
  .choice:hover { border-color: var(--cyan); transform: translateY(-2px); background: rgba(52, 225, 255, 0.08); }
  .choice:disabled { cursor: default; transform: none; }
  .choice.correct {
    border-color: var(--green);
    background: rgba(46, 230, 107, 0.16);
    animation: pop 0.35s ease;
  }
  .choice.wrong {
    border-color: var(--red);
    background: rgba(255, 84, 112, 0.15);
  }
  .choice .hint-note {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
  }

  .choice-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .choice-pair .choice {
    text-align: center;
    font-size: 22px;
    padding: 30px 16px;
  }

  .input-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }
  .input-row input {
    flex: 1 1 200px;
    min-width: 0;
    padding: 15px 16px;
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-size: 19px;
    font-weight: 700;
    font-family: inherit;
  }
  .input-row input:focus {
    outline: none;
    border-color: var(--cyan);
  }

  .feedback {
    display: none;
    margin-top: 16px;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.05);
  }
  .feedback.show { display: block; animation: pop 0.3s ease; }
  .feedback.good {
    border-color: rgba(46, 230, 107, 0.5);
    background: rgba(46, 230, 107, 0.12);
  }
  .feedback.bad {
    border-color: rgba(255, 84, 112, 0.5);
    background: rgba(255, 84, 112, 0.12);
  }
  .feedback.soft {
    border-color: rgba(255, 209, 102, 0.5);
    background: rgba(255, 209, 102, 0.12);
  }
  .feedback h4 { font-size: 17px; margin-bottom: 5px; }
  .feedback p { color: var(--text); opacity: 0.92; font-size: 15px; }

  .shake { animation: shake 0.5s ease; }

  /* ---------- boss ---------- */
  .boss-bar-wrap {
    padding: 16px 18px;
    border-radius: var(--radius);
    background: linear-gradient(120deg, rgba(255, 84, 112, 0.18), rgba(20, 16, 40, 0.9));
    border: 1px solid rgba(255, 84, 112, 0.35);
    margin-bottom: 14px;
  }
  .boss-avatar { font-size: 40px; }
  .boss-taunt {
    margin-top: 8px;
    font-style: italic;
    color: var(--muted);
    font-size: 14px;
    min-height: 20px;
  }

  /* ---------- result ---------- */
  .crown-row { font-size: 52px; letter-spacing: 10px; margin: 10px 0 6px; }
  .crown-row .won { animation: glowPulse 1.6s ease infinite; display: inline-block; }
  .crown-row .lost { opacity: 0.22; filter: grayscale(1); }

  .xp-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 4px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    font-size: 15px;
  }
  .xp-line b { color: var(--gold); }

  .confetti {
    position: fixed;
    top: -12px;
    width: 10px;
    height: 16px;
    border-radius: 3px;
    pointer-events: none;
    z-index: 60;
    animation: fall linear forwards;
  }

  /* ---------- stats / modal ---------- */
  .stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin: 14px 0 20px;
  }
  .stat-box {
    padding: 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line);
    text-align: center;
  }
  .stat-box .n { font-size: 28px; font-weight: 900; color: var(--gold); }
  .stat-box .l { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

  .modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5, 8, 18, 0.72);
    z-index: 50;
    align-items: center;
    justify-content: center;
    padding: 18px;
  }
  .modal-backdrop.show { display: flex; animation: fadeUp 0.25s ease both; }
  .modal {
    width: min(460px, 100%);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 26px;
    box-shadow: var(--shadow);
    animation: pop 0.3s ease;
  }
  .modal h3 { font-size: 22px; margin-bottom: 8px; }
  .modal .goals { margin: 14px 0 20px; }
  .modal .goals li {
    list-style: none;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
    font-size: 15px;
    color: var(--muted);
  }
  .modal .goals li b { color: var(--gold); }

  .how-list li {
    list-style: none;
    padding: 10px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
    color: var(--muted);
  }
  .how-list li b { color: var(--text); }

  .top-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 14px 0;
  }

  footer.site-foot {
    margin-top: 34px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
  }

  @media (max-width: 560px) {
    .choices { grid-template-columns: 1fr; }
    .choice-pair { grid-template-columns: 1fr 1fr; }
    .title-hero { padding: 34px 14px 26px; }
    .panel { padding: 18px; }
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }

