/* Quirky mini games — shared styles. Hand-written, no frameworks. Same design language as the main game. */
@font-face {
  font-family: 'Pretendard';
  src: url('/static/fonts/PretendardVariable.woff2') format('woff2-variations'),
       url('/static/fonts/PretendardVariable.woff2') format('woff2');
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
}
/* Bundled CJK subset webfonts (Noto Sans SC / TC / JP, SIL OFL 1.1 — /static/fonts/OFL.txt).
   Pretendard has Hangul + kana but no Chinese characters (Han), so Chinese / Japanese pages use these first;
   unicode-range keeps Latin text on Pretendard. Subset = characters of the zh / ja dictionaries in i18n.js. */
@font-face { font-family: 'FO Noto Sans SC'; src: url('/static/fonts/NotoSansSC-Regular.subset.woff2?v=2') format('woff2'); font-weight: 100 599; font-style: normal; font-display: swap; unicode-range: U+2E80-2FFF, U+3000-33FF, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FE10-FE19, U+FE30-FE4F, U+FF00-FFEF; }
@font-face { font-family: 'FO Noto Sans SC'; src: url('/static/fonts/NotoSansSC-Bold.subset.woff2?v=2') format('woff2'); font-weight: 600 1000; font-style: normal; font-display: swap; unicode-range: U+2E80-2FFF, U+3000-33FF, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FE10-FE19, U+FE30-FE4F, U+FF00-FFEF; }
@font-face { font-family: 'FO Noto Sans TC'; src: url('/static/fonts/NotoSansTC-Regular.subset.woff2?v=2') format('woff2'); font-weight: 100 599; font-style: normal; font-display: swap; unicode-range: U+2E80-2FFF, U+3000-33FF, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FE10-FE19, U+FE30-FE4F, U+FF00-FFEF; }
@font-face { font-family: 'FO Noto Sans TC'; src: url('/static/fonts/NotoSansTC-Bold.subset.woff2?v=2') format('woff2'); font-weight: 600 1000; font-style: normal; font-display: swap; unicode-range: U+2E80-2FFF, U+3000-33FF, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FE10-FE19, U+FE30-FE4F, U+FF00-FFEF; }
@font-face { font-family: 'FO Noto Sans JP'; src: url('/static/fonts/NotoSansJP-Regular.subset.woff2?v=2') format('woff2'); font-weight: 100 599; font-style: normal; font-display: swap; unicode-range: U+2E80-2FFF, U+3000-33FF, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FE10-FE19, U+FE30-FE4F, U+FF00-FFEF; }
@font-face { font-family: 'FO Noto Sans JP'; src: url('/static/fonts/NotoSansJP-Bold.subset.woff2?v=2') format('woff2'); font-weight: 600 1000; font-style: normal; font-display: swap; unicode-range: U+2E80-2FFF, U+3000-33FF, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FE10-FE19, U+FE30-FE4F, U+FF00-FFEF; }
:root {
  --font: 'Pretendard', system-ui, -apple-system, 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-back: cubic-bezier(.34, 1.56, .64, 1);
  --bg: #14171C; --bg-deep: #0E1115; --panel: #1E232B; --panel-2: #252B35; --panel-3: #2C3340;
  --line: rgba(255,255,255,.07); --line-2: rgba(255,255,255,.12);
  --text: #E9EDF2; --text-2: #A7B0BD; --text-3: #6E7988;
  --accent: #2EE6C5; --accent-ink: #062A24; --accent-soft: rgba(46,230,197,.12);
  --amber: #FFB547; --amber-soft: rgba(255,181,71,.13);
  --danger: #FF5470; --danger-soft: rgba(255,84,112,.13);
  --brain: #4BE08A; --brain-soft: rgba(75,224,138,.13);
  --grey: #9AA4B2; --grey-soft: rgba(154,164,178,.12);
  --shadow-1: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.22);
  --shadow-2: 0 10px 40px rgba(0,0,0,.45), 0 2px 6px rgba(0,0,0,.3);
  --glass: rgba(20,23,28,.72);
  --header-h: 56px;
  color-scheme: dark;
}
/* per-language font stacks: bundled subset first, then Pretendard (Latin, Hangul), then system CJK fonts */
:lang(ja) { --font: 'FO Noto Sans JP', 'Pretendard', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic UI', 'Meiryo', 'Noto Sans CJK JP', 'FO Noto Sans SC', system-ui, sans-serif; }
:lang(zh-Hans) { --font: 'FO Noto Sans SC', 'Pretendard', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', system-ui, sans-serif; }
:lang(zh-Hant) { --font: 'FO Noto Sans TC', 'Pretendard', 'PingFang TC', 'Microsoft JhengHei', 'Noto Sans CJK TC', 'FO Noto Sans SC', system-ui, sans-serif; }
/* language <select>: each option is written in its own language (lang attribute set by i18n.js) */
.lang-sel option[lang] { font-family: var(--font); }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg);
  min-height: 100vh; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 520px at 8% -10%, rgba(46,230,197,.07), transparent 60%),
    radial-gradient(800px 600px at 105% 110%, rgba(255,181,71,.06), transparent 60%);
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.tnum { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------------------------------------------------------------- top bar */
.mtop {
  position: sticky; top: 0; z-index: 40; height: var(--header-h);
  display: flex; align-items: center; gap: 12px; padding: 0 20px;
  background: var(--glass); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.mtop .home { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; color: var(--text); }
.mtop .home:hover { text-decoration: none; }
.mtop .mark { width: 26px; height: 26px; position: relative; flex: none; }
.mtop .mark i { position: absolute; width: 15px; height: 15px; border-radius: 50%; }
.mtop .mark i:first-child { left: 0; top: 0; background: radial-gradient(circle at 35% 30%, #666, #1a1a1a 55%, #000); }
.mtop .mark i:nth-of-type(2) { right: 0; bottom: 0; background: radial-gradient(circle at 35% 30%, #fff, #eeeeea 60%, #c9c9c2); }
.mtop .mark b { position: absolute; right: -2px; top: -2px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.mtop .crumb { color: var(--text-3); font-weight: 600; font-size: 14px; display: inline-flex; gap: 8px; align-items: center; min-width: 0; }
.mtop .crumb a { color: var(--text-2); }
.mtop .crumb b { color: var(--text); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtop .gap { flex: 1; }
.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text-2); transition: background .15s, color .15s, transform .15s;
}
.icon-btn:hover { color: var(--text); background: var(--panel-2); }
.icon-btn:active { transform: scale(.95); }
.icon-btn.off { color: var(--text-3); }
/* language dropdown — same look as .icon-btn (height, radius, border, background, text colour) */
.lang-sel {
  -webkit-appearance: none; -moz-appearance: none; appearance: none; flex: none;
  height: 40px; padding: 0 30px 0 12px; border-radius: 12px; border: 1px solid var(--line);
  background-color: var(--panel); color: var(--text-2); font-weight: 650; font-size: 13px; line-height: 1; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23A7B0BD' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 10px 6px;
  transition: background-color .15s, color .15s;
}
.lang-sel:hover { color: var(--text); background-color: var(--panel-2); }
.lang-sel option { background: var(--panel); color: var(--text); }
.lang-sel.short { width: 56px; padding: 0 20px 0 10px; background-position: right 8px center; }
/* crumb never pushes the header wider than the screen: the current page name ellipsizes */
.mtop .crumb { flex: 0 1 auto; overflow: hidden; white-space: nowrap; }
.mtop .crumb b { min-width: 0; }
.mtop .crumb a { white-space: nowrap; }

/* ---------------------------------------------------------------- buttons, chips */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text);
  font-weight: 650; font-size: 14px; letter-spacing: -.01em; white-space: nowrap;
  transition: transform .15s var(--ease), background .15s, border-color .15s, box-shadow .2s, opacity .15s;
}
a.btn:hover { text-decoration: none; }
.btn:hover { background: var(--panel-3); }
.btn:active { transform: translateY(1px) scale(.985); }
.btn[disabled] { opacity: .42; cursor: not-allowed; transform: none; }
.btn.primary { background: linear-gradient(180deg, #4BF0D2, var(--accent)); color: var(--accent-ink); border-color: transparent;
  box-shadow: 0 6px 22px rgba(46,230,197,.28), inset 0 1px 0 rgba(255,255,255,.35); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.amber { background: linear-gradient(180deg, #FFC872, var(--amber)); color: #3A2400; border-color: transparent;
  box-shadow: 0 6px 22px rgba(255,181,71,.28), inset 0 1px 0 rgba(255,255,255,.35); }
.btn.ghost { background: transparent; }
.btn.lg { min-height: 54px; padding: 0 26px; font-size: 16px; border-radius: 14px; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 650;
  background: var(--panel-2); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }
.seg { display: flex; padding: 4px; gap: 4px; border-radius: 12px; background: var(--bg-deep); border: 1px solid var(--line); }
.seg button { flex: 1; min-height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); font-weight: 650; font-size: 13px; padding: 0 8px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--panel-3); color: var(--text); box-shadow: var(--shadow-1); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-1); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 750; letter-spacing: .14em; color: var(--accent); text-transform: uppercase; }
.eyebrow::before { content: ""; width: 22px; height: 2px; background: currentColor; border-radius: 2px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }

/* ---------------------------------------------------------------- honesty badges (required on every element) */
.mb { display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 750;
  letter-spacing: .01em; white-space: nowrap; line-height: 1; vertical-align: middle; }
.mb::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.mb.brain { color: var(--brain); background: var(--brain-soft); border: 1px solid rgba(75,224,138,.4); }
.mb.part { color: var(--amber); background: var(--amber-soft); border: 1px solid rgba(255,181,71,.42); }
.mb.show { color: var(--grey); background: var(--grey-soft); border: 1px solid rgba(154,164,178,.3); }
.mb.next { color: var(--text-3); background: transparent; border: 1px dashed rgba(154,164,178,.4); }
.mb.flash { animation: mbflash .6s var(--ease) 2; }
@keyframes mbflash { 50% { transform: scale(1.12); filter: brightness(1.4); } }

.blist { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.blist li { display: flex; align-items: center; gap: 8px; justify-content: space-between; font-size: 12.5px; color: var(--text-2); }
.blist li > span:first-child { min-width: 0; }

/* "어떻게 작동하나요" panel */
.how { border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.02); }
.how > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 11px 14px; font-weight: 750; font-size: 13.5px; }
.how > summary::-webkit-details-marker { display: none; }
.how > summary::after { content: "+"; margin-left: auto; color: var(--text-3); font-weight: 600; font-size: 16px; }
.how[open] > summary::after { content: "−"; }
.how .how-b { padding: 0 14px 14px; font-size: 12.5px; color: var(--text-2); display: flex; flex-direction: column; gap: 10px; }
.how .row { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: start; }
.how .row .mb { margin-top: 1px; }
.how .scope { border-top: 1px dashed var(--line-2); padding-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.how .scope code { font-family: inherit; color: var(--text); background: var(--panel-2); border-radius: 6px; padding: 1px 6px; }
.how .scope .k { font-weight: 700; color: var(--text-3); font-size: 11.5px; letter-spacing: .04em; }
.model-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; color: var(--text-2); }

/* notes / toasts */
.note { font-size: 12px; color: var(--text-3); line-height: 1.55; }
.warn-line { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-radius: 10px; font-size: 12.5px; font-weight: 650;
  background: var(--amber-soft); color: var(--amber); border: 1px solid rgba(255,181,71,.3); }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 90; pointer-events: none; width: min(92vw, 420px); }
.toast { padding: 11px 16px; border-radius: 12px; background: rgba(30,35,43,.96); border: 1px solid var(--line-2); box-shadow: var(--shadow-2);
  font-size: 13.5px; font-weight: 600; animation: tin .3s var(--ease); text-align: center; }
.toast.warn { border-color: rgba(255,181,71,.45); color: #FFD9A0; }
.toast.out { opacity: 0; transform: translateY(6px); transition: .3s; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.foot { margin-top: 40px; padding: 22px 0 34px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 12px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

@media (max-width: 767px) {
  :root { --header-h: 52px; }
  .mtop { padding: 0 12px; gap: 8px; }
  .mtop .home span.t { display: none; }
  .wrap { padding: 0 14px; }
}
@media (max-width: 480px) {
  /* phone portrait: keep only "/ <page name>" in the crumb and an icon-only back button */
  .mtop .crumb .cm { display: none; }
  .mtop .back-btn { padding: 0 9px; }
  .mtop .back-btn .lbl { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
/* static trial (체험판) */
.warn-line.info { color: var(--brain); background: var(--brain-soft); border: 1px solid rgba(75,224,138,.32); }
.trial-note { max-width: 1240px; margin: 10px auto 0; padding: 0 24px; }
.trial-note > div { display: flex; gap: 8px; align-items: flex-start; padding: 9px 13px; border-radius: 10px; font-size: 12.5px; font-weight: 650; line-height: 1.5;
  color: var(--amber); background: var(--amber-soft); border: 1px solid rgba(255,181,71,.38); }
.trial-note b { white-space: nowrap; }
