/* ═══════════════════════════════════════════════════════════
   도박의 덫 — LAST BET · 스타일
   ═══════════════════════════════════════════════════════════ */

/* 삼성인터넷 등의 '웹사이트 어둡게'(강제 색 변환) 회피 신호:
   ①color-scheme 선언 ②prefers-color-scheme 미디어쿼리 존재(다크 테마 자체 지원으로 인식) */
@media (prefers-color-scheme: dark) {
    :root { color-scheme: dark; }
}
@media (prefers-color-scheme: light) {
    :root { color-scheme: dark; }   /* 이 페이지는 항상 다크 디자인 */
}

:root {
    color-scheme: dark;   /* 브라우저 강제 다크모드의 색 재변환 방지 (원래 다크 디자인) */
    --bg: #0a0d16;
    --panel: #121828;
    --panel-2: #1a2138;
    --line: rgba(255, 255, 255, .08);
    --gold: #ffd166;
    --gold-deep: #f5a623;
    --pink: #ff3b5c;
    --green: #2ee56b;
    --blue: #3a8bff;
    --red: #ff4d4d;
    --text: #eef1f8;
    --muted: #8b93a8;
    /* 디브리핑 전용(검증된 다크 팔레트) */
    --db-page: #0d0d0d;
    --db-surface: #1a1a19;
    --db-ink: #ffffff;
    --db-ink2: #c3c2b7;
    --db-mut: #898781;
    --db-grid: #2c2c2a;
    --db-base: #383835;
    --db-series: #3987e5;
    --db-critical: #d03b3b;
    --db-good: #0ca30c;
    --db-warn: #fab219;
    --db-line: rgba(255, 255, 255, .1);
    --db-chip: rgba(255, 255, 255, .04);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
    font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, -apple-system, sans-serif;
    background: radial-gradient(1200px 700px at 50% -10%, #182035 0%, #07090f 60%);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    word-break: keep-all;       /* 한국어 의미 단위 줄바꿈 */
    overflow-wrap: break-word;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; }
.hidden { display: none !important; }
.center { text-align: center; }
.muted { color: var(--muted); }
.danger-text { color: var(--red); font-weight: 700; }
.hl-y { color: var(--gold); }
.hl-g { color: var(--green); }
.hl-p { color: var(--pink); }

/* 여러 줄 문단은 줄 길이 비율을 맞춰 줄바꿈 (지원 브라우저에서) */
.intro-desc p, .intro-warn, .intro-privacy, #narration-text,
.modal-body p, .welcome-banner p, .event-banner p,
.crash-line, .db-desc, .db-note, .db-header h1, .db-stat p, .jp-sub {
    text-wrap: balance;
}

/* ══════════ 교육용 배지 (프레임 밖) ══════════ */
#edu-badge {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
    background: rgba(10, 13, 22, .8);
    border: 1px solid var(--line);
    padding: 6px 12px;
    border-radius: 999px;
    z-index: 500;
    white-space: nowrap;
}
#edu-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: livedot 1.6s infinite; }
#edu-badge button {
    font-size: 11px;
    color: var(--gold);
    border: 1px solid rgba(255, 209, 102, .35);
    padding: 3px 9px;
    border-radius: 999px;
}
#edu-badge button:hover { background: rgba(255, 209, 102, .12); }

/* ══════════ 가로 모드 안내 (모바일·태블릿 전용) ══════════ */
#rotate-guard {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999;
    background: #05060a;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    padding: 20px;
}
.rg-icon { font-size: 44px; animation: rgtilt 1.6s ease-in-out infinite; }
@keyframes rgtilt {
    0%, 20% { transform: rotate(-90deg); }
    55%, 100% { transform: rotate(0deg); }
}
@media (prefers-reduced-motion: reduce) { .rg-icon { animation: none; } }
#rotate-guard p { font-size: 18px; font-weight: 700; color: #fff; }
#rotate-guard p b { color: var(--gold); }
#rotate-guard span { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
#rg-exit {
    margin-top: 14px;
    font-size: 13px; font-weight: 700;
    color: var(--gold);
    border: 1px solid rgba(255, 209, 102, .45);
    border-radius: 999px;
    padding: 10px 18px;
    background: rgba(255, 209, 102, .08);
}
/* 터치 기기 + 가로 + 낮은 화면(폰·소형 태블릿)에서만 발동 — 데스크톱 가로 모니터는 제외 */
@media (orientation: landscape) and (max-height: 520px) and (pointer: coarse) {
    #rotate-guard { display: flex; }
}
/* 탈출 버튼을 누른 경우: 가로 그대로 진행 */
body.allow-landscape #rotate-guard { display: none !important; }

/* ══════════ 폰 프레임 ══════════ */
#phone {
    position: relative;
    width: min(420px, 100vw);
    height: min(880px, 100vh);
    background: var(--bg);
    border-radius: 34px;
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .7), 0 0 0 8px #05060a;
    overflow: hidden;
}
/* 화면 꽉 채우기: 작은 화면 + 터치 전용 기기(hover 없음)는 뷰포트 크기와 무관하게 항상.
   (페이지 줌 축소·'PC 버전 보기' 등으로 폰 뷰포트가 480px보다 크게 잡히는 예외 대응) */
@media (max-width: 480px), (max-height: 900px), (hover: none) and (pointer: coarse) {
    #phone { border-radius: 0; box-shadow: none; border: none; width: 100vw; height: 100vh; height: 100dvh; }
    #phone-notch { display: none; }
    #edu-badge { top: auto; bottom: 8px; }
}
/* JS 폴백(body.handheld): 미디어쿼리 신호가 어긋나는 브라우저용 — 위 블록과 동일 규칙 */
body.handheld #phone { border-radius: 0; box-shadow: none; border: none; width: 100vw; height: 100vh; height: 100dvh; }
body.handheld #phone-notch { display: none; }
body.handheld #edu-badge { top: auto; bottom: 8px; }
#phone-notch {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 110px;
    height: 22px;
    background: #05060a;
    border-radius: 999px;
    z-index: 200;
}
#phone.shake { animation: shake .45s; }
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(9px); }
    60% { transform: translateX(-7px); }
    80% { transform: translateX(5px); }
}

#status-bar {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 34px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 0 22px 2px;
    font-size: 12px;
    font-weight: 600;
    z-index: 150;
    pointer-events: none;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,.5);
}
#status-bar .status-icons { display: flex; gap: 6px; }
#status-bar .signal { letter-spacing: -1px; }

/* ══════════ 화면 공통 ══════════ */
.screen {
    position: absolute;
    inset: 0;
    padding-top: 34px;
    display: none;
    flex-direction: column;
    z-index: 1;
}
.screen.active { display: flex; }
.layer {
    position: absolute;
    inset: 0;
    padding-top: 34px;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}
#game-overlay { z-index: 10; }
#chat-layer { z-index: 20; }
#crash-layer { z-index: 100; background: #05060a; }

/* ══════════ 인트로 ══════════ */
#screen-intro {
    background: radial-gradient(600px 400px at 50% 0%, #1c2440 0%, var(--bg) 70%);
    overflow-y: auto;   /* 낮은 화면(인앱 브라우저 등)에서 시작 버튼까지 스크롤 가능하게 */
}
.intro-inner {
    flex: none;
    min-height: 100%;   /* 내용이 넘치면 자연스럽게 늘어나 스크롤됨 (고정 높이 + center의 상단 잘림 방지) */
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 28px; text-align: center; gap: 14px;
}
.intro-logo { font-size: 64px; filter: drop-shadow(0 6px 18px rgba(255, 209, 102, .35)); }
.intro-inner h1 { font-size: 40px; letter-spacing: 6px; background: linear-gradient(180deg, #fff, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.intro-sub { color: var(--muted); font-size: 13px; letter-spacing: 3px; }
.intro-desc { font-size: 14.5px; line-height: 1.8; color: #cfd6e6; margin-top: 6px; }
.intro-desc p + p { margin-top: 10px; }
.intro-warn { font-size: 13px; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; padding: 10px 14px; }
.intro-warn b { color: var(--gold); }
.intro-form { width: 100%; max-width: 280px; display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.intro-form label { font-size: 12px; color: var(--muted); text-align: left; }
.intro-form input {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 13px 16px;
    color: var(--text);
    font-size: 16px;
    outline: none;
    text-align: center;
}
.intro-form input:focus { border-color: var(--gold); }
.intro-credit { font-size: 11px; color: #5a6178; }
.intro-privacy {
    font-size: 11.5px;
    color: var(--muted);
    line-height: 1.6;
    text-align: center;
    background: rgba(46, 229, 107, .06);
    border: 1px solid rgba(46, 229, 107, .25);
    border-radius: 10px;
    padding: 8px 10px;
}
.beginner-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
    background: rgba(255, 209, 102, .08);
    border: 1px solid rgba(255, 209, 102, .3);
    border-radius: 10px;
    padding: 9px 10px;
    cursor: pointer;
    text-align: left;
    line-height: 1.4;
}
.beginner-toggle input { width: 16px; height: 16px; flex: none; accent-color: var(--gold); }
.beginner-toggle span { color: var(--text); }

.btn-gold {
    background: linear-gradient(180deg, var(--gold), var(--gold-deep));
    color: #241a00;
    font-weight: 800;
    border-radius: 12px;
    padding: 12px 18px;
    font-size: 15px;
    box-shadow: 0 6px 20px rgba(245, 166, 35, .35);
    transition: transform .08s;
}
.btn-gold:active { transform: scale(.97); }
.btn-gold.big { padding: 15px 18px; font-size: 17px; }

/* ══════════ 카톡 화면 ══════════ */
#screen-kakao { background: #b2c7d9; }
.kk-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #b2c7d9;
    border-bottom: 1px solid rgba(0, 0, 0, .06);
    color: #1f2933;
}
.kk-back { font-size: 24px; font-weight: 300; }
.kk-title { flex: 1; display: flex; flex-direction: column; }
.kk-title b { font-size: 16px; }
.kk-sub { font-size: 11px; color: #5b6b7a; }
.kk-icons { font-size: 15px; letter-spacing: 6px; color: #33404d; }
.kk-messages { flex: 1; overflow-y: auto; padding: 16px 14px 20px; display: flex; flex-direction: column; gap: 10px; }
.kk-row { display: flex; align-items: flex-end; gap: 6px; }
.kk-row.me { flex-direction: row-reverse; }
.kk-bubble {
    max-width: 72%;
    background: #fff;
    color: #1f2933;
    border-radius: 4px 14px 14px 14px;
    padding: 9px 12px;
    font-size: 14.5px;
    line-height: 1.5;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .08);
    animation: kkin .22s ease-out;
}
.kk-row.me .kk-bubble { background: #fee500; border-radius: 14px 4px 14px 14px; }
@keyframes kkin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.kk-time { font-size: 10px; color: #6b7c8c; margin-bottom: 2px; }
.kk-shot { background: #10131c !important; color: #fff !important; width: 200px; }
.shot-head { font-size: 11px; color: #9aa3b8; }
.shot-amt { font-size: 26px; font-weight: 800; color: var(--gold); margin: 6px 0 2px; }
.shot-sub { font-size: 12px; color: var(--green); }
.kk-link { background: #fff; width: 220px; padding: 0 !important; overflow: hidden; cursor: pointer; }
.link-title { background: linear-gradient(135deg, #1a2138, #3a2454); color: var(--gold); font-weight: 800; padding: 14px 12px; font-size: 15px; }
.link-desc { padding: 9px 12px 2px; font-size: 12.5px; color: #333; }
.link-url { padding: 0 12px 9px; font-size: 11px; color: #8a94a5; }
.link-cta { border-top: 1px solid #eee; padding: 10px 12px; text-align: center; font-size: 13px; font-weight: 700; color: #2f6bff; }
.kk-link.pulse { animation: pulse 1.2s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(47, 107, 255, .45); } 50% { box-shadow: 0 0 0 10px rgba(47, 107, 255, 0); } }
.kk-inputbar { display: flex; align-items: center; gap: 10px; background: #fff; padding: 10px 14px; color: #98a3af; }
.kk-input { flex: 1; background: #f4f5f7; border-radius: 999px; padding: 9px 14px; font-size: 13px; }
.kk-plus, .kk-emoji { font-size: 18px; }

/* ══════════ 사이트 메인 ══════════ */
#screen-site { background: var(--bg); }
.site-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; }

.site-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px 10px;
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, rgba(10, 13, 22, .97), rgba(10, 13, 22, .88));
    backdrop-filter: blur(8px);
    z-index: 5;
    border-bottom: 1px solid var(--line);
}
.hamburger { font-size: 20px; color: var(--muted); padding: 4px; cursor: pointer; }
.site-logo { flex: 1; }
.site-logo h1 {
    font-size: 20px;
    background: linear-gradient(180deg, #ffe9a8, var(--gold-deep));
    -webkit-background-clip: text; background-clip: text; color: transparent;
    display: flex; align-items: baseline; gap: 6px;
}
.site-logo h1 span { font-size: 9px; letter-spacing: 3px; color: var(--muted); -webkit-text-fill-color: var(--muted); }
.user-chip {
    text-align: right;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 6px 12px;
    cursor: pointer;
    min-width: 92px;
}
.user-chip-name { font-size: 10px; color: var(--muted); }
.user-chip-money { font-size: 14px; font-weight: 800; color: var(--gold); transition: color .15s; }
.user-chip-money.up { color: var(--green); }
.user-chip-money.down { color: var(--red); }
.user-chip-debt { font-size: 10px; font-weight: 700; color: var(--red); }

/* 마퀴 */
.marquee { display: flex; align-items: center; gap: 8px; background: #0d1120; border-bottom: 1px solid var(--line); padding: 7px 0 7px 12px; overflow: hidden; }
.marquee-icon { font-size: 13px; }
.marquee-track { flex: 1; overflow: hidden; }
.marquee-text { display: inline-flex; white-space: nowrap; font-size: 12.5px; color: #c6cde0; animation: marquee 38s linear infinite; }
.marquee-text em { font-style: normal; color: #39415c; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.live-strip { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); padding: 9px 16px 0; }
.live-strip b { color: var(--green); }
.live-sep { color: #39415c; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: livedot 1.4s infinite; }
@keyframes livedot { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

.welcome-banner {
    margin: 14px 14px 4px;
    background: linear-gradient(135deg, #251a3d, #3d1428);
    border: 1px solid rgba(255, 209, 102, .4);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
}
.welcome-banner h3 { color: var(--gold); font-size: 16px; margin-bottom: 8px; }
.welcome-banner p { font-size: 13px; line-height: 1.7; color: #d9dcea; margin-bottom: 12px; }
.welcome-banner .btn-gold { width: 100%; }

.section-title { font-size: 13px; font-weight: 700; color: var(--muted); padding: 18px 16px 10px; }

/* 게임 카드 */
.game-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 14px; }
.game-card { position: relative; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); cursor: pointer; transition: transform .1s; }
.game-card:active { transform: scale(.97); }
.game-card-bg { height: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.bg-slot { background: linear-gradient(135deg, #4a2c0e, #8a5a13); }
.bg-pb { background: linear-gradient(135deg, #0e2c4a, #134a8a); }
.bg-ladder { background: linear-gradient(135deg, #143a25, #1f6b42); }
.bg-vip { background: linear-gradient(135deg, #2d0f35, #6b1a4b); }
.gc-icon { font-size: 34px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .5)); }
.gc-title { font-size: 14px; font-weight: 800; text-shadow: 0 2px 6px rgba(0, 0, 0, .6); }
.game-card-foot { background: var(--panel); font-size: 11px; color: var(--muted); padding: 8px 10px; text-align: center; }
.live-badge {
    position: absolute; top: 8px; left: 8px; z-index: 2;
    font-size: 9px; font-weight: 800; letter-spacing: 1px;
    background: var(--pink); color: #fff;
    padding: 3px 8px; border-radius: 999px;
}
.live-badge.live { background: var(--green); color: #04250f; animation: livedot 1.4s infinite; }
.live-badge.vip { background: linear-gradient(180deg, var(--gold), var(--gold-deep)); color: #241a00; }
.game-card.locked .game-card-bg { filter: grayscale(.75) brightness(.6); }

/* 퀵 메뉴 */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 0 14px; }
.quick-item {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 4px;
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    font-size: 12px; color: #ccd3e4; font-weight: 600;
    transition: transform .1s;
}
.quick-item:active { transform: scale(.94); }
.quick-item span { font-size: 21px; }

.event-banner {
    margin: 16px 14px 0;
    background: linear-gradient(120deg, #101a30, #1c1030);
    border: 1px dashed rgba(255, 59, 92, .5);
    border-radius: 14px;
    padding: 13px 16px;
    cursor: pointer;
}
.event-banner b { color: var(--pink); font-size: 13.5px; }
.event-banner p { font-size: 12.5px; color: #c6cde0; line-height: 1.7; margin-top: 5px; }
.event-banner .hl { color: var(--gold); font-weight: 800; }

/* 하단 네비 */
.bottom-nav {
    position: absolute;
    bottom: 30px; left: 0; right: 0;
    display: flex;
    background: rgba(13, 17, 30, .97);
    border-top: 1px solid var(--line);
    padding: 7px 6px calc(7px + env(safe-area-inset-bottom, 0px));
    z-index: 6;
}
.nav-item {
    position: relative;
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    font-size: 10.5px; color: var(--muted); font-weight: 600;
}
.nav-item span { font-size: 19px; }
.nav-item.play {
    background: linear-gradient(180deg, var(--pink), #c21f3f);
    margin: -18px 4px 0;
    border-radius: 16px;
    padding: 9px 0 6px;
    color: #fff;
    box-shadow: 0 6px 16px rgba(255, 59, 92, .4);
}
.badge {
    position: absolute; top: -4px; right: 16%;
    background: var(--pink); color: #fff;
    font-size: 9px; font-weight: 800;
    min-width: 15px; height: 15px; border-radius: 999px;
    display: flex; align-items: center; justify-content: center;
    font-style: normal;
}
.browser-bar {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 30px;
    display: flex; align-items: center; gap: 14px;
    background: #05070d;
    padding: 0 16px;
    font-size: 12px; color: #4a5268;
    z-index: 6;
}
.browser-bar .url { flex: 1; text-align: center; background: #10141f; border-radius: 999px; padding: 4px 10px; font-size: 11px; color: #9aa3b8; }

/* ══════════ 게임 오버레이 ══════════ */
.overlay-header {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    background: #0d1120;
}
#btn-game-back { color: var(--gold); font-size: 14px; font-weight: 700; padding: 4px 6px; }
#game-title { flex: 1; text-align: center; font-size: 15px; }
.overlay-balance { font-size: 13px; font-weight: 800; color: var(--gold); }
#game-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 14px 24px; position: relative; display: flex; flex-direction: column; gap: 12px; }

.room-live { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); }
.room-live b { color: var(--green); }
.room-live.vip b { color: var(--gold); }
.pick-banner {
    background: linear-gradient(90deg, rgba(58, 139, 255, .18), transparent);
    border-left: 3px solid var(--blue);
    padding: 9px 12px;
    font-size: 13px; font-weight: 700;
    border-radius: 6px;
    animation: pulse-soft 1.6s infinite;
}
.pick-banner.gold { border-color: var(--gold); background: linear-gradient(90deg, rgba(255, 209, 102, .16), transparent); }
@keyframes pulse-soft { 0%, 100% { opacity: 1; } 50% { opacity: .65; } }

/* 금액 선택 */
.amount-picker { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.ap-btns { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.ap-btn {
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 8px 2px;
    font-size: 12px; font-weight: 700; color: #ccd3e4;
}
.ap-btn:active { background: #232c4a; }
.ap-btn.max { color: var(--gold); border-color: rgba(255, 209, 102, .4); }
.ap-btn.reset { color: var(--muted); }
.ap-display { display: flex; justify-content: space-between; margin-top: 9px; padding: 0 4px; }
.ap-display span { font-size: 10.5px; color: var(--muted); display: block; }
.ap-display b { font-size: 16px; }
.ap-display .right { text-align: right; }
.ap-display i { font-style: normal; }

.mbtn {
    border-radius: 12px;
    padding: 11px 16px;
    font-size: 14px; font-weight: 800;
    transition: transform .08s;
}
.mbtn:active { transform: scale(.97); }
.mbtn:disabled { filter: grayscale(.6) brightness(.6); cursor: default; }
.mbtn.gold { background: linear-gradient(180deg, var(--gold), var(--gold-deep)); color: #241a00; box-shadow: 0 5px 16px rgba(245, 166, 35, .3); }
.mbtn.dark { background: var(--panel-2); color: #ccd3e4; border: 1px solid var(--line); }
.mbtn.danger { background: linear-gradient(180deg, #ff5a5a, #c22525); color: #fff; }
.mbtn.slim { padding: 8px 14px; font-size: 13px; }
.mbtn.wide { width: 100%; }
.mbtn.big { padding: 15px 16px; font-size: 16px; }

/* 결과 팝업 */
.result-pop {
    position: absolute;
    top: 34%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(8, 10, 18, .96);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 22px 30px;
    text-align: center;
    z-index: 30;
    min-width: 230px;
    animation: popin .25s cubic-bezier(.2, 1.4, .5, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
}
.result-pop.win { border-color: rgba(255, 209, 102, .6); }
.result-pop.lose { border-color: rgba(255, 77, 77, .5); }
.result-pop h2 { font-size: 20px; margin-bottom: 8px; }
.result-pop.lose h2 { color: var(--red); }
.rp-amt { font-size: 30px; font-weight: 900; color: var(--gold); }
.rp-amt.lose { color: var(--red); }
.rp-streak { margin-top: 6px; font-size: 13px; color: var(--pink); font-weight: 800; }
.result-pop p { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
@keyframes popin { from { opacity: 0; transform: translate(-50%, -50%) scale(.7); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

/* 방 채팅 */
.room-chat {
    background: #0c101c;
    border: 1px solid var(--line);
    border-radius: 12px;
    height: 110px;
    overflow-y: auto;
    padding: 8px 10px;
    display: flex; flex-direction: column; gap: 5px;
}
.chat-msg { font-size: 12px; line-height: 1.4; }
.chat-msg b { color: #7ea4ff; margin-right: 6px; font-weight: 700; }
.chat-msg span { color: #b9c0d4; }

/* ── 슬롯 ── */
.slot-machine {
    background: linear-gradient(180deg, #2a1c08, #171007);
    border: 2px solid rgba(255, 209, 102, .5);
    border-radius: 18px;
    padding: 14px;
    text-align: center;
}
.slot-top { font-size: 13px; letter-spacing: 4px; color: var(--gold); font-weight: 800; margin-bottom: 10px; }
.slot-reels { display: flex; gap: 8px; justify-content: center; }
.reel {
    width: 86px; height: 96px;
    background: #fdf6e3;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 46px;
    box-shadow: inset 0 -14px 20px rgba(0, 0, 0, .18), inset 0 14px 20px rgba(0, 0, 0, .18);
}
.reel.stop { animation: reelstop .3s; }
@keyframes reelstop { 0% { transform: translateY(-8px); } 60% { transform: translateY(3px); } 100% { transform: none; } }
.reel.hot { box-shadow: 0 0 0 3px var(--pink), inset 0 -14px 20px rgba(0, 0, 0, .18); }
.reel.winline { box-shadow: 0 0 0 3px var(--gold), 0 0 24px rgba(255, 209, 102, .8); }
.slot-paytable { margin-top: 12px; font-size: 11px; color: #b9a26a; line-height: 1.7; }
.slot-paytable b { color: #ffe9a8; }

/* ── 파워볼 ── */
.pb-stage { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.pb-machine { height: 92px; display: flex; align-items: center; justify-content: center; position: relative; }
.pb-ball-icon { font-size: 52px; }
.pb-ball-icon.rolling { animation: roll .5s linear infinite; }
@keyframes roll { from { transform: rotate(0) translateY(0); } 25% { transform: rotate(90deg) translateY(-6px); } to { transform: rotate(360deg); } }
.pb-result-num {
    position: absolute;
    width: 68px; height: 68px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 30px; font-weight: 900; color: #fff;
    opacity: 0; transform: scale(.4);
    transition: all .3s cubic-bezier(.2, 1.5, .5, 1);
}
.pb-result-num.show { opacity: 1; transform: scale(1); }
.pb-result-num.blue { background: radial-gradient(circle at 30% 30%, #6ea8ff, #1a56c9); box-shadow: 0 0 26px rgba(58, 139, 255, .7); }
.pb-result-num.red { background: radial-gradient(circle at 30% 30%, #ff8a7a, #c92222); box-shadow: 0 0 26px rgba(255, 77, 77, .7); }
.pb-timer { position: relative; height: 20px; background: #0c101c; border-radius: 999px; margin-top: 10px; overflow: hidden; }
.pb-timer-bar { height: 100%; width: 100%; background: linear-gradient(90deg, var(--green), var(--gold)); transition: width 1s linear; }
.pb-timer span, #pb-timer-text {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 800; color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
#pb-timer-text.urgent { color: var(--red); font-size: 14px; animation: livedot .5s infinite; }

.pb-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pb-side {
    border-radius: 14px;
    padding: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color .15s, transform .1s;
}
.pb-side:active { transform: scale(.98); }
.pb-side.odd { background: linear-gradient(160deg, #0e2547, #0a1830); }
.pb-side.even { background: linear-gradient(160deg, #471616, #300a0a); }
.pb-side.sel { border-color: var(--gold); box-shadow: 0 0 18px rgba(255, 209, 102, .35); }
.pbs-head { display: flex; justify-content: space-between; align-items: baseline; }
.pbs-head b { font-size: 22px; }
.pb-side.odd .pbs-head b { color: #7ea4ff; }
.pb-side.even .pbs-head b { color: #ff8a7a; }
.pbs-head span { font-size: 12px; color: var(--muted); }
.pbs-total { font-size: 11px; color: var(--muted); margin: 5px 0; }
.pbs-total b { color: #ccd3e4; }
.pbs-feed { display: flex; flex-direction: column; gap: 3px; min-height: 58px; }
.pbs-feed div { display: flex; justify-content: space-between; font-size: 10.5px; color: #8f97ad; animation: kkin .2s; }
.pbs-feed div b { color: #b9c0d4; font-weight: 600; }
.pbs-feed div.mine { color: var(--gold); }
.pbs-feed div.mine b { color: var(--gold); }

.sb-dots { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px; }
.sb-dots .dot { width: 13px; height: 13px; border-radius: 50%; }
.sb-dots .dot.b { background: #2f6bff; }
.sb-dots .dot.r { background: #e33d3d; }

/* ── 사다리 ── */
.ladder-stage { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px; position: relative; }
.ladder-labels { display: flex; justify-content: space-between; padding: 0 18%; font-weight: 900; font-size: 15px; }
.ladder-labels .blue { color: #7ea4ff; }
.ladder-labels .red { color: #ff8a7a; }
#ladder-svg { width: 100%; height: 150px; display: block; }
.lbase { stroke: #39415c; stroke-width: 2; }
.lactive { stroke: var(--gold); stroke-width: 3.5; fill: none; stroke-linecap: round; filter: drop-shadow(0 0 4px rgba(255, 209, 102, .8)); }
.ladder-result {
    position: absolute;
    top: 10px; right: 12px;
    font-size: 13px; font-weight: 800; color: var(--gold);
    opacity: 0; transition: opacity .3s;
}
.ladder-result.show { opacity: 1; }
.ladder-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.lopt {
    border-radius: 12px;
    padding: 12px 4px;
    display: flex; flex-direction: column; gap: 3px; align-items: center;
    font-size: 14px; font-weight: 800;
    border: 2px solid transparent;
}
.lopt span { font-size: 11px; color: var(--muted); font-weight: 600; }
.lopt.blue { background: linear-gradient(160deg, #0e2547, #0a1830); color: #7ea4ff; }
.lopt.red { background: linear-gradient(160deg, #471616, #300a0a); color: #ff8a7a; }
.lopt.sel { border-color: var(--gold); box-shadow: 0 0 14px rgba(255, 209, 102, .35); }

/* 사다리 조합픽 안내 */
.combo-hint {
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12.5px; color: var(--muted); text-align: center;
    background: rgba(255, 209, 102, .05);
    border: 1px dashed rgba(255, 209, 102, .3);
}
.combo-hint.on {
    color: var(--text);
    border-style: solid; border-color: rgba(255, 209, 102, .55);
    background: rgba(255, 209, 102, .1);
    box-shadow: 0 0 12px rgba(255, 209, 102, .18);
}

/* ── VIP 바카라 ── */
.vip-room { display: flex; flex-direction: column; gap: 12px; }
.bacc-table {
    background: radial-gradient(400px 200px at 50% 0%, #14324a 0%, #0b1c2c 70%);
    border: 2px solid rgba(255, 209, 102, .45);
    border-radius: 18px;
    padding: 16px 12px;
    display: flex; align-items: center; justify-content: space-around;
}
.bacc-hand { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bh-label { font-size: 11px; letter-spacing: 2px; font-weight: 800; color: #7ea4ff; }
.bh-label.banker { color: #ff8a7a; }
.bh-cards { display: flex; gap: 6px; min-height: 74px; min-width: 104px; justify-content: center; }
.bh-total { font-size: 22px; font-weight: 900; color: var(--gold); min-height: 26px; }
.bacc-vs { font-size: 14px; font-weight: 900; color: #39415c; }
.pcard { width: 48px; height: 70px; perspective: 300px; position: relative; }
.pc-face {
    position: absolute; inset: 0;
    background: #fdf6e3;
    border-radius: 7px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: #1a1a1a; font-weight: 800;
    transition: transform .45s;
    backface-visibility: hidden;
}
.pc-face.red { color: #c92222; }
.pc-rank { font-size: 20px; }
.pc-suit { font-size: 16px; }
.pcard::after {
    content: "";
    position: absolute; inset: 0;
    border-radius: 7px;
    background: repeating-linear-gradient(45deg, #1a2138, #1a2138 4px, #232c4a 4px, #232c4a 8px);
    border: 1px solid rgba(255, 209, 102, .4);
    transition: transform .45s;
    backface-visibility: hidden;
}
.pcard .pc-face { transform: rotateY(180deg); }
.pcard:not(.back) .pc-face { transform: rotateY(0); }
.pcard:not(.back)::after { transform: rotateY(-180deg); }
.bacc-bets { display: grid; grid-template-columns: 1fr .8fr 1fr; gap: 8px; }
.bacc-bet {
    border-radius: 12px;
    padding: 13px 4px;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    font-size: 14px; font-weight: 800;
    border: 2px solid transparent;
}
.bacc-bet span { font-size: 11px; color: var(--muted); font-weight: 600; }
.bacc-bet.player { background: linear-gradient(160deg, #0e2547, #0a1830); color: #7ea4ff; }
.bacc-bet.banker { background: linear-gradient(160deg, #471616, #300a0a); color: #ff8a7a; }
.bacc-bet.tie { background: linear-gradient(160deg, #14401f, #0a2010); color: #7be29a; }
.bacc-bet.sel { border-color: var(--gold); box-shadow: 0 0 14px rgba(255, 209, 102, .35); }
.bacc-bet.winside { border-color: var(--gold); box-shadow: 0 0 22px rgba(255, 209, 102, .6); }
.vip-feed { background: #0c101c; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; min-height: 66px; }
.vip-feed div { display: flex; justify-content: space-between; font-size: 12px; padding: 3px 0; animation: kkin .2s; }
.vip-feed .ok { color: var(--green); }
.vip-feed .no { color: var(--red); }

/* ══════════ 텔레그램 채팅 ══════════ */
#chat-layer { background: #0e1621; }
.tg-header {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px;
    background: #17212b;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}
#btn-chat-back { font-size: 24px; color: #6ab2f2; font-weight: 300; }
.tg-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: linear-gradient(135deg, #e17076, #a75563);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; color: #fff;
}
.tg-title { display: flex; flex-direction: column; }
.tg-title b { font-size: 15px; }
.tg-title span { font-size: 12px; color: var(--muted); }
.tg-title span.online { color: #6ab2f2; }
.tg-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.tg-msg {
    max-width: 80%;
    padding: 9px 12px;
    border-radius: 14px;
    font-size: 14px; line-height: 1.55;
    animation: kkin .2s;
    position: relative;
}
.tg-msg.them { background: #182533; align-self: flex-start; border-bottom-left-radius: 4px; }
.tg-msg.me { background: #2b5278; align-self: flex-end; border-bottom-right-radius: 4px; }
.tg-msg b { color: var(--gold); }
.tg-time { display: inline-block; font-style: normal; font-size: 10px; color: rgba(255, 255, 255, .35); margin-left: 8px; transform: translateY(2px); }
.tg-msg .deleted { color: #5f6b7a; font-style: italic; font-size: 13px; }
.tg-msg.typing { display: flex; gap: 4px; padding: 13px 16px; }
.tg-msg.typing span { width: 7px; height: 7px; border-radius: 50%; background: #5f6b7a; animation: typing 1s infinite; }
.tg-msg.typing span:nth-child(2) { animation-delay: .15s; }
.tg-msg.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
.tg-sys { align-self: center; font-size: 11.5px; color: #5f6b7a; background: rgba(255, 255, 255, .04); padding: 4px 12px; border-radius: 999px; }
.tg-choices { display: flex; flex-direction: column; gap: 7px; padding: 0 14px 10px; }
.tg-choices button {
    background: rgba(106, 178, 242, .12);
    border: 1px solid rgba(106, 178, 242, .45);
    color: #6ab2f2;
    border-radius: 12px;
    padding: 11px;
    font-size: 14px; font-weight: 700;
    animation: kkin .25s;
}
.tg-choices button:active { background: rgba(106, 178, 242, .25); }
.tg-inputbar { display: flex; align-items: center; gap: 10px; background: #17212b; padding: 10px 16px; color: #5f6b7a; }
.tg-input { flex: 1; font-size: 14px; }

/* ══════════ 토스트 ══════════ */
#toast-container {
    position: absolute;
    top: 44px; right: 10px;
    display: flex; flex-direction: column; gap: 8px;
    z-index: 70;
    width: 240px;
    pointer-events: none;
}
.toast {
    background: rgba(13, 17, 30, .96);
    border: 1px solid var(--line);
    border-left: 3px solid var(--blue);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 12px; line-height: 1.5;
    color: #d5dbea;
    transform: translateX(120%);
    transition: transform .3s cubic-bezier(.2, 1, .4, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
.toast.show { transform: translateX(0); }
.toast.money { border-left-color: var(--gold); }
.toast.warn { border-left-color: var(--red); }

/* ══════════ 모달 ══════════ */
#modal-layer {
    position: absolute;
    inset: 0;
    background: rgba(3, 5, 10, .78);
    display: flex; align-items: center; justify-content: center;
    z-index: 90;
    padding: 22px;
    opacity: 0;
    transition: opacity .18s ease-out;
}
#modal-layer.on { opacity: 1; }
.modal-box {
    width: 100%;
    max-width: 340px;
    max-height: 86%;
    overflow-y: auto;
    background: linear-gradient(180deg, #161d31, #0f1424);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 20px;
    padding: 20px 18px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
    transform: translateY(10px) scale(.97);
    transition: transform .22s cubic-bezier(.2, .8, .3, 1);
    will-change: transform;
}
#modal-layer.on .modal-box { transform: none; }
.modal-title { font-size: 17px; font-weight: 800; text-align: center; margin-bottom: 14px; }
.modal-body { font-size: 13.5px; line-height: 1.65; }
.modal-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }

.loader {
    width: 34px; height: 34px;
    border: 3px solid var(--line);
    border-top-color: var(--gold);
    border-radius: 50%;
    margin: 12px auto;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet-item {
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px 6px;
    text-align: center;
    font-size: 13px; font-weight: 700; color: #ccd3e4;
    line-height: 1.9;
}
.sheet-item:active { background: #232c4a; }
.notice-list p { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; color: #c6cde0; }
.notice-list p:last-child { border: none; }
.myinfo .mi-row { display: flex; justify-content: space-between; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.myinfo .mi-row span { color: var(--muted); }

/* 랭킹 */
.rank-list { display: flex; flex-direction: column; }
.rank-row {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 6px;
    border-bottom: 1px solid var(--line);
    font-size: 13.5px;
}
.rank-row .rk { width: 30px; text-align: center; font-weight: 800; color: var(--muted); }
.rank-row .rname { flex: 1; }
.rank-row .ramt { font-weight: 800; color: var(--green); }
.rank-row.me-row { background: rgba(255, 209, 102, .1); border-radius: 8px; border: 1px solid rgba(255, 209, 102, .4); }
.rank-row.me-row .rname { color: var(--gold); font-weight: 800; }
.rank-note { margin-top: 10px; font-size: 11px; color: var(--muted); text-align: center; }
.brag-preview {
    margin-top: 12px;
    background: #0d1120;
    border: 1px dashed rgba(255, 209, 102, .5);
    border-radius: 10px;
    padding: 12px;
    font-size: 13px;
    text-align: center;
}

/* 초대 */
.invite-code {
    background: #0d1120;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    font-size: 13px; color: var(--muted);
    margin: 12px 0;
}
.invite-code b { color: var(--gold); letter-spacing: 1px; }
.inv-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.inv-input-row { display: flex; gap: 8px; }
.inv-input-row input {
    flex: 1;
    background: #0d1120;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--text);
    font-size: 14px;
    outline: none;
    min-width: 0;
}
.inv-input-row input:focus { border-color: var(--gold); }
#friend-list { margin: 12px 0; display: flex; flex-direction: column; gap: 6px; }
.friend-row {
    display: flex; justify-content: space-between; align-items: center;
    background: #0d1120;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 13px;
}
.friend-row b.ok { color: var(--green); font-size: 12px; }
.friend-row b.wait { color: var(--muted); font-size: 12px; font-weight: 600; }
.inv-share-row { display: flex; gap: 8px; }
.share-btn { flex: 1; border-radius: 10px; padding: 11px 4px; font-size: 13px; font-weight: 800; }
.share-btn.kakao { background: #fee500; color: #3c1e1e; }
.share-btn.link { background: var(--panel-2); border: 1px solid var(--line); color: #ccd3e4; }
.inv-fine { margin-top: 10px; font-size: 11px; color: var(--muted); text-align: center; }

/* 충전/환전 */
.pay-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.pay-tab {
    flex: 1;
    padding: 9px;
    border-radius: 10px;
    background: var(--panel-2);
    color: var(--muted);
    font-size: 14px; font-weight: 800;
    border: 1px solid var(--line);
}
.pay-tab.on { background: linear-gradient(180deg, var(--gold), var(--gold-deep)); color: #241a00; border-color: transparent; }
.deposit-box {
    background: #0d1120;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    margin-bottom: 12px;
}
.dep-warn { font-size: 11.5px; color: var(--pink); }
.acc-num { font-size: 17px; font-weight: 800; color: var(--gold); margin: 6px 0 3px; }
.acc-holder { font-size: 12px; color: var(--muted); }
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pay-btn {
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    font-size: 15px; font-weight: 800; color: #ffe9a8;
}
.pay-btn:active { background: #232c4a; }
.loan-card {
    margin-top: 12px;
    background: linear-gradient(120deg, #301325, #1c0f2e);
    border: 1px dashed rgba(255, 77, 77, .6);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}
.loan-card.dark { background: linear-gradient(120deg, #24140a, #1a0d0d); }
.loan-card b { font-size: 13.5px; }
.loan-card p { font-size: 12px; color: #c6cde0; line-height: 1.6; margin: 7px 0 10px; }
.loan-card .mbtn { display: block; margin: 0 auto; min-width: 62%; }
.loan-tag { background: var(--red); color: #fff; font-size: 10px; padding: 2px 7px; border-radius: 999px; margin-left: 5px; }
.ex-box { text-align: center; }
.ex-balance { color: var(--gold); font-size: 26px; margin: 4px 0 14px; }
#ex-loading p { font-size: 13px; color: var(--muted); margin-top: 4px; text-align: center; }

/* 가입 모달 */
.signup-fields { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.signup-fields input {
    background: #0d1120;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 13px;
    color: var(--gold);
    font-size: 14px;
    outline: none;
}
.consent-box { display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; color: #c6cde0; }
.consent-box b { color: var(--pink); }
.consent-box input { accent-color: var(--gold); margin-right: 6px; }
.progress-wrap { height: 8px; background: #0d1120; border-radius: 999px; margin-top: 12px; overflow: hidden; }
#su-progress { height: 100%; width: 0; background: linear-gradient(90deg, var(--pink), var(--gold)); transition: width .1s; }
.su-status { margin-top: 8px; font-size: 12px; color: var(--muted); text-align: center; }

/* ══════════ 스포트라이트 ══════════ */
#spotlight-layer { position: absolute; inset: 0; z-index: 85; }
#spotlight-hole {
    position: absolute;
    border-radius: 16px;
    box-shadow: 0 0 0 2000px rgba(2, 4, 9, .82);
    border: 2px solid var(--gold);
    animation: pulse-soft 1.4s infinite;
    cursor: pointer;
}
#spotlight-tip {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: #161d31;
    border: 1px solid rgba(255, 209, 102, .5);
    color: var(--text);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 13.5px;
    line-height: 1.5;
    width: max-content;
    max-width: 280px;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .6);
}
#spotlight-tip b { color: var(--gold); }

/* ══════════ 내레이션 (속마음 카드 — 손에 가리지 않게 중상단 배치) ══════════ */
#narration-bar {
    position: absolute;
    inset: 0;                          /* 화면 전체가 탭 영역 — 아무 데나 눌러 계속 */
    z-index: 80;
    cursor: pointer;
    background: rgba(3, 5, 10, .55);   /* 은은한 스크림으로 속마음에 집중 */
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 104px 20px 20px;          /* 상태바·타이틀 아래 중상단 */
    opacity: 0;
    transition: opacity .3s;
}
#narration-bar.show { opacity: 1; }
.narr-card {
    width: 100%;
    max-width: 340px;
    background: linear-gradient(180deg, #171e33, #101526);
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 18px;
    padding: 14px 18px 12px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
    transform: translateY(-16px);
    transition: transform .3s;
}
#narration-bar.show .narr-card { transform: none; }
.narr-label {
    display: block;
    text-align: center;
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--muted);
    margin-bottom: 8px;
}
#narration-text {
    font-size: 15.5px;
    line-height: 1.8;
    color: #e8ebf5;
    font-style: italic;
    text-align: center;
}
#narration-text b { color: var(--gold); font-style: normal; }
.narr-next { display: block; text-align: center; margin-top: 12px; font-size: 11px; color: var(--muted); animation: livedot 1.4s infinite; }

/* ══════════ 이펙트 ══════════ */
#fx-layer { position: absolute; inset: 0; pointer-events: none; z-index: 96; overflow: hidden; }
.coin {
    position: absolute;
    top: -8%;
    animation: coinfall 1.3s cubic-bezier(.3, 0, .7, .4) forwards;
}
@keyframes coinfall { to { top: 108%; transform: rotate(660deg); } }
#flash-layer { position: absolute; inset: 0; pointer-events: none; z-index: 95; opacity: 0; }
#flash-layer.on { animation: flashanim .24s 3; }
@keyframes flashanim { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }

/* 잭팟 */
.jackpot-layer {
    position: absolute;
    inset: 0;
    z-index: 60;
    background: radial-gradient(600px 500px at 50% 30%, rgba(80, 55, 0, .95), rgba(5, 6, 10, .98));
    display: flex; align-items: center; justify-content: center;
    animation: kkin .4s;
}
.jp-inner { text-align: center; padding: 20px; }
.jp-crown { font-size: 74px; animation: crownfloat 2s ease-in-out infinite; }
@keyframes crownfloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.jp-title { font-size: 15px; letter-spacing: 8px; color: var(--gold); margin: 10px 0; }
.jp-amt {
    font-size: 44px;
    font-weight: 900;
    background: linear-gradient(180deg, #fff2c4, var(--gold-deep));
    -webkit-background-clip: text; background-clip: text; color: transparent;
    filter: drop-shadow(0 6px 24px rgba(255, 200, 60, .5));
}
.jp-sub { margin: 14px 0 22px; font-size: 14px; color: #e8ddb8; }
.jp-sub b { color: var(--gold); }

/* ══════════ 파멸 ══════════ */
#crash-layer { align-items: center; justify-content: center; }
#crash-content { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 30px; }
.crash-line { font-size: 17px; color: #cfd6e6; text-align: center; line-height: 1.7; animation: kkin .6s; }
.crash-line b { color: var(--red); font-size: 21px; }
#crash-layer.glitch::before {
    content: attr(data-glitch);
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 900; color: var(--red);
    background: #05060a;
    animation: glitchanim .12s 10;
}

/* ── 잠적 엔딩: 브라우저 '사이트 접속 불가' 페이지 ── */
.site-down {
    position: absolute; inset: 0; z-index: 75;
    background: #202124;
    display: flex; align-items: center; justify-content: center;
    animation: kkin .4s;
}
.sd-inner { text-align: left; padding: 0 36px; max-width: 320px; }
.sd-icon { font-size: 42px; filter: grayscale(1); opacity: .55; margin-bottom: 18px; }
.sd-inner h2 { font-size: 17px; font-weight: 600; color: #e8eaed; margin-bottom: 8px; }
.sd-url { font-size: 13px; color: #9aa0a6; margin-bottom: 14px; word-break: break-all; }
.sd-desc { font-size: 12px; color: #9aa0a6; line-height: 1.6; margin-bottom: 24px; min-height: 38px; }
.sd-retry {
    background: #8ab4f8; color: #202124;
    font-weight: 700; font-size: 13px;
    padding: 9px 24px; border-radius: 999px;
}
.sd-retry:active { transform: scale(.96); }
@keyframes glitchanim {
    0% { transform: translate(0); opacity: 1; }
    25% { transform: translate(-6px, 2px); }
    50% { transform: translate(5px, -3px); opacity: .6; }
    75% { transform: translate(-3px, -2px); }
    100% { transform: translate(0); opacity: 1; }
}

/* ══════════ 사운드 버튼 (상태바 시계 옆) ══════════ */
#btn-sound {
    position: absolute;
    top: 6px; left: 64px;
    z-index: 210;
    font-size: 12px;
    background: rgba(13, 17, 30, .8);
    border: 1px solid var(--line);
    border-radius: 999px;
    width: 26px; height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: .85;
}

/* ══════════ 디브리핑 ══════════ */
body.debrief-mode { overflow: auto; display: block; }
body.debrief-mode #phone, body.debrief-mode #edu-badge { display: none; }
#debrief-layer {
    position: fixed;
    inset: 0;
    overflow-y: auto;
    background: var(--db-page);
    color: var(--db-ink);
    z-index: 600;
    animation: dbfade .8s;
}
@keyframes dbfade { from { opacity: 0; } to { opacity: 1; } }
.db-wrap { max-width: 660px; margin: 0 auto; padding: 48px 20px 60px; display: flex; flex-direction: column; gap: 18px; }
.db-header { margin-bottom: 6px; }
.db-eyebrow { font-size: 12px; letter-spacing: 2px; color: var(--db-mut); margin-bottom: 12px; text-transform: uppercase; }
.db-header h1 { font-size: 26px; line-height: 1.45; font-weight: 800; }
.db-critical { color: var(--db-critical); }

.db-hero {
    background: var(--db-surface);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 16px;
    padding: 26px 24px;
    text-align: center;
}
.db-hero-value { font-size: 52px; font-weight: 700; color: var(--db-ink); margin: 8px 0 6px; }
.db-hero-value span { font-size: 24px; color: var(--db-ink2); margin-left: 4px; }
.db-hero-sub { font-size: 13px; color: var(--db-mut); }

.db-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 560px) { .db-tiles { grid-template-columns: repeat(2, 1fr); } }
.db-tile {
    background: var(--db-surface);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 12px;
    padding: 14px;
    display: flex; flex-direction: column; gap: 4px;
}
.db-tile-label { font-size: 11.5px; color: var(--db-mut); }
.db-tile b { font-size: 19px; font-weight: 600; color: var(--db-ink); }
.db-delta { font-size: 11px; color: var(--db-ink2); }
.db-delta.down { color: var(--db-critical); }

.db-card {
    background: var(--db-surface);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 16px;
    padding: 22px 20px;
}
.db-card h2 { font-size: 17px; margin-bottom: 10px; }
.db-desc { font-size: 13.5px; color: var(--db-ink2); line-height: 1.7; margin-bottom: 14px; }
.db-note {
    margin-top: 14px;
    font-size: 13px; color: var(--db-ink2); line-height: 1.7;
    background: rgba(255, 255, 255, .04);
    border-left: 3px solid var(--db-series);
    padding: 10px 14px;
    border-radius: 6px;
}
.db-note b { color: var(--db-ink); }

.db-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.db-comp-side {
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 12px;
    padding: 16px 14px;
    display: flex; flex-direction: column; gap: 6px;
    text-align: center;
}
.db-comp-side b { font-size: 24px; font-weight: 700; }
.db-comp-side b.good { color: var(--db-good); }
.db-comp-side b.bad { color: var(--db-critical); }
.db-comp-side span { font-size: 11px; color: var(--db-mut); }

/* 차트 */
.db-chart { margin-top: 8px; }
.db-chart-plot { position: relative; height: 190px; margin: 26px 6px 0; }
.db-gridline {
    position: absolute; left: 26px; right: 0;
    border-top: 1px solid var(--db-grid);
}
.db-gridline.base { border-top-color: var(--db-base); }
.db-gridline i {
    position: absolute; left: -26px; top: -7px;
    font-style: normal; font-size: 10px; color: var(--db-mut);
    font-variant-numeric: tabular-nums;
}
.db-refline {
    position: absolute; left: 26px; right: 0;
    border-top: 1px solid var(--db-critical);
    opacity: .75;
    z-index: 2;
}
.db-refline i {
    position: absolute; right: 0; top: -16px;
    font-style: normal; font-size: 10px; color: var(--db-critical);
}
.db-cols {
    position: absolute; left: 26px; right: 0; top: 0; bottom: 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    z-index: 3;
}
.db-col {
    height: 100%;
    width: 56px;
    position: relative;
    padding: 0;
}
.db-col-val {
    position: absolute;
    bottom: var(--h, 0%);
    left: 0; right: 0;
    padding-bottom: 4px;
    text-align: center;
    font-size: 12px; color: var(--db-ink2); font-weight: 600;
}
.db-col-bar {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: var(--h, 2px);
    min-height: 2px;
    background: var(--db-series);
    border-radius: 4px 4px 0 0;
    transition: filter .15s;
}
.db-col:hover .db-col-bar, .db-col.on .db-col-bar { filter: brightness(1.25); }
.db-col.on .db-col-val { color: var(--db-ink); }
.db-col-label {
    position: absolute;
    top: 100%;
    margin-top: 6px;
    font-size: 10.5px;
    color: var(--db-mut);
    text-align: center;
    line-height: 1.35;
    width: 70px;
}
.db-chart-detail {
    margin-top: 44px;
    font-size: 12.5px;
    color: var(--db-ink2);
    line-height: 1.6;
    background: rgba(255, 255, 255, .04);
    border-radius: 8px;
    padding: 10px 14px;
    min-height: 40px;
}
.db-chart-detail b { color: var(--db-ink); }

.db-fake-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.db-fake-list li {
    font-size: 13.5px; color: var(--db-ink2); line-height: 1.65;
    padding-left: 16px;
    position: relative;
}
.db-fake-list li::before { content: "✕"; position: absolute; left: 0; color: var(--db-critical); font-weight: 700; }
.db-fake-list b { color: var(--db-ink); }

.db-stats { display: flex; flex-direction: column; gap: 10px; }
.db-stat {
    background: rgba(255, 255, 255, .04);
    border-radius: 10px;
    padding: 12px 14px;
}
.db-stat p { font-size: 13.5px; line-height: 1.65; color: var(--db-ink2); }
.db-stat span { display: block; margin-top: 5px; font-size: 11px; color: var(--db-mut); }

#pledge-input {
    width: 100%;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 10px;
    padding: 12px;
    color: var(--db-ink);
    font-size: 14px;
    resize: none;
    outline: none;
    margin-bottom: 10px;
}
#pledge-input:focus { border-color: var(--db-series); }
.db-btn {
    background: var(--db-series);
    color: #fff;
    font-weight: 700;
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 14px;
    width: 100%;
}
.db-btn.ghost { background: transparent; border: 1px solid rgba(255, 255, 255, .2); color: var(--db-ink2); }
.db-pledge-card {
    background: rgba(57, 135, 229, .1);
    border: 1px solid rgba(57, 135, 229, .4);
    border-radius: 12px;
    padding: 18px;
    font-size: 15px;
    line-height: 1.7;
    text-align: center;
}
.db-pledge-card span { display: block; margin-top: 8px; font-size: 12px; color: var(--db-mut); }

.db-help {
    background: linear-gradient(120deg, rgba(57, 135, 229, .12), rgba(12, 163, 12, .08));
    border: 1px solid rgba(57, 135, 229, .3);
    border-radius: 16px;
    padding: 22px 20px;
    text-align: center;
}
.db-help p { font-size: 13.5px; color: var(--db-ink2); line-height: 1.7; }
.db-help-num { font-size: 22px; margin: 12px 0 6px; }
.db-help-num b { color: var(--db-series); font-size: 30px; }
.db-help-sub { font-size: 12px !important; color: var(--db-mut) !important; }
.db-actions { margin-top: 4px; display: flex; flex-direction: column; gap: 8px; }
.db-foot { text-align: center; font-size: 11px; color: var(--db-mut); margin-top: 6px; }

/* ── 문서 헤더 (임상 보고서 스타일) ── */
.db-doc {
    background: var(--db-surface);
    border: 1px solid var(--db-line);
    border-top: 3px solid var(--db-series);
    border-radius: 12px;
    padding: 18px 20px;
}
.db-doc-org { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.db-doc-badge {
    font-size: 11px; font-weight: 700; letter-spacing: 1px;
    color: var(--db-series);
    border: 1px solid var(--db-series);
    border-radius: 999px;
    padding: 3px 10px;
}
.db-print-btn {
    font-size: 12px; font-weight: 700;
    color: var(--db-ink);
    background: var(--db-chip);
    border: 1px solid var(--db-line);
    border-radius: 8px;
    padding: 7px 12px;
}
.db-print-btn:hover { border-color: var(--db-series); }
.db-doc-title { font-size: 18px; font-weight: 800; margin: 12px 0 14px; color: var(--db-ink); }
.db-doc-meta {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
    border-top: 1px solid var(--db-line); padding-top: 12px;
}
@media (max-width: 560px) { .db-doc-meta { grid-template-columns: repeat(2, 1fr); } }
.db-doc-meta span { display: block; font-size: 10px; color: var(--db-mut); margin-bottom: 3px; }
.db-doc-meta b { font-size: 12.5px; font-weight: 600; color: var(--db-ink2); font-variant-numeric: tabular-nums; }

/* ── 기회비용 그리드 ── */
.db-cost-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
@media (max-width: 560px) { .db-cost-grid { grid-template-columns: repeat(2, 1fr); } }
.db-cost {
    background: var(--db-chip);
    border: 1px solid var(--db-line);
    border-radius: 10px;
    padding: 12px 8px;
    text-align: center;
    display: flex; flex-direction: column; gap: 3px;
}
.db-cost i { font-style: normal; font-size: 20px; }
.db-cost span { font-size: 10.5px; color: var(--db-mut); }
.db-cost b { font-size: 15px; color: var(--db-ink); }

/* ── 육각 레이더 ── */
.db-radar { width: min(340px, 100%); margin: 4px auto 0; display: block; }
.rd-grid { fill: none; stroke: var(--db-grid); stroke-width: 1; }
.rd-area { fill: var(--db-series); opacity: .16; }
.rd-line { fill: none; stroke: var(--db-series); stroke-width: 2; stroke-linejoin: round; }
.rd-dot { fill: var(--db-series); stroke: var(--db-surface); stroke-width: 2; }
.rd-label { font-size: 11px; fill: var(--db-mut); }
.rd-val { font-size: 12px; font-weight: 700; fill: var(--db-ink); }
.db-radar-notes { list-style: none; display: flex; flex-direction: column; gap: 7px; margin-top: 10px; }
.db-radar-notes li {
    display: flex; gap: 10px; align-items: baseline;
    font-size: 12.5px; line-height: 1.55;
    background: var(--db-chip);
    border-radius: 8px;
    padding: 8px 12px;
}
.db-radar-notes b { color: var(--db-ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.db-radar-notes span { color: var(--db-ink2); }

/* ── 잔액 곡선 ── */
.db-curve { width: 100%; display: block; margin-top: 4px; }
.cv-grid { stroke: var(--db-grid); stroke-width: 1; }
.cv-grid.base { stroke: var(--db-base); }
.cv-tick { font-size: 10.5px; fill: var(--db-mut); font-variant-numeric: tabular-nums; }
.cv-area { fill: var(--db-series); opacity: .13; }
.cv-line { fill: none; stroke: var(--db-series); stroke-width: 2; stroke-linejoin: round; }
.cv-peak { fill: var(--db-warn); stroke: var(--db-surface); stroke-width: 2; }
.cv-end { fill: var(--db-critical); stroke: var(--db-surface); stroke-width: 2; }
.cv-mark-label { font-size: 11px; font-weight: 700; }
.cv-mark-label.cv-peak { fill: var(--db-warn); stroke: none; }
.cv-mark-label.cv-end { fill: var(--db-critical); stroke: none; }

/* ── CAGI 자가진단 ── */
.cagi-unprinted { margin-top: 10px; font-size: 11px; color: var(--db-mut); }
.cagi-progress { height: 4px; background: var(--db-chip); border-radius: 999px; overflow: hidden; margin-bottom: 12px; }
.cagi-progress i { display: block; height: 100%; background: var(--db-series); transition: width .25s; }
.cagi-qnum { font-size: 11.5px; color: var(--db-mut); margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.cagi-qtext { font-size: 15.5px; font-weight: 700; color: var(--db-ink); line-height: 1.6; margin-bottom: 14px; }
.cagi-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.cagi-opt {
    background: var(--db-chip);
    border: 1px solid var(--db-line);
    border-radius: 10px;
    padding: 13px 10px;
    font-size: 13.5px; font-weight: 600; color: var(--db-ink2);
    text-align: center;
}
.cagi-opt:hover { border-color: var(--db-series); color: var(--db-ink); }
.cagi-opt.sel { border-color: var(--db-series); background: rgba(57, 135, 229, .14); color: var(--db-ink); }
.db-btn.slim { width: auto; padding: 8px 14px; font-size: 12.5px; }
.cagi-lights { display: flex; gap: 12px; justify-content: center; margin: 6px 0 16px; }
.cagi-light {
    width: 58px; height: 58px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 800;
    background: var(--db-chip); color: var(--db-mut);
    border: 1px solid var(--db-line);
    transition: all .4s;
}
.cagi-light.green.on { background: var(--db-good); color: #fff; box-shadow: 0 0 18px rgba(12, 163, 12, .5); }
.cagi-light.yellow.on { background: var(--db-warn); color: #241a00; box-shadow: 0 0 18px rgba(250, 178, 25, .5); }
.cagi-light.red.on { background: var(--db-critical); color: #fff; box-shadow: 0 0 18px rgba(208, 59, 59, .55); }
.cagi-score { text-align: center; font-size: 14px; color: var(--db-ink2); margin-bottom: 18px; }
.cagi-score b { font-size: 22px; color: var(--db-ink); }
.cagi-score span { color: var(--db-mut); font-size: 12px; }
.cagi-name.safe { color: var(--db-good); }
.cagi-name.warn { color: var(--db-warn); }
.cagi-name.danger { color: var(--db-critical); }
.cagi-band { position: relative; display: flex; height: 26px; border-radius: 8px; overflow: visible; margin-bottom: 8px; }
.cagi-seg {
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700;
    border-right: 2px solid var(--db-page);
}
.cagi-seg:first-child { border-radius: 8px 0 0 8px; }
.cagi-seg:nth-child(3) { border-radius: 0 8px 8px 0; border-right: none; }
.cagi-seg.safe { background: rgba(12, 163, 12, .18); color: var(--db-good); }
.cagi-seg.warn { background: rgba(250, 178, 25, .16); color: var(--db-warn); }
.cagi-seg.danger { background: rgba(208, 59, 59, .16); color: var(--db-critical); }
.cagi-pin {
    position: absolute; top: -6px; bottom: -6px; width: 3px;
    background: var(--db-ink);
    border-radius: 2px;
}
.cagi-pin em {
    position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    margin-top: 4px;
    font-style: normal; font-size: 10.5px; font-weight: 800;
    color: var(--db-ink);
    background: var(--db-chip);
    border: 1px solid var(--db-line);
    border-radius: 6px;
    padding: 2px 7px;
    white-space: nowrap;
}
.cagi-result { padding-bottom: 14px; }

/* ── 과학 3카드 / 오해와 진실 / 실천 4단계 ── */
.db-sci { display: flex; flex-direction: column; gap: 10px; }
.db-sci-item {
    background: var(--db-chip);
    border-left: 3px solid var(--db-series);
    border-radius: 8px;
    padding: 12px 14px;
}
.db-sci-item b { display: block; font-size: 13.5px; color: var(--db-ink); margin-bottom: 5px; }
.db-sci-item p { font-size: 12.5px; color: var(--db-ink2); line-height: 1.65; }
.db-myth { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
@media (max-width: 560px) { .db-myth { grid-template-columns: 1fr; } }
.db-myth-item {
    background: var(--db-chip);
    border: 1px dashed rgba(208, 59, 59, .45);
    border-radius: 10px;
    padding: 12px 14px;
}
.db-myth-item b { display: block; font-size: 13px; color: var(--db-critical); margin-bottom: 5px; }
.db-myth-item p { font-size: 12.5px; color: var(--db-ink2); line-height: 1.6; }
.db-steps { list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 10px; }
.db-steps li {
    counter-increment: step;
    position: relative;
    padding: 10px 14px 10px 46px;
    background: var(--db-chip);
    border-radius: 10px;
    font-size: 12.5px; line-height: 1.6;
}
.db-steps li::before {
    content: counter(step);
    position: absolute; left: 12px; top: 12px;
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--db-series); color: #fff;
    font-size: 12px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}
.db-steps b { display: block; color: var(--db-ink); font-size: 13.5px; margin-bottom: 2px; }
.db-steps span { color: var(--db-ink2); }

/* ── 서약서 ── */
.db-oath {
    display: flex; gap: 10px; align-items: flex-start;
    background: var(--db-chip);
    border: 1px solid var(--db-line);
    border-radius: 10px;
    padding: 11px 13px;
    font-size: 13px; color: var(--db-ink2); line-height: 1.6;
    margin-bottom: 8px;
    cursor: pointer;
}
.db-oath input { margin-top: 3px; accent-color: var(--db-series); width: 16px; height: 16px; flex-shrink: 0; }
.db-oath.miss { border-color: var(--db-critical); animation: shake .4s; }
.db-sign-row { display: flex; gap: 8px; margin-top: 10px; }
.db-sign-row input {
    flex: 1;
    background: var(--db-chip);
    border: 1px solid var(--db-line);
    border-radius: 10px;
    padding: 12px;
    color: var(--db-ink);
    font-size: 14px;
    outline: none;
}
.db-sign-row input:focus { border-color: var(--db-series); }
.db-sign-row .db-btn { width: auto; padding: 12px 26px; }
.db-pledge-oaths { font-size: 13px; color: var(--db-ink2); line-height: 1.7; margin-bottom: 10px; }

/* ── 도움 채널 그리드 ── */
.db-help-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 10px; }
@media (max-width: 560px) { .db-help-grid { grid-template-columns: 1fr; } }
.db-help-grid div {
    background: var(--db-chip);
    border: 1px solid var(--db-line);
    border-radius: 10px;
    padding: 12px 8px;
}
.db-help-grid span { display: block; font-size: 10.5px; color: var(--db-mut); margin-bottom: 4px; }
.db-help-grid b { font-size: 17px; color: var(--db-series); }

/* ══════════ A4 인쇄 — 2쪽 요약 보고서(#print-report)만 인쇄된다 ══════════ */
#print-report { display: none; }

@media print {
    @page { size: A4; margin: 11mm 12mm; }
    :root {
        color-scheme: light;
        --db-series: #2a78d6;
        --db-critical: #b93227;
        --db-good: #067306;
        --db-warn: #a06e00;
        --db-ink: #111111;
        --db-ink2: #3a3a38;
        --db-mut: #6d6b66;
        --db-grid: #dddcd5;
        --db-base: #b9b7b0;
        --db-surface: #ffffff;
    }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    body, body.debrief-mode { background: #fff !important; overflow: visible; }
    #phone, #edu-badge, #toast-container, .no-print, .db-wrap { display: none !important; }
    #debrief-layer {
        position: static !important;
        overflow: visible !important;
        animation: none;
        background: #fff;
    }

    #print-report {
        display: block;
        color: #111;
        font-size: 9.5pt;
        line-height: 1.55;
        font-variant-numeric: tabular-nums;
    }
    .pr-page:first-child { break-after: page; }
    .pr-page { break-inside: auto; }

    /* 헤더 */
    .pr-head { border-bottom: 2.5px solid var(--db-series); padding-bottom: 3mm; margin-bottom: 4mm; }
    .pr-head-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2mm; }
    .pr-badge {
        font-size: 7.5pt; font-weight: 700; letter-spacing: .5px;
        color: var(--db-series);
        border: 1px solid var(--db-series);
        border-radius: 999px;
        padding: .8mm 3mm;
    }
    .pr-docno { font-size: 8pt; color: #6d6b66; }
    .pr-head h1 { font-size: 16pt; font-weight: 800; color: #111; margin: 0 0 2mm; }
    .pr-meta { display: flex; gap: 6mm; flex-wrap: wrap; font-size: 8.5pt; color: #6d6b66; }
    .pr-meta b { color: #111; font-weight: 700; }

    /* 핵심 수치 */
    .pr-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2mm; margin-bottom: 4mm; }
    .pr-stats div { border: 1px solid #dcdad2; border-radius: 2mm; padding: 2mm 3mm; }
    .pr-stats span { display: block; font-size: 7.5pt; color: #6d6b66; margin-bottom: .6mm; }
    .pr-stats b { font-size: 10.5pt; color: #111; }
    .pr-stats .crit b { color: var(--db-critical); }

    /* 섹션 */
    .pr-sec { margin-bottom: 4mm; break-inside: avoid; }
    .pr-sec h2 {
        font-size: 10pt; font-weight: 800; color: #111;
        border-left: 3px solid var(--db-series);
        padding-left: 2.5mm;
        margin: 0 0 2mm;
    }
    .pr-small { font-size: 8.5pt; color: #3a3a38; margin-top: 1.5mm; }
    .pr-cols { display: flex; gap: 5mm; align-items: flex-start; }
    .pr-radar { width: 74mm; flex-shrink: 0; }
    .pr-cols .pr-sec { flex: 1; }
    .pr-notes { list-style: none; margin: 0; padding: 0; }
    .pr-notes li { font-size: 8.5pt; color: #3a3a38; padding: 1.2mm 0; border-bottom: 1px solid #eceae4; }
    .pr-notes b { color: #111; }

    /* 차트 (기존 SVG 재사용 — 라이트 변수로 재채색) */
    #print-report .db-curve { width: 100%; height: 46mm; }
    #print-report .db-radar { width: 100%; margin: 0; }
    #print-report .rd-label { fill: #6d6b66; }
    #print-report .rd-val { fill: #111; }
    #print-report .cv-tick { fill: #6d6b66; }
    /* 흰 외곽선은 점(circle)에만 — 텍스트 라벨까지 stroke가 덮으면 글자가 사라진다 */
    #print-report circle.rd-dot, #print-report circle.cv-peak, #print-report circle.cv-end { stroke: #fff; }

    /* 승률 표 */
    .pr-table { width: 100%; border-collapse: collapse; font-size: 8.5pt; }
    .pr-table th, .pr-table td { border: 1px solid #dcdad2; padding: 1.4mm 2.5mm; text-align: left; vertical-align: top; }
    .pr-table th { background: #f4f3ee; font-size: 8pt; color: #3a3a38; }
    .pr-table td:nth-child(2) { font-weight: 800; color: var(--db-series); white-space: nowrap; }

    /* CAGI */
    .pr-cagi { display: flex; gap: 5mm; align-items: flex-start; }
    .pr-lights { display: flex; gap: 1.5mm; flex-shrink: 0; padding-top: 1mm; }
    .pr-lights i {
        width: 11mm; height: 11mm; border-radius: 50%;
        display: flex; align-items: center; justify-content: center;
        font-style: normal; font-size: 7pt; font-weight: 800;
        background: #f4f3ee; color: #b9b7b0;
        border: 1px solid #dcdad2;
    }
    .pr-lights i.g.on { background: var(--db-good); color: #fff; border-color: var(--db-good); }
    .pr-lights i.y.on { background: #fab219; color: #241a00; border-color: #fab219; }
    .pr-lights i.r.on { background: #d03b3b; color: #fff; border-color: #d03b3b; }
    .pr-cagi-body b { font-size: 10pt; color: #111; }
    .pr-cagi-body p { font-size: 8.5pt; color: #3a3a38; margin: 1mm 0 0; }
    .pr-guide { color: #111 !important; }

    /* 소견·서약 */
    .pr-opinion { font-size: 9pt; color: #111; background: #f4f3ee; border-radius: 2mm; padding: 3mm 4mm; margin: 0; }
    .pr-opinion b { color: var(--db-critical); }
    .pr-oath { font-size: 8.5pt; color: #3a3a38; margin: 0 0 3mm; }
    .pr-signrow { display: flex; gap: 8mm; font-size: 9pt; color: #111; align-items: baseline; }
    .pr-signrow b { font-weight: 800; }
    .pr-line { display: inline-block; width: 28mm; border-bottom: 1px solid #6d6b66; height: 4mm; }

    .pr-foot {
        margin-top: 5mm;
        border-top: 1.5px solid var(--db-series);
        padding-top: 2mm;
        font-size: 7.5pt; color: #6d6b66; line-height: 1.7;
    }
    .pr-foot b { color: #111; }
}


/* ══════════ 인트로 모드 선택 ══════════ */
.mode-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 2px; }
.mode-btn {
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    border-radius: 14px;
    padding: 14px 10px 12px;
    text-align: center;
    transition: transform .08s;
}
.mode-btn:active { transform: scale(.96); }
.mode-btn .mode-icon { font-size: 26px; }
.mode-btn .mode-name { font-size: 14.5px; font-weight: 800; }
.mode-btn .mode-desc { font-size: 10.5px; line-height: 1.55; color: var(--muted); }
.mode-btn.full {
    background: linear-gradient(180deg, var(--gold), var(--gold-deep));
    box-shadow: 0 6px 20px rgba(245, 166, 35, .35);
}
.mode-btn.full .mode-name { color: #241a00; }
.mode-btn.full .mode-desc { color: rgba(36, 26, 0, .72); }
.mode-btn.full .mode-desc b { color: #241a00; }
.mode-btn.quick {
    background: var(--panel);
    border: 1px solid rgba(58, 139, 255, .55);
}
.mode-btn.quick .mode-name { color: var(--blue); }
.mode-btn.quick .mode-desc b { color: var(--text); }

/* ══════════ 빠른 교육 모드 — 몽타주 ══════════ */
.qm-layer {
    position: absolute; inset: 0;
    z-index: 70;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(120% 90% at 50% 30%, #101528 0%, #05060a 70%);
    animation: qm-in .35s ease;
}
@keyframes qm-in { from { opacity: 0; } to { opacity: 1; } }
.qm-inner { text-align: center; padding: 0 26px; width: 100%; }
.qm-label { font-size: 13px; letter-spacing: 3px; color: var(--muted); margin-bottom: 14px; }
.qm-amt {
    font-size: 38px; font-weight: 900; letter-spacing: 1px;
    color: var(--gold);
    text-shadow: 0 0 26px rgba(255, 209, 102, .35);
    font-variant-numeric: tabular-nums;
}
.qm-layer.down .qm-amt { color: var(--red); text-shadow: 0 0 26px rgba(255, 77, 77, .35); }
.qm-cap {
    margin: 20px auto 0; max-width: 300px; min-height: 48px;
    font-size: 14.5px; line-height: 1.6; color: #dfe4f2;
    opacity: 0;
}
.qm-cap b { color: var(--gold); }
.qm-layer.down .qm-cap b { color: var(--red); }
.qm-cap.show { animation: qm-cap .5s ease forwards; }
@keyframes qm-cap { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
