/**
 * 법전 vNext UI — design/ui-{intro,main,case}.html 목업의 이식본.
 * 보이는 것의 정본은 목업·디자인 정의서 v1.1 이고, 이 파일은 그 마크업을
 * 상태 바인딩이 가능한 형태로 옮긴 것이다. gap 미사용(전사 규칙) ·
 * 하드코딩 hex 최소화 · 14px 미만 텍스트 금지(판 씬 좌표계 라벨만 예외).
 */

@import url("../fonts/noto-serif-kr.css");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 클래스가 display 를 덮어써도 숨김이 이기게 한다 */
[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  min-width: 320px;
}

body {
  word-break: keep-all;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%; /* 인앱 4단 배율이 유일한 확대 경로 — 이중 곱 방지 */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; /* iOS 더블탭 줌 오발 방지 — 게임 입력을 한 번의 탭으로 고정한다 */
  -webkit-touch-callout: none; /* 말 스프라이트 길게 눌렀을 때 이미지 저장 콜아웃 방지 */
  -webkit-user-select: none;
  user-select: none;
  background: var(--backdrop);
  font-family: var(--sans);
  color: var(--ink);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

@media (min-width: 768px) {
  body {
    background:
      radial-gradient(90% 70% at 50% 30%, rgba(154, 106, 0, 0.1), transparent 60%),
      repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 7px),
      var(--backdrop);
  }
}

/* 변론 입력만은 선택·커서가 살아야 한다 */
textarea,
input {
  -webkit-user-select: text;
  user-select: text;
}

.ic {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.12em;
}

.doc {
  font-family: var(--serif);
}

button {
  font-family: inherit;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  text-align: inherit;
}

button:focus-visible,
[tabindex]:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--teal-deep);
  outline-offset: 3px;
}

.screen.dark button:focus-visible,
.screen.dark [tabindex]:focus-visible {
  outline-color: var(--gold-soft);
}

/* ── 폰 프레임 — 모바일 전체 화면 · 데스크톱 중앙 무대 (한 빌드) ── */
.phone {
  width: min(100vw, 430px);
  height: min(100vh, 860px);
  height: min(var(--app-height, 100dvh), 860px);
  background: linear-gradient(168deg, var(--paper-3), var(--paper));
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .phone {
    width: min(100vw - 16px, 430px);
    height: min(100dvh - 24px, 860px);
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  }
}

@media (max-width: 767px) {
  .phone {
    height: var(--app-height, 100dvh);
    max-height: none;
  }
}

/* 화면 전환 — 컨트롤러가 .on 을 토글한다 */
.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
}

.screen.on {
  display: flex;
}

/* ═══════════════ 연출 레이어 — 옻칠 다크 (타이틀·대국 준비·온보딩) ═══════════════ */

.screen.dark {
  --entry-frame-inset: 14px;
  color: var(--gold-soft);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 5px),
    linear-gradient(180deg, var(--lacquer-2) 0%, var(--lacquer) 45%, var(--lacquer-3) 100%);
}

.screen.dark::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(202, 166, 79, 0.35);
  border-radius: 10px;
  pointer-events: none;
  z-index: 30;
}

.btn-gold {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  border: 1px solid rgba(202, 166, 79, 0.75);
  border-radius: 8px;
  color: var(--gold-soft);
  font-size: var(--type-btn);
  font-weight: 700;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  background: rgba(202, 166, 79, 0.05);
}

.btn-gold.tight {
  letter-spacing: 0.12em;
  text-indent: 0.12em;
}

.btn-gold.dim2 {
  border-color: rgba(202, 166, 79, 0.35);
  color: rgba(217, 196, 145, 0.6);
}

.btn-gold + .btn-gold {
  margin-top: 12px;
}

/* 연출 화면의 하단 CTA는 같은 폭·안전영역·바닥선을 공유한다. */
.bottom-action {
  position: relative;
  z-index: 31;
  flex: 0 0 auto;
  padding: 0 clamp(24px, 8vw, 34px) calc(32px + env(safe-area-inset-bottom, 0px));
}

/* 타이틀 */
.title-screen {
  justify-content: flex-end;
}

.sound-toggle {
  position: absolute;
  top: calc(26px + env(safe-area-inset-top, 0px));
  right: 26px;
  z-index: 5;
  width: var(--tap-target);
  height: var(--tap-target);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-soft);
  border: 0;
  background: transparent;
  opacity: 0.78;
}

.sound-toggle .ic {
  width: 20px;
  height: 20px;
}

.sound-toggle:active {
  opacity: 1;
}

.title-screen .mast {
  position: absolute;
  left: 0;
  right: 0;
  top: 11%;
  text-align: center;
  z-index: 2;
}

.rule2 {
  margin: 0 auto;
  width: 56px;
  height: 3px;
  border-top: 1px solid var(--gold-line);
  border-bottom: 1px solid var(--gold-line);
}

.title-screen .t {
  margin-top: 24px;
  font-size: 62px;
  font-weight: 700;
  letter-spacing: 0.42em;
  margin-left: 0.42em;
  color: var(--gold-soft);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.title-screen .tag {
  margin-top: 16px;
  font-size: var(--type-label);
  font-weight: 600;
  color: rgba(217, 196, 145, 0.55);
  letter-spacing: 0.24em;
  margin-left: 0.24em;
}

.title-screen .codex-art {
  position: absolute;
  left: 50%;
  top: 33%;
  transform: translateX(-50%);
  width: 126%;
  max-width: none;
  filter: drop-shadow(0 0 30px rgba(202, 166, 79, 0.22)) drop-shadow(0 16px 26px rgba(0, 0, 0, 0.55));
}

.title-screen .glow {
  position: absolute;
  left: 50%;
  top: 60%;
  transform: translate(-50%, -50%);
  width: 78%;
  height: 34%;
  z-index: 0;
  background: radial-gradient(50% 50% at 50% 50%, rgba(202, 166, 79, 0.13), transparent 70%);
}

.title-screen .stamp {
  position: absolute;
  right: 19%;
  top: 54.5%;
  width: 58px;
  height: 58px;
  z-index: 3;
  transform: rotate(-3deg);
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.45));
}

.title-screen .foot {
  text-align: center;
}

.title-intro {
  width: 100%;
  min-height: var(--tap-target);
  margin-top: 2px;
  color: var(--gold-soft);
  font-size: var(--type-label);
  font-weight: 600;
  opacity: 0.62;
  text-align: center;
}

.product-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: var(--type-label);
  line-height: 1.35;
  text-align: center;
}

.product-contact {
  min-height: var(--tap-target);
  display: flex;
  align-items: center;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 대국 진입 셸 — 헤더·본문·하단 조작의 기준선은 화면마다 고정한다. */
.entry-screen {
  --entry-content-inline: clamp(24px, 8vw, 34px);
  overflow: hidden;
}

.entry-header {
  flex: 0 0 auto;
  padding: calc(28px + env(safe-area-inset-top, 0px)) var(--entry-content-inline) 14px;
  text-align: center;
}

.entry-header .rule2 {
  width: 42px;
  margin-bottom: 14px;
}

.entry-header .h {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.3em;
  margin-left: 0.3em;
  color: var(--entry-text);
}

.entry-header .s {
  margin-top: 8px;
  font-size: var(--type-label);
  color: var(--entry-text-subtle);
  letter-spacing: 0.06em;
}

.entry-body {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 var(--entry-content-inline);
}

.entry-footer {
  --entry-footer-bottom: calc(var(--entry-frame-inset) + 32px + env(safe-area-inset-bottom, 0px));
  position: relative;
  z-index: 31;
  flex: 0 0 auto;
  padding: 14px var(--entry-content-inline) var(--entry-footer-bottom);
  text-align: center;
}

/* 숫자 키보드가 visual viewport를 줄인 경우에만 입력 본문을 안전하게 올린다. */
@media (max-height: 480px) {
  .entry-body:focus-within {
    overflow-y: auto;
    justify-content: flex-start;
  }
}

.entry-footer .btn-back {
  margin-top: 8px;
}

.entry-footer:empty {
  min-height: calc(20px + env(safe-area-inset-bottom, 0px));
  padding-top: 0;
}

.entry-body .sect {
  padding: 0;
}

.entry-body .sect + .sect {
  margin-top: 22px;
}

.entry-body .lb,
.lobby-lb {
  font-size: var(--type-label);
  font-weight: 700;
  color: var(--entry-text-subtle);
  letter-spacing: 0.24em;
  margin-bottom: 8px;
}

.judge-row {
  display: flex;
}

.judge-card {
  flex: 1;
  min-width: 0;
  min-height: var(--tap-target);
  border: 1px solid var(--entry-border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--entry-surface);
  position: relative;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  color: inherit;
}

.judge-card + .judge-card {
  margin-left: 12px;
}

.judge-card.on {
  border-color: var(--entry-border-strong);
  background: var(--entry-surface-selected);
  box-shadow: inset 0 0 0 1px var(--gold-line), var(--entry-shadow-selected);
}

.judge-card .por {
  height: 120px;
  margin: 6px 6px 0;
  overflow: hidden;
  position: relative;
  background: var(--surface-void);
  border-radius: 4px;
}

.judge-card .por img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 12%;
}

/* 도돌이는 갓이 원본 상단에 닿아 있어 공통 초점값을 쓰면 윗부분이 잘린다. */
.judge-card[data-judge-id="precedentist"] .por img {
  object-position: center top;
}

.judge-card .por::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, var(--entry-portrait-scrim));
}

.judge-card:not(.on) .por img {
  filter: saturate(0.55) brightness(0.75);
}

.judge-card .meta {
  padding: 9px 11px 11px;
  text-align: left;
}

.judge-card .role {
  font-size: var(--type-label);
  font-weight: 800;
  color: var(--pred-red-soft);
  letter-spacing: 0.14em;
}

.judge-card .nm {
  margin-top: 1px;
  font-size: 17px;
  font-weight: 700;
  color: var(--entry-text);
  letter-spacing: 0.1em;
}

.judge-card .quote {
  margin-top: 5px;
  font-size: var(--type-label);
  color: var(--entry-text-muted);
  line-height: 1.5;
  min-height: 20px;
  overflow: visible;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.judge-card .pick {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--entry-border-strong);
  background: var(--entry-selection-scrim);
  color: var(--entry-text);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  z-index: 2;
}

.judge-card.on .pick {
  display: flex;
}

.choice-row {
  display: flex;
  margin-top: 2px;
}

.choice-chip {
  flex: 1;
  min-width: 0;
  min-height: 64px;
  border: 1px solid var(--entry-border);
  border-radius: 6px;
  padding: 12px 13px;
  background: var(--entry-surface);
  display: block;
  color: inherit;
  text-align: left;
}

.choice-chip + .choice-chip {
  margin-left: 12px;
}

.choice-chip.on {
  border-color: var(--entry-border-strong);
  background: var(--entry-surface-selected);
  box-shadow: inset 0 0 0 1px var(--gold-line);
}

.choice-chip.locked {
  opacity: 0.56;
  border-style: dashed;
  background: var(--entry-surface);
}

.choice-chip .mn {
  font-size: 15px;
  font-weight: 700;
  color: var(--entry-text);
  letter-spacing: 0.08em;
}

.choice-chip .md {
  margin-top: 4px;
  font-size: var(--type-label);
  color: var(--entry-text-subtle);
  line-height: 1.6;
}

.choice-chip .badge {
  display: inline-flex;
  align-items: center;
  margin-top: 7px;
  font-size: var(--type-label);
  font-weight: 700;
  color: var(--entry-text-muted);
  border: 1px solid var(--entry-border);
  border-radius: 3px;
  padding: 1px 7px;
}

.choice-chip .badge .ic {
  margin-right: 3px;
}

/* ─── 대국 방식 선택 · 맞대국 로비 ─── */

.route-choice-list,
.lobby-panel {
  display: flex;
  flex-direction: column;
}

.lobby-versus-mark {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: min(100%, 280px);
  min-height: 64px;
  margin-right: auto;
  margin-bottom: 18px;
  margin-left: auto;
}

.lobby-versus-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 70px;
  height: 54px;
}

.lobby-versus-piece {
  display: block;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border: 3px solid var(--entry-text);
  border-radius: 50%;
  box-shadow: var(--entry-shadow-selected);
}

.lobby-versus-side.host .lobby-versus-piece {
  background: var(--teal);
}

.lobby-versus-side.guest .lobby-versus-piece {
  background: var(--clay);
}

.lobby-versus-label {
  display: block;
  width: 100%;
  height: 20px;
  margin-top: 6px;
  color: var(--entry-text-muted);
  font-size: var(--type-label);
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  white-space: nowrap;
}

.lobby-versus-center {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 28px;
  margin-right: 10px;
  margin-left: 10px;
  border: 1px solid var(--entry-border-strong);
  border-radius: 50%;
  color: var(--entry-text);
  font-size: var(--type-heading);
  font-weight: 800;
}

.lobby-versus-center::before,
.lobby-versus-center::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 22px;
  height: 1px;
  background: var(--entry-border-strong);
}

.lobby-versus-center::before {
  right: 100%;
}

.lobby-versus-center::after {
  left: 100%;
}

.route-choice-card {
  width: 100%;
  min-height: var(--tap-target);
  overflow: hidden;
  border: 1px solid var(--entry-border);
  border-radius: var(--r-m);
  background: var(--entry-surface);
  color: var(--entry-text);
  text-align: left;
}

.route-choice-card + .route-choice-card {
  margin-top: 12px;
}

.route-art {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 1;
  object-fit: cover;
  object-position: center;
  background: var(--surface-void);
}

.route-copy {
  display: block;
  padding: 12px 14px 13px;
}

.route-title,
.route-desc,
.route-choice-title,
.route-choice-description {
  display: block;
}

.route-title,
.route-choice-title {
  font-size: var(--type-heading);
  font-weight: 800;
  letter-spacing: 0.1em;
}

.route-desc,
.route-choice-description {
  margin-top: 4px;
  font-size: var(--type-label);
  color: var(--entry-text-muted);
  line-height: 1.45;
}

/* 로비의 방 만들기·참여는 삽화 없이 같은 카드 위계를 압축해 쓴다. */
.route-choice-card.compact {
  min-height: 88px;
  padding: 16px;
}

.route-choice-card:focus-visible,
.route-choice-card:hover {
  border-color: var(--entry-border-strong);
  background: var(--entry-surface-selected);
}

.lobby-panel > * + *,
.lobby-code-panel > * + *,
.lobby-judge-block > * + * {
  margin-top: 12px;
}

.lobby-field {
  display: block;
}

.lobby-field > * {
  display: block;
}

.lobby-field > * + * {
  margin-top: 8px;
}

.entry-lobby .entry-body[data-state="join"] .lobby-field + .lobby-field {
  margin-top: 20px;
}

.lobby-field-head {
  display: flex;
  align-items: baseline;
}

.lobby-field-head .lobby-lb {
  margin-bottom: 0;
}

.lobby-field-meta {
  margin-left: auto;
  color: var(--entry-text-muted);
  font-size: var(--type-label);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
}

.lobby-code-panel,
.lobby-status-panel {
  border: 1px solid var(--entry-border);
  border-radius: var(--r-m);
  background: var(--entry-surface);
  padding: 14px;
}

.lobby-status-panel {
  color: var(--entry-text-muted);
  text-align: center;
}

.lobby-status-panel.on {
  border-color: var(--entry-border-strong);
  background: var(--entry-surface-selected);
  color: var(--entry-text);
  font-weight: 700;
}

.lobby-judge-block {
  margin-top: 20px;
}

.lobby-judge-row {
  display: flex;
}

.lobby-field-control.room-code {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 16px;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  text-align: center;
  position: relative;
}

.room-code-copy {
  position: absolute;
  right: 14px;
  width: 20px;
  height: 20px;
  color: var(--entry-text-muted);
  opacity: 0.72;
}

.lobby-player-line {
  color: var(--entry-text);
  font-size: var(--type-heading);
  font-weight: 800;
  text-align: center;
}

.lobby-share {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: var(--tap-target);
  padding: 0 12px;
  border: 1px solid var(--entry-border-strong);
  border-radius: var(--r-s);
  background: transparent;
  color: var(--gold-soft);
  font-size: var(--type-label);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.lobby-share:focus-visible,
.lobby-share:hover {
  background: var(--entry-surface-selected);
}

.lobby-status {
  margin-top: 10px;
  text-align: center;
  font-size: 14px;
  color: var(--entry-text-muted);
}

.lobby-help {
  display: flex;
  align-items: flex-start;
  padding: 0 14px;
  color: var(--entry-text-muted);
  font-size: var(--type-label);
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  word-break: keep-all;
}

.lobby-help .ic {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin-top: 2px;
}

.lobby-help span {
  min-width: 0;
  margin-left: 6px;
}

.lobby-notice {
  color: var(--teal-soft);
  font-size: var(--type-label);
  font-weight: 800;
  line-height: 1.45;
  text-align: center;
}

.lobby-status.on {
  color: var(--entry-text);
  font-weight: 700;
}

.lobby-wait-panel {
  margin-top: 14px;
}

.lobby-judge-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: left;
}

.lobby-judge-summary img {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid var(--entry-border-strong);
  border-radius: 50%;
  object-fit: cover;
}

.lobby-judge-copy {
  min-width: 0;
  margin-left: 10px;
}

.lobby-judge-copy .role {
  color: var(--entry-text-muted);
  font-size: var(--type-label);
  font-weight: 700;
}

.lobby-judge-copy .nm {
  margin-top: 2px;
  color: var(--entry-text);
  font-size: var(--type-heading);
  font-weight: 900;
}

.lobby-judge-copy .quote {
  margin-top: 4px;
  color: var(--entry-text-muted);
  font-size: var(--type-label);
  line-height: 1.4;
  word-break: keep-all;
}

.lobby-field-control {
  width: 100%;
  height: 56px;
  box-sizing: border-box;
  color: var(--entry-text);
  background: var(--entry-surface);
  border: 1px solid var(--entry-border);
  border-radius: 10px;
  padding: 0 14px;
  outline: none;
  font-family: var(--sans);
}

.code-input {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  text-align: center;
  color: var(--gold-soft);
}

.lobby-name-input {
  font-size: var(--type-btn);
  font-weight: 700;
}

.lobby-name-input::placeholder {
  color: var(--entry-text-subtle);
}

.code-input:focus,
.lobby-name-input:focus {
  border-color: var(--entry-border-strong);
}

.lobby-err {
  margin-top: 12px;
  padding: 0 14px;
  text-align: left;
  font-size: var(--type-label);
  font-weight: 500;
  color: var(--pred-red-soft);
}

/* 재대국 대기 상태 줄 — 리절트 카드 안 */
.rematch-status {
  min-height: 18px;
  margin-bottom: 4px;
  font-size: var(--type-label);
  font-weight: 700;
  color: var(--teal-deep);
}

#mode-note {
  color: var(--pred-red-soft);
  font-weight: 700;
}

.btn-back {
  min-height: var(--tap-target);
}

.entry-footer .btn-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  border: 1px solid var(--entry-border);
  border-radius: var(--r-m);
  background: var(--entry-surface);
  color: var(--entry-text-muted);
}

.entry-footer .btn-gold,
.entry-footer .btn-back {
  font-size: var(--type-btn);
  font-weight: 700;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
}

.entry-footer .btn-back:focus-visible,
.entry-footer .btn-back:hover {
  border-color: var(--entry-border-strong);
  color: var(--entry-text);
}

.entry-footer .btn-back.entry-text-action {
  height: var(--tap-target);
  margin-top: 6px;
  border: 0;
  background: transparent;
  color: var(--entry-text-muted);
  font-size: var(--type-label);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-indent: 0.04em;
}

/* 온보딩 */
.ob-top {
  position: relative;
  z-index: 31;
  flex: 0 0 auto;
  padding: calc(22px + env(safe-area-inset-top, 0px)) 24px 0;
}

.ob-top-row {
  min-height: var(--tap-target);
  display: flex;
  align-items: center;
  position: relative;
}

.ob-top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.ob .ob-sound {
  position: static;
  flex: 0 0 var(--tap-target);
}

.ob .skip {
  min-width: var(--tap-target);
  min-height: var(--tap-target);
  margin-left: 2px;
  font-size: var(--type-label);
  font-weight: 600;
  color: rgba(217, 196, 145, 0.55);
  padding: 6px 8px;
  letter-spacing: 0.04em;
}

.ob-progress {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  width: clamp(66px, 22vw, 84px);
  height: 4px;
}

.ob-progress i {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--gold-line);
  opacity: 0.35;
}

.ob-progress i + i {
  margin-left: 6px;
}

.ob-progress i.on {
  background: var(--gold-soft);
  opacity: 1;
}

.ob-content {
  display: flex;
  flex: 1 1 0;
  min-height: 0;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  touch-action: pan-y;
}

.ob-kicker {
  align-self: center;
  flex: 0 0 auto;
  width: auto;
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--gold-line);
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-soft);
  font-size: var(--type-label);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.08em;
}

.ob .art {
  height: clamp(150px, 32%, 275px);
  margin-top: 8px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
}

.ob .art > img {
  width: 96%;
  display: block;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.5));
}

.ob .lesson {
  min-height: 207px;
  padding: 8px 30px 0;
  text-align: center;
  flex: 0 0 auto;
}

.ob .lesson.board-lesson {
  padding-top: 18px;
}

.ob .h {
  margin-top: 0;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--gold-soft);
  letter-spacing: 0.06em;
}

.ob .d {
  margin-top: 12px;
  font-size: var(--type-label);
  line-height: 1.85;
  color: rgba(217, 196, 145, 0.6);
  font-weight: 500;
}

.ob .d b {
  color: var(--pred-blue-soft);
  font-weight: 800;
}

.ob .d b.r {
  color: var(--pred-red-soft);
}

.ob .cards {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
}

.ob .pcard {
  flex: 0 0 clamp(86px, 27vw, 104px);
  width: clamp(86px, 27vw, 104px);
  height: clamp(132px, 18vh, 140px);
  background: linear-gradient(176deg, var(--surface-card-hi), var(--surface-card-lo));
  border: 1.5px solid var(--gold-line);
  border-radius: 9px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
}

.ob .pcard .pred {
  flex: 0 0 36px;
  display: flex;
  align-items: center;
  padding: 0 7px;
  font-size: var(--type-label);
  font-weight: 800;
  line-height: 1.15;
  color: var(--ink-inverse);
  background: var(--pred-blue);
}

.ob .pcard.red .pred {
  background: var(--pred-red);
}

.ob .pcard .eff {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  font-family: var(--serif);
  font-size: var(--type-body);
  font-weight: 900;
  padding: 6px 7px;
  line-height: 1.35;
  color: var(--ink);
}

.ob .pcard-foot {
  flex: 0 0 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 9px;
  border-top: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: var(--type-label);
  font-weight: 800;
}

.ob .pcard.selected {
  border-color: var(--gold-soft);
  outline: 2px solid var(--gold-line);
  outline-offset: 1px;
}

.ob .pcard + .pcard {
  margin-left: 7px;
}

.ob .judges2 {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ob .jface {
  width: clamp(108px, 40vw, 172px);
  height: clamp(140px, 27vh, 224px);
  border: 1px solid rgba(202, 166, 79, 0.5);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  background: var(--surface-void);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.55);
}

.ob .jface img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 10%;
}

.ob .jface::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(15, 20, 23, 0.8));
}

.ob .jface .jl {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  text-align: center;
  z-index: 2;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--gold-soft);
  letter-spacing: 0.14em;
}

.ob .jface.l {
  transform: rotate(-3.5deg) translate(-5px, 6px);
}

.ob .jface.r {
  transform: rotate(3.5deg) translate(5px, -8px);
  z-index: 2;
  margin-left: 10px;
}

.ob .vs {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(202, 166, 79, 0.7);
  background: var(--lacquer);
  color: var(--gold-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* ═══════════════ 기능 레이어 — 본편 (한지 라이트) ═══════════════ */

/* HUD 9% */
.hud {
  height: calc(clamp(58px, 9%, 76px) + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  padding: env(safe-area-inset-top, 0px) 12px 0;
  flex: 0 0 auto;
  border-bottom: 1px solid rgba(202, 166, 79, 0.5);
  box-shadow: 0 2px 8px rgba(20, 10, 0, 0.06);
  background:
    repeating-linear-gradient(90deg, rgba(37, 51, 57, 0.015) 0 1px, transparent 1px 5px),
    var(--paper-3);
  position: relative;
  z-index: 7;
}

.hud .opponent-identity {
  display: flex;
  align-items: center;
  width: 102px;
  min-width: 0;
  flex: 0 0 102px;
}

.hud .opponent-silhouette {
  position: relative;
  width: 38px;
  height: 46px;
  flex: 0 0 38px;
  overflow: hidden;
  opacity: 0.82;
}

.hud .opponent-silhouette img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  display: block;
}

.hud .opponent-silhouette.human .human-head,
.hud .opponent-silhouette.human .human-body {
  position: absolute;
  left: 50%;
  display: block;
  background: var(--ink-2);
  transform: translateX(-50%);
}

.hud .opponent-silhouette.human .human-head {
  top: 5px;
  width: 17px;
  height: 18px;
  border-radius: 50%;
}

.hud .opponent-silhouette.human .human-body {
  bottom: -7px;
  width: 38px;
  height: 30px;
  border-radius: 50% 50% 0 0;
}

.hud .opponent-who {
  min-width: 0;
  margin-left: 5px;
  flex: 1 1 auto;
  min-width: 0;
}

.hud .opponent-role {
  display: block;
  font-size: var(--type-label);
  font-weight: 800;
  color: var(--clay-deep);
  line-height: 1.1;
  white-space: nowrap;
}

.hud .opponent-name {
  display: block;
  margin-top: 2px;
  font-size: var(--type-label);
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
}

.hud .opponent-name {
  color: var(--ink);
}

.hud .meters {
  margin-left: auto;
  text-align: right;
  flex: 0 0 auto;
}

.hud .score {
  font-weight: 900;
  font-size: var(--type-display);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.hud .score .col {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.hud .score .value {
  display: inline-flex;
  align-items: baseline;
}

.hud .score .goal {
  margin-left: 1px;
  font-size: var(--type-label);
  font-weight: 800;
  opacity: 0.72;
}

.hud .score .lb {
  font-size: var(--type-label);
  font-weight: 800;
  color: var(--ink-muted);
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}

.hud .score .colon {
  margin: 0 5px;
  color: var(--ink-3);
}

.hud .score .me {
  color: var(--teal-deep);
}

.hud .score .foe {
  color: var(--ink-2);
}

.hud .clock {
  position: absolute;
  left: 50%;
  top: env(safe-area-inset-top, 0px);
  bottom: 0;
  width: 72px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-size: var(--type-display);
  font-weight: 900;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.hud .clock-value {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hud .clock-round {
  margin-bottom: 2px;
  color: var(--clay-deep);
  font-size: var(--type-label);
  font-weight: 800;
  line-height: 1;
}

.hud .clock.idle {
  color: var(--ink-muted);
  font-size: var(--type-label);
}

.hud .clock.paused {
  color: var(--ink-2);
}

.hud .clock .bar {
  display: block;
  width: 52px;
  height: 5px;
  border-radius: 3px;
  background: var(--line-2);
  position: relative;
  margin: 2px auto 0;
  overflow: hidden;
}

.hud .clock .bar i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 3px;
  background: var(--clay);
}

.hud .clock.warn {
  color: var(--seal);
}

.hud .clock.warn .bar i {
  background: var(--seal);
}

.hud .clock .ic {
  margin-right: 2px;
}

/* 심판 대사 말풍선 — 일시 발화, 크기는 문구 반응형 */
.judge-say {
  font-family: var(--serif);
  position: absolute;
  left: var(--judge-say-left, 12px);
  top: var(--judge-say-top, calc(9% + 8px));
  max-width: min(78%, 300px);
  width: fit-content;
  z-index: 50; /* 판 표식 위, 컷인·결과·전역 시트 아래 */
  transition: opacity var(--motion-base);
}

.judge-speaker {
  position: relative;
  z-index: 1;
  display: block;
  width: 36px;
  height: 36px;
  margin-left: 6px;
  overflow: hidden;
  border: 1px solid var(--clay-deep);
  border-radius: 50%;
  background: var(--paper-3);
  box-shadow: 0 2px 6px rgba(20, 10, 0, 0.24);
}

.judge-speaker img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.judge-bubble {
  position: relative;
  display: block;
  margin-top: 6px;
  background: rgba(251, 249, 244, 0.96);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: var(--type-body);
  line-height: 1.6;
  color: var(--ink);
  box-shadow: 0 5px 14px rgba(20, 10, 0, 0.2);
}

.judge-bubble::before {
  content: "";
  position: absolute;
  top: -6.5px;
  left: 16px;
  width: 11px;
  height: 11px;
  background: rgba(251, 249, 244, 0.96);
  border-left: 1px solid var(--line-strong);
  border-top: 1px solid var(--line-strong);
  transform: rotate(45deg);
}

/* 판 46% — 실렌더 무대 + cal 절대배치 */
.stage {
  height: auto;
  position: relative;
  overflow: hidden;
  flex: 0 1 clamp(182px, 42vh, 360px);
  flex-basis: clamp(182px, 42dvh, 360px);
  min-height: 0;
  background:
    linear-gradient(180deg, rgba(22, 35, 42, 0.16), rgba(22, 35, 42, 0.035) 22%, transparent 40%),
    radial-gradient(130% 95% at 50% 12%, rgba(15, 138, 143, 0.1), transparent 55%),
    radial-gradient(120% 120% at 50% 115%, rgba(70, 52, 30, 0.14), transparent 55%),
    repeating-linear-gradient(0deg, rgba(37, 51, 57, 0.018) 0 1px, transparent 1px 6px),
    linear-gradient(180deg, var(--paper-2), var(--paper) 70%);
}

.match.focus-play .stage {
  height: auto;
  flex: 1;
}

.match.focus-play .dock {
  display: none;
}

/* 턴 시계 10초 이하 — 초마다 화면 테두리가 심장박동처럼 붉게 튄다 */
.clock-pulse {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  opacity: 0;
  box-shadow: inset 0 0 64px 14px rgba(163, 51, 38, 0.6);
}

.clock-pulse.beat {
  animation: clock-beat 0.85s ease-out;
}

/* 쿵-쿵: 강한 첫 박동, 살짝 가라앉았다가 약한 두 번째 박동, 소멸 */
@keyframes clock-beat {
  0% {
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  32% {
    opacity: 0.18;
  }
  46% {
    opacity: 0.65;
  }
  100% {
    opacity: 0;
  }
}

.stage .board-img {
  position: absolute;
  pointer-events: none;
}

.hint-cell {
  position: absolute;
  transform: translate(-50%, -50%) scaleY(0.42);
  border-radius: 50%;
  cursor: pointer;
  z-index: 22; /* 선택된 말 박스(.pc.sel, 20)보다 위 — 스프라이트 투명 여백이 탭을 삼키지 않도록 */
}

.hint-hit {
  position: absolute;
  width: var(--tap-target);
  height: var(--tap-target);
  transform: translate(-50%, -50%);
  z-index: 23;
  cursor: pointer;
}

.hint-hit::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--teal-deep);
  box-shadow: 0 0 0 3px var(--teal-wash), 0 0 10px var(--teal);
  pointer-events: none;
}

.hint-hit.tg::after {
  background: var(--clay-deep);
  box-shadow: 0 0 0 3px var(--clay-wash), 0 0 10px var(--clay);
}

.hint-cell.mv {
  background: radial-gradient(circle, rgba(15, 138, 143, 0.5), rgba(15, 138, 143, 0.16) 58%, transparent 70%);
  box-shadow: 0 0 0 2px rgba(15, 138, 143, 0.45), 0 0 14px rgba(15, 138, 143, 0.3);
}

.hint-cell.tg {
  background: radial-gradient(circle, rgba(163, 51, 38, 0.5), rgba(163, 51, 38, 0.16) 58%, transparent 70%);
  box-shadow: 0 0 0 2px rgba(163, 51, 38, 0.45);
}

.pc {
  position: absolute;
  transform: translateX(-50%);
  transform-origin: 50% 100%;
  transition: transform var(--motion-fast), filter var(--motion-fast);
}

.pc img {
  width: 100%;
  display: block;
  pointer-events: none;
}

.pc .n {
  position: absolute;
  left: 50%;
  bottom: 28%;
  transform: translateX(-50%);
  font-family: var(--serif);
  font-weight: 900;
  color: var(--ink-piece);
  letter-spacing: 0.06em;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

.pc .n.long {
  letter-spacing: -0.04em;
}

.pc.foe .n {
  color: var(--ink-piece-inverse);
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.45);
}

.pc .rank-score {
  position: absolute;
  left: 50%;
  bottom: 14%;
  transform: translateX(-50%);
  min-width: 28px;
  padding: 1px 4px;
  color: var(--ink);
  background: var(--paper-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-s);
  box-shadow: var(--shadow-1);
  font-size: var(--type-chip);
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}

.pc.foe .rank-score {
  color: var(--paper-3);
  background: var(--ink-2);
  border-color: var(--paper-2);
}

/* 상태 태그 — 선택한 말 위에만 펼쳐진다. 스프라이트 박스가 크므로 머리 바로 위 지점을 잡는다 */
.pc .fxrow {
  position: absolute;
  left: 50%;
  top: 38%;
  transform: translateX(-50%);
  white-space: nowrap;
  pointer-events: none;
  display: flex;
}

.pc .fxrow .fxdot {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 900;
  color: var(--ink-inverse);
  background: var(--ink-2);
  border-radius: 4px;
  padding: 1px 6px;
  margin: 0 1px;
}

.pc .fxrow .fxdot.stride {
  background: var(--move);
}

.pc .fxrow .fxdot.immune {
  background: var(--teal-deep);
}

.pc .fxrow .fxdot.harmless {
  background: var(--ink-2);
}

.pc .fxrow .fxdot.burn {
  background: var(--seal);
}

.pc.sel {
  transform: translateX(-50%) translateY(-4px);
  z-index: 20;
}

.pc.sel img {
  filter: drop-shadow(0 0 8px rgba(15, 138, 143, 0.9)) brightness(1.05);
}

/* 상대 말 선택 — 같은 효과, 색만 붉게 */
.pc.foe.sel img {
  filter: drop-shadow(0 0 8px rgba(163, 51, 38, 0.95)) brightness(1.05);
}

.pc.unsel {
  filter: brightness(0.72) saturate(0.75);
}

.pc.dimmed {
  filter: brightness(0.5) saturate(0.5);
  z-index: 19;
}

.pc.hot {
  z-index: 21;
}

.pc.law-target .rank-score {
  opacity: 0;
}

/* 법 적용 열람 — 이동 타원·판정 O/X/△와 겹치지 않는 조문 꼬리표 */
.law-stamp {
  position: absolute;
  min-width: 30px;
  height: 21px;
  padding: 0 5px;
  transform: translate(-50%, -50%);
  z-index: 39;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: var(--law-marker-tone);
  color: var(--paper-3);
  font-size: var(--type-label);
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.law-stamp::after {
  content: "";
  position: absolute;
  left: var(--law-tail-x, 50%);
  bottom: -11px;
  width: 8px;
  height: 12px;
  background: var(--law-marker-tone);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform: translateX(-50%);
}

.law-stamp.blue {
  --law-marker-tone: var(--pred-blue);
}

.law-stamp.red {
  --law-marker-tone: var(--pred-red);
}

.vring {
  position: absolute;
  transform: translate(-50%, -50%) scaleY(0.42);
  border-radius: 50%;
  pointer-events: none;
  z-index: 20;
}

.vring.o {
  background: radial-gradient(circle, rgba(10, 92, 96, 0.42), rgba(10, 92, 96, 0.14) 58%, transparent 70%);
  box-shadow: 0 0 0 2px rgba(10, 92, 96, 0.5);
}

.vring.q {
  background: radial-gradient(circle, rgba(125, 86, 0, 0.4), rgba(125, 86, 0, 0.14) 58%, transparent 70%);
  box-shadow: 0 0 0 2px rgba(125, 86, 0, 0.5);
}

.vtag {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 40;
  display: flex;
  align-items: center;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 900;
  border: 1.5px solid;
  border-radius: 6px;
  padding: 1.5px 6px;
  background: rgba(251, 249, 244, 0.95);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.vtag .ic {
  margin-right: 3px;
}

/* 문구 없는 O/X 단독 태그 (제정 직후) */
.vtag.solo .ic {
  margin-right: 0;
}

.vtag.o {
  color: var(--verdict-o);
  border-color: var(--verdict-o);
}

.vtag.x {
  color: var(--verdict-x);
  border-color: var(--verdict-x);
}

.vtag.q {
  color: var(--verdict-q);
  border-color: var(--verdict-q);
}

/* 승격 대기 — 끝 행에서 한 턴 버티는 중인 말. 고리가 숨쉬듯 밝아진다.
 * 내 말은 금(법 제정 하이라이트와 같은 "중요한 일" 문법), 상대 말은 붉은 위협. */
.pring {
  position: absolute;
  transform: translate(-50%, -50%) scaleY(0.42);
  border-radius: 50%;
  pointer-events: none;
  /* z-index 를 주지 않는다 — 말(.pc)보다 먼저 그려져 몸체에 가려지는 바닥 빛이다 */
  animation: promo-breathe 1.2s ease-in-out infinite;
}

/* 테두리 선 없이 빛무리만 숨쉰다 — 바닥 조명답게 진하게 */
.pring.mine {
  background: radial-gradient(circle, rgba(190, 132, 8, 0.85), rgba(170, 118, 4, 0.35) 55%, transparent 74%);
}

.pring.foe {
  background: radial-gradient(circle, rgba(185, 55, 38, 0.8), rgba(163, 51, 38, 0.32) 55%, transparent 74%);
}

@keyframes promo-breathe {
  0%,
  100% {
    opacity: 0.55;
  }

  50% {
    opacity: 1;
  }
}

/* 점수 플로트 — 포획·승격 순간 그 자리에서 +N 이 떠올랐다 사라진다 */
.score-float {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 42;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 900;
  pointer-events: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55), 0 2px 6px rgba(0, 0, 0, 0.3);
  animation: score-rise 1.05s ease-out forwards;
}

.score-float.mine {
  color: var(--pred-blue);
}

.score-float.foe {
  color: var(--pred-red);
}

@keyframes score-rise {
  0% {
    opacity: 0;
    margin-top: 8px;
  }

  15% {
    opacity: 1;
  }

  70% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    margin-top: -30px;
  }
}

/* 선택한 말의 승격 표시 — 효과 줄(.fxrow, 38%) 바로 위에 붙는다 */
.pc .promorow {
  position: absolute;
  left: 50%;
  top: 38%;
  transform: translateX(-50%) translateY(calc(-100% - 3px));
  white-space: nowrap;
  pointer-events: none;
  display: flex;
}

.pc .promorow .promodot {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 900;
  color: var(--paper-3);
  border-radius: 4px;
  padding: 1px 6px;
  margin: 0 1px;
}

.pc .promorow .promodot.mine {
  background: var(--gold);
}

.pc .promorow .promodot.foe {
  background: var(--clay-deep);
}

.practice-guide {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 10px;
  z-index: 45; /* 판정 O/X 태그(.vtag 40)는 학습 안내 위로 올라오지 않는다. */
  padding: 10px 12px;
  color: var(--ink);
  background: var(--paper-3);
  border: 1.5px solid var(--teal-deep);
  border-radius: var(--r-l);
  box-shadow: var(--shadow-2);
  pointer-events: none;
}

.practice-step {
  display: inline;
  color: var(--teal-deep);
  font-size: var(--type-label);
  font-weight: 900;
}

.practice-title {
  display: inline;
  margin-left: 8px;
  font-size: var(--type-heading);
  font-weight: 900;
  word-break: keep-all;
}

.practice-body {
  margin-top: 2px;
  color: var(--ink-2);
  font-size: var(--type-label);
  line-height: 1.45;
}

.practice-main,
.practice-sub {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  min-height: var(--tap-target);
  pointer-events: auto;
  text-align: center;
  font-size: var(--type-label);
  font-weight: 800;
}

.practice-main {
  color: var(--paper-3);
  background: var(--teal-deep);
  border-radius: var(--r-m);
}

.practice-sub {
  color: var(--ink-2);
  background: var(--paper-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-m);
}

.practice-actions {
  display: flex;
  margin-top: 6px;
}

.practice-actions > * + * {
  margin-left: 8px;
}

.howto-list {
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
}

.howto-row {
  display: flex;
  align-items: flex-start;
  padding: 9px 2px;
  color: var(--ink-2);
  font-size: var(--type-label);
  line-height: 1.45;
}

.howto-row + .howto-row {
  border-top: 1px dashed var(--line-2);
}

.howto-row strong {
  width: 48px;
  flex: 0 0 auto;
  color: var(--ink);
  line-height: 1.5;
  white-space: pre-line;
}

.howto-row span {
  min-width: 0;
  margin-left: 10px;
  white-space: pre-line;
}

.turn-strip {
  position: absolute;
  left: 50%;
  top: 10px;
  transform: translateX(-50%);
  z-index: 6;
  background: rgba(46, 58, 64, 0.92);
  color: var(--ink-piece-inverse);
  font-size: var(--type-label);
  font-weight: 700;
  border-radius: 8px;
  padding: 6px 14px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}

/* 짧은 상대 턴 — 화면은 유지하고 입력만 잠근다 */
.laws,
.hand {
  position: relative;
}

.match.wait .hand {
  pointer-events: none;
}

/* 법전+손패 독 — 짧은 폰에서는 법 문장을 위해 판보다 지분을 더 갖는다 */
.dock {
  height: auto;
  min-height: 328px;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  position: relative;
  border-top: 1px solid var(--gold-wash);
  box-shadow: inset 0 6px 10px -8px rgba(70, 52, 30, 0.35);
  background:
    repeating-linear-gradient(0deg, rgba(37, 51, 57, 0.013) 0 1px, transparent 1px 5px),
    linear-gradient(180deg, var(--paper-3), var(--paper-2));
}

/* 법전 — 독의 남는 높이를 전부 쓰고, 행들이 그 안에서 균등 분배된다(잘림·겹침 없음) */
.laws {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 7px 10px 3px;
  overflow: hidden;
}

.laws .title {
  font-size: var(--type-label);
  font-weight: 900;
  color: var(--ink-muted);
  letter-spacing: 0.14em;
  flex: 0 0 auto;
}

.laws-head {
  min-height: var(--tap-target);
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  margin-bottom: 3px;
  position: relative;
}

.law-book {
  min-width: 0;
  min-height: var(--tap-target);
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  color: var(--ink-muted);
  text-align: left;
}

.law-book .ic {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin-right: 7px;
  color: var(--gold-deep);
}

.law-book.static {
  pointer-events: none;
}

.law-tools {
  display: flex;
  margin-left: auto;
}

.law-tool {
  width: var(--tap-target);
  height: var(--tap-target);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  border-radius: var(--r-s);
  opacity: 0.8;
}

.law-tool.law-tool-book {
  width: auto;
  padding: 0 4px;
  color: var(--ink-muted);
  font-size: var(--type-label);
  font-weight: 800;
  opacity: 1;
  white-space: nowrap;
}

.law-tool.law-tool-book .ic {
  margin-right: 4px;
  color: var(--gold-deep);
}

.law-tool + .law-tool {
  margin-left: 6px;
}

.law-tool .ic {
  width: 19px;
  height: 19px;
}

@media (hover: hover) and (pointer: fine) {
  .law-tool:hover {
    background: var(--paper-2);
    opacity: 1;
  }
}

.law {
  display: flex;
  align-items: center;
  width: 100%;
  background: var(--paper-3);
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--line-2);
  border-radius: 8px;
  padding: 2px 7px;
  font-size: var(--type-body);
  flex: 1 1 0;
  min-height: 0;
  color: inherit;
}

.law[role="button"] {
  cursor: pointer;
}

/* 짧은 화면에서는 여백만 줄인다. 글자를 14px 아래로 축소하지 않는다. */
@media (max-height: 850px) {
  .laws {
    padding: 8px 12px 2px;
  }

  .laws .title {
    margin-bottom: 0;
  }

  .law {
    padding: 2px 7px;
  }

  .law + .law {
    margin-top: 4px;
  }
}

/* 667px 이하도 동일한 읽기 크기를 지키고 행 사이 여백만 줄인다. */
@media (max-height: 700px) {
  .laws {
    padding: 6px 12px 2px;
  }

  .laws .title {
    margin-bottom: 0;
  }

  .law {
    padding: 1px 6px;
  }

  .law + .law {
    margin-top: 3px;
  }
}

.law.mine {
  border-left-color: var(--teal-deep);
}

.law.theirs {
  border-left-color: var(--clay-deep);
}

/* 방금 제정된 법 — 다음 턴까지 금빛으로 밝힌다 */
.law.fresh {
  background: linear-gradient(90deg, rgba(202, 166, 79, 0.22), rgba(202, 166, 79, 0.08));
  border-color: rgba(202, 166, 79, 0.75);
  box-shadow: 0 0 8px rgba(202, 166, 79, 0.35);
  animation: fresh-law 1.6s ease-in-out infinite;
}

.law.inspecting {
  background: var(--gold-wash);
  border-color: var(--gold-deep);
  box-shadow: none;
}

@keyframes fresh-law {
  0%, 100% { box-shadow: 0 0 8px rgba(202, 166, 79, 0.35); }
  50% { box-shadow: 0 0 14px rgba(202, 166, 79, 0.6); }
}

.law + .law {
  margin-top: 5px;
}

.law .no {
  font-size: var(--type-label);
  font-weight: 900;
  color: var(--ink-muted);
  width: 18px;
  flex: 0 0 auto;
}

.law .txt {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--serif);
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.law .fx {
  margin-left: 6px;
  flex: 0 0 auto;
  height: 22px;
  border-radius: 5px;
  padding: 0 7px;
  background: var(--pred-red);
  color: var(--ink-inverse);
  font-size: var(--type-chip);
  font-weight: 800;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.law .fx.b {
  background: var(--pred-blue);
}

.law.empty {
  border-style: dashed;
  color: var(--ink-muted);
  justify-content: center;
  font-size: var(--type-label);
}

/* 카드 — 독의 40% (전체의 18%, 기존 지분 유지) */
.hand {
  height: 148px;
  padding: 14px 10px 8px;
  display: flex;
  align-items: flex-end;
  overflow-x: auto;
  overflow-y: visible;
  flex: 0 0 auto;
  z-index: 2;
}

/* 3층 고정 플렉스 — 술어 띠·효과문·하단 띠의 시작/끝 지점이 모든 카드에서 같다.
 * button 의 콘텐츠 세로 중앙 정렬이 카드마다 띠 위치를 흔들던 것을 막는다. */
.card {
  flex: 1 0 72px;
  background: linear-gradient(176deg, var(--surface-card-hi), var(--surface-card-lo));
  border: 1px solid var(--gold-line);
  border-radius: 9px;
  position: relative;
  height: 100%;
  overflow: hidden;
  box-shadow: 0 4px 9px rgba(20, 10, 0, 0.18);
  transition: transform 0.18s ease;
  padding: 0;
  display: flex;
  flex-direction: column;
  text-align: left;
  min-width: 0;
}

.card + .card {
  margin-left: 7px;
}

/* 법 카드 4장 + 휴정 1칸. 320px에서도 손패 좌우 10px를 지키며 한 줄에 둔다. */
.hand.full .card {
  flex: 1 1 0;
  min-width: 0;
}

.hand.full .card + .card {
  margin-left: 4px;
}

@media (hover: hover) {
  .card:hover:not(.sel) {
    transform: translateY(-3px);
  }
}

.card .pred {
  flex: 0 0 42px;
  display: flex;
  align-items: center;
  padding: 8px 6px;
  font-size: var(--type-label);
  font-weight: 800;
  color: var(--ink-inverse);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
}

.card .pred.blue {
  background: var(--pred-blue);
}

.card .pred.red {
  background: var(--pred-red);
}

.card .eff {
  flex: 1;
  min-height: 55px;
  display: flex;
  align-items: center; /* 남은 층 안에서 세로 중앙 — 위아래 간격이 항상 균등 */
  font-family: var(--serif);
  font-size: var(--type-body);
  font-weight: 900;
  padding: 4px 8px;
  line-height: 1.3;
  overflow: visible;
}

.card .foot {
  flex: 0 0 25px; /* 문서 흐름에 두어 효과문과 절대 겹치지 않는다 */
  margin-top: auto;
  display: flex;
  align-items: center;
  padding: 0 9px;
  border-top: 1px solid rgba(107, 89, 64, 0.22);
  font-size: var(--type-label);
  color: var(--ink-muted);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  background: var(--surface-card-lo);
}

.card .foot .fxname {
  margin-left: auto;
  padding-left: 8px;
}

.card .foot .fxname {
  margin-left: auto;
  font-weight: 800;
  color: var(--ink-2);
}

.card.sel {
  transform: translateY(-8px);
  border-color: var(--teal-deep);
  box-shadow: 0 10px 18px rgba(10, 92, 96, 0.3);
}

.card.rest-card {
  background: var(--paper-2);
  border-style: dashed;
  border-color: var(--line-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  font-weight: 800;
  font-size: var(--type-label);
  flex: 0 0 58px;
  text-align: center;
}

.card.rest-card b {
  font-size: var(--type-heading);
  color: var(--ink-2);
}

.card.rest-card span {
  margin-top: 8px;
}

.hand.full .card.rest-card {
  flex: 0 0 var(--tap-target);
  min-width: var(--tap-target);
}

/* 구조 자체로도 5칸을 감지한다. 이전 JS가 캐시된 모바일 브라우저에서도 넘치지 않는다. */
.hand > .card:first-child:nth-last-child(5),
.hand > .card:first-child:nth-last-child(5) ~ .card {
  flex: 1 1 0;
  min-width: 0;
}

.hand > .card:first-child:nth-last-child(5) ~ .card {
  margin-left: 4px;
}

.hand > .card:first-child:nth-last-child(5) ~ .card.rest-card {
  flex: 0 0 var(--tap-target);
  min-width: var(--tap-target);
}

.hand.full .card.rest-card b,
.hand > .card:first-child:nth-last-child(5) ~ .card.rest-card b {
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 0.14em;
}

.hand.full .card .pred {
  padding-right: 4px;
  padding-left: 4px;
}

.hand.full .card .eff {
  padding-right: 4px;
  padding-left: 4px;
}

.hand.full .card .foot {
  padding-right: 4px;
  padding-left: 4px;
}

.hand.full .card .foot .fxname {
  padding-left: 0;
}

/* 확정 바 — 옻칠 접지 바 (입법·집행 국면) */
.confirm-bar {
  margin-top: auto;
  background: rgba(18, 23, 27, 0.94);
  border-top: 1px solid rgba(202, 166, 79, 0.45);
  padding: 12px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  position: relative;
  flex: 0 0 auto;
  z-index: 45; /* 판정 태그(.vtag 40)·오버레이보다 위 — ⓘ 규칙 팁이 무엇에도 가려지지 않게 */
}

.confirm-bar .note {
  min-height: var(--tap-target);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--type-label);
  font-weight: 700;
  color: rgba(217, 196, 145, 0.75);
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}

.confirm-bar .note .note-copy {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
}

.confirm-bar .note .note-value {
  display: inline-block;
  margin-left: 6px;
  color: var(--gold-bright);
  font-weight: 900;
}

.confirm-bar .note .note-detail {
  margin-left: 6px;
}

.confirm-bar .note .note-group {
  display: inline-flex;
  align-items: center;
  position: relative;
  line-height: 1.4;
}

.confirm-bar .note .info-icon {
  width: 17px;
  height: 17px;
  margin-left: 6px;
  flex: 0 0 auto;
  color: rgba(217, 196, 145, 0.85);
  pointer-events: none;
}

.confirm-bar .note .info-hit {
  position: absolute;
  top: 50%;
  right: -14px;
  transform: translateY(-50%);
  width: var(--tap-target);
  height: var(--tap-target);
}

.confirm-bar .btn-main {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  background: var(--teal-deep);
  color: var(--ink-inverse);
  border-radius: 8px;
  font-size: var(--type-btn);
  font-weight: 700;
  letter-spacing: 0.06em;
  box-shadow: 0 6px 16px rgba(10, 92, 96, 0.3);
}

.confirm-bar .btn-txt {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: var(--tap-target);
  margin-top: 6px;
  color: rgba(217, 196, 145, 0.6);
  font-size: var(--type-btn);
  font-weight: 700;
}

.rule-tip {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: calc(100% - 7px);
  background: rgba(251, 249, 244, 0.97);
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  padding: 8px 13px 7px; /* 두 줄로 줄어든 내용에 맞춰 세로 여백 축소 */
  text-align: left;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
  z-index: 12;
}

.rule-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: var(--tip-x, 50%);
  transform: translateX(-50%) rotate(45deg);
  width: 11px;
  height: 11px;
  margin-top: -6px;
  background: rgba(251, 249, 244, 0.97);
  border-right: 1.5px solid var(--line-strong);
  border-bottom: 1.5px solid var(--line-strong);
}

.rule-tip .tt {
  font-size: var(--type-label);
  font-weight: 900;
  color: var(--ink);
  margin-bottom: 5px;
}

.rule-tip .tr {
  display: flex;
  align-items: center;
  font-size: var(--type-label);
  color: var(--ink-2);
  padding: 5px 0;
}

.rule-tip .tr + .tr {
  border-top: 1px dashed rgba(107, 89, 64, 0.22);
}

.rule-tip .tr b {
  margin-left: auto;
  flex: 0 0 auto;
  padding-left: 10px;
}

.rule-tip .tr b.plus {
  color: var(--teal-deep);
}

.rule-tip .tr b.zero {
  color: var(--ink-muted);
}

/* 입법 국면 — 카드가 떠오른다 */
.float-dim {
  position: absolute;
  inset: 0;
  z-index: 17;
  pointer-events: none;
  background:
    radial-gradient(95% 60% at 50% 22%, rgba(243, 230, 200, 0.12), transparent 55%),
    radial-gradient(120% 95% at 50% 32%, rgba(22, 26, 29, 0.26), rgba(22, 26, 29, 0.5));
}

.float-card {
  position: absolute;
  left: 50%;
  top: 4%;
  z-index: 23;
  width: 68%;
  transform: translateX(-50%) rotate(-3.5deg);
  background: linear-gradient(174deg, var(--paper-3), var(--surface-sheet-alt));
  border: 2px solid var(--line-strong);
  border-radius: 14px;
  padding: 16px 15px 14px;
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.45), 0 6px 14px rgba(0, 0, 0, 0.25),
    inset 0 0 0 1px rgba(246, 241, 227, 0.85);
}

.float-card::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(107, 89, 64, 0.4);
  border-radius: 9px;
  pointer-events: none;
}

.float-card .pred {
  font-size: 15px;
  font-weight: 900;
  color: var(--clay-deep);
}

.float-card .pred.bluetxt {
  color: var(--pred-blue);
}

.float-card .eff {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 900;
  margin-top: 5px;
  letter-spacing: -0.01em;
}

.float-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3%;
  z-index: 23;
  text-align: center;
  font-size: var(--type-label);
  color: var(--ink-cutin);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

/* 컷인 — 역전재판 문법 */
.cutin {
  position: absolute;
  inset: 0;
  z-index: 60;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(22, 26, 29, 0.42), rgba(22, 26, 29, 0.18) 45%, rgba(22, 26, 29, 0.5));
}

.cutin .art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
}

.cutin .flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(80% 60% at 68% 30%, rgba(243, 230, 200, 0.32), transparent 60%);
}

.dialog {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 61;
  background: rgba(251, 249, 244, 0.97);
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  padding: 9px 12px 11px;
  min-height: 96px;
}

.dialog .speaker {
  display: inline-block;
  background: var(--clay-deep);
  color: var(--ink-inverse);
  font-size: var(--type-label);
  font-weight: 900;
  border-radius: 4px;
  padding: 2px 8px;
  margin-bottom: 5px;
}

.dialog .body {
  font-family: var(--serif);
  font-size: var(--type-body);
  line-height: 1.65;
  color: var(--ink);
  font-weight: 600;
}

.dialog .next {
  position: absolute;
  right: 10px;
  bottom: 6px;
  color: var(--clay);
  font-size: 15px;
  width: var(--tap-target);
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 중앙 팝업 시트 — 결정·통지 (바텀시트 금지, 딤 탭 닫기 금지) */
.sheet-dim {
  position: absolute;
  inset: 0;
  z-index: 199;
  background: rgba(22, 26, 29, var(--dim-pop));
}

.sheet {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 50%;
  transform: translateY(-50%);
  z-index: 200;
  background: linear-gradient(174deg, var(--paper-3), var(--surface-sheet));
  border: 1.5px solid var(--line-strong);
  border-radius: 14px;
  padding: 16px 14px 14px;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(107, 89, 64, 0.15);
  max-height: calc(100% - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 24px);
  overflow-y: auto;
}

.sheet .rule2 {
  width: 42px;
  margin-bottom: 10px;
  border-color: var(--line-strong);
  opacity: 0.55;
}

.sheet .stitle {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 900;
  text-align: center;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  margin-bottom: 2px;
}

.sheet .ssub {
  font-size: var(--type-label);
  color: var(--ink-muted);
  text-align: center;
  margin-bottom: 12px;
  line-height: 1.6;
}

.acts {
  display: block;
}

.act {
  display: flex;
  align-items: center;
  width: 100%;
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  padding: 15px 16px;
  background: var(--paper-3);
  font-weight: 900;
  font-size: 17px;
  color: var(--ink);
}

.act + .act {
  margin-top: 10px;
}

.repeal-copy {
  min-width: 0;
}

.repeal-title {
  overflow: hidden;
  font-size: var(--type-heading);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.repeal-summary {
  margin-top: 3px;
  color: var(--ink-muted);
  font-size: var(--type-label);
  font-weight: 700;
}

.act .sub {
  font-size: var(--type-label);
  font-weight: 700;
  color: var(--ink-muted);
  margin-left: auto;
}

.act.on {
  border-color: var(--teal-deep);
  box-shadow: inset 0 0 0 1px var(--teal-deep);
}

.act.off {
  opacity: 0.6;
  border-style: dashed;
  pointer-events: none;
}

.act .cur {
  margin-left: auto;
  font-size: var(--type-label);
  font-weight: 800;
  color: var(--teal-deep);
}

.act .no-why {
  margin-left: auto;
  font-size: var(--type-label);
  font-weight: 700;
  color: var(--clay-deep);
  text-align: right;
}

.quoted-law {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 900;
  text-align: center;
  background: var(--paper-3);
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  padding: 11px 10px;
  line-height: 1.5;
  margin-bottom: 12px;
}

.mrow {
  display: flex;
  align-items: center;
  font-size: var(--type-label);
  color: var(--ink-2);
  line-height: 1.65;
  padding: 7px 0;
}

.mrow + .mrow {
  border-top: 1px dashed rgba(107, 89, 64, 0.22);
}

.mrow .k {
  width: 96px;
  flex: 0 0 auto;
  color: var(--ink-muted);
  font-size: var(--type-label);
}

.fxchip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  border-radius: 5px;
  padding: 0 7px;
  background: var(--pred-red);
  color: var(--ink-inverse);
  font-size: var(--type-chip);
  font-weight: 800;
  white-space: nowrap;
}

.fxchip.b {
  background: var(--pred-blue);
}

.mrow .arrow {
  margin: 0 7px;
  color: var(--ink-3);
}

.sheet .go {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  text-align: center;
  background: var(--teal-deep);
  color: var(--ink-inverse);
  font-weight: 700;
  font-size: var(--type-btn);
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(10, 92, 96, 0.3);
}

.sheet .go.danger {
  background: var(--clay-deep);
  box-shadow: 0 6px 16px rgba(125, 49, 34, 0.3);
}

.sheet .go.disabled {
  opacity: 0.45;
  box-shadow: none;
  pointer-events: none;
}

.sheet .cancel-txt {
  margin-top: 6px;
  min-height: var(--tap-target);
  text-align: center;
  color: var(--ink-muted);
  font-size: var(--type-btn);
  font-weight: 700;
  padding: 10px 0;
  width: 100%;
  display: block;
}

.sheet .cancel-txt.btn-back {
  font-size: var(--type-label);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* 내용이 적은 확인 시트(폐지 등) — 세로를 조인다 */
.sheet.tight {
  padding: 12px 14px 10px;
}

.sheet.tight .rule2 {
  margin-bottom: 8px;
}

.sheet.tight .stitle {
  margin-bottom: 8px;
}

.sheet.tight .quoted-law {
  margin-bottom: 2px;
}

.sheet.tight .go {
  margin-top: 10px;
  height: 48px;
}

.sheet.tight .cancel-txt {
  margin-top: 2px;
  padding: 8px 0;
}

/* ═══════════════ 케이스 화면 (일괄 이의·작성·판례집·리절트·설정) ═══════════════ */

.case .head {
  padding: 16px 16px 10px;
  border-bottom: 1px solid var(--gold-wash);
  position: relative;
  flex: 0 0 auto;
}

.case .head .h {
  font-size: 20px;
  font-weight: 900;
}

.case .head .s {
  margin-top: 3px;
  font-size: var(--type-label);
  color: var(--ink-muted);
}

.case .head.book-head {
  display: flex;
  align-items: center;
  min-height: 64px;
  padding-top: 0;
  padding-bottom: 0;
}

.case .head.book-head .h {
  line-height: 1.2;
}

.head-close {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: var(--tap-target);
  height: var(--tap-target);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
}

.head-close .ic {
  width: 20px;
  height: 20px;
}

.vmark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid;
  font-size: 13px;
  font-weight: 900;
  flex: 0 0 auto;
}

.vmark.o {
  color: var(--verdict-o);
  border-color: var(--verdict-o);
}

.vmark.x {
  color: var(--verdict-x);
  border-color: var(--verdict-x);
}

.vmark.q {
  color: var(--verdict-q);
  border-color: var(--verdict-q);
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  background: var(--teal-deep);
  color: var(--ink-inverse);
  border-radius: 8px;
  font-size: var(--type-btn);
  font-weight: 700;
  letter-spacing: 0.06em;
  box-shadow: 0 6px 16px rgba(10, 92, 96, 0.35);
}

.btn-primary.danger {
  background: var(--clay-deep);
  box-shadow: 0 6px 16px rgba(125, 49, 34, 0.35);
}

.btn-primary.disabled {
  opacity: 0.45;
  box-shadow: none;
  pointer-events: none;
}

.btn-ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  margin-top: 12px;
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink-2);
  font-size: var(--type-btn);
  font-weight: 700;
  background: rgba(251, 249, 244, 0.7);
}

.btn-text {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: var(--tap-target);
  margin-top: 6px;
  color: var(--ink-muted);
  font-size: var(--type-btn);
  font-weight: 700;
}

.case .foot {
  margin-top: auto;
  padding: 10px 16px calc(32px + env(safe-area-inset-bottom, 0px));
  flex: 0 0 auto;
}

.case .foot.retrial-foot {
  padding-top: 16px;
}

.case .foot .note {
  font-size: var(--type-label);
  color: var(--ink-muted);
  text-align: center;
  margin-bottom: 10px;
  line-height: 1.6;
}

.case .body-scroll {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* 일괄 이의 */
.case-list {
  padding: 10px 14px 0;
}

/* 이의 작성 */
.sum-card {
  margin: 16px 16px 0;
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  background: var(--paper-3);
  padding: 12px 14px;
  display: flex;
  align-items: center;
}

.sum-card .subject {
  font-family: var(--serif);
  font-size: var(--type-heading);
  font-weight: 900;
}

.sum-card .vmark {
  margin-left: auto;
}

.form-lb {
  margin: 16px 16px 8px;
  font-size: var(--type-label);
  font-weight: 900;
  color: var(--ink-muted);
  letter-spacing: 0.12em;
}

.form-lb b {
  color: var(--clay-deep);
}

.free-box {
  margin: 0 16px;
  border: 1.5px dashed var(--line-2);
  border-radius: 10px;
  background: rgba(251, 249, 244, 0.6);
  padding: 10px 11px;
  /* iOS Safari는 16px 미만 입력을 포커스할 때 페이지를 자동 확대한다. */
  font-size: var(--type-btn);
  color: var(--ink);
  min-height: 58px;
  line-height: 1.6;
  width: calc(100% - 32px);
  font-family: inherit;
  resize: none;
}

.free-box::placeholder {
  color: var(--ink-muted);
}

.warn-row {
  margin: 16px 16px 0;
  font-size: var(--type-label);
  color: var(--ink-2);
  line-height: 1.75;
  border-top: 1px solid var(--line-2);
  padding: 14px 2px 0;
}

.warn-row b {
  color: var(--clay-deep);
}

/* 재심 전용 시계 — 본 턴 시계와 별개 1분, 줄어드는 바 */
.retrial-clock {
  margin-top: 10px;
  height: 6px;
  border-radius: 3px;
  background: var(--line-2);
  position: relative;
  overflow: hidden;
}

.retrial-clock i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  border-radius: 3px;
  background: var(--teal-deep);
  transition: width 0.25s linear;
}

.retrial-clock.warn i {
  background: var(--seal);
}

/* 판례집 헤더의 재심 규칙·잔여 횟수 */
.case-help {
  position: absolute;
  right: 54px;
  top: 50%;
  min-height: var(--tap-target);
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  color: var(--ink-muted);
  font-size: var(--type-label);
  font-weight: 700;
}

.case-help .ic {
  display: block;
  width: 18px;
  height: 18px;
  margin-left: 4px;
}

.practice-case-note {
  padding: 8px 16px 0;
  color: var(--teal-deep);
  font-size: var(--type-label);
  font-weight: 800;
  text-align: center;
}

/* 재심 작성의 판정 기록 참고 */
.ref-btn {
  display: block;
  margin: 0 16px;
  width: calc(100% - 32px);
  border: 1.5px solid var(--line-2);
  border-radius: 10px;
  background: var(--paper-3);
  padding: 9px 12px;
  font-size: var(--type-label);
  font-weight: 800;
  color: var(--teal-deep);
  text-align: center;
}

.ref-list {
  margin: 10px 14px 0;
  max-height: 44vh;
  overflow-y: auto;
  text-align: left;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--paper-3);
  padding: 4px 12px;
}

.ref-row {
  padding: 8px 0;
}

.ref-row + .ref-row {
  border-top: 1px dashed rgba(107, 89, 64, 0.22);
}

.ref-row .sent {
  font-weight: 700;
  font-size: 14px;
}

.ref-row .why {
  margin-top: 2px;
  font-size: var(--type-label);
  color: var(--ink-muted);
}

/* 판례집 */
.tabs {
  display: flex;
  padding: 12px 14px 0;
  flex: 0 0 auto;
}

.tab {
  flex: 1;
  min-height: var(--tap-target);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 9px 0;
  font-size: var(--type-label);
  font-weight: 800;
  color: var(--ink-muted);
  border-bottom: 2.5px solid var(--line);
}

.tab.on {
  color: var(--gold-deep);
  border-bottom-color: var(--gold-deep);
}

.filters {
  display: flex;
  padding: 10px 14px;
  overflow-x: auto;
  flex: 0 0 auto;
}

.fchip {
  font-size: var(--type-label);
  font-weight: 700;
  color: var(--ink-2);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  padding: 4px 11px;
  background: var(--paper-3);
  white-space: nowrap;
}

.fchip + .fchip {
  margin-left: 6px;
}

.fchip.on {
  border-color: var(--gold-deep);
  color: var(--gold-deep);
  font-weight: 800;
}

.prec-list {
  padding: 0 14px 12px;
}

.prec {
  /* 재심 가능한 기록은 button 으로 렌더되므로 너비·정렬을 div 와 통일한다 */
  display: block;
  width: 100%;
  text-align: left;
  color: inherit;
  font: inherit;
  border: 1.5px solid var(--line-2);
  border-radius: 12px;
  background: var(--paper-3);
  padding: 10px 12px;
  position: relative;
  overflow: hidden;
}

.prec + .prec {
  margin-top: 9px;
}

.prec .r1 {
  display: flex;
  align-items: center;
}

.prec .subject {
  font-family: var(--serif);
  font-size: 15.5px;
  font-weight: 900;
}

.prec .r1 .vmark {
  margin-left: auto;
}

.prec .meta {
  margin-top: 7px;
  font-size: var(--type-label);
  color: var(--ink-muted);
}

.prec .meta b {
  color: var(--clay-deep);
  font-weight: 800;
}

.prec .rel {
  margin-top: 6px;
  font-size: var(--type-label);
  color: var(--ink-2);
}

.prec .rel .ic {
  color: var(--gold-deep);
  margin-right: 3px;
}

.prec .lockstamp {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%) rotate(-6deg);
  width: 38px;
  height: 38px;
  opacity: 0.92;
}

.prec.locked {
  padding-right: 54px;
}

.prec.open .status {
  position: absolute;
  right: 10px;
  bottom: 8px;
  font-size: var(--type-label);
  font-weight: 800;
  color: var(--verdict-q);
}

.empty-state {
  padding: 60px 30px;
  text-align: center;
  color: var(--ink-muted);
}

.empty-state .doc {
  font-size: 17px;
  font-weight: 900;
  color: var(--ink-2);
  margin-bottom: 8px;
}

.empty-state .d {
  font-size: var(--type-label);
  line-height: 1.7;
}

/* 리절트 — 대국 화면 위 가운데 팝업 */
.result-pop {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 22, 26, 0.55);
}

/* 맞대국 재접속 유예 — 판정 태그·심판 대사보다 위, 결과·전역 시트보다 아래 */
.match-connection-overlay {
  position: absolute;
  inset: 0;
  z-index: 65;
  display: flex;
  pointer-events: auto;
  align-items: center;
  justify-content: center;
  padding:
    calc(56px + env(safe-area-inset-top, 0px))
    16px
    calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--backdrop-wait);
}

.match-connection-panel {
  width: min(296px, 100%);
  padding: 20px 18px;
  text-align: center;
  background: var(--surface-sheet);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-l);
  box-shadow: var(--shadow-2);
}

.match-connection-title {
  color: var(--ink);
  font-size: var(--type-heading);
  font-weight: 800;
  line-height: 1.4;
}

.match-connection-countdown {
  margin-top: 8px;
  color: var(--teal-deep);
  font-size: calc(var(--type-display) * 1.35);
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.match-connection-a11y {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.result-card {
  width: min(320px, 86%);
  background: var(--paper-3);
  border: 1.5px solid var(--line-strong);
  border-radius: 14px;
  padding: 26px 22px 18px;
  text-align: center;
  position: relative;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.42);
  max-height: calc(100% - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 24px);
  overflow-y: auto;
}

.result-card .rule2 {
  width: 42px;
  margin-bottom: 14px;
  border-color: var(--line-strong);
  opacity: 0.6;
}

.result-card .verdict-word {
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 0.3em;
  margin-left: 0.3em;
}

.result-card .verdict-word.lose {
  color: var(--ink-2);
}

.result-card .why {
  margin-top: 6px;
  font-size: var(--type-label);
  color: var(--ink-muted);
}

.result-card .winstamp {
  position: absolute;
  left: 14px;
  top: 14px;
  width: 56px;
  height: 56px;
  transform: rotate(-8deg);
  filter: drop-shadow(0 2px 6px rgba(20, 10, 0, 0.3));
}

.result-close {
  top: 6px;
  right: 6px;
  transform: none;
  z-index: 1;
}

.result-card .btn-primary {
  width: 100%;
  margin-top: 18px;
}

.result-card .btn-text {
  margin-top: 4px;
}

.score-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
}

/* 판이 끝난 뒤에야 밝히는 심판 정보. 결과보다 조용해야 한다. */
.judge-reveal {
  margin-top: 10px;
  text-align: center;
  font-size: var(--type-label);
  color: var(--ink-muted);
}

.score-row .sc {
  font-size: 30px;
  font-weight: 900;
}

.score-row .sc.me {
  color: var(--teal-deep);
}

.score-row .sc.foe {
  color: var(--ink-2);
}

.score-row .colon {
  margin: 0 10px;
  color: var(--ink-3);
  font-size: 20px;
  font-weight: 900;
}

/* 재심 대기 — .screen 의 absolute 배치를 덮어쓰면 안 되므로 position 은 건드리지 않는다 */
.appeal-wait {
  overflow: hidden;
  background: var(--lacquer);
}

.appeal-wait .art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  filter: saturate(0.85) brightness(0.8);
}

.appeal-wait .veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 20, 23, 0.25), rgba(15, 20, 23, 0.55) 55%, rgba(15, 20, 23, 0.9));
}

.appeal-wait .panel {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  z-index: 2;
}

.steps {
  background: rgba(251, 249, 244, 0.96);
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  padding: 16px 18px;
}

.steps .rule2 {
  width: 42px;
  margin-bottom: 10px;
  border-color: var(--line-strong);
  opacity: 0.55;
}

.steps .t {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 900;
  text-align: center;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  margin-bottom: 12px;
}

.step {
  display: flex;
  align-items: center;
  padding: 8px 0;
  font-size: var(--type-label);
  font-weight: 700;
  color: var(--ink-2);
}

.step + .step {
  border-top: 1px dashed rgba(107, 89, 64, 0.22);
}

.step .dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  margin-right: 10px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border: 2px solid var(--line-2);
  color: var(--line-2);
}

.step.done .dot {
  border-color: var(--teal-deep);
  background: var(--teal-deep);
  color: var(--ink-inverse);
}

.step.now .dot {
  border-color: var(--gold-deep);
  color: var(--gold-deep);
}

.step.now {
  color: var(--ink);
  font-weight: 900;
}

.step .st {
  margin-left: auto;
  font-size: var(--type-label);
  color: var(--ink-muted);
}

/* 재심 결과 팝업 */
.dimmed-bg {
  overflow: hidden;
  background: var(--lacquer);
}

.dimmed-bg .bgart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
}

.dimmed-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(22, 26, 29, var(--dim-pop));
  z-index: 1;
  pointer-events: none;
}

.verdict-pop {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: linear-gradient(174deg, var(--paper-3), var(--surface-sheet));
  border: 1.5px solid var(--line-strong);
  border-radius: 14px;
  padding: 18px 16px 16px;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.45);
}

.verdict-pop .rule2 {
  width: 42px;
  margin-bottom: 10px;
  border-color: var(--line-strong);
  opacity: 0.55;
}

.verdict-pop .vt {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 900;
  text-align: center;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
}

.verdict-pop .vt.accept {
  color: var(--teal-deep);
}

.verdict-pop .vt.reject {
  color: var(--ink-2);
}

.verdict-pop .vt.fail {
  color: var(--gold-deep);
}

.verdict-pop .vsub {
  text-align: center;
  font-size: var(--type-label);
  color: var(--ink-muted);
  margin-top: 4px;
}

.verdict-pop .vstamp {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 48px;
  height: 48px;
  transform: rotate(-7deg);
  filter: drop-shadow(0 2px 5px rgba(20, 10, 0, 0.3));
}

.vrows {
  margin-top: 12px;
}

.vrow {
  display: flex;
  align-items: center;
  font-size: var(--type-label);
  color: var(--ink-2);
  line-height: 1.65;
  padding: 7px 0;
}

.vrow + .vrow {
  border-top: 1px dashed rgba(107, 89, 64, 0.22);
}

.vrow .k {
  width: 96px;
  flex: 0 0 auto;
  color: var(--ink-muted);
  font-size: var(--type-label);
}

.vrow b.o {
  color: var(--verdict-o);
}

.vrow b.x {
  color: var(--verdict-x);
}

.vrow b.q {
  color: var(--verdict-q);
}

.vrow .doc {
  font-weight: 900;
}

.verdict-pop .btn-primary {
  margin-top: 14px;
}

/* 설정 */
.set-sect {
  margin: 14px 14px 0;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--paper-3);
  padding: 4px 13px;
}

/* 기권 — 대국 메뉴 시트의 탭 전체가 버튼 */
.set-resign {
  display: block;
  width: calc(100% - 28px);
  min-height: 52px;
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  color: var(--seal);
  cursor: pointer;
}

.set-resign.off {
  color: var(--ink-muted);
  cursor: default;
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(100% - 28px);
  min-height: 52px;
  margin: 14px 14px 0;
  border: 1px solid var(--line-2);
  border-radius: var(--r-m);
  background: var(--paper-3);
  color: var(--ink-2);
  font-size: var(--type-btn);
  font-weight: 600;
}

.menu-item + .menu-item {
  margin-top: 8px;
}

.menu-item.danger {
  color: var(--seal);
}

.match-menu .stitle {
  font-weight: 700;
}

.match-menu .ssub {
  font-weight: 400;
}

.match-menu .cancel-txt {
  font-weight: 500;
}

.match-menu-footer {
  margin: 10px 14px 0;
  padding-top: 8px;
  display: block;
  border-top: 1px solid var(--line-2);
}

.match-menu-meta {
  width: 100%;
  min-height: var(--tap-target);
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  font-size: var(--type-label);
  font-weight: 600;
  line-height: 1.3;
  opacity: 0.68;
  text-align: center;
}

.match-menu .match-menu-continue {
  width: 100%;
  min-height: 52px;
  margin-top: 0;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-m);
  background: var(--teal-deep);
  color: var(--ink-inverse);
  font-size: var(--type-btn);
  font-weight: 600;
}

.judge-info .stitle {
  margin-bottom: 12px;
  font-weight: 700;
}

.judge-info-card {
  margin: 0 14px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: var(--r-m);
  background: var(--paper-3);
  box-shadow: var(--shadow-1);
}

.judge-info-profile {
  min-height: 96px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
}

.judge-info-art {
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
  object-fit: cover;
  object-position: center top;
  border: 1px solid var(--gold-line);
  border-radius: 50%;
  background: var(--paper-2);
}

.judge-info-copy {
  min-width: 0;
  margin-left: 12px;
}

.judge-info-role {
  color: var(--gold-deep);
  font-size: var(--type-chip);
  font-weight: 400;
  line-height: 1.3;
}

.judge-info-name {
  margin-top: 3px;
  color: var(--ink-2);
  font-size: var(--type-heading);
  font-weight: 600;
  line-height: 1.2;
}

.judge-info-basis {
  margin-top: 6px;
  color: var(--ink-muted);
  font-size: var(--type-label);
  font-weight: 500;
  line-height: 1.35;
}

.judge-info-quote {
  padding: 11px 12px 12px;
  border-top: 1px solid var(--line-2);
  background: var(--paper-2);
}

.judge-info-quote-label,
.judge-info-quote-text {
  display: block;
}

.judge-info-quote-label {
  color: var(--ink-muted);
  font-size: var(--type-chip);
  font-weight: 400;
}

.judge-info-quote-text {
  margin-top: 5px;
  color: var(--ink-2);
  font-size: var(--type-label);
  font-weight: 500;
  line-height: 1.6;
  word-break: keep-all;
}

.judge-info .cancel-txt {
  margin-top: 8px;
}

.menu-item.sound-menu .ic {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  display: block;
  vertical-align: middle;
}

.menu-item.sound-menu .sound-label {
  display: block;
  margin-left: 8px;
  line-height: 20px;
}

.info-meta {
  margin: 14px;
  padding: 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-m);
  background: var(--paper-3);
}

.info-meta .product-contact {
  color: var(--teal-deep);
  font-weight: 800;
}

.info-meta .product-copyright {
  color: var(--ink-muted);
}

/* 토스트 */
.toast {
  position: absolute;
  left: 50%;
  top: var(--receipt-top, calc(9% + 8px));
  bottom: auto;
  transform: translateX(-50%);
  z-index: 70;
  background: var(--ink);
  color: var(--paper-3);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: var(--type-label);
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  width: max-content;
  white-space: nowrap;
  max-width: calc(100% - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.toast.good {
  background: var(--teal-deep);
}

.toast.warn {
  background: var(--gold-deep);
}

.toast.bad {
  background: var(--clay-deep);
}

.toast.promotion-toast {
  border: 2px solid var(--gold-soft);
  font-size: var(--type-heading);
  animation: promotion-rise var(--motion-drama) ease-out;
}

@keyframes promotion-rise {
  from {
    transform: translate(-50%, 10px) scale(0.92);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0) scale(1);
    opacity: 1;
  }
}

/* 제정 비행 카드 (고스톱 문법) */
.fly-card {
  position: fixed;
  z-index: 75;
  transition: all var(--motion-drama) cubic-bezier(0.2, 0.9, 0.3, 1);
  pointer-events: none;
}

/* 조용히 죽지 않기 */
#failure {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 999;
  background: var(--surface-failure);
  color: var(--ink-failure);
  font-size: 12px;
  padding: 10px;
  border-radius: 8px;
  max-height: 40%;
  overflow: auto;
  white-space: pre-wrap;
}

/* ── 폼팩터 공통 보정 — 창 크기와 입력 방식은 별도 축으로 다룬다 ── */
@media (max-width: 599px) {
  .screen.dark {
    --entry-frame-inset: 10px;
  }

  .screen.dark::before {
    top: calc(10px + env(safe-area-inset-top, 0px));
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    left: 10px;
  }

  .sound-toggle {
    top: calc(18px + env(safe-area-inset-top, 0px));
    right: 18px;
  }

  .title-screen .mast {
    top: calc(8% + env(safe-area-inset-top, 0px));
  }

  .title-screen .t {
    font-size: clamp(48px, 15vw, 62px);
  }

  .ob {
    overflow: hidden;
  }

  .ob .lesson {
    padding-right: 22px;
    padding-left: 22px;
  }

  .ob .foot {
    margin-top: auto;
  }

  .card .pred,
  .card .eff,
  .card .foot {
    padding-right: 7px;
    padding-left: 7px;
  }

}

@media (max-width: 350px) {
  .hud {
    padding-right: 8px;
    padding-left: 8px;
  }

  .hud .opponent-identity {
    width: 94px;
    flex-basis: 94px;
  }

  .hud .opponent-silhouette {
    width: 34px;
    flex-basis: 34px;
  }

  .hud .score .colon {
    margin-right: 3px;
    margin-left: 3px;
  }

  .practice-guide {
    right: 10px;
  }
}

@media (max-height: 700px) and (orientation: portrait) {
  .title-screen .mast {
    top: calc(6% + env(safe-area-inset-top, 0px));
  }

  .title-screen .t {
    margin-top: 14px;
    font-size: 48px;
  }

  .title-screen .tag {
    margin-top: 8px;
  }

  .title-screen .codex-art {
    top: 35%;
    width: 108%;
  }

  .title-screen .stamp {
    top: 58%;
    right: 16%;
  }

  .judge-card .por {
    height: 96px;
  }

  .judge-card .meta {
    padding: 7px 9px 8px;
  }

  .judge-card .quote {
    margin-top: 3px;
    line-height: 1.4;
  }

  .ob .art {
    height: clamp(170px, 28dvh, 188px);
  }

  .ob .h {
    margin-top: 9px;
    font-size: 22px;
  }

  .ob .d {
    margin-top: 7px;
    line-height: 1.55;
  }

  .practice-guide {
    padding: 8px 10px;
  }

  .practice-body {
    line-height: 1.3;
  }

  .entry-header {
    padding: calc(16px + env(safe-area-inset-top, 0px)) var(--entry-content-inline) 8px;
  }

  .entry-header .rule2 {
    margin-bottom: 8px;
  }

  .entry-header .h {
    font-size: 22px;
  }

  .entry-body .sect + .sect {
    margin-top: 14px;
  }

  .entry-lobby .entry-body[data-state="host"] .lobby-code-panel {
    padding: 6px 10px;
  }

  .entry-lobby .entry-body[data-state="host"] .lobby-code-panel > * + * {
    margin-top: 2px;
  }

  .entry-lobby .entry-body[data-state="host"] .room-code {
    font-size: 28px;
  }

  .ob .lesson {
    min-height: 185px;
  }

  .entry-lobby .entry-body[data-state="host"] .lobby-status {
    margin-top: 4px;
  }

  .entry-lobby .entry-body[data-state="host"] .lobby-judge-block {
    margin-top: 10px;
  }

  .judge-card .por {
    height: 96px;
  }

  .entry-footer {
    padding-top: 8px;
  }
}

@media (min-height: 601px) and (max-height: 700px) and (orientation: portrait) {
  .judge-card .por {
    height: 108px;
  }
}

@media (max-height: 600px) and (orientation: portrait) {
  .judge-card .por {
    height: 78px;
  }

}

@media (min-height: 701px) and (orientation: portrait) {
  .title-screen .codex-art {
    top: 37%;
    width: 126%;
  }

  .title-screen .stamp {
    top: 59%;
    right: 17%;
  }

  .ob-content {
    justify-content: center;
  }

  .ob .art {
    height: clamp(170px, 30dvh, 275px);
  }

  .ob .lesson {
    flex: 0 0 auto;
  }
}

@media (min-height: 900px) and (orientation: portrait) {
  .title-screen .codex-art {
    top: 38%;
  }

  .title-screen .stamp {
    top: 60%;
  }
}

@media (max-height: 600px) and (orientation: portrait) {
  .ob-top {
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
  }

  .ob .art {
    height: 170px;
  }

  .ob .lesson {
    padding-top: 4px;
  }

  .ob .lesson.board-lesson {
    padding-top: 10px;
  }

  .ob .h {
    font-size: 20px;
    line-height: 1.3;
  }

  .ob .d {
    margin-top: 5px;
    line-height: 1.4;
  }

  .ob .pcard .eff {
    padding: 8px 10px 9px;
    font-size: 16px;
    line-height: 1.35;
  }
}

@media (max-width: 350px) and (orientation: portrait) {
  .entry-prep .judge-row,
  .entry-lobby .lobby-judge-row {
    flex-direction: column;
  }

  .entry-prep .judge-card + .judge-card,
  .entry-lobby .judge-card + .judge-card {
    margin-top: 8px;
    margin-left: 0;
  }

  .entry-prep .judge-card,
  .entry-lobby .judge-card {
    display: flex;
    flex-direction: row;
    min-height: 0;
  }

  .entry-prep .judge-card .por,
  .entry-lobby .judge-card .por {
    width: 72px;
    height: auto;
    min-height: 86px;
    flex: 0 0 72px;
    margin: 0 0 0 5px;
  }

  .entry-prep .judge-card .meta,
  .entry-lobby .judge-card .meta {
    flex: 1 1 auto;
    min-width: 0;
    padding: 4px 7px;
  }

  .entry-prep .judge-card .role,
  .entry-lobby .judge-card .role {
    line-height: 1.3;
  }

  .entry-prep .judge-card .nm,
  .entry-lobby .judge-card .nm {
    margin-top: 0;
    line-height: 1.2;
  }

  .entry-prep .judge-card .quote,
  .entry-lobby .judge-card .quote {
    margin-top: 1px;
    line-height: 1.35;
  }

  .entry-prep .choice-chip {
    min-height: 58px;
    padding: 6px 5px;
  }

  .entry-prep .choice-chip .md {
    margin-top: 2px;
    line-height: 1.3;
  }

  .entry-prep .entry-body .sect + .sect {
    margin-top: 10px;
  }

  .entry-lobby .entry-body[data-state="host"] .lobby-code-panel {
    padding: 8px 10px;
  }

  .entry-lobby .entry-body[data-state="host"] .lobby-code-panel > * + * {
    margin-top: 4px;
  }

  .entry-lobby .entry-body[data-state="host"] .room-code {
    font-size: 28px;
  }

  .entry-lobby .entry-body[data-state="host"] .lobby-judge-block {
    margin-top: 4px;
  }
}

/* 짧은 세로 화면의 방장 대기: 코드와 두 심판을 한 화면에 보존한다. */
@media (max-height: 700px) and (orientation: portrait) {
  .entry-lobby .entry-body[data-state="host"] {
    justify-content: flex-start;
  }

  .entry-lobby .entry-body[data-state="host"] .lobby-judge-row {
    flex-direction: column;
  }

  .entry-lobby .entry-body[data-state="host"] .judge-card + .judge-card {
    margin-top: 6px;
    margin-left: 0;
  }

  .entry-lobby .entry-body[data-state="host"] .judge-card {
    flex-direction: row;
    min-height: 0;
  }

  .entry-lobby .entry-body[data-state="host"] .judge-card .por {
    width: 64px;
    height: auto;
    min-height: 72px;
    flex: 0 0 64px;
    margin: 0 0 0 4px;
  }

  .entry-lobby .entry-body[data-state="host"] .judge-card .meta {
    flex: 1 1 auto;
    min-width: 0;
    padding: 4px 7px;
  }

  .entry-lobby .entry-body[data-state="host"] .judge-card .role,
  .entry-lobby .entry-body[data-state="host"] .judge-card .nm,
  .entry-lobby .entry-body[data-state="host"] .judge-card .quote {
    line-height: 1.2;
  }

  .entry-lobby .entry-body[data-state="host"] .judge-card .nm,
  .entry-lobby .entry-body[data-state="host"] .judge-card .quote {
    margin-top: 1px;
  }
}

@media (max-height: 700px) {
  .entry-lobby .entry-body[data-state="host"] .lobby-code-field > * + * {
    margin-top: 3px;
  }

  .entry-lobby .entry-body[data-state="host"] .room-code {
    height: var(--tap-target);
    font-size: 24px;
  }

  .entry-lobby .entry-body[data-state="host"] .lobby-player-line {
    font-size: 15px;
    line-height: 1.2;
  }

  .entry-lobby .entry-body[data-state="host"] .lobby-judge-block > .lobby-lb {
    margin-bottom: 4px;
  }
}

@media (max-height: 600px) and (orientation: portrait) {
  .entry-lobby .entry-header {
    padding: calc(8px + env(safe-area-inset-top, 0px)) var(--entry-content-inline) 2px;
  }

  .entry-lobby .entry-header .rule2 {
    margin-bottom: 4px;
  }

  .entry-lobby .entry-footer {
    padding-top: 4px;
  }

  .entry-lobby .entry-footer .btn-gold {
    height: var(--tap-target);
  }
}

@media (max-width: 350px) and (max-height: 600px) and (orientation: portrait) {
  .entry-lobby .entry-body[data-state="host"] .lobby-code-panel {
    padding: 6px 10px;
  }

  .entry-lobby .entry-footer {
    padding-top: 0;
  }

  .entry-lobby .entry-footer .entry-text-action {
    margin-top: 0;
  }
}

/* iOS는 layout viewport가 실제 표시 영역보다 길 수 있어, JS가 기록한
   visualViewport 기준 compact 상태에도 방장 로비의 짧은 화면 규칙을 적용한다. */
@media (orientation: portrait) {
  html[data-compact-viewport="true"] .entry-lobby .entry-header {
    padding: calc(8px + env(safe-area-inset-top, 0px)) var(--entry-content-inline) 2px;
  }

  html[data-compact-viewport="true"] .entry-lobby .entry-header .rule2 {
    margin-bottom: 4px;
  }

  html[data-compact-viewport="true"] .entry-lobby .entry-footer {
    padding-top: 4px;
  }

  html[data-compact-viewport="true"] .entry-lobby .entry-footer .btn-gold {
    height: var(--tap-target);
  }

  html[data-compact-viewport="true"] .entry-lobby .entry-body[data-state="host"] {
    justify-content: flex-start;
  }

  html[data-compact-viewport="true"] .entry-lobby .entry-body[data-state="host"] .lobby-code-panel {
    padding: 6px 10px;
  }

  html[data-compact-viewport="true"] .entry-lobby .entry-body[data-state="host"] .lobby-code-panel > * + * {
    margin-top: 2px;
  }

  html[data-compact-viewport="true"] .entry-lobby .entry-body[data-state="host"] .lobby-code-field > * + * {
    margin-top: 3px;
  }

  html[data-compact-viewport="true"] .entry-lobby .entry-body[data-state="host"] .room-code {
    height: var(--tap-target);
    font-size: 24px;
  }

  html[data-compact-viewport="true"] .entry-lobby .entry-body[data-state="host"] .lobby-player-line {
    font-size: 15px;
    line-height: 1.2;
  }

  html[data-compact-viewport="true"] .entry-lobby .entry-body[data-state="host"] .lobby-status {
    margin-top: 4px;
  }

  html[data-compact-viewport="true"] .entry-lobby .entry-body[data-state="host"] .lobby-judge-block {
    margin-top: 4px;
  }

  html[data-compact-viewport="true"] .entry-lobby .entry-body[data-state="host"] .lobby-judge-block > .lobby-lb {
    margin-bottom: 4px;
  }

  html[data-compact-viewport="true"] .entry-lobby .entry-body[data-state="host"] .lobby-judge-row {
    flex-direction: column;
  }

  html[data-compact-viewport="true"] .entry-lobby .entry-body[data-state="host"] .judge-card + .judge-card {
    margin-top: 6px;
    margin-left: 0;
  }

  html[data-compact-viewport="true"] .entry-lobby .entry-body[data-state="host"] .judge-card {
    flex-direction: row;
    min-height: 0;
  }

  html[data-compact-viewport="true"] .entry-lobby .entry-body[data-state="host"] .judge-card .por {
    width: 64px;
    height: auto;
    min-height: 72px;
    flex: 0 0 64px;
    margin: 0 0 0 4px;
  }

  html[data-compact-viewport="true"] .entry-lobby .entry-body[data-state="host"] .judge-card .meta {
    flex: 1 1 auto;
    min-width: 0;
    padding: 4px 7px;
  }

  html[data-compact-viewport="true"] .entry-lobby .entry-body[data-state="host"] .judge-card .role,
  html[data-compact-viewport="true"] .entry-lobby .entry-body[data-state="host"] .judge-card .nm,
  html[data-compact-viewport="true"] .entry-lobby .entry-body[data-state="host"] .judge-card .quote {
    line-height: 1.2;
  }

  html[data-compact-viewport="true"] .entry-lobby .entry-body[data-state="host"] .judge-card .nm,
  html[data-compact-viewport="true"] .entry-lobby .entry-body[data-state="host"] .judge-card .quote {
    margin-top: 1px;
  }
}

@media (max-width: 350px) and (orientation: portrait) {
  html[data-compact-viewport="true"] .entry-lobby .entry-footer {
    padding-top: 0;
  }

  html[data-compact-viewport="true"] .entry-lobby .entry-footer .entry-text-action {
    margin-top: 0;
  }
}

@media (orientation: landscape) and (max-height: 599px) {
  .sheet.match-menu {
    padding: 10px 14px 8px;
    overflow-y: hidden;
  }

  .sheet.match-menu .rule2 {
    margin-bottom: 5px;
  }

  .sheet.match-menu .stitle {
    font-size: 17px;
    line-height: 1.2;
  }

  .sheet.match-menu .ssub {
    margin-bottom: 6px;
    line-height: 1.3;
  }

  .sheet.match-menu .menu-item {
    min-height: var(--tap-target);
    height: var(--tap-target);
    margin-top: 6px;
  }

  .sheet.match-menu .match-menu-footer {
    margin-top: 6px;
    padding-top: 4px;
  }

  .sheet.match-menu .match-menu-continue {
    min-height: var(--tap-target);
  }

  .sheet.match-menu .match-menu-meta {
    min-height: 36px;
    margin-top: 0;
  }

  body {
    align-items: stretch;
  }

  .phone {
    width: 100vw;
    max-width: none;
    height: var(--app-height, 100dvh);
    max-height: none;
    border-radius: 0;
  }

  .match.on {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: calc(54px + env(safe-area-inset-top, 0px)) minmax(0, 1fr);
  }

  .match .hud {
    grid-column: 1 / -1;
    grid-row: 1;
    width: 100%;
    height: auto;
  }

  .match .stage {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    height: auto;
  }

  .match .dock {
    grid-column: 2;
    grid-row: 2;
    width: 100%;
    height: auto;
    min-height: 0;
  }

  .match .confirm-bar {
    grid-column: 2;
    grid-row: 2;
    align-self: end;
    max-height: 100%;
    overflow-y: auto;
  }

  .match.focus-play .stage {
    grid-column: 1;
    height: auto;
  }

  .match.focus-play .dock {
    display: none;
  }

  .judge-say {
    top: var(--judge-say-top, calc(54px + env(safe-area-inset-top, 0px) + 8px));
    max-width: calc(100% - 24px);
  }

  .hand { height: 148px; }

  .ob.on {
    display: grid;
    grid-template-columns: 44% 56%;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
  }

  .ob-content {
    display: contents;
  }

  .ob-kicker {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    justify-self: center;
    z-index: 4;
    margin-top: 6px;
  }

  .ob .ob-top {
    grid-column: 1 / -1;
    grid-row: 1;
    padding: calc(6px + env(safe-area-inset-top, 0px)) 24px 0;
  }

  .ob .art {
    grid-column: 1;
    grid-row: 2 / 4;
    width: 100%;
    height: auto;
    min-height: 0;
    margin-top: 0;
    padding-top: env(safe-area-inset-top, 0px);
  }

  .ob .art > img {
    width: 108%;
  }

  .ob .lesson {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    min-height: 0;
    padding: 6px 34px;
    overflow-y: auto;
  }

  .ob .foot {
    grid-column: 2;
    grid-row: 3;
    padding: 0 34px calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .ob .h {
    margin-top: 7px;
    font-size: 21px;
    line-height: 1.3;
  }

  .ob .d {
    margin-top: 6px;
    line-height: 1.45;
  }

  .ob .jface {
    width: min(19vw, 150px);
    height: min(48vh, 180px);
  }

  .ob .pcard {
    flex-basis: clamp(86px, 12vw, 104px);
    width: clamp(86px, 12vw, 104px);
    height: 132px;
  }

  .title-screen .mast {
    right: 52%;
    top: calc(18px + env(safe-area-inset-top, 0px));
  }

  .title-screen .t {
    margin-top: 12px;
    font-size: 42px;
  }

  .title-screen .tag {
    margin-top: 6px;
  }

  .title-screen .codex-art {
    left: 76%;
    top: 5%;
    width: 66%;
  }

  .title-screen .stamp {
    right: 13%;
    top: 54%;
  }

  .title-screen .foot {
    width: 48%;
    padding: 0 34px calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .entry-header {
    padding: calc(8px + env(safe-area-inset-top, 0px)) var(--entry-content-inline) 4px;
  }

  .entry-header .rule2 {
    margin-bottom: 5px;
  }

  .entry-header .h {
    font-size: 21px;
  }

  .entry-screen.on {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .entry-footer {
    display: flex;
    align-items: center;
    width: min(100%, 680px);
    margin-right: auto;
    margin-left: auto;
    padding: 4px var(--entry-content-inline) var(--entry-footer-bottom);
  }

  .entry-footer .btn-gold,
  .entry-footer .btn-back {
    flex: 1 1 0;
    min-width: 0;
    height: var(--tap-target);
    min-height: var(--tap-target);
  }

  .entry-footer .btn-back {
    margin-top: 0;
  }

  .entry-footer .btn-gold + .btn-back {
    margin-left: 12px;
  }

  .entry-footer[data-variant="text-secondary"] {
    flex-direction: column;
  }

  .entry-footer[data-variant="text-secondary"] .btn-gold,
  .entry-footer[data-variant="text-secondary"] .entry-text-action {
    flex: 0 0 auto;
    width: 100%;
  }

  .entry-footer[data-variant="text-secondary"] .entry-text-action {
    margin-top: 4px;
    margin-left: 0;
  }

  .entry-mode .entry-body {
    padding-right: var(--entry-content-inline);
    padding-left: var(--entry-content-inline);
  }

  .entry-mode .route-choice-list {
    display: flex;
    flex-direction: row;
    width: min(100%, 760px);
    margin-right: auto;
    margin-left: auto;
  }

  .entry-mode .route-choice-card {
    flex: 1 1 0;
    min-width: 0;
  }

  .entry-mode .route-choice-card + .route-choice-card {
    margin-top: 0;
    margin-left: 12px;
  }

  .entry-mode .entry-footer {
    width: min(320px, 42%);
    margin-right: auto;
    margin-left: auto;
  }

  .entry-lobby .entry-body {
    padding: 4px var(--entry-content-inline);
  }

  .entry-lobby .entry-body[data-state="host"] {
    display: grid;
    grid-template-columns: minmax(0, 44fr) minmax(0, 56fr);
    grid-template-rows: minmax(0, 1fr);
    align-items: start;
  }

  .entry-lobby .entry-body[data-state="host"] .lobby-code-panel {
    min-width: 0;
    padding: 7px 12px;
  }

  .entry-lobby .entry-body[data-state="host"] .lobby-judge-block {
    min-width: 0;
    margin-top: 0;
    margin-left: 16px;
  }

  .entry-lobby .judge-card .por {
    height: 64px;
  }

  .entry-lobby .judge-card .meta {
    padding: 5px 8px 6px;
  }

  .entry-lobby .judge-card .quote {
    margin-top: 2px;
    min-height: 0;
    line-height: 1.3;
  }

  .entry-lobby .room-code {
    font-size: 30px;
  }

  .entry-lobby .entry-body[data-state="pick"] .route-choice-list {
    display: flex;
    flex-direction: row;
    width: min(100%, 760px);
    margin-right: auto;
    margin-left: auto;
  }

  .entry-lobby .entry-body[data-state="pick"] .route-choice-card {
    flex: 1 1 0;
    min-width: 0;
  }

  .entry-lobby .entry-body[data-state="pick"] .route-choice-card + .route-choice-card {
    margin-top: 0;
    margin-left: 12px;
  }

  .entry-lobby .entry-body[data-state="create"] .lobby-panel,
  .entry-lobby .entry-body[data-state="wait-host"] .lobby-panel {
    width: min(100%, 560px);
    margin-right: auto;
    margin-left: auto;
  }

  .entry-lobby .entry-body[data-state="join"] .lobby-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    width: min(100%, 760px);
    margin-right: auto;
    margin-left: auto;
  }

  .entry-lobby .entry-body[data-state="join"] .lobby-field + .lobby-field {
    margin-top: 0;
    margin-left: 12px;
  }

  .entry-lobby .entry-body[data-state="join"] .lobby-err,
  .entry-lobby .entry-body[data-state="join"] .lobby-help {
    grid-column: 1 / -1;
  }

  .entry-prep .entry-body {
    display: grid;
    grid-template-columns: minmax(0, 56fr) minmax(0, 44fr);
    grid-template-rows: minmax(0, 1fr);
    align-items: center;
    overflow: hidden;
    padding: 0 var(--entry-content-inline) 4px;
  }

  .entry-prep .entry-body .sect {
    min-width: 0;
    padding: 4px 0 0;
  }

  .entry-prep .judge-section {
    grid-column: 1;
  }

  .entry-prep .difficulty-section {
    grid-column: 2;
    margin-top: 0;
    margin-left: 16px;
  }

  .entry-prep .judge-card .por {
    height: 70px;
  }

  .entry-prep .judge-card .meta {
    padding: 5px 8px 6px;
  }

  .entry-prep .judge-card .nm {
    font-size: 15px;
  }

  .entry-prep .judge-card .quote {
    margin-top: 2px;
    min-height: 0;
    line-height: 1.3;
  }

  .entry-prep .choice-chip {
    padding: 6px 8px;
  }

  .entry-prep .choice-chip .md {
    margin-top: 2px;
    line-height: 1.3;
  }

  .entry-prep .choice-chip .badge {
    margin-top: 3px;
  }

  .entry-prep .entry-footer {
    width: min(620px, 72%);
    margin: 0 auto;
    padding-top: 4px;
    padding-bottom: var(--entry-footer-bottom);
  }

  .sheet,
  .verdict-pop {
    left: 18%;
    right: 18%;
  }
}

/* 600~699px 가로 창은 짧은 가로 재배치와 세로 압축 사이의 공백이다.
   각 진입 화면은 세로 구조를 유지한 채 내용만 압축해 44px 입력면과 무스크롤을 함께 지킨다. */
@media (orientation: landscape) and (min-height: 600px) and (max-height: 699px) {
  .entry-mode .entry-header {
    padding: calc(14px + env(safe-area-inset-top, 0px)) var(--entry-content-inline) 7px;
  }

  .entry-mode .entry-header .rule2 {
    margin-bottom: 8px;
  }

  .entry-mode .entry-header .h {
    font-size: 22px;
  }

  .entry-mode .entry-footer {
    padding-top: 6px;
  }

  .entry-prep .entry-header {
    padding: calc(16px + env(safe-area-inset-top, 0px)) var(--entry-content-inline) 8px;
  }

  .entry-prep .entry-header .rule2 {
    margin-bottom: 8px;
  }

  .entry-prep .entry-header .h {
    font-size: 22px;
  }

  .entry-prep .judge-card .por {
    height: 96px;
  }

  .entry-prep .judge-card .meta {
    padding: 7px 9px 8px;
  }

  .entry-prep .judge-card .quote {
    margin-top: 3px;
    line-height: 1.4;
  }

  .entry-prep .entry-body .sect + .sect {
    margin-top: 14px;
  }

  .entry-prep .entry-footer {
    padding-top: 8px;
  }

  .entry-lobby .entry-header {
    padding: calc(8px + env(safe-area-inset-top, 0px)) var(--entry-content-inline) 2px;
  }

  .entry-lobby .entry-header .rule2 {
    margin-bottom: 4px;
  }

  .entry-lobby .entry-footer {
    padding-top: 4px;
  }

  .entry-lobby .entry-footer .btn-gold {
    height: var(--tap-target);
  }

  .entry-lobby .entry-footer .entry-text-action {
    margin-top: 0;
  }

  .entry-lobby .entry-body[data-state="host"] {
    justify-content: flex-start;
  }

  .entry-lobby .entry-body[data-state="host"] .lobby-code-panel {
    padding: 6px 10px;
  }

  .entry-lobby .entry-body[data-state="host"] .lobby-code-panel > * + *,
  .entry-lobby .entry-body[data-state="host"] .lobby-code-field > * + * {
    margin-top: 3px;
  }

  .entry-lobby .entry-body[data-state="host"] .room-code {
    height: var(--tap-target);
    font-size: 24px;
  }

  .entry-lobby .entry-body[data-state="host"] .lobby-player-line {
    font-size: 15px;
    line-height: 1.2;
  }

  .entry-lobby .entry-body[data-state="host"] .lobby-status,
  .entry-lobby .entry-body[data-state="host"] .lobby-judge-block {
    margin-top: 4px;
  }

  .entry-lobby .entry-body[data-state="host"] .lobby-judge-block > .lobby-lb {
    margin-bottom: 4px;
  }

  .entry-lobby .entry-body[data-state="host"] .lobby-judge-row {
    flex-direction: column;
  }

  .entry-lobby .entry-body[data-state="host"] .judge-card + .judge-card {
    margin-top: 6px;
    margin-left: 0;
  }

  .entry-lobby .entry-body[data-state="host"] .judge-card {
    flex-direction: row;
    min-height: 0;
  }

  .entry-lobby .entry-body[data-state="host"] .judge-card .por {
    width: 64px;
    height: auto;
    min-height: 72px;
    flex: 0 0 64px;
    margin: 0 0 0 4px;
  }

  .entry-lobby .entry-body[data-state="host"] .judge-card .meta {
    flex: 1 1 auto;
    min-width: 0;
    padding: 4px 7px;
  }

  .entry-lobby .entry-body[data-state="host"] .judge-card .role,
  .entry-lobby .entry-body[data-state="host"] .judge-card .nm,
  .entry-lobby .entry-body[data-state="host"] .judge-card .quote {
    line-height: 1.2;
  }

  .entry-lobby .entry-body[data-state="host"] .judge-card .nm,
  .entry-lobby .entry-body[data-state="host"] .judge-card .quote {
    margin-top: 1px;
  }
}

@media (any-pointer: coarse) {
  html[data-text-entry="true"] .entry-lobby .entry-body:focus-within {
    overflow-y: auto;
    justify-content: flex-start;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .law-tool,
  .ob .skip,
  .head-close,
  .confirm-bar .note .info-hit {
    min-width: var(--tap-target);
    min-height: var(--tap-target);
  }
}

/* 감소 모션 — 컷인·비행·스태거 제거, 상태만 갱신 */
@media (prefers-reduced-motion: reduce) {
  .pc,
  .card,
  .sheet,
  .judge-say,
  .fly-card,
  .cutin {
    transition: none !important;
    animation: none !important;
  }
}
