@font-face {
  font-family: 'Pretendard';
  src: url('../assets/fonts/Pretendard-700.ttf') format('truetype');
  font-weight: 700; font-display: swap;
}
@font-face {
  font-family: 'Pretendard';
  src: url('../assets/fonts/Pretendard-900.ttf') format('truetype');
  font-weight: 900; font-display: swap;
}
@font-face {
  font-family: 'SongMyung';
  src: url('../assets/fonts/SongMyung-sub.woff2') format('woff2');
  font-weight: 400; font-display: swap;
}

:root {
  --felt: #0a3b2e;
  --felt-2: #0d4a3a;
  --felt-3: #052a21;
  --felt-deep: #031d17;
  --gold: #d9b874;
  --gold-2: #f3dfae;
  --gold-dim: #9b8250;
  --ivory: #f7f2e6;
  --text: #f4f0e4;
  --muted: #c3d2cb;
  --muted-2: #a7bbb2;
  --line: rgba(217, 184, 116, .26);
  --line-soft: rgba(244, 240, 228, .12);
  --panel: #0b2c24;
  --panel-2: #0e352b;
  --card-bg: #fbf7ea;
  --ink: #161d1a;
  --red: #d94b42;
  --red-soft: #ff8d84;
  --blue: #3f7fd9;
  --blue-soft: #8bb8ff;
  --green-tie: #55c08a;
  --ok: #6fe0ae;
  --warn: #f2b45c;
  --bad: #ff8f80;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .38);
  --w: 1180px;
  --vbar-h: 67px;
  --font-ui: 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  --font-display: 'SongMyung', 'Pretendard', serif;
  color-scheme: dark;
}

html[data-theme="light"] {
  --felt: #0e5a45;
  --felt-2: #127059;
  --felt-3: #0a4636;
  --felt-deep: #e9e2d0;
  --text: #13211c;
  --muted: #3c534a;
  --muted-2: #4b6459;
  --panel: #fffdf5;
  --panel-2: #f7f2e4;
  --line: rgba(94, 76, 36, .28);
  --line-soft: rgba(20, 40, 32, .14);
  --shadow: 0 16px 40px rgba(30, 40, 30, .16);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-bottom: calc(var(--vbar-h) + 24px); scroll-padding-top: 0; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-weight: 700;
  background:
    radial-gradient(1200px 700px at 78% -10%, rgba(217, 184, 116, .10), transparent 60%),
    radial-gradient(900px 600px at 8% 30%, rgba(24, 110, 85, .22), transparent 60%),
    var(--felt-deep);
  color: var(--text);
  line-height: 1.62;
  word-break: keep-all;
  overflow-wrap: break-word;
  padding-bottom: calc(var(--vbar-h) + 26px);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
html[data-theme="light"] body {
  background:
    radial-gradient(1100px 600px at 80% -10%, rgba(217, 184, 116, .22), transparent 60%),
    radial-gradient(900px 600px at 0% 20%, rgba(18, 112, 89, .10), transparent 55%),
    #f2ecdc;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
button { font-family: inherit; font-weight: 700; cursor: pointer; border: 0; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; }
::selection { background: var(--gold); color: #101812; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; border-radius: 6px; }

/* ── 인트로 커튼 ─────────────────────────── */
#curtain {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background: radial-gradient(800px 500px at 50% 42%, #0f4636, #031d17 70%);
  color: #f3dfae; transition: opacity .55s ease, visibility .55s;
}
#curtain.gone { opacity: 0; visibility: hidden; pointer-events: none; }
#curtain .cu-in { text-align: center; animation: cuIn 1.1s cubic-bezier(.2,.8,.2,1) both; }
#curtain .cu-mark {
  width: 74px; height: 96px; margin: 0 auto 18px; border: 1px solid rgba(243, 223, 174, .7);
  border-radius: 8px; display: grid; place-items: center; font-size: 34px; color: #f3dfae;
  box-shadow: 0 0 40px rgba(217, 184, 116, .25), inset 0 0 24px rgba(217, 184, 116, .12);
}
#curtain .cu-name { font-family: var(--font-display); font-size: 27px; letter-spacing: .12em; }
#curtain .cu-sub { font-size: 11px; letter-spacing: .34em; color: #c9b684; margin-top: 10px; }
#curtain .cu-line { width: 0; height: 1px; background: linear-gradient(90deg, transparent, #d9b874, transparent); margin: 22px auto 0; animation: cuLine 1.2s .25s ease forwards; }
@keyframes cuIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes cuLine { to { width: 190px; } }

/* ── 헤더 ───────────────────────────────── */
.hdr {
  position: sticky; top: 0; z-index: 90;
  background: rgba(4, 28, 23, .86);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
html[data-theme="light"] .hdr { background: rgba(250, 246, 235, .92); }
.hdr-in {
  max-width: var(--w); margin: 0 auto; display: flex; align-items: center; gap: 14px;
  height: 58px; padding: 0 18px;
}
.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand .mark {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  border: 1px solid var(--line); color: var(--gold-2); font-size: 17px;
  background: linear-gradient(160deg, rgba(217,184,116,.16), rgba(217,184,116,.02));
  box-shadow: inset 0 0 16px rgba(217, 184, 116, .12);
}
.brand .b-name { font-family: var(--font-display); font-size: 19px; letter-spacing: .04em; color: var(--ivory); }
html[data-theme="light"] .brand .b-name { color: var(--text); }
.brand .b-tag { display: block; font-family: var(--font-ui); font-size: 9px; letter-spacing: .28em; color: var(--gold-dim); margin-top: -3px; }
.tabs { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.tab {
  padding: 8px 12px; border-radius: 9px; font-size: 13px; color: var(--muted);
  border: 1px solid transparent; white-space: nowrap;
}
.tab:hover { color: var(--ivory); }
.tab.on { color: #101812; background: linear-gradient(180deg, var(--gold-2), var(--gold)); border-color: transparent; }
html[data-theme="light"] .tab:hover { color: var(--text); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line-soft);
  display: grid; place-items: center; color: var(--muted); font-size: 15px; margin-left: 4px;
}
.icon-btn:hover { color: var(--gold-2); border-color: var(--line); }
.hdr-burger { display: none; }
@media (max-width: 860px) {
  .hdr-in { flex-wrap: wrap; height: auto; padding: 8px 12px 0; gap: 8px; }
  .tabs { order: 3; width: 100%; margin-left: 0; display: flex; padding: 2px 0 8px; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { padding: 7px 11px; font-size: 12.5px; }
  .hdr-burger { display: none; }
}

/* ── 공통 ───────────────────────────────── */
.wrap { max-width: var(--w); margin: 0 auto; padding: 0 18px; }
.view { display: none; animation: viewIn .35s ease both; }
.view.on { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.eyebrow { font-size: 11px; letter-spacing: .3em; color: var(--gold); text-transform: uppercase; }
.sec-title { font-size: clamp(24px, 3.4vw, 34px); color: var(--ivory); }
html[data-theme="light"] .sec-title { color: #12241d; }
.sec-sub { color: var(--muted); font-size: 14.5px; margin-top: 8px; }
.card {
  background: linear-gradient(165deg, rgba(255,255,255,.045), rgba(255,255,255,.012));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px;
}
html[data-theme="light"] .card { background: #fffdf5; }
.gold-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 24px; border-radius: 12px;
  background: linear-gradient(180deg, #f6e3b2, #d8b46a 55%, #c39e55);
  color: #14201a; font-weight: 900; font-size: 15px; letter-spacing: .01em;
  box-shadow: 0 10px 26px rgba(217, 184, 116, .22), inset 0 1px 0 rgba(255,255,255,.6);
  transition: transform .15s, box-shadow .15s;
}
.gold-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 32px rgba(217, 184, 116, .3); }
.gold-btn:active { transform: translateY(1px); }
.ghost-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 12px;
  border: 1px solid var(--line); color: var(--ivory); font-size: 14px;
}
html[data-theme="light"] .ghost-btn { color: var(--text); }
.ghost-btn:hover { border-color: var(--gold); color: var(--gold-2); }
.hr { height: 1px; background: var(--line-soft); margin: 18px 0; border: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.num { font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; letter-spacing: .04em; border: 1px solid var(--line);
  color: var(--gold-2); background: rgba(217, 184, 116, .08);
}
.tag-ok { color: #0e241a; background: var(--ok); border-color: transparent; }
.tag-bad { color: #2a0d09; background: var(--bad); border-color: transparent; }
.tag-warn { color: #2a1c06; background: var(--warn); border-color: transparent; }

/* ── 홈 ─────────────────────────────────── */
.hero { padding: 46px 0 24px; }
.hero-in {
  position: relative; overflow: hidden; border-radius: 26px;
  border: 1px solid var(--line);
  background:
    radial-gradient(700px 380px at 80% 10%, rgba(217, 184, 116, .18), transparent 60%),
    radial-gradient(600px 420px at 10% 100%, rgba(31, 132, 102, .35), transparent 60%),
    linear-gradient(150deg, #0f4c3b, #0a3b2e);
  background-color: #082f26;
  padding: clamp(30px, 5vw, 62px);
  box-shadow: var(--shadow);
}
.hero-in::after {
  content: ""; position: absolute; inset: 14px; border: 1px solid rgba(217, 184, 116, .18);
  border-radius: 18px; pointer-events: none;
}
.hero h1 { font-size: clamp(34px, 6.2vw, 64px); line-height: 1.12; color: #f8f3e3; max-width: 15em; }
.hero h1 em { font-style: normal; color: var(--gold-2); }
.hero-desc { color: #d5e0da; font-size: clamp(14px, 1.6vw, 17px); margin-top: 16px; max-width: 34em; line-height: 1.75; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-note { margin-top: 22px; font-size: 12px; color: #b9c9c0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 34px; }
.hstat { border-top: 1px solid rgba(217,184,116,.26); padding-top: 12px; }
.hstat b { display: block; font-size: clamp(17px, 2.4vw, 24px); color: var(--gold-2); font-variant-numeric: tabular-nums; }
.hstat span { font-size: 11.5px; color: #bdd0c6; }

.modes { padding: 26px 0 10px; }
.mode-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 22px; }
.mode {
  position: relative; text-align: left; padding: 24px; border-radius: 18px;
  border: 1px solid var(--line); background: linear-gradient(165deg, rgba(255,255,255,.05), rgba(255,255,255,.01));
  transition: transform .2s, border-color .2s, background .2s; overflow: hidden;
}
.mode:hover { transform: translateY(-3px); border-color: rgba(217,184,116,.5); }
.mode .m-no { font-size: 11px; letter-spacing: .24em; color: var(--gold); }
.mode h3 { font-size: 22px; margin-top: 8px; color: var(--ivory); }
html[data-theme="light"] .mode h3 { color: var(--text); }
.mode p { color: var(--muted); font-size: 13.5px; margin-top: 8px; line-height: 1.65; }
.mode .m-go { margin-top: 16px; font-size: 12.5px; color: var(--gold-2); display: inline-flex; gap: 6px; align-items: center; }
.mode .m-ic {
  position: absolute; right: 18px; top: 16px; font-size: 30px; opacity: .5;
  color: var(--gold-2);
}
@media (max-width: 720px) {
  .mode-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 26px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ── 실전 테이블 ────────────────────────── */
.table-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 18px; padding: 22px 0 10px; align-items: start; }
.table-main { min-width: 0; }
.table-side { display: grid; gap: 14px; min-width: 0; }
.table-side > .card { min-width: 0; }
@media (max-width: 980px) {
  .table-layout { grid-template-columns: minmax(0, 1fr); }
  .table-side { order: 2; }
}
.tbl-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  font-size: 12px; color: var(--muted); margin-bottom: 10px;
}
.tbl-meta b { color: var(--gold-2); font-variant-numeric: tabular-nums; }
.meta-sep { width: 1px; height: 12px; background: var(--line-soft); }
.balance-box { margin-left: auto; text-align: right; }
.balance-box .bl { font-size: 10px; letter-spacing: .18em; color: var(--muted-2); }
.balance-box .bv { font-size: 19px; color: var(--gold-2); font-variant-numeric: tabular-nums; }

.felt {
  position: relative; border-radius: 20px; overflow: hidden;
  border: 1px solid rgba(217, 184, 116, .4);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(38, 148, 112, .35), transparent 60%),
    radial-gradient(90% 80% at 50% 120%, rgba(0, 0, 0, .4), transparent 60%),
    linear-gradient(160deg, #0f5742, #093a2d 65%, #06291f);
  box-shadow: var(--shadow), inset 0 0 0 8px rgba(0,0,0,.12), inset 0 0 60px rgba(0,0,0,.28);
  padding: 18px 16px 16px;
}
.felt::before {
  content: ""; position: absolute; inset: 10px; border: 1px solid rgba(217,184,116,.22);
  border-radius: 14px; pointer-events: none;
}
.felt-top { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: #bcd3c9; letter-spacing: .08em; }
.shoe-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; border: 1px solid rgba(217,184,116,.3); color: var(--gold-2); }
.hand-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; min-height: 106px; }
.hand-row.banker { margin-top: 8px; }
.hand-label { width: 62px; flex: 0 0 62px; text-align: center; }
.hand-label .hl-name { font-size: 11.5px; letter-spacing: .14em; color: #cfe0d7; display: block; }
.hand-label .hl-total {
  display: inline-grid; place-items: center; min-width: 38px; height: 38px; margin-top: 6px;
  border-radius: 10px; border: 1px solid rgba(217,184,116,.34); background: rgba(0,0,0,.18);
  font-size: 20px; color: var(--gold-2); font-variant-numeric: tabular-nums;
}
.hand-row.banker .hl-total { color: #ff9f95; border-color: rgba(217, 75, 66, .45); }
.hand-row.player .hl-total { color: #9dc2ff; border-color: rgba(63, 127, 217, .5); }
.cards { display: flex; gap: 8px; flex: 1; min-height: 96px; align-items: center; justify-content: center; }
.vs-line { display: flex; align-items: center; gap: 10px; margin: 6px 0; color: #9db8ac; font-size: 10px; letter-spacing: .18em; }
.vs-line::before, .vs-line::after { content: ""; flex: 1; height: 1px; background: rgba(217,184,116,.16); }
.result-badge {
  position: absolute; right: 12px; top: 9px; transform: scale(.92);
  padding: 4px 13px; border-radius: 999px; font-size: 14.5px; font-weight: 900;
  letter-spacing: .02em; background: rgba(4, 24, 19, .92); border: 1px solid var(--gold);
  color: var(--gold-2); box-shadow: 0 8px 24px rgba(0,0,0,.45); opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s; z-index: 5; white-space: nowrap;
}
.result-badge.show { opacity: 1; transform: scale(1); }
.felt.result .felt-top > span:last-child { visibility: hidden; }
.felt-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 11px; color: #aac4b8; min-height: 18px; }
.felt-foot .fr { color: var(--gold-2); }

/* 카드 */
.card3d { width: 64px; height: 92px; perspective: 700px; flex: 0 0 auto; position: relative; }
.card3d .ci { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.card3d.down .ci { transform: rotateY(180deg); }
.face, .back { position: absolute; inset: 0; border-radius: 8px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.face {
  background: linear-gradient(155deg, #fffdf4, #efe6d0); color: #1b2320;
  border: 1px solid rgba(120, 100, 60, .3);
  box-shadow: 0 8px 18px rgba(0,0,0,.32), inset 0 0 0 1px rgba(255,255,255,.6);
  display: flex; flex-direction: column; justify-content: space-between; padding: 5px 6px;
  overflow: hidden;
}
.face.red { color: #b8281f; }
.face .corner { font-size: 13px; line-height: 1; font-weight: 900; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.face .corner .s { font-size: 11px; }
.face .corner.br { align-self: flex-end; transform: rotate(180deg); }
.face .pip-area { position: absolute; inset: 16px 12px; }
.face .pip { position: absolute; transform: translate(-50%, -50%); font-size: 13px; line-height: 1; }
.face .center-glyph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; opacity: .92; }
.face .court {
  position: absolute; inset: 20px 12px; display: grid; place-items: center;
  border: 1px solid currentColor; border-radius: 4px; opacity: .9;
  font-family: var(--font-display); font-size: 26px;
}
.back {
  transform: rotateY(180deg);
  background:
    repeating-linear-gradient(45deg, rgba(217,184,116,.14) 0 2px, transparent 2px 7px),
    radial-gradient(circle at 50% 50%, #0d4436, #062b22 70%);
  border: 1px solid rgba(217, 184, 116, .65);
  box-shadow: 0 8px 18px rgba(0,0,0,.32), inset 0 0 0 3px rgba(3, 25, 20, .9), inset 0 0 0 4px rgba(217,184,116,.28);
  display: grid; place-items: center; color: rgba(243, 223, 174, .8); font-size: 20px;
}
@media (max-width: 430px) { .card3d { width: 52px; height: 76px; } .cards { gap: 6px; } .hand-label { width: 50px; flex: 0 0 50px; } }

/* 베팅 */
.bet-panel { margin-top: 12px; }
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.chip {
  flex: 0 0 auto; min-width: 62px; height: 40px; padding: 0 12px; border-radius: 999px;
  border: 1px dashed rgba(217,184,116,.4); color: var(--gold-2); font-size: 13px;
  font-variant-numeric: tabular-nums; background: rgba(217,184,116,.06);
}
.chip.on { border-style: solid; background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #17231c; border-color: transparent; }
.bet-zones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.zone {
  position: relative; min-height: 62px; border-radius: 12px; border: 1px solid var(--line);
  padding: 9px 8px; text-align: center; background: rgba(255,255,255,.03);
  transition: border-color .15s, background .15s, transform .1s;
}
.zone:hover { border-color: rgba(217,184,116,.55); }
.zone:active { transform: scale(.985); }
.zone .z-name { font-size: 14px; color: var(--ivory); display: block; }
html[data-theme="light"] .zone .z-name { color: var(--text); }
.zone .z-odds { font-size: 10.5px; color: var(--muted-2); display: block; margin-top: 2px; }
.zone.sel { border-color: var(--gold); background: rgba(217,184,116,.14); box-shadow: 0 0 0 1px rgba(217,184,116,.35) inset; }
.zone.disabled { opacity: .45; pointer-events: none; }
.zone .z-bet {
  position: absolute; right: 6px; top: 6px; font-size: 10.5px; color: #14201a;
  background: var(--gold-2); border-radius: 999px; padding: 1px 7px; font-variant-numeric: tabular-nums;
  opacity: 0; transform: scale(.85); transition: .15s;
}
.zone .z-bet.on { opacity: 1; transform: none; }
.table-actions { display: grid; grid-template-columns: auto 1fr; gap: 8px; margin-top: 12px; }
.btn-deal {
  min-height: 54px; border-radius: 12px; font-size: 16px; font-weight: 900;
  background: linear-gradient(180deg, #f6e3b2, #d8b46a 55%, #c39e55); color: #14201a;
  box-shadow: 0 12px 26px rgba(217,184,116,.24);
}
.btn-deal:disabled { filter: grayscale(.6) brightness(.7); box-shadow: none; cursor: not-allowed; }
.btn-undo { min-height: 54px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.btn-undo:disabled { opacity: .4; }

/* 출목표 */
.roads { padding: 14px; }
.road-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.road-head h3 { font-size: 16px; }
.road-tabs { display: flex; gap: 4px; margin-top: 10px; overflow-x: auto; padding-bottom: 2px; }
.rtab { flex: 0 0 auto; padding: 5px 10px; border-radius: 8px; font-size: 11.5px; color: var(--muted); border: 1px solid transparent; }
.rtab.on { color: var(--gold-2); border-color: var(--line); background: rgba(217,184,116,.08); }
.road-body { margin-top: 10px; overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; }
.road-grid { display: grid; gap: 1px; width: max-content; }
.road-cell {
  position: relative; width: var(--cell, 22px); height: var(--cell, 22px);
  display: grid; place-items: center; font-size: calc(var(--cell, 22px) * .62);
}
.road-cell .dot { width: 76%; height: 76%; border-radius: 50%; display: grid; place-items: center; font-style: normal; }
.br-b { color: #ff9d93; }
.br-p { color: #94bdff; }
.road-cell.b { color: #ff9d93; }
.road-cell.p { color: #94bdff; }
.road-cell.b .dot { border: 1.5px solid currentColor; }
.road-cell.p .dot { border: 1.5px solid currentColor; }
.road-cell.t .dot { color: var(--green-tie); border: 1.5px solid currentColor; font-size: .8em; }
.bigroad .road-cell .dot { box-shadow: inset 0 0 0 .5px rgba(0,0,0,.15); }
.road-cell.tie-line::before {
  content: ""; position: absolute; left: 12%; right: 12%; top: 50%; height: 2px;
  background: #55c08a; border-radius: 2px; transform: rotate(-18deg);
}
.road-cell .tie-n { position: absolute; right: 1px; bottom: 0; font-size: 8px; color: #7ff0b7; }
.road-cell .pair-dot { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: var(--gold-2); }
.road-cell .nat-dot { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #f5d76e; }
.road-cell.last { animation: cellPulse 1.3s ease 2; }
@keyframes cellPulse { 0%,100% { filter: none; } 50% { filter: drop-shadow(0 0 6px rgba(243,223,174,.9)); } }
.derived .road-cell .dot.r { border: 1.5px solid #ff9d93; }
.derived .road-cell .dot.b { background: #6fa8ff; border: 1.5px solid #6fa8ff; }
.derived .road-cell .dot.rf { background: #ff8d84; border: 1.5px solid #ff8d84; }
.derived .road-cell .dot.slash::after { content: "/"; color: #ffd9a0; font-size: 1.2em; line-height: 1; }
.derived .road-cell .dot.slash-b::after { content: "/"; color: #8bb8ff; font-size: 1.2em; line-height: 1; }
.road-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; font-size: 10.5px; color: var(--muted-2); }
.road-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.road-empty { color: var(--muted-2); font-size: 12px; padding: 18px 4px; text-align: center; }

/* 코치 */
.coach { padding: 14px 16px; border-left: 2px solid var(--gold); overflow-wrap: anywhere; }
.coach-head { display: flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: .16em; color: var(--gold); }
.coach h3 { font-size: 16.5px; margin-top: 6px; line-height: 1.45; color: var(--ivory); }
html[data-theme="light"] .coach h3 { color: var(--text); }
.coach p { font-size: 12.8px; color: var(--muted); margin-top: 6px; line-height: 1.62; }
.coach .c-fact { margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: rgba(0,0,0,.18); font-size: 11.5px; color: var(--gold-2); border: 1px solid var(--line-soft); }
.coach.tone-bad { border-left-color: var(--bad); }
.coach.tone-warn { border-left-color: var(--warn); }
.coach.tone-ok { border-left-color: var(--ok); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-cell { padding: 10px; border-radius: 10px; background: rgba(0,0,0,.16); border: 1px solid var(--line-soft); min-width: 0; }
.stat-cell b { display: block; font-size: 16px; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.stat-cell span { font-size: 10.5px; color: var(--muted-2); }

/* 빠른 설정 */
.opt-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.opt-row:last-child { border-bottom: 0; }
.opt-row .ol { font-size: 12.5px; color: var(--muted); }
.switch { width: 44px; height: 26px; border-radius: 999px; background: rgba(255,255,255,.14); position: relative; transition: .2s; flex: 0 0 auto; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #f4f0e4; transition: .2s; }
.switch.on { background: var(--gold); }
.switch.on::after { left: 21px; background: #1b241f; }

/* ── 실험실 ─────────────────────────────── */
.lab-head { padding: 26px 0 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 11.5px; letter-spacing: .08em; color: var(--muted-2); }
.field select, .field input {
  height: 46px; border-radius: 10px; background: rgba(0,0,0,.22); color: var(--text);
  border: 1px solid var(--line-soft); padding: 0 12px; font-family: inherit; font-weight: 700; font-size: 14px;
}
html[data-theme="light"] .field select, html[data-theme="light"] .field input { background: #fffdf5; }
.field input:focus, .field select:focus { border-color: var(--gold); outline: none; }
.seg { display: flex; gap: 4px; background: rgba(0,0,0,.18); padding: 3px; border-radius: 10px; }
.seg button { flex: 1; min-height: 38px; border-radius: 8px; font-size: 12px; color: var(--muted); }
.seg button.on { background: rgba(217,184,116,.16); color: var(--gold-2); box-shadow: inset 0 0 0 1px var(--line); }
.lab-run { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; align-items: center; }
.lab-result { margin-top: 18px; display: none; }
.lab-result.on { display: block; }
.res-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.res-cell { padding: 14px; border-radius: 12px; border: 1px solid var(--line-soft); background: rgba(0,0,0,.16); }
.res-cell b { display: block; font-size: 21px; color: var(--gold-2); font-variant-numeric: tabular-nums; line-height: 1.25; }
.res-cell span { font-size: 11px; color: var(--muted-2); }
.res-cell.bad b { color: var(--bad); }
.res-cell.ok b { color: var(--ok); }
canvas#equity { width: 100%; height: 260px; display: block; margin-top: 14px; border-radius: 12px; border: 1px solid var(--line-soft); background: rgba(0,0,0,.18); }
.lab-note { margin-top: 12px; font-size: 12px; color: var(--muted); }
.cmp-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 12.5px; }
.cmp-table th, .cmp-table td { padding: 9px 8px; border-bottom: 1px solid var(--line-soft); text-align: right; font-variant-numeric: tabular-nums; }
.cmp-table th:first-child, .cmp-table td:first-child { text-align: left; }
.cmp-table th { color: var(--muted-2); font-size: 11px; letter-spacing: .04em; }
.cmp-table tr.win td { color: var(--ok); }
.cmp-table tr.lose td { color: var(--bad); }
@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .res-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── 퀴즈 ───────────────────────────────── */
.quiz-wrap { max-width: 760px; margin: 0 auto; padding: 26px 0 10px; }
.quiz-top { display: flex; align-items: center; gap: 10px; }
.qnav { width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); color: var(--ivory); font-size: 18px; display: grid; place-items: center; }
html[data-theme="light"] .qnav { color: var(--text); }
.qnav:disabled { opacity: .35; }
.q-progress { flex: 1; height: 5px; background: rgba(255,255,255,.12); border-radius: 999px; overflow: hidden; }
.q-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); width: 0; transition: width .3s; }
.q-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.q-card { margin-top: 16px; padding: 24px; border-radius: 18px; border: 1px solid var(--line); background: linear-gradient(165deg, rgba(255,255,255,.05), rgba(255,255,255,.012)); }
html[data-theme="light"] .q-card { background: #fffdf5; }
.q-cat { font-size: 10.5px; letter-spacing: .2em; color: var(--gold); }
.q-text { font-size: clamp(17px, 2.4vw, 22px); margin-top: 8px; line-height: 1.55; color: var(--ivory); font-family: var(--font-display); font-weight: 400; }
html[data-theme="light"] .q-text { color: var(--text); }
.q-opts { display: grid; gap: 8px; margin-top: 18px; }
.q-opt { text-align: left; padding: 13px 15px; border-radius: 11px; border: 1px solid var(--line-soft); font-size: 14px; color: var(--text); display: flex; gap: 10px; align-items: flex-start; }
.q-opt .n { color: var(--gold); font-size: 11px; padding-top: 3px; }
.q-opt:hover { border-color: var(--line); background: rgba(217,184,116,.05); }
.q-opt.chosen { border-color: var(--gold); background: rgba(217,184,116,.12); }
.q-opt.right { border-color: var(--ok); background: rgba(111,224,174,.12); }
.q-opt.wrong { border-color: var(--bad); background: rgba(255,143,128,.1); }
.q-exp { margin-top: 14px; padding: 13px 15px; border-radius: 11px; background: rgba(0,0,0,.2); border-left: 2px solid var(--gold); font-size: 13px; color: var(--muted); display: none; }
.q-exp.on { display: block; }
.q-exp b { color: var(--gold-2); }
.q-bottom { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.q-rank { text-align: center; padding: 16px 0; }
.q-rank .rk { font-family: var(--font-display); font-size: 40px; color: var(--gold-2); }
.q-rank .rs { font-size: 14px; color: var(--muted); margin-top: 4px; }
.score-ring { width: 132px; height: 132px; margin: 8px auto 0; position: relative; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring .sc { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.rank-list { display: grid; gap: 8px; margin-top: 20px; }
.rank-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-soft); font-size: 12.5px; color: var(--muted); }
.rank-item.on { border-color: var(--gold); color: var(--gold-2); background: rgba(217,184,116,.08); }
.rank-item .rn { font-family: var(--font-display); font-size: 15px; width: 92px; }
.rank-item .rr { margin-left: auto; font-variant-numeric: tabular-nums; }

/* ── 학습 노트 ──────────────────────────── */
.note-wrap { padding: 26px 0 10px; }
.note-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 18px; }
.note-card { padding: 20px; border-radius: 16px; border: 1px solid var(--line); background: linear-gradient(165deg, rgba(255,255,255,.045), rgba(255,255,255,.012)); }
html[data-theme="light"] .note-card { background: #fffdf5; }
.note-card h3 { font-size: 19px; color: var(--ivory); }
html[data-theme="light"] .note-card h3 { color: var(--text); }
.note-card p, .note-card li { font-size: 13px; color: var(--muted); }
.note-card ul { margin: 8px 0 0; padding-left: 18px; }
.note-card li { margin: 5px 0; }
.rule-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 12px; }
.rule-table th, .rule-table td { padding: 7px 8px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
.rule-table th { color: var(--gold-2); font-size: 11px; letter-spacing: .04em; }
.rule-table td:first-child { color: var(--ivory); white-space: nowrap; }
html[data-theme="light"] .rule-table td:first-child { color: var(--text); }
.fact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.fact { padding: 12px; border-radius: 10px; background: rgba(0,0,0,.16); border: 1px solid var(--line-soft); }
.fact b { display: block; font-size: 18px; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.fact span { font-size: 10.5px; color: var(--muted-2); }
@media (max-width: 860px) { .note-grid { grid-template-columns: 1fr; } }
@media (max-width: 430px) { .fact-grid { grid-template-columns: repeat(2, 1fr); } }

/* ── 스퀴즈 모달 ────────────────────────── */
#squeeze { position: fixed; inset: 0; z-index: 150; display: none; background: rgba(2, 16, 12, .92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
#squeeze.on { display: grid; place-items: center; }
.sq-box { width: min(94vw, 430px); text-align: center; padding: 18px; }
.sq-title { font-family: var(--font-display); font-size: 20px; color: var(--gold-2); }
.sq-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.sq-stage { position: relative; width: 100%; height: min(58vh, 430px); margin: 16px auto 0; display: grid; place-items: center; touch-action: none; user-select: none; -webkit-user-select: none; }
.sq-card { position: relative; width: min(62vw, 230px); aspect-ratio: 0.7; border-radius: 14px; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.55); transform: rotate(-2deg); perspective: 900px; }
.sq-face { position: absolute; inset: 0; }
.sq-face .face { position: absolute; inset: 0; border-radius: 14px; }
.face.lg .corner { font-size: 26px; }
.face.lg .corner .s { font-size: 22px; }
.face.lg .pip { font-size: 26px; }
.face.lg .center-glyph { font-size: 76px; }
.face.lg .court { font-size: 64px; inset: 34px 26px; }
.face.lg .pip-area { inset: 44px 34px; }
.sq-face { position: absolute; inset: 0; }
.sq-cover {
  position: absolute; inset: 0; border-radius: 14px; transform-origin: left center;
  background:
    repeating-linear-gradient(45deg, rgba(217,184,116,.16) 0 2px, transparent 2px 8px),
    radial-gradient(circle at 50% 50%, #12513f, #062b22 72%);
  border: 1px solid rgba(217,184,116,.75);
  box-shadow: inset 0 0 0 5px rgba(3,25,20,.85), inset 0 0 0 6px rgba(217,184,116,.3), 12px 0 24px rgba(0,0,0,.4);
  display: grid; place-items: center; color: rgba(243,223,174,.85); font-size: 40px;
  will-change: transform;
}
.sq-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 70%, rgba(0,0,0,.35)); }
.sq-hint { position: absolute; bottom: -6px; left: 0; right: 0; font-size: 12px; color: var(--muted); }
.sq-bar { height: 4px; border-radius: 999px; background: rgba(255,255,255,.14); margin: 22px auto 0; width: min(70%, 260px); overflow: hidden; }
.sq-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.sq-actions { display: flex; gap: 8px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.sq-skip { min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.sq-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }

/* ── 하단 버전 바 ───────────────────────── */
.vbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 95; height: var(--vbar-h);
  background: rgba(3, 22, 18, .94); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
html[data-theme="light"] .vbar { background: rgba(250, 246, 235, .96); }
.vbar-in { max-width: 640px; height: 100%; margin: 0 auto; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 12px; }
.vbtn { min-width: 92px; height: 40px; border-radius: 10px; font-size: 12.5px; color: var(--muted); border: 1px solid transparent; }
.vbtn.on { color: var(--gold-2); border-color: var(--line); background: rgba(217,184,116,.1); }
html[data-theme="light"] .vbtn.on { color: #6b4f16; }
.vbar-label { font-size: 10px; color: var(--muted-2); letter-spacing: .12em; margin-right: 4px; }
@media (max-width: 430px) { .vbar-label { display: none; } .vbtn { min-width: 0; flex: 1; } }

/* ── 푸터 ───────────────────────────────── */
footer { margin-top: 44px; border-top: 1px solid var(--line-soft); padding: 26px 0 30px; }
.ft-in { max-width: var(--w); margin: 0 auto; padding: 0 18px; display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; justify-content: space-between; }
.ft-note { font-size: 11.5px; color: var(--muted-2); max-width: 46em; line-height: 1.7; }
.ft-links { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.ft-links a:hover { color: var(--gold-2); }

/* ── 보기 모드 ──────────────────────────── */
html.force-mo body { max-width: 430px; margin: 0 auto; box-shadow: 0 0 0 1px var(--line-soft); }
html.force-mo .table-layout { grid-template-columns: 1fr; }
html.force-mo .table-side { order: 2; }
html.force-mo .mode-grid { grid-template-columns: 1fr; }
html.force-mo .hero-stats { grid-template-columns: repeat(2, 1fr); }
html.force-mo .hero-in { padding: 26px 22px; }
html.force-mo .note-grid { grid-template-columns: 1fr; }
html.force-mo .res-grid { grid-template-columns: repeat(2, 1fr); }
html.force-mo .fact-grid { grid-template-columns: repeat(2, 1fr); }
html.force-mo .hdr-in { flex-wrap: wrap; height: auto; padding: 8px 12px 0; gap: 8px; }
html.force-mo .tabs { order: 3; width: 100%; margin-left: 0; padding: 2px 0 8px; overflow-x: auto; }
html.force-mo .tab { padding: 7px 11px; font-size: 12.5px; }
html.force-mo .ft-in { flex-direction: column; }
html.force-mo .card3d { width: 52px; height: 76px; }
html.force-mo .cards { gap: 6px; }
html.force-mo .hand-label { width: 50px; flex: 0 0 50px; }
html.force-mo .vbar-label { display: none; }
html.force-mo .vbtn { min-width: 0; flex: 1; }
html.force-mo .form-grid { grid-template-columns: 1fr 1fr; }
html.force-mo .quiz-wrap, html.force-mo .note-wrap { max-width: 100%; }

html.force-pc body { min-width: 1180px; }
html.force-pc .table-layout { grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr); }
html.force-pc .table-side { order: 0; }
html.force-pc .mode-grid { grid-template-columns: repeat(2, 1fr); }
html.force-pc .hero-stats { grid-template-columns: repeat(4, 1fr); }
html.force-pc .note-grid { grid-template-columns: repeat(2, 1fr); }
html.force-pc .hdr-in { flex-wrap: nowrap; height: 58px; padding: 0 18px; }
html.force-pc .tabs { order: 0; width: auto; margin-left: auto; padding: 0; }
html.force-pc .hdr-burger { display: none; }
html.force-pc .res-grid { grid-template-columns: repeat(4, 1fr); }
html.force-pc .form-grid { grid-template-columns: 1fr 1fr; }
html.force-pc .ft-in { flex-direction: row; }
html.force-app body { max-width: 430px; margin: 0 auto; padding-bottom: calc(140px + env(safe-area-inset-bottom)); }
html.force-app .hdr { position: sticky; }
html.force-app .vbar { background: rgba(3, 22, 18, .98); }
html.force-app .table-layout { padding-top: 12px; }

/* ── 토스트 ─────────────────────────────── */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--vbar-h) + 18px); transform: translate(-50%, 12px);
  background: #f3dfae; color: #17221c; font-size: 12.5px; padding: 10px 18px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 160; box-shadow: 0 10px 30px rgba(0,0,0,.35);
  white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* 접근성: 모션 최소화 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ── 모바일 360 압축 ─────────────────────── */
@media (max-width: 430px) {
  .hdr-in { padding: 6px 12px 0; }
  .tab { padding: 5px 10px; font-size: 12px; }
  .tabs { padding-bottom: 6px; }
  .tbl-meta { font-size: 11.5px; margin-bottom: 6px; gap: 6px 10px; }
  .balance-box .bv { font-size: 17px; }
  .felt { padding: 12px 12px 10px; }
  .felt-top { font-size: 10px; }
  .hand-row { min-height: 96px; margin-top: 8px; }
  .hand-row.banker { margin-top: 6px; }
  .vs-line { margin: 2px 0; }
  .felt-foot { margin-top: 8px; font-size: 10.5px; }
  .bet-panel { margin-top: 10px; }
  .chip { min-width: 52px; height: 38px; padding: 0 9px; font-size: 12px; }
  .chip-row { gap: 6px; overflow: visible; }
  .bet-zones { margin-top: 8px; gap: 6px; }
  .zone { min-height: 58px; padding: 7px 6px; }
  .zone .z-name { font-size: 13px; }
  .zone .z-odds { font-size: 9.5px; }
  .table-actions { margin-top: 8px; }
  .btn-deal { min-height: 50px; font-size: 15px; }
  .btn-undo { min-height: 50px; }
  .result-badge { font-size: 18px; padding: 5px 14px; top: 52%; }
}
@media (min-width: 980px) {
  .card3d { width: 76px; height: 110px; }
  .cards { gap: 12px; }
  .hand-row { min-height: 124px; }
  .face .corner { font-size: 15px; }
  .face .corner .s { font-size: 13px; }
  .face .pip { font-size: 15px; }
  .face .pip-area { inset: 19px 14px; }
}

/* ── 카메라 판독 ─────────────────────────── */
.cam-head { padding: 24px 0 8px; }
.cam-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(270px, .82fr); gap: 16px; align-items: start; }
.cam-main { min-width: 0; }
.cam-side { display: grid; gap: 12px; }
@media (max-width: 980px) { .cam-layout { grid-template-columns: 1fr; } .cam-side { order: 2; } }

.cam-stage {
  position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--line); background:
    radial-gradient(120% 100% at 50% 0%, rgba(30, 120, 92, .35), transparent 60%),
    linear-gradient(160deg, #0d4436, #062b22);
  box-shadow: var(--shadow);
}
.cam-stage::after {
  content: ""; position: absolute; inset: 10px; border: 1px dashed rgba(217, 184, 116, .3);
  border-radius: 10px; pointer-events: none;
}
.cam-img { width: 100%; height: 100%; object-fit: cover; display: block; position: absolute; inset: 0; z-index: 2; }
.cam-empty {
  position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; gap: 6px; padding: 22px; color: var(--muted);
}
.cam-empty .ce-ic { font-size: 34px; color: var(--gold-2); opacity: .8; }
.cam-empty b { font-size: 15px; color: var(--ivory); }
html[data-theme="light"] .cam-empty b { color: var(--text); }
.cam-empty span { font-size: 11.5px; }
.cam-loading {
  position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 8px; background: rgba(3, 22, 18, .78); text-align: center; color: var(--muted);
}
.cam-loading b { color: var(--gold-2); font-size: 14px; }
.cam-loading span { font-size: 11.5px; }
.spin {
  width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(217, 184, 116, .25);
  border-top-color: var(--gold); animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.cam-retake {
  position: absolute; right: 10px; bottom: 10px; z-index: 4; padding: 8px 14px; border-radius: 999px;
  background: rgba(3, 22, 18, .88); border: 1px solid var(--line); color: var(--gold-2); font-size: 12px;
}
.cam-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.cam-shot { flex: 1; min-width: 190px; cursor: pointer; }
label.gold-btn, label.ghost-btn { cursor: pointer; }
.cam-drop { font-size: 11px; color: var(--muted-2); margin-top: 8px; text-align: center; }
.cam-status { font-size: 12.5px; color: var(--gold-2); margin-top: 8px; min-height: 19px; line-height: 1.5; }
.cam-status.err { color: var(--bad); }

.cam-panel {
  margin-top: 12px; border: 1px solid var(--line); border-radius: 14px; padding: 14px;
  background: linear-gradient(165deg, rgba(255,255,255,.045), rgba(255,255,255,.012));
}
html[data-theme="light"] .cam-panel { background: #fffdf5; }
.cp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cp-head h3 { font-size: 16px; }
.cp-head .tiny { font-weight: 700; }
.cam-seq { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; min-height: 40px; align-items: center; }
.cam-seq-empty { font-size: 12px; color: var(--muted-2); }
.seq-chip {
  min-width: 38px; height: 34px; padding: 0 8px; border-radius: 9px; border: 1px solid; font-size: 12.5px;
  display: grid; place-items: center; font-variant-numeric: tabular-nums;
}
.seq-chip.b { color: #ffb3aa; border-color: rgba(255, 157, 147, .55); background: rgba(217, 75, 66, .12); }
.seq-chip.p { color: #a8ccff; border-color: rgba(148, 189, 255, .55); background: rgba(63, 127, 217, .12); }
.seq-chip.t { color: #8ef0bf; border-color: rgba(85, 192, 138, .55); background: rgba(85, 192, 138, .1); }
.seq-chip:active { transform: scale(.94); }
.cam-edit { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.ce-label { font-size: 10.5px; letter-spacing: .06em; color: var(--muted-2); margin-right: 2px; }
.ce-btn { min-height: 36px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line-soft); font-size: 11.5px; color: var(--muted); }
.ce-btn.b { color: #ffb3aa; }
.ce-btn.p { color: #a8ccff; }
.ce-btn.t { color: #8ef0bf; }
.ce-btn:hover { border-color: var(--line); }
.cam-hint { font-size: 10.5px; color: var(--muted-2); margin-top: 8px; line-height: 1.65; }

.cam-panel.analysis { display: grid; gap: 10px; }
.an-block { padding: 12px; border-radius: 10px; background: rgba(0, 0, 0, .16); border-left: 2px solid var(--gold); }
.an-head { font-size: 10.5px; letter-spacing: .07em; color: var(--gold); }
.an-head .an-no { font-size: 12px; margin-right: 4px; }
.an-body { font-size: 13px; color: var(--text); margin-top: 5px; line-height: 1.7; }
.an-body b { color: var(--gold-2); }
.an-body .big { font-size: 15px; }
.cam-tips { margin: 8px 0 0; padding-left: 17px; font-size: 12px; color: var(--muted); line-height: 1.85; }
.cam-side .honest { border-left: 2px solid var(--warn); }
.cam-side .honest b { color: var(--warn); font-size: 13px; }
.cam-side .honest p { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.7; }

/* 하단 고정 확률 바 */
.prob-dock {
  position: fixed; left: 0; right: 0; bottom: var(--vbar-h); z-index: 88; display: none;
  background: rgba(3, 22, 18, .97); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); padding: 7px 12px calc(7px + env(safe-area-inset-bottom));
}
html[data-theme="light"] .prob-dock { background: rgba(250, 246, 235, .98); }
body.cam-open .prob-dock { display: block; }
body.cam-open { padding-bottom: calc(var(--vbar-h) + 128px + env(safe-area-inset-bottom)); }
html.force-app body.cam-open { padding-bottom: calc(var(--vbar-h) + 128px + env(safe-area-inset-bottom)); }
.pd-top { display: flex; justify-content: space-between; align-items: baseline; max-width: 660px; margin: 0 auto 5px; font-size: 10.5px; color: var(--muted-2); }
.pd-top b { color: var(--gold-2); font-size: 12.5px; }
.pd-cells { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-width: 660px; margin: 0 auto; }
.pd-cell {
  border: 1px solid var(--line-soft); border-radius: 10px; padding: 5px 3px; text-align: center;
  background: rgba(255, 255, 255, .03); min-width: 0;
}
.pd-cell .pdl { display: block; font-size: 10.5px; color: var(--muted-2); }
.pd-cell strong { display: block; font-size: 17px; color: var(--ivory); font-variant-numeric: tabular-nums; line-height: 1.2; }
.pd-cell .pds { display: block; font-size: 9.5px; color: var(--muted-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-cell.on { border-color: var(--gold); background: rgba(217, 184, 116, .16); box-shadow: inset 0 0 0 1px rgba(217, 184, 116, .25); }
.pd-cell.on strong { color: var(--gold-2); font-size: 20px; }
.pd-cell.on .pdl { color: var(--gold); }
.pd-note { font-size: 9.5px; color: var(--muted-2); text-align: center; margin: 5px auto 0; max-width: 660px; line-height: 1.35; }
@media (max-width: 360px) {
  .pd-cell strong { font-size: 15px; }
  .pd-cell.on strong { font-size: 18px; }
  .pd-cell .pds { font-size: 9px; }
}

.cam-warn {
  margin-top: 9px; padding: 8px 10px; border-radius: 8px; font-size: 11.5px; line-height: 1.55;
  color: #2a1c06; background: var(--warn); font-weight: 900;
}
#camSource.warn { color: var(--warn); }
