/* ==========================================================
   smith lab — global styles
   ========================================================== */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Space+Grotesk:wght@500;700&display=swap');

:root {
  --bg: #0a0b0d;
  --bg-2: #111318;
  --panel: #14171d;
  --line: #23272f;
  --text: #e6e8eb;
  --muted: #7d8590;
  --accent: #c6ff3d;     /* acid lime */
  --accent-2: #ff3df2;   /* hot magenta */
  --accent-3: #3dd9ff;   /* cyan */
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: 'Space Grotesk', system-ui, sans-serif;
  --radius: 10px;
}

:root[data-theme="light"] {
  --bg: #f4f3ee;
  --bg-2: #ebe9e2;
  --panel: #ffffff;
  --line: #d9d6cc;
  --text: #15171a;
  --muted: #6b6f76;
  --accent: #5a7d00;
  --accent-2: #c2189f;
  --accent-3: #0077a8;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: -1px -1px;
  background-attachment: fixed;
}
body::before {
  /* vignette so the grid fades out */
  content: '';
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, transparent 0%, var(--bg) 70%);
  pointer-events: none;
  z-index: -1;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--accent); color: #000; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 12px; }
.logo { font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--text); letter-spacing: -0.02em; }
.logo:hover { text-decoration: none; }
.logo { display: inline-flex; align-items: center; }
.logo-img { width: 28px; height: 28px; margin-right: 8px; }
.logo .dot { color: var(--accent); }
.logo .cursor { display: inline-block; width: 9px; height: 18px; background: var(--accent); vertical-align: -3px; margin-left: 3px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.nav-links { display: flex; gap: 18px; align-items: center; font-size: 13px; }
.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--text); text-decoration: none; }

.btn-icon {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; height: 32px; min-width: 32px; padding: 0 8px; cursor: pointer;
  font-family: var(--mono); font-size: 13px;
}
.btn-icon:hover { border-color: var(--accent); }

/* ---------- hero ---------- */
.hero { padding: 96px 0 56px; }
.tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted);
  border: 1px solid var(--line); background: var(--panel);
  padding: 4px 10px; border-radius: 999px;
}
.tag .live { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.hero h1 {
  font-family: var(--display);
  font-size: clamp(48px, 10vw, 112px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin: 24px 0 20px;
}
.hero h1 .glitch {
  background: linear-gradient(90deg, var(--accent), var(--accent-3), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { color: var(--muted); max-width: 560px; margin: 0; }
.prompt { margin-top: 28px; color: var(--muted); font-size: 14px; }
.prompt .ps1 { color: var(--accent); }
.prompt #typed { color: var(--text); }
.prompt .caret { display: inline-block; width: 8px; height: 16px; background: var(--text); vertical-align: -2px; animation: blink 1s steps(1) infinite; }

/* ---------- mascot ---------- */
.hero-grid { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 32px; }
.mascot {
  position: relative; background: none; border: 0; padding: 56px 0 0; cursor: pointer;
  animation: bob 3.2s ease-in-out infinite;
}
.mascot img { width: 260px; height: auto; display: block; filter: drop-shadow(10px 10px 0 var(--accent-2)); transition: transform .2s; }
.mascot:hover img { transform: rotate(-4deg) scale(1.03); }
.mascot.hop img { animation: hop .45s ease; }
@keyframes bob { 50% { transform: translateY(-10px); } }
@keyframes hop { 40% { transform: translateY(-22px) rotate(4deg); } }
.bubble {
  position: absolute; top: 0; right: 40%; white-space: nowrap;
  background: var(--text); color: var(--bg); font-family: var(--mono); font-size: 13px; font-weight: 700;
  padding: 8px 12px; border-radius: 12px 12px 2px 12px;
  box-shadow: 4px 4px 0 var(--accent);
}

/* ---------- section ---------- */
section { padding: 48px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.section-head h2 { font-family: var(--display); font-size: 28px; margin: 0; letter-spacing: -0.02em; }
.section-head h2 .num { color: var(--accent); font-family: var(--mono); font-size: 14px; margin-right: 10px; vertical-align: middle; }

.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 0 10px; height: 38px; min-width: 260px;
}
.search:focus-within { border-color: var(--accent); }
.search input { flex: 1; background: transparent; border: 0; outline: 0; color: var(--text); font-family: var(--mono); font-size: 13px; }
kbd { font-family: var(--mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip {
  background: transparent; color: var(--muted); border: 1px dashed var(--line);
  font-family: var(--mono); font-size: 12px; padding: 4px 10px; border-radius: 999px; cursor: pointer;
}
.chip:hover { color: var(--text); }
.chip.on { color: #000; background: var(--accent); border: 1px solid var(--accent); }
.chip .n { opacity: .6; margin-left: 2px; }
.tools-head { margin-bottom: 12px; }
.tools-head .search { flex: 1 1 100%; min-width: 0; }
.cat-chips { gap: 6px; margin: 0 0 18px; }
.cat-chips .chip { font-size: 11px; padding: 3px 9px; }
.card .meta span.cat { color: var(--text); border: 1px solid var(--line); }

/* ---------- tool cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; color: var(--text); transition: transform .15s, border-color .15s, box-shadow .15s;
}
.card:hover { text-decoration: none; transform: translateY(-3px); border-color: var(--accent); box-shadow: 6px 6px 0 var(--accent); }
.card.soon { opacity: .5; pointer-events: none; }
.card .top { display: flex; justify-content: space-between; align-items: center; }
.card .icon { font-size: 22px; width: 42px; height: 42px; display: grid; place-items: center; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; }
.card .status { font-size: 11px; padding: 2px 8px; border-radius: 4px; border: 1px solid currentColor; }
.status.live { color: var(--accent); }
.status.beta { color: var(--accent-3); }
.status.soon { color: var(--muted); }
.card h3 { font-family: var(--display); font-size: 19px; margin: 4px 0 0; }
.card p { margin: 0; color: var(--muted); font-size: 13px; flex: 1; }
.card .meta { display: flex; gap: 6px; flex-wrap: wrap; }
.card .meta span { font-size: 11px; color: var(--muted); background: var(--bg-2); padding: 2px 7px; border-radius: 4px; }
.card .arrow { position: absolute; right: 18px; bottom: 16px; color: var(--muted); transition: transform .15s, color .15s; }
.card:hover .arrow { color: var(--accent); transform: translate(3px, -3px); }
.empty { color: var(--muted); padding: 40px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); padding: 28px 0 48px; margin-top: 40px; color: var(--muted); font-size: 12px; }
footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ==========================================================
   tool page shared layout
   ========================================================== */
.tool-head { padding: 48px 0 24px; }
.crumb { font-size: 12px; color: var(--muted); }
.crumb a { color: var(--muted); }
.tool-head h1 { font-family: var(--display); font-size: clamp(32px, 6vw, 52px); letter-spacing: -0.03em; margin: 8px 0; }
.tool-head p { color: var(--muted); margin: 0; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--bg-2); font-size: 12px; color: var(--muted); }
.panel-bar .dots { display: flex; gap: 6px; }
.panel-bar .dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); display: block; }
.panel-bar .dots i:nth-child(1) { background: #ff5f57; }
.panel-bar .dots i:nth-child(2) { background: #febc2e; }
.panel-bar .dots i:nth-child(3) { background: #28c840; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }

textarea.code {
  width: 100%; min-height: 360px; resize: vertical; display: block;
  background: transparent; color: var(--text); border: 0; outline: 0;
  font-family: var(--mono); font-size: 13px; line-height: 1.55; padding: 14px;
}
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.btn {
  font-family: var(--mono); font-size: 13px; cursor: pointer;
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: 8px; transition: all .12s;
}
.btn:hover { border-color: var(--text); }
.btn.primary { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 700; }
.btn.primary:hover { box-shadow: 3px 3px 0 var(--text); transform: translate(-1px, -1px); }
.msg { font-size: 12px; padding: 8px 12px; border-top: 1px solid var(--line); color: var(--muted); min-height: 34px; }
.msg.ok { color: var(--accent); }
.msg.err { color: #ff5f57; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--accent); color: #000; font-size: 13px; font-weight: 700;
  padding: 8px 16px; border-radius: 8px; opacity: 0; transition: all .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 760px) {
  .hero { padding-top: 48px; }
  .hero-grid { grid-template-columns: 1fr; }
  .mascot { order: -1; justify-self: start; padding-top: 48px; }
  .mascot img { width: 170px; }
  .bubble { right: auto; left: 120px; }
}
@media (max-width: 640px) {
  .search { min-width: 0; width: 100%; }
  .nav-links .hide-sm { display: none; }
}

/* ==========================================================
   money calculators (money/*)
   ========================================================== */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 860px) { .calc { grid-template-columns: 1fr; } }
.calc form { padding: 6px 0; }
.field { display: grid; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.field:last-child { border-bottom: 0; }
.field > label, .field > .lbl { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.field .hint { color: var(--accent-3); font-size: 11px; }
.inp { display: flex; align-items: center; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; }
.inp:focus-within { border-color: var(--accent); }
.inp input, .inp select {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--text);
  font-family: var(--mono); font-size: 16px; padding: 10px 0; color-scheme: dark;
}
:root[data-theme="light"] .inp input, :root[data-theme="light"] .inp select { color-scheme: light; }
.inp select option { background: var(--panel); }
.inp .unit { color: var(--muted); font-size: 13px; margin-left: 8px; white-space: nowrap; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.inp input[type=number] { width: 100%; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { cursor: pointer; }
.seg input { display: none; }
.seg span { display: inline-block; font-size: 13px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); }
.seg input:checked + span { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 700; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick button { font-family: var(--mono); font-size: 11px; background: transparent; color: var(--muted); border: 1px dashed var(--line); border-radius: 6px; padding: 3px 8px; cursor: pointer; }
.quick button:hover { color: var(--text); border-color: var(--text); }

.result { position: sticky; top: 72px; }
.big { padding: 22px 18px 18px; border-bottom: 1px solid var(--line); }
.big .k { font-size: 12px; color: var(--muted); }
.big .v { font-family: var(--display); font-size: clamp(32px, 5vw, 44px); font-weight: 700; color: var(--accent); line-height: 1.15; word-break: keep-all; }
.big .sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { font-weight: 500; text-align: right; }
.kv.minus b { color: #ff7b72; }
.kv.total { background: var(--bg-2); }
.kv.total b { font-weight: 700; }
.ratio-bar { display: flex; height: 10px; margin: 0 18px 16px; border-radius: 5px; overflow: hidden; background: var(--bg-2); }
.ratio-bar i { display: block; height: 100%; }

.sched-wrap { max-height: 520px; overflow: auto; }
table.sched { width: 100%; border-collapse: collapse; font-size: 13px; }
table.sched th, table.sched td { padding: 8px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.sched th { position: sticky; top: 0; background: var(--bg-2); color: var(--muted); font-weight: 400; z-index: 1; }
table.sched td:first-child, table.sched th:first-child { text-align: left; }
table.sched tr.hl td { color: var(--accent); }

.guide { margin-top: 28px; font-size: 14px; line-height: 1.85; color: var(--text); }
.guide h2 { font-family: var(--display); font-size: 22px; margin: 28px 0 8px; letter-spacing: -0.01em; }
.guide h3 { font-size: 15px; margin: 18px 0 6px; }
.guide p, .guide li { color: color-mix(in srgb, var(--text) 82%, var(--muted)); }
.guide ul, .guide ol { padding-left: 20px; }
.guide code { color: var(--accent); background: var(--bg-2); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.guide .note { font-size: 12px; color: var(--muted); border-left: 3px solid var(--line); padding-left: 12px; }
.related-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.related-tools a { font-size: 13px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; color: var(--text); background: var(--panel); }
.related-tools a:hover { border-color: var(--accent); text-decoration: none; }

/* ---------- faq / footer links ---------- */
.faq { display: grid; gap: 8px; }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 0 16px; }
.faq summary { cursor: pointer; padding: 12px 0; font-weight: 500; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: 'Q.'; color: var(--accent); margin-right: 8px; font-family: var(--mono); }
.faq details[open] summary { border-bottom: 1px dashed var(--line); }
.faq details > div { padding: 12px 0 14px; color: color-mix(in srgb, var(--text) 82%, var(--muted)); }
.foot-links { display: inline-flex; gap: 14px; flex-wrap: wrap; }
.foot-links a { color: var(--muted); }
.related-posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-top: 12px; }
.related-posts a { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; color: var(--text); }
.related-posts a:hover { border-color: var(--accent); text-decoration: none; }
.related-posts a small { display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.related-posts a b { display: block; font-weight: 500; line-height: 1.5; }
.related-posts a span { display: block; color: var(--muted); font-size: 12px; margin-top: 6px; line-height: 1.6; }

/* ---------- home: popular / categories / groups / about ---------- */
.popular { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; align-items: center; }
.popular .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-right: 4px; }
.popular a { font-size: 13px; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; }
.popular a:hover { border-color: var(--accent); text-decoration: none; }
.section-head h2 .count { font-family: var(--mono); font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.group-head { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: end; margin: 18px 0 2px; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.group-head:first-child { margin-top: 0; }
.group-head h3 { margin: 0; font-family: var(--display); font-size: 18px; }
.group-head h3 span { font-family: var(--mono); font-size: 12px; color: var(--muted); font-weight: 400; }
.group-head a { font-size: 12px; color: var(--muted); }
.about-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; }
.about-box h2 { font-family: var(--display); font-size: 24px; margin: 0 0 12px; }
.about-box h2 .num { color: var(--accent); font-family: var(--mono); font-size: 14px; margin-right: 10px; }
.about-box p { margin: 0 0 10px; line-height: 1.8; max-width: 760px; }
.about-box .muted { color: var(--muted); font-size: 13px; margin: 0; }
.section-head > a { font-size: 13px; color: var(--muted); }

/* ==========================================================
   games (games/*)
   ========================================================== */
.game { max-width: 640px; margin: 0 auto; }
.game .panel-bar b { color: var(--text); font-weight: 500; }
.game-stats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; border-bottom: 1px solid var(--line); }
.game-stats > div { padding: 10px 14px; border-right: 1px solid var(--line); min-width: 0; }
.game-stats > div:last-child { border-right: 0; }
.game-stats small { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; }
.game-stats b { display: block; font-family: var(--display); font-size: 22px; line-height: 1.2; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-stats .hl b { color: var(--accent); }
.game-stage { position: relative; padding: 16px; display: grid; place-items: center; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.game-controls { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--bg-2); }
.game-controls .grow { flex: 1; }
.game-controls .btn { padding: 7px 12px; }
.game-hint { font-size: 12px; color: var(--muted); padding: 0 16px 12px; text-align: center; }
.game-hint kbd { margin: 0 1px; }
.game-overlay {
  position: absolute; inset: 16px; display: grid; place-items: center; text-align: center; z-index: 3;
  background: color-mix(in srgb, var(--panel) 82%, transparent); backdrop-filter: blur(2px); border-radius: 10px;
}
.game-overlay[hidden] { display: none; }
.game-overlay h2 { font-family: var(--display); font-size: 30px; margin: 0 0 6px; letter-spacing: -0.02em; }
.game-overlay p { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.game-overlay .new { color: var(--accent); font-weight: 700; }
.game-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.game-seg button { font-family: var(--mono); font-size: 12px; padding: 6px 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer; }
.game-seg button.on { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 700; }
.record-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.record-table td, .record-table th { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: right; }
.record-table td:first-child, .record-table th:first-child { text-align: left; }
.record-table th { color: var(--muted); font-weight: 400; }

/* 2048 */
.g2048 { --gap: 10px; width: min(100%, 440px); aspect-ratio: 1; position: relative; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: var(--gap); touch-action: none; }
.g2048 .cells, .g2048 .tiles { position: absolute; inset: var(--gap); }
.g2048 .cells { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.g2048 .cells i { background: color-mix(in srgb, var(--line) 70%, transparent); border-radius: 8px; }
.g2048 .tile {
  position: absolute; width: calc((100% - 3 * var(--gap)) / 4); height: calc((100% - 3 * var(--gap)) / 4);
  display: grid; place-items: center; border-radius: 8px; font-family: var(--display); font-weight: 700;
  font-size: clamp(18px, 7vw, 38px); transition: transform .1s ease-in-out; will-change: transform;
}
.g2048 .tile span { display: block; }
.g2048 .tile.new span { animation: pop .18s ease .06s backwards; }
.g2048 .tile.merged span { animation: bump .18s ease .08s; }
@keyframes pop { from { transform: scale(0); } }
@keyframes bump { 50% { transform: scale(1.18); } }
.g2048 .tile[data-v="2"]    { background: #e8e4d8; color: #3a3833; }
.g2048 .tile[data-v="4"]    { background: #e5dcc2; color: #3a3833; }
.g2048 .tile[data-v="8"]    { background: #c6ff3d; color: #10130a; }
.g2048 .tile[data-v="16"]   { background: #9fe02a; color: #10130a; }
.g2048 .tile[data-v="32"]   { background: #3dd9ff; color: #04212a; }
.g2048 .tile[data-v="64"]   { background: #1fa8d6; color: #fff; }
.g2048 .tile[data-v="128"]  { background: #ff8c42; color: #fff; font-size: clamp(16px, 6vw, 32px); }
.g2048 .tile[data-v="256"]  { background: #ff6a3d; color: #fff; font-size: clamp(16px, 6vw, 32px); }
.g2048 .tile[data-v="512"]  { background: #ff3df2; color: #fff; font-size: clamp(16px, 6vw, 32px); }
.g2048 .tile[data-v="1024"] { background: #b02cff; color: #fff; font-size: clamp(13px, 4.8vw, 26px); }
.g2048 .tile[data-v="2048"] { background: #febc2e; color: #1a1300; font-size: clamp(13px, 4.8vw, 26px); box-shadow: 0 0 24px #febc2e; }
.g2048 .tile.big            { background: #15171a; color: #febc2e; font-size: clamp(11px, 4vw, 22px); border: 1px solid #febc2e; }
:root[data-theme="light"] .g2048 .tile[data-v="8"] { background: #b6ec2c; }
:root[data-theme="light"] .g2048 .cells i { background: #dcd8cc; }
:root[data-theme="light"] .g2048 .tile[data-v="2"] { background: #ffffff; box-shadow: 0 1px 0 #cfcabd; }
:root[data-theme="light"] .g2048 .tile[data-v="4"] { background: #fff1cf; box-shadow: 0 1px 0 #e3d3a8; }

/* reaction */
.react-pad {
  width: 100%; min-height: 320px; border-radius: 12px; border: 1px solid var(--line); cursor: pointer;
  display: grid; place-items: center; text-align: center; padding: 24px; touch-action: manipulation;
  font-family: var(--display); transition: background-color .05s; background: color-mix(in srgb, var(--accent-3) 14%, var(--bg-2)); color: var(--text);
}
.react-pad:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.react-pad .big-t { font-size: clamp(30px, 7vw, 52px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.react-pad .small-t { font-family: var(--mono); font-size: 14px; opacity: .8; margin-top: 10px; }
.react-pad.wait { background: #c2334d; color: #fff; border-color: #c2334d; }
.react-pad.go { background: #1baf7a; color: #04150e; border-color: #1baf7a; }
.react-pad.early { background: #febc2e; color: #1a1300; border-color: #febc2e; }
.react-tries { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 12px; width: 100%; }
.react-tries span { font-size: 12px; padding: 3px 9px; border: 1px dashed var(--line); border-radius: 999px; color: var(--muted); min-width: 64px; text-align: center; }
.react-tries span.done { border-style: solid; color: var(--text); }

/* minesweeper */
.ms-scroll { max-width: 100%; overflow: auto; -webkit-overflow-scrolling: touch; }
.ms-board { display: grid; gap: 2px; background: var(--line); border: 2px solid var(--line); border-radius: 8px; width: max-content; margin: 0 auto; touch-action: manipulation; }
.ms-board button {
  --s: 32px; width: var(--s); height: var(--s); padding: 0; border: 0; border-radius: 3px; cursor: pointer;
  font-family: var(--display); font-weight: 700; font-size: calc(var(--s) * .55); line-height: 1;
  background: color-mix(in srgb, var(--line) 70%, var(--muted)); color: var(--text);
  box-shadow: inset -2px -2px 0 rgba(0,0,0,.25), inset 2px 2px 0 rgba(255,255,255,.12);
}
.ms-board button:hover:not(.open) { filter: brightness(1.15); }
.ms-board button.open { background: var(--bg-2); box-shadow: none; cursor: default; }
.ms-board button.boom { background: #ff5f57; }
.ms-board button.wrong { text-decoration: line-through; }
.ms-board button.n1 { color: #3d8bff; } .ms-board button.n2 { color: #1baf7a; } .ms-board button.n3 { color: #ff5f57; }
.ms-board button.n4 { color: #b06cff; } .ms-board button.n5 { color: #ff8c42; } .ms-board button.n6 { color: #19b5c9; }
.ms-board button.n7 { color: var(--text); } .ms-board button.n8 { color: var(--muted); }
:root[data-theme="light"] .ms-board button.n1 { color: #1857c4; }
:root[data-theme="light"] .ms-board button.n2 { color: #0d7a52; }
:root[data-theme="light"] .ms-board button.n3 { color: #d1281f; }
:root[data-theme="light"] .ms-board button.n4 { color: #6a2bc2; }
:root[data-theme="light"] .ms-board button:not(.open) { background: #cfccc1; }
:root[data-theme="light"] .ms-board button { box-shadow: inset -2px -2px 0 rgba(0,0,0,.12), inset 2px 2px 0 rgba(255,255,255,.7); }
.ms-mode { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }

/* typing */
.type-target { font-family: 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif; font-size: clamp(18px, 4.4vw, 24px); line-height: 1.7; padding: 18px 18px 6px; letter-spacing: .01em; word-break: keep-all; width: 100%; }
.type-target .ok { color: var(--accent); }
.type-target .bad { color: #ff5f57; text-decoration: underline wavy; text-underline-offset: 5px; }
.type-target .cur { border-bottom: 2px solid var(--accent-3); }
.type-target .rest { color: var(--muted); }
.type-next { font-size: 13px; color: var(--muted); padding: 0 18px 10px; width: 100%; font-family: 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif; }
.type-input { width: 100%; font-family: 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif; font-size: 20px; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); outline: 0; }
.type-input:focus { border-color: var(--accent); }
.type-progress { height: 4px; background: var(--bg-2); width: 100%; border-radius: 2px; overflow: hidden; margin-top: 10px; }
.type-progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* number memory */
.mem-show { font-family: var(--display); font-weight: 700; font-size: clamp(28px, 9vw, 64px); letter-spacing: .06em; word-break: break-all; text-align: center; line-height: 1.15; }
.mem-bar { height: 6px; background: var(--bg-2); border-radius: 3px; width: min(320px, 100%); overflow: hidden; margin: 18px auto 0; }
.mem-bar i { display: block; height: 100%; background: var(--accent); width: 100%; }
.mem-box { min-height: 280px; width: 100%; display: grid; place-items: center; text-align: center; }
.mem-input { font-family: var(--display); font-size: 30px; text-align: center; letter-spacing: .08em; width: min(100%, 420px); padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); outline: 0; }
.mem-input:focus { border-color: var(--accent); }
.mem-cmp { font-family: var(--display); font-size: 22px; letter-spacing: .06em; word-break: break-all; }
.mem-cmp .x { color: #ff5f57; text-decoration: underline; }
.mem-cmp .o { color: var(--accent); }

/* snake */
.snake-canvas { display: block; width: min(100%, 480px); aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); touch-action: none; }
.dpad { display: none; grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(2, 48px); gap: 6px; justify-content: center; margin: 12px auto 0; }
.dpad button { font-size: 20px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; touch-action: manipulation; }
.dpad button:active { background: var(--accent); color: #000; }
.dpad .u { grid-column: 2; } .dpad .l { grid-column: 1; grid-row: 2; } .dpad .d { grid-column: 2; grid-row: 2; } .dpad .r { grid-column: 3; grid-row: 2; }
@media (pointer: coarse) { .dpad { display: grid; } }

/* other games list */
.game-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 12px; }
.game-list a { display: flex; gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; color: var(--text); }
.game-list a:hover { border-color: var(--accent); text-decoration: none; }
.game-list a span { font-size: 22px; }
.game-list a small { display: block; color: var(--muted); font-size: 11px; }
@media (max-width: 520px) {
  .game-stats > div { padding: 8px 10px; }
  .game-stats b { font-size: 18px; }
  .game-stats small { font-size: 10px; }
  .game-stage { padding: 12px 8px; }
  .game-overlay { inset: 12px 8px; }
  .game-controls { padding: 10px 12px; }
}

/* ==========================================================
   saju · today-fortune (life/saju, life/today-fortune)
   ========================================================== */
.saju-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.saju-form .field:last-child { border-bottom: 1px solid var(--line); }
.saju-form .field:nth-last-child(-n+2) { border-bottom: 0; }
.saju-out { margin-top: 14px; }
.saju-out .note { font-size: 12px; color: var(--muted); line-height: 1.7; }
.saju-sum { padding: 18px 18px 6px; border-bottom: 1px solid var(--line); }
.saju-sum h3 { font-family: var(--display); font-size: 19px; margin: 0 0 10px; }
.saju-sum > p { margin: 0 0 10px; line-height: 1.9; font-size: 15px; word-break: keep-all; }
.sum-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.sum-card { border: 1px solid var(--line); border-radius: 10px; padding: 13px 15px; background: var(--bg-2); }
.sum-card h4 { margin: 0 0 6px; font-size: 15px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.sum-card h4 small { color: var(--muted); font-weight: 400; font-size: 11px; }
.sum-card p { margin: 0; font-size: 14px; line-height: 1.8; word-break: keep-all; }
.sum-card .score { font-family: var(--display); color: var(--accent); margin-left: auto; font-size: 18px; }
.sum-luck { border: 1px dashed var(--accent); border-radius: 10px; padding: 12px 15px; margin: 0 0 14px; font-size: 14px; }
.sum-luck > span { color: var(--muted); font-size: 12px; margin-left: 4px; }
.luck-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.luck-chips span { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; background: var(--panel); }
.luck-chips b { color: var(--text); font-weight: 600; }
.saju-h { font-family: var(--display); font-size: 16px; margin: 0; padding: 16px 18px 8px; }
.saju-h small { font-family: var(--mono); font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.saju-tbl-wrap { overflow-x: auto; padding: 0 10px 8px; }
.saju-tbl { width: 100%; min-width: 300px; border-collapse: collapse; table-layout: fixed; text-align: center; }
.saju-tbl th { font-size: 13px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.saju-tbl th small { display: block; font-size: 10px; color: var(--muted); font-weight: 400; }
.saju-tbl td { padding: 5px 4px; font-size: 12px; }
.saju-tbl tr.tg td { color: var(--muted); }
.saju-tbl .ch { display: inline-grid; place-items: center; align-content: center; width: min(68px, 100%); aspect-ratio: 1; border-radius: 12px; font-size: 28px; font-weight: 700; line-height: 1.05; }
.saju-tbl .ch small { font-size: 10px; font-weight: 500; opacity: .85; }
.saju-tbl .ch.none { border: 1px dashed var(--line); color: var(--muted); }
.el0 { background: #2f9e44; color: #fff; } .el1 { background: #e03131; color: #fff; } .el2 { background: #f0b429; color: #1a1300; }
.el3 { background: #c9ced6; color: #15171a; } .el4 { background: #1f4e8c; color: #fff; }
.ohaeng { padding: 0 18px 10px; display: grid; gap: 8px; }
.oh-row { display: grid; grid-template-columns: 74px 1fr 34px 34px; gap: 10px; align-items: center; font-size: 13px; }
.oh-k { border-radius: 6px; padding: 3px 6px; font-size: 12px; text-align: center; white-space: nowrap; }
.oh-bar { height: 10px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); overflow: hidden; }
.oh-bar i { display: block; height: 100%; border-radius: 999px; }
.oh-row b { font-weight: 600; text-align: right; }
.oh-row .lv { font-size: 11px; color: var(--muted); }
.oh-row .lv0 { color: #ff5f57; } .oh-row .lv4 { color: #febc2e; }
.fortune-meter { height: 8px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); overflow: hidden; margin: 2px 0 8px; }
.fortune-meter i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.zodiac-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.zodiac-grid .sum-card.me { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.zodiac-grid .sum-card small.y { display: block; width: 100%; font-size: 11px; color: var(--muted); font-weight: 400; }
@media (max-width: 860px) { .sum-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .saju-form { grid-template-columns: 1fr; }
  .saju-form .field:nth-last-child(2) { border-bottom: 1px solid var(--line); }
  .saju-sum { padding: 16px 14px 4px; }
  .oh-row { grid-template-columns: 70px 1fr 30px 30px; gap: 8px; }
}
.fortune-note { font-size: 14px; line-height: 1.8; margin: 0 0 4px; }

/* sky-fighter (games/sky-fighter) */
.game.sky-game { max-width: 980px; }
.sky-stage { padding: 0; display: block; }
.sky-stage .game-overlay { inset: 0; border-radius: 0; }
.sky-host { position: relative; width: 100%; height: 480px; overflow: hidden; background: linear-gradient(#2f6fd6, #cfe6ff); touch-action: none; }
.sky-host > canvas:not(.arena-radar) { display: block; width: 100% !important; height: 100% !important; touch-action: none; cursor: crosshair; }
.sky-hud { position: absolute; left: 12px; right: 12px; top: 10px; display: flex; align-items: center; gap: 12px; pointer-events: none; z-index: 2; }
.sky-hp { width: min(220px, 45%); height: 10px; border-radius: 999px; background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 255, 255, .5); overflow: hidden; }
.sky-hp i { display: block; height: 100%; width: 100%; background: var(--accent); transition: width .2s; }
.sky-combo { font-family: var(--mono); font-weight: 700; font-size: 14px; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.sky-toast { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); font-family: var(--display); font-size: clamp(20px, 4vw, 34px); font-weight: 800; color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, .5); opacity: 0; transition: opacity .3s; pointer-events: none; white-space: nowrap; z-index: 2; }
.sky-flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(255, 40, 40, .75)); z-index: 1; }
.sky-pop { position: absolute; left: 0; top: 0; font-family: var(--mono); font-weight: 800; font-size: 15px; color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, .7); pointer-events: none; opacity: 0; z-index: 2; will-change: transform; }
.sky-pop.hot { color: #febc2e; font-size: 18px; }
.sky-pop.bad { color: #ff6b6b; }
.sky-pop.heal { color: #ff8fc7; }

/* ==========================================================
   side nav — category dropdown menu (injected by scripts/seo.py)
   ========================================================== */
.side-toggle { margin-right: 10px; font-size: 16px; }
.nav .wrap > .side-toggle + .logo { margin-right: auto; }
.side-nav {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 60; width: 286px; max-width: 86vw;
  display: flex; flex-direction: column; background: var(--bg-2); border-right: 1px solid var(--line);
  transform: translateX(-102%); transition: transform .22s ease; visibility: hidden;
}
.side-nav.open { transform: none; visibility: visible; box-shadow: 8px 0 32px rgba(0,0,0,.35); }
.sn-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.45); }
.sn-head { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); flex: none; }
.sn-head .logo { font-size: 16px; }
.sn-close { background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; width: 36px; height: 36px; border-radius: 8px; }
.sn-close:hover { color: var(--text); background: var(--panel); }
.sn-search { display: flex; align-items: center; gap: 8px; margin: 12px 12px 6px; padding: 0 10px; height: 38px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; flex: none; }
.sn-search:focus-within { border-color: var(--accent); }
.sn-search span { color: var(--muted); }
.sn-search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--text); font-size: 14px; font-family: inherit; }
.sn-body { flex: 1; overflow-y: auto; padding: 6px 8px 16px; overscroll-behavior: contain; }
.sn-top { display: block; padding: 9px 10px; border-radius: 8px; color: var(--text); font-size: 14px; }
.sn-top:hover { background: var(--panel); text-decoration: none; }
.sn-cat { border-radius: 8px; margin-top: 2px; }
.sn-cat summary { display: flex; align-items: center; gap: 2px; padding: 9px 10px; border-radius: 8px; cursor: pointer; list-style: none; font-size: 14px; font-weight: 600; user-select: none; }
.sn-cat summary::-webkit-details-marker { display: none; }
.sn-cat summary::after { content: '›'; margin-left: 8px; color: var(--muted); transition: transform .15s; font-size: 18px; line-height: 1; }
.sn-cat[open] summary::after { transform: rotate(90deg); }
.sn-cat summary:hover { background: var(--panel); }
.sn-cat summary em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--muted); font-family: var(--mono); font-weight: 400; }
.sn-cat[open] summary { color: var(--accent); }
.si { display: inline-block; width: 24px; text-align: center; flex: none; }
.sn-links { display: grid; padding: 2px 0 8px 10px; margin-left: 12px; border-left: 1px dashed var(--line); }
.sn-links a { display: flex; align-items: center; padding: 7px 8px; border-radius: 6px; color: var(--muted); font-size: 13.5px; line-height: 1.35; }
.sn-links a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.sn-links a.on { color: #000; background: var(--accent); font-weight: 600; }
.sn-links a.sn-all { font-size: 12px; color: var(--muted); padding-left: 32px; }
.sn-empty { color: var(--muted); font-size: 13px; padding: 12px; }
.sn-foot { flex: none; display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 11px; }
.sn-foot a { color: var(--muted); }
body.sn-lock { overflow: hidden; }
/* wide screens: pinned sidebar */
@media (min-width: 1440px) {
  .side-nav { transform: none; visibility: visible; box-shadow: none; z-index: 40; width: 268px; }
  .sn-backdrop, .sn-close { display: none !important; }
  body { padding-left: 268px; }
  .side-toggle { display: none; }
  body.sn-lock { overflow: auto; }
}
@media (prefers-reduced-motion: reduce) { .side-nav { transition: none; } }

/* ==========================================================
   surveys (survey/*) — 성향 테스트, assets/js/survey.js
   ========================================================== */
.sv { max-width: 640px; margin: 0 auto; }
.sv, .sv .btn, .sv-head > p, .sv-tgrid, .sv-types, .sv-others { font-family: system-ui, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif; }
.sv [hidden] { display: none !important; }
.sv-head p b { color: var(--text); }
.sv-start { padding: 26px 22px 22px; text-align: center; }
.sv-hero { font-size: 76px; line-height: 1.15; animation: sv-bob 2.6s ease-in-out infinite; }
@keyframes sv-bob { 50% { transform: translateY(-6px) rotate(-4deg); } }
.sv-intro { max-width: 32em; margin: 12px auto 16px; font-size: 15px; line-height: 1.85; word-break: keep-all; color: color-mix(in srgb, var(--text) 88%, var(--muted)); }
.sv-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 18px; }
.sv-meta span { font-size: 12px; color: var(--muted); background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.sv .sv-go { display: block; width: 100%; padding: 16px; font-size: 17px; border-radius: 12px; text-align: center; }
.sv .sv-go:hover { text-decoration: none; }
.sv-mine { display: block; width: 100%; margin-top: 10px; padding: 12px; border-radius: 12px; }
.sv-note { font-size: 12px; color: var(--muted); margin: 14px 0 0; line-height: 1.7; }
.sv-friend { margin: 0 0 16px; padding: 12px 14px; border: 1.5px dashed var(--accent-2); border-radius: 12px; background: color-mix(in srgb, var(--accent-2) 9%, transparent); font-size: 15px; }
.sv-friend b { color: var(--accent-2); }
.sv-friend small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; }

/* quiz */
.sv-quiz { padding: 0 0 18px; }
.sv-progress { height: 6px; background: var(--bg-2); }
.sv-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-3), var(--accent)); transition: width .35s ease; }
.sv-qhead { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 0; }
.sv-back { background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; padding: 8px 6px; cursor: pointer; border-radius: 6px; }
.sv-back:hover { color: var(--text); background: var(--bg-2); }
.sv-count { font-size: 13px; color: var(--muted); padding-right: 6px; }
.sv-count b { color: var(--accent); font-size: 16px; }
.sv-qbody { padding: 6px 18px 0; }
.sv-qbody.in-r { animation: sv-in-r .28s ease both; }
.sv-qbody.in-l { animation: sv-in-l .28s ease both; }
@keyframes sv-in-r { from { opacity: 0; transform: translateX(28px); } }
@keyframes sv-in-l { from { opacity: 0; transform: translateX(-28px); } }
.sv-q { font-size: clamp(19px, 5vw, 23px); line-height: 1.5; margin: 10px 0 18px; word-break: keep-all; min-height: 3em; }
.sv-opts { display: grid; gap: 10px; }
.sv-opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 14px 16px; text-align: left;
  font: inherit; font-size: 15.5px; line-height: 1.5; color: var(--text); background: var(--bg-2); border: 1.5px solid var(--line);
  border-radius: 12px; cursor: pointer; transition: border-color .12s, background .12s, transform .12s; word-break: keep-all; -webkit-tap-highlight-color: transparent; }
.sv-opt .k { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-size: 12px; color: var(--muted); background: var(--panel); }
@media (hover: hover) { .sv-opt:hover { border-color: var(--accent); transform: translateY(-1px); } }
.sv-opt:active { transform: scale(.985); }
.sv-opt.on { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 700; }
.sv-opt.on .k { background: #000; color: var(--accent); border-color: #000; }
/* body 모드 숫자 입력 (키·몸무게) */
.sv-input { display: grid; gap: 10px; }
.sv-input-row { display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: var(--bg-2); border: 1.5px solid var(--line); border-radius: 12px; }
.sv-input-row:focus-within { border-color: var(--accent); }
.sv-input-row input { flex: 1; min-width: 0; font: inherit; font-size: 26px; font-weight: 800; color: var(--text); background: transparent; border: 0; outline: 0; padding: 6px 0; }
.sv-input-row span { font-size: 17px; font-weight: 700; color: var(--muted); }
.sv-input-err { margin: 0; font-size: 13px; color: #e5484d; min-height: 1.2em; }

/* result */
.sv-done-msg { text-align: center; font-weight: 700; margin: 4px 0 14px; }
.sv-card { background: var(--panel); border: 1px solid var(--line); border-top: 6px solid var(--c); border-radius: 16px; overflow: hidden; padding-bottom: 20px; animation: sv-pop .4s ease both; }
@keyframes sv-pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.sv-card-top { text-align: center; padding: 26px 20px 16px; background: radial-gradient(ellipse at 50% 0, color-mix(in srgb, var(--c) 30%, transparent), transparent 72%); }
.sv-kicker { display: inline-block; font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; background: var(--panel); }
.sv-big { font-size: 84px; line-height: 1.15; margin-top: 8px; }
.sv-name { font-family: var(--display); font-size: clamp(30px, 8vw, 40px); line-height: 1.2; margin: 6px 0 6px; letter-spacing: -0.02em; color: color-mix(in srgb, var(--c) 78%, var(--text)); word-break: keep-all; }
.sv-sum { margin: 0; font-size: 16px; font-weight: 700; word-break: keep-all; }
.sv-desc { padding: 0 22px; margin: 14px 0; font-size: 15px; line-height: 1.85; word-break: keep-all; color: color-mix(in srgb, var(--text) 88%, var(--muted)); }
.sv-traits { list-style: none; margin: 0; padding: 0 22px; display: grid; gap: 6px; }
.sv-traits li { position: relative; padding: 8px 12px 8px 34px; background: var(--bg-2); border-radius: 10px; font-size: 14px; line-height: 1.5; }
.sv-traits li::before { content: '✔'; position: absolute; left: 12px; top: 8px; color: color-mix(in srgb, var(--c) 80%, var(--text)); font-weight: 700; }
.sv-gauge { margin: 6px 22px 4px; height: 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.sv-gauge i { display: block; height: 100%; background: var(--c); border-radius: 999px; animation: sv-grow .8s ease both; transform-origin: left; }
@keyframes sv-grow { from { transform: scaleX(0); } }
.sv-range { text-align: center; font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.sv-range b { color: var(--text); font-size: 18px; }
.sv-bars { margin: 18px 22px 0; display: grid; gap: 7px; }
.sv-bars-h { font-size: 13px; color: var(--muted); font-weight: 500; }
.sv-bar { display: grid; grid-template-columns: minmax(0, 7.5em) 1fr 3em; gap: 10px; align-items: center; font-size: 13px; }
.sv-bar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-bar i { height: 10px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.sv-bar i b { display: block; height: 100%; background: var(--c); border-radius: 999px; animation: sv-grow .8s ease both; transform-origin: left; }
.sv-bar em { font-style: normal; text-align: right; color: var(--muted); }
.sv-match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 22px 0; }
.sv-match a { display: block; text-align: center; padding: 12px 8px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: var(--bg-2); }
.sv-match a:hover { border-color: var(--c); text-decoration: none; }
.sv-match small { display: block; font-size: 12px; color: var(--muted); }
.sv-match .e { display: block; font-size: 30px; line-height: 1.3; }
.sv-match b { font-size: 14px; }
.sv-tip { margin: 16px 22px 0; padding: 12px 14px; border-radius: 10px; font-size: 14px; line-height: 1.7; background: color-mix(in srgb, var(--c) 13%, var(--bg-2)); }
.sv-tip b { display: block; font-size: 12px; margin-bottom: 2px; }

/* share · invite · compare */
.sv-share { display: grid; gap: 8px; margin-top: 14px; }
.sv .sv-share .btn { text-align: center; padding: 11px 8px; border-radius: 10px; }
.sv .sv-share .sv-share-main, .sv-cshare > .btn.primary { padding: 15px; font-size: 16px; }
.sv-share-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.sv-cshare .sv-share-row { grid-template-columns: 1fr 1fr; }
.sv-share-row a.btn { display: block; color: var(--text); }
.sv-share-row a.btn:hover { text-decoration: none; }
@media (max-width: 520px) { .sv-share-row { grid-template-columns: 1fr 1fr; } }
.sv-invite { margin-top: 14px; padding: 16px; border: 1.5px dashed var(--accent-2); border-radius: 14px; background: color-mix(in srgb, var(--accent-2) 7%, var(--panel)); }
.sv-invite b { font-size: 16px; }
.sv-invite p { margin: 4px 0 12px; font-size: 13px; color: var(--muted); }
.sv-invite-form { display: flex; gap: 8px; }
.sv-invite-form input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); }
.sv-invite-form input:focus { outline: none; border-color: var(--accent-2); }
.sv-invite-form .btn { padding: 10px 14px; border-radius: 10px; white-space: nowrap; background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
@media (max-width: 520px) { .sv-invite-form { flex-direction: column; } .sv-invite-form .btn { padding: 13px; } }
.sv-again { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.sv-again .btn { color: var(--text); }
.sv-again a.btn:hover { text-decoration: none; }
.sv-compare { margin-bottom: 16px; padding: 18px 16px; border-radius: 16px; border: 2px solid var(--accent-2); background: linear-gradient(160deg, color-mix(in srgb, var(--accent-2) 14%, var(--panel)), var(--panel) 60%); animation: sv-pop .4s ease both; }
.sv-vs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
.sv-vs > i { font-style: normal; font-size: 26px; font-weight: 700; color: var(--accent-2); }
.sv-vs-side { display: block; text-align: center; padding: 12px 6px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); border-top: 4px solid var(--c); color: var(--text); }
a.sv-vs-side:hover { text-decoration: none; border-color: var(--c); }
.sv-vs-side small { display: block; font-size: 12px; color: var(--muted); }
.sv-vs-side .e { display: block; font-size: 40px; line-height: 1.3; }
/* combo 테스트: 캐릭터 그림 · 검사별로 보면 · MBTI로 바로 보기 */
.sv-big.has-art { margin-top: 4px; }
.sv-art { display: block; width: min(200px, 56vw); height: auto; margin: 0 auto; filter: drop-shadow(0 6px 14px rgba(0,0,0,.25)); }
.sv-match .e img, .sv-vs-side .e img { display: block; width: 64px; height: 64px; margin: 2px auto; }
.sv-vs-side .e img { width: 72px; height: 72px; }
.sv-frames { margin: 16px 22px 0; }
.sv-frames dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 8px 0 0; }
.sv-frames dl div { border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; background: var(--bg-2); }
.sv-frames dt { font-size: 11px; color: var(--muted); }
.sv-frames dd { margin: 2px 0 0; font-weight: 700; font-size: 14px; color: var(--text); }
.sv-mbti { margin-top: 12px; text-align: center; }
.sv-mbti summary { cursor: pointer; color: var(--muted); font-size: 14px; padding: 6px; }
.sv-mbti-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; max-width: 360px; margin: 8px auto 0; }
.sv-mbti-grid .btn { justify-content: center; font-family: var(--mono); font-size: 13px; padding: 8px 0; }
.sv-vs-side b { font-size: 15px; word-break: keep-all; }
.sv-verdict { text-align: center; margin-top: 12px; }
.sv-pct { display: block; font-family: var(--display); font-size: 52px; line-height: 1.1; color: var(--accent-2); }
.sv-verdict h3 { margin: 4px 0; font-size: 20px; }
.sv-verdict p { margin: 0; font-size: 14px; line-height: 1.7; color: color-mix(in srgb, var(--text) 85%, var(--muted)); word-break: keep-all; }
.sv-k-bad .sv-pct { color: #febc2e; }

/* result page · lists */
.sv-cta { text-align: center; margin-bottom: 16px; }
.sv-cta span { display: block; margin-top: 8px; font-size: 12px; color: var(--muted); }
.sv-cta-2 { margin: 18px 0 0; }
.sv-rpage .sv-mycompare { margin-bottom: 16px; }
.sv-rlinks a { border-left: 4px solid var(--c); }
.sv-rlinks a[aria-current] { border-color: var(--c); font-weight: 700; }
.sv-types { list-style: none; padding: 0 !important; display: grid; gap: 6px; }
.sv-types li { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; }
.sv-others a.done b::after { content: ' ✓'; color: var(--accent); }
.sv-tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.sv-tcard { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 18px 18px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; color: var(--text); box-shadow: inset 0 4px 0 var(--c); transition: transform .15s, box-shadow .15s, border-color .15s; }
.sv-tcard:hover { text-decoration: none; transform: translateY(-3px); border-color: var(--c); box-shadow: inset 0 4px 0 var(--c), 5px 5px 0 var(--c); }
.sv-tcard .e { font-size: 40px; line-height: 1.2; }
.sv-tcard b { font-family: var(--display); font-size: 18px; margin-top: 4px; }
.sv-tcard p { margin: 0; color: color-mix(in srgb, var(--text) 80%, var(--muted)); font-size: 14px; flex: 1; word-break: keep-all; }
.sv-tcard small { color: var(--muted); font-size: 11px; margin-top: 6px; }
.sv-tcard .sv-done { position: absolute; top: 14px; right: 14px; font-style: normal; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--accent); color: #000; max-width: 60%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-tcard .sv-done[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .sv-hero, .sv-card, .sv-compare, .sv-qbody, .sv-gauge i, .sv-bar i b { animation: none !important; } }
