/* =====================================================================
   Puck Dribble Trainer — design system
   컨셉: 종이 바탕 + 잉크 블랙 + 포인트 레드 한 색. 타이포그래피가 주인공.
   - Display: Fraunces / Noto Serif KR (굵은 세리프 — 숫자·제목)
   - Text:    Poppins / Noto Sans KR
   - Accent:  Caveat / Nanum Pen Script (필기체, 항상 레드, 한 화면에 한두 번만)
   캔버스용 같은 값은 src/theme.js 에 있음.
   ===================================================================== */
:root {
  --paper: #F4F1EA;
  --paper-2: #EAE5D9;
  --ink: #161616;
  --ink-soft: #4A4741;
  --mute: #8C877C;
  --red: #E03C31;      /* PANTONE 179 C */
  --yellow: #FFC72C;   /* PANTONE 123 C — 수집 아이템 전용 */
  --line: 1.5px;
  --radius: 18px;
  --display: "Fraunces", "Noto Serif KR", Georgia, serif;
  --sans: "Poppins", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  --script: "Caveat", "Nanum Pen Script", cursive;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  overscroll-behavior: none; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
button, input, select, textarea { font: inherit; color: inherit; }
select, select option, input, textarea { color: var(--ink); }
select option, select optgroup { background-color: var(--paper); color: var(--ink); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
input::placeholder { color: var(--mute); opacity: 1; }
.hidden { display: none !important; }
.script { font-family: var(--script); color: var(--red); font-weight: 700; font-size: 1.45em; line-height: 1; }

h1, h2, h3 { font-family: var(--display); font-weight: 900; font-variation-settings: "SOFT" 100; letter-spacing: -0.01em; margin: 0; }

#app { position: fixed; inset: 0; overflow: hidden; }

/* ---------- 스테이지 (카메라) ---------- */
#stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--paper-2); }
.view { position: relative; max-width: 100%; max-height: 100%; aspect-ratio: 4 / 3; width: 100%; }
.view video, .view canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.view video { object-fit: fill; background: var(--ink); transition: filter 0.4s; }
.view.mirror video { transform: scaleX(-1); }
.view.mouse-mode video { visibility: hidden; }
.view.mouse-mode { background: var(--paper); }
.splash .btn.btn-mouse { display: block; margin: 12px auto 0; font-size: 15px; min-height: 48px; padding: 12px 28px; }
.view.calibrating { cursor: crosshair; }
/* 플레이 중에는 영상을 차분하게 눌러 잉크·레드 오버레이가 주인공이 되게 */
#app.playing .view video { filter: saturate(0.4) contrast(0.96) brightness(1.04); }
#overlay { pointer-events: none; }
#debug { pointer-events: none; opacity: 0.55; mix-blend-mode: multiply; }

#floor-handles .handle { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  border: 2px solid var(--ink); background: rgba(244, 241, 234, 0.85); padding: 0; touch-action: none; z-index: 4; box-shadow: 0 0 0 4px rgba(244, 241, 234, 0.5); }
#floor-handles .handle::before { content: ""; position: absolute; inset: 15px; border-radius: 50%; background: var(--red); }
#floor-handles .handle:active { background: var(--paper); transform: scale(1.1); }
#floor-handles .handle::after { content: attr(data-label); position: absolute; left: 50%; top: 100%; transform: translate(-50%, 8px);
  white-space: nowrap; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; color: var(--paper); background: var(--ink); padding: 3px 10px; border-radius: 999px; pointer-events: none; }
#floor-handles .handle[data-i="0"]::after, #floor-handles .handle[data-i="1"]::after { top: auto; bottom: 100%; transform: translate(-50%, -8px); }

/* 자유 연습 코스 편집: 번호 원을 끌어다 놓는다 */
.course { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.course-field { position: absolute; pointer-events: none; }
.course-tray { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 10px; padding: 7px 12px; flex-wrap: wrap;
  background: rgba(244, 241, 234, 0.94); border-bottom: 1px solid var(--ink); pointer-events: auto; }
.course-slots { display: flex; gap: 6px; flex-wrap: wrap; min-height: 40px; align-items: center; }
.course-hint { font-size: 12px; color: var(--ink-soft); margin-left: auto; }
.course-tray .btn { min-height: 32px; padding: 4px 10px; font-size: 12.5px; }
/* 목표 사이클 수 조절: − 10 + */
.course-cycles { display: inline-flex; align-items: center; gap: 0; border: var(--line) solid var(--ink); border-radius: 999px; overflow: hidden; height: 34px; }
.course-cycles span { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; color: var(--ink-soft); padding: 0 10px 0 12px; }
.course-cycles button { border: 0; border-left: var(--line) solid var(--ink); background: transparent; width: 34px; height: 100%; font-size: 18px; font-weight: 600; cursor: pointer; padding: 0; }
.course-cycles button:hover { background: var(--ink); color: var(--paper); }
.course-cycles button:disabled { opacity: 0.3; cursor: default; background: transparent; color: var(--ink); }
.course-cycles output { font-family: var(--display); font-weight: 900; font-size: 17px; min-width: 44px; text-align: center; border-left: var(--line) solid var(--ink); align-self: stretch; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.course-pt { width: 40px; height: 40px; border-radius: 50%; border: var(--line) solid var(--ink); background: var(--paper); color: var(--ink); padding: 0;
  font-family: var(--display); font-weight: 900; font-size: 17px; line-height: 1; display: grid; place-items: center; cursor: grab; pointer-events: auto; touch-action: none; flex: none;
  box-shadow: 0 0 0 calc(var(--dwell, 0) * 9px) rgba(224, 60, 49, 0.45); transition: background 0.15s, color 0.15s; }
.course-field > .course-pt, .course > .course-pt { position: absolute; margin: -20px 0 0 -20px; }
.course-pt.dragging { cursor: grabbing; transform: scale(1.15); z-index: 6; }
.course-pt.next { background: var(--red); border-color: var(--red); color: var(--paper); }
.course-pt.done { background: var(--ink); color: var(--paper); }
.course.running .course-tray { display: none; }
.course.running .course-pt { pointer-events: none; cursor: default; }

.tap-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--paper);
  border: var(--line) solid var(--ink); border-radius: 999px; padding: 12px 24px; font-size: 16px; font-weight: 600; text-align: center; pointer-events: none; }

/* ---------- HUD: 종이 띠 + 큰 세리프 숫자 ---------- */
.hud { position: absolute; top: 0; left: 0; right: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: calc(var(--safe-top) + 8px) calc(var(--safe-right) + 18px) 8px calc(var(--safe-left) + 18px); pointer-events: none;
  background: rgba(244, 241, 234, 0.92); border-bottom: var(--line) solid var(--ink); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.hud-left { display: flex; flex-direction: column; min-width: 0; }
.hud-mode { font-family: var(--display); font-weight: 900; font-variation-settings: "SOFT" 100; font-size: 22px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-instruction { color: var(--ink-soft); font-size: 13px; min-height: 1.4em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-label { font-size: 10px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--mute); line-height: 1; }
.hud-center { display: flex; flex-direction: column; align-items: center; }
.hud-timer { font-family: var(--display); font-weight: 900; font-variation-settings: "SOFT" 100; font-variant-numeric: tabular-nums; font-size: 38px; line-height: 1; }
.hud-timer.urgent { color: var(--red); }
.hud-right { display: grid; grid-template-columns: auto auto; justify-content: end; align-items: baseline; column-gap: 12px; text-align: right; }
.hud-right .hud-label { grid-column: 1 / -1; }
.hud-score { grid-column: 2; grid-row: 2; font-family: var(--display); font-weight: 900; font-variation-settings: "SOFT" 100; font-variant-numeric: tabular-nums; font-size: 38px; line-height: 1; }
.hud-combo { grid-column: 1; grid-row: 2; font-family: var(--script); font-weight: 700; color: var(--red); font-size: 26px; line-height: 1; white-space: nowrap; transform: rotate(-4deg); }
.hud-lives { grid-column: 1 / -1; font-size: 12px; font-weight: 600; color: var(--red); min-height: 0; }
.hud-lives.info { color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.btn-flip { position: absolute; right: calc(var(--safe-right) + 14px); top: calc(var(--safe-top) + 84px); width: 44px; height: 44px; border-radius: 50%;
  border: var(--line) solid var(--ink); background: rgba(244, 241, 234, 0.92); display: grid; place-items: center; cursor: pointer; padding: 0; }
.btn-flip svg { width: 22px; height: 22px; stroke: var(--ink); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.btn-flip:active { transform: rotate(180deg); transition: transform 0.25s; }
.btn-replace { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-bottom) + 92px); z-index: 5; }

.area-bar { position: absolute; left: var(--safe-left); right: var(--safe-right); top: calc(var(--safe-top) + 76px); display: flex; flex-direction: column; gap: 8px; align-items: center;
  padding: 10px 14px; z-index: 5; pointer-events: none; }
.area-bar .area-hint { background: var(--paper); border: var(--line) solid var(--ink); border-radius: 999px; padding: 8px 18px; font-size: 13px; max-width: 760px; text-align: center; }
.area-bar .setup-step { color: var(--red); font-weight: 700; margin-right: 8px; white-space: nowrap; }
.area-bar .area-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; pointer-events: auto; }

/* ---------- 상태 칩: 테두리 알약 + 점 ---------- */
.status { position: absolute; left: calc(var(--safe-left) + 14px); bottom: calc(var(--safe-bottom) + 84px); display: flex; gap: 6px; pointer-events: none; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(244, 241, 234, 0.92); border: 1px solid var(--ink); border-radius: 999px; padding: 3px 10px; font-size: 11.5px; font-weight: 500; }
.chip i { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--ink); background: transparent; }
.chip.ok i { background: var(--ink); }
.chip.warn i { background: var(--yellow); }
.chip.bad i { background: var(--red); border-color: var(--red); }
.chip-fps { color: var(--mute); border-color: transparent; background: transparent; font-variant-numeric: tabular-nums; }
#app.playing .status, #app.playing .btn-flip { display: none; }

/* ---------- 버튼: 알약 ---------- */
.btn { border: var(--line) solid var(--ink); background: var(--paper); color: var(--ink); border-radius: 999px;
  padding: 10px 20px; font-size: 14.5px; font-weight: 600; min-height: 44px; cursor: pointer; letter-spacing: 0.01em; transition: background 0.15s, color 0.15s, transform 0.1s; }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--red); border-color: var(--red); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-soft); padding-left: 12px; padding-right: 12px; }
.btn-ghost:hover { background: transparent; color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.btn.active { background: var(--ink); color: var(--paper); }
.btn-big { font-size: 18px; padding: 16px 40px; min-height: 58px; background: var(--red); border-color: var(--red); color: var(--paper); }
.btn-big:hover { background: var(--ink); border-color: var(--ink); }
.btn-close { padding: 6px 12px; min-height: 36px; }

/* ---------- 하단 컨트롤 ---------- */
.controls { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; justify-content: center; align-items: center;
  padding: 10px calc(var(--safe-right) + 14px) calc(var(--safe-bottom) + 12px) calc(var(--safe-left) + 14px);
  background: rgba(244, 241, 234, 0.92); border-top: var(--line) solid var(--ink); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
#btn-start { background: var(--red); border-color: var(--red); color: var(--paper); padding-left: 30px; padding-right: 30px; margin-left: 6px; }
#btn-start:hover { background: var(--ink); border-color: var(--ink); }
#btn-start.stop { background: var(--ink); border-color: var(--ink); }
/* 플레이 중: 띠를 걷고 '중지'만 남긴다 */
#app.playing .controls { background: transparent; border-top-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; justify-content: flex-end; pointer-events: none; }
#app.playing .controls .btn:not(#btn-start) { display: none; }
#app.playing #btn-start { pointer-events: auto; min-height: 38px; padding: 6px 18px; font-size: 13px; opacity: 0.9; }

/* ---------- 패널 공통 ---------- */
.panel { position: absolute; inset: 0; z-index: 10; }
.muted { color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.error { color: var(--red) !important; white-space: pre-line; font-size: 13.5px; }
.row { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; align-items: center; }

/* ---------- 시작 화면: 포스터 ---------- */
.splash { background: var(--paper); display: flex; justify-content: center; padding: calc(var(--safe-top) + 22px) 24px calc(var(--safe-bottom) + 28px); overflow: auto; }
.splash-inner { width: min(760px, 100%); text-align: center; margin: auto 0; }
.masthead { display: flex; justify-content: flex-end; font-size: 13px; font-weight: 500; letter-spacing: 0.02em; color: var(--ink); margin-bottom: clamp(10px, 3vh, 28px); }
.lockup { position: relative; display: inline-block; font-size: clamp(50px, min(13vw, 13vh), 112px); line-height: 0.92; letter-spacing: -0.03em; margin: 0 0 0.3em; }
.lockup-script { position: absolute; right: -0.06em; bottom: -0.52em; font-family: var(--script); font-weight: 700; font-variation-settings: normal; color: var(--red);
  font-size: 0.62em; letter-spacing: 0; transform: rotate(-7deg); white-space: nowrap; }
.hero-art { display: block; width: min(360px, 74%); height: auto; max-height: 26vh; object-fit: contain; margin: clamp(10px, 2.4vh, 28px) auto clamp(6px, 1.6vh, 14px); }
.lead { display: inline-block; border: var(--line) solid var(--ink); border-radius: 28px; padding: 9px 24px; font-size: clamp(13px, 2.2vw, 15.5px); margin: 0 0 18px; max-width: 100%; text-wrap: balance; }
.howto { text-align: left; margin: 18px auto 0; max-width: 620px; border-top: 1px solid var(--ink); }
.copyright { margin: 14px auto 0; font-size: 11px; color: var(--ink-soft); letter-spacing: .02em; }
/* 공식 주소가 아닐 때 (src/guard.js) */
.guard-stop { max-width: 520px; margin: 20vh auto 0; padding: 0 16px; text-align: center; font-size: 16px; line-height: 1.6; }
.guard-stop a { word-break: break-all; }
.howto summary { cursor: pointer; list-style: none; padding: 12px 2px; font-weight: 600; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.howto summary::-webkit-details-marker { display: none; }
.howto summary::after { content: "+"; font-family: var(--display); font-size: 22px; line-height: 1; }
.howto[open] summary::after { content: "–"; }
.tips { margin: 0 0 8px; padding: 0; list-style: none; counter-reset: tip; font-size: 13.5px; color: var(--ink-soft); }
.tips li { counter-increment: tip; display: grid; grid-template-columns: 34px 1fr; padding: 8px 0; border-top: 1px solid rgba(22, 22, 22, 0.12); }
.tips li::before { content: counter(tip, decimal-leading-zero); font-family: var(--display); font-weight: 900; color: var(--ink); font-size: 15px; }
.tips b { color: var(--ink); font-weight: 600; }

/* 초대 링크(?c=코드)로 들어왔을 때 */
.invite-card { display: flex; flex-direction: column; gap: 4px; max-width: 620px; margin: 4px auto 14px; padding: 12px 18px; text-align: left;
  border: var(--line) solid var(--red); border-radius: var(--radius); background: var(--paper); }
.invite-card b { font-family: var(--display); font-weight: 900; font-variation-settings: "SOFT" 100; font-size: 22px; line-height: 1.15; color: var(--red); }
.invite-card span { font-size: 14px; color: var(--ink-soft); }
.invite-card.bad { border-color: var(--ink); }
.invite-card.bad b { color: var(--ink); }
.auth-hint { margin: 10px 0 0; font-size: 12px; line-height: 1.5; color: var(--mute); }
/* 정회원 배지: '베타 멤버 No.0007' */
.member-badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; line-height: 1.5; color: var(--paper); background: var(--red);
  border-radius: 999px; padding: 1px 9px; margin-left: 4px; vertical-align: 3px; white-space: nowrap; }
/* 베타 상태 칩: 의견 보내고 정회원 유지 / 정회원 유지 / 베타 종료 (누르면 개발자에게) */
.beta-chip { display: inline-block; font: inherit; font-size: 11px; font-weight: 700; line-height: 1.5; color: var(--red); background: transparent;
  border: 1.5px dashed var(--red); border-radius: 999px; padding: 0 9px; margin-left: 6px; vertical-align: 2px; white-space: nowrap; cursor: pointer; }
.beta-chip.ok { border-style: solid; color: var(--ink-soft); border-color: var(--ink-soft); cursor: default; }
.beta-chip.bad { border-style: solid; color: var(--paper); background: var(--ink-soft); border-color: var(--ink-soft); }

.auth-card { text-align: left; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 14px 2px; margin: 0 auto 18px; max-width: 620px; }
.auth-card .muted { margin: 10px 0 0; font-size: 12px; }
.auth-card .row { margin-top: 12px; }
.auth-tabs { display: flex; gap: 22px; margin-bottom: 14px; }
.auth-tabs .tab { padding: 2px 0 4px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--mute);
  font-family: var(--display); font-weight: 900; font-variation-settings: "SOFT" 100; font-size: 22px; cursor: pointer; }
.auth-tabs .tab.active { color: var(--ink); border-bottom-color: var(--red); }
.auth-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px 14px; }
.auth-grid label, .settings-grid label, .diag label { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; color: var(--ink-soft); }
.auth-grid input, .auth-grid select, .settings-grid select, .rank-filters select, .diag select, .versus-names input, .comm-mode {
  font-size: 15px; font-weight: 500; letter-spacing: 0; padding: 10px 14px; border-radius: 12px; border: var(--line) solid var(--ink); background: var(--paper); color: var(--ink); width: 100%; }
.auth-logged { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--ink-soft); }
.auth-logged #auth-who { flex: 1 1 260px; }
.auth-logged b { font-family: var(--display); font-weight: 900; font-size: 22px; color: var(--ink); margin-right: 6px; }

.diag { text-align: left; border: var(--line) solid var(--red); border-radius: var(--radius); padding: 14px 16px; margin: 14px auto 0; max-width: 620px; }
.diag-info { font-size: 11.5px; color: var(--ink-soft); white-space: pre-wrap; margin: 10px 0 0; max-height: 140px; overflow: auto; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---------- 모달: 종이 카드 ---------- */
.modal { background: rgba(244, 241, 234, 0.78); display: flex; align-items: center; justify-content: center; padding: 20px; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.modal-card { background: var(--paper); border: var(--line) solid var(--ink); border-radius: 26px; width: min(820px, 100%); max-height: 100%; overflow: auto; padding: 22px 26px 26px; }
.modal-card header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--ink); }
.modal-card h2 { font-size: 30px; line-height: 1.1; }

/* 모드: 번호 + 세리프 제목 */
.seg { display: inline-flex; border: var(--line) solid var(--ink); border-radius: 999px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 8px 18px; font-weight: 600; font-size: 14px; cursor: pointer; min-height: 38px; }
.seg button + button { border-left: var(--line) solid var(--ink); }
.seg button.active { background: var(--ink); color: var(--paper); }
.time-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.time-row .muted { margin: 0; }
/* 3×3 배치: 가운데(5번)는 퍽이 대기하는 자리라 비워 둔다. 9번은 Coming soon */
.mode-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 10px; } /* 모든 칸 같은 높이 */
.mode-wait, .mode-soon { border-radius: var(--radius); min-height: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--mute); font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.mode-wait i { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--mute); }
.mode-soon { border: 1px solid rgba(22, 22, 22, 0.22); align-items: flex-start; justify-content: flex-start; padding: 14px 16px; text-transform: none; letter-spacing: 0; }
.mode-soon .no { font-family: var(--display); font-weight: 900; font-size: 14px; }
.mode-soon b { font-family: var(--script); font-weight: 700; font-size: 30px; line-height: 1; color: var(--red); margin-top: 10px; transform: rotate(-4deg); }
.mode-card { position: relative; text-align: left; background: var(--paper); border: var(--line) solid var(--ink); border-radius: var(--radius); padding: 14px 16px 16px; cursor: pointer;
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto auto 1fr auto; align-content: stretch; align-items: start; row-gap: 2px; transition: background 0.15s, color 0.15s; }
/* 번호·시간 / 제목 / 영문 / 설명 / best 를 모든 카드에서 같은 줄에 */
.mode-card .no { grid-row: 1; grid-column: 1; }
.mode-card .time { grid-row: 1; grid-column: 2; }
.mode-card b { grid-row: 2; }
.mode-card em { grid-row: 3; }
.mode-card small { grid-row: 4; }
.mode-card .best { grid-row: 5; align-self: end; }
.mode-card { overflow: hidden; }
.mode-card:hover, .mode-card.hover { background: var(--paper-2); }
.mode-card.selected.hover { background: var(--ink); }
/* 퍽 커서가 머무는 동안 아래에서 차오르는 진행 띠 */
.mode-card::after { content: ""; position: absolute; left: 0; bottom: 0; height: 5px; width: var(--dwell, 0%); background: var(--red); transition: width 0.12s linear; }
.pick-hint { margin: 0 0 12px; }
.pick-cursor { position: fixed; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--red);
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--ink); pointer-events: none; z-index: 30; transition: left 0.08s linear, top 0.08s linear; }
.mode-card .no { font-family: var(--display); font-weight: 900; font-size: 14px; color: var(--mute); }
.mode-card .time { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; border: 1px solid currentColor; border-radius: 999px; padding: 1px 9px; align-self: start; }
.mode-card b { grid-column: 1 / -1; font-family: var(--display); font-weight: 900; font-variation-settings: "SOFT" 100; font-size: 23px; line-height: 1.15; margin-top: 6px; }
.mode-card em { grid-column: 1 / -1; font-style: normal; font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mute); }
.mode-card small { grid-column: 1 / -1; color: var(--ink-soft); font-size: 12.5px; line-height: 1.5; margin-top: 6px; }
.mode-card .best { grid-column: 1 / -1; font-family: var(--script); font-weight: 700; font-size: 22px; color: var(--red); line-height: 1; margin-top: 8px; }
.mode-card.selected { background: var(--ink); color: var(--paper); }
.mode-card.selected small, .mode-card.selected em, .mode-card.selected .no { color: rgba(244, 241, 234, 0.72); }
.versus-row { margin-top: 16px; padding-top: 12px; border-top: 1px solid rgba(22, 22, 22, 0.15); display: grid; gap: 10px; }
.versus-row .versus-names { margin-top: 0; }
.invisible-switch span { line-height: 1.4; }
.inv-tag { display: inline-block; border: 1px solid var(--ink); border-radius: 999px; padding: 0 8px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; color: var(--ink); background: var(--paper); vertical-align: middle; }
.versus-names { display: flex; gap: 10px; margin-top: 10px; }

.switch { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--ink); }
.switch input { width: 20px; height: 20px; accent-color: var(--ink); }

.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px 22px; }
.settings-grid label.switch { flex-direction: row; font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--ink); }
.settings-grid output { float: right; margin-left: 6px; font-family: var(--display); font-weight: 900; font-size: 14px; color: var(--ink); letter-spacing: 0; }
input[type="range"] { accent-color: var(--ink); height: 30px; width: 100%; }

.calib-grid { display: grid; margin-top: 10px; }
.calib-item { display: grid; grid-template-columns: 36px 1fr auto auto auto; gap: 10px; align-items: center; padding: 12px 0; border-top: 1px solid rgba(22, 22, 22, 0.15); }
.calib-item b { font-family: var(--display); font-weight: 900; font-size: 18px; }
.calib-item small { display: block; color: var(--ink-soft); font-size: 12px; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: var(--line) solid var(--ink); background: #000; }
.swatch.none { background: repeating-linear-gradient(45deg, var(--paper) 0 5px, var(--paper-2) 5px 10px); }

/* 랭킹: 표 = 얇은 괘선 + 세리프 숫자 */
.rank-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.rank-filters select { flex: 1; min-width: 110px; width: auto; }
.rank-table-wrap { max-height: 52vh; overflow: auto; }
.rank-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rank-table th { position: sticky; top: 0; background: var(--paper); text-align: left; font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mute); padding: 8px; border-bottom: var(--line) solid var(--ink); }
.rank-table td { padding: 10px 8px; border-bottom: 1px solid rgba(22, 22, 22, 0.14); white-space: nowrap; }
.rank-table td:first-child { font-family: var(--display); font-weight: 900; font-size: 18px; width: 44px; }
.rank-table td:nth-child(2) { font-weight: 600; }
.rank-table td:last-child, .rank-table th:last-child { text-align: right; font-family: var(--display); font-weight: 900; font-variant-numeric: tabular-nums; }
.rank-table td:last-child { font-size: 18px; }
.rank-table tr.top1 td:first-child, .rank-table tr.top2 td:first-child, .rank-table tr.top3 td:first-child { color: var(--red); }
.rank-table tr.me td { background: var(--paper-2); }
.rank-table tr.me td:first-child { box-shadow: inset 3px 0 0 var(--red); }

/* 결과: 큰 숫자 */
.result-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 22px; }
.stat { padding: 10px 0 12px; border-top: 1px solid rgba(22, 22, 22, 0.18); }
.stat small { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute); }
.stat b { font-family: var(--display); font-weight: 900; font-variation-settings: "SOFT" 100; font-size: 30px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat:first-child b, .stat.full b { font-size: 56px; }
.stat.full { grid-column: 1 / -1; border-top: 0; }
.stat.winner small { font-family: var(--script); font-size: 26px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--red); }
.stat.winner b { color: var(--red); }
.result-rank { margin: 14px 0 0; font-size: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* 게임 종료 후 선택: 왼쪽 = 한 번 더, 오른쪽 = 모드 선택 (퍽을 2초 두면 채워지며 실행) */
.choice { display: grid; grid-template-columns: 1fr minmax(110px, 1.1fr) 1fr; gap: 14px; align-items: stretch; margin-top: 20px; }
.choice-opt { position: relative; overflow: hidden; border: var(--line) solid var(--ink); border-radius: var(--radius); background: var(--paper); color: var(--ink);
  padding: 12px 18px; min-height: 72px; cursor: pointer; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; text-align: left; transition: transform 0.1s; }
.choice-opt.right { align-items: flex-end; text-align: right; }
.choice-opt:active { transform: scale(0.98); }
.choice-opt > :not(.choice-fill) { position: relative; }
.choice-fill { position: absolute; top: 0; bottom: 0; left: 0; width: 0; background: var(--red); transition: width 0.12s linear; }
.choice-opt.right .choice-fill { left: auto; right: 0; }
.choice-label { font-family: var(--display); font-weight: 900; font-variation-settings: "SOFT" 100; font-size: 24px; line-height: 1.15; }
.choice-opt small { font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; color: var(--ink-soft); }
.choice-opt.filling, .choice-opt.filling small { color: var(--paper); }
.choice-opt.left:not(.hidden) { background: var(--ink); color: var(--paper); }
.choice-opt.left small { color: rgba(244, 241, 234, 0.75); }
.choice-track { position: relative; align-self: center; height: 56px; }
.choice-track::before { content: ""; position: absolute; left: 0; right: 0; top: 22px; border-top: 1px solid var(--ink); }
.choice-track .zone { position: absolute; top: 20px; height: 5px; background: var(--ink); border-radius: 3px; }
.choice-track .zone-l { left: 0; width: 33%; }
.choice-track .zone-r { right: 0; width: 33%; }
#choice-dot { position: absolute; top: 22px; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px var(--paper); transition: left 0.08s linear; }
.choice-track small { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font-size: 11px; color: var(--mute); white-space: nowrap; }

.toast { position: absolute; left: 50%; top: calc(var(--safe-top) + 96px); transform: translateX(-50%); background: var(--ink); color: var(--paper);
  border-radius: 22px; padding: 10px 22px; font-size: 14px; font-weight: 500; z-index: 20; pointer-events: none; width: max-content; max-width: min(92vw, 720px); text-align: center; text-wrap: balance; animation: toast-in 0.2s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (orientation: portrait) {
  .controls { flex-wrap: wrap; }
}

/* ---------- 휴대폰(좁은 화면) ---------- */
@media (max-width: 600px) {
  .hud { padding-left: calc(var(--safe-left) + 12px); padding-right: calc(var(--safe-right) + 12px); gap: 8px; }
  .hud-mode { font-size: 16px; }
  .hud-instruction { font-size: 11px; }
  .hud-timer, .hud-score { font-size: 26px; }
  .hud-combo { font-size: 19px; }
  .btn { padding: 8px 13px; font-size: 13px; min-height: 40px; }
  .btn-big { font-size: 17px; padding: 14px 34px; min-height: 54px; }
  .controls { gap: 6px; padding-top: 8px; }
  #btn-start { padding-left: 22px; padding-right: 22px; margin-left: 0; }
  .status { bottom: calc(var(--safe-bottom) + 112px); left: 10px; max-width: 72%; }
  .btn-flip { top: calc(var(--safe-top) + 68px); width: 40px; height: 40px; }
  .modal { padding: 10px; }
  .modal-card { padding: 16px 16px 20px; border-radius: 20px; }
  .modal-card h2 { font-size: 24px; }
  .settings-grid { grid-template-columns: 1fr; }
  .mode-list { gap: 6px; }
  .mode-card { padding: 9px 9px 11px; border-radius: 14px; }
  .mode-card b { font-size: 15px; margin-top: 4px; }
  .mode-card em, .mode-card small { display: none; }
  .mode-card .time { font-size: 9.5px; padding: 0 6px; }
  .mode-card .best { font-size: 16px; margin-top: 4px; }
  .mode-wait, .mode-soon { min-height: 70px; }
  .mode-soon { padding: 9px; }
  .mode-soon b { font-size: 20px; }
  .course-pt { width: 32px; height: 32px; font-size: 14px; }
  .course-field > .course-pt, .course > .course-pt { margin: -16px 0 0 -16px; }
  .course-slots { gap: 4px; min-height: 32px; }
  .course-hint { display: none; }
  .calib-item { grid-template-columns: 32px 1fr; }
  .stat:first-child b, .stat.full b { font-size: 44px; }
  .choice { grid-template-columns: 1fr 1fr; gap: 10px; }
  .choice-track { grid-column: 1 / -1; grid-row: 1; }
  .choice-label { font-size: 19px; }
  .choice-opt { min-height: 62px; padding: 10px 14px; }
  .masthead { font-size: 11.5px; }
}

/* ---------- 언어 전환 (한국어 | English) ---------- */
.lang-row { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.lang-seg { font-family: var(--sans); }
.lang-seg button { padding: 5px 14px; min-height: 32px; font-size: 12.5px; color: var(--ink); }
.settings-grid .lang-seg { align-self: flex-start; }
html[lang="en"] .mode-card em { display: none; }           /* 영어에서는 제목과 영문 부제가 겹치므로 숨김 */

/* ---------- 커뮤니티 ---------- */
.mode-community .time { border-color: var(--red); color: var(--red); }
.mode-community b { color: var(--red); }
.modal-card.community { width: min(1140px, 100%); }
.comm-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.comm-bar .comm-mode { width: auto; min-width: 150px; flex: 1 1 150px; max-width: 220px; padding: 8px 12px; font-size: 14px; }
.comm-bar #comm-write { margin-left: auto; }
/* 글 목록(왼쪽) + 상위 5위(오른쪽, 고정) */
.comm-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 330px); gap: 24px; align-items: start; }
.comm-detail { position: sticky; top: 0; margin-top: 12px; border: var(--line) solid var(--ink); border-radius: 18px; padding: 16px 16px 18px; background: var(--paper); }
.post .post-detail { display: none; }
.detail-empty { margin: 0; font-size: 13px; line-height: 1.6; color: var(--mute); }
.detail-head h4 { font-family: var(--display); font-weight: 900; font-variation-settings: "SOFT" 100; font-size: 20px; line-height: 1.2; margin: 8px 0 2px; overflow-wrap: anywhere; }
.detail-head small { font-size: 10.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute); }
.detail-count { display: flex; align-items: baseline; gap: 6px; margin: 12px 0 2px; }
.detail-count b { font-family: var(--display); font-weight: 900; font-size: 40px; line-height: 1; color: var(--red); font-variant-numeric: tabular-nums; }
.detail-count span { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.detail-rule { margin: 4px 0 10px; font-size: 12.5px; line-height: 1.55; color: var(--ink-soft); }
.detail-rule b { color: var(--ink); }
.detail-act { margin-top: 14px; }
.post-sum { display: flex; align-items: baseline; gap: 6px 8px; flex-wrap: wrap; margin: 10px 0 0; font-size: 13px; color: var(--ink-soft); }
.post-sum .cnt { font-weight: 700; color: var(--ink); }
.post-sum b { color: var(--ink); font-weight: 600; }
.post-sum strong { font-family: var(--display); font-weight: 900; color: var(--red); font-variant-numeric: tabular-nums; }
.post-sum .age { border: 1px solid var(--mute); border-radius: 999px; padding: 0 8px; font-size: 11px; font-weight: 600; color: var(--mute); }
.post-sum i { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 600; color: var(--red); }
.replace-note { margin: 8px 0 0; font-size: 13px; line-height: 1.5; color: var(--ink-soft); }
.replace-note b { color: var(--ink); }
.replace-note strong { font-family: var(--display); font-weight: 900; color: var(--red); }
#comm-note { margin: 10px 0 0; font-size: 12px; }
.comm-form { margin-top: 14px; padding: 14px 0 16px; border-top: var(--line) solid var(--ink); border-bottom: var(--line) solid var(--ink); display: grid; gap: 12px; }
.comm-form label { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; color: var(--ink-soft); }
.comm-form label output { align-self: flex-end; margin-top: -18px; font-weight: 500; color: var(--mute); }
.comm-form input, .comm-form textarea { font: inherit; font-size: 15px; font-weight: 500; letter-spacing: 0; padding: 10px 14px; border-radius: 12px; border: var(--line) solid var(--ink); background: var(--paper); color: var(--ink); width: 100%; resize: vertical; }
.comm-form .seg { justify-self: start; }
.comm-form .row { margin-top: 0; }
.comm-form .error { margin: 0; }
.comm-preview .muted { margin: 0; }
.comm-list { margin-top: 6px; }
.comm-empty { padding: 24px 0; text-align: center; }
.post { padding: 16px 0 18px; border-top: 1px solid rgba(22, 22, 22, 0.2); cursor: pointer; }
.post.selected { box-shadow: inset 3px 0 0 var(--red); padding-left: 14px; background: linear-gradient(90deg, var(--paper-2), transparent 70%); }
.post:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.post:first-child { border-top: 0; }
.post-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-soft); }
.post-head b { color: var(--ink); font-weight: 600; font-size: 13.5px; }
.post-head time { margin-left: auto; color: var(--mute); font-size: 12px; }
.post-head .who-more { display: inline-flex; gap: 6px; align-items: center; }
.post-head .who-more i { font-style: normal; color: var(--mute); }
.post-head .tag { border: 1px solid var(--mute); border-radius: 999px; padding: 0 8px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; color: var(--mute); }
.post-tag { font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; border: 1px solid var(--ink); border-radius: 999px; padding: 1px 10px; color: var(--ink); }
.post-beat .post-tag, .post-record .post-tag { background: var(--ink); color: var(--paper); }
.post-beat .post-tag { background: var(--red); border-color: var(--red); }
.post h3 { font-family: var(--display); font-weight: 900; font-variation-settings: "SOFT" 100; font-size: 22px; line-height: 1.2; margin: 8px 0 4px; }
.post-body { margin: 0 0 10px; font-size: 14px; line-height: 1.6; color: var(--ink-soft); white-space: pre-line; overflow-wrap: anywhere; }
.course-box { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: start; }
.course-svg { width: 100%; height: auto; display: block; }
.cs-field { fill: var(--paper-2); stroke: var(--ink); stroke-width: 1; }
.cs-line { fill: none; stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 3; }
.cs-dot { fill: var(--paper); stroke: var(--ink); stroke-width: 1.2; }
.cs-dot.first { fill: var(--red); stroke: var(--red); }
.cs-n { font-family: var(--display); font-weight: 900; font-size: 9px; text-anchor: middle; dominant-baseline: central; fill: var(--ink); }
.cs-n.first { fill: var(--paper); }
.post-meta { display: grid; gap: 6px; font-size: 13px; min-width: 0; }
.post-size { font-size: 10.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute); }
.post-meta .t { font-weight: 600; }
.post-empty { margin: 0; color: var(--ink-soft); font-size: 13px; }
.board-title { font-family: var(--script); font-weight: 700; font-size: 20px; line-height: 1; color: var(--red); }
.detail-board { list-style: none; margin: 4px 0 0; padding: 0; }
.detail-board li { display: grid; grid-template-columns: 22px minmax(0, auto) auto auto 1fr auto; gap: 6px; align-items: baseline; padding: 6px 0; border-top: 1px solid rgba(22, 22, 22, 0.12); }
.detail-board li:first-child { border-top: 0; }
.detail-board .rk { font-family: var(--display); font-weight: 900; font-size: 15px; }
.detail-board li b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-board li .jersey { margin-left: 0; }
.detail-board li em { font-style: normal; font-size: 10px; font-weight: 600; letter-spacing: 0.06em; color: var(--mute); border: 1px solid var(--mute); border-radius: 999px; padding: 0 6px; }
.detail-board li em.sp { border: 0; padding: 0; }
.detail-board li .t { grid-column: 5; text-align: right; font-family: var(--display); font-weight: 900; font-variant-numeric: tabular-nums; }
.detail-board li small { grid-column: 6; color: var(--mute); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.detail-board li.holder .rk, .detail-board li.holder .t { color: var(--red); }
.detail-board li.me { background: var(--paper-2); box-shadow: inset 3px 0 0 var(--red); padding-left: 6px; }
.post-taken, .beat-line { margin: 6px 0 0; font-size: 13px; color: var(--ink-soft); }
.post-taken b, .beat-line b { color: var(--ink); }
.beat-line strong { display: block; font-family: var(--display); font-weight: 900; font-size: 20px; color: var(--red); font-variant-numeric: tabular-nums; }
.post-score { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.post-score b { font-family: var(--display); font-weight: 900; font-variation-settings: "SOFT" 100; font-size: 54px; line-height: 1; color: var(--red); font-variant-numeric: tabular-nums; }
.post-score span { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute); }
.post-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.post-foot .cheer.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.post-foot [data-act="delete"] { margin-left: auto; }

/* 좁은 화면: 상위 5위는 오른쪽 대신 누른 글 바로 아래에 */
@media (max-width: 820px) {
  .comm-main { grid-template-columns: 1fr; }
  .comm-detail { display: none; }
  .post.selected .post-detail { display: block; margin-top: 14px; padding: 14px; border: var(--line) solid var(--ink); border-radius: 16px; background: var(--paper); cursor: default; }
}

/* 결과 화면: 커뮤니티 공유 / 코스 도전 결과 */
.result-share { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid rgba(22, 22, 22, 0.18); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.share-msg { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; color: var(--ink-soft); flex: 1 1 260px; }
.share-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.share-msg b { color: var(--ink); }
.share-msg strong { font-family: var(--display); font-weight: 900; font-size: 18px; color: var(--red); font-variant-numeric: tabular-nums; }

@media (max-width: 600px) {
  .lang-row { margin-bottom: 8px; }
  .course-box { grid-template-columns: 104px 1fr; gap: 12px; }
  .post h3 { font-size: 19px; }
  .post-score b { font-size: 42px; }
  .detail-board li { grid-template-columns: 18px minmax(0, 1fr) auto auto; }
  .detail-board li em, .detail-board li .jersey { display: none; }
  .detail-board li .t { grid-column: 3; }
  .detail-board li small { grid-column: 4; }
}

/* 등번호 (#87): 별명 옆 작은 세리프 숫자 */
.jersey { font-family: var(--display); font-weight: 900; font-variant-numeric: tabular-nums; color: var(--red); margin-left: 4px; font-size: 0.95em; }
.rank-table .jersey { font-size: 13px; }
#btn-logout { white-space: nowrap; flex-shrink: 0; }

/* 게스트 결과: 정회원이었다면 몇 위 + 플레이 인증으로 코드 받기 */
.result-guest { margin: 14px 0 0; padding: 12px 16px; border: var(--line) dashed var(--red); border-radius: var(--radius); font-size: 14px; color: var(--ink-soft); }
.result-guest p { margin: 0 0 6px; }
.result-guest p:last-child { margin-bottom: 0; }
.result-guest .guest-rank b { font-family: var(--display); font-weight: 900; font-variation-settings: "SOFT" 100; font-size: 20px; color: var(--ink); }
.result-guest .guest-tags { font-weight: 700; color: var(--red); }
.result-guest .muted { font-size: 12px; }
.guest-dm { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 6px; }
.guest-dm .btn { text-decoration: none; }

/* 개발자에게 (커뮤니티) */
.fb-form h3 { font-size: 20px; margin: 0; }
.fb-form .fb-intro { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink); }
.fb-form .muted { margin: 0; font-size: 12px; }

/* 운영자 화면 */
.adm-sec { padding: 12px 0 14px; border-top: 1px solid rgba(22, 22, 22, 0.18); }
.adm-sec:first-of-type { border-top: 0; padding-top: 0; }
.adm-sec h3 { font-size: 20px; margin-bottom: 4px; }
.adm-sec .muted { margin: 0 0 10px; font-size: 12.5px; }
.adm-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.adm-row label { display: flex; flex-direction: column; gap: 5px; flex: 1 1 160px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; color: var(--ink-soft); }
.adm-row input, .adm-out input, .adm-table input { font-size: 15px; padding: 9px 12px; border-radius: 12px; border: var(--line) solid var(--ink); background: var(--paper); color: var(--ink); min-width: 0; }
.adm-row > input { flex: 1 1 200px; }
.adm-out { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.adm-out b { font-family: var(--display); font-weight: 900; font-size: 22px; letter-spacing: 0.04em; }
.adm-out input { flex: 1 1 240px; font-size: 13px; }
.adm-table td { vertical-align: middle; }
.adm-table tr.dim td { color: var(--mute); }
.adm-table input { font-size: 13px; padding: 4px 8px; border-radius: 8px; }
.adm-acts { white-space: nowrap; }
.adm-acts .btn { min-height: 30px; padding: 3px 10px; font-size: 12px; }
.adm-feedback { display: grid; gap: 10px; max-height: 420px; overflow: auto; }
.fb-item { padding: 10px 12px; border: 1px solid rgba(22, 22, 22, 0.25); border-radius: 12px; font-size: 13.5px; }
.fb-item header { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 4px; }
.fb-item header span, .fb-item header time { font-size: 11.5px; color: var(--mute); }
.fb-item p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-item em { display: block; font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; color: var(--red); }
