/* =========================================================
   IQ Test — "BRIGHT & PLAYFUL · PREMIUM" (Option B)
   Manrope · vibrant purple→pink · layered shadows · motion
   ========================================================= */

:root {
  --bg:         #F6F5FF;
  --surface:    #FFFFFF;
  --surface-2:  #F3F2FD;
  --ink:        #1C1840;
  --ink-soft:   #5E5878;
  --muted:      #948FB0;
  --line:       #ECEAFB;
  --line-2:     #DCD8F5;
  --primary:    #6C5CE7;
  --primary-2:  #8B5CF6;
  --primary-ink:#4A37C7;
  --primary-soft:#EEEBFF;

  --c-abstract: #7C5CFF;
  --c-numeric:  #10B7B2;
  --c-verbal:   #FF5C8A;
  --c-spatial:  #FF9F38;

  --grad:       linear-gradient(135deg, #7C5CFF 0%, #9B59FF 48%, #FF5CA0 100%);
  --grad-score: linear-gradient(135deg, #3a2a85 0%, #6b46c9 55%, #c44c9e 100%);

  --good:       #15B981;
  --bad:        #EF5350;
  --flag:       #F59E0B;
  --glyph:      #2A2550;

  --shadow-sm:  0 2px 8px rgba(76, 60, 160, .08);
  --shadow:     0 16px 36px rgba(76, 60, 160, .13), 0 4px 10px rgba(20, 16, 50, .04);
  --shadow-lg:  0 28px 64px rgba(76, 60, 160, .22);
  --glow:       0 12px 30px rgba(124, 92, 255, .42);

  --radius:     18px;
  --radius-sm:  12px;
  --font-sans:  "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --font-mono:  "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --maxw:       960px;
}

:root[data-theme="dark"] {
  --bg:         #14112C;
  --surface:    #1E1A3E;
  --surface-2:  #191536;
  --ink:        #F1EFFB;
  --ink-soft:   #AEA8CC;
  --muted:      #7E78A2;
  --line:       #2A2552;
  --line-2:     #383070;
  --primary:    #8B7BFF;
  --primary-2:  #A78BFF;
  --primary-ink:#C9BEFF;
  --primary-soft:#241F47;
  --good:       #2DD49A;
  --bad:        #FF6E66;
  --flag:       #F2B23A;
  --glyph:      #E6E2F8;
  --shadow-sm:  0 2px 10px rgba(0,0,0,.35);
  --shadow:     0 18px 44px rgba(0,0,0,.5);
  --shadow-lg:  0 30px 70px rgba(0,0,0,.6);
  --glow:       0 12px 34px rgba(139, 123, 255, .5);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0; min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
/* soft ambient colour glow (premium depth, not harsh) */
body::before, body::after {
  content: ""; position: fixed; z-index: 0; width: 55vw; height: 55vw;
  max-width: 640px; max-height: 640px; border-radius: 50%;
  filter: blur(100px); opacity: .42; pointer-events: none;
}
body::before { top: -16vw; left: -10vw; background: radial-gradient(circle at 30% 30%, #7C5CFF, transparent 70%); }
body::after  { bottom: -20vw; right: -12vw; background: radial-gradient(circle at 60% 40%, #FF5CA0, transparent 70%); }
:root[data-theme="dark"] body::before { opacity: .28; }
:root[data-theme="dark"] body::after  { opacity: .24; }

.container { position: relative; z-index: 1; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

h1, h2, h3 { margin: 0 0 .4em; line-height: 1.18; font-weight: 800; letter-spacing: -.02em; }
h1 { font-size: clamp(2rem, 5vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.85rem); }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1rem; }
.muted { color: var(--ink-soft); }
.small { font-size: .85rem; }
.gradient-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); font-weight: 800; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--grad); color: #fff; font-weight: 800; font-size: .85rem; box-shadow: var(--glow); }
.brand-text { font-size: 1.02rem; letter-spacing: -.01em; }
.header-controls { display: flex; align-items: center; gap: 10px; }

.lang-switch { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; box-shadow: var(--shadow-sm); }
.lang-btn { border: 0; background: transparent; color: var(--ink-soft); cursor: pointer; font: inherit; font-size: .8rem; font-weight: 700; padding: 6px 12px; border-radius: 999px; transition: .18s; }
.lang-btn:hover { color: var(--ink); }
.lang-btn.is-active { background: var(--grad); color: #fff; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--ink); font-size: 1.1rem; transition: .18s; box-shadow: var(--shadow-sm); }
.icon-btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }

.auth-area { display: flex; align-items: center; }
.auth-btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; font-size: .82rem; padding: 8px 14px; border-radius: 999px; cursor: pointer; transition: .18s; box-shadow: var(--shadow-sm); }
.auth-btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.auth-user { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px 5px; box-shadow: var(--shadow-sm); }
.auth-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.auth-name { font-size: .82rem; font-weight: 700; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-signout { display: grid; place-items: center; width: 30px; height: 30px; border: 0; background: transparent; cursor: pointer; color: var(--ink-soft); border-radius: 50%; transition: .15s; }
.auth-signout:hover { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.auth-signout svg { display: block; }
.saved-note { color: var(--good); font-weight: 700; font-size: .9rem; }
@media (max-width: 560px) { .auth-name { display: none; } }

/* ---------- Screens ---------- */
main { padding: 32px 0 72px; position: relative; z-index: 1; }
.screen { display: none; }
.screen.is-active { display: block; animation: rise .5s cubic-bezier(.2,.7,.3,1); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { opacity: 0; transform: translateY(10px) scale(.96); } 100% { opacity: 1; transform: none; } }

.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(24px, 4vw, 44px); }

/* ---------- Intro / greeting ---------- */
.greeting { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: .95rem; color: var(--primary-ink); background: var(--primary-soft); border: 1px solid var(--line-2); padding: 8px 14px 8px 10px; border-radius: 999px; margin-bottom: 18px; animation: pop .5s both; }
.greeting .wave { display: inline-block; font-size: 1.1rem; transform-origin: 70% 70%; animation: wave 2.4s ease-in-out infinite; }
@keyframes wave { 0%,60%,100%{transform:rotate(0)} 10%{transform:rotate(16deg)} 20%{transform:rotate(-8deg)} 30%{transform:rotate(16deg)} 40%{transform:rotate(-4deg)} 50%{transform:rotate(10deg)} }

.hero .lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 60ch; }
.domain-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 28px 0; }
.domain { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; transition: .22s; animation: pop .5s both; box-shadow: var(--shadow-sm); }
.domain:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.domain:nth-child(1){ animation-delay:.05s } .domain:nth-child(2){ animation-delay:.12s } .domain:nth-child(3){ animation-delay:.19s } .domain:nth-child(4){ animation-delay:.26s }
.domain-icon { display: inline-grid; place-items: center; min-width: 42px; height: 42px; padding: 0 10px; border-radius: 13px; color: #fff; font-weight: 800; font-size: .9rem; margin-bottom: 12px; }
.domain:nth-child(1) .domain-icon { background: linear-gradient(135deg, var(--c-abstract), #a48bff); }
.domain:nth-child(2) .domain-icon { background: linear-gradient(135deg, var(--c-numeric), #4fd6d1); }
.domain:nth-child(3) .domain-icon { background: linear-gradient(135deg, var(--c-verbal), #ff8bae); }
.domain:nth-child(4) .domain-icon { background: linear-gradient(135deg, var(--c-spatial), #ffc070); }
.domain h3 { margin-bottom: 5px; }
.domain p { margin: 0; font-size: .9rem; color: var(--ink-soft); }

.meta-row { display: flex; gap: 14px; flex-wrap: wrap; margin: 8px 0 24px; }
.meta { display: flex; flex-direction: column; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 26px; min-width: 100px; box-shadow: var(--shadow-sm); }
.meta-num { font-size: 1.8rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.meta-label { font-size: .78rem; color: var(--ink-soft); }

.howto { margin: 0 0 18px; border: 1px solid var(--line); border-radius: 16px; padding: 4px 18px; background: var(--surface); box-shadow: var(--shadow-sm); }
.howto summary { cursor: pointer; font-weight: 700; padding: 13px 0; }
.howto ul { margin: 0 0 12px; padding-left: 20px; color: var(--ink-soft); }
.howto li { margin: 7px 0; }

.disclaimer { display: block; background: color-mix(in srgb, var(--flag) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--flag) 32%, var(--line)); border-radius: 14px; padding: 14px 16px; font-size: .9rem; margin: 18px 0; color: var(--ink-soft); }
.disclaimer strong { color: var(--flag); margin-right: 4px; }
.resume-line { margin: 12px 0 0; }

/* ---------- Buttons ---------- */
.btn { font: inherit; font-weight: 700; cursor: pointer; border-radius: 999px; padding: 12px 24px; border: 1px solid transparent; transition: .18s; line-height: 1; }
.btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: var(--glow); background-size: 160% 160%; }
.btn-primary:hover { transform: translateY(-2px) scale(1.01); background-position: 100% 0; }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.btn-lg { padding: 16px 34px; font-size: 1.08rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
#btn-start { animation: pulse 2.8s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: var(--glow); } 50% { box-shadow: 0 14px 40px rgba(255, 92, 160, .5); } }

/* ---------- Test ---------- */
.test-topbar { margin-bottom: 24px; }
.progress-wrap { margin-bottom: 14px; }
.progress-bar { height: 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--grad); background-size: 200% 100%; transition: width .35s ease; animation: shimmer 3s linear infinite; }
@keyframes shimmer { to { background-position: 200% 0; } }
.test-status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.q-counter { font-weight: 800; }
.domain-tag { font-size: .76rem; font-weight: 700; color: #fff; background: var(--grad); padding: 4px 12px; border-radius: 999px; }
.timer { margin-left: auto; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 600; background: var(--surface); border: 1px solid var(--line); padding: 5px 14px; border-radius: 999px; box-shadow: var(--shadow-sm); }
.timer.is-low { color: #fff; background: var(--bad); border-color: var(--bad); animation: blink 1s step-start infinite; }
@keyframes blink { 50% { opacity: .55; } }

.q-prompt { font-size: 1.2rem; font-weight: 700; margin-bottom: 18px; }
.q-stem { margin-bottom: 24px; }

.matrix { display: inline-grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; }
.cell { width: 84px; height: 84px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; display: grid; place-items: center; }
.cell.missing { background: var(--primary-soft); border: 2px dashed var(--primary); }
.cell svg, .opt svg { width: 100%; height: 100%; }
.cell .qmark { font-size: 2rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.sequence { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 1.7rem; font-weight: 800; }
.seq-num { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; min-width: 56px; text-align: center; font-variant-numeric: tabular-nums; box-shadow: var(--shadow-sm); }
.seq-q { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.seq-sep { color: var(--muted); font-size: 1.3rem; }

.analogy { font-size: 1.45rem; font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.analogy .word { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 16px; box-shadow: var(--shadow-sm); }
.analogy .rel { color: var(--muted); }
.analogy .blank { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }

.spatial-stem { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.figure-box { width: 110px; height: 110px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.figure-box svg { width: 84px; height: 84px; }

.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.options.opt-text { grid-template-columns: 1fr; max-width: 500px; }
.opt { position: relative; cursor: pointer; background: var(--surface); border: 2px solid var(--line); border-radius: 14px; padding: 14px; display: grid; place-items: center; gap: 6px; transition: .14s; color: var(--ink); font: inherit; text-align: center; box-shadow: var(--shadow-sm); }
.opt:hover { border-color: var(--primary-2); transform: translateY(-3px); box-shadow: var(--shadow); }
.opt:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; }
.opt.selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
.opt.selected::after { content: "✓"; position: absolute; top: 5px; right: 8px; font-size: .8rem; font-weight: 800; color: var(--primary); }
.opt .opt-key { position: absolute; top: 6px; left: 9px; font-size: .72rem; font-weight: 700; color: var(--muted); }
.opt-text .opt { min-height: 54px; font-size: 1.05rem; font-weight: 600; }
.opt-figure { width: 92px; height: 92px; }
.opt-num { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }

.test-nav { display: flex; gap: 10px; margin-top: 28px; flex-wrap: wrap; }
.test-nav .btn-primary { margin-left: auto; }
#btn-flag.is-flagged { color: var(--flag); border-color: var(--flag); }

/* ---------- Review ---------- */
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 8px; margin: 18px 0; }
.review-cell { aspect-ratio: 1; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink-soft); transition: .14s; font: inherit; font-weight: 800; }
.review-cell:hover { border-color: var(--primary); transform: translateY(-2px); }
.review-cell.answered { background: var(--grad); color: #fff; border-color: transparent; }
.review-cell.flagged { box-shadow: inset 0 0 0 3px var(--flag); }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: .85rem; color: var(--ink-soft); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 14px; height: 14px; border-radius: 5px; display: inline-block; border: 2px solid var(--line); }
.dot-answered { background: var(--primary); border-color: var(--primary); }
.dot-blank { background: var(--surface); }
.dot-flag { border-color: var(--flag); }

/* ---------- Result ---------- */
.score-hero { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; margin: 10px 0 26px; padding: 30px; border-radius: var(--radius); position: relative; overflow: hidden; background: var(--grad-score); color: #fff; box-shadow: var(--shadow-lg); }
.score-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.28) 50%, transparent 70%); transform: translateX(-100%); animation: sweep 3.2s ease-in-out .3s 1; }
@keyframes sweep { to { transform: translateX(100%); } }
.score-gauge { width: 172px; height: 172px; flex: 0 0 auto; }
.score-main { flex: 1; min-width: 220px; position: relative; }
.score-label { color: rgba(255,255,255,.8); font-size: .85rem; font-weight: 600; }
.score-range { font-size: clamp(2.7rem, 8vw, 3.8rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.04; color: #fff; text-shadow: 0 4px 24px rgba(0,0,0,.2); }
.score-sub { color: rgba(255,255,255,.82); font-size: .95rem; }
.score-sub strong { color: #fff; }
#score-band strong { display: inline-block; margin-top: 6px; padding: 5px 14px; border-radius: 999px; background: rgba(255,255,255,.18); color: #fff; font-size: .9rem; font-weight: 700; backdrop-filter: blur(4px); }

.bars { display: grid; gap: 14px; margin: 14px 0 8px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 52px; align-items: center; gap: 12px; }
.bar-name { font-size: .9rem; font-weight: 700; }
.bar-track { height: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; width: 0; transition: width .9s cubic-bezier(.2,.7,.3,1); }
.bar-row:nth-child(1) .bar-fill { background: linear-gradient(90deg, var(--c-abstract), #a48bff); }
.bar-row:nth-child(2) .bar-fill { background: linear-gradient(90deg, var(--c-numeric), #4fd6d1); }
.bar-row:nth-child(3) .bar-fill { background: linear-gradient(90deg, var(--c-verbal), #ff8bae); }
.bar-row:nth-child(4) .bar-fill { background: linear-gradient(90deg, var(--c-spatial), #ffc070); }
.bar-val { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-soft); }

.answers-review { margin: 18px 0; border: 1px solid var(--line); border-radius: 16px; padding: 4px 18px; background: var(--surface); box-shadow: var(--shadow-sm); }
.answers-review summary { cursor: pointer; font-weight: 700; padding: 14px 0; }
.answers-list { display: grid; gap: 10px; padding-bottom: 14px; }
.ans-item { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: .9rem; }
.ans-badge { width: 28px; height: 28px; flex: 0 0 auto; border-radius: 9px; display: grid; place-items: center; font-weight: 800; color: #fff; }
.ans-badge.ok { background: var(--good); }
.ans-badge.no { background: var(--bad); }
.ans-text { flex: 1; }
.ans-text b { color: var(--ink); }

/* share / monetization */
.share-row { display: flex; align-items: center; gap: 10px; margin: 18px 0 6px; flex-wrap: wrap; }
.share-label { color: var(--ink-soft); font-weight: 700; font-size: .85rem; }
.share-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; transition: .15s; box-shadow: var(--shadow-sm); }
.share-btn:hover { transform: translateY(-3px); color: #fff; box-shadow: var(--shadow); }
.share-btn svg { display: block; }
.share-tg:hover { background: #29a9eb; border-color: #29a9eb; }
.share-wa:hover { background: #25d366; border-color: #25d366; }
.share-x:hover { background: #111; border-color: #111; }
.share-fb:hover { background: #1877f2; border-color: #1877f2; }
.share-native:hover { background: var(--primary); border-color: var(--primary); }

.ad-slot { margin: 18px 0; padding: 10px; border: 1px dashed var(--line-2); border-radius: 14px; text-align: center; background: var(--surface-2); }
.ad-slot[hidden] { display: none; }
.ad-label { display: block; font-size: .7rem; color: var(--muted); margin-bottom: 6px; }

.donate-panel { margin: 18px 0; padding: 20px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.donate-panel::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--grad); }
.donate-panel[hidden] { display: none; }
.donate-panel h3 { margin: 4px 0 4px; }
.donate-methods { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 4px; }
.donate-btn { font: inherit; font-weight: 700; cursor: pointer; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); border-radius: 12px; padding: 10px 18px; transition: .15s; box-shadow: var(--shadow-sm); }
.donate-btn:hover { transform: translateY(-2px); color: #fff; }
.dm-payoneer:hover { background: #ff4800; border-color: #ff4800; }
.dm-paypal:hover { background: #0070ba; border-color: #0070ba; }
.dm-payme:hover { background: #33b9c9; border-color: #33b9c9; }
.dm-click:hover { background: #0098eb; border-color: #0098eb; }
.donate-copy { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.dc-label { font-weight: 700; font-size: .9rem; }
.dc-value { font-family: var(--font-mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px; font-size: .9rem; word-break: break-all; }
.dc-copy { padding: 7px 14px !important; font-size: .82rem; }
.donate-qr { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 14px 0; }
.dq-img { width: 184px; height: 184px; border-radius: 14px; background: #fff; padding: 8px; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.dq-cap { text-align: center; font-size: .78rem; color: var(--ink-soft); }

/* history */
.history-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; margin: 0 0 18px; box-shadow: var(--shadow-sm); }
.history-panel h3 { margin: 0 0 10px; }
.history-list { display: grid; gap: 8px; }
.history-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.h-score { font-weight: 800; font-size: 1.1rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.h-meta { text-align: right; font-size: .8rem; color: var(--ink-soft); }

/* footer */
.site-footer { position: relative; z-index: 1; }
.site-footer .container { display: flex; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 26px; }
.site-footer p { font-size: .8rem; }
.site-footer a { color: var(--ink-soft); }
.site-footer a:hover { color: var(--primary); }

/* cookie */
.cookie-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 50; max-width: 580px; width: calc(100% - 32px); display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); border-radius: 16px; padding: 13px 17px; font-size: .88rem; color: var(--ink-soft); }
.cookie-bar[hidden] { display: none; }
.cookie-bar a { color: var(--primary); }
.cookie-bar .btn { padding: 9px 18px; font-size: .85rem; white-space: nowrap; }

/* confetti (result reward) */
.confetti-piece { position: fixed; top: -12px; width: 9px; height: 14px; z-index: 60; pointer-events: none; border-radius: 2px; animation: confall linear forwards; }
@keyframes confall { to { transform: translateY(105vh) rotate(720deg); opacity: .9; } }

@media (max-width: 560px) {
  .cell { width: 64px; height: 64px; }
  .bar-row { grid-template-columns: 104px 1fr 44px; }
  .sequence, .analogy { font-size: 1.25rem; }
  .test-nav .btn { flex: 1; }
  .test-nav .btn-primary { margin-left: 0; }
  .score-hero { padding: 22px; }
}
@media print {
  body::before, body::after { display: none; }
  .site-header, .site-footer, .test-nav, .answers-review summary, .cookie-bar { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: none; }
  .answers-review[open] .answers-list { display: grid; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
