:root {
	--bg: #f5f6fb;
	--card: #ffffff;
	--ink: #16162a;
	--muted: #646480;
	--line: #e4e5f0;
	--cell: #f1f2fa;
	--accent: #5046e5;
	--accent-ink: #ffffff;
	--accent-soft: #ecebfe;
	--ok: #16a34a;
	--bad: #dc2626;
	--radius: 18px;
	--shadow: 0 1px 2px rgba(22, 22, 60, .04), 0 10px 30px rgba(22, 22, 60, .07);
	--grad: linear-gradient(135deg, #4338ca 0%, #6d28d9 55%, #9333ea 100%);
	--wide: 1080px;
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0e0e16;
		--card: #181824;
		--ink: #ececf4;
		--muted: #9b9bb2;
		--line: #2a2a3b;
		--cell: #222233;
		--accent: #8b84ff;
		--accent-ink: #0e0e16;
		--accent-soft: #26244a;
		--ok: #4ade80;
		--bad: #f87171;
		--shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .25);
		--grad: linear-gradient(135deg, #3730a3 0%, #5b21b6 55%, #7e22ce 100%);
		color-scheme: dark;
	}
}

* { box-sizing: border-box; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans KR", "Noto Sans JP", "Noto Sans SC", sans-serif;
	-webkit-font-smoothing: antialiased;
	word-break: keep-all;
	overflow-wrap: anywhere;
}

a { color: inherit; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1.05rem; }
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }

/* 머리말 · 꼬리말 */
.topbar {
	position: sticky; top: 0; z-index: 20;
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	height: 64px; padding-inline: max(16px, calc((100% - var(--wide)) / 2));
	background: color-mix(in srgb, var(--bg) 82%, transparent);
	backdrop-filter: saturate(1.4) blur(12px);
	border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; text-decoration: none; letter-spacing: -.01em; white-space: nowrap; }
.logo { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--grad); color: #fff; font-size: 14px; }
.nav { display: flex; align-items: center; gap: 14px; }
.nav-link { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; white-space: nowrap; }
.nav-link:hover { color: var(--ink); }
#lang { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font: inherit; font-size: 14px; }

main { max-width: var(--wide); margin: 0 auto; padding: 0 16px; }
main[data-view="test"], main[data-view="result"] { max-width: 720px; }

.footer { max-width: var(--wide); margin: 48px auto 0; padding: 32px 16px 48px; border-top: 1px solid var(--line); }
.footer p { color: var(--muted); font-size: 13px; text-align: center; margin: 0 0 8px; }
.footer-links { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }
.footer-links a { text-decoration: none; font-weight: 600; }
.footer-links a:hover { color: var(--ink); }

/* 공통 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin: 16px 0; box-shadow: var(--shadow); }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.narrow-text { max-width: 620px; margin: 0 auto 28px; }
.eyebrow { color: var(--accent); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 10px; }
.eyebrow a { text-decoration: none; }
.lead { color: var(--muted); font-size: 1.12rem; margin: 0 0 28px; }

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 12px;
	padding: 12px 20px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
	transition: transform .12s, box-shadow .2s, opacity .2s, background .2s;
}
.btn:hover { box-shadow: 0 6px 18px rgba(80, 70, 229, .25); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: default; box-shadow: none; }
.btn-lg { padding: 16px 28px; font-size: 1.05rem; border-radius: 14px; }
.btn-ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--accent); box-shadow: none; }
.btn-light { background: #fff; color: #3730a3; }
.btn-light:hover { box-shadow: 0 10px 28px rgba(0, 0, 0, .25); }
.btn-glass { background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .35); }
.btn-glass:hover { background: rgba(255, 255, 255, .2); box-shadow: none; }

.ico { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.block { margin: 72px 0; }
.section-title { font-size: clamp(1.45rem, 3.2vw, 2rem); font-weight: 800; letter-spacing: -.02em; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.more-link { color: var(--accent); font-weight: 700; text-decoration: none; }

/* 첫 화면: JS가 그리기 전에 보이는 소개 글 (검색 엔진용, 곧바로 화면으로 바뀐다) */
.seo-intro { max-width: 720px; margin: 40px auto; }
.seo-intro h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); font-weight: 800; letter-spacing: -.02em; }
.seo-intro p, .seo-intro li { color: var(--muted); }

/* 첫 화면: 히어로 */
.hero {
	position: relative; overflow: hidden; overflow: clip;
	display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 24px;
	margin-top: 20px; padding: 56px 52px; border-radius: 28px;
	background: var(--grad); color: #fff;
	box-shadow: 0 30px 60px -20px rgba(67, 56, 202, .45);
}
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.hero::before { width: 520px; height: 520px; right: -160px; top: -200px; background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 65%); }
.hero::after { width: 380px; height: 380px; left: -140px; bottom: -200px; background: radial-gradient(circle, rgba(244, 114, 182, .35), transparent 65%); }
.hero-copy { position: relative; z-index: 1; }
.badge { display: inline-block; margin: 0 0 18px; padding: 6px 14px; border-radius: 99px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25); font-size: 14px; font-weight: 600; }
.hero h1 { font-size: clamp(2.1rem, 5.2vw, 3.4rem); font-weight: 800; letter-spacing: -.03em; margin-bottom: .35em; }
.hero .lead { color: rgba(255, 255, 255, .86); font-size: 1.18rem; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 32px; }
.hero-feats { display: flex; gap: 28px; list-style: none; padding: 0; margin: 0; color: rgba(255, 255, 255, .8); font-size: 14px; }
.hero-feats b { display: block; font-size: 1.5rem; color: #fff; line-height: 1.2; }
.guest-line { margin: 20px 0 0; font-size: 13px; color: rgba(255, 255, 255, .7); }
.hero-art { position: relative; z-index: 1; display: flex; justify-content: center; }
.hero-art img { width: 100%; max-width: 480px; }

.stat-strip { display: grid; grid-template-columns: repeat(3, 1fr); list-style: none; padding: 20px; margin: 20px 0 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; color: var(--muted); font-size: 14px; }
.stat-strip b { display: block; font-size: 1.7rem; color: var(--ink); font-variant-numeric: tabular-nums; }

.history { display: flex; flex-wrap: wrap; gap: 10px; }
.h-item { display: flex; align-items: baseline; gap: 10px; padding: 10px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; box-shadow: var(--shadow); }
.h-item:hover { border-color: var(--accent); }
.h-iq { font-weight: 800; font-size: 1.25rem; color: var(--accent); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 28px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.step p, .area p { color: var(--muted); margin: 0; font-size: 15px; }
.step-ico { position: relative; display: inline-grid; place-items: center; width: 54px; height: 54px; margin-bottom: 18px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); }
.step-ico i { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--grad); color: #fff; font: 700 12px/1 system-ui, sans-serif; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.split.reverse > :first-child { order: 2; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 32px; box-shadow: var(--shadow); }
.panel .demo-opts { margin: 28px auto 0; }
.panel .seq { padding-bottom: 24px; border-bottom: 1px dashed var(--line); }
#demo .muted { font-size: 1.05rem; }
.demo-msg { font-weight: 700; margin: 16px 0; }
.demo-msg:empty { display: none; }
.demo-msg.ok { color: var(--ok); }
.demo-msg.bad { color: var(--bad); }
.checks { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 14px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; font-weight: 500; }
.checks .ico { color: #fff; background: var(--ok); border-radius: 50%; padding: 4px; width: 26px; height: 26px; stroke-width: 3; }

.sample { position: relative; text-align: center; }
.sample p { margin: 0; }
.sample .bar-row { text-align: left; }
.sample-tag { position: absolute; top: -10px; right: -6px; padding: 4px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; }

.areas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 28px; }
.area { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.area .ico { width: 48px; height: 48px; padding: 12px; border-radius: 14px; margin-bottom: 14px; color: #fff; }
.area-numeric .ico { background: #0ea5e9; }
.area-pattern .ico { background: #8b5cf6; }
.area-spatial .ico { background: #f59e0b; }
.area-logic .ico { background: #10b981; }

.bands { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.band { display: grid; gap: 2px; padding: 18px 14px; background: var(--card); border: 1px solid var(--line); border-top: 6px solid var(--c); border-radius: 16px; text-align: center; box-shadow: var(--shadow); }
.band b { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.band span { font-weight: 600; font-size: 14px; }
.band small { color: var(--c); font-weight: 800; font-size: 1.1rem; }
.band-0 { --c: #f43f5e; }
.band-1 { --c: #f59e0b; }
.band-2 { --c: #6366f1; }
.band-3 { --c: #10b981; }
.band-4 { --c: #a855f7; }
.band-chip { display: inline-block; margin-top: 8px !important; padding: 4px 14px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px; }

/* 국기 · 닉네임 */
.flag { display: inline-block; width: 24px; height: 18px; border-radius: 3px; object-fit: cover; vertical-align: -3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); flex: none; }
.flag-none { box-shadow: none; text-align: center; line-height: 18px; font-size: 15px; }
.link-btn { background: none; border: 0; padding: 0; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.guest-line .flag { margin-right: 4px; }
.player { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 6px !important; padding: 6px 14px; border-radius: 99px; background: var(--cell); font-size: 15px; }

.nick-dialog { width: min(420px, calc(100% - 32px)); padding: 28px; border: 0; border-radius: 22px; background: var(--card); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .3); }
.nick-dialog::backdrop { background: rgba(14, 14, 30, .55); backdrop-filter: blur(3px); }
.nick-dialog h2 { font-size: 1.35rem; margin-bottom: .3em; }
.nick-field { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 0 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--bg); }
.nick-field:focus-within { border-color: var(--accent); }
.nick-field input { flex: 1; min-width: 0; padding: 14px 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 1.05rem; }
.nick-error { min-height: 1.4em; margin: 8px 0 4px; color: var(--bad); font-size: 14px; }
.nick-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* 랭킹 */
.rank-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.rank-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); min-width: 0; }
.rank-card h3 { font-size: 1.15rem; margin: 0 0 12px; }
.rank-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.rank-card-head h3 { margin: 0; }
.tabs { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--cell); }
.tabs button { border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.rank-list { list-style: none; padding: 0; margin: 0; }
.rank-list li, .r-head { display: grid; grid-template-columns: 30px 1fr 56px; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.rank-list.countries li { grid-template-columns: 30px 1fr 72px 56px; }
.r-head { border-top: 0; padding: 0 0 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.r-head span:nth-child(n+3), .rank-list .r-sub, .rank-list .r-val { text-align: right; }
.rank-list .r-head { padding-top: 0; border-top: 0; }
.r-pos { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 13px; font-weight: 800; color: var(--muted); }
.top-1 .r-pos { background: #fbbf24; color: #78350f; }
.top-2 .r-pos { background: #d1d5db; color: #374151; }
.top-3 .r-pos { background: #f0b27a; color: #7c2d12; }
.r-name { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; }
.r-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sample-chip { flex: none; padding: 1px 7px; border-radius: 99px; background: var(--cell); color: var(--muted); font-size: 11px; font-weight: 700; }
.r-sub { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.r-val { font-size: 1.05rem; font-variant-numeric: tabular-nums; color: var(--accent); }
.rank-empty { margin: 8px 0 0; padding: 28px 12px; border: 1px dashed var(--line); border-radius: 12px; text-align: center; color: var(--muted); }
.rank-note { max-width: 720px; margin: 16px auto 0; }

/* 읽을거리 카드 */
.a-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; margin-top: 20px; }
.a-grid.three { grid-template-columns: repeat(3, 1fr); }
.a-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s; }
.a-card:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(22, 22, 60, .12); }
.a-card img { display: block; width: 100%; aspect-ratio: 800 / 420; object-fit: cover; }
.a-card-body { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px 20px; flex: 1; }
.a-card-body b { font-size: 1.08rem; line-height: 1.35; }
.a-card-body span { color: var(--muted); font-size: 14px; }
.a-card-body small { color: var(--accent); font-weight: 700; font-size: 13px; margin-top: auto; padding-top: 6px; }

.faq { max-width: 780px; margin: 24px auto 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.faq details { border-top: 1px solid var(--line); }
.faq details:first-child { border-top: 0; }
.faq summary { display: flex; justify-content: space-between; gap: 16px; padding: 18px 24px; font-weight: 700; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.4rem; line-height: 1; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0; padding: 0 24px 20px; color: var(--muted); }

.cta-band {
	display: flex; align-items: center; justify-content: space-between; gap: 32px;
	margin: 72px 0 24px; padding: 44px 48px; border-radius: 28px;
	background: var(--grad); color: #fff;
}
.cta-band h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); font-weight: 800; letter-spacing: -.02em; margin-bottom: .3em; }
.cta-band p { margin: 0; color: rgba(255, 255, 255, .85); }
.cta-band .rules { margin: 14px 0 0; color: rgba(255, 255, 255, .78); font-size: 14px; }
.cta-band .btn { flex: none; }
.rules { margin: 0; padding-left: 1.3em; }
.rules li { margin: 4px 0; }

/* 읽을거리 페이지 */
.learn-head { text-align: center; margin: 48px auto 8px; max-width: 680px; }
.learn-head h1 { font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 800; letter-spacing: -.03em; }
.prose { max-width: 720px; margin: 40px auto 0; font-size: 17px; line-height: 1.8; }
.prose h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); font-weight: 800; letter-spacing: -.03em; margin-bottom: .3em; }
.prose .lead { margin-bottom: 8px; }
.prose h2 { font-size: 1.45rem; font-weight: 800; letter-spacing: -.01em; margin: 2em 0 .6em; }
.prose h3 { font-size: 1.12rem; margin: 1.6em 0 .4em; }
.prose p, .prose ul { margin: 0 0 1.1em; }
.prose li { margin: 6px 0; }
.prose em { font-style: italic; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.4em; font-size: 15px; background: var(--card); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.prose th, .prose td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.prose th { background: var(--cell); font-weight: 700; }
.a-hero { display: block; width: 100%; border-radius: 22px; margin: 20px 0 36px; box-shadow: var(--shadow); }
main.learn .cta-band { margin-top: 56px; }

/* 응시 화면 */
.test { padding: 16px 0; }
.test-top { display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.timer { font-variant-numeric: tabular-nums; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 4px 10px; }
.timer.warn { color: var(--bad); border-color: var(--bad); }
.progress { height: 6px; background: var(--line); border-radius: 99px; margin: 12px 0 24px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--grad); transition: width .3s; }
.prompt { font-size: 1.15rem; text-align: center; }
.prompt.small { font-size: 15px; text-align: left; font-weight: 500; }

.figure { display: flex; justify-content: center; margin: 0 auto 24px; color: var(--ink); }
.figure .matrix { width: min(100%, 280px); }
.figure > .opt-svg { width: 150px; background: var(--cell); border-radius: 14px; }
.figure.sm .matrix { width: 200px; }
.figure.sm > .opt-svg { width: 100px; }
.cell-bg { fill: var(--cell); }
.cell-missing { fill: none; stroke: var(--accent); stroke-width: 3; stroke-dasharray: 8 6; }
.cell-q { fill: var(--accent); font: 700 44px system-ui, sans-serif; }
.piece { fill: currentColor; fill-opacity: .85; stroke: var(--card); stroke-width: 2; }

.seq, .pairs, .eq, .num-grid { font-size: clamp(1.4rem, 5vw, 1.9rem); font-weight: 700; font-variant-numeric: tabular-nums; }
.seq { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.seq span { background: var(--cell); border-radius: 12px; padding: 8px 14px; min-width: 56px; text-align: center; }
.q { color: var(--accent); }
.seq .q { outline: 2px dashed var(--accent); outline-offset: -2px; }
.pairs { display: grid; gap: 8px; }
.pairs div { display: flex; align-items: center; justify-content: center; gap: 14px; }
.pairs span { min-width: 48px; text-align: center; }
.pairs i { color: var(--muted); font-style: normal; }
.num-grid { border-collapse: separate; border-spacing: 8px; }
.num-grid td { background: var(--cell); border-radius: 12px; width: 76px; height: 64px; text-align: center; }
.eq { display: grid; gap: 10px; }
.eq-row { display: flex; align-items: center; justify-content: center; gap: 10px; }
.eq-row span { min-width: 22px; text-align: center; }
.sym { width: 34px; height: 34px; color: var(--accent); }

.options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 440px; margin: 0 auto; }
.opt {
	position: relative; display: grid; place-items: center; aspect-ratio: 1;
	background: var(--card); color: var(--ink); border: 2px solid var(--line); border-radius: 14px;
	padding: 8px; cursor: pointer; font: inherit; transition: border-color .15s, background .15s;
}
.options.text .opt { aspect-ratio: auto; min-height: 68px; }
button.opt:hover { border-color: var(--accent); }
.opt.selected { border-color: var(--accent); background: var(--accent-soft); }
.opt .letter { position: absolute; top: 6px; left: 9px; font-size: 12px; font-weight: 700; color: var(--muted); }
.opt-svg { width: 100%; max-width: 110px; }
.opt-text { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.options.sm { max-width: 360px; gap: 8px; margin-bottom: 8px; }
.options.sm .opt { cursor: default; }
.options.sm .opt-text { font-size: 1.15rem; }
.opt.is-answer { border-color: var(--ok); }
.opt.is-wrong { border-color: var(--bad); }
button.opt.is-answer { background: color-mix(in srgb, var(--ok) 12%, var(--card)); }
button.opt.is-wrong { background: color-mix(in srgb, var(--bad) 10%, var(--card)); }

.nav-row { display: flex; justify-content: space-between; gap: 12px; margin: 28px 0 20px; }
/* 문제 화면: 그림이 커서 화면이 길어져도 이전·다음 버튼이 늘 화면 아래에 보이게 붙여 둔다 */
.test .nav-row {
	position: sticky; bottom: 0; z-index: 5;
	margin: 24px 0 16px; padding: 12px 0;
	background: color-mix(in srgb, var(--bg) 88%, transparent);
	backdrop-filter: blur(10px);
	border-top: 1px solid var(--line);
}
/* 문항 번호: PC는 20개 한 줄, 좁은 화면은 10개씩 두 줄 (한두 개만 다음 줄로 떨어지지 않게 열 수를 고정) */
.dots { display: grid; grid-template-columns: repeat(20, 28px); justify-content: center; gap: 6px; }
.dot { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--muted); font-size: 12px; cursor: pointer; padding: 0; }
.dot.done { background: var(--accent-soft); color: var(--ink); border-color: transparent; }
.dot.cur { border-color: var(--accent); color: var(--ink); font-weight: 700; }

/* 결과 화면 */
.result { text-align: center; padding-top: 32px; }
.result p { margin: 0; }
.iq-label { font-weight: 600; margin-top: 8px !important; }
.iq { font-size: clamp(4rem, 18vw, 6rem); font-weight: 800; line-height: 1.05; letter-spacing: -.03em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bell { width: min(100%, 360px); margin: 12px auto 8px; display: block; }
.bell text { fill: var(--muted); font-size: 10px; }
.bell-line { fill: none; stroke: var(--ink); stroke-width: 2; opacity: .6; }
.bell-fill { fill: var(--accent); opacity: .25; }
.bell-mark { stroke: var(--accent); stroke-width: 2; }
.bell-dot { fill: var(--accent); }
.big-line { font-size: 1.1rem; font-weight: 600; margin: 8px 0 !important; }
.fig-card { display: flex; gap: 22px; align-items: flex-start; }
.fig-card h2 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; margin: 2px 0 8px; }
.fig-card p { margin: 0 0 10px; }
.fig-card .fig-note { margin: 4px 0 0; }
.fig-avatar { flex: none; display: grid; place-items: center; width: 72px; height: 72px; border-radius: 22px; color: #fff; }
.fig-avatar .ico { width: 36px; height: 36px; }
.area-numeric .fig-avatar { background: #0ea5e9; }
.area-pattern .fig-avatar { background: #8b5cf6; }
.area-spatial .fig-avatar { background: #f59e0b; }
.area-logic .fig-avatar { background: #10b981; }
.share { text-align: center; }
.share h2 { margin-bottom: .2em; }
.share-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
main[data-view="result"] .block { margin: 40px 0; }

.bar-row { display: grid; grid-template-columns: 88px 1fr 44px; align-items: center; gap: 10px; margin: 10px 0; font-size: 14px; }
.bar-row b { text-align: right; }
.bar { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--grad); border-radius: 99px; }
.stats { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 6px; }

.ad { margin: 24px 0; min-height: 100px; }
.ad-label { display: block; font-size: 11px; color: var(--muted); text-align: center; margin-bottom: 4px; letter-spacing: .04em; }
.ad-placeholder { display: grid; place-items: center; height: 100px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: 13px; }


#toast {
	position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 30;
	background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px;
	opacity: 0; pointer-events: none; transition: .25s; max-width: calc(100% - 32px); font-size: 14px;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
	.hero { grid-template-columns: 1fr; padding: 40px 28px 8px; text-align: center; }
	.hero-cta, .hero-feats { justify-content: center; }
	.hero-art img { max-width: 360px; }
	.areas { grid-template-columns: repeat(2, 1fr); }
	.split { grid-template-columns: 1fr; gap: 24px; }
	.split.reverse > :first-child { order: 0; }
	.rank-grid { grid-template-columns: 1fr; }
	.a-grid.three { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
	.cta-band { flex-direction: column; align-items: flex-start; padding: 36px 28px; }
}

@media (max-width: 640px) {
	.hero { padding: 32px 20px 0; border-radius: 22px; }
	.hero-cta .btn { flex: 1 1 100%; }
	.hero-feats { gap: 18px; }
	.nav { gap: 10px; }
	.block { margin: 52px 0; }
	.steps { grid-template-columns: 1fr; }
	.bands { grid-template-columns: 1fr; }
	.band { grid-template-columns: 96px 1fr auto; align-items: center; text-align: left; border-top-width: 1px; border-left: 6px solid var(--c); }
	.band b { white-space: nowrap; }
	.panel .seq { gap: 6px; font-size: 1.25rem; }
	.panel .seq span { min-width: 0; padding: 6px 10px; }
	.rank-card { padding: 18px 16px; }
	.rank-list.countries li { grid-template-columns: 26px 1fr 52px 48px; gap: 8px; }
	.panel { padding: 22px; }
	.cta-band .btn { width: 100%; }
	.dots { grid-template-columns: repeat(10, minmax(0, 30px)); }
	.dot { width: 100%; height: auto; aspect-ratio: 1; }
	/* 문제 화면: 그림이 커도 이전·다음 버튼이 늘 화면 아래에 보이게 붙여 둔다 */
	.test .nav-row { margin: 20px -16px 16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
	.test .nav-row .btn { flex: 1; }
	.figure { margin-bottom: 18px; }
	.figure .matrix { width: min(100%, 240px); }
}

@media (max-width: 420px) {
	/* 아주 좁은 화면에서는 로고만 남겨 메뉴가 줄바꿈되지 않게 한다 */
	.brand span:not(.logo) { display: none; }
	#lang { padding: 6px; font-size: 13px; max-width: 104px; }
}

@media (max-width: 480px) {
	.seq { gap: 6px; }
	.seq span { min-width: 0; padding: 6px 9px; }
	.share-row { display: grid; grid-template-columns: 1fr 1fr; }
	.share-row .btn:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
	.card { padding: 18px; }
	.fig-card { flex-direction: column; gap: 14px; }
	.options { gap: 8px; }
	.areas { grid-template-columns: 1fr; }
	.num-grid td { width: 64px; height: 56px; }
	.bar-row { grid-template-columns: 72px 1fr 40px; }
	.stat-strip b { font-size: 1.3rem; }
}
