:root {
  color-scheme: light;
  --bg: #f6f7fb; --surface: #ffffff; --text: #1b1f2a; --muted: #636a7a; --line: #e6e9f0;
  --accent: #2f6fed; --rich: #e0a100; --talent: #7c5cff; --lucky: #1fa463; --unlucky: #e5484d;
  --ga: #3b82f6; --gb: #f59e42; --bar: #9db8f2;
  --shadow: 0 1px 2px rgba(20,30,60,.04), 0 4px 16px rgba(20,30,60,.04);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html { min-height: 100%; background: linear-gradient(180deg, #f3f6fd 0%, #f6f7fb 40%, #fbf8f3 100%) no-repeat; }   /* 위 차가운 흰색 → 아래 따뜻한 흰색 */
body {
  margin: 0; background: transparent; color: var(--text);
  word-break: keep-all; overflow-wrap: break-word;
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

.nav { border-bottom: 1px solid var(--line); background: var(--surface); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; min-height: 68px; padding-top: 6px; padding-bottom: 6px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand img { width: 42px; height: 42px; display: block; }
.brand .bt { display: flex; flex-direction: column; line-height: 1.15; }
.brand b { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.brand small { font-size: 10.5px; letter-spacing: .22em; color: var(--muted); font-weight: 600; margin-top: 3px; }
.brand .bt { position: relative; }
.brand .ver { position: absolute; left: 100%; top: 5px; margin-left: 8px; font-size: 10px; font-weight: 500; letter-spacing: 0; color: var(--muted); opacity: .55; white-space: nowrap; }   /* 제목 옆 작은 퇴색 글자 버전 표시 */
.navr { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.nav a.link { color: var(--muted); text-decoration: none; font-size: 14px; }
.nav a.link:hover { color: var(--text); }
.visits { display: inline-flex; align-items: stretch; font-size: 12.5px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); white-space: nowrap; overflow: hidden; }
.visits[hidden] { display: none; }
.visits .vi { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px; }
.visits .vi b { color: var(--text); font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.visits .vsep { width: 1px; background: var(--line); }
.visits .live { align-self: center; width: 7px; height: 7px; border-radius: 50%; background: var(--lucky); box-shadow: 0 0 0 3px rgba(31,164,99,.18); margin-right: -1px; }
@media (max-width: 480px) { .brand b { font-size: 19px; } .brand img { width: 36px; height: 36px; } .navr a.link { display: none; } .visits .vi { padding: 5px 9px; gap: 4px; } .visits .vi b { font-size: 13.5px; } .visits { font-size: 11.5px; } }

h1 { font-size: clamp(26px, 5vw, 38px); line-height: 1.25; margin: 40px 0 12px; letter-spacing: -0.02em; }
h2 { font-size: 22px; margin: 44px 0 12px; letter-spacing: -0.01em; }
h3 { font-size: 16px; margin: 0 0 4px; }
.lead { font-size: 18px; color: var(--muted); max-width: 680px; margin: 0 0 8px; }
p, li { max-width: 720px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin: 20px 0 0; }
.card {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px; text-decoration: none; color: var(--text);
}
.card.live:hover { border-color: var(--accent); }
.card .tag { font-size: 12px; color: var(--muted); }
.card.soon { opacity: .65; }
.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 99px; background: var(--accent); color: #fff; margin-left: 6px; }
.badge.gray { background: var(--line); color: var(--muted); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); }
.controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px 24px; }
.ctl label { display: flex; justify-content: space-between; font-size: 14px; }
.ctl output { font-variant-numeric: tabular-nums; font-weight: 600; }
.ctl input[type=range] { width: 100%; accent-color: var(--accent); }
.ctl .hint { font-size: 12px; color: var(--muted); }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; align-items: center; }
button {
  font: inherit; font-size: 14px; padding: 8px 14px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button:disabled { opacity: .5; cursor: default; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-top: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat .k { font-size: 13px; color: var(--muted); }
.stat .v { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 13px; color: var(--muted); }

.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 16px; margin-top: 16px; }
.chart h3 { padding: 0 2px; }
.chart p { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
canvas { width: 100%; display: block; }
canvas.rounded { border-radius: 12px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pair figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; text-align: center; }
.pair figure { margin: 0; }
@media (max-width: 520px) { .pair { grid-template-columns: 1fr; } }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }

.anim-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.anim-bar select { font: inherit; font-size: 14px; padding: 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.anim-bar .when { margin-left: auto; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--muted); }

.callout { border-left: 3px solid var(--accent); background: var(--surface); padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 16px 0; max-width: 720px; }
footer { border-top: 1px solid var(--line); margin-top: 64px; padding: 24px 0 48px; color: var(--muted); font-size: 13px; }

.progress { height: 4px; background: var(--line); border-radius: 4px; margin-top: 8px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; }
.sel { width: 100%; font: inherit; font-size: 14px; padding: 7px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }

/* ---------- 메인 페이지 ---------- */
.hero { padding-bottom: 8px; }
.herostats { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 18px 0 0; font-size: 14px; color: var(--muted); }
.herostats b { color: var(--text); font-size: 18px; font-weight: 800; margin-right: 2px; }
.catnav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.catchip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600; box-shadow: var(--shadow); }
.catchip:hover { border-color: var(--c); }
.catchip em { font-style: normal; font-size: 12px; font-weight: 700; color: #fff; background: var(--c); border-radius: 99px; padding: 0 7px; }
.cat { margin-top: 44px; scroll-margin-top: 16px; }
.cathead { display: flex; align-items: center; gap: 14px; padding-left: 14px; border-left: 4px solid var(--c); }
.cathead h2 { margin: 0; font-size: 22px; }
.cathead p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.caticon { font-size: 26px; line-height: 1; }
.catcount { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--c); background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 3px 12px; white-space: nowrap; }
.xgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; margin-top: 16px; }
.xcard { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 18px 16px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .15s, border-color .15s, box-shadow .15s; overflow: hidden; }
.xcard::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--c); opacity: .85; }
.xcard:hover { transform: translateY(-2px); border-color: var(--c); box-shadow: 0 6px 22px rgba(20,30,60,.10); }
.xtop { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.xnum { font-size: 13px; font-weight: 800; color: var(--c); letter-spacing: .04em; }
.xchip { font-size: 11.5px; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px; }
.xcard h3 { font-size: 18px; line-height: 1.35; margin: 10px 0 6px; letter-spacing: -0.01em; }
.xcard p { margin: 0 0 14px; font-size: 14px; color: var(--muted); line-height: 1.6; }
.xgo { margin-top: auto; font-size: 13.5px; font-weight: 700; color: var(--c); }
.xgo i { font-style: normal; display: inline-block; transition: transform .15s; }
.xcard:hover .xgo i { transform: translateX(3px); }
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 16px; }
.scard { display: flex; flex-direction: column; gap: 3px; background: transparent; border: 1.5px dashed var(--line); border-radius: 14px; padding: 14px 16px; }
.scard .stag { font-size: 11.5px; color: var(--muted); }
.scard b { font-size: 15px; }
.scard small { font-size: 12.5px; color: var(--muted); }
@media (max-width: 520px) { .cathead { flex-wrap: wrap; } .catcount { margin-left: 0; } }

/* ---------- 언어 전환 ---------- */
.langtoggle { display: inline-flex; padding: 3px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.langtoggle button { font: inherit; font-size: 12.5px; font-weight: 700; padding: 5px 11px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; word-break: keep-all; }
.langtoggle button:hover { color: var(--text); }
.langtoggle button.on { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgba(20,30,60,.12); cursor: default; }
html[lang="en"] body { word-break: normal; }
@media (max-width: 480px) { .langtoggle button { padding: 4px 8px; font-size: 12px; } .navr { gap: 8px; } .brand small { display: none; } }

footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
footer a:hover { color: var(--accent); }
footer .copy { margin-top: 8px; font-size: 12px; opacity: .85; }

/* ---------- 작업대: 입력값(왼쪽 고정) + 결과(오른쪽) ---------- */
main.wrap.wide { max-width: 1320px; }
.workbench { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; margin-top: 16px; }
.wb-side { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; border-radius: 16px; }
.wb-side .panel { margin: 0; }
.wb-side .controls { grid-template-columns: 1fr; gap: 12px; }
.wb-side .btns .primary { flex: 1 1 100%; }
.wb-side .btns { margin-top: 14px; }
.wb-main { min-width: 0; }
.wb-main > :first-child { margin-top: 0 !important; }
.wb-main .stats { margin-top: 0; margin-bottom: 16px; }
.wb-main .charts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.wb-fab { display: none; }
@media (max-width: 980px) {
  .workbench { display: block; }
  .wb-side { position: static; max-height: none; overflow: visible; }
  .wb-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; margin: 0; max-height: 52vh; overflow: auto; border-radius: 18px 18px 0 0; box-shadow: 0 -8px 28px rgba(20,30,60,.22); transform: translateY(105%); transition: transform .22s ease; padding-bottom: 72px; }
  .wb-sheet.open { transform: translateY(0); }
  .wb-sheet .controls { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
  body { padding-bottom: 76px; }
  .wb-fab { display: inline-flex; position: fixed; right: 14px; bottom: 14px; z-index: 60; align-items: center; justify-content: center; width: 52px; height: 52px; padding: 0; font: inherit; font-size: 24px; font-weight: 700; color: #fff; background: var(--accent); border: 0; border-radius: 99px; box-shadow: 0 6px 20px rgba(47,111,237,.45); cursor: pointer; }
  .wb-main .stats { margin-bottom: 12px; }
}

/* ---------- 실험 페이지: 위쪽은 작게, 작업대는 바로, 읽을거리는 아래 ---------- */
main.wide h1 { margin: 22px 0 6px; font-size: clamp(24px, 3.2vw, 32px); }
main.wide .lead { font-size: 16px; line-height: 1.6; max-width: 820px; margin: 0; }
.jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.jump a { font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 4px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); }
.jump a:hover { color: var(--accent); border-color: var(--accent); }
.story { margin-top: 48px; scroll-margin-top: 16px; }
.story h2 { margin-top: 0; }
.callouts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.callouts .callout { margin: 0; max-width: none; background: var(--surface); box-shadow: var(--shadow); border-radius: 12px; border-left-width: 4px; }
.callouts .callout:nth-child(2) { border-left-color: var(--muted); }
details.notes { margin-top: 40px; padding: 4px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; scroll-margin-top: 16px; }
details.notes > summary { cursor: pointer; font-weight: 700; font-size: 17px; padding: 12px 0; list-style-position: inside; }
details.notes[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 8px; }
@media (max-width: 700px) { .callouts { grid-template-columns: 1fr; } }

/* 작업대 안쪽: 통계는 한 줄로 촘촘하게, 첫 애니메이션은 너무 커지지 않게 */
.wb-main .stats { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 10px; }
.wb-main .stat { padding: 11px 14px; }
.wb-main .stat .k { font-size: 12.5px; line-height: 1.35; }
.wb-main .stat .v { font-size: 22px; }
.wb-main .stat .s { font-size: 12px; line-height: 1.4; }
.wb-main > section.panel:first-of-type canvas, .wb-main > .panel.chart:first-of-type canvas { max-width: 760px; margin-left: auto; margin-right: auto; }
.wb-main > section.panel:first-of-type .anim-bar { max-width: 760px; margin-left: auto; margin-right: auto; }

/* ---------- 실험 페이지: 이전/다음 ---------- */
.xnav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; margin-top: 44px; }
.xnav a { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
.xnav a:hover { border-color: var(--c, var(--accent)); }
.xnav small { font-size: 12px; color: var(--muted); }
.xnav b { font-size: 15px; line-height: 1.3; }
.xnav .sym { color: var(--c); font-weight: 800; }
.xnav .next { text-align: right; align-items: flex-end; }
.xnav .all { justify-content: center; color: var(--muted); font-size: 14px; }
@media (max-width: 640px) { .xnav { grid-template-columns: 1fr 1fr; } .xnav .all { grid-column: 1 / -1; order: 3; } }

/* ---------- 언어 선택 드롭다운 (5개 언어) ---------- */
.langtoggle { position: relative; display: inline-block; padding: 0; background: transparent; border: 0; }
.langtoggle .lt-btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12.5px; font-weight: 700; padding: 6px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--text); cursor: pointer; white-space: nowrap; }
.langtoggle .lt-btn:hover { border-color: var(--accent); color: var(--accent); }
.langtoggle .lt-caret { font-size: 10px; color: var(--muted); }
.langtoggle .lt-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 150px; margin: 0; padding: 5px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(20,30,60,.16); }
.langtoggle .lt-menu[hidden] { display: none; }
.langtoggle .lt-menu li { padding: 8px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--text); cursor: pointer; outline: none; }
.langtoggle .lt-menu li:hover, .langtoggle .lt-menu li:focus { background: var(--bg); }
.langtoggle .lt-menu li.on { color: var(--accent); }
.langtoggle .lt-menu li.on::after { content: " ✓"; }
html[lang="es"] body, html[lang="fr"] body { word-break: normal; }
html[lang="ja"] body, html[lang="zh"] body { word-break: normal; line-break: strict; }
html[lang="ru"] body { word-break: normal; hyphens: auto; }
@media (max-width: 480px) { .langtoggle .lt-btn { padding: 5px 8px; font-size: 12px; } .langtoggle .lt-cur { max-width: 74px; overflow: hidden; text-overflow: ellipsis; } }

/* ---------- 3D 보기 (three.js) ---------- */
canvas.view3d { display: block; width: 100%; aspect-ratio: 16 / 10; height: auto; border-radius: 14px; background: #f6f7fb; cursor: grab; touch-action: pan-y; } /* 휴대폰: 세로로 쓸면 페이지 스크롤, 가로로 끌면 3D 회전 */
canvas.view3d:active { cursor: grabbing; }
.badge3d { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 800; letter-spacing: .04em; color: #fff; background: linear-gradient(135deg, #2f6fed, #7c5cff); vertical-align: middle; }
.hint3d { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.charts > section.panel.wide { grid-column: 1 / -1; }

/* ---------- 상단 제목 옆 소개 문구 ---------- */
.nav .tagline { flex: 1 1 auto; min-width: 0; margin: 0 18px 0 16px; padding-left: 16px; border-left: 1px solid var(--line); font-size: 12.5px; font-weight: 600; line-height: 1.35; color: var(--muted); letter-spacing: -0.005em; max-width: 430px; }
@media (max-width: 1020px) { .nav .tagline { display: none; } }

/* ---------- 왼쪽 시작선 맞추기: 메뉴·제목·본문·바닥글을 모두 같은 폭(1320px)으로 ---------- */
.nav .wrap, footer .wrap, .hero-in.wrap { max-width: 1320px; }

/* ---------- 다시 오게 만드는 장치 (engage.js) ---------- */
.jump .star-chip { font: inherit; font-size: 13px; font-weight: 700; color: var(--muted); padding: 4px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); cursor: pointer; }
.jump .star-chip:hover { color: #b7791f; border-color: #e0a100; }
.jump .star-chip.on { color: #8a5a00; background: #fff4d6; border-color: #e0a100; }
.more-like { margin: 36px 0 8px; }
.more-like h2 { font-size: 20px; margin: 0 0 12px; }
.ecards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.ecard { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .18s, border-color .18s; }
.ecard:hover { transform: translateY(-3px); border-color: var(--c, var(--accent)); }
.ec-img { position: relative; display: block; aspect-ratio: 16 / 9; background: #eef1f8; overflow: hidden; }
.ec-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ec-sym { position: absolute; left: 10px; top: 8px; font-size: 20px; font-weight: 800; color: var(--c, var(--accent)); text-shadow: 0 0 6px #fff, 0 0 2px #fff; }
.ec-done { position: absolute; right: 8px; top: 8px; width: 22px; height: 22px; border-radius: 50%; background: #1fa463; color: #fff; font-size: 13px; font-weight: 800; display: grid; place-items: center; }
.ec-t { padding: 10px 14px 13px; font-size: 14.5px; font-weight: 700; line-height: 1.35; word-break: keep-all; }
.ec-rm { position: absolute; right: 8px; bottom: 8px; width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 11px; cursor: pointer; opacity: 0; transition: opacity .15s; }
.ecard:hover .ec-rm, .ec-rm:focus { opacity: 1; }
@media (hover: none) { .ec-rm { opacity: .8; } }
#nudge { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 70; width: max-content; max-width: min(520px, calc(100vw - 90px)); display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; background: #1b1f2a; color: #fff; padding: 12px 14px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.28); font-size: 13.5px; line-height: 1.45; animation: ndin .35s ease; }
@keyframes ndin { from { opacity: 0; transform: translate(-50%, 10px); } }
#nudge .nd-msg { flex: 1 1 200px; }
#nudge button { font: inherit; font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 9px; border: 1px solid rgba(255,255,255,.35); background: transparent; color: #fff; cursor: pointer; }
#nudge .nd-go { background: var(--accent, #2f6fed); border-color: var(--accent, #2f6fed); }
@media (max-width: 980px) { #nudge { left: 14px; transform: none; bottom: 82px; max-width: calc(100vw - 28px); } @keyframes ndin { from { opacity: 0; } } }
@media (prefers-reduced-motion: reduce) { #nudge { animation: none; } .ecard { transition: none; } }
@media (max-width: 600px) { .ecards, .mine .ecards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .ec-t { font-size: 13px; padding: 8px 10px 11px; } }

/* ---------- 먼저 예상해 보세요 (engage.js) ---------- */
.predict { margin: 16px 0 0; padding: 16px 20px 18px; background: linear-gradient(135deg, #f1f4ff, #f7f1ff); border: 1px solid #cfd8ff; border-radius: 16px; }
.predict h2 { margin: 0 0 6px; font-size: 16px; color: #3b4cc0; }
.predict .pq { margin: 0 0 12px; font-size: 16.5px; font-weight: 700; line-height: 1.5; max-width: 900px; }
.popts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.popt { font: inherit; font-size: 15px; font-weight: 700; line-height: 1.4; text-align: left; padding: 12px 14px; border-radius: 12px; border: 1.5px solid #c3ccf5; background: #fff; color: var(--text); cursor: pointer; transition: transform .12s, border-color .12s, background .12s; }
button.popt:hover { transform: translateY(-2px); border-color: #5b6ee6; background: #f5f7ff; }
span.popt { cursor: default; }
.popt.right { border-color: #1fa463; background: #e8f7ee; color: #14663f; }
.popt.wrong { border-color: #e5484d; background: #fdecec; color: #a32a2e; }
.popt.off { opacity: .55; }
.pnote { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.pmine { margin: 0 0 6px; font-size: 15px; font-weight: 800; color: #3b4cc0; }
.preveal { margin-top: 10px; font: inherit; font-weight: 700; font-size: 14px; padding: 8px 16px; border-radius: 10px; border: 0; background: #3b4cc0; color: #fff; cursor: pointer; }
.pres { margin: 12px 0 4px; font-size: 17px; font-weight: 800; }
.pres.ok { color: #14663f; } .pres.no { color: #8a5a00; }
.pwhy { margin: 4px 0 0; font-size: 14.5px; line-height: 1.6; max-width: 900px; }
.poth-t { margin: 14px 0 6px; font-size: 13px; font-weight: 800; color: var(--muted); }
.pbar { display: grid; grid-template-columns: minmax(120px, 280px) minmax(0, 1fr) 44px; gap: 10px; align-items: center; font-size: 13px; margin: 3px 0; }
.pbar .pb { height: 8px; background: #e4e8f2; border-radius: 99px; overflow: hidden; }
.pbar .pb i { display: block; height: 100%; background: #8f9bd6; border-radius: 99px; }
.pbar.right .pb i { background: #1fa463; } .pbar .pv { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.poth-s { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
@media (max-width: 600px) { .predict { padding: 14px 14px 16px; } .pbar { grid-template-columns: 1fr 70px 40px; } }
.workbench.pgated { filter: blur(9px) saturate(.5); pointer-events: none; user-select: none; max-height: 300px; overflow: hidden; opacity: .75; }
.lead.pgated-lead { display: none; }
.pskip { font: inherit; font-size: 13px; font-weight: 700; margin-left: 6px; padding: 3px 10px; border-radius: 8px; border: 1px solid #c3ccf5; background: #fff; color: #3b4cc0; cursor: pointer; }
.pskip:hover { background: #eef0ff; }

/* ---------- 영상 연결 (engage.js) ---------- */
.vidbox { margin: 36px 0 8px; }
.vidbox h2 { font-size: 20px; margin: 0 0 12px; }
.vid, .vframe { position: relative; display: block; width: 100%; max-width: 720px; aspect-ratio: 16 / 9; border: 0; padding: 0; border-radius: 14px; overflow: hidden; background: #0f1222; cursor: pointer; }
.vid img { width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.vid .vplay { position: absolute; inset: 0; margin: auto; width: 68px; height: 68px; border-radius: 50%; background: rgba(229, 72, 77, .95); color: #fff; font-size: 26px; display: grid; place-items: center; padding-left: 5px; box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.small li.theory > b:first-child { color: var(--accent); }

/* ---- 재생 막대: 눈에 잘 띄게 (재생은 채운 버튼, 나머지는 색 테두리) ---- */
.anim-bar { padding: 8px 10px; border-radius: 16px; background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); gap: 8px; }
.anim-bar button { font-weight: 700; font-size: 15px; min-height: 42px; padding: 0 16px; border-radius: 12px; border: 1.5px solid color-mix(in srgb, var(--accent) 55%, var(--line)); background: var(--surface); color: var(--accent); cursor: pointer; transition: transform .12s, box-shadow .12s, background .12s; }
.anim-bar button:hover { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(47,111,237,.18); }
.anim-bar button:active { transform: translateY(0); }
.anim-bar #play { background: var(--accent); border-color: var(--accent); color: #fff; min-width: 124px; box-shadow: 0 6px 16px rgba(47,111,237,.32); }
.anim-bar #play:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.anim-bar select { min-height: 42px; padding: 0 10px; font-weight: 700; font-size: 14.5px; border: 1.5px solid color-mix(in srgb, var(--accent) 55%, var(--line)); border-radius: 12px; color: var(--accent); cursor: pointer; }
.anim-bar button:focus-visible, .anim-bar select:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
@media (max-width: 760px) { .anim-bar button { flex: 1 1 auto; min-height: 46px; } .anim-bar #play { flex: 2 1 40%; } .anim-bar select { min-height: 46px; flex: 1 1 auto; } .anim-bar .when { flex: 1 1 100%; margin-left: 0; text-align: right; } }

/* ================= 실험 페이지 휴대폰 다듬기 (≤980px) ================= */
.leadmore, .chartdots { display: none; }
@media (max-width: 980px) {
  main.wide .lead.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  main.wide .lead { font-size: 15px; line-height: 1.6; }
  .leadmore { display: inline-block; margin: 6px 0 0; padding: 4px 2px; border: 0; background: none; color: var(--accent); font-weight: 700; font-size: 14px; cursor: pointer; }
  .leadmore[hidden] { display: none; }
  .jump { flex-wrap: nowrap; overflow-x: auto; margin-right: -16px; padding: 2px 16px 4px 0; scrollbar-width: none; }
  .jump::-webkit-scrollbar { display: none; }
  .jump a, .jump button { flex: 0 0 auto; min-height: 40px; display: inline-flex; align-items: center; padding: 0 14px; }
  /* 슬라이더: 손가락으로 잡기 쉽게 큰 손잡이와 넉넉한 높이 */
  .ctl { padding: 4px 0 10px; }
  .ctl input[type=range] { -webkit-appearance: none; appearance: none; height: 44px; background: transparent; margin: 0; touch-action: pan-y; }
  .ctl input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 22%, #dfe5f1); }
  .ctl input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -11px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(20,30,60,.35); }
  .ctl input[type=range]::-moz-range-track { height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 22%, #dfe5f1); }
  .ctl input[type=range]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(20,30,60,.35); }
  .ctl label { font-size: 15px; font-weight: 700; }
  .ctl label output { color: var(--accent); font-weight: 800; }
  .ctl select.sel { min-height: 44px; font-size: 15px; }
  .btns button { min-height: 44px; }
  /* 설정 패널: 손잡이 막대, 넉넉한 안쪽 여백 */
  .wb-sheet { padding-top: 22px; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
  .wb-sheet::before { content: ""; position: absolute; top: 8px; left: 50%; width: 44px; height: 5px; margin-left: -22px; border-radius: 99px; background: #cfd6e4; }
  /* 그래프: 옆으로 넘겨 보는 카드 */
  .wb-main .charts { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 4px 16px 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .wb-main .charts::-webkit-scrollbar { display: none; }
  .wb-main .charts > section.panel { flex: 0 0 90%; min-width: 0; scroll-snap-align: center; margin: 0; }
  .wb-main .charts > section.panel.wide { grid-column: auto; }
  .chartdots { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 2px 0 14px; }
  .chartdots i { width: 8px; height: 8px; border-radius: 50%; background: #cfd6e4; transition: width .2s, background .2s; }
  .chartdots i.on { width: 22px; border-radius: 99px; background: var(--accent); }
  .chartdots .swipehint { margin-left: 8px; font-size: 12px; color: var(--muted); }
  /* 재생 막대: 그래프를 보는 동안 화면 아래에 달라붙어 계속 누를 수 있게 (설정 버튼은 그 위로) */
  .wb-main > section.panel:first-of-type .anim-bar.stickybar { position: sticky; bottom: 10px; z-index: 40; box-shadow: 0 8px 24px rgba(20,30,60,.2); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
  .wb-main > section.panel:first-of-type .anim-bar.stickybar { flex-wrap: nowrap; gap: 6px; padding: 7px 8px; }
  .wb-main > section.panel:first-of-type .anim-bar.stickybar button, .wb-main > section.panel:first-of-type .anim-bar.stickybar select { flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 0 8px; font-size: 14px; }
  .wb-main > section.panel:first-of-type .anim-bar.stickybar button, .wb-main > section.panel:first-of-type .anim-bar.stickybar select { white-space: nowrap; }
  .wb-main > section.panel:first-of-type .anim-bar.stickybar #play { flex: 0 0 auto; padding: 0 12px; min-width: 0; }
  .wb-main > section.panel:first-of-type .anim-bar.stickybar select { flex: 0 1 92px; text-overflow: ellipsis; font-size: 13px; padding: 0 4px; }
  .wb-main > section.panel:first-of-type .anim-bar.stickybar .when { display: none; }
  body.has-animbar .wb-fab { bottom: 86px; }
  body.has-animbar { padding-bottom: 150px; }
}

/* ---- 결과 해석 상자: 한 줄 헤드라인 + "상세 설명"(접힘) ---- */
.callout .clabel { margin: 0 0 6px; font-size: 12.5px; font-weight: 800; letter-spacing: .02em; color: var(--accent); }
.callout.cl-not .clabel { color: var(--muted); }
.callout .chead { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.callout .chead li { position: relative; padding-left: 18px; font-size: 16px; font-weight: 700; line-height: 1.55; color: var(--text); }
.callout .chead li:first-child { font-size: 17px; }
.callout .chead li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.callout.cl-not .chead li::before { background: #a7afc2; }
.callout.cl-then .clabel { color: #1fa463; }
.callout.cl-then .chead li::before { background: #1fa463; }
.callout .chead li:not(:first-child) { font-weight: 600; color: color-mix(in srgb, var(--text) 88%, #fff); }
.callout .cmore { margin: 10px 0 0; }
.callout .cmore > summary { display: inline-flex; align-items: center; gap: 6px; list-style: none; cursor: pointer; padding: 5px 12px; border-radius: 99px; border: 1.5px solid color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--surface); color: var(--accent); font-size: 13.5px; font-weight: 700; user-select: none; }
.callout .cmore > summary::-webkit-details-marker { display: none; }
.callout .cmore > summary::after { content: "▾"; font-size: 12px; transition: transform .18s; }
.callout .cmore[open] > summary::after { transform: rotate(180deg); }
.callout .cmore > summary:hover { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.callout .cmore > summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.callout .cfull { margin: 10px 0 0; font-size: 14.5px; line-height: 1.75; color: color-mix(in srgb, var(--text) 85%, #fff); }
.callout .cfull > b:first-child { display: none; }

/* 시뮬레이션 화면 범례 (talent-vs-luck 등): 기호 + 설명 */
.wlegend { list-style: none; margin: 8px 0 4px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--text); }
.wlegend li { display: inline-flex; align-items: center; gap: 6px; }
/* (구) 기호 범례 */
.wlegend .wg { display: inline-block; min-width: 16px; text-align: center; font-weight: 700; line-height: 1; }
.wlegend .wg.badge { border: 2px solid; border-radius: 50%; width: 20px; height: 20px; min-width: 20px; font-size: 9px; display: inline-flex; align-items: center; justify-content: center; background: #fff; }
.wlegend .wg.ring { border: 2.5px solid; border-radius: 50%; width: 16px; height: 16px; background: #fff; }

.wlegend .em { font-size: 18px; line-height: 1; }
.wlegend .pi { width: 16px; height: 19px; flex: none; }

.wlegend .dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); flex: none; }
.wlegend .glow { width: 20px; height: 20px; border-radius: 50%; flex: none; background: radial-gradient(circle, rgba(var(--c),.34) 0, rgba(var(--c),0) 72%); }

.wlegend .glow { background: radial-gradient(circle, rgba(var(--c),.55) 0, rgba(var(--c),0) 72%); }

/* 재생 중에는 통계 카드가 '지금까지의 값'이라 살짝 흐리게 */
#stats { transition: opacity .25s; }
#stats.live { opacity: .55; }
