/* =========================================================
   보드게임 라운지 — 다크 메탈릭 디자인 시스템
   (디자인 컨셉: 좌 2 / 우 8 레이아웃, 브러시드 메탈 패널, 크롬 텍스트·버튼)
   색·질감 토큰은 :root 에 모여 있습니다. 게임 CSS 도 이 토큰을 사용합니다.
   ========================================================= */
:root {
  color-scheme: dark;

  /* 바탕 */
  --bg: #07080a;
  --bg-glow: #1a1f26;
  --well: #0e1013;        /* 패널 안 오목한 칸 */
  --field: #0b0d10;       /* 입력창 */
  --raised: #121519;      /* 칩/보조 버튼 */

  /* 선 */
  --line: #2b3038;
  --line-soft: #262b32;
  --line-strong: #3a414b;
  --line-hover: #4b535f;

  /* 글자 */
  --text: #e6e9ee;
  --text-strong: #f1f4f7;
  --text-2: #c9d0d8;
  --muted: #98a2ae;
  --placeholder: #7c8591;

  /* 금속 */
  --surface-metal:
    repeating-linear-gradient(90deg, rgba(255,255,255,.018) 0 1px, transparent 1px 3px),
    linear-gradient(160deg, #1d2127 0%, #13161a 55%, #191c21 100%);
  --shadow-metal: inset 0 1px 0 rgba(255,255,255,.08), inset 0 -1px 0 rgba(0,0,0,.6), 0 14px 34px rgba(0,0,0,.5);
  --chrome-text: linear-gradient(180deg, #f6f8fa 0%, #b9c1ca 46%, #eef1f4 54%, #8e97a2 100%);
  --chrome-btn: linear-gradient(180deg, #f1f4f7, #aab2bc 50%, #c6cdd5 51%, #8f98a2);
  --chrome-hi: #f1f4f7;
  --chrome-mid: #b9c1ca;
  --chrome-lo: #6c7580;
  --steel-btn: linear-gradient(180deg, #2a3038, #171a1f);

  /* 상태 */
  --win: #7fd0b4;
  --lose: #4da3ff;
  --lose-hi: #bfe0ff;
  --lose-lo: #2a6fc0;
  --lose-line: #2a5a9a;
  --danger: #e59a8c;     /* 오류·경고 (패배색과 구분) */
  --draw: #e8c26a;
  --accent: #b9c1ca;      /* 게임별 강조색 (manifest.color) 으로 덮어씀 */

  --radius-lg: 18px;
  --radius: 16px;
  --radius-sm: 10px;

  --font: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', system-ui, sans-serif;
  --font-num: 'Rajdhani', 'Noto Sans KR', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: radial-gradient(1200px 600px at 70% -10%, var(--bg-glow) 0%, var(--bg) 60%) fixed, var(--bg);
}
a { color: var(--text-2); }
a:hover { color: #fff; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--chrome-mid); outline-offset: 2px; }
input::placeholder { color: var(--placeholder); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-family: var(--font-num); font-weight: 700; }

/* ---------- 재질 ---------- */
.metal, .metal-panel {
  background: var(--surface-metal);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-metal);
  border-radius: var(--radius-lg);
}
.chrome, .metal-text {
  background: var(--chrome-text);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.eyebrow {
  font-family: var(--font-num); font-weight: 600; font-size: 13px;
  letter-spacing: .16em; color: var(--muted); text-transform: uppercase;
}
.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--line-strong), transparent); }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--steel-btn);
  color: var(--text-2);
  font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
  transition: filter .15s, border-color .15s, transform .1s;
}
.btn:hover { color: #fff; border-color: var(--line-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn.chrome-btn, .btn.primary {
  border-color: #e4e8ec; color: #0d0f12; font-weight: 700;
  background: var(--chrome-btn);
  box-shadow: 0 4px 12px rgba(0,0,0,.45);
}
.btn.chrome-btn:hover, .btn.primary:hover { color: #0d0f12; filter: brightness(1.08); }
.btn.outline, .btn.ghost { background: transparent; box-shadow: none; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn.big { min-height: 52px; padding: 0 28px; font-size: 16px; }
.btn.block { display: flex; width: 100%; }
.icon-square {
  width: 44px; height: 44px; flex: none; display: inline-grid; place-items: center;
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--raised); color: var(--text-2); cursor: pointer;
}
.icon-square:hover { color: #fff; border-color: var(--line-hover); }
.icon-square.on { color: #0d0f12; background: var(--chrome-btn); border-color: #e4e8ec; }
.icon-square.sm { width: 36px; height: 36px; }

.segmented {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px;
  background: var(--field); border: 1px solid var(--line-strong);
  box-shadow: inset 0 2px 4px rgba(0,0,0,.6);
}
.segmented button {
  border: 0; background: transparent; color: var(--text-2);
  min-height: 36px; padding: 0 14px; border-radius: 9px; cursor: pointer; font-weight: 500;
}
.segmented button.active { background: var(--chrome-btn); color: #0d0f12; font-weight: 700; box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.segmented.small button { min-height: 30px; padding: 0 10px; font-size: 13px; }

.chip {
  min-height: 40px; padding: 0 18px; border-radius: 99px;
  border: 1px solid #333a43; background: var(--raised); color: var(--text-2);
  font-size: 14px; font-weight: 500; cursor: pointer;
}
.chip:hover { border-color: #59626f; }
.chip.active { border-color: #d7dce2; color: #0d0f12; font-weight: 700; background: linear-gradient(180deg, #f1f4f7, #a9b1bb 50%, #c9d0d7 51%, #9099a3); }

.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; background: var(--muted); }
.dot.win { background: var(--win); }
.dot.lose { background: var(--lose); }
.dot.draw { background: var(--draw); }

/* ---------- 셸: 좌 2 / 우 8 ---------- */
.shell {
  max-width: 1600px; margin: 0 auto; padding: 24px;
  display: grid; grid-template-columns: minmax(260px, 2fr) minmax(0, 8fr); gap: 24px; align-items: start;
}
.main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* 사이드바 */
.sidebar { position: sticky; top: 24px; padding: 24px; display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 9px; color: #111418;
  background: linear-gradient(145deg, #e9edf1, #7d8691 55%, #c3cad2);
  box-shadow: inset 0 1px 0 #fff, 0 4px 10px rgba(0,0,0,.5);
}
.brand-name { font-family: var(--font-num); font-weight: 700; font-size: 20px; letter-spacing: .08em; }

.profile-block { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.avatar-ring {
  width: 96px; height: 96px; border-radius: 50%; padding: 3px;
  background: conic-gradient(from 210deg, #f1f4f7, #6c7580, #d7dce2, #5a626c, #f1f4f7);
  box-shadow: 0 8px 22px rgba(0,0,0,.6);
}
.avatar-core {
  width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; color: var(--chrome-mid);
  background: linear-gradient(160deg, #262b33, #0f1215);
}
.avatar-initial { font-size: 38px; font-weight: 900; }
.profile-name { font-size: 20px; font-weight: 700; }
.profile-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

.level { display: flex; flex-direction: column; gap: 8px; }
.level-row { display: flex; justify-content: space-between; align-items: baseline; }
.level-num { font-family: var(--font-num); font-weight: 700; font-size: 22px; }
.level-xp { font-family: var(--font-num); font-size: 14px; color: var(--muted); }
.xp-track { height: 8px; border-radius: 99px; background: var(--field); box-shadow: inset 0 1px 3px rgba(0,0,0,.8); overflow: hidden; }
.xp-fill { height: 100%; border-radius: 99px; background: linear-gradient(180deg, #f0f3f6, #9aa3ad 50%, #c8cfd6); min-width: 4px; }

.stat-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.stat-tiles.inline { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-tiles > div { background: var(--well); border: 1px solid var(--line-soft); border-radius: 12px; padding: 12px 6px; text-align: center; }
.stat-tiles dd { margin: 0; font-family: var(--font-num); font-weight: 700; font-size: 24px; line-height: 1.2; }
.stat-tiles dt { font-size: 12px; color: var(--muted); }

.side-nav { display: flex; flex-direction: column; gap: 4px; }
.navlink {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  color: var(--text-2); font-size: 14px; text-decoration: none;
}
.navlink:hover { background: #1f242b; color: #fff; }
.navlink.active { background: linear-gradient(90deg, #2a3038, #1a1e24); border-color: var(--line-strong); color: #fff; font-weight: 500; }
.nav-badge {
  margin-left: auto; font-family: var(--font-num); font-size: 13px; font-weight: 700;
  color: #0d0f12; background: var(--chrome-mid); border-radius: 99px; padding: 1px 8px;
}
.side-actions { display: grid; gap: 8px; }

.recent { display: flex; flex-direction: column; gap: 10px; }
.recent p { margin: 0; }
.recent-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--well); border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
  color: var(--text); text-decoration: none;
}
.recent-item:hover { border-color: var(--line-strong); color: var(--text); }
.recent-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.recent-title { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-sub { font-size: 12px; color: var(--muted); }
.recent-xp { font-family: var(--font-num); font-weight: 700; font-size: 15px; }
.recent-xp.win { color: var(--win); }
.recent-xp.lose { color: var(--lose); }
.recent-xp.draw { color: var(--draw); }

/* 우측 상단 패널 */
.page-head {
  padding: 20px 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
}
.page-head h1 { margin-top: 2px; font-size: 30px; font-weight: 900; letter-spacing: -.01em; }
.head-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 0 1 440px; justify-content: flex-end; min-width: 0; }
.search {
  flex: 1 1 260px; min-width: 0; display: flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 16px; border-radius: 12px; color: var(--chrome-mid);
  background: var(--field); border: 1px solid #353c45; box-shadow: inset 0 2px 4px rgba(0,0,0,.6);
}
.search:focus-within { border-color: #8e97a2; box-shadow: 0 0 0 3px rgba(185,193,202,.18), inset 0 2px 4px rgba(0,0,0,.6); }
.search input { flex: 1; min-width: 0; height: 100%; background: transparent; border: 0; outline: none; color: var(--text); font-size: 15px; }

.list-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.count { font-size: 14px; color: var(--muted); }
.count .num { font-size: 17px; color: var(--text); margin-right: 2px; }

/* ---------- 게임 카드 ---------- */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.game-card {
  border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.game-card:hover { transform: translateY(-4px); border-color: var(--line-hover); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 20px 40px rgba(0,0,0,.6); }
.card-art, .detail-art {
  position: relative; height: 160px; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 50% 45%, rgba(255,255,255,.09), transparent 62%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.025) 0 2px, transparent 2px 6px),
    linear-gradient(160deg, #222830, #0c0e11);
  border-bottom: 1px solid var(--line);
}
.thumb-art { position: relative; display: grid; place-items: center; width: 112px; height: 112px; }
.thumb-shape { width: 100%; height: 100%; filter: drop-shadow(0 0 10px currentColor); }
.thumb-glyph { position: absolute; font-size: 36px; font-weight: 900; }
.badge {
  position: absolute; top: 12px; left: 12px;
  font-family: var(--font-num); font-weight: 700; font-size: 12px; letter-spacing: .1em;
  padding: 3px 10px; border-radius: 99px; color: #0d0f12; background: linear-gradient(180deg, #f1f4f7, #a9b1bb);
}
.sub-pill {
  position: absolute; top: 12px; right: 12px; display: flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700; color: var(--win);
  background: rgba(0,0,0,.55); border: 1px solid var(--line-strong); padding: 3px 10px; border-radius: 99px;
}
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.card-body h2 { font-size: 18px; font-weight: 700; }
.card-body h2 a { color: var(--text-strong); text-decoration: none; }
.card-body h2 a:hover { color: #fff; text-decoration: underline; }
.card-line, .card-chip { display: none; }
.card-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--text-2); }
.card-meta span { display: flex; align-items: center; gap: 6px; }
.card-meta svg { color: var(--muted); }
.card-actions { display: flex; gap: 8px; margin-top: auto; }
.play-btn { flex: 1; font-size: 15px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.empty { grid-column: 1 / -1; border-radius: var(--radius); padding: 48px 24px; text-align: center; color: var(--muted); font-size: 15px; }

/* ---------- 상세 ---------- */
.game-detail { display: flex; flex-direction: column; gap: 20px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 20px; }
.detail-art { height: auto; min-height: 260px; border-radius: var(--radius-lg); }
.detail-art .thumb-art { width: 150px; height: 150px; }
.detail-art .thumb-glyph { font-size: 48px; }
.detail-info { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.detail-info p { margin: 0; }
.detail-desc { font-size: 16px; color: var(--text); }
.cta-row { display: flex; flex-wrap: wrap; gap: 8px; }
.rules, .panel { padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.rules h2, .panel h2 { font-size: 20px; margin-bottom: 6px; }
.rules-body { color: var(--text-2); }
.rules-body ul { margin: 0; padding-left: 20px; }
.rules-body li { margin: 6px 0; }
.rules-body b { color: var(--text-strong); }

/* ---------- 인증 ---------- */
.auth { width: 100%; max-width: 440px; margin: 24px auto; padding: 32px; }
.auth h1 { font-size: 30px; font-weight: 900; margin: 2px 0 22px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field span { font-size: 13px; color: var(--text-2); font-weight: 500; }
.field input, .seat-name {
  height: 48px; padding: 0 14px; border-radius: 12px;
  border: 1px solid #353c45; background: var(--field); color: var(--text);
  box-shadow: inset 0 2px 4px rgba(0,0,0,.6);
}
.field input:focus, .seat-name:focus { outline: none; border-color: #8e97a2; box-shadow: 0 0 0 3px rgba(185,193,202,.18), inset 0 2px 4px rgba(0,0,0,.6); }
.form-error { color: var(--danger); min-height: 1.4em; margin: 0 0 8px; font-size: 14px; }
.auth-alt { text-align: center; margin: 16px 0 0; color: var(--muted); font-size: 14px; }

/* ---------- 내 정보 ---------- */
.nick-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.nick-form .field { flex: 1 1 260px; margin: 0; }
.nick-form .form-error { flex-basis: 100%; order: 3; margin: 0; min-height: 0; }
.sub-list { display: grid; gap: 8px; }
.sub-item {
  display: grid; grid-template-columns: 56px 1fr auto auto; gap: 12px; align-items: center;
  padding: 10px 12px; border-radius: 12px; background: var(--well); border: 1px solid var(--line-soft);
}
.mini-art {
  width: 56px; height: 56px; border-radius: 10px; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(160deg, #222830, #0c0e11); border: 1px solid var(--line);
}
.mini-art .thumb-art { width: 40px; height: 40px; }
.mini-art .thumb-glyph { font-size: 14px; }
.mini-art .thumb-shape { filter: drop-shadow(0 0 4px currentColor); }
.sub-info { display: grid; }
.table-wrap { overflow-x: auto; }
.match-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.match-table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 8px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.match-table td { padding: 12px 8px; border-bottom: 1px solid var(--line-soft); }
.result { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; white-space: nowrap; }
.result.win { color: var(--win); }
.result.lose { color: var(--lose); }
.result.draw { color: var(--draw); }

/* ---------- 토스트 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px;
  background: linear-gradient(180deg, #2a3038, #171a1f); border: 1px solid var(--line-strong);
  box-shadow: 0 14px 34px rgba(0,0,0,.6); color: var(--text); font-size: 14px;
}
.toast a { color: #fff; font-weight: 700; }

/* =========================================================
   게임 창 (play.html) — 디자인: "플레이 화면"
   ========================================================= */
.play-window { min-height: 100dvh; }
.play-shell { box-sizing: border-box; min-height: 100dvh; padding: 20px; display: flex; flex-direction: column; gap: 16px; max-width: 1600px; margin: 0 auto; }
.play-bar { min-height: 64px; flex: none; border-radius: 14px; padding: 10px 16px; display: flex; align-items: center; gap: 16px; }
.exit-btn { min-height: 44px; padding: 0 14px; gap: 8px; background: transparent; box-shadow: none; }
.play-titles { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.play-name { font-size: 20px; font-weight: 900; white-space: nowrap; }
.play-sub { font-size: 13px; color: var(--muted); white-space: nowrap; }
.play-turn { font-family: var(--font-num); font-size: 15px; color: var(--muted); letter-spacing: .06em; white-space: nowrap; }
.play-bar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.info-chip {
  display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 10px;
  background: var(--field); border: 1px solid var(--line-soft); font-size: 13px; color: var(--muted); white-space: nowrap;
}
.info-slot { display: flex; align-items: center; gap: 8px; }
.info-slot[hidden] { display: none; }
.chip-pill {
  height: 32px; padding: 0 12px; border-radius: 99px; display: flex; align-items: center; white-space: nowrap;
  font-size: 13px; color: var(--text-2); background: var(--field); border: 1px solid var(--line-soft);
}
.info-chip svg { color: var(--chrome-mid); }
.info-chip .num { font-size: 18px; color: var(--text); }
.play-tools { display: flex; gap: 8px; }
.play-tools .icon-square { background: transparent; }

.play-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: stretch; }
.play-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.play-grid:has(.play-side[hidden]) { grid-template-columns: minmax(0, 1fr); }

/* 오른쪽 패널 */
.play-side { border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 14px; min-height: 0; max-height: calc(100dvh - 120px); position: sticky; top: 20px; }
.play-side[hidden] { display: none; }
.side-now {
  font-size: 14px; padding: 10px 12px; border-radius: 10px; background: var(--well); border: 1px solid var(--line-soft); color: var(--text-2);
}
.side-now:empty { display: none; }
.side-now[data-tone="me"] { border-color: #8a6a2a; background: linear-gradient(90deg, rgba(224,176,79,.14), rgba(224,176,79,.03)); color: var(--text); }
.side-now[data-tone="win"] { border-color: color-mix(in srgb, var(--win) 50%, transparent); color: var(--win); }
.side-now[data-tone="lose"] { border-color: color-mix(in srgb, var(--lose) 50%, transparent); color: var(--lose); }
.side-block { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.side-block[hidden], .side-now[hidden] { display: none; }
.side-block.grow { flex: 1; }
.side-custom { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.side-custom:empty { display: none; }
.side-standings { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.side-standings li {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px;
  background: var(--well); border: 1px solid var(--line-soft);
}
.side-standings li.active { border-color: #8a6a2a; }
.side-standings li.out { opacity: .5; }
.st-rank { font-size: 15px; color: var(--muted); width: 16px; }
.st-name { flex: 1; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-val { font-size: 16px; }
.emotes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.emote { min-height: 40px; border-radius: 9px; border: 1px solid #333a43; background: var(--raised); color: var(--text-2); font-size: 13px; cursor: pointer; }
.emote:hover { background: #1f242b; }
.chat {
  display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 6px 0 12px; border-radius: 10px;
  background: var(--field); border: 1px solid #353c45; box-shadow: inset 0 2px 4px rgba(0,0,0,.6);
}
.chat input { flex: 1; min-width: 0; height: 100%; background: transparent; border: 0; outline: none; color: var(--text); font-size: 14px; }
.chat-send { width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.chat-send:hover { color: #fff; background: #1f242b; }

/* 게임 화면 공통 조각 */
.ring-avatar {
  width: 44px; height: 44px; flex: none; border-radius: 50%; padding: 2px;
  background: conic-gradient(from 210deg, #f1f4f7, #6c7580, #d7dce2, #5a626c, #f1f4f7);
}
.ring-avatar > span {
  width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(160deg, #262b33, #0f1215); color: var(--text-2); font-weight: 700; font-size: 16px;
}
.ring-avatar.sm { width: 40px; height: 40px; }
.opp-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; flex: none; }
.opp-card { min-height: 76px; border-radius: 14px; padding: 0 16px; display: flex; align-items: center; gap: 12px; }
.opp-card.active { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.opp-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.opp-info b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opp-info b small { font-size: 11px; font-weight: 500; color: var(--muted); }
.opp-info > span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opp-count { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; background: var(--field); border: 1px solid var(--line-soft); }
.opp-count i { width: 12px; height: 16px; border-radius: 3px; background: linear-gradient(180deg, #eef1f4, #9aa3ad); }
.opp-count b { font-size: 18px; }

.turn-banner {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 2;
  display: flex; align-items: center; gap: 12px; padding: 7px 20px 7px 8px; border-radius: 99px; white-space: nowrap;
  background: linear-gradient(180deg, #fff4d6, #e0b04f 50%, #eac26c 51%, #b8862a); color: #1a1205;
  box-shadow: 0 0 0 4px rgba(224,176,79,.18), 0 10px 30px rgba(224,176,79,.35);
  animation: bannerIn .45s ease-out both;
}
.turn-banner.static { position: relative; top: 0; left: 0; transform: none; align-self: center; animation-name: bannerInStatic; }
.tb-play { width: 30px; height: 30px; border-radius: 50%; background: #1a1205; color: #e8c26a; display: grid; place-items: center; }
.tb-play svg { fill: currentColor; }
.tb-word { font-size: 19px; letter-spacing: .14em; }
.tb-sep { width: 1px; height: 18px; background: rgba(26,18,5,.35); }
.tb-text { font-size: 14px; font-weight: 700; }
@keyframes bannerIn { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes bannerInStatic { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

.myturn { animation: turnGlow 1.8s ease-in-out infinite; border-color: #e0b04f !important; }
@keyframes turnGlow {
  0%, 100% { box-shadow: 0 0 0 2px rgba(224,176,79,.55), 0 0 26px rgba(224,176,79,.22), inset 0 1px 0 rgba(255,255,255,.1); }
  50% { box-shadow: 0 0 0 2px rgba(224,176,79,.95), 0 0 52px rgba(224,176,79,.45), inset 0 1px 0 rgba(255,255,255,.1); }
}
.me-info { min-width: 0; }
.me-name { display: flex; align-items: center; gap: 8px; }
.me-name b { font-size: 16px; }
.me-sub { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.me-sub svg { color: var(--win); }
.my-badge { font-size: 11px; font-weight: 700; color: #0d0f12; background: linear-gradient(180deg, #fff4d6, #e0b04f); border-radius: 99px; padding: 2px 8px; }

/* 원형 턴 타이머 */
.turn-clock { display: flex; align-items: center; gap: 10px; color: #e0b04f; }
.turn-clock[hidden] { display: none; }
.turn-clock .ring { stroke: #e0b04f; transition: stroke-dasharray 1s linear; }
.turn-clock .num { font-size: 24px; }
.turn-clock.low { color: var(--danger); }
.turn-clock.low .ring { stroke: var(--danger); }
/* 보드 오른쪽 하단 오버레이 (레이아웃에 영향 없음) */
.turn-clock.overlay { position: absolute; right: 12px; bottom: 12px; z-index: 5; pointer-events: none; padding: 6px 12px 6px 6px; border-radius: 99px; background: rgba(7,8,10,.78); border: 1px solid var(--line-strong); box-shadow: 0 6px 16px rgba(0,0,0,.5); backdrop-filter: blur(2px); }
.turn-clock.overlay svg { width: 36px; height: 36px; }
.turn-clock.overlay .num { font-size: 20px; }
.turn-clock.overlay.low { border-color: var(--danger); }

@media (prefers-reduced-motion: reduce) {
  .myturn, .turn-banner { animation: none; }
}

.gate { padding: 40px 24px; display: grid; gap: 10px; justify-items: center; text-align: center; }
.gate h2 { font-size: 22px; }
.gate p { margin: 0 0 6px; }

.setup { padding: 24px; display: flex; flex-direction: column; gap: 16px; max-width: 760px; width: 100%; margin: 0 auto; }
.setup-head h2 { font-size: 22px; margin-top: 2px; }
.setup p { margin: 0; }
.seats { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.seat {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px; background: var(--well); border: 1px solid var(--line-soft);
}
.seat-no {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-family: var(--font-num); font-weight: 700; font-size: 16px;
  background: linear-gradient(160deg, #262b33, #0f1215); border: 1px solid var(--line-strong); color: var(--chrome-mid);
}
.seat-me { font-weight: 700; }
.seat-name { height: 40px; flex: 1 1 140px; min-width: 0; }
.seat .icon-square { margin-left: auto; }
.add-seat { align-self: flex-start; }
.start-btn { align-self: flex-start; }

.status {
  min-height: 48px; padding: 12px 16px; border-radius: 12px; text-align: center; font-weight: 500;
  background: var(--well); border: 1px solid var(--line-soft); box-shadow: inset 0 1px 3px rgba(0,0,0,.5);
}
.status:empty { visibility: hidden; }
.status[data-tone="win"] { color: var(--win); border-color: color-mix(in srgb, var(--win) 45%, transparent); }
.status[data-tone="lose"] { color: var(--lose); border-color: color-mix(in srgb, var(--lose) 45%, transparent); }
.status[data-tone="draw"] { color: var(--draw); border-color: color-mix(in srgb, var(--draw) 45%, transparent); }
.stage { position: relative; min-height: 240px; display: flex; flex-direction: column; flex: 1; }
.loading { text-align: center; padding: 40px; }
.error { color: var(--danger); }
.save-note { margin: 0; text-align: right; min-height: 1.2em; }
.save-note .num { color: var(--win); font-size: 15px; }

.rules-dialog {
  max-width: 640px; width: calc(100% - 32px); padding: 24px; color: var(--text);
}
.rules-dialog::backdrop { background: rgba(4,5,7,.75); }
.rules-dialog h2 { font-size: 20px; margin: 2px 0 10px; }
.rules-dialog form { margin-top: 16px; text-align: right; }

/* 플레이어 표시줄 (BoardGames.ui.playerBar) */
.player-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.pb-item {
  display: flex; align-items: center; gap: 8px; padding: 5px 14px 5px 5px; border-radius: 99px;
  background: var(--well); border: 1px solid var(--line-soft); font-size: 14px;
  transition: border-color .2s, box-shadow .2s;
}
.pb-item.active { border-color: #d7dce2; box-shadow: 0 0 0 1px rgba(215,220,226,.5), 0 0 16px rgba(200,210,225,.15); }
.pb-item.out { opacity: .45; }
.pb-badge {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-num); font-size: 14px; font-weight: 700;
  background: linear-gradient(160deg, #262b33, #0f1215); border: 1px solid var(--line-strong); color: var(--chrome-mid);
}
.pb-item.active .pb-badge { background: var(--chrome-btn); color: #0d0f12; border-color: #e4e8ec; }
.pb-name { font-weight: 700; }
.pb-bot { font-size: 11px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 99px; padding: 1px 8px; }
.pb-extra { color: var(--text-2); font-family: var(--font-num); font-weight: 600; font-size: 15px; }

/* 화면 가리기 (BoardGames.ui.handoff) */
.handoff {
  position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 16px;
  background: rgba(7, 8, 10, .97); border-radius: var(--radius-lg);
}
.handoff-card { text-align: center; display: grid; gap: 8px; justify-items: center; }
.handoff-card h3 { font-size: 28px; }
.handoff-card p { margin: 0; }
.handoff-card .btn { margin-top: 10px; }

/* =========================================================
   게임 시작 설정 모달 (디자인: "게임 시작 팝업")
   ========================================================= */
.setup-modal {
  width: min(920px, calc(100% - 32px)); max-height: calc(100dvh - 32px);
  padding: 0; border-radius: 22px; color: var(--text); overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 40px 90px rgba(0,0,0,.75);
}
.setup-modal[open] { display: flex; flex-direction: column; }
.setup-modal::backdrop { background: rgba(4,5,7,.72); backdrop-filter: blur(3px); }

.sm-head {
  position: relative; display: flex; align-items: center; gap: 20px; padding: 28px 32px; flex: none;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(500px 200px at 85% 50%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.022) 0 2px, transparent 2px 6px),
    linear-gradient(160deg, #232931, #0e1013);
}
.sm-art {
  width: 72px; height: 72px; flex: none; border-radius: 16px; display: grid; place-items: center;
  background: linear-gradient(160deg, #262b33, #0f1215); border: 1px solid var(--line-strong);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
}
.sm-art .thumb-art { width: 52px; height: 52px; }
.sm-art .thumb-glyph { font-size: 18px; }
.sm-art .thumb-shape { filter: drop-shadow(0 0 8px currentColor); }
.sm-title { flex: 1; min-width: 0; padding-right: 48px; }
.sm-title h1 { margin: 2px 0 4px; font-size: 32px; font-weight: 900; }
.sm-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; color: var(--text-2); }
.sm-meta i { width: 1px; height: 12px; background: #59626f; }
.sm-close { position: absolute; top: 20px; right: 20px; }

.sm-body {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 28px;
  padding: 28px 32px; overflow-y: auto; flex: 1 1 auto; min-height: 0;
}
.sm-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sm-col:last-child { gap: 20px; }
.sm-group { display: flex; flex-direction: column; gap: 10px; }

.mode-opt {
  display: flex; align-items: center; gap: 14px; min-height: 68px; padding: 12px 16px; width: 100%;
  border-radius: 12px; border: 1px solid #2f353e; background: var(--well); color: var(--text-2);
  text-align: left; cursor: pointer;
}
.mode-opt:hover:not(:disabled) { border-color: #59626f; }
.mode-opt .radio { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 2px solid #59626f; display: grid; place-items: center; }
.mode-opt .mode-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.mode-opt .mode-text b { font-size: 15px; font-weight: 500; }
.mode-opt .mode-text span { font-size: 12px; color: var(--muted); }
.mode-opt.active {
  border-color: var(--text-2); color: #fff;
  background: linear-gradient(90deg, #2c323b, #1a1e24);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 0 0 3px rgba(185,193,202,.12);
}
.mode-opt.active .radio { border-color: var(--text); }
.mode-opt.active .radio::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--text); }
.mode-opt.active .mode-text b { font-weight: 700; }
.mode-opt.active .mode-text span { color: #b4bcc6; }
.mode-opt:disabled { cursor: not-allowed; opacity: .55; }
.soon {
  flex: none; font-family: var(--font-num); font-weight: 700; font-size: 11px; letter-spacing: .06em;
  padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line-strong); color: var(--muted);
}

.seg-row {
  display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 6px; padding: 4px;
  border-radius: 12px; background: var(--field); border: 1px solid var(--line-soft);
}
.seg-row button {
  min-height: 44px; border-radius: 9px; border: 1px solid transparent; background: transparent;
  color: var(--text-2); font-size: 15px; cursor: pointer;
}
.seg-row button:hover { background: #1f242b; }
.seg-row button.active { border-color: #e4e8ec; background: var(--chrome-btn); color: #0d0f12; font-weight: 700; }
.seg-row.compact { flex: 1 1 auto; gap: 2px; padding: 3px; }
.seg-row.compact button { min-height: 36px; font-size: 13px; padding: 0 6px; }

.setup-modal .seats { gap: 6px; }
.setup-modal .seat { flex-wrap: nowrap; }
.setup-modal .seat .seg-row.compact:first-of-type { flex: 0 0 116px; }
.setup-modal .seat-name { height: 42px; }

.rule-list { display: flex; flex-direction: column; }
.rule-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 56px; padding: 6px 4px; border-bottom: 1px solid #22262d;
}
.rule-row:last-child { border-bottom: 0; }
.rule-row > div { display: flex; flex-direction: column; min-width: 0; }
.rule-row b { font-size: 14px; font-weight: 500; }
.rule-row span { font-size: 12px; color: var(--muted); }
.switch {
  width: 52px; height: 30px; flex: none; padding: 3px; border-radius: 99px; cursor: pointer;
  display: flex; justify-content: flex-start;
  border: 1px solid var(--line-strong); background: var(--field); box-shadow: inset 0 2px 4px rgba(0,0,0,.6);
}
.switch span { width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(180deg, #59626f, #353c45); }
.switch.on { justify-content: flex-end; border-color: #d7dce2; background: linear-gradient(180deg, #d7dce2, #8f98a2); box-shadow: none; }
.switch.on span { background: linear-gradient(180deg, #fff, #c9d0d7); box-shadow: 0 2px 4px rgba(0,0,0,.5); }

.sm-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; flex: none;
  padding: 20px 32px; border-top: 1px solid var(--line); background: var(--well);
}
.sm-summary { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--win); box-shadow: 0 0 8px var(--win); flex: none; }
.sm-actions { display: flex; gap: 10px; }

/* =========================================================
   공통 결과 화면 (디자인: "결과 – 승리" / "결과 – 패배")
   ========================================================= */
.btn.gold-btn {
  border-color: #fff1c9; color: #1a1205; font-weight: 700;
  background: linear-gradient(180deg, #fff4d6, #e0b04f 50%, #eac26c 51%, #b8862a);
  box-shadow: 0 8px 22px rgba(224,176,79,.3);
}
.btn.gold-btn:hover { color: #1a1205; filter: brightness(1.08); }

.result-overlay {
  position: fixed; inset: 0; z-index: 40; overflow-y: auto; padding: 24px 16px;
  display: grid; place-items: center;
  background: radial-gradient(700px 480px at 50% 28%, rgba(224,176,79,.16), transparent 70%), rgba(4,5,7,.8);
  backdrop-filter: blur(5px);
  animation: resIn .35s ease-out both;
}
.result-overlay.lose, .result-overlay.draw {
  background: radial-gradient(700px 480px at 50% 28%, rgba(120,140,170,.08), transparent 70%), rgba(4,5,7,.82);
}
@keyframes resIn { from { opacity: 0; } to { opacity: 1; } }
.res-dialog { width: min(760px, 100%); display: flex; flex-direction: column; align-items: center; gap: 22px; }
.res-chip {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 16px 0 6px; border-radius: 99px;
  background: rgba(14,16,19,.9); border: 1px solid #333a43; font-size: 14px;
}
.res-chip .muted { font-size: 13px; }
.res-chip-ini {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 900;
  background: linear-gradient(160deg, #262b33, #0f1215); border: 1px solid var(--line-strong); color: var(--text-2);
}
.res-head { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.result-overlay.win .res-icon { filter: drop-shadow(0 0 18px rgba(224,176,79,.6)); }
.res-word { font-size: 92px; line-height: 1; letter-spacing: .2em; padding-left: .2em; -webkit-background-clip: text; background-clip: text; color: transparent; }
.result-overlay.win .res-word { background-image: linear-gradient(180deg, #fff4d6 0%, #e8c26a 42%, #fff1c9 52%, #a87a22 100%); }
.result-overlay.lose .res-word, .result-overlay.draw .res-word { background-image: linear-gradient(180deg, #c9d0d8 0%, #7c8591 46%, #aab2bc 54%, #4f5762 100%); }
.res-head h1 { margin-top: 4px; font-size: 22px; font-weight: 700; }

.res-panel { width: 100%; border-radius: 20px; overflow: hidden; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 30px 80px rgba(0,0,0,.7); }
.result-overlay.win .res-panel { border-color: #5a4a26; box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 0 0 1px rgba(224,176,79,.15), 0 30px 80px rgba(0,0,0,.7); }
.res-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.res-summary > div { padding: 16px 12px; text-align: center; border-right: 1px solid #22262d; display: flex; flex-direction: column; }
.res-summary > div:last-child { border-right: 0; }
.res-summary b { font-size: 26px; }
.res-summary span { font-size: 12px; color: var(--muted); }
.result-overlay.win .res-summary .rank { color: #e8c26a; }
.result-overlay.lose .res-summary .rank { color: var(--lose); }

.res-table { padding: 18px 28px 8px; display: flex; flex-direction: column; gap: 6px; }
.res-row {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) 110px 70px; gap: 12px; align-items: center;
  min-height: 46px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-soft); background: var(--well);
}
.res-row.head { min-height: 0; padding-bottom: 2px; border: 0; background: none; font-family: var(--font-num); font-weight: 600; font-size: 12px; letter-spacing: .14em; color: var(--muted); }
.res-row > :nth-child(3), .res-row > :nth-child(4) { text-align: right; }
.res-rank { font-size: 20px; color: var(--muted); }
.res-name { font-size: 15px; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-name small { font-size: 11px; color: var(--muted); font-weight: 400; }
.res-score { font-size: 18px; color: var(--text-2); }
.res-tier { font-size: 16px; color: var(--muted); font-weight: 500; }
.res-tier.up { color: #e8c26a; }
.res-row.first .res-rank, .res-row.first .res-score { color: #e8c26a; }
.result-overlay.win .res-row.me { border-color: #8a6a2a; background: linear-gradient(90deg, rgba(224,176,79,.16), rgba(224,176,79,.03)); }
.result-overlay.win .res-row.me .res-rank, .result-overlay.win .res-row.me .res-score { color: #e8c26a; }
.result-overlay.lose .res-row.me { border-color: var(--lose-line); background: linear-gradient(90deg, rgba(77,163,255,.12), rgba(77,163,255,.02)); }
.result-overlay.lose .res-row.me .res-rank, .result-overlay.lose .res-row.me .res-score, .result-overlay.lose .res-row.me .res-tier { color: var(--lose); }
.res-row.me .res-name { font-weight: 700; }

.res-rewards {
  margin-top: 14px; padding: 18px 28px; border-top: 1px solid var(--line); background: var(--well);
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: center;
}
.res-rewards.practice { display: block; text-align: center; color: var(--muted); font-size: 14px; }
.res-xp { display: flex; flex-direction: column; gap: 8px; }
.res-xp-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.res-xp-row .num { font-size: 18px; }
.res-xp-row .muted { font-size: 14px; font-weight: 500; }
.res-xp-row em { font-style: normal; font-size: 15px; color: var(--text-2); }
.res-xp-row em.win { color: #e8c26a; }
.res-xp-track { position: relative; height: 10px; border-radius: 99px; background: var(--bg); box-shadow: inset 0 1px 3px rgba(0,0,0,.8); overflow: hidden; }
.res-xp-track > div { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; }
.res-xp-track .gain { background: linear-gradient(180deg, #fff1c9, #e0b04f 50%, #b8862a); }
.result-overlay.lose .res-xp-track .gain, .result-overlay.draw .res-xp-track .gain { background: linear-gradient(180deg, #f0f3f6, #9aa3ad 50%, #c8cfd6); opacity: .55; }
.res-xp-track .base { background: linear-gradient(180deg, #f0f3f6, #9aa3ad 50%, #c8cfd6); }
.res-card { text-align: center; padding: 10px; border-radius: 12px; background: #15181d; border: 1px solid var(--line); display: flex; flex-direction: column; }
.res-card b { font-size: 22px; color: var(--text-2); }
.res-card b.up { color: #e8c26a; }
.res-card b.down { color: var(--lose); }
.res-card .tier-name { font-size: 18px; color: var(--chrome-hi); }
.res-card span { font-size: 12px; color: var(--muted); }
.res-actions { display: flex; gap: 10px; }
.res-actions .btn { min-height: 52px; border-radius: 12px; }
.res-actions .btn.outline { background: rgba(18,21,25,.9); }
.res-actions [data-res=again] { padding: 0 34px; }

/* ---------- 반응형 (태블릿·모바일) ---------- */
@media (max-width: 1000px) {
  .play-grid { grid-template-columns: minmax(0, 1fr); }
  .play-side { position: static; max-height: none; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); padding: 16px; gap: 16px; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .sm-body { grid-template-columns: minmax(0, 1fr); }

  /* 사이드바 → 상단 컴팩트 카드 */
  .sidebar {
    position: static; padding: 16px; gap: 14px;
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  }
  .sidebar > .brand { grid-column: 1; }
  .sidebar > .divider { display: none; }
  .sidebar > .profile-block,
  .sidebar > .level,
  .sidebar > .points-box,
  .sidebar > .stat-tiles,
  .sidebar > .side-actions,
  .sidebar > .side-nav,
  .sidebar > .recent { grid-column: 1 / -1; }
  .sidebar > [data-act=logout] { grid-column: 2; grid-row: 1; width: auto; min-height: 36px; padding: 0 12px; font-size: 13px; }
  .profile-block { flex-direction: row; text-align: left; gap: 14px; }
  .avatar-ring { width: 60px; height: 60px; flex: none; }
  .avatar-core svg { width: 28px; height: 28px; }
  .avatar-initial { font-size: 24px; }
  .side-actions { grid-template-columns: 1fr 1fr; }
  .sidebar > .stat-tiles { gap: 0; border-radius: 10px; background: var(--well); border: 1px solid var(--line-soft); }
  .sidebar > .stat-tiles > div { display: flex; align-items: baseline; justify-content: center; gap: 4px; padding: 7px 4px; border: 0; border-right: 1px solid #22262d; border-radius: 0; background: none; }
  .sidebar > .stat-tiles > div:last-child { border-right: 0; }
  .sidebar > .stat-tiles dd { font-size: 18px; line-height: 1.2; }
  .sidebar > .stat-tiles dt { font-size: 11px; }
  .navlink { min-height: 40px; border-radius: 99px; padding: 0 14px; font-size: 13px; border-color: #333a43; background: var(--raised); }
  .navlink.active { border-color: #59626f; }
  .recent-item { border-left: 3px solid var(--muted); }
  .recent-item.win { border-left-color: var(--win); }
  .recent-item.lose { border-left-color: var(--lose); }
  .recent-item.draw { border-left-color: var(--draw); }
  .recent-item .dot { display: none; }

  /* 가로 스크롤 메뉴 / 최근 플레이 */
  .side-nav, .recent {
    flex-direction: row; overflow-x: auto; scrollbar-width: none;
    margin: 0 -16px; padding: 0 16px;
  }
  .side-nav::-webkit-scrollbar, .recent::-webkit-scrollbar { display: none; }
  .navlink { flex: none; }
  .recent .eyebrow { display: none; }
  .recent-item { flex: 0 0 220px; }
  .recent p { white-space: nowrap; }
}
@media (max-width: 560px) {
  body { font-size: 14px; }
  .shell { padding: 12px; }
  .page-head { padding: 16px; }
  .page-head h1 { font-size: 24px; }
  .head-tools { flex-basis: 100%; }
  .list-bar { flex-direction: column; align-items: stretch; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -12px; padding: 0 12px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .game-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .game-card { flex-direction: row; align-items: center; padding: 12px; gap: 12px; border-radius: 14px; min-height: 88px; }
  .game-card:hover { transform: none; }
  .game-card .card-art { flex: none; width: 64px; height: 64px; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; }
  .game-card .thumb-art { width: 48px; height: 48px; }
  .game-card .thumb-glyph { font-size: 18px; }
  .game-card .thumb-shape { filter: drop-shadow(0 0 6px currentColor); }
  .game-card .card-art .badge, .game-card .sub-pill, .game-card .card-sub, .game-card .card-meta { display: none; }
  .game-card .card-body { padding: 0; flex-direction: row; align-items: center; gap: 12px; min-width: 0; }
  .game-card .card-body > div:first-child { flex: 1; min-width: 0; }
  .game-card h2 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 6px; min-width: 0; }
  .game-card h2 a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .game-card .card-chip {
    display: inline-block; flex: none; font-family: var(--font-num); font-size: 11px; font-weight: 700; letter-spacing: .06em;
    padding: 1px 7px; border-radius: 99px; color: #0d0f12; background: linear-gradient(180deg, #f1f4f7, #a9b1bb);
  }
  .game-card .card-line { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
  .game-card .card-actions { flex: none; margin-top: 0; }
  .game-card .play-btn { height: 44px; width: auto; padding: 0 14px; font-size: 14px; font-weight: 700; white-space: nowrap; }
  .sub-item { grid-template-columns: 56px 1fr; }
  .sub-item .btn { width: 100%; }
  .stat-tiles.inline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth { padding: 24px 18px; margin: 8px auto; }
  .rules, .panel, .detail-info { padding: 18px; }

  .setup { padding: 16px; }
  .seat { padding: 10px; }
  .seat .segmented { flex: 1 1 auto; }
  .seat .segmented button { flex: 1; }
  .start-btn { align-self: stretch; }

  /* 시작 설정 모달 → 하단 시트 */
  .setup-modal {
    width: 100%; max-width: none; max-height: 94dvh; margin: auto 0 0;
    border-radius: 20px 20px 0 0; border-bottom: 0;
  }
  .setup-modal::before { content: ''; flex: none; align-self: center; width: 40px; height: 4px; border-radius: 99px; background: #3a414b; margin-top: 8px; }
  .sm-head { padding: 12px 16px 16px; gap: 12px; }
  .sm-close { top: 10px; }
  .setup-modal .seat-name { height: 40px; }
  .sm-actions .btn { min-height: 50px; }
  .sm-art { width: 52px; height: 52px; border-radius: 12px; }
  .sm-art .thumb-art { width: 38px; height: 38px; }
  .sm-art .thumb-glyph { font-size: 14px; }
  .sm-title h1 { font-size: 24px; }
  .sm-meta { font-size: 12px; gap: 4px 10px; }
  .sm-close { right: 14px; width: 40px; height: 40px; }
  .sm-body { padding: 16px; gap: 20px; }
  .mode-opt { min-height: 58px; padding: 10px 12px; }
  .setup-modal .seat { flex-wrap: wrap; }
  .setup-modal .seat .seg-row.compact:first-of-type { flex: 1 1 100px; }
  .setup-modal .seat .seg-row.compact.levels, .setup-modal .seat-name { flex: 1 1 100%; }
  .sm-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); gap: 10px; }
  .sm-summary { width: 100%; }
  .sm-actions { width: 100%; }
  .sm-actions .btn { flex: 1; }
  .sm-actions .btn.big { flex: 2; padding: 0 12px; }

  /* 게임 창 */
  .play-shell { padding: 8px; gap: 10px; }
  .play-bar { min-height: 0; padding: 6px; gap: 8px; flex-wrap: nowrap; border-radius: 12px; }
  .exit-btn { min-height: 40px; padding: 0 10px; }
  .exit-btn span { display: none; }
  .play-titles { flex: 1; min-width: 0; flex-direction: column; gap: 0; }
  .play-name { font-size: 16px; line-height: 1.25; }
  .play-turn { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .play-bar-right { gap: 6px; }
  .info-chip { height: 40px; padding: 0 10px; }
  .info-chip span { display: none; }
  .play-tools .icon-square { width: 40px; height: 40px; }
  .play-bar-right { margin-left: 0; flex: none; }
  .play-bar-right .info-slot { display: none; }
  .play-tools { display: flex; gap: 4px; }
  .play-tools .icon-square { width: 40px; height: 40px; }
  .play-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .opp-row { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 6px; }
  .opp-card { min-height: 36px; border-radius: 10px; padding: 0 8px; gap: 6px; }
  .opp-info > span, .opp-info b small { display: none; }
  .opp-info b { font-size: 12px; }
  .opp-count { padding: 0; background: none; border: 0; gap: 3px; }
  .opp-count i { width: 9px; height: 12px; }
  .opp-count b { font-size: 14px; }
  .opp-card .ring-avatar { display: none; }
  .nc-me-head .ring-avatar { display: none; }
  .turn-clock.overlay { right: 8px; bottom: 8px; }
  .turn-clock.overlay svg { width: 28px; height: 28px; }
  .turn-clock.overlay .num { font-size: 16px; }
  .turn-banner { padding: 5px 12px 5px 5px; gap: 8px; top: 10px; }
  .tb-play { width: 24px; height: 24px; }
  .tb-word { font-size: 15px; }
  .tb-sep, .tb-text { display: none; }
  .play-side { padding: 14px; }
  .chat-log { max-height: 200px; }
  .chat { height: 40px; }
  .chat-send { width: 36px; height: 36px; }
  .online-emotes .emote { min-height: 40px; font-size: 13px; }

  /* 결과 화면 */
  .result-overlay { padding: 16px 10px; place-items: start center; }
  .res-dialog { gap: 14px; }
  .res-icon { transform: scale(.7); margin: -14px 0; }
  .res-word { font-size: 60px; }
  .res-head h1 { font-size: 18px; }
  .res-summary b { font-size: 20px; }
  .res-table { padding: 12px 10px 4px; }
  .res-row { grid-template-columns: 30px minmax(0, 1fr) 78px 44px; gap: 6px; padding: 0 8px; }
  .res-row.head { font-size: 10px; letter-spacing: .06em; }
  .res-name small { display: none; }
  .res-score { font-size: 15px; }
  .res-rewards { grid-template-columns: 1fr 1fr; padding: 14px 12px; }
  .res-xp { grid-column: 1 / -1; }
  .res-actions { width: 100%; }
  .res-actions .btn, .res-actions [data-res=again] { flex: 1; padding: 0 12px; }
  .res-chip { height: 32px; font-size: 13px; }
  .res-chip .muted { font-size: 12px; }
  .res-chip-ini { width: 24px; height: 24px; font-size: 11px; }
  .res-summary > div { padding: 12px 6px; }
  .res-summary span { font-size: 11px; }
  .res-rewards .res-card { padding: 8px; }
  .res-card b { font-size: 20px; }
  .res-card .tier-name { font-size: 16px; line-height: 25px; }
  .res-points { flex-wrap: nowrap; padding: 12px; gap: 10px; }
  .res-pt-main { flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; }
  .res-pt-main b { font-size: 22px; line-height: 1.1; }
  .res-pt-bal { flex-direction: column; align-items: flex-end; gap: 0; flex: none; }
  .res-pt-bal b { font-size: 18px; }
  .result-overlay.lose { background: radial-gradient(420px 360px at 50% 18%, rgba(77,163,255,.12), transparent 70%), #07080a; }
  .result-overlay.lose .res-word { background: none; color: var(--lose); text-shadow: 0 0 24px rgba(77,163,255,.35); }
  .result-overlay.lose .res-icon { filter: drop-shadow(0 0 12px rgba(77,163,255,.45)); }
  .result-overlay.lose .res-panel { border-color: var(--lose-line); }
  .result-overlay.lose .res-xp-row em { color: var(--lose); }
  .result-overlay.lose .res-xp-track .gain { opacity: 1; background: linear-gradient(180deg, var(--lose-hi), var(--lose) 50%, var(--lose-lo)); }

  .player-bar { gap: 6px; margin-bottom: 10px; }
  .pb-item { font-size: 13px; padding-right: 10px; }
  .pb-bot { display: none; }
  .status { min-height: 44px; padding: 10px 12px; font-size: 14px; }
}
.my-badge.off { visibility: hidden; } /* 자리는 유지 → 차례가 바뀌어도 줄이 흔들리지 않음 */

/* 데스크톱 게임 창 — 한 화면에 맞춤(페이지 스크롤 없음). 보드가 남는 높이를 흡수. */
@media (min-width: 1001px) and (min-height: 640px) {
  .play-window { height: 100dvh; overflow: hidden; }
  .play-shell { height: 100dvh; min-height: 0; overflow: hidden; padding: 16px; gap: 12px; }
  .play-grid { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr); gap: 12px; }
  .play-main { min-height: 0; overflow: hidden; }
  .stage { flex: 1; min-height: 0; }
  .play-side { position: static; max-height: none; height: 100%; min-height: 0; overflow: hidden; }
  .play-side > .side-now, .play-side > .side-block:not(.grow), .play-side > .side-custom, .play-side > .emotes, .play-side > .chat, .play-side > .divider { flex: none; }
  .play-side > .side-block.grow { flex: 1 1 0; min-height: 0; overflow: hidden; }
}

/* ---- 게임 내 경고·일시 안내 오버레이 (BoardGames.ui.notify) — 레이아웃을 밀지 않음 ---- */
.bg-notify-layer {
  position: fixed; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none; box-sizing: border-box; padding: 0 12px;
}
.bg-notify {
  display: flex; align-items: center; gap: 10px; max-width: min(520px, calc(100% - 24px));
  padding: 10px 16px; border-radius: 12px; font-size: 14px; line-height: 1.4;
  border: 1px solid var(--line-strong); color: var(--text, #e6e9ee);
  box-shadow: 0 10px 28px rgba(0,0,0,.55);
  animation: bg-notify-in .22s ease-out both;
}
.bg-notify.out { animation: bg-notify-out .2s ease-in both; }
.bg-notify-ico { flex: none; display: inline-flex; }
.bg-notify.tone-warn { border-color: var(--draw, #e8c26a); }
.bg-notify.tone-warn .bg-notify-ico { color: var(--draw, #e8c26a); }
.bg-notify.tone-error { border-color: var(--danger); }
.bg-notify.tone-error .bg-notify-ico { color: var(--danger); }
.bg-notify.tone-info .bg-notify-ico { color: var(--text-2); }
@keyframes bg-notify-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes bg-notify-out { from { opacity: 1; } to { opacity: 0; transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) {
  .bg-notify, .bg-notify.out { animation: none; transform: none; }
  .bg-notify.out { opacity: 0; }
}
@media (max-width: 560px) { .bg-notify { font-size: 13px; padding: 9px 12px; } }

/* =========================================================
   포인트 · 관리자
   ========================================================= */
.pg { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--text-strong); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; min-height: 36px; }
.price-tag { display: inline-flex; align-items: center; gap: 4px; color: var(--draw); font-family: var(--font-num); font-weight: 700; }
.price-tag svg { color: var(--draw); }

/* 사이드바 포인트 */
.points-box {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px;
  padding: 10px 14px; border-radius: var(--radius-sm); background: var(--well); border: 1px solid var(--line-soft);
  color: var(--text-2); text-decoration: none;
}
.points-box:hover { border-color: var(--line-strong); }
.pb-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.points-box .num { font-size: 22px; }

/* 포인트 페이지 */
.pt-top { display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: flex-start; justify-content: space-between; }
.pt-balance { font-size: 44px; line-height: 1.1; }
.pt-code { display: flex; flex-direction: column; gap: 6px; min-width: 0; max-width: 100%; }
.pt-code-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pt-code-row b { font-size: 28px; letter-spacing: .14em; color: var(--text-strong); }
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 6px; }
.pkg {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 12px; min-height: 120px;
  color: var(--text-2); cursor: pointer; font: inherit;
}
.pkg:hover { border-color: var(--line-hover); transform: translateY(-2px); }
.pkg b { font-size: 28px; }
.pkg-ico { color: var(--draw); }
.pt-table th.r, .pt-table td.r { text-align: right; }
.pt-up { color: var(--draw); }
.pt-down { color: var(--lose); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.dlg-actions .btn { min-height: 44px; }

/* 관리자 */
.adm-tabs { max-width: 560px; }
.adm-table tr.dim { opacity: .5; }
.adm-msg { max-width: 280px; overflow-wrap: anywhere; }
.adm-body { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.adm-search { flex: 0 0 auto; width: 100%; height: 44px; max-width: 460px; margin: 6px 0; }
.adm-list { display: grid; gap: 8px; }
.adm-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center;
  padding: 12px 14px; border-radius: 12px; background: var(--well); border: 1px solid var(--line-soft);
}
.adm-who { display: flex; flex-direction: column; min-width: 0; }
.adm-who b { overflow-wrap: anywhere; }
.adm-badge {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px;
  color: #0d0f12; background: var(--chrome-mid); vertical-align: middle;
}
.adm-pts { display: flex; flex-direction: column; align-items: flex-end; }
.adm-pts b { font-size: 20px; }
.adm-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.adm-acts .btn { min-height: 44px; }
.adm-settings { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.adm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.adm-games { display: grid; gap: 12px; }
.adm-game {
  display: grid; grid-template-columns: minmax(110px, 1fr) minmax(220px, 1.4fr) repeat(3, minmax(90px, .8fr)); gap: 10px 12px; align-items: end;
  padding: 12px 14px; border-radius: 12px; background: var(--well); border: 1px solid var(--line-soft);
}
.adm-game .field { margin: 0; }
.adm-game .field.dim { opacity: .45; }
.adm-game-name { align-self: center; font-size: 16px; }
.field input[type=number] { min-width: 0; }

@media (max-width: 900px) {
  .adm-game { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .adm-game-name, .adm-game .seg-row { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .pt-balance { font-size: 34px; }
  .pt-code-row b { font-size: 22px; }
  .pkg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adm-tabs { max-width: none; }
  .adm-row { grid-template-columns: minmax(0, 1fr) auto; }
  .adm-acts { grid-column: 1 / -1; justify-content: stretch; }
  .adm-acts .btn { flex: 1; }
  .adm-game { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adm-game .field:nth-of-type(1) { grid-column: 1 / -1; }
}

/* 시작 모달 — 정산 정보 */
.sm-sumwrap { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sm-points { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 13px; color: var(--text-2); }
.sm-points:empty { display: none; }
.sm-bal b { font-size: 15px; color: var(--draw); }
.sm-short { color: var(--danger); }
.sm-actions .btn:disabled { opacity: .45; cursor: not-allowed; }

/* 결과 화면 — 포인트 */
.res-points {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px;
  padding: 14px 28px; border-top: 1px solid var(--line); background: var(--well);
}
.res-pt-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.res-pt-main b { font-size: 26px; color: var(--text-2); }
.res-pt-main b.up { color: var(--draw); }
.res-pt-main b.down { color: var(--lose); }
.res-pt-bal { display: flex; align-items: baseline; gap: 10px; }
.res-pt-bal b { font-size: 22px; color: var(--text-strong); }
@media (max-width: 560px) {
  .res-points { padding: 12px 16px; }
}

/* ---------- 랭킹 (#/ranking) ---------- */
.rk-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.rk-tabs .chip, .rk-chips .chip { min-height: 44px; }
.rk-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rk-chips[hidden] { display: none; }
.rk-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rk-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .02); }
.rk-row.top { border-color: #59626f; background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02)); }
.rk-row.me { border-color: var(--draw); box-shadow: 0 0 0 1px var(--draw) inset; }
.rk-no { font-family: 'Rajdhani', sans-serif; font-size: 22px; font-weight: 700; text-align: center; color: var(--text-2); }
.rk-row.top .rk-no { font-size: 28px; }
.rk-who { min-width: 0; display: flex; flex-direction: column; }
.rk-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-row.me .rk-name { color: var(--draw); }
.rk-sub { font-size: 12px; color: var(--text-2); }
.rk-val { font-family: 'Rajdhani', sans-serif; font-size: 22px; font-weight: 700; text-align: right; white-space: nowrap; }
.rk-row.top .rk-val { font-size: 26px; }
.rk-note { margin: 12px 0 0; }
@media (max-width: 560px) { .rk-row { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 8px; padding: 8px 10px; } }

/* ---------- 관리자: 경기 기록 · 정지 · 로컬 모드 배지 ---------- */
.adm-badge.adm-bad { color: #0d0f12; background: var(--danger); }
.adm-filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 6px 0; }
.adm-filter .adm-search { margin: 0; flex: 1 1 220px; }
.adm-filter select {
  min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--text);
  background: var(--steel-btn); border: 1px solid var(--line-strong); font: inherit;
}
.adm-check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.adm-check input { width: 20px; height: 20px; }
.adm-table-wrap { overflow-x: auto; max-width: 100%; margin-top: 8px; }
.adm-table { width: 100%; min-width: 640px; border-collapse: collapse; text-align: left; }
.adm-table th, .adm-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.adm-table th { color: var(--text-2); font-weight: 500; font-size: 12px; }
.adm-table tr.voided td { opacity: .5; text-decoration: line-through; }
.adm-table tr.voided td:last-child, .adm-table tr.voided td:nth-child(6) { text-decoration: none; }
.local-badge {
  position: fixed; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 50;
  padding: 4px 12px; border-radius: 999px; font-size: 12px; pointer-events: none;
  color: var(--danger); background: var(--steel-btn); border: 1px solid var(--line-strong);
}

/* ---------- 비밀번호 변경 · 임시 비밀번호 ---------- */
.pw-form { display: grid; gap: 0; max-width: 420px; }
.pw-form .field input { min-height: 44px; }
.pw-form .btn { min-height: 44px; justify-self: start; }
.temp-pw {
  display: block; margin: 14px 0 6px; padding: 14px; text-align: center; user-select: all;
  font-size: 26px; letter-spacing: .08em; color: var(--text); word-break: break-all;
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: 10px;
}
@media (max-width: 560px) { .pw-form { max-width: none; } .temp-pw { font-size: 20px; } }

/* ================= 온라인 대전 (대기실 · 채팅 · 연결 상태 · 공개 방 목록) ================= */
.conn-badge {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--raised); color: var(--draw); font-size: 13px; font-weight: 500;
}
.conn-badge[hidden] { display: none; }
.conn-badge.lost { color: var(--danger); border-color: var(--danger); }

.lobby { display: flex; flex-direction: column; gap: 14px; max-width: 760px; width: 100%; margin: 0 auto; padding: 8px 0; min-width: 0; }
.lobby-head, .lobby-seats { border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.lobby-head p { margin: 0; }
.lobby-code-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.lobby-code { font-size: 44px; letter-spacing: .14em; line-height: 1.1; user-select: all; }
.lobby-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lb-seat {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 56px; padding: 8px 12px;
  border-radius: 12px; border: 1px solid var(--line-soft); background: var(--well);
}
.lb-seat.open { border-style: dashed; }
.lb-no { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--raised); border: 1px solid var(--line-strong); font-size: 15px; }
.lb-who { display: flex; flex-direction: column; gap: 2px; flex: 1 1 140px; min-width: 0; }
.lb-who b { overflow-wrap: anywhere; font-weight: 500; }
.lb-tag { font-size: 11px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--draw); color: var(--draw); font-weight: 700; }
.lb-off { color: var(--danger); font-weight: 700; }
.lb-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.lb-acts .btn { min-height: 44px; }
.lobby-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lobby-actions .btn[disabled] { opacity: .45; cursor: not-allowed; }
.lobby-hint { margin: 0; }
.queue-card { max-width: 520px; margin: 40px auto; }

/* 채팅 패널 */
.chat-panel { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; padding: 0; background: none; border: 0; color: inherit; cursor: default; text-align: left; }
.chat-chev { margin-left: auto; display: none; transform: rotate(-90deg); transition: transform .15s; }
.chat-unread { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--draw); color: #0d0f12; font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.chat-unread[hidden] { display: none; }
.chat-body { display: flex; flex-direction: column; gap: 8px; flex: 1 1 0; min-height: 0; }
.chat-log { list-style: none; margin: 0; padding: 0; flex: 1; min-height: 90px; overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.chat-log li { font-size: 13px; line-height: 1.5; color: #b4bcc6; overflow-wrap: anywhere; }
.chat-log li b { color: var(--text); }
.chat-log .chat-emote { color: var(--draw); font-weight: 700; }
.chat-report { font-size: 12px; min-height: 28px; margin-left: 6px; color: var(--placeholder); font-weight: 500; }
.online-emotes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.online-emotes .emote { min-height: 40px; padding: 0 4px; }
.play-side.online .side-custom { flex: none; }

/* 공개 방 목록 · 초대 코드 입력 (시작 설정 모달) */
.join-code { height: 52px; font-size: 26px; letter-spacing: .3em; text-align: center; text-transform: uppercase; flex: none; }
.open-rooms { display: grid; gap: 8px; max-height: 190px; overflow: auto; }
.room-opt {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; text-align: left; min-height: 56px; padding: 8px 12px;
  border-radius: 12px; border: 1px solid var(--line-strong); background: var(--raised); color: var(--text); cursor: pointer; font: inherit;
}
.room-opt:hover { border-color: var(--line-hover); }
.room-opt .small { grid-column: 1; }
.room-opt .room-code { grid-row: 1 / span 2; grid-column: 2; font-size: 18px; letter-spacing: .1em; color: var(--chrome-hi); }

@media (max-width: 560px) {
  .lobby-code { font-size: 34px; }
  .lobby-head, .lobby-seats { padding: 14px; }
  .lb-acts { width: 100%; }
  .lb-acts .btn { flex: 1 1 auto; }
  .conn-badge { font-size: 12px; white-space: normal; border-radius: 12px; padding: 6px 10px; }
  .chat-head { cursor: pointer; min-height: 44px; }
  .chat-chev { display: inline-flex; }
  .chat-panel.collapsed .chat-body { display: none; }
  .chat-panel.collapsed .chat-chev { transform: rotate(90deg); }
  .chat-panel:not(.collapsed) .chat-log { max-height: 180px; }
}

/* 관리자 포인트 조정: 빠른 증감 버튼 */
.adj-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: -4px 0 10px; }
.adj-quick .btn { min-height: 44px; padding-inline: 6px; }
.adj-preview { margin: 0 0 8px; min-height: 1.4em; }
