/* =========================================================
   부스폼 디자인 시스템 — 이 :root 값이 색/여백의 기준
   ========================================================= */
@import url("../vendor/pretendard/pretendard.css");

:root {
  --bg: #f6f6fb;
  --surface: #ffffff;
  --surface-2: #fafafd;
  --ink: #1b1f3b;
  --ink-2: #5b6180;
  --ink-3: #8a8fa8;
  --line: #e6e7f0;
  --line-2: #d6d8e6;
  --brand: #ff5a36;
  --brand-2: #ff3d5a;
  --brand-soft: #fff1ec;
  --gold: #ffc531;
  --gold-ink: #9a6b00;
  --mint: #14b8a6;
  --mint-soft: #e7f8f5;
  --danger: #e5484d;
  --danger-soft: #fdecec;
  --info: #3b82f6;
  --info-soft: #eaf2fe;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(27, 31, 59, 0.04), 0 6px 24px rgba(27, 31, 59, 0.06);
  --shadow-lg: 0 20px 60px rgba(27, 31, 59, 0.16);
  --font: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0 0 8px; line-height: 1.3; letter-spacing: -0.02em; }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 21px; font-weight: 800; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0 0 10px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); font-size: 13px; }
.small { font-size: 13px; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- 레이아웃 ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.wrap-sm { max-width: 720px; margin: 0 auto; padding: 0 20px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.top { align-items: flex-start; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 860px) {
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 24px; }
}
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; } .mt32 { margin-top: 32px; }
.mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; } .mb24 { margin-bottom: 24px; }

/* ---------- 상단바 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 16px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 850; font-size: 20px; color: var(--ink); letter-spacing: -0.03em; }
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; }
.brand b { color: var(--brand-2); font-weight: 850; }
.brand small { font-size: 12px; font-weight: 600; color: var(--ink-3); margin-left: 2px; letter-spacing: 0; }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { color: var(--ink-2); font-weight: 600; font-size: 14px; padding: 8px 12px; border-radius: 10px; }
.nav a:hover { background: var(--bg); text-decoration: none; color: var(--ink); }
.nav a.on { color: var(--ink); background: var(--bg); }
.topbar .spacer { flex: 1; }
@media (max-width: 760px) {
  .nav { display: none; }
  .nav.open { display: flex; flex-direction: column; position: absolute; top: 62px; left: 0; right: 0; background: #fff; padding: 10px 16px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .menu-btn { display: inline-flex !important; }
}
.menu-btn { display: none; }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; white-space: nowrap;
  transition: transform 0.06s ease, box-shadow 0.15s ease, background 0.15s ease;
  text-decoration: none !important; color: var(--ink); background: var(--surface);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 6px 18px rgba(255, 77, 74, 0.28); }
.btn-primary:hover { box-shadow: 0 8px 24px rgba(255, 77, 74, 0.36); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-line { border-color: var(--line-2); background: var(--surface); }
.btn-line:hover { border-color: var(--ink-3); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg); color: var(--ink); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-lg { height: 54px; padding: 0 26px; font-size: 17px; border-radius: 14px; }
.btn-block { width: 100%; }
.icon-btn { width: 34px; height: 34px; padding: 0; border-radius: 9px; }

/* ---------- 카드/박스 ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-h h3 { margin: 0; }
.notice { border-radius: 12px; padding: 12px 14px; font-size: 14px; background: var(--info-soft); color: #1e4f9c; }
.notice.warn { background: #fff6e0; color: #7a5500; }
.notice.danger { background: var(--danger-soft); color: #9b2226; }
.notice.ok { background: var(--mint-soft); color: #0d6b61; }
.stat { padding: 16px 18px; }
.stat .k { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.stat .v { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-top: 2px; }

/* ---------- 배지 ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--bg); color: var(--ink-2); white-space: nowrap; }
.badge.live { background: var(--mint-soft); color: #0d7a6e; }
.badge.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--mint); animation: pulse 1.6s infinite; }
.badge.draft { background: #f1f2f7; color: var(--ink-2); }
.badge.closed { background: #eceef5; color: var(--ink-3); }
.badge.paid { background: linear-gradient(135deg, #fff3cf, #ffe39a); color: var(--gold-ink); }
.badge.brand { background: var(--brand-soft); color: var(--brand-2); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: #1e4f9c; }
@keyframes pulse { 50% { opacity: 0.3; } }

/* ---------- 폼 ---------- */
label.f { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; }
label.f .req { color: var(--brand-2); margin-left: 2px; }
.input, select.input, textarea.input {
  width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 12px;
  font: inherit; color: var(--ink); background: var(--surface); outline: none; transition: border 0.15s, box-shadow 0.15s;
}
textarea.input { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(255, 90, 54, 0.12); }
.input.sm { height: 36px; border-radius: 9px; font-size: 14px; }
.help { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.field { margin-bottom: 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 14.5px; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.seg { display: inline-flex; background: var(--bg); padding: 4px; border-radius: 12px; gap: 4px; }
.seg button { border: 0; background: transparent; height: 36px; padding: 0 14px; border-radius: 9px; font: inherit; font-weight: 700; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line-2); border-radius: 99px; transition: 0.2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(18px); }

/* ---------- 표 ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-weight: 700; color: var(--ink-2); background: var(--surface-2); font-size: 13px; }
table.t th, table.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
table.t td.wrap { white-space: normal; min-width: 160px; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover td { background: #fcfcfe; }

/* ---------- 탭 ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 12px 16px; font: inherit; font-weight: 700; color: var(--ink-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-color: var(--brand); }

/* ---------- 모달/토스트 ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 18, 40, 0.48); z-index: 100; display: grid; place-items: center; padding: 16px; animation: fade 0.15s; }
.modal { background: #fff; border-radius: 18px; width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 24px; box-shadow: var(--shadow-lg); animation: pop 0.18s ease; }
.modal.wide { width: min(880px, 100%); }
.modal h3 { margin-bottom: 12px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(0.96); opacity: 0; } }
.toast-box { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); animation: pop 0.2s; max-width: 90vw; }
.toast.err { background: var(--danger); }
.toast.ok { background: #0f8f80; }

/* ---------- 기타 ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--ink-2); }
.empty .big { font-size: 44px; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; min-height: 40vh; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; font-weight: 600; }
.pill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.footer { padding: 40px 0 60px; color: var(--ink-3); font-size: 13px; border-top: 1px solid var(--line); margin-top: 60px; }
.footer a { color: var(--ink-2); }

/* ---------- 게임 공통 ---------- */
.game-stage { text-align: center; user-select: none; -webkit-user-select: none; }
.game-stage canvas { border-radius: 20px; }
.game-cta { margin-top: 16px; min-width: 220px; }
.game-hint { margin: 12px 0 0; font-weight: 700; color: var(--ink-2); }
.game-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 12px; margin-top: 12px; font-size: 12.5px; color: var(--ink-2); }
.game-legend span { display: inline-flex; align-items: center; gap: 6px; }
.game-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
/* 사업자 정보 (전자상거래법 표시) */
.biz { font-size: 13px; color: var(--ink-3, #8a90a6); border-top: 1px solid var(--line); margin-top: 32px; padding-top: 16px; line-height: 1.7; word-break: keep-all; }
.biz a { color: inherit; text-decoration: underline; }
.footer .row .biz-line a { margin-left: 0; text-decoration: underline; }
