/* ABAP Quest: the portfolio's navy glass with a gold RPG accent. Loaded after styles.css. */
.quest-page {
  --gold: #f4cb6e;
  --gold-hi: #ffe29a;
  --gold-lo: #e0a43a;
  --blood: #ff8f80;
  --rare: #8cc4ff;
  --epic: #cdb2ff;
  --font-rpg: "Cinzel", "Trajan Pro", Georgia, serif;
}
.quest-page .bg::before { content: ""; position: absolute; inset: 0;
  background: radial-gradient(760px 520px at 88% -6%, rgba(231, 164, 58, .2), transparent 65%),
              radial-gradient(620px 420px at -6% 92%, rgba(231, 164, 58, .08), transparent 65%); }

.q-display { font-family: var(--font-rpg); font-weight: 700; letter-spacing: .015em; }
.q-gold { color: var(--gold); }
.q-red { color: var(--blood); }
.q-small { font-size: 13.5px; color: var(--ink-dim); }
.q-lead { color: var(--ink-dim); font-size: 17px; max-width: 58ch; }
.flip { transform: scaleX(-1); }
.btn[disabled] { opacity: .45; cursor: default; transform: none; }
.q-gold .i { width: 15px; height: 15px; vertical-align: -2px; margin-right: 3px; }

/* Buttons */
.btn.q-btn-gold { background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo)); color: #2a1a02; border-color: transparent;
  box-shadow: 0 10px 30px -12px rgba(240, 180, 60, .9), inset 0 1px 0 rgba(255, 255, 255, .6); }
.btn.q-btn-gold:hover { background: linear-gradient(180deg, #ffeab8, #eeb24c); }
.btn.q-btn-red { background: linear-gradient(180deg, #ffab9c, #e0564c); color: #2a0505; border-color: transparent;
  box-shadow: 0 10px 30px -12px rgba(255, 90, 80, .85), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn.q-btn-red:hover { background: linear-gradient(180deg, #ffbcb0, #ea6359); }

/* Navigation brand */
.q-mono { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(140deg, var(--gold-hi), var(--gold-lo)); color: #2a1a02; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55); }
.q-mono .i { width: 18px; height: 18px; stroke-width: 2; }
.q-brand .name { font-family: var(--font-rpg); font-weight: 700; letter-spacing: .04em; }

/* Way back to the portfolio: "← Portfolio" on computers, an iPhone-style "‹ Portfolio" on phones */
.q-back .q-chev { display: none; }
@media (max-width: 640px) {
  .quest-page .nav-inner { position: relative; }
  .quest-page .nav-links { display: flex; order: -1; margin-left: 0; }   /* styles.css hides the section links on phones */
  .quest-page .q-back { display: flex; align-items: center; gap: 1px; color: var(--gold); font-weight: 600; font-size: 15px; padding: 6px 8px 6px 2px; }
  .q-back .q-arrow { display: none; }
  .q-back .q-chev { display: block; width: 20px; height: 20px; stroke-width: 2.4; }
  .quest-page .q-brand { position: absolute; left: 50%; transform: translateX(-50%); gap: 8px; }
  .quest-page .q-brand .name { font-size: 15px; }
  .quest-page .q-mono { width: 26px; height: 26px; }
  .quest-page .lang-switch { margin-left: auto; }
}
@media (max-width: 380px) {
  .quest-page .q-back { font-size: 14px; padding-right: 4px; }
  .quest-page .q-brand { gap: 6px; }
  .quest-page .q-brand .name { font-size: 13.5px; }
}
@media (max-width: 340px) { .quest-page .q-brand .name { display: none; } }   /* very narrow phones: the sword alone */
@media (max-width: 640px) { body.quest-page { padding-bottom: env(safe-area-inset-bottom); } }   /* no section bar on this page */

.q-main { gap: 40px; }
.q-main[data-view="zone"], .q-main[data-view="ach"] { gap: 18px; }
.q-main[data-view="quiz"] { max-width: 820px; gap: 16px; }
.q-noscript { border-radius: 20px; padding: 20px; text-align: center; }
.q-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.q-actions.center { justify-content: center; margin-top: 14px; }
.q-crumbs { display: flex; }

/* ---------- Hero and player stats ---------- */
.q-hero { position: relative; overflow: hidden; border-radius: 32px; padding: clamp(22px, 4vw, 42px);
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.q-hero::before { content: ""; position: absolute; width: 420px; height: 420px; right: -120px; top: -180px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(244, 203, 110, .22), transparent 68%); }
.q-hero h1 { font-size: clamp(42px, 7vw, 70px); line-height: 1.02; margin: 10px 0 14px;
  background: linear-gradient(180deg, #fff6dc 10%, var(--gold) 58%, #b9822a); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 22px rgba(231, 164, 58, .35)); }
.q-stats { position: relative; border-radius: 22px; padding: 18px; display: flex; flex-direction: column; gap: 14px;
  background: rgba(3, 10, 28, .42); border: 1px solid rgba(255, 255, 255, .1); }
.q-level { display: flex; align-items: center; gap: 14px; }
.q-medal { --p: 0; width: 66px; height: 66px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--gold) calc(var(--p) * 1%), rgba(255, 255, 255, .1) 0); box-shadow: 0 0 26px -6px rgba(244, 203, 110, .6); }
.q-medal span { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font: 700 23px var(--font-rpg); color: var(--gold);
  background: radial-gradient(circle at 35% 30%, #24427e, #0a1838 75%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2); }
.q-level-copy { min-width: 0; }
.q-level-copy small { display: block; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); }
.q-level-copy b { display: block; font: 700 19px var(--font-rpg); color: #fff4d6; margin: 2px 0; }
.q-level-copy span { font-size: 13px; color: var(--ink-dim); }
.q-xpbar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.q-xpbar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi));
  box-shadow: 0 0 12px rgba(255, 210, 120, .6); transition: width .6s var(--ease); }
.q-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.q-tile { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 14px; text-decoration: none;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); transition: background .2s, border-color .2s; }
.q-tile span { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-dim); }
.q-tile .i { width: 15px; height: 15px; color: var(--gold); }
.q-tile b { font-size: 16.5px; font-weight: 650; }
.q-tile.link:hover { background: rgba(244, 203, 110, .1); border-color: rgba(244, 203, 110, .35); }

/* ---------- The map: a trail of zones ---------- */
.q-trail { list-style: none; margin: 0; padding: 0; position: relative; display: flex; flex-direction: column; gap: 18px; }
.q-trail::before { content: ""; position: absolute; left: 50%; top: 24px; bottom: 150px; width: 3px; margin-left: -1.5px; border-radius: 2px;
  background: repeating-linear-gradient(to bottom, rgba(244, 203, 110, .55) 0 10px, transparent 10px 19px); }
.q-zone { position: relative; width: calc(50% - 42px); border-radius: 22px; min-height: 150px; transition: transform .25s var(--ease), border-color .25s, box-shadow .25s; }
.q-zone:nth-child(odd) { align-self: flex-start; }
.q-zone:nth-child(even) { align-self: flex-end; }
.q-zone + .q-zone { margin-top: -66px; }
/* the stone on the trail and the short path that leads to it */
.q-zone::after { content: ""; position: absolute; top: 34px; width: 20px; height: 20px; border-radius: 50%; box-sizing: border-box;
  background: #0b1a3c; border: 3px solid var(--gold); box-shadow: 0 0 0 5px rgba(3, 10, 25, .9); }
.q-zone::before { content: ""; position: absolute; top: 43px; width: 32px; height: 2px; background: rgba(244, 203, 110, .45); }
.q-zone:nth-child(odd)::after { right: -52px; }
.q-zone:nth-child(odd)::before { right: -32px; }
.q-zone:nth-child(even)::after { left: -52px; }
.q-zone:nth-child(even)::before { left: -32px; }
.q-zone.is-cleared::after { background: var(--gold); }
.q-zone.is-current { border-color: rgba(244, 203, 110, .55); box-shadow: 0 0 0 1px rgba(244, 203, 110, .25), 0 20px 50px -20px rgba(231, 164, 58, .55); }
.q-zone.is-current::after { animation: q-beacon 2.2s ease-in-out infinite; }
.q-zone.is-locked .q-zone-in { opacity: .55; }   /* the card stays opaque, so the trail does not show through its stone */
.q-zone.is-locked::after { border-color: rgba(255, 255, 255, .3); }
.q-zone.is-locked::before { background: rgba(255, 255, 255, .15); }
.q-zone:not(.is-locked):hover { transform: translateY(-3px); border-color: rgba(244, 203, 110, .5); }
@keyframes q-beacon { 50% { box-shadow: 0 0 0 5px rgba(3, 10, 25, .9), 0 0 0 10px rgba(244, 203, 110, .25), 0 0 24px 6px rgba(244, 203, 110, .55); } }

.q-zone-in { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px 15px; border-radius: inherit; color: inherit; text-decoration: none; height: 100%; }
.q-zone-top { display: flex; align-items: center; gap: 10px; }
.q-sigil { width: 42px; height: 42px; border-radius: 14px; flex: none; display: grid; place-items: center; color: var(--gold);
  background: radial-gradient(circle at 30% 25%, rgba(255, 226, 154, .3), rgba(231, 164, 58, .07) 72%);
  border: 1px solid rgba(244, 203, 110, .38); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18); }
.q-sigil.big { width: 74px; height: 74px; border-radius: 22px; }
.q-sigil.big .i { width: 38px; height: 38px; stroke-width: 1.5; }
.is-locked .q-sigil { color: var(--ink-dim); border-color: rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .05); }
.q-zone-n { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); }
.q-pill { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px;
  white-space: nowrap; color: var(--ink-dim); background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); }
.q-pill .i { width: 14px; height: 14px; }
.q-pill.gold { color: #2a1a02; background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo)); border-color: transparent; }
.q-pill.here { color: var(--gold); border-color: rgba(244, 203, 110, .45); background: rgba(244, 203, 110, .1); }
.q-zone-name { font: 700 21px/1.2 var(--font-rpg); color: #fff4d6; margin-top: 8px; }
.q-zone-topic { font-size: 14px; color: var(--ink-dim); }
.q-bar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; margin-top: 10px; }
.q-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4d8dff, #8cc4ff); }
.q-zone-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-size: 12.5px; color: var(--ink-dim); }
.q-zone-meta.locked { margin-top: 10px; }
.q-boss-mini { display: inline-flex; align-items: center; gap: 5px; color: var(--blood); }
.q-boss-mini.won { color: var(--gold); }
.q-boss-mini .i { width: 14px; height: 14px; }

/* The final boss closes the trail */
.q-raid { position: relative; margin-top: 30px; border-radius: 26px; padding: 22px 24px; display: flex; align-items: center; gap: 20px; }
.q-raid.glass { border-color: rgba(255, 122, 110, .38);
  background: linear-gradient(120deg, rgba(255, 90, 80, .2), rgba(255, 255, 255, .03) 48%, rgba(244, 203, 110, .1)), rgba(10, 22, 56, .55); }
.q-raid.is-cleared.glass { border-color: rgba(244, 203, 110, .5); }
.q-raid.is-locked > * { opacity: .7; }
.q-raid::before { content: ""; position: absolute; left: 50%; top: -31px; width: 22px; height: 22px; margin-left: -11px; border-radius: 6px; transform: rotate(45deg);
  background: #2a0c14; border: 3px solid var(--blood); box-shadow: 0 0 18px rgba(255, 90, 80, .6); }
.q-raid-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.q-raid h3 { font-size: 25px; color: #ffe1da; margin-top: 2px; }
.q-raid-copy > p:not(.eyebrow):not(.q-small) { color: #d9c4c1; font-style: italic; }
.q-raid .btn, .q-raid .q-pill { margin-left: 0; flex: none; }
.q-portrait, .q-raid-portrait { width: 76px; height: 76px; border-radius: 50%; flex: none; display: grid; place-items: center; color: var(--blood);
  background: radial-gradient(circle at 40% 35%, rgba(255, 120, 110, .38), rgba(70, 8, 20, .5)); border: 1px solid rgba(255, 122, 110, .5);
  box-shadow: 0 0 40px -8px rgba(255, 90, 80, .7); }
.q-portrait .i, .q-raid-portrait .i { width: 40px; height: 40px; stroke-width: 1.5; }
.is-cleared .q-raid-portrait, .won .q-portrait { color: var(--gold); border-color: rgba(244, 203, 110, .55);
  background: radial-gradient(circle at 40% 35%, rgba(255, 226, 154, .35), rgba(80, 50, 10, .45)); box-shadow: 0 0 40px -8px rgba(244, 203, 110, .7); }
.q-portrait.small { width: 50px; height: 50px; }
.q-portrait.small .i { width: 28px; height: 28px; }

.q-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 28px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .08); }
.q-explorer .i { width: 18px; height: 18px; color: var(--gold); margin-left: 2px; }
.q-explorer input:checked + .track { background: var(--gold-lo); }
.q-foot-hint { font-size: 13px; color: var(--ink-dim); }
.q-reset { margin-left: auto; }
.q-reset.armed { background: rgba(255, 90, 80, .2); border-color: rgba(255, 122, 110, .55); color: #ffd6cf; }

/* ---------- Zone ---------- */
.q-zone-head { position: relative; overflow: hidden; border-radius: 28px; padding: clamp(20px, 3.5vw, 32px); display: flex; gap: 22px; align-items: flex-start; }
.q-zone-head::before { content: ""; position: absolute; width: 360px; height: 360px; right: -100px; top: -170px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(244, 203, 110, .18), transparent 68%); }
.q-zone-head h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.08; color: #fff4d6; margin: 6px 0 10px; }
.q-zone-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.q-panel { border-radius: 24px; padding: 22px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.q-panel > p { color: var(--ink-dim); font-size: 15px; }
.q-panel > .btn, .q-boss-row { margin-top: auto; }
.q-panel-head { display: flex; align-items: center; gap: 10px; width: 100%; }
.q-panel-head .i { color: var(--gold); }
.q-panel-head h2 { font-size: 20px; font-weight: 650; }
.q-count { margin-left: auto; font-size: 13px; color: var(--ink-dim); white-space: nowrap; }
.q-dots { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.q-dots i, .q-legend i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; box-sizing: border-box; }
.q-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--ink-dim); }
.q-legend span { display: inline-flex; align-items: center; gap: 6px; }
.q-legend i { width: 10px; height: 10px; }
.d-new { border: 1.5px solid rgba(255, 255, 255, .32); }
.d-miss { background: #ff7a7a; box-shadow: 0 0 8px rgba(255, 122, 122, .55); }
.d-ok { background: var(--accent); }
.d-master { background: var(--gold); box-shadow: 0 0 8px rgba(244, 203, 110, .7); }
.q-boss-panel.glass { border-color: rgba(255, 122, 110, .3);
  background: linear-gradient(160deg, rgba(255, 90, 80, .14), rgba(255, 255, 255, .03) 60%), rgba(10, 22, 56, .55); }
.q-boss-panel.won.glass { border-color: rgba(244, 203, 110, .45);
  background: linear-gradient(160deg, rgba(244, 203, 110, .14), rgba(255, 255, 255, .03) 60%), rgba(10, 22, 56, .55); }
.q-boss-panel h2 { font-size: 24px; color: #ffe1da; line-height: 1.15; }
.q-boss-panel.won h2 { color: #fff4d6; }
.q-flavor { font-style: italic; color: #d9c4c1 !important; }
.q-boss-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.q-side { grid-column: 1 / -1; }
.q-sidelist { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 8px; }
.q-sidelist li { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); transition: background .2s, border-color .2s; }
.q-sidelist li.done { background: rgba(244, 203, 110, .06); border-color: rgba(244, 203, 110, .22); }
.q-sidelist label { display: flex; align-items: flex-start; gap: 12px; flex: 1; min-width: 0; cursor: pointer; font-size: 15px; }
.q-sidelist input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.q-check { width: 22px; height: 22px; border-radius: 7px; flex: none; margin-top: 1px; display: grid; place-items: center; border: 1.5px solid rgba(255, 255, 255, .35); transition: background .2s; }
.q-check .i { width: 15px; height: 15px; stroke-width: 2.6; opacity: 0; }
.q-sidelist input:checked + .q-check { background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo)); border-color: transparent; color: #2a1a02; }
.q-sidelist input:checked + .q-check .i { opacity: 1; }
.q-sidelist input:focus-visible + .q-check { outline: 2px solid var(--accent); outline-offset: 2px; }
.q-sidelist li.done label > span:last-child { color: var(--ink-dim); text-decoration: line-through; text-decoration-color: rgba(244, 203, 110, .6); }
.q-sidelist .btn { flex: none; }

/* ---------- Questions ---------- */
.q-quiz { display: flex; flex-direction: column; gap: 14px; }
.q-quiz-top { display: flex; align-items: center; gap: 12px; }
.q-quiz-title { flex: 1; min-width: 0; text-align: center; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-counter { font-size: 13px; color: var(--ink-dim); white-space: nowrap; }
.q-steps { display: flex; gap: 6px; }
.q-steps i { flex: 1; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .1); }
.q-steps .done { background: var(--accent); }
.q-steps .now { background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi)); }
.q-fight { border-radius: 20px; padding: 12px 16px; display: flex; align-items: center; gap: 14px; }
.q-fight.glass { border-color: rgba(255, 122, 110, .32); background: linear-gradient(120deg, rgba(255, 90, 80, .14), rgba(255, 255, 255, .03) 60%), rgba(10, 22, 56, .55); }
.q-fight-main { flex: 1; min-width: 0; }
.q-fight-main b { display: block; font-size: 16px; color: #ffe1da; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-hp { display: flex; gap: 3px; margin-top: 7px; }
.q-hp i { flex: 1; height: 8px; border-radius: 3px; background: linear-gradient(180deg, #ff9384, #d8443c); box-shadow: 0 0 8px rgba(255, 90, 80, .45); transition: background .4s, box-shadow .4s; }
.q-hp i.gone { background: rgba(255, 255, 255, .1); box-shadow: none; }
.q-hearts { display: flex; gap: 3px; }
.q-hearts .i { width: 22px; height: 22px; fill: #ff6b7d; stroke: #ff8f9c; }
.q-hearts .lost .i { fill: none; stroke: rgba(255, 255, 255, .28); }
.q-fight.anim-hit { animation: q-glow-gold .7s var(--ease); }
.q-fight.anim-hit .q-portrait { animation: q-shake .5s var(--ease); }
.q-fight.anim-hurt { animation: q-glow-red .7s var(--ease); }
.q-fight.anim-hurt .q-hearts { animation: q-shake .5s var(--ease); }
@keyframes q-shake { 20% { transform: translateX(-6px) rotate(-6deg); } 40% { transform: translateX(5px) rotate(5deg); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
@keyframes q-glow-gold { 30% { box-shadow: 0 0 0 2px rgba(244, 203, 110, .7), 0 0 40px rgba(244, 203, 110, .45); } }
@keyframes q-glow-red { 30% { box-shadow: 0 0 0 2px rgba(255, 90, 80, .8), 0 0 40px rgba(255, 60, 60, .45); } }

.q-card { border-radius: 26px; padding: clamp(18px, 3.5vw, 30px); display: flex; flex-direction: column; gap: 16px; }
.q-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.q-rar { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 4px 10px; border-radius: 99px; border: 1px solid; }
.q-rar.r-c { color: #c9d0dc; border-color: rgba(195, 201, 212, .35); }
.q-rar.r-r { color: var(--rare); border-color: rgba(114, 182, 255, .5); background: rgba(114, 182, 255, .08); }
.q-rar.r-e { color: var(--epic); border-color: rgba(180, 141, 255, .55); background: rgba(180, 141, 255, .12); box-shadow: 0 0 14px -2px rgba(180, 141, 255, .5); }
.q-from { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-dim); }
.q-from .i { width: 16px; height: 16px; color: var(--gold); }
.q-question { font-size: clamp(19px, 2.6vw, 23px); font-weight: 620; line-height: 1.4; letter-spacing: -.01em; text-wrap: pretty; }
code.ic { font-family: var(--font-mono); font-size: .84em; padding: .08em .38em; border-radius: 6px; background: rgba(114, 182, 255, .12); border: 1px solid rgba(114, 182, 255, .22); color: #d6e9ff; overflow-wrap: anywhere; }
.q-code { margin: 0; padding: 14px 16px; border-radius: 16px; background: rgba(2, 8, 22, .62); border: 1px solid rgba(255, 255, 255, .08); font-size: 13.5px; line-height: 1.65; overflow-x: auto; }
.q-code .ln { display: block; white-space: pre; }
.q-options { display: flex; flex-direction: column; gap: 10px; }
.q-opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: 500 16px/1.4 var(--font-body); color: var(--ink); padding: 12px 14px; border-radius: 16px;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12); cursor: pointer; transition: background .2s, border-color .2s, transform .15s, opacity .3s; }
.q-opt:hover:not([disabled]) { background: rgba(255, 255, 255, .1); border-color: rgba(244, 203, 110, .5); }
.q-opt:active:not([disabled]) { transform: scale(.99); }
.q-opt[disabled] { cursor: default; }
.q-opt.mono .q-opt-t { font-family: var(--font-mono); font-size: 14px; }
.q-key { width: 28px; height: 28px; border-radius: 9px; flex: none; display: grid; place-items: center; font: 700 13px var(--font-mono); color: var(--ink-dim);
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); }
.q-opt-t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.q-opt-i { width: 20px; height: 20px; flex: none; stroke-width: 2.4; }
.q-opt.right { background: rgba(127, 227, 207, .12); border-color: rgba(127, 227, 207, .65); }
.q-opt.right .q-key { background: var(--mint); color: #022a22; border-color: transparent; }
.q-opt.right .q-opt-i { color: var(--mint); }
.q-opt.wrong { background: rgba(255, 122, 122, .12); border-color: rgba(255, 122, 122, .6); }
.q-opt.wrong .q-key { background: #ff7a7a; color: #300; border-color: transparent; }
.q-opt.wrong .q-opt-i { color: #ff9a9a; }
.q-opt.dim { opacity: .5; }
.q-feedback { border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; animation: q-rise .35s var(--ease); }
.q-feedback.ok { background: rgba(127, 227, 207, .08); border: 1px solid rgba(127, 227, 207, .3); }
.q-feedback.bad { background: rgba(255, 122, 122, .07); border: 1px solid rgba(255, 122, 122, .3); }
.q-feedback > p:not(.q-verdict) { color: #d6e2f7; font-size: 15.5px; }
.q-verdict { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.q-verdict b { font-size: 16px; }
.q-verdict .i { width: 20px; height: 20px; stroke-width: 2.6; }
.ok .q-verdict { color: var(--mint); }
.bad .q-verdict { color: #ff9a9a; }
.q-verdict .q-small { font-weight: 400; }
.q-xp { font: 700 13px var(--font-body); color: #2a1a02; background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo)); padding: 2px 9px; border-radius: 99px; animation: q-pop .5s var(--ease); }
.q-next { display: flex; justify-content: flex-end; }
.q-keys { font-size: 12.5px; color: var(--ink-dim); text-align: right; }
@keyframes q-rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes q-pop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.15); opacity: 1; } }

/* ---------- Result ---------- */
.q-result { border-radius: 30px; padding: clamp(28px, 5vw, 48px) clamp(20px, 4vw, 40px); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; animation: q-rise .4s var(--ease); }
.q-result-icon { position: relative; width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 4px; color: #cfe5ff;
  background: radial-gradient(circle at 40% 35%, rgba(114, 182, 255, .32), rgba(20, 40, 90, .45)); border: 1px solid rgba(114, 182, 255, .4); }
.q-result-icon > .i { width: 48px; height: 48px; stroke-width: 1.5; }
.q-result.win .q-result-icon { color: var(--gold); border-color: rgba(244, 203, 110, .6); background: radial-gradient(circle at 40% 35%, rgba(255, 226, 154, .4), rgba(80, 50, 10, .45)); box-shadow: 0 0 60px -10px rgba(244, 203, 110, .8); }
.q-result.lose .q-result-icon { color: var(--blood); border-color: rgba(255, 122, 110, .55); background: radial-gradient(circle at 40% 35%, rgba(255, 120, 110, .38), rgba(70, 8, 20, .5)); }
.q-result h1 { font-size: clamp(32px, 6vw, 50px); line-height: 1.05; }
.q-result.win h1 { background: linear-gradient(180deg, #fff6dc 10%, var(--gold) 60%, #b9822a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.q-result.lose h1 { color: #ffd6cf; }
.q-result .q-lead { max-width: 46ch; }
.q-score { font-weight: 650; font-size: 17px; }
.q-burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
.q-burst i { position: absolute; width: 6px; height: 16px; margin: -8px -3px; border-radius: 3px; background: linear-gradient(#fff3cf, var(--gold-lo)); opacity: 0;
  animation: q-spark 1.2s var(--ease) .15s forwards; }
@keyframes q-spark { 0% { opacity: 1; transform: rotate(var(--a)) translateY(-30px) scale(.6); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(-150px) scale(1); } }

/* ---------- Achievements ---------- */
.q-achs h1 { font-size: clamp(30px, 5vw, 44px); color: #fff4d6; }
.q-ach-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 12px; }
.q-ach { border-radius: 18px; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; }
.q-ach:not(.on) { opacity: .66; }
.q-ach.on.glass { border-color: rgba(244, 203, 110, .35); }
.q-ach-i { width: 42px; height: 42px; border-radius: 50%; flex: none; display: grid; place-items: center; color: var(--ink-dim); background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); }
.q-ach.on .q-ach-i { color: #2a1a02; background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo)); border-color: transparent; box-shadow: 0 0 20px -4px rgba(244, 203, 110, .8); }
.q-ach.on .q-ach-i .i { fill: currentColor; }
.q-ach b { display: block; font-size: 15.5px; }
.q-ach span { display: block; font-size: 13.5px; color: var(--ink-dim); }
.q-ach small { display: block; margin-top: 4px; font-size: 12px; color: var(--gold); }

/* ---------- Toasts ---------- */
.q-toasts { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; width: min(92vw, 440px);
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.q-toast { display: flex; align-items: center; gap: 10px; max-width: 100%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; animation: q-rise .35s var(--ease); transition: opacity .35s, transform .35s; }
.q-toast.glass { background: linear-gradient(160deg, rgba(150, 190, 255, .16), rgba(120, 160, 255, .05) 62%), rgba(10, 24, 60, .9); }
.q-toast.ach.glass, .q-toast.level.glass { border-color: rgba(244, 203, 110, .55); }
.q-toast .i { width: 18px; height: 18px; color: var(--gold); }
.q-toast b { margin-left: auto; color: var(--gold); white-space: nowrap; }
.q-toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- Layout for smaller screens ---------- */
@media (max-width: 760px) {
  .q-hero { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .q-trail { padding-left: 34px; }
  .q-trail::before { left: 12px; top: 20px; bottom: 170px; }
  .q-zone { width: auto; align-self: stretch !important; min-height: 0; }
  .q-zone + .q-zone { margin-top: 0; }
  .q-zone::after { left: -31px !important; right: auto !important; top: 26px; width: 18px; height: 18px; }
  .q-zone::before { display: none; }
  .q-raid { margin-left: -34px; flex-direction: column; align-items: flex-start; gap: 14px; }
  .q-raid::before { left: 21px; margin-left: 0; }
  .q-zone-grid { grid-template-columns: minmax(0, 1fr); }
  .q-zone-head { flex-direction: column; gap: 14px; }
  .q-reset { margin-left: 0; }
}
@media (max-width: 640px) {
  .q-hero h1 { font-size: 44px; }
  .q-opt { font-size: 15px; padding: 11px 12px; gap: 10px; }
  .q-opt.mono .q-opt-t { font-size: 13px; }
  .q-code.lines { font-size: 12px; padding: 12px 12px 12px 4px; }
  .q-quiz-title { visibility: hidden; }   /* the card already names the zone */
  .q-toasts { top: calc(max(12px, env(safe-area-inset-top)) + 64px); bottom: auto; }
  .q-hearts .i { width: 19px; height: 19px; }
  .q-fight { padding: 10px 12px; gap: 10px; }
  .q-fight-main b { white-space: normal; font-size: 15px; line-height: 1.25; }
  .q-panel { padding: 18px; }
  .q-sidelist li { flex-wrap: wrap; }
}
@media (hover: none) {
  .q-zone:not(.is-locked):hover { transform: none; border-color: var(--stroke); }
  .q-zone.is-current:hover { border-color: rgba(244, 203, 110, .55); }
  .q-opt:hover:not([disabled]) { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .12); }
}
@media (prefers-reduced-motion: reduce) {
  .q-zone.is-current::after, .q-fight, .q-fight *, .q-feedback, .q-xp, .q-result, .q-toast { animation: none !important; }
}
