:root {
  --bg: #0f1419;
  --panel: #171d25;
  --line: #2a3340;
  --text: #e6edf3;
  --muted: #8b98a8;
  --primary: #3b82f6;
  --fold: #4b5563;
  --check: #22c55e;
  --call: #16a34a;
  --bet1: #f59e0b;
  --bet2: #f97316;
  --bet3: #ef4444;
  --allin: #991b1b;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans KR", sans-serif; }
header { display: flex; align-items: baseline; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
h1 { font-size: 18px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 10px; }
h3 { font-size: 14px; margin: 8px 0 6px; }
.muted { color: var(--muted); font-size: 13px; }
.hidden { display: none !important; }
.layout { display: grid; grid-template-columns: minmax(320px, 520px) 1fr; gap: 16px; padding: 16px; }
@media (max-width: 960px) { .layout { grid-template-columns: 1fr; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; min-width: 0; }
.row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin: 6px 0; }
label { display: inline-flex; align-items: center; gap: 6px; }
input, textarea { background: #0b0f14; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 5px 7px; font: inherit; }
input[type=number] { width: 80px; }
textarea { width: 100%; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.btn { background: #222b36; color: var(--text); border: 1px solid var(--line); border-radius: 7px; padding: 7px 12px; cursor: pointer; font: inherit; }
.btn:hover { background: #2a3542; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.small { padding: 4px 9px; font-size: 13px; }

.ranges { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
@media (max-width: 1300px) { .ranges { grid-template-columns: 1fr; } }
.rangeBox { min-width: 0; }

/* 13×13 그리드 */
.grid169 { display: grid; grid-template-columns: repeat(13, 1fr); gap: 2px; user-select: none; margin-top: 6px; }
.grid169 .cell { position: relative; aspect-ratio: 1; border-radius: 3px; background: #0b0f14; border: 1px solid #1f2731; font-size: 10px; display: flex; align-items: center; justify-content: center; color: #c9d4df; overflow: hidden; cursor: pointer; }
.grid169 .cell.pair { border-color: #334155; }
.grid169 .cell .fill { position: absolute; inset: 0; background: var(--primary); opacity: .75; transform-origin: bottom; }
.grid169 .cell .lbl { position: relative; z-index: 1; text-shadow: 0 0 2px #000; }
.grid169.strat .cell { cursor: pointer; }
.grid169.strat .cell .bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column-reverse; height: 100%; }
.grid169.strat .cell .seg { width: 100%; }
.grid169 .cell.sel { outline: 2px solid #fff; outline-offset: -1px; }
.grid169 .cell.dim { opacity: .25; }

.cardPicker { display: grid; grid-template-columns: repeat(13, 1fr); gap: 3px; margin: 6px 0; max-width: 560px; }
.cardPicker .card { padding: 4px 0; text-align: center; border-radius: 4px; background: #0b0f14; border: 1px solid var(--line); cursor: pointer; font-size: 12px; }
.cardPicker .card.used { opacity: .25; cursor: default; }
.cardPicker .card.on { background: var(--primary); color: #fff; }
.cardPicker .s0, .cardPicker .s3 { color: #e6edf3; }
.cardPicker .s1 { color: #60a5fa; }
.cardPicker .s2 { color: #f87171; }
.card.on.s1, .card.on.s2 { color: #fff; }

.path { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.path .crumb { background: #222b36; border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; cursor: pointer; font-size: 13px; }
.path .crumb.cur { background: var(--primary); border-color: var(--primary); color: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.actions .act { border-radius: 8px; padding: 6px 10px; border: 1px solid var(--line); cursor: pointer; background: #1b232d; min-width: 110px; }
.actions .act:hover { background: #243041; }
.actions .act .nm { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.actions .act .sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.actions .act .ev { font-size: 12px; color: var(--muted); }
table.detail { border-collapse: collapse; width: 100%; margin-top: 8px; font-size: 12px; }
table.detail th, table.detail td { border-bottom: 1px solid var(--line); padding: 3px 6px; text-align: right; }
table.detail th:first-child, table.detail td:first-child { text-align: left; }
.lockBox { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 8px; }
.lockBox input[type=number] { width: 64px; }
.badge { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 10px; background: #7c2d12; color: #fed7aa; margin-left: 6px; }
#preview { margin: 8px 0; }
.warn { color: #fbbf24; }
.err { color: #f87171; }
