* { box-sizing: border-box; }
:root { --ink:#1e1b4b; --line:#e5e7eb; --accent:#4f46e5; --accent2:#f59e0b; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, sans-serif;
  color: var(--ink);
  background: radial-gradient(130% 100% at 100% 0%, #eef2ff 0%, #fef3c7 70%, #ffe4e6 100%);
  padding: 22px;
}
.quest { max-width: 900px; margin: 0 auto; }
.q-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.brand { display: flex; gap: 12px; align-items: center; }
.brand-mark { font-size: 30px; }
.eyebrow { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
h1 { margin: 2px 0 0; font-size: 21px; }
.q-score { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-weight: 800; }
.q-score span { color: var(--accent); }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 26px; box-shadow: 0 12px 34px rgba(30,27,75,.08); text-align: center; }
.sub { margin: 0 0 16px; color: #4b5563; font-weight: 600; font-size: 17px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 18px; }
.chip { border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 10px 18px; font-weight: 700; cursor: pointer; text-transform: capitalize; }
.chip:hover { border-color: var(--accent); background: #eef2ff; }
.primary { border: none; border-radius: 16px; padding: 15px 22px; font-size: 17px; font-weight: 800; color: #fff; cursor: pointer; background: linear-gradient(90deg, var(--accent), #7c3aed); box-shadow: 0 8px 20px rgba(79,70,229,.28); margin-top: 6px; }
.primary:hover { filter: brightness(1.06); }

.loading .book, .panel .book { font-size: 52px; animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-10px) rotate(4deg); } }
@media (prefers-reduced-motion: reduce) { .book { animation: none; } }

.page { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 22px; background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 22px; box-shadow: 0 12px 34px rgba(30,27,75,.08); }
@media (max-width: 720px) { .page { grid-template-columns: 1fr; } }
.illus { position: relative; margin: 0; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: linear-gradient(135deg, #eef2ff, #fde68a); border: 2px solid var(--ink); }
.illus img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s ease; }
.illus.ready img { opacity: 1; }
.illus-shim { position: absolute; inset: 0; display: grid; place-content: center; font-size: 42px; animation: pulse 1.2s ease-in-out infinite; }
.illus.ready .illus-shim { display: none; }
@keyframes pulse { 0%,100% { opacity: .5; } 50% { opacity: 1; } }

.page-num { margin: 0 0 6px; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #9ca3af; }
.story-text { margin: 0 0 18px; font-size: 19px; line-height: 1.5; }
.q { border-top: 2px dashed var(--line); padding-top: 16px; }
.q-skill { margin: 0 0 4px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--accent2); }
.q-prompt { margin: 0 0 12px; font-weight: 800; font-size: 17px; }
.q-opts { display: grid; gap: 10px; }
.q-opt { text-align: left; border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 13px 16px; font-weight: 700; font-size: 16px; cursor: pointer; }
.q-opt:hover:not(:disabled) { border-color: var(--accent); background: #eef2ff; }
.q-opt.right { border-color: #16a34a; background: #dcfce7; }
.q-opt.wrong { border-color: #dc2626; background: #fee2e2; }
.q-feedback { margin: 12px 0 0; font-weight: 800; }
.q-feedback.ok { color: #16a34a; }
.q-feedback.no { color: #b45309; }
.page-body .primary { margin-top: 16px; }

.done-title { margin: 6px 0; font-size: 26px; }
.flash { margin-top: 14px; background: #fef3c7; border: 1px solid #fcd34d; color: #92400e; border-radius: 12px; padding: 10px 14px; font-weight: 700; }
