/* 패 파인더 — 옻칠·금박 스타일 / 새 레이아웃
   로비: 상단 플레이어 칩·설정 기어 → 제목 → 규칙 카드(탭) → 가로 플레이 버튼 두 줄 → 랭킹 스트립 → 배너·버전(자리 고정)
   게임: 위 나가기·규칙 칩 (멀티는 상대 4인) / 가운데 판 / 아래 시간 막대 + 독(SCORE·힌트·LEFT)
   랭킹: 포디움(1~3위) + 4위부터 목록, 내 순위는 아래 고정 바 / 설정: 카드 격자 / 팝업: 아래에서 올라오는 시트 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --ink: #120c09;
  --glass: rgba(18, 12, 9, 0.66);
  --glass-2: rgba(36, 24, 17, 0.72);
  --glass-3: rgba(58, 40, 28, 0.6);
  --line: rgba(230, 196, 122, 0.28);
  --line-hi: rgba(230, 196, 122, 0.55);

  --gold: #e6c47a;
  --gold-hi: #f8e3ad;
  --gold-lo: #b8923f;
  --gold-ink: #2a1a0c;
  --text: #f4ead7;
  --text-dim: rgba(244, 234, 215, 0.55);

  --red: #b23a2e;    --red-hi: #d95441;   --red-ink: #ffefdc;
  --jade: #2d8a77;   --jade-hi: #48b39a;  --jade-ink: #eafff8;
  --stone: #3b312c;  --stone-hi: #574840; --stone-ink: #e9dcc7;

  --col: 420px;        /* 세로 화면 기준 내용 폭 */
  --safe-top: max(env(safe-area-inset-top), 10px);
  --safe-bottom: max(env(safe-area-inset-bottom), 10px);
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--text);
  font-family: "Avenir Next", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  user-select: none;
  -webkit-user-select: none;
  /* none으로 두면 자손(랭킹 목록)의 터치 스크롤까지 막힌다 — 판(canvas)만 따로 none */
  touch-action: manipulation;
  -webkit-touch-callout: none;
}
/* iOS 사파리 더블탭 확대 금지 — touch-action은 상속되지 않으므로 모든 요소에 건다 (판·랭킹 목록만 none) */
* { touch-action: manipulation; }
button, input { font-family: inherit; }
canvas { touch-action: none; }
.hidden { display: none !important; }

/* 화면 전환 — 디졸브 */
.screen { transition: opacity 0.28s ease; }
.screen.dissolve { opacity: 0; pointer-events: none; }
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--safe-top) 18px var(--safe-bottom);
  background: var(--ink);
}

/* ---------- 규칙별 배경 그림 (0.5초 크로스페이드, 위아래 어두운 막) ---------- */
.screen.bg-rule::before,
.screen.bg-rule::after {
  content: "";
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  transition: opacity 0.5s ease;
  z-index: 0;
  pointer-events: none;
}
.screen.bg-rule::before {
  background-image:
    linear-gradient(180deg, rgba(10, 6, 4, 0.72) 0%, rgba(10, 6, 4, 0.5) 35%, rgba(10, 6, 4, 0.55) 70%, rgba(10, 6, 4, 0.82) 100%),
    url("Assets/Image/bg_sichuan.jpg");
  opacity: 0;
}
.screen.bg-rule::after {
  background-image:
    linear-gradient(180deg, rgba(10, 6, 4, 0.72) 0%, rgba(10, 6, 4, 0.5) 35%, rgba(10, 6, 4, 0.55) 70%, rgba(10, 6, 4, 0.82) 100%),
    url("Assets/Image/bg_shanghai.jpg");
  opacity: 0;
}
body[data-rule="sichuan"] .screen.bg-rule::before { opacity: 1; }
body[data-rule="shanghai"] .screen.bg-rule::after { opacity: 1; }
.screen.bg-rule > * { z-index: 1; }
#screen-game::before, #screen-game::after { filter: saturate(0.9); }

/* ---------- 공통 조각 ---------- */
.glassy {
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* 상단 줄 — 왼쪽/가운데/오른쪽 */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: var(--col);
  min-height: 44px;
  flex: none;
}
.topbar .screen-title { flex: 1; text-align: center; }
.topbar-spacer { width: 40px; flex: none; }

/* 둥근 아이콘 버튼 (기어 · 뒤로 · 나가기) */
.icon-btn {
  flex: none;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--glass);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--gold);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.icon-btn:active { background: var(--glass-3); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }

.screen-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--gold-hi);
  text-shadow: 0 2px 0 rgba(60, 30, 5, 0.8), 0 6px 16px rgba(0, 0, 0, 0.6);
}

/* 금박 제목 */
.brand-logo {
  font-size: 46px;
  font-weight: 800;
  letter-spacing: 6px;
  color: var(--gold);
  background: linear-gradient(180deg, #fff2c8 0%, #f0cf7f 45%, #c99a3f 60%, #f3d98e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 rgba(60, 30, 5, 0.9)) drop-shadow(0 8px 18px rgba(0, 0, 0, 0.6));
}
.brand-logo span { margin-left: 8px; }
.brand-sub {
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: 6px;
  color: var(--gold);
  opacity: 0.7;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}
.brand-sub::before, .brand-sub::after {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  margin: 0 10px;
  vertical-align: middle;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* 넓은 버튼 · 작은 버튼 */
.btn-wide {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 12px 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 3px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.06s ease, filter 0.15s ease;
}
.btn-wide:active { transform: scale(0.98); filter: brightness(0.92); }
.btn-wide:disabled { background: var(--stone); color: var(--text-dim); box-shadow: none; border-color: transparent; pointer-events: none; }
.btn-gold  { background: linear-gradient(180deg, var(--gold-hi), var(--gold) 60%, var(--gold-lo)); color: var(--gold-ink); }
.btn-stone { background: linear-gradient(180deg, var(--stone-hi), var(--stone)); color: var(--stone-ink); }

.btn-small {
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.btn-small:active { filter: brightness(0.92); transform: scale(0.98); }
.btn-small-pink { background: linear-gradient(180deg, var(--red-hi), var(--red)); color: var(--red-ink); }
.btn-small-sky  { background: linear-gradient(180deg, var(--jade-hi), var(--jade)); color: var(--jade-ink); }
.btn-small-mint { background: linear-gradient(180deg, var(--gold-hi), var(--gold) 60%, var(--gold-lo)); color: var(--gold-ink); }
.btn-small-gray { background: linear-gradient(180deg, var(--stone-hi), var(--stone)); color: var(--stone-ink); }

/* ---------- 닉네임 화면 ---------- */
#screen-nickname { justify-content: flex-start; }
.nick-hero {
  flex: 0 0 42%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 28px;
  text-align: center;
}
.nick-card {
  width: 100%;
  max-width: var(--col);
  padding: 22px 20px 20px;
  border-radius: 20px;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.nick-card label { font-size: 12px; letter-spacing: 3px; color: var(--text-dim); text-align: center; }
.nick-field { position: relative; width: 100%; }
.nick-card input {
  width: 100%;
  padding: 14px 16px;
  font-size: 18px;
  text-align: center;
  letter-spacing: 3px;
  color: var(--gold-hi);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
}
.nick-card input::placeholder { color: rgba(244, 234, 215, 0.25); opacity: 1; letter-spacing: 4px; }
.nick-card input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(230, 196, 122, 0.18); }
.nick-ghost {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
  font-size: 18px;
  letter-spacing: 3px;
  color: var(--gold-hi);
  background: rgba(18, 12, 9, 0.95);
  border: 1px solid var(--gold);
  border-radius: 12px;
  cursor: text;
}
.nick-ghost .suffix { color: var(--text-dim); }

/* ---------- 로비 ---------- */
#screen-lobby { justify-content: flex-start; gap: 14px; padding-bottom: 130px; } /* 아래 배너 묶음 자리 */

.player-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px 0 4px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  flex: 1;
  min-width: 0;
  max-width: 260px;
}
.avatar {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--gold-ink);
  background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.chip-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 800; letter-spacing: 1px; color: var(--gold-hi); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-out {
  flex: none;
  padding: 4px 9px;
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  cursor: pointer;
}
.chip-out:active { color: var(--gold); }
.topbar > .icon-btn:last-child { margin-left: auto; }

/* 제목~랭킹 스트립 묶음은 상단 줄과 배너 사이 가운데에 놓인다 */
.lobby-title { text-align: center; margin-top: auto; }
#screen-lobby .rank-strip { margin-bottom: auto; }
.lobby-title .brand-logo { font-size: 42px; }

/* 규칙 카드 — 탭이 카드 위에 붙어 있고, 카드 안에 이름·설명·수치 */
.rule-card {
  width: 100%;
  max-width: var(--col);
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--line-hi);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.rule-switch {
  position: relative;
  display: flex;
  padding: 4px;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid var(--line);
}
.rule-switch .rule-opt {
  position: relative;
  z-index: 1;
  flex: 1;
  padding: 11px 0;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.25s ease;
}
.rule-switch .rule-opt.active { color: var(--gold-ink); }
.rule-switch .rule-knob {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 10px;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-lo));
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: transform 0.25s cubic-bezier(0.4, 1.4, 0.6, 1);
}
body[data-rule="shanghai"] .rule-switch .rule-knob { transform: translateX(100%); }
.rule-body { padding: 16px 18px 18px; }
.rule-name {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 6px;
  color: var(--gold-hi);
  text-shadow: 0 2px 0 rgba(60, 30, 5, 0.8), 0 6px 16px rgba(0, 0, 0, 0.6);
}
.rule-desc { margin-top: 6px; font-size: 13.5px; line-height: 1.5; color: var(--text); }
.rule-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.rule-meta span {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--gold);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.3);
}

/* 플레이 버튼 — 가로 두 줄 */
.play-list { width: 100%; max-width: var(--col); display: flex; flex-direction: column; gap: 10px; }
.play-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  padding: 10px 16px 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: transform 0.06s ease, filter 0.15s ease;
}
.play-btn:active { transform: scale(0.985); filter: brightness(0.92); }
.play-icon {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 230, 170, 0.4);
}
.play-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.play-text b { font-size: 16px; letter-spacing: 1px; }
.play-text small { font-size: 12px; opacity: 0.82; letter-spacing: 0.5px; }
.play-arrow { flex: none; font-size: 26px; line-height: 1; opacity: 0.7; }
.play-solo { background: linear-gradient(120deg, #d9553f 0%, #b23a2e 55%, #8c261f 100%); color: #ffe9c8; }
.play-solo b { color: #ffe1a3; }
.play-multi { background: linear-gradient(120deg, #4bb79c 0%, #2d8a77 55%, #1f655a 100%); color: #e8fff8; }
.play-multi b { color: #dffff2; }

/* 랭킹 스트립 — 상위 3명 */
.rank-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: var(--col);
  min-height: 48px;
  padding: 6px 12px 6px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--glass);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.rank-strip:active { background: var(--glass-3); }
.strip-head { flex: none; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; letter-spacing: 1px; color: var(--gold-hi); }
.strip-head .crown { font-size: 14px; }
.strip-top { flex: 1; min-width: 0; display: flex; gap: 6px; overflow: hidden; }
.strip-top .top {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
}
.strip-top .top i { font-style: normal; font-weight: 800; }
.strip-top .top:nth-child(1) i { color: #ffd76a; }
.strip-top .top:nth-child(2) i { color: #d9dde3; }
.strip-top .top:nth-child(3) i { color: #e0a070; }
.strip-top .top b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--text); }
.strip-top .top em { font-style: normal; color: var(--gold); white-space: nowrap; }
.strip-top .empty { font-size: 11px; color: var(--text-dim); align-self: center; }
.strip-arrow { flex: none; font-size: 22px; line-height: 1; color: var(--gold); opacity: 0.7; }

/* ---------- 로비 하단 (배너 + 버전/저작권) — 자리 그대로 ---------- */
.lobby-bottom {
  position: absolute;
  left: 50%;
  bottom: 15px;
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: var(--col);
}
#game-banner { z-index: 16; }
.app-banner {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: var(--col);
}
.banner-track {
  position: relative;
  width: 100%;
  aspect-ratio: 1024 / 163;
  overflow: hidden;
  border-radius: 12px;
  background: var(--glass-2);
}
.banner-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
}
.banner-slide.current { transform: translateY(0); }
.banner-slide.leaving { transform: translateY(-100%); }
.copyright {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  margin-top: 10px;
  text-align: center;
  font-size: 11px;
  line-height: 1.35;
  color: rgba(244, 234, 215, 0.45);
  letter-spacing: 0.02em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* ---------- 토스트 ---------- */
.toast {
  position: fixed;
  left: 50%;
  top: 18%;
  transform: translateX(-50%);
  padding: 12px 22px;
  background: rgba(22, 14, 10, 0.95);
  border: 1px solid var(--line-hi);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--gold-hi);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 40;
  white-space: nowrap;
}
.toast.show { opacity: 1; }

/* ---------- 시트 팝업 — 아래에서 올라온다 ---------- */
.match-popup {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(6, 3, 2, 0.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 20;
  animation: popup-fade 0.15s ease-out both;
}
@keyframes popup-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.match-box {
  animation: sheet-up 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.1) both;
  width: 100%;
  max-width: 480px;
  padding: 10px 24px calc(var(--safe-bottom) + 18px);
  text-align: center;
  background: linear-gradient(180deg, rgba(40, 27, 19, 0.98), rgba(22, 14, 10, 0.99));
  border: 1px solid var(--line-hi);
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -16px 50px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: var(--text);
}
.sheet-grip {
  width: 44px;
  height: 4px;
  margin: 0 auto 16px;
  border-radius: 999px;
  background: var(--line-hi);
}
.match-title { font-size: 22px; font-weight: 800; letter-spacing: 4px; color: var(--gold-hi); }
.match-title span { display: inline-block; width: 1.6em; text-align: left; }
.match-sub { margin-top: 10px; font-size: 12px; letter-spacing: 1px; color: var(--text-dim); }
.match-cancel { width: 100%; margin-top: 22px; }
.signoff-msg { white-space: pre-line; font-size: 14px; line-height: 1.7; color: var(--text); letter-spacing: 0.5px; }
.signoff-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 22px; }
#signoff-cancel { grid-column: 1 / -1; }
.exit-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 22px; }
.signoff-nick { color: var(--gold-hi); }
.match-box.guide-box { text-align: left; }
.guide-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--gold-hi);
  text-align: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.guide-list { margin: 0 0 4px 18px; }
.guide-list li { font-size: 13.5px; line-height: 1.7; margin-bottom: 8px; color: var(--text); }
.guide-list li::marker { color: var(--gold); }
.guide-list b { color: var(--gold-hi); }
.guide-close { width: 100%; margin-top: 12px; }

/* ---------- 랭킹 화면 ---------- */
#screen-ranking { justify-content: flex-start; gap: 12px; padding-bottom: 95px; }
#screen-ranking .topbar .screen-title { flex: none; }
#screen-ranking .topbar .rule-switch { margin-left: auto; }
.rule-switch.small {
  flex: none;
  width: 150px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}
.rule-switch.small .rule-opt { padding: 7px 0; font-size: 11px; letter-spacing: 2px; }
.rule-switch.small .rule-knob { top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 999px; }

/* 탭 — 밑줄형, 오른쪽 끝에 초기화 안내 */
.rank-tabs {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  width: 100%;
  max-width: var(--col);
  border-bottom: 1px solid var(--line);
}
.rank-tab {
  padding: 8px 14px 10px;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  cursor: pointer;
}
.rank-tab.active { color: var(--gold-hi); border-bottom-color: var(--gold); }
.rank-info { margin-left: auto; padding-bottom: 10px; font-size: 10px; letter-spacing: 1px; color: var(--text-dim); white-space: nowrap; }
.rank-remain { color: var(--gold); }

/* 포디움 — 2위 · 1위 · 3위 */
.rank-podium {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  align-items: end;
  gap: 8px;
  width: 100%;
  max-width: var(--col);
  flex: none;
}
.rank-podium:empty { display: none; }
.podium {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px 12px;
  border-radius: 14px 14px 6px 6px;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: rank-flip 0.32s ease-out backwards;
  transform-origin: center bottom;
  min-width: 0;
}
.podium .medal { font-size: 18px; line-height: 1; }
.podium .rk { font-size: 11px; font-weight: 800; letter-spacing: 1px; color: var(--text-dim); }
.podium .nm { max-width: 100%; font-size: 12px; font-weight: 800; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .val { font-size: 14px; font-weight: 800; color: var(--gold); white-space: nowrap; }
.podium .sub { font-size: 10px; color: var(--text-dim); }
.podium.p1 { padding-top: 16px; padding-bottom: 18px; border-color: var(--line-hi); background: linear-gradient(180deg, rgba(230, 196, 122, 0.22), var(--glass)); }
.podium.p1 .medal { font-size: 24px; }
.podium.p1 .nm { color: var(--gold-hi); font-size: 13px; }
.podium.p2 { padding-bottom: 14px; }
.podium.me { box-shadow: 0 0 0 1px var(--gold) inset; }

.rank-list {
  width: 100%;
  max-width: var(--col);
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--glass);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  -webkit-overflow-scrolling: touch;
  touch-action: none; /* 스크롤은 app.js가 포인터로 직접 처리한다 (손가락·마우스 드래그 모두) */
  overscroll-behavior: contain;
  cursor: grab;
}
.rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(230, 196, 122, 0.1);
  font-size: 14px;
  transform-origin: center center;
  animation: rank-flip 0.32s ease-out backwards;
}
@keyframes rank-flip {
  from { opacity: 0; transform: scaleY(0); }
  to   { opacity: 1; transform: scaleY(1); }
}
.rank-row .rk { width: 30px; text-align: right; font-weight: 800; color: var(--text-dim); }
.rank-row .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .val { font-weight: 800; letter-spacing: 1px; flex: none; min-width: 3.6em; text-align: right; color: var(--gold); }
.rank-row .val.pt, .rank-me .val.pt { text-align: center; }
.rank-row .sub { font-size: 11px; color: var(--text-dim); margin-left: 6px; flex: none; width: 48px; text-align: right; white-space: nowrap; }
.rank-row.me { background: rgba(230, 196, 122, 0.14); }
.rank-row.me .nm { color: var(--gold-hi); font-weight: 800; }
.rank-empty { padding: 32px 16px; text-align: center; font-size: 13px; color: var(--text-dim); letter-spacing: 1px; line-height: 1.7; }

/* 내 순위 — 목록 아래 고정 금판 */
.rank-me {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  width: 100%;
  max-width: var(--col);
  padding: 12px 14px;
  font-size: 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 60%, var(--gold-lo));
  color: var(--gold-ink);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.rank-me .rk { width: 30px; text-align: right; font-weight: 800; }
.rank-me .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.rank-me .val { font-weight: 800; letter-spacing: 1px; flex: none; min-width: 3.6em; text-align: right; }
.rank-me .sub { font-size: 11px; opacity: 0.75; margin-left: 6px; flex: none; width: 48px; text-align: right; white-space: nowrap; }

/* ---------- 설정 — 카드 격자 ---------- */
#screen-config { justify-content: flex-start; gap: 16px; padding-bottom: 95px; }
.config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  max-width: var(--col);
}
.config-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.config-card.wide { grid-column: 1 / -1; flex-direction: row; align-items: center; }
.config-card.wide .cfg-label { flex: 1; }
.cfg-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 800;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
}
.cfg-label { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; font-weight: 700; letter-spacing: 0.5px; color: var(--text); }
.cfg-label small { font-size: 10.5px; font-weight: 500; color: var(--text-dim); letter-spacing: 1px; }
.config-card .toggle { align-self: stretch; }
.toggle {
  min-width: 72px;
  padding: 10px 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  cursor: pointer;
  background: linear-gradient(180deg, var(--stone-hi), var(--stone));
  color: var(--text-dim);
}
.toggle.on { background: linear-gradient(180deg, var(--jade-hi), var(--jade)); color: var(--jade-ink); box-shadow: 0 0 14px rgba(72, 179, 154, 0.35); }
.toggle.outline { background: transparent; border: 1px solid var(--gold); color: var(--gold); }
.toggle.outline:active { background: rgba(230, 196, 122, 0.15); }

/* ---------- 광고 화면 ---------- */
#screen-ad { padding: 0; justify-content: center; background: #0c0806; }
.ad-text { font-size: 30pt; font-weight: 800; letter-spacing: 8px; color: var(--text-dim); }
.ad-top { position: absolute; top: 30px; left: 14px; height: 40px; display: flex; align-items: center; gap: 10px; }
.ad-count { font-size: 13px; letter-spacing: 1px; color: var(--text-dim); }

/* ---------- 게임 화면 ---------- */
#screen-game { justify-content: flex-start; gap: 8px; padding-left: 10px; padding-right: 10px; }

.game-top { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 480px; flex: none; }
.game-chip {
  flex: 1;
  text-align: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--gold-hi);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.net-lost-cover { position: absolute; inset: 0; background: rgba(6, 3, 2, 0.6); z-index: 14; }

/* 멀티 — 상대 4인 (윗줄 아래) */
.multi-view {
  display: flex;
  gap: 4px;
  width: 100%;
  max-width: 480px;
  height: 13vh;
  min-height: 70px;
  max-height: 120px;
  flex: none;
  transition: opacity 0.3s ease;
}
.multi-view.veiled { opacity: 0; }
.rival {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 10px;
  background: var(--glass);
  border: 1px solid var(--line);
  overflow: hidden;
  padding: 3px;
}
.rival canvas { flex: 1; min-height: 0; display: block; }
/* 상대 남은 시간 — 미니 보드와 이름 줄 사이의 가는 선. 내 시간 막대와 같은 색 규칙 */
.rival-time {
  flex: none;
  width: calc(100% - 4px);
  height: 3px;
  margin: 2px 0 1px;
  border-radius: 999px;
  background: rgba(10, 6, 4, 0.7);
  overflow: hidden;
}
.rival-time-fill {
  width: 100%;
  height: 100%;
  transform-origin: left center;
  background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi));
  transition: transform 0.25s linear, background 0.4s ease;
}
.rival-time.warn .rival-time-fill { background: linear-gradient(90deg, #d9702a, #ffb35c); }
.rival-time.danger .rival-time-fill { background: linear-gradient(90deg, #b3261e, #ff6a5a); animation: time-pulse 0.7s ease-in-out infinite; }
.rival.dead .rival-time { visibility: hidden; }
.rival-info { display: flex; align-items: baseline; gap: 3px; width: 100%; padding: 1px 2px 0; }
.rival-name { flex: 1; min-width: 0; font-size: 8px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rival-score { flex: none; font-size: 10px; font-weight: 800; color: var(--gold-hi); }
/* 끝난 상대 위에 뜨는 등수 배지 — 금판 원, 튀어나오며 나타난다 */
.rival-rank {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  min-width: 52px;
  padding: 5px 10px;
  border-radius: 8px; /* 모서리만 둥근 직사각형 */
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 60%, var(--gold-lo));
  border: 1px solid rgba(255, 245, 210, 0.7);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  color: var(--gold-ink);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 1px;
  text-align: center;
  white-space: nowrap;
  z-index: 2;
  animation: badge-pop 0.35s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}
.rival-rank small { display: block; font-size: 8px; font-weight: 700; letter-spacing: 1px; opacity: 0.8; }
/* 클리어 — 가장자리 네온이 숨쉬듯 부드럽게 점멸한다.
   box-shadow를 직접 애니메이션하면 프레임마다 다시 그려 끊겨 보이므로, 네온을 ::after 층에 그려 두고
   불투명도만 움직인다 (합성만 하므로 매끄럽다). */
.rival-rank.clear { border-color: rgba(95, 216, 255, 0.9); }
.rival-rank.clear::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 10px;
  border: 2px solid rgba(95, 216, 255, 0.95);
  box-shadow: 0 0 6px rgba(95, 216, 255, 0.9), 0 0 16px rgba(95, 216, 255, 0.8), 0 0 30px rgba(95, 216, 255, 0.5), inset 0 0 8px rgba(95, 216, 255, 0.5);
  pointer-events: none;
  will-change: opacity;
  animation: neon-breathe 2.4s ease-in-out infinite;
}
@keyframes neon-breathe {
  0%, 100% { opacity: 0.15; }
  50%      { opacity: 1; }
}
/* 1등 확정 — 옻칠 붉은 판에 금 테두리, 왕관, 금빛 광채가 빙글빙글 돈다 */
.rival-rank.first {
  min-width: 64px;
  padding: 6px 10px 5px;
  color: #fff3d0;
  background: linear-gradient(160deg, #e0644d 0%, #b23a2e 55%, #7f1f18 100%);
  border: 1px solid #ffe08a;
  text-shadow: 0 1px 0 rgba(60, 10, 5, 0.9), 0 0 8px rgba(255, 220, 120, 0.5);
  animation: badge-pop 0.35s cubic-bezier(0.3, 1.6, 0.5, 1) both, first-glow 1.6s ease-in-out 0.35s infinite;
}
.rival-rank.first small { color: #ffe08a; opacity: 1; }
.rival-rank.first .crown {
  display: block;
  font-size: 15px;
  line-height: 1;
  margin: -14px auto 1px; /* 배지 위로 살짝 올라앉는다 */
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6));
  animation: crown-bob 1.6s ease-in-out infinite;
}
.rival-rank.first::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 11px;
  padding: 2px;
  background: conic-gradient(from var(--hint-spin), rgba(255, 225, 140, 0) 0deg, #ffe08a 60deg, rgba(255, 225, 140, 0) 120deg, rgba(255, 225, 140, 0) 180deg, #ffe08a 240deg, rgba(255, 225, 140, 0) 300deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: hint-spin 2s linear infinite;
  pointer-events: none;
}
@keyframes first-glow {
  0%, 100% { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6), 0 0 10px rgba(255, 200, 90, 0.45); }
  50%      { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6), 0 0 22px rgba(255, 200, 90, 0.95), 0 0 40px rgba(255, 160, 60, 0.5); }
}
@keyframes crown-bob {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50%      { transform: translateY(-2px) rotate(6deg); }
}
@keyframes badge-pop {
  from { transform: translate(-50%, -50%) scale(0.3); opacity: 0; }
  to   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
.rival.dead { background: rgba(6, 3, 2, 0.75); border-color: rgba(255, 255, 255, 0.06); }
.rival.dead canvas { filter: grayscale(1) brightness(0.6) opacity(0.5); }
.rival.dead .rival-name, .rival.dead .rival-score { color: var(--text-dim); }

/* 판 */
.board-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.board-area { flex: 1; min-width: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
#board-canvas {
  display: block;
  border-radius: 14px;
  background: rgba(12, 8, 6, 0.52);
  box-shadow: 0 0 0 1px var(--line), 0 12px 36px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 0;
}

/* 남은 시간 — 가로 막대, 독 바로 위 */
.time-col {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 480px;
  flex: none;
  padding: 0 4px;
}
.time-bar {
  position: relative;
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: rgba(10, 6, 4, 0.7);
  border: 1px solid var(--line);
  overflow: hidden;
}
.time-fill {
  position: absolute;
  inset: 0;
  transform-origin: left center; /* 왼쪽에 고여 있고 오른쪽부터 줄어든다 */
  background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi));
  transition: transform 0.1s linear, background 0.4s ease;
}
.time-bar.warn .time-fill { background: linear-gradient(90deg, #d9702a, #ffb35c); }
.time-bar.danger .time-fill { background: linear-gradient(90deg, #b3261e, #ff6a5a); animation: time-pulse 0.7s ease-in-out infinite; }
.time-text { flex: none; min-width: 36px; text-align: right; font-size: 12px; font-weight: 800; letter-spacing: 1px; color: var(--gold-hi); text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8); }
.time-col.danger .time-text { color: #ff8d80; }
@keyframes time-pulse { 50% { opacity: 0.55; } }

/* 독 — SCORE · 힌트 · LEFT */
.game-dock {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 480px;
  flex: none;
  padding: 8px 18px;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}
.dock-cell { flex: 1; min-width: 0; }
.dock-cell.right { text-align: right; }
.hud-label { font-size: 9px; letter-spacing: 3px; color: var(--text-dim); }
.hud-value { font-size: 26px; font-weight: 800; letter-spacing: 1px; color: var(--gold-hi); line-height: 1.15; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6); }
.hud-value.dim { color: var(--text); font-size: 20px; }
.hint-btn {
  position: relative;
  flex: none;
  width: 66px;
  height: 66px;
  margin: -18px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border: 2px solid rgba(255, 245, 210, 0.5);
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 60%, var(--gold-lo));
  color: var(--gold-ink);
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.hint-word { font-size: 11px; font-weight: 800; letter-spacing: 2px; }
.hint-num { font-size: 18px; font-weight: 800; line-height: 1; }
.hint-btn:active { transform: scale(0.96); }
.hint-btn.off { background: var(--stone); color: var(--text-dim); box-shadow: none; border-color: rgba(255, 255, 255, 0.1); cursor: default; }

/* 판이 끝나면 독·시간 막대는 감추고(자리는 유지) 그 자리에 배너가 뜬다 */
#screen-game.ended .game-dock, #screen-game.ended .time-col { visibility: hidden; }

/* 콤보 글자 — 화면 위 가운데. 색·크기·흔들림은 app.js가 CSS 변수로 넣는다 */
#screen-game .combo-text { /* id 선택자로 .screen.bg-rule > * 의 z-index:1 을 이긴다 — 판보다 위 */
  position: absolute;
  left: 50%;
  top: 35%; /* 화면 위에서 35% 자리 */
  transform: translate(-50%, -50%);
  z-index: 13;
  pointer-events: none;
  font-size: var(--combo-size, 24px);
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--combo-color, #d8c060);
  text-shadow: 0 2px 0 rgba(40, 20, 5, 0.9), 0 0 12px var(--combo-glow, rgba(216, 192, 96, 0.5)), 0 8px 20px rgba(0, 0, 0, 0.7);
  white-space: nowrap;
  animation: combo-pop 1s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.combo-shake { display: inline-block; }
.combo-text.shaking .combo-shake { animation: combo-shake var(--shake-ms, 100ms) linear var(--shake-times, 1); }
@keyframes combo-pop {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  15%  { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  25%  { transform: translate(-50%, -50%) scale(1); }
  75%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -60%) scale(0.95); }
}
@keyframes combo-shake {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(var(--shake-px), calc(-1 * var(--shake-px))); }
  40%  { transform: translate(calc(-1 * var(--shake-px)), var(--shake-px)); }
  60%  { transform: translate(var(--shake-px), var(--shake-px)); }
  80%  { transform: translate(calc(-1 * var(--shake-px)), calc(-1 * var(--shake-px))); }
  100% { transform: translate(0, 0); }
}

/* 힌트 카드 날아가기 — 판 위 카드와 같은 생김새의 DOM 조각 */
.hint-fly {
  position: fixed;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14%;
  background: linear-gradient(180deg, #3a2416, #1a0f09);
  box-shadow: inset 0 0 0 2px #f0cf7f, inset 0 0 0 4px rgba(26, 15, 9, 1), inset 0 0 0 5px rgba(255, 230, 160, 0.8), 0 8px 20px rgba(0, 0, 0, 0.6);
  color: #f8e3ad;
  font-weight: 800;
  letter-spacing: 1px;
  text-shadow: 0 0 8px rgba(255, 210, 120, 0.8);
  pointer-events: none;
  transform-origin: center center;
}
/* 힌트 버튼 번쩍임 — 횟수가 늘 때 0.3초 하얗게 */
.hint-btn.flash { animation: hint-flash 0.3s ease-out both; }
@keyframes hint-flash {
  0%   { background: #fff; color: #fff; box-shadow: 0 0 24px rgba(255, 255, 255, 1), 0 0 48px rgba(255, 240, 200, 0.9); }
  100% { background: linear-gradient(180deg, var(--gold-hi), var(--gold) 60%, var(--gold-lo)); color: var(--gold-ink); }
}

/* 카운트다운 */
.count-banner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 78px;
  font-weight: 800;
  color: var(--gold-hi);
  text-shadow: 0 3px 0 rgba(90, 50, 10, 0.9), 0 12px 30px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  z-index: 12;
}
.count-banner .pop { animation: count-pop 0.9s ease-out both; }
@keyframes count-pop {
  0%   { opacity: 0; transform: scale(1.7); }
  22%  { opacity: 1; transform: scale(1); }
  75%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.82); }
}

/* 결과 오버레이 — 판 영역을 덮는 어두운 유리 */
.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 20px;
  border-radius: 14px;
  background: rgba(14, 9, 6, 0.9);
  border: 1px solid var(--line-hi);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10;
  animation: popup-fade 0.25s ease-out both;
}
.overlay-title { font-size: 38px; font-weight: 800; letter-spacing: 6px; color: var(--gold-hi); text-shadow: 0 3px 0 rgba(90, 50, 10, 0.9), 0 10px 24px rgba(0, 0, 0, 0.7); }
.overlay-sub { margin-top: 2px; margin-bottom: 14px; font-size: 13px; letter-spacing: 1px; color: var(--text-dim); text-align: center; line-height: 1.6; }
.overlay-sub b { color: var(--gold-hi); font-size: 20px; }
.overlay-rank { width: 100%; max-width: 300px; margin-bottom: 14px; }
.overlay-rank:empty { display: none; }
.orank-row {
  transform-origin: center center;
  animation: rank-flip 0.32s ease-out backwards;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  font-size: 13px;
  border-radius: 10px;
  margin-bottom: 4px;
  background: var(--glass-2);
  border: 1px solid rgba(230, 196, 122, 0.12);
}
.orank-row.me { background: linear-gradient(180deg, var(--gold-hi), var(--gold) 60%, var(--gold-lo)); color: var(--gold-ink); font-weight: 800; border-color: transparent; }
.orank-row .rk { width: 20px; font-weight: 800; color: var(--text-dim); }
.orank-row.me .rk { color: var(--gold-ink); }
.orank-row .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pts { font-weight: 900; white-space: nowrap; text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.7), 1px -1px 0 rgba(0, 0, 0, 0.7), -1px 1px 0 rgba(0, 0, 0, 0.7), 1px 1px 0 rgba(0, 0, 0, 0.7); }
.orank-row .pts { flex: none; min-width: 26px; text-align: right; }
.pts-1 { color: #ff6b5e; }
.pts-2 { color: #ffa54a; }
.pts-3 { color: #ffd84a; }
.overlay-sub .pts { font-size: 15px; }
.orank-row .val { font-weight: 800; flex: none; min-width: 2.2em; text-align: center; }
.orank-row .sub { font-size: 11px; color: var(--text-dim); flex: none; width: 66px; margin-right: -6px; white-space: nowrap; text-align: right; }
.orank-row.me .sub { color: var(--gold-ink); opacity: 0.7; }
.orank-row.playing { opacity: 0.6; }
.overlay-btns { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; width: 100%; max-width: 300px; }
.overlay-btns .btn-wide { min-height: 48px; font-size: 14px; }

/* 나가기 버튼 둘레를 도는 고리 — 멀티 도중 서버와 끊겼을 때 */
@property --hint-spin {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
.icon-btn.attention::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(from var(--hint-spin),
    #fff1b8 0deg, #ffd45e 30deg, #f0b429 70deg, #141414 120deg, #141414 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: hint-spin 1s linear infinite;
  pointer-events: none;
}
#btn-exit { position: relative; }
@keyframes hint-spin {
  from { --hint-spin: 0deg; }
  to   { --hint-spin: 360deg; }
}

@media (max-height: 700px) {
  .lobby-title .brand-logo { font-size: 36px; }
  .rule-body { padding: 12px 16px 14px; }
  .play-btn { min-height: 56px; }
}
