/* 차크기(car.famousbros.com) — 사이트 값만. 부품 모양은 fb.css.
   대비(WCAG, 실측 2026-11-03):
   라이트  ink #16202a / #fff 16.5:1 · muted #4a5662 / #fff 7.5:1, / bg #f4f6f8 6.9:1 · accent #0b6b5d / 흰 글자 6.4:1
           차 A #b45309 / #fff 5.0:1 · 차 B #1d4ed8 / #fff 6.7:1
   다크    ink #e8eef3 / #141b21 14.9:1 · muted #a9b6c2 / #141b21 8.4:1 · accent #4fd1b5 / 글자 #0d1a17 9.5:1
           차 A #f59e0b / #141b21 8.1:1 · 차 B #60a5fa / #141b21 6.8:1
   차 A·B 색은 데이터 색이다(어느 차인지) — 강조색(accent)과 따로 둔다. 빨강은 쓰지 않는다(오류 전용). */
:root {
  --fb-bg: #f4f6f8;
  --fb-surface: #ffffff;
  --fb-ink: #16202a;
  --fb-muted: #4a5662;
  --fb-line: #dde3e8;
  --fb-accent: #0b6b5d;
  --fb-on-accent: #ffffff;
  --fb-display: "IBM Plex Sans KR", system-ui, sans-serif;
  --fb-display-weight: 700;
  --car-a: #b45309;
  --car-b: #1d4ed8;
  --person: #6b7785;
  --wheel: #2a323b;
  --grid: #e3e8ec;
  --warn: #8a5a00;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fb-bg: #0e1418;
    --fb-surface: #141b21;
    --fb-ink: #e8eef3;
    --fb-muted: #a9b6c2;
    --fb-line: #26313a;
    --fb-accent: #4fd1b5;
    --fb-on-accent: #0d1a17;
    --car-a: #f59e0b;
    --car-b: #60a5fa;
    --person: #93a1ae;
    --wheel: #05080a;
    --grid: #202a32;
    --warn: #f2c14e;
  }
}

body { margin: 0; background: var(--fb-bg); color: var(--fb-ink);
  font: 16px/1.6 system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif; }
img { max-width: 100%; height: auto; }
a { color: inherit; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--fb-accent); outline-offset: 2px; }
.wrap { max-width: var(--fb-max); margin: 0 auto; padding: 0 16px; }
.page { padding-top: 24px; padding-bottom: 44px; }
h1, h2, h3 { font-family: var(--fb-display); line-height: 1.3; }
h1 { font-size: clamp(26px, 5vw, 36px); margin: 8px 0 8px; }
h2 { font-size: 22px; margin: 40px 0 8px; }
h3 { font-size: 18px; margin: 24px 0 8px; }
p { margin: 0 0 12px; }
.lead { color: var(--fb-muted); margin-bottom: 24px; }
.muted { color: var(--fb-muted); }
.num { font-variant-numeric: tabular-nums; }
.mark b { color: var(--fb-accent); }
.note { font-size: 14px; color: var(--fb-muted); }
.warn { color: var(--warn); }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.dot--a { background: var(--car-a); } .dot--b { background: var(--car-b); }

/* 폼 */
.form { display: grid; gap: 12px; }
.form--row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; }
label.f { display: grid; gap: 4px; font-size: 14px; color: var(--fb-muted); }
input, select { min-height: 44px; box-sizing: border-box; padding: 8px 12px; border: 1px solid var(--fb-line);
  border-radius: var(--fb-r-s); background: var(--fb-surface); color: var(--fb-ink); font: inherit; width: 100%; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.checks legend { font-size: 14px; color: var(--fb-muted); margin-bottom: 4px; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px;
  border: 1px solid var(--fb-line); border-radius: 999px; background: var(--fb-surface); cursor: pointer; }
.check input { width: 18px; min-height: 18px; margin: 0; }
.panel { background: var(--fb-surface); border: 1px solid var(--fb-line); border-radius: var(--fb-r-m); padding: 16px; }
.panel + .panel { margin-top: 16px; }

/* 두 차 고르기 */
.slots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.slot { position: relative; display: grid; gap: 4px; padding: 16px; border-radius: var(--fb-r-m);
  background: var(--fb-surface); border: 2px solid var(--fb-line); text-decoration: none; min-height: 44px; }
.slot--a { border-color: var(--car-a); } .slot--b { border-color: var(--car-b); }
.slot__k { font-size: 14px; color: var(--fb-muted); }
.slot__n { font-weight: 700; }
@media (max-width: 560px) { .slots { grid-template-columns: 1fr; } }

/* 탭(상태는 주소에) */
.tabs { display: flex; gap: 8px; margin: 24px 0 12px; flex-wrap: wrap; }
.tabs a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--fb-line); text-decoration: none; background: var(--fb-surface); }
.tabs a[aria-current="page"] { border-color: var(--fb-ink); font-weight: 700; }

/* 그림 */
.stage { background: var(--fb-surface); border: 1px solid var(--fb-line); border-radius: var(--fb-r-m); overflow: hidden; }
.stage canvas { display: block; width: 100%; height: min(62vh, 520px, 110vw); touch-action: none; }
.stage__bar { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; border-top: 1px solid var(--fb-line); }
.stage__bar button { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--fb-line);
  background: var(--fb-bg); color: var(--fb-ink); font: inherit; cursor: pointer; }
.stage__bar button[aria-pressed="true"] { border-color: var(--fb-ink); font-weight: 700; }
.stage noscript, .stage__fallback { display: block; padding: 16px; }
.draws { display: grid; gap: 16px; grid-template-columns: 2fr 1fr; margin-top: 16px; }
.draws--3 { grid-template-columns: 2fr 1fr 1fr; }
.draws figure { margin: 0; background: var(--fb-surface); border: 1px solid var(--fb-line); border-radius: var(--fb-r-m); padding: 12px; }
.draws figcaption { font-size: 14px; color: var(--fb-muted); margin-top: 8px; }
@media (max-width: 720px) { .draws, .draws--3 { grid-template-columns: 1fr; } }
svg.draw { width: 100%; height: auto; display: block; }
.draw .car { fill-opacity: .22; stroke-width: 18; }
.draw .car--a { fill: var(--car-a); stroke: var(--car-a); }
.draw .car--b { fill: var(--car-b); stroke: var(--car-b); fill-opacity: .14; stroke-dasharray: 60 30; }
.draw .car--ghost { fill-opacity: .08; }
.draw .wheel { fill: var(--wheel); }
.draw .person { fill: var(--person); }
.draw .person-limb { stroke: var(--person); stroke-linecap: round; }
.draw .grid { stroke: var(--grid); stroke-width: 8; }
.draw .ground { stroke: var(--fb-muted); stroke-width: 14; }
.draw .grid-t, .draw .row-t { fill: var(--fb-muted); font-size: 110px; }
.draw .roof { stroke: var(--fb-ink); stroke-width: 14; stroke-dasharray: 40 24; }

/* 표 */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; background: var(--fb-surface);
  border-radius: var(--fb-r-s); overflow: hidden; }
.tbl th, .tbl td { text-align: right; padding: 10px 12px; border-bottom: 1px solid var(--fb-line); height: 44px; box-sizing: border-box; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl thead th { font-size: 14px; color: var(--fb-muted); font-weight: 600; }
.tbl .est { font-size: 13px; color: var(--fb-muted); }
.tbl td { white-space: nowrap; }
@media (max-width: 560px) { .tbl th, .tbl td { padding: 8px; font-size: 14px; } }
.fit { display: inline-block; font-size: 13px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--fb-line); white-space: nowrap; }
.fit--닿거나 { border-color: var(--warn); color: var(--warn); }

/* 목록 줄 — 줄 전체 링크 */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.list li { position: relative; display: grid; grid-template-columns: 88px 1fr auto; gap: 12px; align-items: center;
  padding: 12px; background: var(--fb-surface); border: 1px solid var(--fb-line); border-radius: var(--fb-r-s); min-height: 44px; }
.list .t { font-weight: 700; text-decoration: none; }
.list .t::after { content: ""; position: absolute; inset: 0; }
.list .pick { position: relative; z-index: 1; min-height: 44px; display: inline-flex; align-items: center; }
.list img, .list .ph { width: 88px; height: 58px; object-fit: cover; border-radius: 8px; background: var(--fb-bg); }
.list .m { font-size: 14px; color: var(--fb-muted); }
@media (max-width: 560px) { .list li { grid-template-columns: 64px 1fr; } .list img, .list .ph { width: 64px; height: 44px; }
  .list .pick { grid-column: 1 / -1; justify-content: center; } }
.pager { display: flex; justify-content: center; gap: 12px; margin: 24px 0; }
.pager a, .pager span { min-height: 44px; display: inline-flex; align-items: center; padding: 0 12px; }
.empty { padding: 24px; text-align: center; color: var(--fb-muted); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 16px 0; }
.facts div { background: var(--fb-surface); border: 1px solid var(--fb-line); border-radius: var(--fb-r-s); padding: 12px; }
.facts dt { font-size: 13px; color: var(--fb-muted); }
.facts dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.photo { margin: 0; }
.photo img { border-radius: var(--fb-r-m); }
.photo figcaption { font-size: 13px; color: var(--fb-muted); }
.hero-draw { background: var(--fb-surface); border-radius: var(--fb-r-l); padding: 12px; border: 1px solid var(--fb-line); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
