/* EvalTycoon — 담백한 타이쿤 스타일 */
:root {
  --bg: #16181d;
  --panel: #1f2229;
  --panel-2: #262a33;
  --line: #363b47;
  --text: #e8e6e1;
  --muted: #9aa0ab;
  --accent: #f5a623;      /* 앰버 — 타이쿤 계기판 */
  --ok: #4cc38a;
  --bad: #e5534b;
  --info: #58a6ff;
  --radius: 10px;
  font-size: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--text); font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif; line-height: 1.6; }
button { font: inherit; cursor: pointer; border: none; border-radius: 8px; }

.wrap { max-width: 980px; margin: 0 auto; padding: 16px 16px 80px; }

/* ── 헤더 ── */
header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 0 16px; flex-wrap: wrap; }
header h1 { font-size: 1.4rem; letter-spacing: .5px; }
header h1 .amber { color: var(--accent); }
header .sub { color: var(--muted); font-size: .85rem; }

/* ── 스테이션 맵 ── */
.station-map { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 18px; }
.station-node { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 6px; text-align: center; cursor: pointer; transition: transform .12s, border-color .12s; position: relative; }
.station-node:hover:not(.locked) { transform: translateY(-2px); border-color: var(--accent); }
.station-node .num { font-size: .7rem; color: var(--muted); }
.station-node .name { font-size: .78rem; font-weight: 600; }
.station-node.locked { opacity: .38; cursor: not-allowed; }
.station-node.locked .name::before { content: "🔒 "; font-size: .7rem; }
.station-node.done { border-color: var(--ok); }
.station-node.done::after { content: "✓"; position: absolute; top: 4px; right: 6px; color: var(--ok); font-size: .75rem; }
.station-node.active { border-color: var(--accent); background: var(--panel-2); }

/* ── 컨베이어 ── */
.conveyor { background: repeating-linear-gradient(90deg, var(--panel-2) 0 26px, var(--panel) 26px 52px); border: 1px solid var(--line); border-radius: var(--radius); height: 92px; overflow: hidden; position: relative; margin-bottom: 14px; }
.belt-card { position: absolute; top: 14px; width: 150px; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; padding: 6px 9px; font-size: .7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: belt-move var(--belt-dur, 14s) linear infinite; }
.belt-card b { color: var(--text); display: block; font-size: .72rem; }
@keyframes belt-move { from { left: 100%; } to { left: -160px; } }
.paused .belt-card { animation-play-state: paused; }

/* ── 컨트롤 ── */
.controls { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.controls button { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); padding: 6px 14px; font-size: .85rem; }
.controls button:hover { border-color: var(--accent); }
.controls .hint { color: var(--muted); font-size: .78rem; }

/* ── 스테이션 본문 ── */
.stage { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.stage h2 { font-size: 1.15rem; margin-bottom: 4px; }
.stage h2 .tag { font-size: .7rem; color: var(--accent); border: 1px solid var(--accent); border-radius: 99px; padding: 1px 9px; vertical-align: 2px; margin-left: 8px; }
.stage .concept { color: var(--muted); font-size: .85rem; margin-bottom: 16px; }
.stage h3 { font-size: .95rem; margin: 18px 0 8px; color: var(--accent); }
.stage p { font-size: .9rem; margin-bottom: 10px; }
.narr { background: var(--panel-2); border-left: 3px solid var(--info); border-radius: 6px; padding: 10px 14px; font-size: .88rem; margin-bottom: 14px; }
.narr.warn { border-left-color: var(--bad); }
.narr.good { border-left-color: var(--ok); }

/* 카드/보기 버튼 */
.choice-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.choice { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; text-align: left; color: var(--text); font-size: .88rem; transition: border-color .1s; }
.choice:hover:not(:disabled) { border-color: var(--accent); }
.choice.correct { border-color: var(--ok); background: rgba(76,195,138,.08); }
.choice.wrong { border-color: var(--bad); background: rgba(229,83,75,.08); }
.choice:disabled { cursor: default; }
.explain { font-size: .8rem; color: var(--muted); padding: 6px 2px 0; }

/* 트레이스 카드 */
.trace-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 10px 0; }
.trace-card .tid { color: var(--muted); font-size: .72rem; }
.trace-card .q { font-size: .9rem; margin: 4px 0; }
.trace-card .q::before { content: "고객 "; color: var(--info); font-size: .75rem; }
.trace-card .step { font-size: .78rem; color: var(--muted); padding: 3px 0 3px 14px; border-left: 2px dashed var(--line); margin: 4px 0 4px 4px; }
.trace-card .a { font-size: .9rem; margin: 6px 0; padding: 8px 12px; background: var(--panel); border-radius: 8px; }
.trace-card .a::before { content: "봇 "; color: var(--accent); font-size: .75rem; }
.verdict-btns { display: flex; gap: 8px; margin-top: 10px; }
.verdict-btns button { flex: 1; padding: 8px; font-weight: 700; }
.btn-pass { background: rgba(76,195,138,.15); color: var(--ok); border: 1px solid var(--ok); }
.btn-fail { background: rgba(229,83,75,.15); color: var(--bad); border: 1px solid var(--bad); }
.btn-pass.sel { background: var(--ok); color: #08130d; }
.btn-fail.sel { background: var(--bad); color: #160705; }

/* 정책 시트 */
.policy-sheet { background: #201d15; border: 1px solid #4a4025; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 14px; font-size: .82rem; }
.policy-sheet h4 { color: var(--accent); font-size: .82rem; margin-bottom: 6px; }
.policy-sheet li { list-style: none; padding: 2px 0; color: #d8d2c2; }
.policy-sheet li b { color: var(--accent); font-weight: 600; margin-right: 6px; }

/* 실패 카탈로그 표 */
table.catalog { width: 100%; border-collapse: collapse; font-size: .85rem; margin: 10px 0; }
table.catalog th, table.catalog td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; }
table.catalog th { background: var(--panel-2); color: var(--muted); font-weight: 600; }
table.catalog td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.catalog tr.total td { border-top: 2px solid var(--accent); font-weight: 700; }

/* 묶기(축코딩) 버킷 */
.buckets { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }
.bucket { background: var(--panel-2); border: 1px dashed var(--line); border-radius: var(--radius); padding: 10px; min-height: 90px; }
.bucket.over { border-color: var(--accent); background: #27231a; }
.bucket h4 { font-size: .8rem; color: var(--accent); margin-bottom: 6px; }
.memo-chip { display: inline-block; background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; font-size: .74rem; margin: 2px; cursor: grab; }
.memo-chip.placed { border-color: var(--ok); }

/* 분류대 (코드 vs 심판) */
.routing-belts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.routing-belt { border: 1px dashed var(--line); border-radius: var(--radius); padding: 12px; min-height: 70px; text-align: center; }
.routing-belt h4 { font-size: .85rem; margin-bottom: 4px; }
.routing-belt .desc { font-size: .72rem; color: var(--muted); }

/* 조립대 블록 */
.judge-slots { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.judge-slot { border: 1px dashed var(--line); border-radius: 8px; padding: 10px 14px; font-size: .85rem; }
.judge-slot .slot-name { color: var(--accent); font-size: .72rem; display: block; }
.judge-slot.filled { border-style: solid; border-color: var(--ok); }
.judge-slot.bad { border-style: solid; border-color: var(--bad); }
.block-pool { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.block-pool .choice { flex: 1 1 45%; }

/* 게이지/계기판 */
.gauges { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.gauge { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.gauge .label { font-size: .78rem; color: var(--muted); display: flex; justify-content: space-between; }
.gauge .label b { color: var(--text); font-variant-numeric: tabular-nums; }
.gauge .bar { height: 10px; background: var(--panel); border-radius: 99px; margin-top: 6px; overflow: hidden; }
.gauge .bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s; }
.gauge.g-ok .bar i { background: var(--ok); }

/* θ 콘솔 */
.theta-console { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; }
.slider-row { display: grid; grid-template-columns: 130px 1fr 74px; gap: 10px; align-items: center; font-size: .82rem; padding: 6px 0; }
.slider-row label { color: var(--muted); }
.slider-row output { text-align: right; font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 700; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.theta-viz { margin: 14px 0 4px; }
.theta-viz .bar-row { display: grid; grid-template-columns: 92px 1fr 66px; gap: 10px; align-items: center; font-size: .8rem; padding: 5px 0; }
.theta-viz .track { height: 20px; background: var(--panel); border-radius: 6px; position: relative; overflow: hidden; }
.theta-viz .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; transition: width .35s; }
.fill.obs { background: repeating-linear-gradient(45deg, var(--bad) 0 8px, #a03d38 8px 16px); }
.fill.theta { background: var(--bad); }
.fill.ci { background: rgba(88,166,255,.30); border: 1px solid rgba(88,166,255,.6); transition: left .35s, width .35s; }
.theta-warn { color: var(--bad); font-size: .8rem; padding-top: 6px; display: none; }
.theta-warn.show { display: block; }

/* 진행/완료 */
.progress-line { font-size: .8rem; color: var(--muted); margin: 8px 0; }
.clear-btn { background: var(--accent); color: #1b1405; font-weight: 700; padding: 10px 22px; margin-top: 14px; }
.clear-btn:disabled { opacity: .35; cursor: not-allowed; }
.score { font-size: .9rem; color: var(--accent); font-weight: 700; }

/* CI 파이프라인 */
.pipeline { display: flex; align-items: center; gap: 6px; margin: 12px 0; flex-wrap: wrap; font-size: .8rem; }
.pipe-node { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.pipe-node.gate { border-color: var(--accent); }
.pipe-node.red { border-color: var(--bad); background: rgba(229,83,75,.1); }
.pipe-node.green { border-color: var(--ok); background: rgba(76,195,138,.08); }
.pipe-arrow { color: var(--muted); }

/* 엔딩 대시보드 */
.ending-dash { text-align: center; padding: 24px 0; }
.ending-dash .big { font-size: 2.2rem; font-weight: 800; color: var(--ok); }
.ending-dash .from { color: var(--bad); text-decoration: line-through; font-size: 1.2rem; margin-right: 10px; }

/* ── 반응형 (블로그 요구: 대·소화면) ── */
@media (max-width: 640px) {
  :root { font-size: 15px; }
  .station-map { grid-template-columns: repeat(4, 1fr); }
  .routing-belts, .gauges { grid-template-columns: 1fr; }
  .slider-row { grid-template-columns: 100px 1fr 60px; }
  .conveyor { height: 78px; }
  .stage { padding: 16px; }
}
