/* 「불발 MISFIRE」 — 화면·플로우 스타일 (오너 B)
 *
 * 규칙
 *  - base.css 의 토큰만 쓴다. 색을 새로 만들지 않는다.
 *  - base.css 소유 클래스(.btn .panel .row .col .dim .mono, #app)는 재정의하지 않는다.
 *    변형이 필요하면 내 소유 접두사(.s-*)를 덧붙인다.
 *  - #app 은 base.css 에서 `display:block; max-width:720px; padding:12px 16px 32px` 이다.
 *    상단바·HUD 를 화면 끝까지 붙이려면 그 여백만큼 음수 마진을 준다(아래 --pad-* ).
 *  - 위조 조항(.entry-alt)에는 절대 붉은색·배지·애니메이션을 쓰지 않는다. 유출 방지가 기능이다.
 *  - 최소 폭 320px, 터치 타깃 44px, 한글 조판 keep-all.
 */

/* ── 1. 골격 ────────────────────────────────────────────────────── */

/* 셸 — 폭 제한은 #app 이 아니라 여기에 있다. 그래야 화면마다 다른 폭을 줄 수 있다.
   --pad-x/--pad-t 는 :root(base.css)에서 상속받는다. 여기서 다시 선언하면 브레이크포인트가 끊긴다. */
.screen {
  /* 상단바 실높이 = 6px + 44px 버튼 + 6px + 테두리 + 노치 안전영역.
     safe-area 를 빼먹으면 설치형(PWA)·노치 폰에서 타이머 윗부분이 상단바 뒤로 숨는다.
     ★전 구간 57px 고정 — 데스크톱에서 키우면 .hud 의 top 과 game.js 의 실측이 동시에 어긋난다.
     데스크톱 상단바는 높이가 아니라 내용물로 키운다. */
  --bar-h: calc(57px + env(safe-area-inset-top, 0px));
  display: block;
  min-width: 0;
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding: var(--pad-t) var(--pad-x) var(--pad-b);
}

.screen-body { min-width: 0; }
.screen-head { margin-bottom: 14px; }

.screen-title {
  margin: 0;
  font-size: var(--fs-xl);
  line-height: var(--lh-head);
  letter-spacing: -.01em;
}
.screen-title:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.screen-title:focus:not(:focus-visible) { outline: none; }

.screen-sub { margin: 4px 0 0; font-size: .88rem; }
.lede { margin: 8px 0 0; color: var(--dim); font-size: .95rem; line-height: 1.6; }

.screen-foot {
  position: sticky;
  bottom: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 18px calc(var(--pad-x) * -1) calc(var(--pad-b) * -1);
  padding: 12px var(--pad-x) calc(14px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, var(--bg) 68%, transparent);
}

.stack { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.stack-tight { gap: 8px; }
.foot-note { margin: 0; font-size: var(--fs-xs); line-height: 1.55; color: var(--dim); text-align: center; }

/* 버튼 변형 (내 소유 클래스) */
.btn.s-block { width: 100%; }
.btn.s-sm { min-height: 44px; padding: 8px 12px; font-size: .88rem; }
.btn.s-icon { gap: 6px; }
.btn.s-primary { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.btn.s-primary:hover { background: #ffc04a; }
.btn.s-ghost { background: transparent; }
.btn.s-ghost:hover { background: var(--panel2); }

.btn-row { flex-wrap: wrap; gap: 8px; }
.btn-row > .btn { flex: 1 1 auto; }
.btn-row-split > .btn { flex: 1 1 0; }

.linkish {
  align-self: center;
  min-height: 44px;
  padding: 4px 8px;
  border: 0;
  background: none;
  color: var(--info);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.linkish:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; border-radius: 6px; }

.note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r);
  background: var(--panel);
  color: var(--dim);
  font-size: .88rem;
  line-height: 1.6;
}
.note .ico { flex: 0 0 auto; margin-top: 3px; color: var(--accent); }
.note-danger { border-left-color: var(--danger); }
.note-danger .ico { color: var(--danger); }

.panel-title { margin: 0 0 6px; font-size: .95rem; }

/* ── 2. 상단 바 (base.css 의 .topbar 위에 덧쓴다) ────────────────── */

.screen > .topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 8px;
  margin: calc(var(--pad-t) * -1) calc(var(--pad-x) * -1) 14px;
  padding: calc(6px + env(safe-area-inset-top, 0px)) 8px 6px;
  background: var(--bg);
}

.tb-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border: 1px solid transparent;
  border-radius: var(--r);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.tb-btn:hover { background: var(--panel2); }
.tb-btn:focus-visible { outline: 2px solid var(--info); outline-offset: -2px; }
.tb-btn.is-hidden { visibility: hidden; pointer-events: none; }

.tb-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
}
.tb-code {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .16em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.tb-sub { font-size: .72rem; letter-spacing: .05em; }

/* ── 3. 타이틀 ─────────────────────────────────────────────────── */

.brand { text-align: center; padding: 18px 0 6px; }
.brand-lockup {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.brand-ko {
  font-size: clamp(2.6rem, 15vw, 3.8rem);
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1;
}
/* 워드마크는 영문 단독이다. 한글 제목을 없앤 뒤로 이 글자가 곧 로고라 크기를 승격했다.
   letter-spacing 이 크면 오른쪽에 빈칸이 생기므로 그만큼 안쪽으로 당겨 시각 중심을 맞춘다. */
.brand-en {
  font-size: var(--fs-3xl);
  letter-spacing: .22em;
  text-indent: .22em;
  color: var(--accent);
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 0 28px color-mix(in srgb, var(--accent) 28%, transparent);
}
.brand-tag { margin: 16px 0 0; color: var(--dim); font-size: var(--fs-sm); letter-spacing: .02em; }

/* ── 4. 코드 · 대조어 ──────────────────────────────────────────── */

.code-panel { text-align: center; }
.code-cap { font-size: var(--fs-2xs); letter-spacing: .24em; }

.codebig {
  display: inline-flex;
  justify-content: center;
  margin: 6px 0 12px;
  padding: 10px clamp(14px, 4vw, 24px);
  border: 1px solid var(--line-hi);
  border-radius: var(--r);
  background: #0a0e13;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, .6),
              inset 0 0 0 1px color-mix(in srgb, var(--accent) 10%, transparent);
  font-size: clamp(2rem, 11vw, 3.4rem);
  font-weight: 800;
  letter-spacing: .16em;
  color: var(--accent);
  text-shadow: 0 0 18px color-mix(in srgb, var(--accent) 40%, transparent);
  word-break: break-all;
}
.codebig:focus-visible { outline: 2px solid var(--info); outline-offset: 4px; border-radius: 6px; }

.cw-host:empty { display: none; }
.cw-host > * + * { margin-top: 8px; }

.checkword {
  border: 1px dashed var(--line);
  border-radius: var(--r);
  background: var(--panel);
  padding: 10px 12px;
}
.cw-line { display: flex; align-items: center; gap: 8px; }
.cw-ico { display: inline-flex; color: var(--info); }
.cw-text { font-weight: 700; font-size: 1.02rem; }
.cw-sub { margin: 4px 0 0 26px; font-size: .8rem; line-height: 1.5; }

/* 코드 입력 6칸 */
.cf { position: relative; }
.cf-cells { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.cf-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: clamp(52px, 13vw, 72px);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  font-size: clamp(1.2rem, 5.5vw, 2rem);
  font-weight: 700;
}
/* 채워진 칸은 진행 상태지 지금 눌러야 할 것이 아니다 — 주황은 6칸이 다 찼을 때만 */
.cf-cell.is-filled { border-color: var(--line-hi); color: var(--text); }
.cf-cell.is-active { box-shadow: inset 0 0 0 2px var(--info); }
.cf-input {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  padding: 0;
  border: 0;
  opacity: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  font-size: 16px;              /* iOS 자동 확대 방지 */
}
.cf-input:focus { outline: none; }
.cf.is-full .cf-cell { border-color: var(--ok); color: var(--accent); }

.derived { margin: 0; font-size: var(--fs-xs); color: var(--dim); text-align: center; }

/* ── 5. 폼 ─────────────────────────────────────────────────────── */

.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field-label { font-size: .9rem; font-weight: 700; }
.field-help { margin: 0; font-size: var(--fs-xs); line-height: 1.55; }
.field-err {
  margin: 0;
  min-height: 1.2em;
  color: var(--danger);
  font-size: .86rem;
  line-height: 1.5;
}
.field-err:empty { min-height: 0; }

.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg-btn {
  flex: 1 1 44px;
  min-width: 44px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.seg-btn.is-on { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.seg-btn:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }

.filter-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
.filter-input:focus-visible { outline: 2px solid var(--info); outline-offset: 1px; }
.filter-count { min-width: 3.4em; text-align: right; font-size: .82rem; }

/* ── 6. 좌석 고르기 ───────────────────────────────────────────── */

.cw-sticky { position: relative; z-index: 5; }

.seatgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.seatbtn {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 84px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.seatbtn:hover { border-color: var(--accent); }
.seatbtn:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
.seatbtn.is-hands { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: var(--panel2); }
.seatbtn.is-mine { box-shadow: inset 0 0 0 1px var(--info); }
.st-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.st-seat { font-size: .78rem; letter-spacing: .1em; }
.st-mine {
  font-size: .68rem;
  padding: 2px 6px;
  border: 1px solid var(--info);
  border-radius: 999px;
  color: var(--info);
}
.st-call { font-size: 1.1rem; font-weight: 800; }
.st-desc { font-size: var(--fs-xs); line-height: 1.45; }

/* ── 7. 장치(게임) 화면 ───────────────────────────────────────── */

.hud {
  position: sticky;
  top: var(--bar-h);
  z-index: 15;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: flex-end;
  justify-content: space-between;
  margin: 0 calc(var(--pad-x) * -1) 12px;
  padding: 8px var(--pad-x) 10px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.hud-timer { flex: 1 1 150px; min-width: 130px; display: flex; flex-direction: column; gap: 3px; }
.hud-cap { font-size: var(--fs-2xs); letter-spacing: .16em; text-transform: none; }
.hud-stats { flex: 0 1 auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hud-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel2);
  font-size: var(--fs-xs);
}
.hud-val { font-weight: 700; }

.timer-box { display: flex; align-items: baseline; gap: 6px; }
.timer-mark { font-size: .95rem; line-height: 1; color: var(--accent); }
.timer-mark:empty { display: none; }
.timer-val { font-size: clamp(1.75rem, 4.5vw, 3.25rem); letter-spacing: .02em; font-weight: 800; line-height: 1.05; }
.timer-box.is-warn .timer-val, .timer-box.is-warn .timer-mark { color: var(--accent); }
.timer-box.is-danger .timer-val, .timer-box.is-danger .timer-mark { color: var(--danger); }
.timer-box.is-danger .timer-val { animation: bi-pulse 1s steps(2, end) infinite; }

.timer-bar {
  position: relative;
  height: 10px;
  border-radius: 3px;
  background: #0a0e13;
  border: 1px solid var(--line);
  overflow: hidden;
}
.timer-fill {
  display: block;
  height: 100%;
  width: calc(var(--p, 1) * 100%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--ok) 78%, #fff), var(--ok));
  transition: width .25s linear;
}
.timer-fill.is-warn {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 78%, #fff), var(--accent));
}
/* 위험은 색만으로 말하지 않는다 — 빗금이 색각과 무관하게 같은 말을 한다 */
.timer-fill.is-danger {
  background: linear-gradient(180deg, color-mix(in srgb, var(--danger) 78%, #fff), var(--danger));
  background-image: repeating-linear-gradient(45deg, rgba(0, 0, 0, .30) 0 6px, transparent 6px 12px);
}
/* 눈금 — 채움 위에 얹혀 남은 양을 셀 수 있게 한다 */
.timer-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 11px, rgba(0, 0, 0, .55) 11px 12px);
}

.dots { display: inline-flex; gap: 4px; align-items: center; }
.dot { font-style: normal; font-size: var(--fs-sm); line-height: 1; color: var(--dim); }
.dot.is-on { color: var(--danger); }

.hud.is-hot { border-bottom-color: var(--danger); }
.hud.shake { animation: bi-shake .34s ease-in-out 1; }

@keyframes bi-shake {
  0%, 100% { transform: translateX(0); }
  22% { transform: translateX(-4px); }
  55% { transform: translateX(4px); }
  80% { transform: translateX(-2px); }
}
@keyframes bi-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

.gamewrap { position: relative; min-width: 0; }
.panes { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.bomb-mount { min-width: 0; }
.bomb-mount.is-off, .solo-manual.is-off { display: none; }

.tabs {
  display: flex;
  gap: 6px;
  margin: 12px 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
}
.tab {
  flex: 1 1 0;
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.tab.is-on { background: var(--panel2); color: var(--text); }
.tab:focus-visible { outline: 2px solid var(--info); outline-offset: -2px; }

.endcover {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px;
  text-align: center;
  background: var(--bg);
  border-radius: var(--r);
}
.endcover[hidden] { display: none; }
.ec-ico { color: var(--ok); }
.endcover.is-lose .ec-ico { color: var(--danger); }
.ec-title { margin: 0; font-size: var(--fs-2xl); letter-spacing: .06em; }
.endcover.is-win .ec-title { color: var(--ok); }
.endcover.is-lose .ec-title { color: var(--danger); }
.ec-sub { margin: 0; color: var(--dim); font-size: .92rem; }

/* ── 8. 규정집(전문가) ────────────────────────────────────────── */

.brief {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
}
.brief-ico { flex: 0 0 auto; margin-top: 2px; color: var(--dim); }
/* 3줄 고정 높이 — 역할에 따라 상자 모양이 달라지면 어깨너머로 새어 나간다. */
.brief-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.brief-text { margin: 0; font-size: .95rem; line-height: 1.6; color: var(--text); }
.brief-text + .brief-text { color: var(--dim); font-size: .86rem; }

.tools {
  position: sticky;
  top: var(--bar-h);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0;
  background: var(--bg);
}
.tools-search { display: flex; align-items: center; gap: 8px; }
.tools.is-blurred { visibility: hidden; }

.book-head { margin: 14px 0 4px; }
.book-title { margin: 0; font-size: 1rem; letter-spacing: .02em; }
.book-sub { margin: 3px 0 0; font-size: .82rem; }

.manual-wrap { min-width: 0; }
.manual-wrap.is-blurred { visibility: hidden; }
.manual-wrap.ts-m { font-size: 1rem; }
.manual-wrap.ts-l { font-size: 1.1rem; }
.manual-wrap.ts-xl { font-size: 1.22rem; }

.manual { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }

.sect {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  overflow: hidden;
}
.sect[hidden] { display: none; }
.sect-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 12px;
  background: var(--panel2);
  cursor: pointer;
  list-style: none;
}
.sect-head::-webkit-details-marker { display: none; }
.sect-head:focus-visible { outline: 2px solid var(--info); outline-offset: -2px; }
.sect-title { flex: 1 1 auto; font-weight: 800; font-size: var(--fs-md); letter-spacing: .01em; }
.sect-count { flex: 0 0 auto; font-size: .76em; }
.sect-chev { flex: 0 0 auto; display: inline-flex; color: var(--dim); transition: transform .18s ease; }
.sect[open] .sect-chev { transform: rotate(180deg); }
.sect-body { padding: 10px 12px 12px; }
.sect-note { margin: 10px 0 0; font-size: .8em; line-height: 1.6; }

.entries { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.entry { display: flex; gap: 10px; align-items: flex-start; }
.entry[hidden] { display: none; }
.entry-order {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px; height: 22px;
  margin-top: 3px;
  padding: 0 4px;
  border-radius: 6px;
  background: var(--panel2);
  color: var(--dim);
  font-size: .72em;
  font-weight: 700;
}
.entry-main { flex: 1 1 auto; min-width: 0; }
.entry-text { margin: 0; line-height: 1.65; }
.entry-text mark {
  background: rgba(77, 163, 255, .3);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}

/* 위조 조항 표시 — 본문색·작은 글씨·정적. 붉은색·배지·점멸 금지(어깨너머 유출 방지). */
.entry-alt {
  margin: 5px 0 0;
  color: var(--text);
  font-size: .76em;
  line-height: 1.55;
  opacity: .9;
}
.entry-red { margin: 5px 0 0; font-size: .76em; line-height: 1.55; }
.alt-mark { margin-right: 5px; }

.kcols { display: flex; flex-wrap: wrap; gap: 10px; }
.kcol {
  flex: 1 1 140px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel2);
}
.kcol[hidden] { display: none; }
.kcol-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.kcol-title { font-size: .82em; font-weight: 700; color: var(--dim); }
.kglyphs { display: flex; flex-wrap: wrap; gap: 6px; }
.kglyph {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 40px;
  padding: 4px 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
}
.kglyph svg { display: block; }
.kglyph-fallback { font-size: 1rem; font-weight: 700; line-height: 26px; }
.kg-num { font-size: .74em; color: var(--text); }  /* 번호가 곧 통화 좌표 — 기호보다 잘 보여도 정당하다 */

.filter-empty { margin: 12px 0 0; text-align: center; font-size: .9rem; }
.filter-empty[hidden] { display: none; }

/* 프라이버시 덮개 */
.cover {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px calc(20px + env(safe-area-inset-right, 0px))
           calc(24px + env(safe-area-inset-bottom, 0px)) calc(20px + env(safe-area-inset-left, 0px));
  text-align: center;
  background: var(--bg);
}
.cover[hidden] { display: none; }
.cover-ico { color: var(--dim); }
.cover-title { margin: 0; font-size: clamp(1.4rem, 8vw, 1.8rem); }
.cover-slot { margin: 0; color: var(--accent); font-weight: 700; letter-spacing: .04em; }
.cover-body { margin: 0; max-width: 30ch; color: var(--dim); font-size: .92rem; line-height: 1.65; }
.cover-btn { margin-top: 10px; max-width: 260px; }

/* ── 9. 지목 ──────────────────────────────────────────────────── */

.votelist { display: flex; flex-direction: column; gap: 8px; }
.voteitem {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.voteitem:hover { border-color: var(--accent); }
.voteitem:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
.voteitem.is-on { border-color: var(--accent); background: var(--panel2); }
.vi-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--panel2);
  color: var(--dim);
  font-weight: 700;
}
.voteitem.is-on .vi-num { background: var(--accent); color: var(--ink); }
.vi-name { flex: 1 1 auto; font-weight: 700; }
.vi-me { flex: 0 0 auto; font-size: .78rem; }
.vi-mark { flex: 0 0 auto; color: transparent; }
.voteitem.is-on .vi-mark { color: var(--accent); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-size: .9rem;
  font-weight: 700;
}
.chip.is-ok { border-color: var(--ok); color: var(--ok); }
.chip.is-bad { border-color: var(--danger); color: var(--danger); }

/* ── 10. 결과 ─────────────────────────────────────────────────── */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  text-align: center;
}
.hero.is-win { border-color: var(--ok); }
.hero.is-lose { border-color: var(--danger); }
.hero-ico { color: var(--ok); }
.hero.is-lose .hero-ico { color: var(--danger); }
.hero-title { margin: 0; font-size: var(--fs-2xl); letter-spacing: .03em; }
.hero.is-win .hero-title { color: var(--ok); }
.hero.is-lose .hero-title { color: var(--danger); }
.hero-note { margin: 2px 0 0; color: var(--dim); font-size: .92rem; }

.facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.facts:empty { display: none; }
.facts li {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--dim);
  font-size: .84rem;
}

.reveal {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: var(--r);
  background: var(--panel);
}
.reveal.is-pending { color: var(--dim); }
.reveal.is-ok { border-left-color: var(--ok); }
.reveal.is-bad { border-left-color: var(--danger); }
.reveal.is-flat { border-left-color: var(--accent); }
.reveal-ico { flex: 0 0 auto; color: var(--dim); }
.reveal.is-ok .reveal-ico { color: var(--ok); }
.reveal.is-bad .reveal-ico { color: var(--danger); }
.reveal-main { flex: 1 1 auto; min-width: 0; }
.reveal-text { margin: 0; font-size: 1rem; font-weight: 700; line-height: 1.55; }
.reveal.is-pending .reveal-text { font-weight: 400; }
.reveal-sub { margin: 4px 0 0; font-size: .86rem; line-height: 1.5; }
.reveal-sub[hidden] { display: none; }

/* 대조표 — 억울한 사람이 풀리는 자리 */
.rows { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.rowcard {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel2);
}
.rowcard-head {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
  font-size: .76rem;
  margin-bottom: 8px;
}
.rc-sec { min-width: 0; }
.rc-badge {
  flex: 0 0 auto;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.rowline {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 6px 0;
  line-height: 1.6;
}
.rowline + .rowline { border-top: 1px dashed var(--line); }
.rl-cap {
  flex: 0 0 auto;
  min-width: 3.6em;
  font-size: .74rem;
  font-weight: 700;
  padding-top: 3px;
  color: var(--dim);
}
.rowline.is-forged .rl-cap { color: var(--danger); }
.rowline.is-original .rl-cap { color: var(--ok); }
.rl-text { flex: 1 1 auto; min-width: 0; font-size: .92rem; }
.rowline .kglyphs { flex: 1 1 auto; }

.loads { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.loaditem {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel2);
}
.ld-call { font-size: .86rem; font-weight: 700; }
.ld-count { font-size: .86rem; color: var(--dim); }

.sharecard { display: flex; flex-direction: column; gap: 8px; }
.share-pre {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel2);
  color: var(--text);
  font-size: .8rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-wrap: anywhere;
}

/* ── 11. 규칙 카드 ────────────────────────────────────────────── */

.step-card { display: flex; flex-direction: column; gap: 10px; }
.step-ill { display: flex; justify-content: center; padding: 4px 0 2px; }
.ill { width: 100%; max-width: 320px; height: auto; }
.ill-phone { fill: var(--panel2); stroke: var(--line); stroke-width: 1.5; }
.ill-phone.is-hot { stroke: var(--accent); }
.ill-core { fill: none; stroke: var(--accent); stroke-width: 2; }
.ill-wire { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.ill-rule { stroke: var(--dim); stroke-width: 2; stroke-linecap: round; }
.ill-bubble { fill: var(--panel2); stroke: var(--line); stroke-width: 1.5; }
.ill-bubble.is-a { stroke: var(--ok); }
.ill-bubble.is-b { stroke: var(--danger); }
.ill-ring { fill: none; stroke: var(--line); stroke-width: 3; }
.ill-hand { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; }
.ill-bolt { fill: none; stroke: var(--danger); stroke-width: 2; stroke-linejoin: round; }
.ill-head, .ill-body { fill: var(--panel2); stroke: var(--line); stroke-width: 1.5; }
.ill-head.is-pick, .ill-body.is-pick { stroke: var(--accent); }
.ill-arrow { stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; }
.ill-text { fill: var(--dim); font-size: 9px; font-family: var(--font); }

.step-h { margin: 0; font-size: 1.15rem; }
.step-h:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.step-h:focus:not(:focus-visible) { outline: none; }
.step-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.step-line { display: flex; gap: 8px; align-items: flex-start; line-height: 1.65; font-size: .95rem; }
.sl-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px; height: 20px;
  margin-top: 4px;
  border-radius: 5px;
  background: var(--panel2);
  color: var(--dim);
  font-size: .72rem;
  font-weight: 700;
}
.step-count { margin: 0; font-size: .8rem; text-align: right; }

.dots-nav { justify-content: center; gap: 6px; align-self: center; }
.dot-btn {
  position: relative;
  width: 44px; height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.dot-btn::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 8px; height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: var(--line);
}
.dot-btn.is-on::after { width: 22px; margin-left: -11px; border-radius: 999px; background: var(--accent); }
.dot-btn:focus-visible { outline: 2px solid var(--info); outline-offset: -8px; border-radius: 50%; }

/* ── 12. 토스트 · 대화상자 ────────────────────────────────────── */

.toast-host {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 60;
  width: min(92vw, 420px);
  pointer-events: none;
}
.toast {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel2);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: .9rem;
  text-align: center;
}
.toast-bad { border-color: var(--danger); }

.dlg-back {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, .64);
}
.dlg {
  width: min(94vw, 380px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow);
}
.dlg-title { margin: 0; font-size: 1.1rem; }
.dlg-body { margin: 0; color: var(--dim); font-size: .92rem; line-height: 1.65; }
.dlg-actions { display: flex; gap: 8px; }
.dlg-actions > .btn { flex: 1 1 0; }

/* ── 13. 반응형 ───────────────────────────────────────────────── */

@media (min-width: 900px) {
  .scr-solo .panes { flex-direction: row; align-items: flex-start; }
  .scr-solo .bomb-mount { flex: 1 1 58%; min-width: 0; }
  .scr-solo .solo-manual { flex: 1 1 42%; min-width: 0; }
  .scr-solo .solo-manual.is-off, .scr-solo .bomb-mount.is-off { display: block; }
  .scr-solo .tabs { display: none; }
}

@media (max-width: 359px) {
  .cf-cells { gap: 4px; }
  .cf-cell { height: 50px; }
  .brand-en { letter-spacing: .28em; }
  .seatgrid { grid-template-columns: 1fr; }
  .rl-cap { min-width: 3.2em; }
}

/* ── 14. 접근성 ───────────────────────────────────────────────── */

/* base.css 가 prefers-reduced-motion 에서 애니메이션을 이미 죽인다.
   여기서는 점멸 대신 남길 정적 표시를 준다. */
@media (prefers-reduced-motion: reduce) {
  .timer-box.is-danger { box-shadow: inset 0 0 0 2px var(--danger); border-radius: 6px; }
}

@media (prefers-contrast: more) {
  .btn, .sect, .voteitem, .seatbtn, .rowcard, .checkword { border-color: var(--text); }
  .lede, .dim, .field-help, .st-desc { color: var(--text); }
  /* 새로 들인 옅은 선들도 같이 승격한다 — 안 그러면 대비 요청이 절반만 먹는다 */
  :root { --line-soft: var(--text); --line-hi: var(--text); }
  .mod::before { opacity: 1; }
  /* 질감은 대비를 갉아먹는다. 대비를 요청한 사람에게는 걷어낸다. */
  body::before, #app::after { display: none; }
}

@media print {
  .screen > .topbar, .screen-foot, .tools, .cover, .toast-host { display: none; }
}


/* 라운드 보정 스테퍼 (좌석 화면) — 중도 합류 기기의 라운드를 손으로 맞추는 손잡이 */
.round-adjust {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
}
.round-adjust .btn { min-width: 44px; padding: 8px 0; }
.round-adjust .round-val { font-weight: 700; min-width: 44px; text-align: center; }
.round-adjust .round-hint { font-size: .8rem; flex-basis: 100%; }


/* ── 연출: 라운드 종료 입장 시퀀스 ─────────────────────────────── */

/* 폭발: 백섬광 1프레임 → 암전. 문구는 정적 뒤에 떠오른다. */
.endcover.is-enter.is-lose { animation: bi-boomflash .55s steps(1, end) 1; }
@keyframes bi-boomflash {
  0%   { background: #f4f6f8; }
  8%   { background: #05070a; }
  100% { background: transparent; }
}
.endcover.is-enter .ec-sub { opacity: 0; animation: bi-late-fade .6s ease-out .9s 1 forwards; }
.endcover.is-enter.is-win .ec-sub { animation-delay: .55s; }
@keyframes bi-late-fade { to { opacity: 1; } }

.ec-time {
  margin: 2px 0 0;
  font-size: clamp(1.3rem, 8vw, 1.9rem);
  font-weight: 800;
  color: var(--ok);
  letter-spacing: .06em;
}

/* 폭발 몸통 셰이크 — HUD 셰이크보다 크고 짧다 */
.screen.is-boomshake { animation: bi-boomshake .5s ease-out 1; }
@keyframes bi-boomshake {
  0% { transform: translate(0, 0); }
  15% { transform: translate(-9px, 3px); }
  30% { transform: translate(8px, -4px); }
  45% { transform: translate(-6px, 2px); }
  60% { transform: translate(4px, -2px); }
  80% { transform: translate(-2px, 1px); }
  100% { transform: translate(0, 0); }
}

/* 잔여 30초 — 화면 가장자리가 숨쉬듯 붉어진다. 숫자를 안 봐도 몸이 먼저 안다. */
.screen.is-lowtime::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 25;
  box-shadow: inset 0 0 42px 6px rgba(255, 90, 90, .22);
  animation: bi-vignette 1.6s ease-in-out infinite;  /* 0.625Hz — 광과민 기준(3Hz)의 1/5 */
}
@keyframes bi-vignette {
  0%, 100% { opacity: .35; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .endcover.is-enter.is-lose { animation: none; }
  .endcover.is-enter .ec-sub { animation: none; opacity: 1; }
  .screen.is-boomshake { animation: none; }
  /* 맥동 대신 정적 비네트 — 정보(시간이 얼마 안 남음)는 유지한다 */
  .screen.is-lowtime::after { animation: none; opacity: .8; }
}


/* 결과 등급 훈장 — 장치(◆앞) × 지목(◆뒤). 색은 보조, 기호가 정보다. */
.hero-grade {
  margin: 6px 0 0;
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  letter-spacing: .30em;
  text-indent: .30em;
  color: var(--dim);
}
.hero.grade-full { border-color: var(--ok); box-shadow: 0 0 0 1px rgba(61, 220, 151, .28) inset; }
.hero.grade-full .hero-grade { color: var(--ok); }
.hero.grade-half .hero-grade { color: var(--accent); }
.hero.grade-late .hero-grade { color: var(--accent); }
.hero.grade-lose .hero-grade { color: var(--danger); }


/* 자리 배정표 — 자리마다 다른 초대 링크. 서버 없이 좌석 겹침을 없애는 유일한 경로다. */
.sl-panel { padding: 10px 12px; }
.sl-sum {
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 700;
  cursor: pointer;
}
.sl-sum::marker { color: var(--dim); }
.seatlinks { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.sl-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.sl-n {
  flex: 0 0 22px;
  color: var(--dim);
  font-weight: 700;
  text-align: center;
}
.sl-cs { flex: 1 1 auto; font-weight: 700; min-width: 0; }
.sl-row .btn { flex: 0 0 auto; }


/* 좌석 인장 — 점호로 좌석 겹침·공석·다른 판을 잡는다 */
.sealbox { text-align: center; }
.seal-mine {
  display: inline-block;
  margin: 4px 0;
  padding: 8px 22px;
  border: 1px solid var(--line-hi);
  border-radius: var(--r-lg);
  background: #0a0e13;
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, .6);
  font-size: clamp(2.6rem, 13vw, 4rem);
  font-weight: 800;
  letter-spacing: .12em;
  color: var(--accent);
  text-shadow: 0 0 16px color-mix(in srgb, var(--accent) 40%, transparent);
  line-height: 1.1;
}
.sealgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 8px;
  margin: 6px 0;
}
.seal-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel2);
}
.seal-seat { font-size: .74rem; }
.seal-v { font-size: 1.5rem; font-weight: 800; letter-spacing: .06em; }

/* 집결 절차 3줄 */
.steps {
  margin: 0;
  padding-left: 20px;
  font-size: .88rem;
  line-height: 1.9;
}
.steps li { padding-left: 2px; }



/* ══ 데스크톱 레이아웃 ═══════════════════════════════════════════
   화면마다 답이 다르다. 타이틀은 넓히면 링크 목록이 되고, 규정집은 넓히면
   한 줄이 63자가 돼 소리 내어 읽기가 나빠진다. 그래서 화면 이름마다 폭을 따로 정한다. */

@media (min-width: 1024px) {
  .scr-title                { --shell: 1000px; }
  .scr-create, .scr-join    { --shell: 720px; }
  .scr-rules                { --shell: 900px; }
  .scr-vote                 { --shell: 820px; }
  .scr-role                 { --shell: 960px; }
  .scr-result               { --shell: 1040px; }
  .scr-expert               { --shell: 1080px; }
  .scr-defuser, .scr-aiplay { --shell: 1200px; }
  .scr-solo                 { --shell: 1240px; }
}
@media (min-width: 1440px) {
  .scr-expert               { --shell: 1180px; }
  .scr-result               { --shell: 1120px; }
  .scr-defuser, .scr-aiplay { --shell: 1360px; }
  .scr-solo                 { --shell: 1400px; }
}

/* ── 상단바는 콘텐츠가 아니라 크롬이다 ────────────────────
   .screen 의 폭 제한을 물려받으면 1900px 화면에서 600px 짜리 띠가
   허공에 떠 있는 것처럼 보인다. 바탕은 화면 끝까지, 내용만 셸 폭으로. */
.screen > .topbar {
  position: relative;
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding-left: max(var(--pad-x), calc(50vw - var(--shell) / 2));
  padding-right: max(var(--pad-x), calc(50vw - var(--shell) / 2));
  background: linear-gradient(180deg, rgba(21, 26, 33, .92), rgba(11, 14, 17, .92));
  backdrop-filter: none;
}

/* ── 타이틀 ────────────────────────────────────────────────
   좁은 화면에서는 세로 한 줄, 넓은 화면에서는 좌(정체) / 우(할 일) 2단.
   2단으로 가르는 진짜 이유는 미관이 아니라 **배경 다이얼과 버튼을 물리적으로 떼어놓기** 위해서다.
   한 컬럼에 겹쳐 두면 다이얼 눈금이 버튼 사이로 비쳐 화면이 어수선해진다. */
.scr-title { display: flex; flex-direction: column; min-height: 100dvh; }
.scr-title .screen-body { margin: auto 0; width: 100%; }

.title-cols { display: flex; flex-direction: column; gap: var(--s5); min-width: 0; }

.brand {
  position: relative;
  padding: 24px 0 10px;
  isolation: isolate;      /* 다이얼이 이 상자 밖으로 스며 나가지 않게 */
}
.title-dial {
  position: absolute;
  left: 50%;
  top: 42%;
  width: min(70vw, 300px);
  height: auto;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  z-index: -1;             /* 언제나 글자·버튼 아래 */
  pointer-events: none;
  opacity: .34;
}
.td-minor { stroke: var(--line); stroke-width: 1.2; }
.td-major { stroke: var(--line-hi); stroke-width: 2; }
.td-ring, .td-ring2 { fill: none; stroke: var(--line); stroke-width: 1; }
.td-ring2 { stroke-dasharray: 2 9; opacity: .7; }
.td-live { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }

/* 진입 때 한 번만 돈다. 상시 회전은 배터리와 시선을 같이 먹는다. */
.td-ticks {
  transform-origin: 100px 100px;
  animation: bi-dial-in .7s cubic-bezier(.16, .84, .3, 1) 1 both;
}
@keyframes bi-dial-in {
  from { transform: rotate(-14deg); opacity: 0; }
  to   { transform: rotate(0);      opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .td-ticks { animation: none; } }

.brand-lockup, .brand-tag, .brand-what { position: relative; z-index: 1; }

/* 위험 표시대 — 워드마크와 아래 내용을 갈라놓는 한 줄 */
.brand::after {
  content: '';
  display: block;
  width: min(280px, 70%);
  height: 6px;
  margin: 18px auto 0;
  border-radius: 2px;
  opacity: .55;
  background: repeating-linear-gradient(-45deg,
    color-mix(in srgb, var(--accent) 55%, transparent) 0 7px, transparent 7px 14px);
}

/* 한 줄 설명 — "이게 무슨 게임인가"에 답하지 않으면 메뉴 여섯 개는 벽이다 */
.brand-what {
  margin: 14px auto 0;
  max-width: 34em;
  color: var(--dim);
  font-size: var(--fs-sm);
  line-height: 1.65;
}

.title-menu { display: flex; flex-direction: column; gap: var(--s5); min-width: 0; }

/* 목적별로 묶는다. 라벨 하나가 "무엇부터 눌러야 하는가"를 답한다. */
.menu-group { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.menu-h {
  margin: 0;
  font-size: var(--fs-2xs);
  font-weight: 800;
  letter-spacing: .18em;
  color: var(--dim);
  text-transform: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.menu-h::after {
  content: '';
  flex: 1 1 auto;
  height: 1px;
  background: var(--line);
}

/* 처음 온 사람에게만 뜨는 안내. 한 판이라도 돌리면 사라진다. */
.firstrun {
  padding: 16px;
  border: 1px solid var(--line-hi);
  border-radius: var(--r-lg);
  background:
    radial-gradient(120% 160% at 0% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%),
    var(--panel);
  box-shadow: var(--shadow-hi), var(--shadow-1);
}
.firstrun-t {
  margin: 0 0 12px;
  font-size: var(--fs-sm);
  font-weight: 800;
  letter-spacing: .02em;
}
.firstrun-row { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 520px) {
  .firstrun-row { grid-template-columns: 1fr 1fr; }
}

/* ── 좌석 — 통화로 부르는 번호가 가장 커야 한다.
   DOM 은 그대로 두고 display:contents 로 자식을 그리드에 직접 앉힌다. ── */
@media (min-width: 480px) {
  .seatgrid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
}
.seatbtn {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  grid-template-areas: "num call" "num desc";
  column-gap: 12px;
  row-gap: 2px;
  align-items: center;
  min-height: 96px;
  padding: 14px;
}
.st-top { display: contents; }
.st-seat {
  grid-area: num;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: var(--r-sm);
  background: var(--panel3);
  border: 1px solid var(--line);
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0;
}
.st-call { grid-area: call; font-size: var(--fs-md); font-weight: 800; }
.st-desc { grid-area: desc; }
.st-mine { position: absolute; top: 8px; right: 8px; }
.seatbtn.is-hands { box-shadow: inset 3px 0 0 var(--accent), var(--shadow-hi), var(--shadow-1); }
.seatbtn.is-mine  { box-shadow: inset 0 0 0 2px var(--info), var(--shadow-hi); }
.seal-cell { background: var(--panel3); }
.seal-v { font-size: var(--fs-lg); }

/* ── 규칙 — 삽화가 고정폭이라 1단이면 눈이 위아래로 튄다.
   삽화 좌 / 글 우로 갈라 한 번에 읽히게 한다. ── */
@media (min-width: 900px) {
  .step-card {
    display: grid;
    grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
    grid-template-areas: "ill head" "ill lines" "ill count";
    align-content: start;
    column-gap: var(--s5);
    row-gap: 8px;
  }
  .step-ill   { grid-area: ill; align-self: center; margin: 0; }
  .step-h     { grid-area: head; }
  .step-lines { grid-area: lines; }
  .step-count { grid-area: count; }
}

/* ── 지목 — 6명이 한 화면에 들어와야 시각 비교가 된다 ── */
@media (min-width: 768px) {
  .votelist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .voteitem { min-height: 68px; }
  .vi-num { width: 36px; height: 36px; font-size: var(--fs-md); }
}

/* ── 규정집 2단 — 한 단이 한글 29자/줄이 된다. 소리 내어 읽기 최적 구간이다.
   멀티컬럼(columns:2)은 쓰지 않는다: details 가 단 경계에서 쪼개지고,
   조항이 두 단에 걸치면 어깨너머로 조항 길이를 비교할 단서가 생긴다. ── */
@media (min-width: 1024px) {
  .scr-expert .manual {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
  }
  /* 큰 글씨 모드에서 2단이면 한 줄 24자라 오히려 읽기가 나빠진다 */
  .scr-expert .manual-wrap.ts-xl .manual { grid-template-columns: 1fr; }
  .scr-expert .brief { padding: 16px 18px; }
}

/* ── 해체자 — 좌측 계기판 레일.
   상태판은 게임 내내 되묻는 값이라 가로 스티키로 두면 세로 공간만 먹는다. ── */
@media (min-width: 1024px) {
  .scr-defuser .bomb-mount {
    display: grid;
    grid-template-columns: 292px minmax(0, 1fr);
    gap: var(--s5);
    align-items: start;
  }
  .scr-defuser .statusbar {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    margin-bottom: 0;
    padding: 16px;
  }
  .scr-defuser .statusbar .stat {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line-soft);
  }
  .scr-defuser .statusbar .stat:last-child { border-bottom: 0; padding-bottom: 0; }
  .scr-defuser .statusbar.is-stuck { box-shadow: var(--shadow-hi), var(--shadow-1); }
}
@media (min-width: 1440px) {
  .scr-defuser .bomb-mount { grid-template-columns: 320px minmax(0, 1fr); }
  .scr-defuser .modgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* 좁아진 것은 뷰포트가 아니라 실제 칸 폭이다 — 밸브 구획 최소 286px 를 지킨다 */
@media (min-width: 900px) and (max-width: 1279px) {
  .scr-solo .modgrid { grid-template-columns: 1fr; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .scr-aiplay .modgrid { grid-template-columns: 1fr; }
}

/* ── 결과 — 스크롤 없이 명예회복 표까지 보이는 게 이 화면의 목적 ── */
@media (min-width: 1024px) {
  .scr-result .screen-body > .stack {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--s5);
    align-items: start;
  }
  .scr-result .hero,
  .scr-result .facts     { grid-column: 1 / -1; }
  .scr-result .reveal,
  .scr-result .rowsbox   { grid-column: 1; }
  .scr-result .loadsbox,
  .scr-result .sharecard { grid-column: 2; }
}

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 5vw, 40px) var(--s4);
  background-image:
    radial-gradient(120% 140% at 50% -20%, color-mix(in srgb, var(--ok) 15%, transparent), transparent 62%),
    var(--sheen);
}
.hero.is-lose {
  background-image:
    radial-gradient(120% 140% at 50% -20%, color-mix(in srgb, var(--danger) 17%, transparent), transparent 62%),
    var(--sheen);
}
.facts li { background: var(--panel3); font-size: var(--fs-xs); }

/* ── 데스크톱 상단바 — 높이(--bar-h)는 건드리지 않고 내용물만 키운다 ── */
@media (min-width: 768px) {
  .tb-code { font-size: var(--fs-md); letter-spacing: .2em; }
  .tb-sub { font-size: var(--fs-2xs); }
  .screen > .topbar { box-shadow: 0 1px 0 rgba(255, 255, 255, .04); }
}

/* ── 강조색 위계 — 주황은 "지금 손대야 할 것" 하나뿐이어야 한다.
   안내 노트와 페이지 점은 경고도 액션도 아니다. ── */
.note { border-left-color: var(--line-hi); }
.note .ico { color: var(--info); }
.note-danger { border-left-color: var(--danger); }
.dot-btn.is-on::after { background: var(--text); }

/* ── 규정집은 의도적으로 밋밋해야 한다. 여기 개선은 장식이 아니라 조판이다. ── */
.sect-head { background: var(--panel2); border-bottom: 1px solid var(--line-soft); }
.entry-order { background: var(--panel3); color: var(--text); font-family: var(--font-mono); }
.tools { background: var(--bg); border-bottom: 1px solid var(--line-soft); }

/* 끝내기 커버 — 정적이 카타르시스다. 바탕만 보강한다. */
.endcover {
  background:
    radial-gradient(90% 70% at 50% 30%, color-mix(in srgb, var(--danger) 12%, transparent), transparent 65%),
    var(--bg);
}
.endcover.is-win {
  background:
    radial-gradient(90% 70% at 50% 30%, color-mix(in srgb, var(--ok) 12%, transparent), transparent 65%),
    var(--bg);
}

/* 언어 전환 — 현재 언어가 아니라 바꿀 언어를 보여준다 */
.tb-lang {
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--dim);
}
.tb-lang:hover { color: var(--text); }


/* ── 타이틀 2단 (넓은 화면) ───────────────────────────────── */
@media (min-width: 1000px) {
  .title-cols {
    display: grid;
    grid-template-columns: minmax(360px, 1.1fr) minmax(340px, .9fr);
    gap: var(--s6);
    align-items: center;
  }
  .brand { padding: 0; text-align: left; }
  .brand::after { margin-left: 0; margin-right: auto; }
  .brand-what { margin-left: 0; }
  .title-dial { left: 46%; top: 46%; width: min(38vw, 460px); }
  .scr-title .brand-en { font-size: clamp(3rem, 6vw, 5.2rem); }
}
@media (min-width: 1440px) {
  .scr-title { --shell: 1200px; }
}

/* ── 데스크톱에서는 조작 대상도 같이 커져야 한다 ──────────────
   폰 기준 48px 버튼을 1900px 모니터에 그대로 두면 화면에 비해 작아 보인다.
   글자만 키우면 버튼이 헐렁해지므로 높이·여백·글자를 같이 올린다. */
@media (min-width: 1024px) and (pointer: fine) {
  .btn { min-height: 52px; padding: 13px 20px; font-size: var(--fs-md); }
  .btn-lg { min-height: 64px; font-size: var(--fs-lg); }
  .menu-h { font-size: var(--fs-xs); }
}

/* ── 「지금 할 일」 안내 ─────────────────────────────────────
   계기부터 들이밀면 처음 온 사람은 무엇부터 손대야 할지 알 수 없다.
   장치 위에 한 줄로 앉혀 시선이 계기로 가기 전에 먼저 읽히게 한다. */
.stepguide {
  margin: 0 0 var(--s4);
  padding: 14px 16px;
  border: 1px solid var(--line-hi);
  border-left-width: 3px;
  border-left-color: var(--accent);
  border-radius: var(--r);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 42%),
    var(--panel);
  box-shadow: var(--shadow-hi), var(--shadow-1);
}
.sg-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.sg-cap {
  font-size: var(--fs-2xs);
  font-weight: 800;
  letter-spacing: .16em;
  color: var(--accent);
}
.sg-num { font-size: var(--fs-2xs); color: var(--dim); }
.sg-line {
  margin: 0 0 12px;
  font-size: var(--fs-sm);
  line-height: 1.6;
}
.sg-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.sg-next { min-height: 40px; padding: 8px 18px; }
.sg-off { font-size: var(--fs-2xs); }

/* 초대형 화면에서의 셸 폭 — 읽기 좋은 줄 길이를 넘지 않는 선에서만 넓힌다 */
@media (min-width: 1700px) {
  .scr-create, .scr-join    { --shell: 860px; }
  .scr-vote                 { --shell: 980px; }
  .scr-role                 { --shell: 1120px; }
  .scr-rules                { --shell: 1040px; }
  .scr-result               { --shell: 1240px; }
  .scr-expert               { --shell: 1280px; }
  .scr-title                { --shell: 1320px; }
  .scr-defuser, .scr-aiplay { --shell: 1560px; }
  .scr-solo                 { --shell: 1600px; }
}

/* ── 매칭 ───────────────────────────────────────────────────
   서버가 있어야 되는 유일한 화면이다. 그래서 "안 되는 상태"를 감추지 않고
   무엇이 안 되는지 + 대신 무엇을 할 수 있는지를 같은 자리에서 말한다. */
.ms-panel { display: flex; flex-direction: column; gap: 14px; }
.ms-status { margin: 0; font-size: var(--fs-sm); color: var(--dim); min-height: 1.4em; }
.ms-wait { margin: 0; font-size: var(--fs-md); font-weight: 700; letter-spacing: .04em; }

/* 대기 표시 — 세 점이 순서대로 밝아진다. 1.2Hz, 위치는 고정(움직이면 시선을 먹는다). */
.ms-spin { display: none; gap: 8px; align-items: center; height: 12px; }
.ms-spin.is-on { display: flex; }
.ms-spin i {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--line-hi);
  animation: bi-wait 1.2s ease-in-out infinite;
}
.ms-spin i:nth-child(2) { animation-delay: .2s; }
.ms-spin i:nth-child(3) { animation-delay: .4s; }
@keyframes bi-wait {
  0%, 100% { background: var(--line-hi); }
  40%      { background: var(--accent); }
}
@media (prefers-reduced-motion: reduce) {
  .ms-spin i { animation: none; background: var(--accent); }
}

/* 스토어 정책이 요구하는 문서 링크 — 앱 안에서 닿을 수 있어야 한다 */
.legal-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.legal-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  color: var(--dim);
  font-size: var(--fs-2xs);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.legal-link:hover { color: var(--text); border-bottom-color: var(--line-hi); }
.legal-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
@media (min-width: 1000px) { .legal-row { justify-content: flex-start; } }

/* ── 초대 — 방 열기 화면의 주인공 ──────────────────────────
   서버가 없어 로비를 못 만든다. 대신 자리마다 다른 링크를 하나씩 보내고,
   보낸 자리를 표시해 "누가 남았나"를 화면이 대신 기억한다. 로비 없는 로비다. */
.sl-panel { display: flex; flex-direction: column; gap: 10px; }
.sl-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.sl-sum { margin: 0; font-size: var(--fs-md); font-weight: 800; letter-spacing: .01em; }
.sl-progress { margin: 0; font-size: var(--fs-2xs); color: var(--dim); letter-spacing: .06em; }
.sl-progress.is-done { color: var(--ok); }

.seatlinks { display: flex; flex-direction: column; gap: 8px; }
.sl-row { display: flex; align-items: stretch; gap: 8px; min-width: 0; }
.sl-row.is-mine {
  align-items: center;
  padding: 10px 14px;
  border: 1px dashed var(--line-hi);
  border-radius: var(--r);
  background: var(--panel2);
}

.sl-send {
  flex: 1 1 auto;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  text-align: left;
}
.sl-send.is-sent { border-color: var(--ok); opacity: .72; }
.sl-send.is-sent .sl-act { color: var(--ok); }

.sl-name { display: inline-flex; align-items: baseline; gap: 8px; min-width: 0; }
.sl-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  padding: 1px 6px;
  border-radius: var(--r-sm);
  background: var(--panel3);
  font-size: var(--fs-2xs);
  color: var(--text);
}
.sl-cs { font-weight: 700; }
.sl-act { font-size: var(--fs-2xs); color: var(--dim); letter-spacing: .08em; white-space: nowrap; }
.sl-mine-tag {
  margin-left: auto;
  font-size: var(--fs-2xs);
  letter-spacing: .1em;
  color: var(--accent);
  font-weight: 800;
}
.sl-take { flex: 0 0 auto; }

/* ── 난이도 표시 ────────────────────────────────────────────
   인원마다 난이도가 다른 건 예전부터 그랬는데(bomb.js DIFFICULTY) 화면에 표시가 없어
   고르는 사람이 알 수 없었다. 선택이 의미를 가지려면 결과가 보여야 한다. */
.players-box { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.diff-line {
  margin: 0;
  font-size: var(--fs-2xs);
  letter-spacing: .04em;
  color: var(--dim);
}

/* ── 스피드런 ───────────────────────────────────────────────
   시계가 거꾸로 도는 유일한 모드. 큰 숫자는 쌓인 시간(=기록)이고,
   아래 게이지는 여전히 남은 예산을 말한다. */
.run-panel { display: flex; flex-direction: column; gap: 14px; }
.run-best {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.run-best.has-best { color: var(--text); font-weight: 700; }
.run-clear { font-size: var(--fs-2xs); }

/* 끝 화면의 기록 · 신기록 */
.ec-best {
  margin: 6px 0 0;
  font-size: var(--fs-sm);
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--accent);
}
.ec-fail { margin: 6px 0 0; font-size: var(--fs-xs); }


/* ── 검증에서 잡힌 것들 ────────────────────────────────────── */

/* 단계 버튼에 좌우 여백이 없어 「Standard」가 단어 중간에서 끊겼다.
   전역 button 리셋이 없어 UA 기본 padding(1px 6px)만 있었다. */
.seg-btn { padding: 8px 6px; overflow-wrap: normal; word-break: keep-all; }

/* 좁은 폭에서는 4칸을 한 줄에 밀어 넣지 않는다 — 「Standard」가 잘린다.
   2×2 로 접으면 칸당 폭이 두 배가 되어 어느 언어에서도 온전히 들어간다. */
@media (max-width: 420px) {
  .run-panel .seg { display: grid; grid-template-columns: 1fr 1fr; }
  .run-panel .seg-btn { flex: none; }
}

/* 실패한 판인데 기록이 성공 색(초록)으로 떴다 — 바로 아래에 「기록으로 남지 않는다」가 붙는데도. */
.endcover.is-lose .ec-time { color: var(--dim); }

/* 스피드런도 데스크톱에서 장치+규정집 2단이어야 한다.
   .scr-solo 만 지정돼 있어 스피드런은 탭 전환이었다 — 규정집을 보려면 장치가 사라져 기록에 손해다. */
@media (min-width: 900px) {
  .scr-runplay .panes { flex-direction: row; align-items: flex-start; }
  .scr-runplay .bomb-mount { flex: 1 1 58%; min-width: 0; }
  .scr-runplay .solo-manual { flex: 1 1 42%; min-width: 0; }
  .scr-runplay .solo-manual.is-off, .scr-runplay .bomb-mount.is-off { display: block; }
  .scr-runplay .tabs { display: none; }
}

/* 타이머 게이지 — width 전이는 매 프레임 레이아웃을 강제한다(판 내내 60fps).
   transform 은 컴포지터에서 처리되어 메인스레드를 건드리지 않는다. 보이는 결과는 같다. */
.timer-fill {
  width: 100%;
  transform: scaleX(var(--p, 1));
  transform-origin: left center;
  transition: transform .25s linear;
}
