/* ===========================================================================
   드럼롤 추첨 - 스타일
   고르기 화면은 이마고 웹과 같은 문법(MOYO 웹 공통 기준). 1층 뼈대(간격 · 모서리 · 글자 · 그림자 · 움직임)는
   모든 제품이 같고, 포인트색 한 벌만 제품마다 바꾼다. 게임은 어두운 무대 위에서.
   - 글씨는 검정 하나로 조용하게. 색은 그림판(파스텔)과 작은 표시(고른 것 · 강조 둘째 줄)에만.
   - 주 버튼은 검은 캡슐, 보조는 테두리 캡슐. 그림자 · 그라데이션 버튼은 쓰지 않는다.
   - 두 줄 제목: 첫 줄은 기본색, 둘째 줄(고객이 얻는 것)은 강조색. 안내 글은 문장마다 줄을 바꾼다.
   - 움직임 곡선은 cubic-bezier(.16, 1, .3, 1). 움직이지 않을 때의 모습이 다 끝난 모습이다.
   =========================================================================== */
:root {
  /* 1층 뼈대 - 이마고와 같은 값 */
  --sp-xs: 4px; --sp-sm: 8px; --sp-md: 12px; --sp-lg: 16px; --sp-xl: 24px; --sp-2xl: 32px; --sp-3xl: 48px;
  --r-sm: 12px; --r-md: 14px; --r-card: 20px; --r-lg: 22px; --r-panel: 28px; --r-xl: 35px;
  --h-btn: 52px; --h-btn-lg: 56px; --h-btn-sm: 40px;
  --ease: cubic-bezier(.16, 1, .3, 1); --ease-tab: cubic-bezier(.4, 0, .2, 1);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, .031); --shadow-float: 0 12px 30px rgba(0, 0, 0, .078);
  --gut: 20px; --max: 1140px;
  /* 글자 · 면 */
  --ink: #111115; --ink-2: #2E2E34; --ink2: #4E4E55; --ink3: #6B6B73; --btn: #242428;
  --line: #E4E4E5; --warm: #F7F6F3; --paper: #F5F5F7; --tint2: #FFF7F3; --lav: #FDEEE8;
  /* 2층 포인트색 - 레크판과 같은 주황. 흰 바탕 글자 대비 4.5:1 을 넘게 로고 주황(#E8541A)보다 한 단계 짙게 */
  --accent: #C84816; --accent-ink: #86310F; --accent-tint: #FDEEE8; --accent-2: #E8541A; --accent-soft: #FDEEE8;
  /* 옛 이름 - 시트 · 무대가 같이 쓴다 */
  --grey-1: #F5F5F7; --grey-2: #ECECF0; --grey-3: #DCDCE2; --grey-4: #B4B4BE; --grey-5: #6B6B73;
  --gold: #FFC83D; --gold-2: #C78A00;
  --stage-bg: #080913; --stage-text: #F3F4FA; --stage-dim: #A3A8C6;
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Segoe UI', sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
@media (min-width: 768px) { :root { --gut: 32px; } }
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); color: var(--ink); background: #fff; overflow-x: clip;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent; word-break: keep-all; overflow-wrap: anywhere;
}
body.in-stage { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.acc { color: var(--accent); }
/* 나타나기: 처음에 화면 아래에 있던 덩어리에만 스크립트가 붙인다 */
.rv-h { opacity: 0; }
@media print { .rv-h { opacity: 1 !important; } }

/* ---------------------------------------------------------------- 머리 바 (이마고 상단 바: 64 · 흰 바탕 · 내려가면 아래 선) */
.topbar {
  position: sticky; top: 0; z-index: 10; height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 max(var(--gut), calc((100% - var(--max)) / 2));
  background: rgba(255, 255, 255, .94); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent; transition: border-color .35s ease;
}
html.scrolled .topbar { border-bottom-color: rgba(0, 0, 0, .06); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo { flex: none; display: block; width: 32px; height: 32px; border-radius: 9px; }
.brand-name { font-weight: 700; font-size: 19px; letter-spacing: -0.02em; white-space: nowrap; }
.brand-tag { margin-left: 6px; font-size: 15px; color: var(--ink3); white-space: nowrap; }
@media (max-width: 880px) { .brand-tag { display: none; } }

/* 머리 오른쪽: 소리 · 내 명단 · 언어 - 테두리 없는 알약(이마고 로그인 · 언어 단추) */
.top-right { display: flex; align-items: center; gap: 4px; flex: none; }
.top-snd, .acct-btn, .lang-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 12px;
  border: 0; border-radius: 999px; background: transparent; color: var(--ink);
  font-size: 15px; font-weight: 500; letter-spacing: -0.01em; white-space: nowrap; transition: background .15s, color .15s;
}
.top-snd:hover, .acct-btn:hover, .lang-btn:hover, .lang-btn[aria-expanded="true"] { background: rgba(0, 0, 0, .05); }
.top-snd { width: 38px; padding: 0; }
.top-snd svg { stroke-width: 1.8; }
.top-snd .ic-off { display: none; }
.top-snd.is-muted { color: var(--ink3); }
.top-snd.is-muted .ic-on { display: none; }
.top-snd.is-muted .ic-off { display: block; }
/* 소리가 막혀 있을 때: 단추에서 물결이 번지고, 「화면을 누르면 음악이 나와요」 말풍선이 잠깐 뜬다 */
.top-snd.wants { color: var(--accent); animation: snd-ring 1.8s ease-out infinite; }
@keyframes snd-ring { 0% { box-shadow: 0 0 0 0 rgba(200, 72, 22, .45); } 70%, 100% { box-shadow: 0 0 0 10px rgba(200, 72, 22, 0); } }
.snd-hint {
  position: absolute; top: calc(100% + 10px); right: -6px; z-index: 30; white-space: nowrap; pointer-events: none;
  padding: 9px 13px; border-radius: 12px; background: var(--btn); color: #fff; font-size: 13px; font-weight: 600;
  box-shadow: 0 10px 26px rgba(17, 17, 21, .2); animation: hint-in .4s var(--ease) both;
}
.snd-hint::before {
  content: ''; position: absolute; top: -5px; right: 20px; width: 11px; height: 11px; border-radius: 2px;
  background: var(--btn); transform: rotate(45deg);
}
@keyframes hint-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.acct-av { display: inline-grid; place-items: center; width: 20px; height: 20px; }
.acct-av svg { width: 18px; height: 18px; stroke-width: 1.9; }
.lang { position: relative; flex: none; }
.lang-btn svg { stroke-width: 1.7; }
.lang-menu {
  position: absolute; right: 0; top: 46px; z-index: 20; min-width: 160px; padding: 8px;
  background: #fff; border: 1px solid rgba(0, 0, 0, .06); border-radius: 20px; box-shadow: 0 18px 50px rgba(17, 17, 21, .14);
}
.lang-menu button { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: none; border-radius: 12px; font-size: 15px; }
.lang-menu button:hover { background: rgba(0, 0, 0, .04); }
.lang-menu button[aria-checked="true"] { font-weight: 700; color: var(--accent-ink); }
@media (max-width: 520px) { #langLabel { display: none; } .lang-btn { width: 38px; padding: 0; } .acct-btn { padding: 0 10px; } }
@media (max-width: 380px) {
  .topbar { gap: 6px; }
  .brand { gap: 8px; }
  .brand-logo { width: 30px; height: 30px; }
  .brand-name { font-size: 18px; }
  .top-right { gap: 2px; }
  .acct-btn { gap: 4px; padding: 0 8px; }
}

/* ---------------------------------------------------------------- 입장 화면(컴퓨터)
   브라우저는 누르기 전에 소리를 막는다. 마우스로 들어온 사람은 입장 화면에서 「시작하기」를 누르는 순간
   메인 테마와 함께 고르기 화면이 열린다. 휴대폰은 화면을 덮지 않는다(검색에서 들어온 사람을 막지 않게).
   모양은 이마고 첫 화면: 파스텔 그림판 위에 머리글 · 두 줄 제목 · 검은 캡슐, 맨 아래에 말씀 */
.gate {
  position: fixed; inset: 0; z-index: 500; display: none;
  flex-direction: column; align-items: center; justify-content: center;
  padding: 56px 32px 150px; text-align: center; color: var(--ink); cursor: pointer;
  background: #fff; -webkit-user-select: none; user-select: none;
}
.gate::before, .gate::after { content: ''; position: absolute; inset: 16px; z-index: -1; border-radius: var(--r-xl); pointer-events: none; }
/* 주황 강조색에 맞춘 따뜻한 오로라(복숭아 · 살구 · 크림 · 연분홍) */
.gate::before { background: linear-gradient(118deg, #FFD2C0 0%, #FFE2CC 34%, #FFF0DC 68%, #FDE3EC 100%); }
.gate::after {
  background-image: radial-gradient(rgba(255, 255, 255, .55) 1.2px, transparent 1.3px); background-size: 14px 14px; opacity: .6;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 40%, #000 70%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 40%, #000 70%, transparent 100%);
}
html.gated .gate, .gate.out { display: flex; }
html.gated, html.gated body { overflow: hidden; }
.gate-in { display: flex; flex-direction: column; align-items: center; max-width: 760px; transition: transform .6s var(--ease); }
.gate-logo { position: relative; width: 104px; height: 104px; margin-bottom: 30px; }
.gate-icon {
  position: relative; display: block; width: 104px; height: 104px; border-radius: 24px;
  box-shadow: 0 24px 50px -12px rgba(120, 50, 20, .38), 0 0 0 1px rgba(255, 255, 255, .5);
  animation: gate-float 4.8s ease-in-out infinite;
}
/* 등불처럼 번지는 물결(뻗는 빛줄기는 쓰지 않는다) */
.gate-wave {
  position: absolute; left: 50%; top: 50%; width: 104px; height: 104px; margin: -52px 0 0 -52px;
  border-radius: 50%; border: 2px solid rgba(200, 72, 22, .26); opacity: 0;
  animation: gate-wave 3s cubic-bezier(.2, .6, .35, 1) infinite;
}
.gate-wave:nth-child(2) { animation-delay: 1s; }
.gate-wave:nth-child(3) { animation-delay: 2s; }
@keyframes gate-wave { 0% { transform: scale(.92); opacity: .7; } 100% { transform: scale(2.2); opacity: 0; } }
@keyframes gate-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.gate-eye { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 18px; line-height: 1.5; font-weight: 650; color: var(--accent-ink); letter-spacing: -0.01em; }
.gate-eye::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.gate-title { margin: 0; font-size: clamp(36px, 4.6vw, 58px); line-height: 1.3; font-weight: 650; letter-spacing: -0.025em; }
.gate-title .acc { display: inline-block; }
.gate-go {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 220px; height: var(--h-btn-lg); margin-top: 38px; padding: 0 30px;
  border: 1px solid var(--btn); border-radius: 999px; background: var(--btn); color: #fff;
  font-size: 17px; font-weight: 600; letter-spacing: -0.01em; transition: background .15s, transform .15s;
}
.gate-go:hover { background: #000; border-color: #000; }
.gate-go:active { transform: scale(.98); }
.gate-go:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.gate-sub { margin: 14px 0 0; font-size: 15px; color: var(--ink2); }
.gate-quiet {
  margin-top: 6px; height: 40px; padding: 0 12px; border: 0; background: none;
  color: var(--accent-ink); font-size: 16px; font-weight: 650;
}
.gate-quiet:hover { text-decoration: underline; text-underline-offset: 3px; }
.gate-quiet:focus-visible { border-radius: 8px; }
.gate-verse {
  position: absolute; left: 0; right: 0; bottom: 46px; margin: 0 auto; max-width: 46ch; padding: 0 20px;
  font-size: 13px; line-height: 1.7; color: var(--ink2);
}
.gate-verse b { display: block; font-weight: 600; }
.gate.out { opacity: 0; pointer-events: none; transition: opacity .55s ease; }
.gate.out .gate-in { transform: translateY(-10px); }
@media (max-height: 640px) {
  .gate { padding: 40px 32px; justify-content: flex-start; overflow-y: auto; }
  .gate-in { margin: auto 0; }
  .gate-logo { width: 80px; height: 80px; margin-bottom: 20px; }
  .gate-icon { width: 80px; height: 80px; border-radius: 19px; }
  .gate-wave { width: 80px; height: 80px; margin: -40px 0 0 -40px; }
  .gate-title { font-size: 36px; }
  .gate-go { margin-top: 26px; }
  .gate-verse { position: static; margin-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .gate-icon { animation: none; }
  .gate-wave { display: none; }
  .gate.out, .gate-in { transition: none; }
}

/* ---------------------------------------------------------------- 고르기 화면 */
.setup { max-width: calc(var(--max) + var(--gut) * 2); margin: 0 auto; padding: 8px var(--gut) 24px; display: grid; gap: 16px; }
@media (min-width: 960px) {
  .setup { grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: 24px; padding-bottom: 32px; align-items: start; }
  .names-panel { position: sticky; top: 80px; }
}
/* 판: 이마고의 따뜻한 판(#F7F6F3) · 모서리 28(폰 24) */
.panel { background: var(--warm); border-radius: var(--r-panel); padding: 28px 26px; }
@media (max-width: 767px) { .panel { border-radius: 24px; padding: 24px 20px; } }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
/* 판 순서 표시: 흰 알약 + 강조색 번호(이마고 첫 화면 그림판의 단계 꼬리표) */
.step { display: inline-flex; align-items: center; gap: 7px; height: 30px; margin: 0 0 14px; padding: 0 12px 0 5px; border-radius: 999px; background: #fff; box-shadow: 0 4px 12px rgba(40, 30, 100, .08); font-size: 13.5px; font-weight: 650; color: var(--accent-ink); white-space: nowrap; }
.step b { display: inline-grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; }
h1, h2 { margin: 0; font-size: clamp(24px, 2.4vw, 30px); line-height: 1.3; font-weight: 650; letter-spacing: -0.022em; }
.count-pill {
  flex: none; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--accent-tint); color: var(--accent-ink);
  font-weight: 650; font-size: 14px; display: inline-flex; align-items: center; font-variant-numeric: tabular-nums;
}
.hint { margin: 8px 0 16px; color: var(--ink3); font-size: 15px; line-height: 1.55; white-space: pre-line; }
.hint.small { font-size: 13.5px; margin: 14px 2px 0; }
.names-box { position: relative; }
#names {
  display: block; width: 100%; min-height: 220px; height: 34vh; max-height: 520px; resize: vertical;
  border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px 18px;
  font: 500 16px/1.65 var(--font); color: var(--ink); background: #fff; outline: none;
  transition: border-color .15s, box-shadow .2s;
}
#names:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(200, 72, 22, .14); }
.example-tag {
  position: absolute; right: 12px; top: 12px; z-index: 1; pointer-events: none;
  font-size: 12.5px; font-weight: 650; color: var(--accent-ink); background: var(--accent-tint); border-radius: 999px; padding: 4px 10px;
}
.names-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
/* 작은 단추(칩): 흰 바탕 · 옅은 테두리 캡슐(이마고 sm 단추 높이) */
.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 15px;
  border-radius: 999px; border: 1px solid #DADAE0; background: #fff; color: var(--ink);
  font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; transition: background .15s, border-color .15s, transform .15s;
}
.chip:hover { background: #F4F4F6; }
.chip:active { transform: scale(.98); }
.chip.strong { background: var(--btn); border-color: var(--btn); color: #fff; }
.chip.strong:hover { background: #000; border-color: #000; }
.chip.strong svg { stroke-width: 2.2; }
.drop-hint {
  position: absolute; inset: 0; z-index: 2; display: none; place-items: center; pointer-events: none; text-align: center; padding: 20px;
  border-radius: var(--r-card); border: 2px dashed var(--accent); background: rgba(238, 235, 251, .95); color: var(--accent-ink); font-weight: 700; font-size: 16px;
}
.names-box.dropping .drop-hint { display: grid; }

/* ---------------------------------------------------------------- 바닥글 (이마고: 로고 | 묶음별 줄 / 사업자 정보 / 말씀) */
.site-foot {
  margin-top: 24px; padding: 56px max(var(--gut), calc((100% - var(--max)) / 2)) calc(130px + var(--safe-b));
  border-top: 1px solid rgba(0, 0, 0, .06); color: var(--ink2); font-size: 13px; line-height: 1.7;
}
@media (min-width: 960px) { .site-foot { padding-bottom: 56px; } }
.foot-top { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; }
.foot-brand { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.foot-logo { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; }
.foot-logo img { width: 28px; height: 28px; border-radius: 8px; }
.foot-logo b { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.foot-tag { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink3); }
.foot-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 20px; }
.foot-col { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.foot-col p { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--ink); }
.foot-col a { font-size: 14.5px; line-height: 1.5; color: #3B3B41; text-decoration: none; cursor: pointer; }
.foot-col a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.foot-col a.ff-link { display: flex; flex-direction: column; gap: 2px; color: var(--accent-ink); }
.foot-col a.ff-link b { font-weight: 650; }
.foot-col a.ff-link span { font-size: 13px; color: var(--ink3); }
.foot-biz { display: grid; gap: 2px; margin-top: 48px; padding-top: 22px; border-top: 1px solid rgba(0, 0, 0, .08); color: #8C8C93; font-size: 12.5px; line-height: 1.8; }
.foot-verse { max-width: 46ch; margin: 28px auto 0; color: #6E6E73; font-size: 13px; text-align: center; line-height: 1.7; }
.foot-verse b { display: block; font-weight: 600; color: #6E6E73; }
@media (max-width: 1000px) { .foot-top { grid-template-columns: minmax(0, 1fr); gap: 28px; } }
@media (max-width: 560px) { .site-foot { padding-top: 44px; } .foot-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 시트 안 목록(맨 아래 버튼은 늘 보이게) */
.sheet.list-sheet { display: flex; flex-direction: column; overflow: hidden; }
.sheet.list-sheet .sh-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; margin: 0 -20px; padding: 2px 20px 4px; }
.sheet.list-sheet .sh-actions { flex: none; padding-top: 12px; }
.sh-sub { margin: -2px 0 14px; font-size: 14px; line-height: 1.5; color: var(--grey-5); }
.sh-sub.small { margin: 8px 2px 0; font-size: 13px; }
.w-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.w-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 7px 8px; border-radius: 14px; transition: background .2s; }
.w-row.more { background: #FFF6DB; }
.w-dot { width: 10px; height: 10px; border-radius: 50%; }
.w-name { font-weight: 700; font-size: 16px; }
/* 조 나누기 규칙 시트 */
.tr-list { display: grid; gap: 8px; margin: 6px 0 4px; }
.tr-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 20px; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px 10px 16px; border: 1px solid var(--grey-2); border-radius: 16px; background: #fff; text-align: left; }
.tr-row:hover { border-color: var(--grey-3); background: var(--grey-1); }
.tr-name { font-size: 16px; font-weight: 800; color: var(--ink); white-space: nowrap; }
.tr-val { font-size: 14px; font-weight: 600; color: var(--grey-5); text-align: right; overflow-wrap: anywhere; line-height: 1.4; }
.tr-chev svg { width: 18px; height: 18px; fill: none; stroke: var(--grey-4); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tr-sheet .sh-sub.small { margin: 12px 2px 16px; }
.pick-list { display: grid; gap: 2px; }
.pick-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 7px 8px; border: 0; border-radius: 14px; background: none; text-align: left; transition: background .2s; }
button.pick-row:hover { background: var(--grey-1); }
.pick-name { font-weight: 700; font-size: 16px; color: var(--ink); overflow-wrap: anywhere; }
.pick-badge { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--grey-3); display: inline-flex; align-items: center; font-size: 13px; font-weight: 800; color: var(--grey-4); }
.pick-row[aria-pressed="true"] { background: #FFF6DB; }
.pick-row[aria-pressed="true"] .pick-badge { border-color: transparent; background: #1A1300; color: #FFD66B; }
.tg-labels { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.tg-lab-title { font-size: 13px; font-weight: 800; color: var(--grey-5); margin-right: 2px; }
.tg-lab { width: 88px; height: 38px; padding: 0 12px; border: 1px solid var(--grey-3); border-radius: 12px; font: inherit; font-size: 15px; font-weight: 700; color: var(--ink); background: #fff; }
.tg-lab:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(200, 72, 22, .14); }
.tg-seg { display: inline-flex; gap: 4px; padding: 3px; border-radius: 999px; background: var(--grey-1); }
.tg-opt { min-width: 48px; height: 34px; padding: 0 12px; border: 0; border-radius: 999px; background: none; font-size: 14px; font-weight: 800; color: var(--grey-5); }
.tg-opt[aria-pressed="true"] { background: var(--ink); color: #fff; }
.stepper.locked button { visibility: hidden; }
.pz-chip.plain { padding: 0 12px; }
.stepper.small { height: 42px; }
.stepper.small .w-btn { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--grey-1); display: grid; place-items: center; }
.stepper.small .w-btn:disabled { opacity: .35; }
.stepper.small output { min-width: 38px; text-align: center; font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.choice-list { display: grid; gap: 8px; }
.choice {
  display: grid; gap: 4px; width: 100%; padding: 14px 16px; border-radius: 16px; text-align: left;
  border: 1.5px solid var(--grey-3); background: #fff; transition: border-color .15s, transform .12s;
}
.choice:hover { border-color: var(--accent); }
.choice:active { transform: scale(.99); }
.choice.best { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.choice-top { display: flex; align-items: center; gap: 8px; }
.choice-title { font-weight: 800; font-size: 16px; }
.choice-tag { font-size: 12px; font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); border-radius: 999px; padding: 3px 8px; }
.choice-sub { font-size: 14px; line-height: 1.45; color: var(--grey-5); }
.choice-meta { font-size: 12px; color: var(--grey-5); }
.ml-list { display: grid; gap: 8px; }
.ml-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px; border-radius: 16px; background: var(--grey-1); }
.ml-open { display: grid; gap: 3px; padding: 14px 16px; border: 0; background: none; border-radius: 16px; text-align: left; }
.ml-title { font-weight: 800; font-size: 16px; }
.ml-meta { font-size: 13px; color: var(--grey-5); }
.ml-del { width: 44px; height: 44px; margin-right: 6px; border-radius: 12px; border: 0; background: none; color: var(--grey-5); display: grid; place-items: center; }
.ml-del:hover { background: #fff; color: #C2410C; }
.ml-empty { margin: 0; padding: 26px 0; text-align: center; font-size: 15px; color: var(--grey-5); }
.text-input {
  width: 100%; height: 54px; margin-top: 6px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--grey-3);
  font: 600 16px var(--font); color: var(--ink); background: #fff; outline: none;
}
.text-input:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(17, 17, 20, .06); }
/* 안내 글은 문장마다 줄을 바꾼다(스크립트가 문장 사이에 줄바꿈을 넣고, 이 칸들만 그 줄을 보여 준다) */
.sh-sub, .choice-sub, .login-note, .mn-rv-s, .mn-sub, .mo-note, .mw-sub, .cd-sub, .tm-sub, .gate-sub { white-space: pre-line; }
/* 기다림: 화면을 어둡게 덮고 가운데 흰 판 위에서 돈다(누름은 막힌다) */
.busy { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; background: rgba(15, 12, 40, .35); }
.busy::before { content: ''; grid-area: 1 / 1; width: 76px; height: 76px; border-radius: 22px; background: #fff; box-shadow: 0 12px 30px rgba(0, 0, 0, .12); }
.spinner { grid-area: 1 / 1; width: 28px; height: 28px; border-radius: 50%; border: 3px solid #E5E8EB; border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.game-grid { display: grid; gap: 10px; margin-top: 18px; }
/* 고르는 카드: 흰 카드 · 모서리 20, 고르면 강조색 테두리 + 옅은 고리(이마고 요금 카드 고르기) */
.game-card {
  position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  width: 100%; padding: 14px 18px 14px 14px; border-radius: var(--r-card); border: 2px solid transparent; background: #fff; text-align: left;
  transition: border-color .15s, box-shadow .2s, transform .15s;
}
.game-card:hover { box-shadow: 0 8px 24px rgba(200, 72, 22, .10); }
.game-card:active { transform: scale(.99); }
.game-card[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.gc-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--paper); display: grid; place-items: center; color: var(--ink); transition: background .15s, color .15s; }
.gc-icon svg { width: 28px; height: 28px; stroke-width: 1.9; }
.gc-icon svg .f { fill: currentColor; stroke: none; }
.gc-icon svg .f2 { fill: currentColor; fill-opacity: .16; }
.game-card[aria-pressed="true"] .gc-icon { background: var(--accent-tint); color: var(--accent); }
.gc-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.gc-name { font-weight: 650; font-size: 17px; letter-spacing: -0.02em; }
.gc-desc { font-size: 14px; color: var(--ink3); line-height: 1.45; }
.gc-range { font-size: 13px; font-weight: 600; color: var(--ink3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.gc-check { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; display: none; place-items: center; box-shadow: 0 0 0 2px #fff; }
.gc-check svg { width: 14px; height: 14px; stroke-width: 3; }
.game-card[aria-pressed="true"] .gc-check { display: grid; }
.game-card.is-off .gc-icon, .game-card.is-off .gc-text { opacity: .5; }
/* 그림 아이콘(빌드에서 그림 파일을 켰을 때) */
.pics .game-card { grid-template-columns: 56px minmax(0, 1fr) auto; }
.pics .gc-icon, .pics .game-card[aria-pressed="true"] .gc-icon { width: 56px; height: 56px; border-radius: 0; background: none; }
.pics .gc-icon img {
  display: block; width: 100%; height: 100%; object-fit: contain;
  filter: drop-shadow(0 4px 7px rgba(60, 30, 160, .18)); transition: transform .3s cubic-bezier(.3, .7, .2, 1.4);
}
.pics .game-card[aria-pressed="true"] .gc-icon img { transform: scale(1.08) rotate(-4deg); }
.game-card.is-off .gc-range { color: #D92D20; }
@media (max-width: 440px) {
  .game-card { grid-template-columns: 44px minmax(0, 1fr); padding: 12px 14px; }
  .gc-icon { width: 44px; height: 44px; }
  .gc-range { grid-column: 2; margin-top: -8px; }
  .pics .game-card { grid-template-columns: 52px minmax(0, 1fr); }
  .pics .gc-icon, .pics .game-card[aria-pressed="true"] .gc-icon { width: 52px; height: 52px; }
}

.rules { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }
.rule-k { display: flex; align-items: center; gap: 10px; }
.rule-label { font-weight: 650; font-size: 16px; }
.rule-unit { font-weight: 600; color: var(--ink-2); }
.stepper { display: inline-flex; align-items: center; height: 46px; border-radius: 999px; background: #fff; border: 1px solid var(--line); padding: 3px; }
.stepper button { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--paper); display: grid; place-items: center; transition: background .15s; }
.stepper button:hover { background: #ECECEF; }
.stepper button:disabled { opacity: .35; }
.stepper output { min-width: 44px; text-align: center; font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
/* 하나 고르기: 흰 바탕 위 검은 알약이 고른 칸으로 미끄러진다(이마고 탭 알약 0.3초) */
.seg { position: relative; display: inline-flex; padding: 3px; border-radius: 999px; background: #fff; border: 1px solid var(--line); }
.seg button { position: relative; z-index: 1; height: 38px; padding: 0 15px; border-radius: 999px; border: 0; background: none; font-size: 14.5px; font-weight: 600; color: var(--ink3); white-space: nowrap; transition: color .3s ease; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--btn); color: #fff; }
.seg.pill-on::before {
  content: ''; position: absolute; left: 0; top: 0; z-index: 0; width: var(--pw, 0); height: var(--ph, 0);
  transform: translate(var(--pl, 0), var(--pt, 0)); border-radius: 999px; background: var(--btn); pointer-events: none;
}
.seg.pill-on button[aria-pressed="true"] { background: transparent; }
@media (prefers-reduced-motion: no-preference) {
  .seg.pill-go::before { transition: transform .3s var(--ease-tab), width .3s var(--ease-tab), height .3s var(--ease-tab); }
}
.rule-desc { margin: 14px 2px 0; font-size: 14.5px; color: var(--ink3); line-height: 1.55; white-space: pre-line; }
/* 상품 · 벌칙: 규칙 아래 조용한 한 줄 */
.prize-line { margin-top: 12px; }
.pz-add { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 15px 0 11px; border: 1px dashed #CFCFD6; border-radius: 999px; background: #fff; color: var(--ink2); font-size: 14.5px; font-weight: 600; transition: border-color .15s, color .15s; }
.pz-add svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; }
.pz-add:hover { border-color: var(--accent); color: var(--accent-ink); }
.pz-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; text-align: left; }
.pz-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 32px; padding: 0 12px 0 4px; border-radius: 999px; background: var(--paper); font-size: 14px; font-weight: 600; color: var(--ink); }
.pz-chip b { display: grid; place-items: center; min-width: 24px; height: 24px; border-radius: 999px; background: #FFF4D6; color: #8A5A00; font-size: 12px; font-weight: 800; }
.pz-chip span { overflow-wrap: anywhere; }
.pz-more { font-size: 13px; font-weight: 600; color: var(--ink3); padding: 0 4px; }
.pz-edit { margin-left: auto; padding: 0 6px; font-size: 14px; font-weight: 650; color: var(--accent-ink); }
.sh-textarea { display: block; width: 100%; min-height: 150px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; font: inherit; font-size: 16px; line-height: 1.6; color: var(--ink); resize: vertical; }
.sh-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(200, 72, 22, .14); }
.pz-sheet .pz-note { margin: 10px 2px 16px; font-weight: 650; color: var(--ink-2); }

/* 맨 아래 시작 단추(폰): 손이 닿는 자리에 늘 떠 있다 */
.cta-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9;
  padding: 18px var(--gut) calc(14px + var(--safe-b));
  background: linear-gradient(to top, #fff 62%, rgba(255, 255, 255, 0));
}
@media (min-width: 960px) { .cta-bar { position: static; padding: 0; margin-top: 22px; background: none; } }
/* 시작 단추 바로 아래 레크판 길: 폰은 떠 있는 단추 밑 한 줄, 컴퓨터는 판 안의 흰 카드(코스 고르기 줄과 같은 결) */
.cta-rp { display: flex; align-items: center; justify-content: center; gap: 7px; height: 40px; margin-top: 4px; color: var(--accent-ink); font-size: 15px; letter-spacing: -0.01em; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.cta-rp[hidden] { display: none; }
.cta-rp-ic { display: grid; place-items: center; flex: none; }
.cta-rp-ic svg { width: 22px; height: 22px; stroke-width: 1.8; }
.cta-rp-ic svg .f, .cta-rp-go svg .f { fill: currentColor; stroke: none; }
.cta-rp-tx { display: flex; flex-direction: column; min-width: 0; }
.cta-rp-tx b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cta-rp-s { display: none; }
.cta-rp-go { display: grid; place-items: center; flex: none; }
.cta-rp-go svg { width: 16px; height: 16px; stroke-width: 2.4; }
.cta-rp:active { opacity: .7; }
@media (max-width: 959px) {
  html.rp-cta .cta-bar { padding-bottom: calc(4px + var(--safe-b)); }
  html.rp-cta .site-foot { padding-bottom: calc(162px + var(--safe-b)); }
}
@media (min-width: 960px) {
  .cta-rp { justify-content: flex-start; gap: 14px; height: auto; margin-top: 12px; padding: 12px 18px 12px 12px; border: 1px solid var(--grey-2); border-radius: 18px; background: #fff; color: var(--ink); transition: border-color .15s, background .15s; }
  .cta-rp:hover { border-color: var(--grey-3); background: var(--grey-1); }
  .cta-rp:active { opacity: 1; }
  .cta-rp-ic { width: 48px; height: 48px; border-radius: 14px; background: var(--accent-tint); color: var(--accent-ink); }
  .cta-rp-ic svg { width: 26px; height: 26px; }
  .cta-rp-tx { flex: 1; gap: 2px; }
  .cta-rp-tx b { font-size: 16.5px; font-weight: 700; color: #1E1E22; }
  .cta-rp-s { display: block; font-size: 13.5px; line-height: 1.45; color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cta-rp-go { width: 34px; height: 34px; border-radius: 999px; background: var(--accent-tint); color: var(--accent-ink); }
  .cta-rp:hover .cta-rp-go { background: var(--accent); color: #fff; }
}
html.embed .cta-rp, html.obs .cta-rp { display: none !important; }
/* 단추: 주 = 검은 캡슐, 보조 = 테두리 캡슐(이마고 사이트 단추) */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--h-btn); padding: 0 26px;
  border-radius: 999px; border: 1px solid var(--btn); background: var(--btn); color: #fff;
  font-weight: 600; font-size: 17px; letter-spacing: -0.01em; white-space: nowrap; transition: background .15s, border-color .15s, transform .15s;
}
.btn-primary:hover { background: #000; border-color: #000; }
.btn-primary:active { transform: scale(.98); }
.btn-start { width: 100%; height: var(--h-btn-lg); }
.btn-start.is-off, .btn-primary.is-off { background: #C9C9D0; border-color: #C9C9D0; }
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 48px; padding: 0 20px;
  border-radius: 999px; border: 1px solid var(--btn); background: transparent; color: var(--ink);
  font-weight: 600; font-size: 16px; letter-spacing: -0.01em; transition: background .15s, transform .15s;
}
.btn-secondary:hover { background: rgba(0, 0, 0, .04); }
.btn-secondary:active { transform: scale(.98); }
.btn-secondary:disabled { opacity: .4; }
.btn-text { height: 44px; padding: 0 12px; border: 0; background: none; font-weight: 600; font-size: 15px; color: var(--ink2); text-decoration: underline; text-underline-offset: 3px; }
.btn-text:hover { color: var(--ink); }

/* ---------------------------------------------------------------- 무대 */
.stage {
  position: fixed; inset: 0; z-index: 50; color: var(--stage-text); overflow: hidden; --tension: 0;
  background: radial-gradient(ellipse 90% 60% at 50% -10%, #23205A 0%, #0D0E22 48%, var(--stage-bg) 100%);
}
.stage:not([hidden]) { animation: stage-in .32s cubic-bezier(.2, .8, .2, 1); }
@keyframes stage-in { from { opacity: 0; transform: scale(1.015); } to { opacity: 1; transform: none; } }
.stage::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 25;
  background: radial-gradient(ellipse 75% 70% at 50% 50%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, .8) 100%);
  opacity: calc(var(--tension) * 0.95); transition: opacity .25s linear;
}
.stage-shake { position: absolute; inset: 0; display: flex; flex-direction: column; }
.stage-top {
  flex: none; height: calc(60px + var(--safe-t)); padding: var(--safe-t) 12px 0;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
  position: relative; z-index: 30;
}
.icon-btn {
  width: 42px; height: 42px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .06); color: var(--stage-text); display: grid; place-items: center;
}
.icon-btn:hover { background: rgba(255, 255, 255, .12); }
.icon-btn .ic-off { display: none; }
.icon-btn.is-muted .ic-on { display: none; }
.icon-btn.is-muted .ic-off { display: block; }
.stage-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; white-space: nowrap; overflow: hidden; }
#stageTitle { font-weight: 800; font-size: 17px; letter-spacing: -0.02em; }
.stage-status { font-size: 14px; color: var(--stage-dim); overflow: hidden; text-overflow: ellipsis; }
.stage-actions { display: flex; align-items: center; gap: 8px; }
.speed { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); }
.speed button { height: 34px; min-width: 40px; padding: 0 8px; border: 0; border-radius: 999px; background: none; color: var(--stage-dim); font-weight: 700; font-size: 13px; }
.speed button[aria-pressed="true"] { background: #fff; color: var(--ink); }
.stage-body { position: relative; flex: 1 1 auto; min-height: 0; }
.stage-bottom {
  flex: none; display: flex; justify-content: center; gap: 10px; position: relative; z-index: 30;
  padding: 10px 16px calc(14px + var(--safe-b));
}
.stage-bottom:empty { padding: 0 0 calc(8px + var(--safe-b)); }
.btn-stage {
  height: 54px; padding: 0 28px; min-width: 180px; border-radius: 999px; border: 0; background: #fff; color: var(--ink);
  font-weight: 800; font-size: 16px; box-shadow: 0 8px 30px rgba(0, 0, 0, .35); transition: transform .12s, opacity .15s;
}
.btn-stage:active { transform: scale(.98); }
.btn-stage:disabled { opacity: .35; }
.btn-stage.ghost { background: rgba(255, 255, 255, .08); color: var(--stage-text); border: 1px solid rgba(255, 255, 255, .16); box-shadow: none; min-width: 0; }
@media (max-width: 600px) {
  .stage-title { flex-direction: column; align-items: flex-start; gap: 0; }
  #stageTitle { font-size: 16px; }
  .stage-status { font-size: 12px; max-width: 100%; }
  .btn-stage { flex: 1; min-width: 0; padding: 0 16px; }
  .speed button { min-width: 34px; padding: 0 6px; }
  .stage-actions { gap: 6px; }
  .icon-btn { width: 38px; height: 38px; border-radius: 12px; }
}
.stage-fx { position: absolute; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }

/* ---------------------------------------------------------------- 연출 */
.fx-flash { position: absolute; inset: 0; pointer-events: none; }
.fx-callout {
  position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); pointer-events: none;
  font-weight: 900; font-size: clamp(64px, 14vw, 140px); line-height: 1.05; letter-spacing: -0.03em; color: #fff;
  text-shadow: 0 6px 40px rgba(0, 0, 0, .55); white-space: nowrap;
}
.fx-callout.small { font-size: clamp(24px, 5.6vw, 46px); font-weight: 800; }
.fx-callout .fx-sub { display: block; margin-top: .3em; font-size: max(18px, .34em); font-weight: 800; letter-spacing: -0.01em; color: #fff; text-align: center; text-shadow: 0 4px 24px rgba(0, 0, 0, .6); }
.fx-callout.big .fx-sub { font-size: max(20px, .3em); }
.fx-callout.big { font-size: clamp(40px, 10vw, 112px); max-width: 94vw; overflow: hidden; text-overflow: ellipsis; padding: 0 .1em; }
.fx-callout.gold { color: var(--gold); text-shadow: 0 0 34px rgba(255, 200, 61, .55), 0 6px 40px rgba(0, 0, 0, .6); }
.fx-callout.dim { color: var(--stage-dim); font-size: clamp(30px, 6vw, 60px); }
.fx-callout.small.dim { font-size: clamp(22px, 4.6vw, 38px); }
.fx-banner {
  position: absolute; left: 50%; top: 66px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; max-width: 90vw;
  background: rgba(20, 22, 48, .86); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 8px 30px rgba(0, 0, 0, .35);
}
.fx-banner.gold { background: var(--gold); color: #1A1300; border-color: transparent; }
.fx-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.fx-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; }

/* ---------------------------------------------------------------- 핀볼 */
.pb-wrap { position: absolute; inset: 0; }
.pb-canvas { position: absolute; inset: 0; display: block; }
.pb-hud {
  position: absolute; right: 24px; top: 12px; z-index: 2; width: 230px; padding: 12px 14px; border-radius: 18px;
  background: rgba(13, 15, 36, .74); border: 1px solid rgba(255, 255, 255, .08); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.pb-hud-head { font-size: 12px; font-weight: 700; color: var(--stage-dim); margin-bottom: 6px; }
.pb-rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.pb-rank li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 8px; height: 26px; font-size: 14px; font-weight: 600; }
.pb-rank .dot { width: 10px; height: 10px; border-radius: 50%; }
.pb-rank .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-rank .tg { font-size: 12px; color: var(--stage-dim); font-variant-numeric: tabular-nums; }
.pb-rank li.win .nm, .pb-rank li.win .tg { color: var(--gold); }
@media (max-width: 760px) {
  .pb-hud { left: 8px; right: auto; top: 6px; width: 148px; padding: 7px 10px; border-radius: 14px; background: rgba(13, 15, 36, .62); }
  .pb-hud-head { display: none; }
  .pb-rank { gap: 2px; }
  .pb-rank li { font-size: 12px; height: 20px; gap: 6px; grid-template-columns: 8px minmax(0, 1fr) auto; }
  .pb-rank .dot { width: 8px; height: 8px; }
  .pb-rank .tg { font-size: 11px; }
}

/* ---------------------------------------------------------------- 사다리 */
.ld-wrap { position: absolute; inset: 6px 14px 4px; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; gap: 8px; max-width: 1100px; margin: 0 auto; }
.ld-hud { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 14px; min-height: 20px; font-size: 14px; color: var(--stage-dim); }
.ld-chance { color: var(--gold); font-weight: 700; }
.ld-top, .ld-bot { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 4px; }
.ld-name {
  position: relative; height: 42px; padding: 0 4px; border-radius: 12px; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .06); color: var(--stage-text);
  font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center;
  transition: background .2s, transform .15s, opacity .3s;
}
.ld-name::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--c); }
.ld-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-name:hover { background: rgba(255, 255, 255, .12); }
.ld-name.going { background: var(--c); color: #111; transform: translateY(2px); }
.ld-name.won { background: var(--gold); color: #1A1300; }
.ld-name.passed { opacity: .45; }
.ld-mid { position: relative; min-height: 0; }
.ld-canvas { position: absolute; inset: 0; display: block; }
.ld-res { position: relative; height: 54px; border-radius: 12px; overflow: hidden; background: rgba(255, 255, 255, .06); }
.ld-face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-weight: 800; font-size: 14px; }
.ld-res.win .ld-face { background: var(--gold); color: #1A1300; }
.ld-res.pass .ld-face { background: rgba(255, 255, 255, .1); color: var(--stage-dim); }
.ld-res.pz .ld-txt { font-size: .86em; line-height: 1.15; padding: 0 4px; text-align: center; word-break: keep-all; overflow-wrap: anywhere; }
.ld-who { max-width: 100%; padding: 0 3px; font-size: 11px; font-weight: 600; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-cover {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: 12px;
  font-weight: 900; font-size: 18px; color: rgba(255, 255, 255, .7);
  background: repeating-linear-gradient(135deg, #2B2E60 0 10px, #24274F 10px 20px); border: 1px solid rgba(255, 255, 255, .12);
  transition: transform .55s cubic-bezier(.2, .8, .2, 1), opacity .55s;
}
.ld-res.open .ld-cover { transform: translateY(-105%); opacity: 0; }
.ld-res.trembling .ld-cover { animation: tremble .09s linear infinite; }
@keyframes tremble {
  0% { transform: translate(0, 0); } 25% { transform: translate(-1.5px, 1px); }
  50% { transform: translate(1.5px, -1px); } 75% { transform: translate(-1px, -1px); } 100% { transform: translate(0, 0); }
}
.ld-wrap.dense .ld-name { font-size: 11.5px; height: 38px; padding: 0 2px; }
.ld-wrap.dense .ld-face { font-size: 11px; }
.ld-wrap.dense .ld-who { display: none; }
.ld-wrap.vertical .ld-name { height: 74px; padding: 6px 0; writing-mode: vertical-rl; font-size: 12.5px; letter-spacing: -0.03em; }
.ld-wrap.vertical .ld-nm { max-height: 100%; }
.ld-wrap.vertical .ld-res { height: 62px; }
.ld-wrap.vertical .ld-face { writing-mode: vertical-rl; font-size: 12px; }
.ld-wrap.vertical .ld-who { display: none; }
.ld-wrap.vertical .ld-cover { font-size: 13px; }
@media (max-width: 600px) {
  .ld-wrap { inset: 4px 8px 2px; }
  .ld-top, .ld-bot { gap: 3px; }
  .ld-name { font-size: 12px; }
}

/* ---------------------------------------------------------------- 제비 */
.st-wrap { position: absolute; inset: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.st-hud { text-align: center; padding: 6px 16px 0; }
.st-turn { display: inline-flex; align-items: center; gap: 10px; font-size: clamp(22px, 4.6vw, 34px); font-weight: 800; letter-spacing: -0.02em; }
.st-dot { width: 14px; height: 14px; border-radius: 50%; }
.st-odds { margin-top: 4px; color: var(--stage-dim); font-size: 14px; font-weight: 600; }
.st-stage { position: relative; min-height: 0; cursor: pointer; touch-action: manipulation; overflow: hidden; }
.st-cup-back {
  position: absolute; left: 50%; bottom: calc(var(--pivot) + var(--cupH) - 14px); width: var(--cupW); height: 28px;
  transform: translateX(-50%); border-radius: 50%; background: radial-gradient(ellipse at 50% 40%, #0B0820 40%, #2A1F66 100%);
}
.st-sticks { position: absolute; inset: 0; pointer-events: none; }
.st-stick {
  position: absolute; left: 50%; bottom: calc(var(--pivot) + 6px); width: var(--sw); margin-left: calc(var(--sw) / -2);
  transform-origin: 50% 100%; border-radius: 999px;
  background: linear-gradient(90deg, #C99A5B, #F2D7A6 45%, #D9AE70); box-shadow: inset 0 0 0 1px rgba(80, 50, 20, .25);
  transition: filter .2s, opacity .45s;
}
.st-tip { position: absolute; left: 0; right: 0; bottom: 0; height: var(--tip); border-radius: 0 0 999px 999px; background: inherit; }
.st-stick.w .st-tip { background: linear-gradient(90deg, #E2324B, #FF6B7D 45%, #C9223B); box-shadow: inset 0 4px 0 var(--gold); }
.st-num {
  position: absolute; left: 50%; top: 0; width: var(--bd); height: var(--bd); margin: calc(var(--bd) / -2) 0 0 calc(var(--bd) / -2);
  border-radius: 50%; background: #fff; color: #15122B; display: grid; place-items: center;
  font-size: calc(var(--bd) * .5); font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .45); transform: rotate(var(--ca, 0deg));
}
.st-stick.hover .st-num, .st-stick.active .st-num { background: var(--gold); }
.st-stick.lost .st-num { background: #A3A8C6; }
.st-chip-num { opacity: .65; font-weight: 700; }
.st-stick.hover { filter: brightness(1.15); }
.st-stick.active { filter: brightness(1.15) drop-shadow(0 0 10px rgba(255, 255, 255, .4)); z-index: 2; }
.st-stick.won .st-tip { box-shadow: inset 0 4px 0 var(--gold), 0 0 22px 6px rgba(255, 200, 61, .75); }
.st-stick.lost { filter: grayscale(.5) brightness(.85); }
.st-stick.gone { opacity: 0; }
.st-cup-front {
  position: absolute; z-index: 3; left: 50%; bottom: var(--pivot); width: var(--cupW); height: var(--cupH); transform: translateX(-50%);
  border-radius: 0 0 calc(var(--cupW) * .2) calc(var(--cupW) * .2); pointer-events: none;
  background: linear-gradient(90deg, #4A31B4 0%, #8B74FF 36%, #6C4DFF 62%, #3B2896 100%); box-shadow: 0 24px 50px rgba(0, 0, 0, .45);
}
.st-cup-front::before {
  content: ''; position: absolute; left: 0; right: 0; top: -14px; height: 28px; border-radius: 50%;
  background: linear-gradient(180deg, #B4A6FF, #7A5CFF); clip-path: inset(50% 0 0 0);
}
.st-cup-front::after {
  content: ''; position: absolute; left: 14%; right: 14%; bottom: 22%; height: 18%; border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, .28);
}
/* 그림 파일: 통 뒤쪽(입구 안쪽까지) → 제비 → 통 앞면 순서로 겹쳐 제비가 통 안에 꽂혀 보이게 한다 */
.has-img .st-cup-back {
  bottom: var(--pivot); width: var(--cupImgW); height: var(--cupImgH); border-radius: 0;
  background: var(--img-cup) center / 100% 100% no-repeat;
}
.has-img .st-cup-front {
  width: var(--cupImgW); height: var(--cupImgH); border-radius: 0; box-shadow: none;
  background: var(--img-cup-front) center / 100% 100% no-repeat; filter: drop-shadow(0 18px 26px rgba(0, 0, 0, .5));
}
.has-img .st-cup-front::before, .has-img .st-cup-front::after, .has-img .st-tip { display: none; }
.has-img .st-stick { border-radius: 0; box-shadow: none; background: var(--img-stick) center / 100% 100% no-repeat; }
.has-img .st-stick.w { background-image: var(--img-stick-win); }
.has-img .st-stick.won { filter: drop-shadow(0 0 12px rgba(255, 200, 61, .9)); }
.st-log { display: flex; gap: 6px; overflow-x: auto; min-height: 46px; padding: 8px 14px 6px; scrollbar-width: none; }
.st-log::-webkit-scrollbar { display: none; }
.st-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; background: rgba(255, 255, 255, .07); font-size: 13px; font-weight: 600; }
.st-chip.win { background: var(--gold); color: #1A1300; }
.st-chip-dot { width: 8px; height: 8px; border-radius: 50%; }
.st-chip-res { opacity: .72; font-weight: 800; }

/* ---------------------------------------------------------------- 카드 */
.cd-wrap { position: absolute; inset: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); padding: 4px 14px 6px; }
.cd-hud { text-align: center; padding-bottom: 8px; }
.cd-title { min-height: 1.3em; font-size: clamp(20px, 4.2vw, 30px); font-weight: 800; letter-spacing: -0.02em; }
.cd-sub { margin-top: 2px; font-size: 13px; color: var(--stage-dim); }
.cd-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 8px; }
.cd-chips:empty { display: none; }
.cd-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; background: rgba(255, 200, 61, .14); border: 1px solid rgba(255, 200, 61, .42); font-size: 13px; font-weight: 700; }
.cd-chip-rank { color: var(--gold); }
.cd-chip-dot { width: 8px; height: 8px; border-radius: 50%; }
.cd-table { position: relative; min-height: 0; }
.cd-card { position: absolute; left: 0; top: 0; width: var(--cw); height: var(--ch); transform-origin: 50% 50%; perspective: 1000px; transition: opacity .3s, filter .3s; }
.cd-table.ready .cd-card:not(.won):not(.picked) { cursor: pointer; }
.cd-table.ready .cd-card:not(.won):not(.picked):hover .cd-shake { transform: translateY(-5px); }
.cd-shake { width: 100%; height: 100%; transition: transform .15s; }
.cd-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.3, .7, .2, 1); }
.cd-inner.flipped { transform: rotateY(180deg); }
.cd-face { position: absolute; inset: 0; border-radius: calc(var(--cw) * .1); backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.cd-back {
  display: grid; place-items: center; border: 2px solid rgba(255, 255, 255, .85); box-shadow: 0 6px 16px rgba(0, 0, 0, .35);
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 62%), repeating-linear-gradient(45deg, #5B3FE0 0 6px, #6C4DFF 6px 12px);
}
.cd-num {
  font-weight: 900; font-size: calc(var(--cw) * .36); line-height: 1; letter-spacing: -0.03em; color: #fff;
  text-shadow: 0 2px calc(var(--cw) * .06) rgba(20, 10, 60, .55); transition: opacity .3s;
}
.cd-card.hinted .cd-num { opacity: 0; }
.cd-corner { position: absolute; left: 9%; top: 7%; font-size: calc(var(--cw) * .1); font-weight: 800; color: var(--grey-5); }
.cd-hint {
  position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .35s;
  font-weight: 900; font-size: calc(var(--cw) * .44); color: var(--gold); text-shadow: 0 0 calc(var(--cw) * .12) rgba(255, 200, 61, .85);
}
.cd-card.hinted .cd-hint { opacity: 1; }

.cd-front {
  transform: rotateY(180deg); background: #fff; color: var(--ink); border: 2px solid #fff; text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--cw) * .04); padding: 8%;
  box-shadow: inset 0 calc(var(--cw) * .05) 0 var(--c);
}
.cd-rank { font-size: calc(var(--cw) * .1); font-weight: 800; color: var(--gold-2); text-align: center; line-height: 1.2; word-break: keep-all; overflow-wrap: anywhere; }
.cd-name { font-size: clamp(9px, calc(var(--cw) * .16), 40px); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; }
.cd-card.won .cd-front { box-shadow: inset 0 calc(var(--cw) * .05) 0 var(--c), 0 0 0 3px var(--gold); }
.cd-table.focus .cd-card:not(.picked) { opacity: .22; filter: saturate(.5); }
/* 그림 파일: 뒷면은 보라 무늬 카드, 앞면은 상아색 카드(빌드에서 그림 파일을 켰을 때) */
.has-img .cd-face { border-radius: calc(var(--cw) * .06); }
.has-img .cd-back { border: 0; background: var(--img-card-back) center / 100% 100% no-repeat, #4B2FD0; box-shadow: 0 6px 16px rgba(0, 0, 0, .42); }
.has-img .cd-num { font-size: calc(var(--cw) * .27); text-shadow: 0 2px calc(var(--cw) * .04) rgba(10, 5, 40, .8); }
.has-img .cd-front { border: 0; padding: 14% 12%; background: var(--img-card-face) center / 100% 100% no-repeat, #FFF8EA; box-shadow: 0 6px 16px rgba(0, 0, 0, .32); }
.has-img .cd-corner { left: 0; right: 0; top: 9%; text-align: center; color: #9A7A3A; }
.has-img .cd-name::before {
  content: ''; display: block; width: calc(var(--cw) * .085); height: calc(var(--cw) * .085); border-radius: 50%;
  margin: 0 auto calc(var(--cw) * .05); background: var(--c);
}
.has-img .cd-card.won .cd-front { box-shadow: 0 0 0 3px var(--gold), 0 0 calc(var(--cw) * .22) rgba(255, 200, 61, .55); }
.has-img .cd-card.picked .cd-back { box-shadow: 0 0 calc(var(--cw) * .35) rgba(139, 116, 255, .85); }
.cd-card.picked .cd-back { box-shadow: 0 0 0 2px #fff, 0 0 calc(var(--cw) * .35) rgba(139, 116, 255, .7); }

/* ---------------------------------------------------------------- 원판 */
.wh-wrap { position: absolute; inset: 0; }
.wh-canvas { position: absolute; inset: 0; display: block; touch-action: none; cursor: grab; }
.wh-now {
  position: absolute; left: 50%; top: 6px; z-index: 2; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 10px; max-width: 92%; min-height: 58px; padding: 10px 22px; border-radius: 999px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12);
  font-size: clamp(20px, 4.4vw, 32px); font-weight: 800; letter-spacing: -0.02em; white-space: nowrap;
  transition: background .3s, color .3s, transform .3s, box-shadow .3s;
}
.wh-now-dot { flex: none; width: 14px; height: 14px; border-radius: 50%; }
.wh-now-name { min-width: 2em; overflow: hidden; text-overflow: ellipsis; }
.wh-now.win { background: var(--gold); color: #1A1300; transform: translateX(-50%) scale(1.06); box-shadow: 0 0 40px rgba(255, 200, 61, .5); }

/* ---------------------------------------------------------------- 시트 (이마고 작은 창: 폰은 아래에서, 넓은 화면은 가운데) */
.veil {
  position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(15, 12, 40, .45); opacity: 0; transition: opacity .2s;
}
.veil.on-stage { background: rgba(3, 4, 10, .55); }
.veil.in { opacity: 1; }
.sheet {
  width: min(540px, 100%); max-height: min(88vh, 880px); overflow: auto; background: #fff; color: var(--ink);
  border-radius: 24px 24px 0 0; padding: 24px 20px calc(16px + var(--safe-b));
  transform: translateY(24px); transition: transform .32s var(--ease); box-shadow: 0 20px 60px rgba(15, 12, 40, .25);
}
.veil.in .sheet { transform: translateY(0); }
@media (min-width: 640px) { .veil { align-items: center; padding: 24px; } .sheet { border-radius: 24px; padding: 26px 24px 22px; } }
.sh-title { margin: 0 0 8px; font-size: 19px; font-weight: 800; line-height: 1.35; letter-spacing: -0.02em; }
.sh-body { margin: 0 0 20px; font-size: 14.5px; line-height: 1.6; color: var(--ink2); white-space: pre-line; }
.sh-actions { display: grid; gap: 8px; }
.sh-actions.two { grid-template-columns: 1fr 1fr; }
.sh-actions .btn-primary, .sh-actions .btn-secondary { width: 100%; height: var(--h-btn); }
.sh-close { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--paper); display: grid; place-items: center; color: var(--ink); }
.res-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.res-hl { display: flex; align-items: center; gap: 8px; min-width: 0; }
.res-trophy {
  flex: none; width: 56px; height: 56px; margin: -10px 0 -10px -6px; object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(199, 138, 0, .35)); animation: tro-pop .7s cubic-bezier(.3, 1.6, .5, 1) both;
}
@keyframes tro-pop { from { opacity: 0; transform: scale(.3) rotate(-14deg); } to { opacity: 1; transform: none; } }
.res-kicker { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px; background: #FFF4D1; color: #8A5A00; font-weight: 700; font-size: 14px; }
.res-winners { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.res-winners li { display: flex; align-items: center; gap: 12px; min-width: 0; }
.res-winners .res-name { font-size: clamp(30px, 8vw, 44px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; overflow-wrap: anywhere; }
.res-winners.many .res-name { font-size: 22px; font-weight: 700; }
.res-dot { flex: none; width: 14px; height: 14px; border-radius: 50%; }
.res-tag { margin-left: auto; flex: none; font-size: 14px; font-weight: 600; color: var(--ink3); }
.res-meta { margin: 12px 0 18px; font-size: 14px; color: var(--ink3); }
.res-actions { display: grid; gap: 8px; }
.res-actions .btn-primary { width: 100%; height: var(--h-btn-lg); }
.res-actions .btn-text { justify-self: center; }
.res-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.res-row .btn-secondary { width: 100%; padding: 0 10px; font-size: 15px; }
.res-details { margin-top: 14px; border-top: 1px solid var(--grey-2); padding-top: 10px; }
.res-details summary { cursor: pointer; font-weight: 650; font-size: 15px; padding: 6px 0; }
.res-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; max-height: 300px; overflow: auto; }
.res-list li { display: flex; align-items: center; gap: 10px; padding: 7px 6px; font-size: 15px; border-radius: 10px; }
.res-list li.hl { background: #FFF6DB; font-weight: 700; }
.res-list .res-dot { width: 10px; height: 10px; }
.res-list .res-tag { font-size: 13px; }
.res-more { margin: 6px 0 0; font-size: 13px; color: var(--ink3); }
.res-fair { margin: 14px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--ink3); white-space: pre-line; }

/* 알림: 위 가운데 짙은 알약(이마고 알림) */
.toast {
  position: fixed; left: 50%; top: calc(76px + var(--safe-t)); z-index: 100; transform: translate(-50%, -10px);
  width: max-content; max-width: calc(100vw - 32px); padding: 12px 20px; border-radius: 999px; background: #1E1E2E; color: #fff;
  font-weight: 600; font-size: 14px; line-height: 1.4; text-align: center; box-shadow: 0 8px 32px rgba(0, 0, 0, .15);
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .35s var(--ease);
}
.toast.in { opacity: 1; transform: translate(-50%, 0); }
html.obs .toast, body.in-stage .toast { top: calc(18px + var(--safe-t)); }

@media (prefers-reduced-motion: reduce) {
  .res-trophy, .top-snd.wants, .snd-hint { animation: none; }
  .ld-res.trembling .ld-cover { animation: none; }
  .cd-inner { transition-duration: .2s; }
  .stage:not([hidden]) { animation: none; }
}

/* ---------------------------------------------------------------- 조 나누기 */
.tm-wrap { position: absolute; inset: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 10px; padding: 4px 14px 10px; }
.tm-hud { text-align: center; }
.tm-title { min-height: 1.3em; font-size: clamp(20px, 4.2vw, 30px); font-weight: 800; letter-spacing: -0.02em; }
.tm-sub { margin-top: 2px; font-size: 13px; color: var(--stage-dim); }
.tm-board { --fs: 14px; min-height: 0; display: grid; gap: 10px; align-content: start; overflow: hidden; padding: 2px; }
.tm-board.scroll { overflow: auto; }
.tm-board:not(.scroll) { align-content: center; }
.tm-team { --c: #8B74FF; min-width: 0; padding: calc(var(--fs) * .7) calc(var(--fs) * .7) calc(var(--fs) * .8); border-radius: 16px; background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .09); transition: box-shadow .3s, background .3s; }
.tm-team.hit { animation: tmHit .45s ease-out; }
@keyframes tmHit { from { box-shadow: 0 0 0 2px var(--c) inset, 0 0 22px -6px var(--c); } to { box-shadow: 0 0 0 0 transparent inset; } }
.tm-team.done { background: rgba(255, 255, 255, .07); box-shadow: 0 0 0 1.5px var(--c) inset; animation: tmDone .55s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes tmDone { 0% { transform: scale(.97); } 60% { transform: scale(1.02); } 100% { transform: none; } }
.tm-head { display: flex; align-items: center; gap: .5em; margin-bottom: .6em; font-size: calc(var(--fs) * 1.08); font-weight: 800; }
.tm-dot { flex: none; width: .72em; height: .72em; border-radius: 50%; background: var(--c); }
.tm-name { min-width: 0; }
.tm-count { margin-left: auto; font-size: .82em; font-weight: 700; color: var(--stage-dim); font-variant-numeric: tabular-nums; }
.tm-list { display: flex; flex-wrap: wrap; gap: calc(var(--fs) * .36); }
.tm-chip { display: inline-flex; align-items: center; max-width: 100%; padding: .3em .66em .3em .5em; border-radius: 999px; background: rgba(255, 255, 255, .1); color: var(--stage-text); font-size: var(--fs); font-weight: 650; line-height: 1.25; overflow-wrap: anywhere; }
.tm-chip::before { content: ''; flex: none; width: .44em; height: .44em; margin-right: .42em; border-radius: 50%; background: var(--c); }
.tm-chip.pending { visibility: hidden; }
.tm-chip.lead { background: rgba(255, 200, 61, .16); box-shadow: inset 0 0 0 1px rgba(255, 200, 61, .5); }
.tm-lead { margin-left: .4em; padding: .05em .45em; border-radius: 999px; background: var(--gold); color: #1A1300; font-size: .7em; font-weight: 800; }
.tm-chip.pop { animation: tmPop .34s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes tmPop { from { transform: scale(.55); } to { transform: none; } }
.tm-deck { justify-self: center; display: flex; flex-direction: column; align-items: center; gap: 6px; transition: opacity .4s, transform .4s; perspective: 600px; }
.tm-deck.gone { opacity: 0; transform: translateY(14px); pointer-events: none; }
.tm-card { min-width: 168px; max-width: min(86vw, 560px); padding: .5em 1.1em; display: grid; place-items: center; border-radius: 14px; background: #fff; color: var(--ink); font-size: clamp(20px, 2.3vw, 36px); font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; box-shadow: 0 0 0 4px rgba(255, 255, 255, .08), 0 14px 34px rgba(0, 0, 0, .4); }
.tm-card.turn { animation: tmTurn .2s ease-out; }
@keyframes tmTurn { from { transform: rotateX(75deg); } to { transform: none; } }
.tm-left { font-size: 13px; color: var(--stage-dim); font-variant-numeric: tabular-nums; }
.tm-layer { position: absolute; inset: 0; pointer-events: none; }
.tm-fly { position: absolute; display: flex; align-items: center; justify-content: center; padding: 0 .6em; border-radius: 999px; background: #fff; color: var(--ink); border: 2px solid var(--c); font-weight: 800; white-space: nowrap; box-shadow: 0 8px 22px rgba(0, 0, 0, .38); will-change: transform; box-sizing: border-box; }

/* 결과: 조 목록 */
.res-groups { display: grid; gap: 10px; margin-top: 14px; max-height: min(46vh, 420px); overflow: auto; padding-right: 2px; }
.res-group { --c: var(--accent); padding: 14px 16px; border-radius: var(--r-md); background: var(--warm); }
.res-ghead { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.res-ghead .res-dot { width: 12px; height: 12px; background: var(--c); }
.res-gname { font-size: 17px; font-weight: 700; }
.res-gcount { margin-left: auto; font-size: 14px; font-weight: 600; color: var(--ink3); }
.res-gmembers { display: flex; flex-wrap: wrap; gap: 6px; }
.res-gchip { padding: 5px 11px; border-radius: 999px; background: #fff; font-size: 15px; font-weight: 600; }
.res-gchip.lead { border-color: #E8C35A; background: #FFF8E1; }
.res-lead { margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: #1A1300; color: #FFD66B; font-size: 11px; font-weight: 800; vertical-align: 1px; }
.res-row.one { grid-template-columns: 1fr; }
/* 짝꿍: 짝마다 한 줄. 넓으면 두 줄씩 나란히 */
.res-groups.pairs { grid-template-columns: repeat(auto-fill, minmax(min(100%, 236px), 1fr)); gap: 8px; }
.res-groups.pairs .res-group { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.res-groups.pairs .res-ghead { flex: none; margin: 0; gap: 6px; }
.res-groups.pairs .res-ghead .res-dot { width: 10px; height: 10px; }
.res-groups.pairs .res-gname { font-size: 14px; font-weight: 700; color: var(--ink2); white-space: nowrap; }
.res-groups.pairs .res-gcount { display: none; }
.res-groups.pairs .res-gmembers { flex: 1; min-width: 0; gap: 5px; }
.res-groups.pairs .res-gchip { padding: 5px 10px; }

/* 결과 링크 · 기록 · 결과 이미지 */
.res-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 10px; }
.ml-row.one { grid-template-columns: minmax(0, 1fr); }
.ml-hist { justify-self: center; }
.btn-secondary.is-off { opacity: .45; }
.sh-actions a.btn-primary, .sh-actions a.btn-secondary { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.img-sheet .sh-scroll { display: grid; justify-items: center; }
.img-preview { display: block; width: auto; max-width: 100%; max-height: min(56vh, 520px); border-radius: 16px; background: #080913; box-shadow: 0 8px 26px rgba(17, 17, 20, .18); }

/* 언어 안내 · 소개와 자주 묻는 질문 */
.lang-hint { position: fixed; z-index: 40; top: calc(72px + var(--safe-t)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 24px); padding: 6px 6px 6px 16px; border-radius: 999px; background: #fff; box-shadow: 0 18px 50px rgba(17, 17, 21, .14), 0 0 0 1px rgba(0, 0, 0, .06); display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink3); }
.lang-hint[hidden] { display: none; }
.lang-hint a { font-weight: 650; color: var(--accent-ink); text-decoration: none; }
.lang-hint button { margin-left: 2px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--paper); display: grid; place-items: center; color: var(--ink3); }

/* 고르기 아래: 소개 · 자주 묻는 질문. 고르기 판(왼쪽 붙어 다니는 명단 판)과 다른 덩어리라 겹치지 않는다 */
.more { max-width: calc(var(--max) + var(--gut) * 2); margin: 0 auto; padding: 0 var(--gut) 24px; }
/* 장면 사이 점선 띠(이마고) */
.dots { height: 38px; margin-top: 40px; background-image: radial-gradient(#D9D9DE 1.3px, transparent 1.4px); background-size: 12px 12px; background-position: center; background-repeat: repeat-x; opacity: .9; }
/* 장면 머리말: 머리글(강조색) -> 왼쪽 두 줄 제목 | 오른쪽 설명 */
.about { padding: 48px 0 8px; }
.eye { margin: 0 0 12px; font-size: 18px; line-height: 1.5; font-weight: 650; color: var(--accent-ink); letter-spacing: -0.01em; }
.about-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: 20px 56px; align-items: end; }
.sec-h { margin: 0; font-size: clamp(28px, 3.1vw, 44px); line-height: 1.38; font-weight: 650; letter-spacing: -0.022em; text-wrap: balance; }
.sec-h .acc { display: inline-block; text-wrap: balance; }
.sec-lead { margin: 0; padding-bottom: 6px; font-size: 19px; line-height: 1.68; color: #1E1E22; white-space: pre-line; text-wrap: pretty; }
/* 자주 묻는 질문: 따뜻한 판 아코디언, 첫 칸은 열어 둔다 */
.faq-wrap { margin-top: 88px; scroll-margin-top: 84px; }
.faq-h { margin-bottom: 36px; text-align: center; }
.faq { max-width: 1080px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq-item { border-radius: var(--r-lg); background: var(--warm); }
.faq-item summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 28px; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.45; color: rgba(0, 0, 0, .82); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary svg { flex: none; width: 22px; height: 22px; color: #6E6E73; stroke-width: 2; transition: transform .3s var(--ease); }
.faq-item[open] summary svg { transform: rotate(180deg); }
.faq-item p { margin: 0; padding: 0 28px 26px; font-size: 17px; line-height: 1.6; color: rgba(0, 0, 0, .62); white-space: pre-line; }
@media (prefers-reduced-motion: no-preference) {
  .faq-item[open] > p { animation: faq-in .35s var(--ease) both; }
  @supports (interpolate-size: allow-keywords) {
    .faq-item { interpolate-size: allow-keywords; }
    .faq-item::details-content { block-size: 0; overflow-y: clip; transition: block-size .35s var(--ease), content-visibility .35s allow-discrete; }
    .faq-item[open]::details-content { block-size: auto; }
  }
}
@keyframes faq-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) { .about-head { grid-template-columns: minmax(0, 1fr); } .faq-wrap { margin-top: 64px; } }
@media (max-width: 767px) {
  .dots { margin-top: 28px; }
  .about { padding-top: 32px; }
  .eye { font-size: 15px; margin-bottom: 8px; }
  .sec-h { font-size: 28px; }
  .sec-lead { font-size: 17px; }
  .faq-h { margin-bottom: 24px; }
}
@media (max-width: 640px) { .faq-item summary { padding: 20px; font-size: 16.5px; } .faq-item p { padding: 0 20px 22px; font-size: 15.5px; } }

/* 로그인 · 계정 */
.acct-line { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 8px; margin: -2px 0 12px; }
.acct-who { font-size: 14px; line-height: 1.5; color: var(--grey-5); }
.acct-line .btn-text { height: 32px; padding: 0 4px; font-size: 14px; color: var(--accent); }
.login-actions { margin-top: 4px; }
/* 구글 · 애플 로그인: 공식 로고 + 흰 바탕 테두리 단추(이마고 로그인과 같은 모양, 두 회사 지침 모두 허용) */
.btn-login { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 56px; border-radius: var(--r-md); font-size: 16px; font-weight: 650; letter-spacing: -0.01em; border: 1px solid #DADAE0; background: #fff; color: var(--ink); transition: background .15s; }
.btn-login:hover { background: #F7F7F9; }
.btn-login.apple { background: #fff; border-color: #DADAE0; color: #000; }
.btn-login.is-off { opacity: .5; }
.login-note { margin: 14px 2px 0; font-size: 13px; line-height: 1.6; color: var(--grey-5); }
.login-note a { color: var(--ink-2); font-weight: 700; }
.login-warn { margin: 0 0 12px; padding: 12px 14px; border-radius: 14px; background: #FFF4D1; color: #6B4700; font-size: 14px; line-height: 1.55; }
.acct-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--grey-1); }
.acct-card svg { flex: none; width: 24px; height: 24px; }
.acct-txt { min-width: 0; }
.acct-mail { font-weight: 800; font-size: 16px; overflow-wrap: anywhere; }
.acct-via { margin-top: 2px; font-size: 13px; color: var(--grey-5); }
.btn-text.danger { justify-self: center; color: #C2410C; }

/* 카드 앞뒤 가리기: 3D 뒷면 숨김(backface-visibility)을 못 쓰는 브라우저에서도 뒤집기 전 이름이 비치지 않게
   반쯤 돌았을 때(곡선상 약 0.11초) 앞뒤를 바꿔 보여 준다 */
.cd-back { transition: visibility 0s linear .11s; }
.cd-front { visibility: hidden; transition: visibility 0s linear .11s; }
.cd-inner.flipped .cd-front { visibility: visible; }
.cd-inner.flipped .cd-back { visibility: hidden; }

/* 결과 「전체 순서」 펼치기: 기본 삼각형 표시 대신 꺾쇠 */
.res-details summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.res-details summary::-webkit-details-marker { display: none; }
.res-details summary::after { content: ''; flex: none; width: 7px; height: 7px; border-right: 2px solid var(--grey-5); border-bottom: 2px solid var(--grey-5); transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s; }
.res-details[open] summary::after { transform: rotate(225deg) translate(-2px, -2px); }

/* 처음 그릴 때 자리가 출렁이지 않게 설명 줄의 높이를 미리 잡아 둔다 */
.rule-desc { min-height: 3em; }

/* ---------------------------------------------------------------- 링크로 보내기 · 엑셀 저장 */
.link-box { display: grid; gap: 6px; margin: 4px 0 18px; padding: 14px 16px; border-radius: 16px; background: var(--grey-1); border: 1px solid var(--grey-2); }
.link-meta { font-size: 13px; font-weight: 800; color: var(--grey-5); }
.link-url { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); word-break: break-all; }
.hist-csv { justify-self: center; margin: 8px auto 0; display: block; }

/* ---------------------------------------------------------------- 다른 사이트에 끼워 쓸 때(?embed=1) */
.embed-wait { display: none; }
html.embed .more, html.embed .foot-top, html.embed .foot-biz, html.embed #acctBtn, html.embed #langBtn, html.embed .lang-hint, html.embed .gate { display: none !important; }
html.embed .site-foot { padding-top: 8px; }
html.embed-stage .app { display: none; }
html.embed-stage body:not(.in-stage) .embed-wait {
  position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: var(--stage-bg); color: var(--stage-text); text-align: center; padding: 24px;
}
.embed-wait img { width: 56px; height: 56px; border-radius: 14px; }
.embed-wait b { font-size: 22px; font-weight: 900; letter-spacing: -0.03em; }
.embed-wait span { font-size: 15px; color: var(--stage-dim); }

/* ---------------------------------------------------------------- 마니또: 고르기 화면 */
.game-extra { display: grid; gap: 8px; margin-top: 16px; }
.gx-label { padding: 0 4px; font-size: 13px; font-weight: 800; color: var(--grey-5); }
.pics .mn-card .gc-icon img.gc-tall { transform: rotate(-9deg) scale(.86); border-radius: 3px; }
.pics .mn-card[aria-pressed="true"] .gc-icon img.gc-tall { transform: rotate(-4deg) scale(.95); }
.mn-again { display: block; height: 36px; margin: 6px 0 0; padding: 0 4px; font-size: 14px; color: var(--accent); }
.mn-input { margin: 0 0 12px; }
.mn-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 4px; }
.mn-field .sh-actions { margin-top: 16px; }
.mn-switch {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 56px; margin: 0 0 12px;
  padding: 0 16px; border: 1px solid var(--grey-2); border-radius: 16px; background: #fff; font-size: 16px; font-weight: 800; color: var(--ink); text-align: left;
}
.mn-sw-track { position: relative; flex: none; width: 50px; height: 30px; border-radius: 999px; background: var(--grey-3); transition: background .2s; }
.mn-sw-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .22s cubic-bezier(.3, .7, .2, 1); }
.mn-switch[aria-checked="true"] .mn-sw-track { background: var(--accent); }
.mn-switch[aria-checked="true"] .mn-sw-track::after { transform: translateX(20px); }
.mn-ms-area:disabled { opacity: .45; background: var(--grey-1); }
.mn-ms-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mn-ms-foot .pz-note { margin: 10px 2px 4px; }
.mn-ms-foot .btn-text { flex: none; height: 36px; font-size: 14px; }
.mn-ms-foot.off .pz-note { opacity: .5; }

/* 링크 보내기 시트 */
.mn-prog { display: grid; gap: 8px; margin: 2px 0 12px; }
.mn-ptxt { font-size: 14px; font-weight: 800; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.mn-bar { display: block; height: 8px; border-radius: 999px; background: var(--grey-2); overflow: hidden; }
.mn-bar i { display: block; width: 0; height: 100%; border-radius: 999px; background: var(--accent); transition: width .35s cubic-bezier(.3, .7, .2, 1); }
.mn-prog.all .mn-bar i { background: #1F9D63; }
.mn-list { display: grid; gap: 2px; }
.mn-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 54px; padding: 4px 4px 4px 8px; border-radius: 14px; }
.mn-row:hover { background: var(--grey-1); }
.mn-name { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.mn-go {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 78px; height: 38px; padding: 0 14px;
  border: 0; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 800;
}
.mn-go svg { stroke-width: 2.8; }
.mn-go[aria-pressed="true"] { background: #E6F6EE; color: #11744A; }
.mn-reveal { margin: 14px 0 2px; padding: 16px; border-radius: 16px; background: #FFF8E6; border: 1px solid #F1DB98; }
.mn-rv-t { font-size: 15px; font-weight: 800; color: #6B4700; }
.mn-rv-s { margin: 4px 0 12px; font-size: 13.5px; line-height: 1.55; color: #7A5A12; }
.mn-rv-btn { width: 100%; }
.mn-listcopy { display: block; margin: 4px auto 0; font-size: 14px; }

/* 공개 결과(짝 목록) */
.mn-pairs { list-style: none; margin: 14px 0 0; padding: 0 2px 0 0; display: grid; gap: 2px; max-height: min(50vh, 440px); overflow: auto; }
.mn-pairs li { display: grid; grid-template-columns: 10px minmax(0, 1fr) 18px 10px minmax(0, 1fr); align-items: center; gap: 8px; padding: 10px; border-radius: 12px; font-size: 16px; font-weight: 700; }
.mn-pairs li:nth-child(odd) { background: var(--grey-1); }
.mn-pairs li.first:not(:first-child) { margin-top: 10px; }
.mn-pairs .res-dot { width: 10px; height: 10px; }
.mn-par { display: grid; place-items: center; color: var(--grey-4); }
.mn-pg, .mn-pr { min-width: 0; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- 마니또: 카드(앞: 이름, 뒤: 보라 무늬)
   겹: .mc(자리) > .mc-sh(떨림 · 원근) > .mc-in(뒤집기) > 앞뒤 면 */
.mc { position: relative; display: block; width: var(--w); height: calc(var(--w) * 1.5); padding: 0; border: 0; background: none; color: inherit; font: inherit; }
.mc-sh, .mc-in, .mc-face { display: block; }
.mc-sh { position: absolute; inset: 0; perspective: 1100px; }
.mc-in { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .62s cubic-bezier(.3, .7, .2, 1); }
.mc.down .mc-in { transform: rotateY(180deg); }
.mc-face { position: absolute; inset: 0; border-radius: calc(var(--w) * .07); backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.mc-front {
  --c: #7565F2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--w) * .05);
  padding: 14% 11%; text-align: center; color: var(--ink); background: #FFF8EA; border: 2px solid #fff; box-shadow: 0 8px 22px rgba(0, 0, 0, .36);
}
.mc-back {
  transform: rotateY(180deg); display: grid; place-items: center; border: 2px solid rgba(255, 255, 255, .85); box-shadow: 0 8px 22px rgba(0, 0, 0, .4);
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 62%), repeating-linear-gradient(45deg, #5B3FE0 0 6px, #6C4DFF 6px 12px);
}
.has-img .mc-front { border: 0; background: var(--img-card-face) center / 100% 100% no-repeat, #FFF8EA; }
.has-img .mc-back { border: 0; background: var(--img-card-back) center / 100% 100% no-repeat, #4B2FD0; }
/* 3D 뒷면 숨김을 못 쓰는 브라우저에서도 뒤집기 전 이름이 비치지 않게: 반쯤 돌았을 때 앞뒤를 바꿔 보여 준다 */
.mc-front { transition: visibility 0s linear .12s; }
.mc-back { visibility: hidden; transition: visibility 0s linear .12s; }
.mc.down .mc-back { visibility: visible; }
.mc.down .mc-front { visibility: hidden; }
.mc-dot { flex: none; width: calc(var(--w) * .085); height: calc(var(--w) * .085); border-radius: 50%; background: var(--c); }
.mc-name {
  max-width: 100%; font-size: clamp(10px, calc(var(--w) * .16), 60px); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em;
  overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.mc-cap { font-size: clamp(10px, calc(var(--w) * .062), 16px); font-weight: 800; letter-spacing: .04em; color: #9A7A3A; }
.mc-seal {
  position: absolute; left: 50%; bottom: 10%; width: calc(var(--w) * .2); height: calc(var(--w) * .2); margin-left: calc(var(--w) * -.1);
  display: grid; place-items: center; border-radius: 50%; color: #5A3A00;
  background: radial-gradient(circle at 34% 30%, #FFE9A3, #F2B92B 55%, #B07800); box-shadow: 0 2px 6px rgba(90, 58, 0, .35), inset 0 -2px 3px rgba(90, 58, 0, .25);
  transform: scale(0); transition: transform .38s cubic-bezier(.3, 1.6, .5, 1) .12s;
}
.mc-seal svg { width: 56%; height: 56%; stroke-width: 2.6; }
.mc.sealed .mc-seal { transform: scale(1); }
.mc-tap { padding: 0 18%; text-align: center; font-size: clamp(12px, calc(var(--w) * .085), 22px); font-weight: 800; letter-spacing: -0.01em; color: #fff; text-shadow: 0 2px 10px rgba(10, 5, 40, .85); }
.mc.glow .mc-back { box-shadow: 0 0 0 2px rgba(255, 255, 255, .75), 0 0 calc(var(--w) * .32) rgba(139, 116, 255, .95); }
@keyframes mcFloat { 0%, 100% { transform: translateY(0) rotate(-1.4deg); } 50% { transform: translateY(-8px) rotate(1.4deg); } }

/* 정하기(진행자) */
.mn-wrap { position: absolute; inset: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); padding: 4px 14px 8px; }
.mn-hud { text-align: center; padding-bottom: 10px; }
.mn-title { min-height: 1.3em; font-size: clamp(20px, 4.2vw, 30px); font-weight: 800; letter-spacing: -0.02em; }
.mn-sub { margin-top: 2px; font-size: 13px; color: var(--stage-dim); }
.mn-table { --w: 60px; position: relative; min-height: 0; }
.mn-tile { position: absolute; left: 0; top: 0; will-change: transform; }
.mn-tile .mc-front { padding: 12% 9% 26%; }
.mn-tile .mc-name { -webkit-line-clamp: 2; font-size: clamp(9px, calc(var(--w) * .17), 34px); }

/* 받은 링크(한 사람) */
.mo-wrap { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.mo-col { min-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 12px 20px 24px; text-align: center; }
.mo-col > :first-child { margin-top: auto; }
.mo-col > :last-child { margin-bottom: auto; }
.mo-kicker { font-size: 14px; font-weight: 800; letter-spacing: .01em; color: var(--gold); }
.mo-who { max-width: 22ch; font-size: clamp(20px, 5vw, 30px); font-weight: 800; line-height: 1.3; letter-spacing: -0.02em; }
.mo-card { --w: min(56vw, 240px, 32vh); flex: none; margin: 4px 0; cursor: pointer; }
.mo-card.down:not(.glow) .mc-sh { animation: mcFloat 3.2s ease-in-out infinite; }
.mo-card:focus-visible { outline: 3px solid #7565F2; outline-offset: 8px; border-radius: 14px; }
.mo-hint { min-height: 1.4em; font-size: 14px; color: var(--stage-dim); transition: opacity .3s; }
.mo-hint.gone { opacity: 0; }
.mo-info { width: min(100%, 420px); display: grid; gap: 10px; opacity: 0; transform: translateY(10px); transition: opacity .45s .1s, transform .45s .1s, filter .3s; }
.mo-info.in { opacity: 1; transform: none; }
.mo-info.veiled { filter: blur(8px); opacity: .45; pointer-events: none; }
.mo-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.mo-chip { display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 999px; background: rgba(255, 200, 61, .14); border: 1px solid rgba(255, 200, 61, .42); color: #FFE7A6; font-size: 14px; font-weight: 700; }
.mo-note { margin: 0; padding: 14px 16px; border-radius: 16px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); font-size: 15px; line-height: 1.6; color: var(--stage-text); white-space: pre-wrap; text-align: left; }
.mo-ms { display: grid; gap: 6px; padding: 14px; border-radius: 16px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); text-align: left; }
.mo-ms-t { margin: 0 2px 2px; font-size: 13px; font-weight: 800; color: var(--stage-dim); }
.mo-m { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .06); color: var(--stage-text); font-size: 15px; font-weight: 650; line-height: 1.4; text-align: left; }
.mo-ck { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); display: grid; place-items: center; transition: background .2s, border-color .2s; }
.mo-ck svg { width: 14px; height: 14px; stroke-width: 3; opacity: 0; }
.mo-m[aria-pressed="true"] .mo-ck { background: var(--gold); border-color: var(--gold); color: #1A1300; }
.mo-m[aria-pressed="true"] .mo-ck svg { opacity: 1; }
.mo-m[aria-pressed="true"] .mo-mt { color: var(--stage-dim); text-decoration: line-through; text-decoration-color: rgba(163, 168, 198, .6); }

/* 공개하는 날 */
.mw-wrap { position: absolute; inset: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 8px; padding: 6px 14px 10px; }
.mw-hud { text-align: center; }
.mw-title { min-height: 1.3em; font-size: clamp(22px, 4.6vw, 40px); font-weight: 800; letter-spacing: -0.025em; }
.mw-sub { min-height: 1.2em; margin-top: 4px; font-size: 15px; color: var(--stage-dim); }
.mw-pair { --w: 160px; position: relative; min-height: 0; }
.mw-card { position: absolute; left: 0; top: 0; transition: transform .6s cubic-bezier(.2, .8, .2, 1), opacity .45s; will-change: transform; }
.mw-card.instant { transition: none; }
.mw-card.float .mc-sh { animation: mcFloat 3.2s ease-in-out infinite; }
.mw-card.hit .mc-sh { animation: mwHit .5s cubic-bezier(.3, 1.5, .5, 1); }
.mw-card.hit .mc-front { box-shadow: 0 0 0 3px var(--gold), 0 0 calc(var(--w) * .25) rgba(255, 200, 61, .55); }
@keyframes mwHit { 0% { transform: scale(.94); } 60% { transform: scale(1.06); } 100% { transform: none; } }
.mw-arrow { position: absolute; left: 50%; top: 50%; color: var(--gold); opacity: 0; transform: translate(-50%, -50%) scale(.6); transition: opacity .4s, transform .4s; }
.mw-arrow.on { opacity: 1; transform: translate(-50%, -50%); }
.mw-arrow svg { display: block; width: 100%; height: auto; stroke-width: 3; }
.mw-chain { max-height: min(26vh, 200px); overflow-y: auto; display: grid; gap: 6px; justify-items: center; padding: 2px; }
.mw-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 6px; }
.mw-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); font-size: 14px; font-weight: 700; color: var(--stage-text); white-space: nowrap; }
.mw-chip.pop { animation: tmPop .34s cubic-bezier(.3, 1.6, .5, 1); }
.mw-dot { width: 8px; height: 8px; border-radius: 50%; }
.mw-to { display: inline-grid; place-items: center; color: var(--gold); }
.mw-to svg { width: 16px; height: 16px; stroke-width: 2.6; }
@media (prefers-reduced-motion: reduce) {
  .mo-card.down:not(.glow) .mc-sh, .mw-card.float .mc-sh, .mw-card.hit .mc-sh, .mw-chip.pop { animation: none; }
  .mc-in { transition-duration: .2s; }
}

/* ---------------------------------------------------------------- 폰으로 참가하기 */
.chip-ic { display: inline-flex; align-items: center; gap: 6px; }
.chip-ic svg { stroke-width: 2; }
.chip.live { position: relative; border-color: #86E0A9; background: #F2FBF5; }
.chip.live::after { content: ''; position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 2px #fff; animation: lbLive 1.8s ease-in-out infinite; }
@keyframes lbLive { 0%, 100% { transform: scale(1); } 50% { transform: scale(.7); } }
.lb-wrap {
  position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(16px, 3vw, 40px);
  padding: 8px clamp(14px, 3vw, 40px) 12px;
}
.lb-join { min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(10px, 1.6vh, 18px); text-align: center; }
.lb-title { font-size: clamp(22px, 3vw, 40px); font-weight: 800; letter-spacing: -0.025em; }
.lb-qr { position: relative; flex: none; width: min(100%, 46vh, 420px); aspect-ratio: 1; padding: 3.5%; border-radius: 24px; background: #fff; box-shadow: 0 20px 60px rgba(0, 0, 0, .45), 0 0 0 6px rgba(255, 255, 255, .06); }
.lb-qrsvg { display: block; width: 100%; height: 100%; }
.lb-qrsvg rect, .lb-qrsvg path { stroke: none; }
.lb-closed { position: absolute; inset: 0; display: none; place-items: center; border-radius: 24px; background: rgba(8, 9, 19, .8); color: #fff; font-size: clamp(18px, 2.4vw, 28px); font-weight: 800; }
.lb-wrap.closed .lb-closed { display: grid; }
.lb-how { display: grid; gap: 2px; font-size: clamp(14px, 1.4vw, 18px); line-height: 1.45; color: var(--stage-dim); }
.lb-how span:last-child { color: var(--stage-text); font-weight: 700; }
.lb-code { display: flex; align-items: baseline; gap: 12px; }
.lb-code-k { font-size: 14px; font-weight: 800; color: var(--stage-dim); }
.lb-code-v { font-size: clamp(34px, 5vw, 64px); font-weight: 900; letter-spacing: .06em; line-height: 1; color: var(--gold); font-variant-numeric: tabular-nums; }
.lb-people { min-height: 0; display: flex; flex-direction: column; padding: 18px; border-radius: 24px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); }
.lb-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.lb-ptitle { font-size: clamp(18px, 1.3vw, 26px); font-weight: 800; }
.lb-count { display: inline-grid; place-items: center; min-width: 1.9em; height: 1.7em; padding: 0 .55em; border-radius: 999px; background: var(--gold); color: #1A1300; font-size: clamp(15px, 1.1vw, 21px); font-weight: 900; font-variant-numeric: tabular-nums; }
.lb-clear { margin-left: auto; height: 34px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--stage-dim); font-size: 14px; font-weight: 700; }
.lb-clear:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.lb-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; }
.lb-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: clamp(42px, 5.4vh, 58px); padding: 0 .6em 0 .95em; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .1); color: var(--stage-text); font-size: clamp(17px, 1.6vw, 26px); font-weight: 700; }
.lb-chip:hover { background: rgba(255, 255, 255, .16); }
.lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-x { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%; color: var(--stage-dim); opacity: 0; transition: opacity .15s; }
.lb-chip:hover .lb-x, .lb-chip:focus-visible .lb-x { opacity: 1; }
@media (hover: none) { .lb-x { opacity: .55; } }
.lb-x svg { width: 14px; height: 14px; stroke-width: 2.6; }
.lb-chip.pop { animation: lbIn .9s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes lbIn { 0% { transform: scale(.55); background: rgba(255, 200, 61, .55); } 30% { transform: scale(1.06); } 100% { transform: none; background: rgba(255, 255, 255, .1); } }
.lb-empty { flex: 1; display: grid; place-content: center; gap: 6px; padding: 20px; text-align: center; color: var(--stage-dim); font-size: 15px; }
.lb-empty b { font-size: 19px; color: var(--stage-text); }
@media (max-width: 760px) {
  .lb-wrap { grid-template-columns: 1fr; grid-template-rows: auto minmax(220px, 1fr); overflow-y: auto; }
  .lb-qr { width: min(72vw, 38vh, 320px); border-radius: 18px; }
  .lb-people { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) { .lb-chip.pop, .chip.live::after { animation: none; } }

/* ---------------------------------------------------------------- 끝장판 3단계 */
/* 규칙: 세 갈래 고르기가 좁은 폰에서도 한 줄에 */
@media (max-width: 400px) { .seg button { padding: 0 11px; font-size: 13.5px; } }
.chip-ic svg .f { fill: currentColor; stroke: none; }
@media (max-width: 700px) { .wide-only { display: none !important; } }

/* 핀볼: 꾹 눌러 빨리 감기 · 처음 한 번 알려 주기 · 당첨 자리 */
.pb-wrap { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.pb-fast {
  position: absolute; left: 50%; top: 14px; z-index: 3; transform: translate(-50%, -6px); opacity: 0; pointer-events: none;
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .94); color: var(--ink); font-weight: 800; font-size: 14px; box-shadow: 0 8px 26px rgba(0, 0, 0, .35);
  transition: opacity .15s, transform .15s;
}
.pb-fast.on { opacity: 1; transform: translate(-50%, 0); }
.pb-fast svg .f { fill: currentColor; stroke: none; }
.pb-tip {
  position: absolute; left: 50%; bottom: 18px; z-index: 3; transform: translate(-50%, 8px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: rgba(20, 22, 48, .9); border: 1px solid rgba(255, 255, 255, .16); color: var(--stage-text); font-weight: 700; font-size: 14px;
  transition: opacity .3s, transform .3s;
}
.pb-tip.on { opacity: 1; transform: translate(-50%, 0); }
.pb-rank li.hot { margin: 0 -6px; padding: 0 6px; border-radius: 8px; box-shadow: inset 0 0 0 1.5px rgba(255, 200, 61, .85); }
.pb-rank li.hot .tg { color: var(--gold); font-weight: 800; }

/* 녹화 단추: 켜 두면 빨간 점, 담는 중이면 시간이 붙는다 */
.rec-btn { position: relative; }
.rec-btn .rec-dot { fill: #FF5A52; stroke: none; }
.rec-btn[aria-pressed="true"] { border-color: rgba(255, 90, 82, .6); background: rgba(255, 90, 82, .16); }
.rec-btn.on { width: auto; padding: 0 12px 0 10px; display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 90, 82, .16); }
.rec-btn.on svg { animation: recBlink 1.2s steps(2, jump-none) infinite; }
.rec-time { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; color: #FF8E88; }
.rec-time:empty { display: none; }
@keyframes recBlink { 50% { opacity: .35; } }
.vid-preview { display: block; width: auto; max-width: 100%; max-height: min(56vh, 520px); border-radius: 16px; background: #080913; box-shadow: 0 8px 26px rgba(17, 17, 20, .18); }
@media (prefers-reduced-motion: reduce) { .rec-btn.on svg { animation: none; } }

/* 방송 화면 만들기 시트 */
.obs-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.obs-label { font-weight: 800; font-size: 15px; }
.obs-sheet .seg { background: var(--grey-1); }
.obs-how { margin: 0 0 4px; padding: 12px 16px; border-radius: 16px; border: 1px solid var(--grey-2); }
.obs-how summary { font-weight: 800; font-size: 15px; cursor: pointer; }
.obs-steps { margin: 10px 0 2px; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; line-height: 1.55; color: var(--ink-2); }

/* 방송 화면(?obs=1): 무대만, 위아래 단추 없이, 배경은 투명 · 초록 · 어둡게 */
html.obs .app, html.obs .site-foot, html.obs .gate, html.obs .embed-wait, html.obs .toast { display: none !important; }
html.obs, html.obs body { overflow: hidden; }
html.obs .stage-top, html.obs .stage-bottom { display: none; }
html.obs .fx-banner { top: 18px; font-size: 22px; padding: 12px 24px; }
html.obs .pb-hud { transform: scale(1.3); transform-origin: top right; }
html.obs-bg-t, html.obs-bg-t body, html.obs-bg-t .stage { background: transparent !important; }
html.obs-bg-g, html.obs-bg-g body, html.obs-bg-g .stage { background: #00FF00 !important; }
html.obs-bg-d body { background: var(--stage-bg); }
html.obs-bg-t .stage::after, html.obs-bg-g .stage::after { display: none; }
html.obs .stage:not([hidden]) { animation: none; }
.obs-idle {
  position: fixed; inset: 0; z-index: 60; display: none; place-content: center; justify-items: center; gap: 10px; text-align: center; padding: 24px;
  color: #F3F4FA; font-family: var(--font);
}
.obs-idle.show { display: grid; }
.obs-idle b { display: inline-block; padding: 14px 26px; border-radius: 22px; background: rgba(13, 15, 36, .86); font-size: 34px; font-weight: 900; letter-spacing: -0.03em; }
.obs-idle span { display: inline-block; padding: 8px 16px; border-radius: 999px; background: rgba(13, 15, 36, .78); font-size: 20px; font-weight: 700; color: #C9CDEA; }
.obs-idle.click { cursor: pointer; }
.obs-res {
  position: absolute; left: 50%; top: 50%; z-index: 45; width: min(760px, 86vw); max-height: 86vh; overflow: hidden;
  transform: translate(-50%, -46%) scale(.96); opacity: 0; transition: opacity .45s ease, transform .55s cubic-bezier(.2, .8, .2, 1);
  padding: 34px 40px 30px; border-radius: 32px; text-align: center; color: #F3F4FA;
  background: linear-gradient(180deg, rgba(36, 30, 92, .94), rgba(12, 12, 32, .96)); border: 2px solid rgba(255, 200, 61, .55);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .55);
}
.obs-res.in { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.obs-kick { display: inline-block; padding: 8px 22px; border-radius: 999px; background: var(--gold); color: #3A2600; font-weight: 900; font-size: 24px; }
.obs-wins { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 10px; }
.obs-wins li { display: flex; align-items: center; justify-content: center; gap: 14px; min-width: 0; }
.obs-dot { flex: none; width: 18px; height: 18px; border-radius: 50%; }
.obs-name { font-size: 64px; font-weight: 900; letter-spacing: -0.03em; line-height: 1.12; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.obs-tag { flex: none; font-size: 22px; font-weight: 800; color: var(--gold); }
.obs-wins.many { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 22px; text-align: left; }
.obs-wins.many li { justify-content: flex-start; }
.obs-wins.many .obs-name { font-size: 34px; }
.obs-wins.many .obs-tag { font-size: 17px; }
.obs-wins.many .obs-dot { width: 14px; height: 14px; }
.obs-groups { margin: 20px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; text-align: left; }
.obs-groups.many { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.obs-group { padding: 12px 16px; border-radius: 18px; background: rgba(255, 255, 255, .07); border-left: 6px solid var(--c); }
.obs-group b { display: block; font-size: 24px; font-weight: 900; }
.obs-group span { display: block; margin-top: 4px; font-size: 17px; font-weight: 600; line-height: 1.45; color: #D6D9F0; }
.obs-meta { margin-top: 18px; font-size: 18px; font-weight: 600; color: #A3A8C6; }
@media (max-width: 600px) {
  .speed button:not([aria-pressed="true"]) { display: none; }
  .speed button { min-width: 40px; }
}
@media (max-width: 400px) { .rec-btn.on .rec-time { display: none; } .rec-btn.on { padding: 0; width: 38px; justify-content: center; } }

/* 사다리판: 결과 칸 선물 상자(그림이 있을 때). 길이 닿으면 떨리다가 뚜껑이 날아가고, 상자가 줄어들며 결과가 올라온다 */
.ld-res.gift { --sh: 64px; height: var(--sh); background: none; overflow: visible; }
.ld-wrap.dense .ld-res.gift { --sh: 56px; }
.ld-wrap.vertical .ld-res.gift { --sh: 66px; }
.ld-res.gift .ld-cover { background: none; border: 0; transition: none; overflow: visible; }
.ld-res.gift.open .ld-cover { transform: none; opacity: 1; pointer-events: none; }
.ld-gift {
  position: absolute; left: 50%; top: 1px; transform: translateX(-50%);
  width: min(calc(100% - 2px), calc((var(--sh) - 3px) * var(--gr))); aspect-ratio: var(--gr);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .45));
}
.ld-gb, .ld-gl { position: absolute; display: block; background-repeat: no-repeat; background-size: 100% 100%; }
.ld-gb { background-image: var(--img-ladder-gift-base); transform-origin: 50% 100%; }
.ld-gl { background-image: var(--img-ladder-gift-lid); transform-origin: 50% 90%; }
.ld-res.gift .ld-face { border-radius: 12px; opacity: 0; transform: scale(.82); }
.ld-res.gift.open .ld-face { opacity: 1; transform: none; transition: opacity .3s .32s, transform .45s .32s cubic-bezier(.3, 1.5, .5, 1); }
.ld-res.gift.trembling .ld-cover { animation: none; }
.ld-res.gift.trembling .ld-gift { animation: tremble .09s linear infinite; }
.ld-res.gift.trembling .ld-gl { animation: ldLid .16s ease-in-out infinite alternate; }
@keyframes ldLid { from { transform: translateY(0); } to { transform: translateY(-7%) rotate(-2deg); } }
.ld-res.gift.open .ld-gl { transform: translate(-10%, -120%) rotate(-24deg); opacity: 0; transition: transform .62s cubic-bezier(.15, .75, .25, 1), opacity .4s .22s; }
.ld-res.gift.open .ld-gb { transform: translateY(8%) scale(.5); opacity: 0; transition: transform .34s .24s ease-in, opacity .3s .28s; }
@media (prefers-reduced-motion: reduce) {
  .ld-res.gift.trembling .ld-gift, .ld-res.gift.trembling .ld-gl { animation: none; }
  .ld-res.gift.open .ld-gl, .ld-res.gift.open .ld-gb { transition: opacity .2s; transform: none; }
}

/* 조 나누기판: 추첨함에서 올라오는 이름표, 조 색을 입힌 깃발(그림이 있을 때) */
.tm-deck.pics { --tkh: clamp(44px, 7.4vh, 84px); gap: 2px; }
.tm-draw { position: relative; display: grid; justify-items: center; }
.tm-deck.pics .tm-card {
  position: relative; z-index: 2; height: var(--tkh); min-width: calc(var(--tkh) * 2.6); max-width: min(86vw, 560px);
  padding: 0 calc(var(--tkh) * var(--tcap) + .3em); border-radius: 0; background: none; box-shadow: none;
  color: #3B2A0E; font-size: calc(var(--tkh) * .42); filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .45));
}
.tm-deck.pics .tm-card::before {
  content: ''; position: absolute; inset: 0; z-index: -1; box-sizing: border-box;
  border-style: solid; border-color: transparent;
  border-width: calc(var(--tkh) * .49) calc(var(--tkh) * var(--tcap));
  border-image: var(--img-team-ticket) 49% 12% fill / calc(var(--tkh) * .49) calc(var(--tkh) * var(--tcap)) stretch;
}
.tm-deck.pics .tm-card.turn { animation: tmDraw .24s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes tmDraw { from { transform: translateY(40%) scale(.82); } to { transform: none; } }
.tm-box {
  position: relative; z-index: 1; width: calc(var(--tkh) * 1.34); aspect-ratio: 232 / 300; margin-top: calc(var(--tkh) * -.5);
  background: var(--img-team-box) center / contain no-repeat; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .4));
}
.tm-deck.shaking .tm-box { animation: tmShake .16s ease-in-out infinite alternate; }
@keyframes tmShake { from { transform: rotate(-3deg) translateY(1px); } to { transform: rotate(3deg) translateY(-1px); } }
.tm-flag {
  flex: none; position: relative; isolation: isolate; height: 1.7em; aspect-ratio: 147 / 192; margin: -.3em -.05em -.3em -.15em;
  background: var(--img-team-flag) center / contain no-repeat;
}
.tm-flag i {
  position: absolute; inset: 0; background: var(--c); mix-blend-mode: multiply;
  -webkit-mask: var(--img-team-flag-mask) center / contain no-repeat; mask: var(--img-team-flag-mask) center / contain no-repeat;
}
@media (prefers-reduced-motion: reduce) { .tm-deck.shaking .tm-box, .tm-deck.pics .tm-card.turn { animation: none; } }

/* ---------------------------------------------------------------- 핀볼 코스 고르기 */
.crs-pick { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 18px; align-items: center; gap: 12px; width: 100%; margin-top: 12px; padding: 8px 12px 8px 8px; border: 1px solid var(--grey-2); border-radius: 18px; background: #fff; text-align: left; transition: border-color .15s, background .15s; }
.crs-pick:hover { border-color: var(--grey-3); background: var(--grey-1); }
.crs-thumb { display: block; width: 56px; height: 40px; border-radius: 11px; background: #0E1128; }
.crs-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.crs-k { font-size: 12px; font-weight: 700; color: var(--grey-5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crs-v { font-size: 16px; font-weight: 800; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crs-len { padding: 5px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 700; white-space: nowrap; }
.crs-chev svg { display: block; color: var(--grey-4); }
@media (max-width: 380px) { .crs-pick { gap: 10px; } .crs-len { padding: 4px 8px; font-size: 12px; } }

.crs-list { display: grid; gap: 10px; margin: 4px 0 16px; }
.crs-card { position: relative; display: grid; grid-template-columns: 116px minmax(0, 1fr); align-items: center; gap: 14px; padding: 10px 46px 10px 10px; border: 1.5px solid var(--grey-2); border-radius: 20px; background: #fff; text-align: left; transition: border-color .15s, box-shadow .15s; }
.crs-card:hover { border-color: var(--grey-3); }
.crs-card[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.crs-cv { display: block; width: 116px; height: 88px; border-radius: 14px; background: #0E1128; }
.crs-tx { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.crs-nm { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.crs-ds { font-size: 13.5px; line-height: 1.45; color: var(--grey-5); }
.crs-ln { align-self: flex-start; margin-top: 4px; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: 12.5px; font-weight: 700; }
.crs-ck { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 24px; height: 24px; border: 1.5px solid var(--grey-3); border-radius: 999px; color: transparent; }
.crs-ck svg { width: 14px; height: 14px; stroke-width: 3; }
.crs-card[aria-pressed="true"] .crs-ck { border-color: var(--accent); background: var(--accent); color: #fff; }
@media (max-width: 400px) { .crs-card { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding-right: 40px; } .crs-cv { width: 96px; height: 80px; } .crs-ds { font-size: 13px; } }

/* ---------------------------------------------------------------- 레크판으로 이어지는 길
   이마고의 「다른 탭으로」 판: 연보라 판 하나 · 머리글 · 제목 · 설명 · 검은 작은 캡슐. 닫기는 오른쪽 위 */
.rp-card { position: relative; margin: 18px 0 4px; border-radius: var(--r-lg); background: var(--lav); transition: opacity .2s, transform .2s; }
.rp-card.gone { opacity: 0; transform: translateY(6px); }
.rp-link { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 20px 56px 20px 22px; color: var(--ink); text-decoration: none; }
.rp-k { font-size: 14px; font-weight: 650; color: var(--accent-ink); }
.rp-t { margin-top: 2px; font-size: 19px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.4; color: #1E1E22; }
.rp-s { font-size: 14.5px; line-height: 1.55; color: var(--ink2); white-space: pre-line; }
.rp-go {
  display: inline-flex; align-items: center; gap: 2px; margin-top: 12px; height: var(--h-btn-sm); padding: 0 12px 0 16px;
  border-radius: 999px; background: var(--btn); color: #fff; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; transition: background .15s;
}
.rp-go svg { stroke: currentColor; stroke-width: 2.4; }
.rp-link:hover .rp-go { background: #000; }
.rp-x { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .7); color: var(--ink2); transition: background .15s; }
.rp-x:hover { background: #fff; color: var(--ink); }
html.embed .foot-col.family { display: none !important; }

/* ---------------------------------------------------------------- 고르기 화면: 아이콘 그림이 아직 없는 방법 */
.gc-svg { display: grid; place-items: center; width: 48px; height: 48px; margin: auto; border-radius: 14px; background: var(--paper); color: var(--ink); transition: background .15s, color .15s; }
.game-card[aria-pressed="true"] .gc-svg { background: var(--accent-tint); color: var(--accent); }

/* ---------------------------------------------------------------- 번호로 채우기 */
.nm-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 12px; }
.nm-chip { font-variant-numeric: tabular-nums; }
.nm-chip.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.nm-input { margin: 0; font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.nm-note { min-height: 1.5em; font-variant-numeric: tabular-nums; }
.nm-more { display: grid; margin: 6px 0 14px; border-top: 1px solid var(--grey-2); }
.nm-q {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
  min-height: 46px; padding: 0 2px; border: 0; border-bottom: 1px solid var(--grey-2); background: none; text-align: left; font-size: 14.5px;
}
.nm-qk { color: var(--grey-5); }
.nm-qv { font-weight: 650; color: var(--ink); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nm-qc { font-size: 13.5px; font-weight: 650; color: var(--accent-ink); }
.nm-q:hover .nm-qc { text-decoration: underline; }

/* ---------------------------------------------------------------- 전광판 */
.bd-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: stretch; padding: 4px 12px 6px; }
.bd-hud { flex: none; text-align: center; padding: 2px 0 4px; }
.bd-title {
  min-height: 1.3em; font-size: clamp(20px, 4.2vw, 32px); font-weight: 800; letter-spacing: -0.02em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .3s;
}
.bd-wrap.won .bd-title { color: var(--gold); }
.bd-sub { min-height: 1.4em; margin-top: 2px; font-size: 13.5px; color: var(--stage-dim); font-variant-numeric: tabular-nums; }
.bd-mid { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.bd-board { position: relative; flex: none; width: 300px; height: 185px; }
.bd-screen {
  position: absolute; overflow: hidden;
  background: radial-gradient(ellipse 80% 70% at 50% 38%, #3A1AA8 0%, #22106E 58%, #160A4C 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), inset 0 10px 30px rgba(0, 0, 0, .45);
}
.bd-face { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.bd-frame { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; user-select: none; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .5)); }
/* 그림 테두리가 없을 때: 코드로 그린 금 테두리 */
.bd-board.no-img { border-radius: 28px; padding: 0; background: linear-gradient(160deg, #FFE08A, #FCB424 38%, #E49C0C 72%, #C27A06); box-shadow: 0 12px 36px rgba(0, 0, 0, .5), inset 0 2px 0 rgba(255, 255, 255, .6); }
.bd-board.no-img .bd-screen { box-shadow: inset 0 0 0 3px rgba(120, 70, 0, .35), inset 0 10px 30px rgba(0, 0, 0, .45); }

/* 전구: 그림의 전구 자리에 빛을 얹는다. 굴리는 동안은 차례로, 당첨이면 다 같이 */
.bd-bulbs { position: absolute; inset: 0; pointer-events: none; }
.bd-bulb {
  position: absolute; width: var(--bulb, 20px); height: var(--bulb, 20px); margin: calc(var(--bulb, 20px) / -2) 0 0 calc(var(--bulb, 20px) / -2);
  border-radius: 50%; opacity: .25; mix-blend-mode: screen;
  background: radial-gradient(circle, rgba(255, 252, 230, .95) 0%, rgba(255, 220, 120, .55) 38%, rgba(255, 200, 61, 0) 70%);
}
.bd-board.rolling .bd-bulb { animation: bd-chase .9s linear infinite; animation-delay: calc(var(--i) * -0.064s); }
.bd-board.win .bd-bulb { animation: bd-blink .32s steps(2, jump-none) 6; }
@keyframes bd-chase { 0%, 100% { opacity: .15; } 50% { opacity: 1; } }
@keyframes bd-blink { 0% { opacity: 1; } 100% { opacity: .1; } }

/* 숫자 칸 */
.bd-tile {
  position: relative; flex: none; overflow: hidden; width: 70px; height: 96px; border-radius: 12px;
  background: linear-gradient(180deg, #8A4DF6 0%, #6A2BE6 46%, #5418CF 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35), inset 0 -4px 10px rgba(30, 0, 90, .45), 0 6px 14px rgba(10, 0, 40, .5);
  color: #FFFDF6; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: 0;
  transition: box-shadow .25s, transform .25s;
}
.bd-tile::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, 0) 42%, rgba(0, 0, 0, 0) 60%, rgba(20, 0, 60, .28) 100%);
}
.bd-strip { position: absolute; left: 0; right: 0; top: 0; height: 200%; display: flex; flex-direction: column; will-change: transform; }
.bd-dig { flex: 1 1 50%; display: grid; place-items: center; text-shadow: 0 0 .14em rgba(255, 255, 255, .55), 0 .04em .06em rgba(40, 0, 100, .5); }
.bd-tile.fast .bd-strip { filter: blur(.035em); }
.bd-tile.lock { animation: bd-lock .38s cubic-bezier(.2, .9, .3, 1.4); }
.bd-tile.lead0 { opacity: .45; }
.bd-tile.won { box-shadow: inset 0 2px 0 rgba(255, 255, 255, .45), 0 0 0 3px var(--gold), 0 0 .5em rgba(255, 200, 61, .6); }
@keyframes bd-lock { 0% { transform: scale(1.08); } 100% { transform: none; } }

/* 이름 줄 */
.bd-reel { position: absolute; inset: 0; }
.bd-row {
  position: absolute; left: 6%; right: 6%; top: 50%; height: var(--row, 40px); margin-top: calc(var(--row, 40px) / -2);
  display: flex; align-items: center; justify-content: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-weight: 700; color: rgba(255, 255, 255, .42); will-change: transform;
}
.bd-row.mid { color: #fff; font-weight: 800; text-shadow: 0 0 .25em rgba(255, 255, 255, .45); }
.bd-reel.fast .bd-row { filter: blur(.03em); }
.bd-band {
  position: absolute; left: 0; right: 0; top: 50%; height: var(--row, 40px); margin-top: calc(var(--row, 40px) / -2);
  background: linear-gradient(90deg, rgba(255, 200, 61, 0), rgba(255, 200, 61, .14) 18%, rgba(255, 200, 61, .14) 82%, rgba(255, 200, 61, 0));
  border-top: 2px solid rgba(255, 200, 61, .55); border-bottom: 2px solid rgba(255, 200, 61, .55);
}
.is-name .bd-face::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(22, 10, 76, .95) 0%, rgba(22, 10, 76, 0) 30%, rgba(22, 10, 76, 0) 70%, rgba(22, 10, 76, .95) 100%);
}
.bd-reel.won .bd-row.mid { color: var(--gold); text-shadow: 0 0 .3em rgba(255, 200, 61, .6); }

/* 남은 후보 · 뽑힌 사람 */
.bd-left {
  min-height: 34px; padding: 6px 16px; border-radius: 999px; font-size: 15px; font-weight: 800; letter-spacing: -0.01em; font-variant-numeric: tabular-nums;
  color: var(--gold); background: rgba(255, 200, 61, .12); border: 1px solid rgba(255, 200, 61, .36); opacity: 0; transform: translateY(6px);
}
.bd-left:empty { visibility: hidden; }
.bd-left.in { animation: bd-pop .42s cubic-bezier(.2, .9, .3, 1.3) forwards; }
@keyframes bd-pop { 0% { opacity: 0; transform: translateY(6px) scale(.9); } 100% { opacity: 1; transform: none; } }
.bd-wins { flex: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-height: 76px; overflow-y: auto; padding: 4px 0 2px; }
.bd-wins:empty { display: none; }
.bd-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; background: rgba(255, 200, 61, .14); border: 1px solid rgba(255, 200, 61, .42); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bd-chip-tag { color: var(--gold); }
.bd-chip.off { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .14); color: var(--stage-dim); }
.bd-chip.off .bd-chip-name { text-decoration: line-through; }
.bd-chip.off .bd-chip-tag { color: var(--stage-dim); }
@media (prefers-reduced-motion: reduce) {
  .bd-board.rolling .bd-bulb, .bd-board.win .bd-bulb, .bd-tile.lock, .bd-left.in { animation: none; }
  .bd-left.in { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- 대진표 */
.bk-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 4px 8px 6px; }
.bk-hud { flex: none; text-align: center; padding: 2px 8px 6px; }
.bk-title {
  font-size: clamp(20px, 4.2vw, 32px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bk-sub { min-height: 1.4em; margin-top: 2px; font-size: 13.5px; color: var(--stage-dim); font-variant-numeric: tabular-nums; }
/* 넘치면 밀어서 본다. 가운데 맞춤은 margin:auto 로(넘칠 때 왼쪽 위가 잘리지 않게) */
.bk-view { flex: 1 1 auto; min-height: 0; display: flex; overflow: hidden; }
.bk-view.scroll { overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 0 6px 10px; }
.bk-board { position: relative; flex: none; margin: auto; --s: 1; }
.bk-lines { position: absolute; left: 0; top: 0; overflow: visible; z-index: 0; }
.bk-ln { fill: none; stroke: rgba(255, 200, 61, .3); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: stroke .3s, stroke-width .3s; }
.bk-ln.won { stroke: var(--gold); stroke-width: 3; }
.bk-ln.bye { stroke: rgba(255, 200, 61, .6); stroke-dasharray: 4 4; }
/* 판 이름 줄: 밀어서 볼 때도 위에 붙어 있다 */
.bk-heads { position: sticky; top: 0; height: calc(34px * var(--s)); pointer-events: none; z-index: 2; }
.bk-view.scroll .bk-heads { background: linear-gradient(180deg, rgba(8, 9, 19, .94) 72%, rgba(8, 9, 19, 0)); }
.bk-head {
  position: absolute; top: 0; height: calc(30px * var(--s)); line-height: calc(30px * var(--s));
  font-size: calc(12.5px * var(--s)); font-weight: 800; letter-spacing: .02em; text-align: center;
  color: rgba(255, 200, 61, .85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bk-plate {
  position: absolute; z-index: 1; box-sizing: border-box; display: flex; align-items: center; justify-content: center;
  margin: 0; padding: 0 calc(10px * var(--s)); border-radius: calc(11px * var(--s));
  border: calc(1.5px * var(--s)) solid rgba(255, 255, 255, .2);
  background: linear-gradient(180deg, #8A4DF6, #5418CF); color: #fff;
  box-shadow: 0 calc(4px * var(--s)) calc(12px * var(--s)) rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
  font: inherit; font-size: calc(15px * var(--s)); font-weight: 800; letter-spacing: -0.01em; line-height: 1.2;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background .25s, border-color .25s, color .25s, box-shadow .25s, opacity .25s;
}
.bk-plate:disabled { cursor: default; }
.bk-plate:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.bk-name { display: block; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-plate.live { border-color: rgba(255, 200, 61, .75); }
.bk-plate.live:hover { filter: brightness(1.12); }
.bk-plate.won { border: calc(2.5px * var(--s)) solid var(--gold); box-shadow: 0 0 calc(16px * var(--s)) rgba(255, 200, 61, .35), inset 0 1px 0 rgba(255, 255, 255, .25); }
.bk-plate.lost { background: linear-gradient(180deg, #3A2A78, #2A1E5C); color: rgba(243, 244, 250, .45); border-color: rgba(255, 255, 255, .08); box-shadow: none; }
.bk-plate.empty { background: rgba(255, 255, 255, .05); border: calc(1.5px * var(--s)) dashed rgba(255, 255, 255, .2); box-shadow: none; }
.bk-plate.gone { visibility: hidden; }
.bk-plate.champ { border: calc(2px * var(--s)) dashed rgba(255, 200, 61, .45); background: rgba(255, 200, 61, .06); }
.bk-plate.champ.crowned { border: 0; color: #1A1300; background: linear-gradient(180deg, #FFE08A, #FFC83D 45%, #E49C0C); box-shadow: 0 0 calc(28px * var(--s)) rgba(255, 200, 61, .55), inset 0 1px 0 rgba(255, 255, 255, .6); }
.bk-plate.wait .bk-name { opacity: 0; }
.bk-plate.ghost { z-index: 3; pointer-events: none; transition: transform .43s cubic-bezier(.3, .7, .2, 1); }
.bk-trophy { position: absolute; z-index: 2; height: auto; pointer-events: none; opacity: .3; filter: grayscale(.7); transition: opacity .6s, filter .6s, transform .6s; }
.bk-trophy.on { opacity: 1; filter: drop-shadow(0 0 18px rgba(255, 200, 61, .5)); transform: scale(1.06); }
@media (prefers-reduced-motion: no-preference) {
  .bk-plate.live { animation: bkLive 1.6s ease-in-out infinite; }
  .bk-plate.flip { animation: bkFlip .36s cubic-bezier(.2, .8, .3, 1.2); }
  .bk-plate.pop { animation: bkPop .36s cubic-bezier(.3, 1.6, .5, 1); }
}
@media (prefers-reduced-motion: reduce) {
  .bk-plate.ghost { transition: none; }
}
@keyframes bkLive {
  0%, 100% { box-shadow: 0 calc(4px * var(--s)) calc(12px * var(--s)) rgba(0, 0, 0, .35), 0 0 0 0 rgba(255, 200, 61, 0); }
  50% { box-shadow: 0 calc(4px * var(--s)) calc(12px * var(--s)) rgba(0, 0, 0, .35), 0 0 0 calc(3px * var(--s)) rgba(255, 200, 61, .45); }
}
@keyframes bkFlip { from { transform: perspective(400px) rotateX(90deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bkPop { 0% { transform: scale(.82); } 100% { transform: scale(1); } }

/* ---------------------------------------------------------------- 자리 배치 */
.se-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 4px 8px 6px; }
.se-hud { flex: none; text-align: center; padding: 2px 8px 6px; }
.se-title {
  font-size: clamp(20px, 4.2vw, 32px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.se-sub { min-height: 1.4em; margin-top: 2px; font-size: 13.5px; color: var(--stage-dim); font-variant-numeric: tabular-nums; }
.se-view { flex: 1 1 auto; min-height: 0; display: flex; overflow: hidden; }
.se-view.scroll { overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 0 6px 10px; }
.se-room { position: relative; flex: none; margin: auto; --s: 1; }
.se-front {
  position: absolute; display: grid; place-items: center; border-radius: 999px; background: #2C2742;
  border: 1.5px solid rgba(255, 200, 61, .55); color: var(--gold); font-weight: 800; letter-spacing: .12em;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.se-seat { position: absolute; margin: 0; padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; border-radius: calc(12px * var(--s)); }
.se-seat:disabled { cursor: default; }
.se-seat:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.se-desk { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; user-select: none; -webkit-user-drag: none; transition: filter .2s, opacity .25s; }
.se-room.flip .se-desk { transform: rotate(180deg); }
.se-name {
  position: absolute; display: flex; align-items: center; justify-content: center; text-align: center;
  color: #fff; font-weight: 800; line-height: 1.1; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden;
  text-shadow: 0 1px 2px rgba(40, 0, 90, .45); pointer-events: none;
}
.se-seat.off { visibility: hidden; pointer-events: none; }
.se-seat.empty .se-desk { opacity: .38; }
.se-seat.pre { opacity: 0; }
.se-seat.cyc .se-name { opacity: .72; }
.se-seat:not(:disabled):not(.empty):hover .se-desk { filter: brightness(1.08); }
.se-seat.pick .se-desk { filter: drop-shadow(0 0 calc(9px * var(--s)) rgba(255, 200, 61, .95)) brightness(1.1); }
.se-seat.no-img .se-name { background: linear-gradient(180deg, #8A4DF6, #5418CF); border: calc(2px * var(--s)) solid var(--gold); border-radius: calc(12px * var(--s)); }
.se-seat.no-img.empty .se-name { opacity: .38; }
.se-ghost {
  position: absolute; z-index: 5; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800;
  white-space: nowrap; pointer-events: none; text-shadow: 0 2px 10px rgba(0, 0, 0, .55); transition: transform .36s cubic-bezier(.3, .7, .2, 1);
}
@media (prefers-reduced-motion: no-preference) {
  .se-seat.in { animation: seIn .38s cubic-bezier(.2, .9, .3, 1.25) both; }
  .se-seat.lock .se-name { animation: seLock .32s cubic-bezier(.3, 1.6, .5, 1); }
}
@media (prefers-reduced-motion: reduce) {
  .se-ghost { transition: none; }
}
@keyframes seIn { from { opacity: 0; transform: translateY(calc(-14px * var(--s))) scale(.86); } to { opacity: 1; transform: none; } }
@keyframes seLock { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* ---------------------------------------------------------------- 1인 1역: 조 나누기의 이름표 그림에 역할(작게)과 이름(크게) */
.rl-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 4px 8px 6px; }
.rl-hud { flex: none; text-align: center; padding: 2px 8px 8px; }
.rl-title {
  font-size: clamp(20px, 4.2vw, 32px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rl-sub { min-height: 1.4em; margin-top: 2px; font-size: 13.5px; color: var(--stage-dim); font-variant-numeric: tabular-nums; }
.rl-view { flex: 1 1 auto; min-height: 0; display: flex; overflow: hidden; }
.rl-view.scroll { overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 2px 4px 12px; }
.rl-grid { position: relative; display: grid; margin: auto; --tkh: 60px; --tcap: .27; --rf: 12px; }
.rl-view.scroll .rl-grid { margin: 0 auto; }
.rl-card {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--tkh) * .02);
  min-width: 0; height: var(--tkh); margin: 0; padding: 0 calc(var(--tkh) * var(--tcap) + 4px); border: 0; background: none;
  color: #2B1D06; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .18s;
}
.rl-card::before { content: ''; position: absolute; inset: 0; z-index: 0; transition: filter .2s, opacity .25s; }
.rl-grid.pics .rl-card::before {
  box-sizing: border-box; border-style: solid; border-color: transparent;
  border-width: calc(var(--tkh) * .49) calc(var(--tkh) * var(--tcap));
  border-image: var(--img-team-ticket) 49% 12% fill / calc(var(--tkh) * .49) calc(var(--tkh) * var(--tcap)) stretch;
}
.rl-grid:not(.pics) .rl-card { padding: 0 calc(var(--tkh) * .14 + 4px); }
.rl-grid:not(.pics) .rl-card::before { border: 2px solid var(--gold); border-radius: calc(var(--tkh) * .2); background: #FFF6E2; }
.rl-role, .rl-name { position: relative; z-index: 1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.rl-role { font-size: var(--rf); font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; color: #94600F; }
.rl-name { min-height: 1.12em; font-weight: 800; line-height: 1.12; letter-spacing: -0.015em; }
/* 빈 역할: 이름표를 옅게 비워 두고 글은 무대 위의 밝은 글씨로 */
.rl-card.empty::before { opacity: .26; filter: grayscale(.4); }
.rl-card.empty .rl-role { color: rgba(255, 228, 176, .78); }
.rl-card.empty .rl-name { font-size: var(--rf); font-weight: 600; color: rgba(243, 244, 250, .5); }
.rl-card.rest::before { filter: grayscale(.9) brightness(.86); }
.rl-card.rest .rl-role { color: #6E665A; }
.rl-card.pre { opacity: 0; }
.rl-card.cyc .rl-name { opacity: .5; }
.rl-card:disabled { cursor: default; }
.rl-card:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 10px; }
.rl-card:not(:disabled):not(.empty):not(.rest):hover::before { filter: brightness(1.06); }
.rl-card.pick { transform: translateY(-3px); }
.rl-card.pick::before { filter: drop-shadow(0 0 7px rgba(255, 200, 61, .95)) brightness(1.06); }
.rl-ghost {
  position: absolute; z-index: 5; padding: .16em .6em; border: 2px solid var(--gold); border-radius: 999px; background: #FFF6E2;
  color: #2B1D06; font-weight: 800; line-height: 1.12; white-space: nowrap; pointer-events: none; transform: translate(-50%, -50%);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .45); transition: transform .36s cubic-bezier(.3, .7, .2, 1);
}
@media (prefers-reduced-motion: no-preference) {
  .rl-card.in { animation: rlIn .36s cubic-bezier(.2, .9, .3, 1.25) both; }
  .rl-card.lock .rl-name { animation: rlLock .3s cubic-bezier(.3, 1.6, .5, 1); }
}
@media (prefers-reduced-motion: reduce) {
  .rl-ghost, .rl-card { transition: none; }
}
@keyframes rlIn { from { opacity: 0; transform: translateY(-10px) scale(.88); } to { opacity: 1; transform: none; } }
@keyframes rlLock { 0% { transform: scale(1.3); } 100% { transform: scale(1); } }
/* 역할 목록 시트: 보기(교실 · 모임 · 청소) */
.rl-presets { margin: 2px 0 10px; }

/* ---------------------------------------------------------------- 순서 정하기: 같은 이름표 그림에 번호(왼쪽, 굵게)와 이름 */
.od-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 4px 8px 6px; }
.od-hud { flex: none; text-align: center; padding: 2px 8px 8px; }
.od-title {
  font-size: clamp(20px, 4.2vw, 32px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.od-sub { min-height: 1.4em; margin-top: 2px; font-size: 13.5px; color: var(--stage-dim); font-variant-numeric: tabular-nums; }
.od-view { flex: 1 1 auto; min-height: 0; display: flex; overflow: hidden; }
.od-view.scroll { overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 2px 4px 12px; }
.od-grid { position: relative; display: grid; margin: auto; --tkh: 60px; --tcap: .27; --numw: 30px; }
.od-view.scroll .od-grid { margin: 0 auto; }
.od-card {
  position: relative; display: flex; align-items: center; gap: calc(var(--tkh) * .08);
  min-width: 0; height: var(--tkh); margin: 0; padding: 0 calc(var(--tkh) * var(--tcap) + 6px); border: 0; background: none;
  color: #2B1D06; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .18s;
}
.od-card::before { content: ''; position: absolute; inset: 0; z-index: 0; transition: filter .2s; }
.od-grid.pics .od-card::before {
  box-sizing: border-box; border-style: solid; border-color: transparent;
  border-width: calc(var(--tkh) * .49) calc(var(--tkh) * var(--tcap));
  border-image: var(--img-team-ticket) 49% 12% fill / calc(var(--tkh) * .49) calc(var(--tkh) * var(--tcap)) stretch;
}
.od-grid:not(.pics) .od-card { padding: 0 calc(var(--tkh) * .14 + 6px); }
.od-grid:not(.pics) .od-card::before { border: 2px solid var(--gold); border-radius: calc(var(--tkh) * .2); background: #FFF6E2; }
.od-num, .od-name { position: relative; z-index: 1; pointer-events: none; }
.od-num {
  flex: none; width: var(--numw); text-align: center; font-size: calc(var(--tkh) * .4); font-weight: 900; line-height: 1;
  letter-spacing: -0.04em; color: #94600F; font-variant-numeric: tabular-nums;
}
.od-name { flex: 1; min-width: 0; min-height: 1.12em; overflow: hidden; white-space: nowrap; text-align: center; font-weight: 800; line-height: 1.12; letter-spacing: -0.015em; }
.od-card.pre { opacity: 0; }
.od-card.cyc .od-name { opacity: .5; }
.od-card:disabled { cursor: default; }
.od-card:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 10px; }
.od-card:not(:disabled):hover::before { filter: brightness(1.06); }
.od-card.pick { transform: translateY(-3px); }
.od-card.pick::before { filter: drop-shadow(0 0 7px rgba(255, 200, 61, .95)) brightness(1.06); }
.od-ghost {
  position: absolute; z-index: 5; padding: .16em .6em; border: 2px solid var(--gold); border-radius: 999px; background: #FFF6E2;
  color: #2B1D06; font-weight: 800; line-height: 1.12; white-space: nowrap; pointer-events: none; transform: translate(-50%, -50%);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .45); transition: transform .36s cubic-bezier(.3, .7, .2, 1);
}
@media (prefers-reduced-motion: no-preference) {
  .od-card.in { animation: rlIn .36s cubic-bezier(.2, .9, .3, 1.25) both; }
  .od-card.lock .od-name { animation: rlLock .3s cubic-bezier(.3, 1.6, .5, 1); }
}
@media (prefers-reduced-motion: reduce) {
  .od-ghost, .od-card { transition: none; }
}
/* 짝꿍 정하기 무대: 순서표와 같은 번호표에 이름 둘(홀수면 한 장만 셋)과 & . 이름 하나하나가 바꾸기 단추 */
.pr-card { cursor: default; }
.pr-names { position: relative; z-index: 1; flex: 1; min-width: 0; display: flex; align-items: center; }
.pr-name {
  flex: 1 1 0; min-width: 0; height: calc(var(--tkh) * .7); margin: 0; padding: 0 2px; border: 0; border-radius: calc(var(--tkh) * .16);
  background: none; color: #2B1D06; font: inherit; font-weight: 800; line-height: 1.12; letter-spacing: -0.015em;
  white-space: nowrap; overflow: hidden; text-align: center; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background .18s, transform .18s, box-shadow .18s;
}
.pr-name:disabled { cursor: default; color: #2B1D06; }
.pr-name:not(:disabled):hover { background: rgba(255, 255, 255, .4); }
.pr-name:focus-visible { outline: 2px solid #94600F; outline-offset: -2px; }
.pr-name.pick { background: rgba(255, 200, 61, .6); box-shadow: inset 0 0 0 2px #E2A21C; transform: translateY(-2px); }
.pr-name.cyc { opacity: .5; }
.pr-amp {
  flex: none; width: var(--ampw, 20px); text-align: center; font-size: calc(var(--tkh) * .34); font-weight: 800; line-height: 1;
  color: #B8861B; opacity: .3; transition: opacity .2s;
}
.pr-card.tied .pr-amp { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .pr-card.lock .pr-amp, .pr-card.lock .pr-name { animation: rlLock .3s cubic-bezier(.3, 1.6, .5, 1); }
}
@media (prefers-reduced-motion: reduce) {
  .pr-name, .pr-amp { transition: none; }
}
/* 꼭 짝 시트: 정해 둔 짝 줄(누르면 뺀다) */
.pr-fix-list { display: grid; gap: 8px; margin: 2px 0 8px; }
.pr-fix-row {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 14px; border: 1px solid var(--line);
  border-radius: var(--r-md); background: #fff; color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.pr-fix-row:hover { border-color: var(--grey-4); }
.pr-fix-names { flex: 1; min-width: 0; font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.pr-fix-names i { margin: 0 6px; font-style: normal; color: var(--accent-ink); }
.pr-fix-del { flex: none; font-size: 13.5px; color: var(--ink3); }
.pr-fix-empty { margin: 4px 2px 10px; font-size: 14.5px; color: var(--ink3); }
/* 고정 순서 시트: 번호 칸(누르면 그 번호에 앉힐 사람을 고른다) */
.od-fix-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; margin: 2px 0 8px; }
.od-fix {
  display: grid; gap: 2px; place-items: center; min-height: 62px; padding: 8px 4px; border-radius: 14px; border: 1.5px solid var(--grey-3);
  background: #fff; font: inherit; color: var(--ink); transition: border-color .15s, background .15s;
}
.od-fix b { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.od-fix span { min-height: 1.3em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--grey-5); }
.od-fix.on { border-color: var(--accent); background: var(--accent-tint); }
.od-fix.on span { color: var(--accent-ink); font-weight: 700; }
.od-fix:hover { border-color: var(--grey-4); }
/* 결과 창: 순서는 번호를 이름 앞에 */
.res-winners .res-num { flex: none; min-width: 1.6em; font-size: 15px; font-weight: 800; color: var(--accent-ink); font-variant-numeric: tabular-nums; text-align: right; }
.res-winners:not(.many) .res-num { font-size: 22px; }

/* 자리 규칙 시트: 한 줄 자리 수 · 자리 판 미리보기 */
.sc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; margin: 2px 0 8px; }
.sc-opt { display: grid; gap: 2px; place-items: center; padding: 12px 6px; border-radius: 14px; border: 1.5px solid var(--grey-3); background: #fff; transition: border-color .15s, box-shadow .15s; }
.sc-opt b { font-size: 16px; font-weight: 800; }
.sc-opt span { font-size: 13px; color: var(--grey-5); }
.sc-opt:hover { border-color: var(--accent); }
.sc-opt[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.sc-auto { justify-self: start; }
.mg { display: grid; gap: 8px; margin: 4px 0 6px; }
.mg-front { justify-self: center; min-width: 40%; padding: 5px 18px; border-radius: 999px; background: #2C2742; color: var(--gold); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-align: center; }
.mg-grid { display: grid; gap: 6px 4px; }
.mg-cell {
  min-width: 0; min-height: 36px; padding: 2px 3px; border-radius: 9px; border: 1.5px solid #F2CDBD; background: #FFF4EE;
  color: var(--accent-ink); font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mg-cell:hover { border-color: var(--accent); }
.mg-cell.fixed { background: var(--accent); border-color: var(--accent-ink); color: #fff; }
.mg-cell.off { background: transparent; border-style: dashed; border-color: var(--grey-3); color: var(--grey-5); }
.mg-cell:disabled { cursor: default; }
.tr-sw { position: relative; width: 40px; height: 24px; border-radius: 999px; background: var(--grey-3); transition: background .2s; }
.tr-sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.tr-sw.on { background: var(--accent); }
.tr-sw.on::after { transform: translateX(16px); }
.tr-row[role="switch"] { grid-template-columns: auto minmax(0, 1fr) 40px; }

/* ---------------------------------------------------------------- 결과를 폰으로 보내기: 진행자 화면(큰 QR)
   교실 TV · 프로젝터에 띄우는 화면이라 QR 을 화면 높이에 맞춰 최대한 크게. 참가자가 읽는 한 줄은 QR 바로 위에 */
.sheet.qr-sheet { width: min(720px, 100%); max-height: 94vh; }
.qs-title { margin: 14px 0 12px; font-size: clamp(19px, 2.6vw, 28px); font-weight: 800; line-height: 1.3; letter-spacing: -0.02em; text-align: center; }
.qs-qr {
  width: min(100%, max(220px, calc(94vh - 350px)), 640px); aspect-ratio: 1; margin: 0 auto; padding: 0;
  border-radius: 18px; background: #fff; border: 1px solid var(--grey-2); overflow: hidden;
}
.qr-sheet.dense .qs-qr { width: min(100%, max(220px, calc(94vh - 400px)), 640px); }
.qs-qr svg { display: block; width: 100%; height: 100%; }
.qs-qr svg rect, .qs-qr svg path { stroke: none; }
.qs-dense { margin: 10px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--ink2); text-align: center; white-space: pre-line; }
.qs-no { margin: 4px 0 18px; text-align: center; }
.qs-what { display: grid; gap: 2px; margin: 14px 0 16px; text-align: center; }
.qs-what b { font-size: 16px; font-weight: 750; letter-spacing: -0.01em; }
.qs-what span { font-size: 13.5px; color: var(--ink3); }
.qs-note { margin: 12px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--ink3); text-align: center; white-space: pre-line; }

/* ---------------------------------------------------------------- 받은 폰: 결과 보기(#v=)
   흰 바탕 한 장. 위에서부터 결과 이름 · 내 이름 찾기 · 결과, 맨 아래에 「나도 드럼롤로 뽑기」를 붙여 둔다 */
body.in-rv { overflow: hidden; }
.rv {
  position: fixed; inset: 0; z-index: 65; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; background: #fff; color: var(--ink);
}
.rv-main { flex: 1 0 auto; width: min(640px, 100%); margin: 0 auto; padding: calc(16px + var(--safe-t)) 20px 24px; }
.rv-top { display: flex; align-items: center; gap: 8px; margin-bottom: 22px; }
.rv-logo { display: block; width: 28px; height: 28px; border-radius: 8px; }
.rv-brand { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.rv-kick { margin-bottom: 10px; }
.rv-title { margin: 0; font-size: clamp(26px, 7vw, 34px); font-weight: 800; line-height: 1.25; letter-spacing: -0.03em; outline: none; }
.rv-meta { margin: 8px 0 0; font-size: 14px; color: var(--ink3); }
.rv-find { margin-top: 18px; }
.rv-input { margin-top: 0; }
.rv-hit { min-height: 0; margin: 10px 2px 0; font-size: 15px; line-height: 1.5; color: var(--ink2); white-space: pre-line; }
.rv-hit:empty { display: none; }
.rv-hit.on { padding: 12px 14px; border-radius: 14px; background: var(--accent-tint); color: var(--accent-ink); font-size: 17px; font-weight: 750; }
.rv-hit.none { color: var(--ink3); }
.rv-body { margin-top: 18px; }
.rv .res-winners { margin-top: 0; }
.rv .res-groups { max-height: none; overflow: visible; margin-top: 0; padding-right: 0; }
.rv .res-list { max-height: none; overflow: visible; }
.rv-sub { margin: 22px 0 6px; font-size: 16px; font-weight: 750; }
/* 1인 1역: 역할이 답이라 조금 더 또렷하게 */
.rv-body.g-roles .res-tag { font-size: 15px; font-weight: 650; color: var(--ink-2); }
.rv .res-winners li { padding: 2px 8px; margin: 0 -8px; border-radius: 12px; transition: background .2s; }
.rv .res-winners li.me, .rv .res-list li.me { background: var(--accent-tint); color: var(--accent-ink); }
.rv .res-gchip.me { background: var(--accent); color: #fff; }
.rv .res-gchip.me .res-lead { background: #fff; color: var(--accent-ink); }
/* 자리표: 칠판이 위, 앞줄부터. 자리 폭은 화면에 맞추고(44-76px), 그보다 좁아지면 옆으로 밀어 본다 */
.rv-seats {
  --cols: 6; --aisles: 2; --tracks: 8; --gap: 4px; --aisle: 8px;
  --seat: max(44px, min(76px, calc((min(640px, 100vw) - 40px - (var(--tracks) - 1) * var(--gap) - var(--aisles) * var(--aisle)) / var(--cols))));
  overflow-x: auto; margin: 0 -20px; padding: 4px 20px 10px;
}
.rv-room { display: grid; column-gap: var(--gap); row-gap: 7px; align-items: stretch; }
.rv-board {
  justify-self: center; width: min(62%, 320px); height: 30px; margin-bottom: 8px; border-radius: 999px;
  display: grid; place-items: center; background: #2C2742; color: #FFC83D; font-size: 13px; font-weight: 800; letter-spacing: .02em;
}
.rv-seat {
  min-height: 46px; padding: 6px 3px; border-radius: 10px; display: grid; place-items: center; text-align: center;
  background: var(--warm); border: 1px solid var(--line); font-size: clamp(11.5px, calc(var(--seat) * .26), 15px); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em;
  transition: background .2s, color .2s, transform .2s;
}
.rv-seat.empty { background: none; border-style: dashed; border-color: var(--grey-3); }
.rv-seat.me { background: var(--accent); border-color: var(--accent); color: #fff; transform: scale(1.06); }
.rv-note { margin: 26px 0 0; font-size: 13px; line-height: 1.55; color: var(--ink3); white-space: pre-line; }
.rv-verse { margin: 14px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--ink3); }
.rv-verse .rv-ref { display: block; }
.rv-bar {
  position: sticky; bottom: 0; flex: none; padding: 12px 20px calc(12px + var(--safe-b));
  background: linear-gradient(rgba(255, 255, 255, 0), #fff 28%);
}
.rv-bar .btn-primary { display: flex; width: min(600px, 100%); height: var(--h-btn-lg); margin: 0 auto; }
@media (min-width: 640px) { .rv-seats { --gap: 6px; --aisle: 16px; } .rv-seat { min-height: 52px; } }
@media (prefers-reduced-motion: reduce) { .rv-seat, .rv .res-winners li { transition: none; } .rv-seat.me { transform: none; } }
