/* =========================================================
   디자인 시스템 레이어 (v86)
   기존 style.css · lucian-ui.css 위에 마지막으로 얹어, 화면 전체를 한 가지 규칙으로 정리한다.
   규칙:
   1) 글씨체: 영문·숫자는 Inter(내장), 한글은 기기 기본 고딕. 한글에 기울임(italic)을 쓰지 않는다.
   2) 테두리는 1px 실선 하나, 그림자는 최소. 박스 안에 박스를 겹치지 않는다.
   3) 아이콘은 선 아이콘(SVG)으로 통일. 이모지는 사용자가 고르는 아바타에만.
   4) 강조는 한 화면에 한 곳: 큰 숫자(기록)와 주 버튼 하나.
   5) 방사형 빛살(부챗살) 무늬는 쓰지 않는다.
   색은 토큰에서만 가져온다 → 강조색 변경·라이트 모드가 그대로 동작.
   ========================================================= */
@font-face { font-family: "ST Inter"; src: url("../vendor/fonts/inter-400.woff2") format("woff2"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "ST Inter"; src: url("../vendor/fonts/inter-600.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "ST Inter"; src: url("../vendor/fonts/inter-800.woff2") format("woff2"); font-weight: 800 900; font-display: swap; }

body.lucian-ui {
  --bg: #0a0c10; --bg2: #101319; --card: #151920; --line: #242a35;
  --txt: #f3f5f8; --muted: #8d96a5;
  --green: #2fd17a; --amber: #f5a524; --red: #ff5a5f;
  --final: #ffd43b;                                   /* 확정 기록 */
  --ledge: color-mix(in srgb, var(--accent) 58%, #000); /* 주 버튼 아래 두께 */
  --tint: color-mix(in srgb, var(--accent) 14%, transparent);
  --font: "ST Inter", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Segoe UI", Roboto, sans-serif;
  --r-sm: 12px; --r-md: 16px; --r-lg: 22px;
  /* 옛 레이어(lucian-ui·record.css)의 변수도 같은 토큰으로: 유리 광택·이중 테두리를 한 번에 끈다 */
  --ux-rim: var(--line); --ux-shine: transparent; --ux-shadow: transparent; --panel: var(--card); --text: var(--txt);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  background-image: radial-gradient(120% 50% at 50% -18%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%);
  background-repeat: no-repeat;
}
body.lucian-ui[data-theme="light"] {
  --bg: #f4f5f7; --bg2: #ffffff; --card: #ffffff; --line: #e2e5ea;
  --txt: #0e1116; --muted: #667085;
  --green: #12a05c; --red: #e5484d; --final: #d9620a;
  background-image: none;
}
.lucian-ui :is(button, input, select, textarea) { font-family: inherit; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 1. 시작 화면: 컵이 쌓이고, 바닥에 충격 링이 퍼지고, 로고가 올라온다 ---------- */
html.no-splash .splash { display: none; }
html.splash-on body { overflow: hidden; }
.splash {
  position: fixed; inset: 0; z-index: 300; cursor: pointer; overflow: hidden;
  display: grid; place-content: center; justify-items: center; gap: 0;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: radial-gradient(60% 42% at 50% 44%, #10283a 0%, #090c11 100%);
  color: #fff; font-family: "ST Inter", system-ui, sans-serif;
  animation: splash-out .36s ease 1.8s forwards; /* CSS만으로 사라짐 → 스크립트 실패와 무관 */
}
.splash.splash-skip { animation: splash-out .2s ease forwards; }
.splash-stack { position: relative; width: min(74vw, 380px); }
.splash-cups { position: relative; display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 14px 18px #0008); }
.splash-cups use { animation: cup-drop .42s cubic-bezier(.3, 1.4, .55, 1) both; animation-delay: calc(.06s + var(--i) * .06s); }
/* 바닥의 타원 충격 링 (동심원, 빛살 아님) */
.splash-ring {
  position: absolute; left: 50%; bottom: -6%; width: 70%; aspect-ratio: 5 / 1; translate: -50% 50%;
  border: 2px solid #38bdf8; border-radius: 50%; opacity: 0;
  animation: ring-out .7s ease-out .64s both;
}
.splash-ring.late { animation-delay: .82s; border-color: #7dd3fc; }
.splash-floor {
  position: absolute; left: 50%; bottom: -4px; height: 2px; width: 0; translate: -50% 0; border-radius: 2px;
  background: linear-gradient(90deg, transparent, #38bdf8 30%, #e0f2fe 50%, #38bdf8 70%, transparent);
  animation: floor-in .5s cubic-bezier(.2, .8, .2, 1) .6s forwards;
}
.splash-logo {
  margin: 34px 0 0; display: flex; gap: .26em; overflow: hidden; padding-bottom: .06em;
  font-weight: 800; font-size: clamp(38px, 11.5vw, 76px); line-height: 1; letter-spacing: -.02em;
}
.splash-logo span, .splash-logo b { display: block; font-weight: 800; animation: rise .5s cubic-bezier(.2, .9, .2, 1) both; }
.splash-logo span { color: #fff; animation-delay: .78s; }
.splash-logo b { color: #38bdf8; animation-delay: .86s; }
.splash-tag {
  margin: 16px 0 0; font-size: clamp(11px, 3vw, 13px); font-weight: 600; letter-spacing: .34em; text-indent: .34em;
  color: #8fa3b8; animation: fade-in .35s ease 1.12s both;
}
@keyframes cup-drop { 0% { transform: translateY(-160px); opacity: 0; } 55% { opacity: 1; } 100% { transform: none; opacity: 1; } }
@keyframes ring-out { 0% { opacity: .9; scale: .3; } 100% { opacity: 0; scale: 1.9; } }
@keyframes floor-in { to { width: 118%; } }
@keyframes rise { from { transform: translateY(105%); } to { transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes splash-out { to { opacity: 0; visibility: hidden; } }

/* ---------- 2. 버튼 ---------- */
/* 주 버튼: 단색 + 아래 두께 4px. 누르면 내려앉는다. */
.lucian-ui :is(.mic-btn:not(.on), .primary) {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px; padding: 0 20px; margin-bottom: 4px;
  font-size: 17px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; color: #04121c; text-shadow: none;
  background: var(--accent); border: 0; border-radius: var(--r-md);
  box-shadow: 0 4px 0 var(--ledge);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s;
}
.lucian-ui .mic-btn { width: 100%; }
.lucian-ui :is(.mic-btn, .primary)::before { content: none; } /* 예전 유리 광택 제거 */
.lucian-ui :is(.mic-btn:not(.on), .primary):not(:disabled):active { transform: translateY(4px); box-shadow: 0 0 0 var(--ledge); }
.lucian-ui .mic-btn.small { min-height: 48px; padding: 0 16px; font-size: 15px; border-radius: 14px; box-shadow: 0 3px 0 var(--ledge); margin-bottom: 3px; }
.lucian-ui .mic-btn.small:not(:disabled):active { transform: translateY(3px); }
/* 연결된 상태의 버튼(연결 끊기)·보조 버튼: 평평한 면 + 실선 */
.lucian-ui :is(.mic-btn.on, .ghost-btn) {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 16px; margin-bottom: 0;
  font-size: 15px; font-weight: 600; color: var(--txt);
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: none; animation: none;
}
.lucian-ui .mic-btn.on { min-height: 56px; border-radius: var(--r-md); font-size: 16px; }
.lucian-ui .ghost-btn.full { display: flex; width: 100%; }
.lucian-ui .ghost-btn.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, var(--line)); background: var(--card); }
.lucian-ui :is(.mic-btn.on, .ghost-btn):not(:disabled):active { transform: scale(.98); background: var(--bg2); }
@media (hover: hover) and (pointer: fine) {
  .lucian-ui :is(.mic-btn:not(.on), .primary):not(:disabled):hover { transform: none; filter: brightness(1.06); box-shadow: 0 4px 0 var(--ledge); border-color: transparent; }
  .lucian-ui :is(.mic-btn.on, .ghost-btn, .preview-entry):not(:disabled):hover { transform: none; box-shadow: none; border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
}
/* JS가 글자만 바꾸는 버튼의 아이콘 */
.lucian-ui #micBtn::before, .lucian-ui #undoBtn::before, .lucian-ui .event-tab.seq::before {
  content: ""; position: static; inset: auto; flex: none; width: 20px; height: 20px; border-radius: 0;
  background: currentColor; pointer-events: none;
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat;
}
.lucian-ui #micBtn { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='13.5' r='7.5'/%3E%3Cpath d='M12 13.5V9.5M9.5 2.5h5M19 6l-1.6 1.6'/%3E%3C/svg%3E"); }
.lucian-ui #micBtn.on { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E"); }
.lucian-ui #undoBtn {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M10 11v6M14 11v6M6 7l1 12a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-12M9 7V5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2'/%3E%3C/svg%3E");
  width: auto; min-height: 40px; margin: 0 auto 10px; padding: 0 14px; display: flex;
  font-size: 13.5px; font-weight: 600; border: 0; background: color-mix(in srgb, var(--red) 12%, transparent); border-radius: 999px;
}
.lucian-ui #undoBtn::before { width: 16px; height: 16px; }
.lucian-ui #undoBtn[hidden] { display: none; }

/* ---------- 3. 홈: 상단 · 설치 안내 · 모드 · 종목 ---------- */
.lucian-ui .disp-top { padding: calc(14px + var(--app-safe-top)) 20px 12px; }
.lucian-ui .stack-brand { gap: 10px; }
.lucian-ui .stack-brand img { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); }
.lucian-ui .stack-wordmark { margin: 0 0 4px; font-size: 15px; font-weight: 800; font-style: normal; letter-spacing: .06em; line-height: 1; white-space: nowrap; color: var(--txt); }
.lucian-ui .stack-wordmark b { color: var(--accent); text-shadow: none; }
.lucian-ui[data-theme="light"] .stack-wordmark b { color: color-mix(in srgb, var(--accent) 70%, #062a3d); }
.lucian-ui .conn { gap: 6px; font-size: 12px; font-weight: 600; }
.lucian-ui .conn .dot { width: 7px; height: 7px; box-shadow: none; }
.lucian-ui .conn.live .dot { animation: dot-ping 1.6s ease-out infinite; }
@keyframes dot-ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 60%, transparent); } 100% { box-shadow: 0 0 0 7px transparent; } }
.lucian-ui .stacker-chip { padding: 7px 12px; font-size: 13px; font-weight: 600; color: var(--txt); background: var(--card); border: 1px solid var(--line); }
.lucian-ui .icon-btn { display: grid; place-items: center; width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 12px; background: var(--card); border: 1px solid var(--line); box-shadow: none; color: var(--txt); }
.lucian-ui .icon-btn .ico { width: 19px; height: 19px; }

.lucian-ui .home-install {
  position: relative; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin: 0 20px 12px; padding: 12px 44px 12px 16px;
  border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line);
}
.lucian-ui .home-install-copy strong { font-size: 14px; font-weight: 700; }
.lucian-ui .home-install-copy p { margin: 3px 0 0; font-size: 12.5px; line-height: 1.45; }
.lucian-ui .home-install .mic-btn { width: auto; min-height: 36px; padding: 0 14px; margin: 0; font-size: 13px; font-weight: 700; border-radius: 999px; color: var(--accent); background: var(--tint); box-shadow: none; }
.lucian-ui[data-theme="light"] .home-install .mic-btn { color: color-mix(in srgb, var(--accent) 60%, #000); }
.lucian-ui .home-install .mic-btn:not(:disabled):active { transform: scale(.97); box-shadow: none; }
.install-close { position: absolute; top: 50%; right: 6px; translate: 0 -50%; display: grid; place-items: center; width: 34px; height: 34px; min-height: 34px !important; padding: 0; border: 0; border-radius: 50% !important; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; box-shadow: none; }
.install-close:hover, .install-close:focus-visible { color: var(--txt); background: var(--bg2); }
.lucian-ui .home-install-guide { padding-top: 4px; }

/* 측정 방식: 조용한 밑줄 탭 (종목 선택보다 한 단계 아래) */
.lucian-ui .home-timer-modes { display: flex; gap: 22px; margin: 0 20px 14px; padding: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; box-shadow: none; }
.lucian-ui .home-timer-modes :is(a, button) {
  flex: none; min-height: 40px; padding: 8px 0 10px; border: 0; border-radius: 0; background: none; box-shadow: none;
  font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: -.01em; overflow: visible;
}
.lucian-ui .home-timer-modes a[aria-current="page"] { color: var(--txt); font-weight: 700; background: none; box-shadow: inset 0 -2px 0 var(--accent); }
.lucian-ui .home-timer-modes :is(a, button):is(:hover, :focus-visible) { color: var(--txt); background: none; }

/* 종목 선택·세그먼트 */
.lucian-ui :is(.event-tabs, .seg) { padding: 4px; gap: 4px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--bg2); box-shadow: none; }
.lucian-ui #view-display .event-tabs { width: calc(100% - 40px); max-width: none; margin: 0 auto; align-self: center; }
.lucian-ui #view-display .disp-bottom { max-width: none; width: 100%; }
.lucian-ui #view-display .event-tab { padding-top: 0; padding-bottom: 0; }
.lucian-ui .event-tab { flex: 1 1 0; min-width: 0; min-height: 48px; padding: 0 4px; font-size: clamp(16px, 4.6vw, 19px); font-weight: 800; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.lucian-ui .event-tab.seq { flex: 0 0 52px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; font-size: 12px; font-weight: 700; border-left: 0; --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 3l3 3-3 3M4 11V9a3 3 0 0 1 3-3h13M7 21l-3-3 3-3M20 13v2a3 3 0 0 1-3 3H4'/%3E%3C/svg%3E"); }
.lucian-ui .event-tab.seq::before { width: 18px; height: 18px; }
.lucian-ui .event-tab.seq.active { color: var(--accent); background: var(--tint); }
.lucian-ui .seg-btn { min-height: 40px; font-size: 14px; font-weight: 700; }
.lucian-ui .lucian-pill { border-radius: 12px; background: var(--accent); box-shadow: 0 1px 2px #0004; }
.lucian-ui :is(.event-tab.active:not(.seq), .seg-btn.active) { color: #04121c; }

/* ---------- 4. 타이머 판 ---------- */
.lucian-ui .stage { position: relative; margin: 14px 20px; border: 1px solid var(--line); border-radius: 26px; background: var(--bg2); box-shadow: none; isolation: isolate; transition: border-color .2s, box-shadow .2s; }
.lucian-ui .stage.idle { background: var(--bg2); }
.lucian-ui .stage::before { content: none; }
.lucian-ui .big-time { font-family: "ST Inter", var(--font); font-weight: 800; font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1, "zero" 0; letter-spacing: -.035em; text-shadow: none; color: var(--txt); }
.lucian-ui .stage.idle .big-time { color: color-mix(in srgb, var(--txt) 34%, transparent); }
.lucian-ui .stage-hint { margin-top: 12px; font-size: 14px; font-weight: 600; color: var(--muted); opacity: 1; }
.lucian-ui .stage.ready { border-color: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 18%, transparent); animation: none; }
.lucian-ui .stage.ready .big-time { color: var(--green); }
.lucian-ui .stage.running { border-color: var(--accent); box-shadow: 0 0 0 3px var(--tint); }
.lucian-ui .stage.running .big-time { color: var(--txt); text-shadow: none; }
.lucian-ui .stage.stopped { border-color: var(--final); box-shadow: 0 0 0 3px color-mix(in srgb, var(--final) 16%, transparent); }
.lucian-ui .stage.stopped .big-time { color: var(--final); text-shadow: none; }
/* 저장 순간: 얇은 링 하나가 퍼진다 */
.lucian-ui .stage { overflow: hidden; }
.lucian-ui .stage::after { content: ""; display: none; position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; translate: -50% -50%; border-radius: 50%; border: 2px solid var(--final); pointer-events: none; z-index: 1; }
.lucian-ui .stage.save-burst::after { display: block; animation: save-ring .6s ease-out forwards; }
@keyframes save-ring { from { opacity: .8; width: 40px; height: 40px; } to { opacity: 0; width: 520px; height: 520px; } }

.lucian-ui .disp-bottom { padding: 0 20px 20px; }
.lucian-ui #shareBtnDisp { margin-top: 10px; }
.lucian-ui .saved-toast { top: 14%; padding: 11px 18px; font-size: 14px; font-weight: 700; color: var(--bg); background: var(--txt); border: 0; box-shadow: 0 10px 30px -10px #000a; }
.lucian-ui .saved-toast.show { animation: none; }

/* 신기록: 어두운 막 + 동심원 링 + 큰 글자 (빛살 없음) */
.pb-overlay.show { background: radial-gradient(circle at 50% 50%, #05070bdd 0 30%, #05070b88 70%); }
.pb-overlay::before, .pb-overlay::after { content: ""; position: absolute; left: 50%; top: 50%; width: 90px; height: 90px; translate: -50% -50%; border-radius: 50%; border: 2px solid var(--final); opacity: 0; }
.pb-overlay.show::before { animation: pb-ring 1s ease-out both; }
.pb-overlay.show::after { animation: pb-ring 1s ease-out .22s both; }
/* 선 굵기가 변하지 않게 크기(width/height)로 퍼뜨린다 */
@keyframes pb-ring { from { opacity: .8; width: 90px; height: 90px; } to { opacity: 0; width: 130vmax; height: 130vmax; } }
.lucian-ui .pb-text { position: relative; padding: 0 20px; font-family: var(--font); font-size: clamp(44px, 12vw, 104px); font-weight: 800; font-style: normal; letter-spacing: -.03em; line-height: 1.05; color: var(--final); background: none; -webkit-text-fill-color: currentColor; filter: none; text-shadow: 0 6px 30px #000a; }
.pb-overlay.show .pb-text { animation: pbpop .45s cubic-bezier(.2, 1.4, .4, 1); }

/* 대결·녹화 카드 */
.lucian-ui .feature-tabs { gap: 10px; margin-top: 14px; }
.lucian-ui .preview-entry { position: relative; padding: 14px 34px 14px 14px; text-align: left; border-radius: 18px; border: 1px solid var(--line); background: var(--card); box-shadow: none; color: var(--txt); }
.lucian-ui .preview-entry:not(:disabled):active { transform: scale(.98); box-shadow: none; }
.lucian-ui .recording-entry { border-color: var(--line); }
.lucian-ui .feature-icon { width: 36px; height: 36px; margin-bottom: 10px; border-radius: 11px; color: var(--accent); background: var(--tint); }
.lucian-ui .preview-entry:first-child .feature-icon { color: var(--amber); background: color-mix(in srgb, var(--amber) 15%, transparent); }
.lucian-ui .feature-icon svg { width: 20px; height: 20px; stroke-width: 2; }
.lucian-ui .preview-entry strong { font-size: 15px; font-weight: 700; line-height: 1.3; }
.lucian-ui .preview-entry span:not(.feature-icon) { margin-top: 3px; font-size: 12px; color: var(--muted); }
.lucian-ui .feature-arrow { position: absolute; right: 10px; top: 50%; translate: 0 -50%; color: var(--muted); display: grid; }

/* ---------- 5. 하단 메뉴 ---------- */
.nav-ico { display: grid; place-items: center; width: 26px; height: 26px; }
.nav-ico svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.lucian-ui .bottom-nav { gap: 0; padding: 6px 8px calc(6px + var(--app-safe-bottom)); background: color-mix(in srgb, var(--bg) 86%, transparent); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); border-top: 1px solid var(--line); }
.lucian-ui .nav-btn { gap: 2px; min-height: 48px; border-radius: 12px; font-size: 11px; font-weight: 600; color: var(--muted); background: none; box-shadow: none; transition: color .15s; }
.lucian-ui .nav-btn.active, .lucian-ui[data-theme="light"] .nav-btn.active { color: var(--accent); background: none; }
.lucian-ui[data-theme="light"] .nav-btn.active { color: color-mix(in srgb, var(--accent) 65%, #000); }
.lucian-ui .nav-btn.active .nav-ico svg { stroke-width: 2.3; }
/* 넓은 화면(태블릿·PC)에서만 떠 있는 메뉴. 가로로 눕힌 휴대폰은 화면이 낮아 기본 메뉴를 쓴다 */
@media (min-width: 800px) and (min-height: 521px) {
  .lucian-ui .bottom-nav { left: 50%; right: auto; width: min(560px, 100% - 32px); translate: -50% 0; bottom: 14px; height: var(--nav-h); padding-bottom: 6px; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 16px 40px -18px #000c; }
  body.app-home { padding-bottom: calc(var(--nav-h) + 30px); }
  body.timing .bottom-nav { transform: translateY(160%); }
}

/* ---------- 6. 기록 · 랭킹 · 설정 ---------- */
.lucian-ui .page-head { padding: calc(20px + var(--app-safe-top)) 20px 8px; }
.lucian-ui .page-head h1 { font-size: 28px; font-weight: 800; font-style: normal; letter-spacing: -.03em; line-height: 1.15; }
.lucian-ui .page-head h1::after { content: none; }
.lucian-ui .record-source-filter { padding: 6px 20px; }
.lucian-ui .record-source-filter label { font-size: 13px; font-weight: 600; }
.lucian-ui :is(.select, .input) { min-height: 46px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--bg2); border: 1px solid var(--line); color: var(--txt); }
.lucian-ui :is(.select, .input):focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--tint); }
.lucian-ui .best-cards { gap: 8px; padding: 8px 20px; }
.lucian-ui .best-card { padding: 14px 6px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); box-shadow: none; }
.lucian-ui .best-card .ev { line-height: 16px; font-size: 12px; font-weight: 700; color: var(--muted); font-family: var(--font); }
.lucian-ui .best-card .bt { margin-top: 6px; line-height: 28px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: var(--txt); text-shadow: none; font-variant-numeric: tabular-nums; }
.lucian-ui .best-card .lb { margin-top: 2px; font-size: 10.5px; font-weight: 600; letter-spacing: .02em; color: var(--final); }
.lucian-ui .filter-chips { padding: 6px 20px; gap: 6px; }
.lucian-ui .chip { min-height: 38px; padding: 0 14px; font-size: 13px; font-weight: 600; background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; box-shadow: none; }
.lucian-ui .chip.active { background: var(--txt); border-color: var(--txt); color: var(--bg); }
.lucian-ui .records-actions { padding: 8px 20px; gap: 8px; }
/* 기록 목록: 한 장의 카드 안에 줄로 */
.lucian-ui .record-list { margin: 8px 20px 20px; padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--card); overflow: hidden; }
.lucian-ui .record-list:empty { display: none; }
.lucian-ui .record-item { gap: 12px; margin: 0; padding: 12px 8px 12px 16px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; box-shadow: none; }
.lucian-ui .record-item:last-child { border-bottom: 0; }
.lucian-ui .record-item.best { border-color: var(--line); box-shadow: none; }
.lucian-ui .record-item .badge { min-width: 54px; text-align: center; padding: 5px 8px; font-size: 11.5px; font-weight: 700; border-radius: 8px; border: 0; background: var(--bg2); color: var(--muted); }
.lucian-ui .record-item.best .badge { color: var(--muted); }
.lucian-ui .record-item .rtime { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.lucian-ui .record-item .rdate { margin-top: 1px; font-size: 12px; }
.pb-tag { padding: 3px 6px; border-radius: 6px; font-size: 10px; font-weight: 800; letter-spacing: .06em; line-height: 1; color: #1a1400; background: var(--final); }
.lucian-ui[data-theme="light"] .pb-tag { color: #fff; }
.lucian-ui .record-item .del { display: grid; place-items: center; min-width: 44px; width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 12px; background: none; box-shadow: none; color: var(--muted); }
.lucian-ui .record-item .del:is(:hover, :focus-visible, :active) { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.lucian-ui .empty { padding: 56px 24px; font-size: 14px; }
.records-footer { margin-top: 0; align-items: center; }
.text-danger { flex: 0 0 auto; min-height: 44px; padding: 8px 12px; border: 0; background: none; box-shadow: none; color: var(--muted); font: 600 13px/1.2 inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; border-radius: 12px; }
.text-danger:is(:hover, :focus-visible) { color: var(--red); }

.lucian-ui .disclaimer { margin: 6px 20px 10px; padding: 10px 14px; font-size: 12.5px; font-weight: 500; line-height: 1.5; text-align: left; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); }
.lucian-ui .rank-filters { padding: 4px 20px 8px; }
.lucian-ui .rank-list { margin: 8px 20px 20px; padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--card); overflow: hidden; }
.lucian-ui .rank-list:empty { display: none; }
.lucian-ui .rank-item { margin: 0; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; box-shadow: none; }
.lucian-ui .rank-item:last-child { border-bottom: 0; }
.lucian-ui .rank-item.me { background: var(--tint); box-shadow: inset 3px 0 0 var(--accent); }
.lucian-ui .rank-no { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.lucian-ui .rank-item.top:nth-child(1) .rank-no { color: var(--final); text-shadow: none; }
.lucian-ui .rank-item.top:nth-child(2) .rank-no { color: #aab4c3; }
.lucian-ui .rank-item.top:nth-child(3) .rank-no { color: #c98a4b; }
.lucian-ui .rank-name { font-size: 15px; font-weight: 700; }
.lucian-ui .rank-time { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }

.lucian-ui .setting-block { margin: 10px 20px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: none; }
.lucian-ui .setting-label { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.lucian-ui .hint { font-size: 13px; line-height: 1.55; }
.lucian-ui details > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; }
.lucian-ui details > summary::-webkit-details-marker { display: none; }
.lucian-ui details > summary::after { content: ""; flex: none; width: 9px; height: 9px; margin-right: 4px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); rotate: 45deg; transition: rotate .2s; }
.lucian-ui details[open] > summary::after { rotate: 225deg; }
.lucian-ui .switch input:checked + .slider { background: var(--accent); }
.lucian-ui .swatch { width: 36px; height: 36px; min-height: 36px; border-width: 2px; box-shadow: none; }
.lucian-ui .swatch.sel { border-color: var(--bg2); box-shadow: 0 0 0 2px var(--txt); }
.lucian-ui .swatch.custom { height: 36px; border: 1px dashed var(--line); }
.lucian-ui .emoji-btn { min-height: 44px; border: 1px solid var(--line); background: var(--bg2); box-shadow: none; border-radius: 12px; }
.lucian-ui .emoji-btn.sel { border-color: var(--accent); background: var(--tint); }
.lucian-ui .version { font-size: 12px; }
.lucian-ui .modal { background: #05070bcc; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.lucian-ui .modal-box { padding: 16px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--bg2); }
.lucian-ui .share-img { border-radius: 14px; }
.lucian-ui .timer-connection-help { border: 1px solid color-mix(in srgb, var(--amber) 55%, var(--line)); border-radius: var(--r-md); }

/* ---------- 7. 휴대폰 타이머 안내 화면 ---------- */
.lucian-ui.touch-page :is(h1, h2) { font-style: normal; letter-spacing: -.03em; font-weight: 800; }

/* ---------- 8. 가로로 눕힌 휴대폰: 타이머가 첫 화면에 크게 ---------- */
@media (orientation: landscape) and (max-height: 520px) {
  body.app-home:not(.led-mode):not(.present) #view-display.active {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(210px, 34%);
    grid-template-rows: auto minmax(0, 1fr) auto; column-gap: 12px;
    min-height: calc(100dvh - var(--nav-h) - var(--app-safe-bottom));
    max-width: none; padding: 0 12px;
  }
  body.app-home:not(.led-mode):not(.present) #view-display > .disp-top { grid-column: 1 / -1; padding: calc(8px + var(--app-safe-top)) 4px 6px; }
  body.app-home:not(.led-mode):not(.present) #view-display > #stage { grid-column: 1; grid-row: 2 / 4; margin: 0 0 8px; min-height: 0; }
  body.app-home:not(.led-mode):not(.present) #view-display > .event-tabs { grid-column: 2; grid-row: 2; width: 100%; margin: 0; align-self: start; flex-wrap: wrap; }
  body.app-home:not(.led-mode):not(.present) #view-display > .disp-bottom { grid-column: 2; grid-row: 3; padding: 0 0 8px; }
  body.app-home:not(.led-mode):not(.present) #view-display > :is(.home-install, .home-timer-modes),
  body.app-home:not(.led-mode):not(.present) #view-display .feature-tabs,
  body.app-home:not(.led-mode):not(.present) #shareBtnDisp { display: none; }
  .lucian-ui #view-display .event-tab, .lucian-ui #view-display .event-tab.seq { flex: 1 1 calc(50% - 4px); min-height: 44px; font-size: 17px; }
  .lucian-ui .mic-btn:not(.small) { min-height: 52px; font-size: 16px; }
  :root { --nav-h: 54px; }
}

/* ---------- 9. 움직임 줄이기 설정 존중 ---------- */
@media (prefers-reduced-motion: reduce) {
  .splash { animation: splash-out .3s ease .6s forwards; }
  .splash *, .splash::before, .splash::after { animation: none !important; }
  .splash-floor { width: 118%; }
  .lucian-ui .conn.live .dot, .lucian-ui .stage.save-burst::after, .pb-overlay.show::before, .pb-overlay.show::after, .pb-overlay.show .pb-text { animation: none; }
}
.lucian-ui .swatch.custom { width: auto; min-width: 0; padding: 0 12px; border-radius: 999px; white-space: nowrap; font-size: 12px; font-weight: 600; }
.lucian-ui .setting-block > :is(div, label).setting-label:first-child { display: block; margin-bottom: 10px; } /* summary(접기 제목)는 제외: 화살표가 오른쪽에 붙어야 함 */
/* Inter 숫자는 폭이 좁아 같은 칸에 조금 더 크게 들어간다 (LED·측정 전체화면 모드는 기존 계산 유지) */
@supports (font-size: 1cqb) { .lucian-ui #view-display #bigTime { font-size: min(calc(158cqi / var(--len, 6)), 78cqb); } }

/* ---------- 10. 연습녹화 · 대결 화면도 같은 규칙으로 ---------- */
.lucian-ui .recorder h1 { font-weight: 800; letter-spacing: -.03em; }
.lucian-ui .eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .14em; }
.lucian-ui .topbar a { min-height: 40px; padding: 0 14px; display: inline-flex; align-items: center; font-size: 14px; font-weight: 600; border-radius: 12px; background: var(--card); border: 1px solid var(--line); box-shadow: none; }
.lucian-ui .mode-tabs { padding: 4px; gap: 4px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--bg2); box-shadow: none; }
.lucian-ui .mode-tabs a { min-height: 44px; padding: 0 8px; gap: 6px; display: flex; align-items: center; justify-content: center; border: 0; font-size: 15px; font-weight: 700; color: var(--muted); }
.lucian-ui .mode-tabs a[aria-current="page"] { color: #04121c; }
.lucian-ui :is(.secondary, .button.secondary) { min-height: 48px; font-weight: 600; color: var(--txt); background: var(--card); border: 1px solid var(--line); box-shadow: none; }
.lucian-ui :is(.secondary, .button.secondary):not(:disabled):active { transform: scale(.98); }
/* 주요 촬영 버튼: 홈의 주 버튼과 같은 모양 */
.lucian-ui .recorder :is(#openCamera, #startRecord, #stopRecord, #downloadVideo) { min-height: 56px; padding: 0 18px; border-radius: var(--r-md); font-size: 17px; font-weight: 700; letter-spacing: -.01em; filter: none; }
.lucian-ui .recorder #openCamera { border: 1px solid var(--line); background: var(--card); box-shadow: none; }
.lucian-ui .recorder :is(#startRecord, #downloadVideo) { border: 0; color: #04121c; background: var(--accent); box-shadow: 0 4px 0 var(--ledge); }
.lucian-ui .recorder #stopRecord { border: 0; color: #fff; background: #e5484d; box-shadow: 0 4px 0 #9b1c2e; }
.lucian-ui .recorder :is(#startRecord, #stopRecord, #downloadVideo):not(:disabled):not([aria-disabled="true"]):active { transform: translateY(4px); box-shadow: 0 0 0 transparent; filter: none; }
.lucian-ui .recorder #openCamera:not(:disabled):active { transform: scale(.98); box-shadow: none; }
.lucian-ui .recorder :is(#startRecord, #stopRecord, #downloadVideo):is(:disabled, [aria-disabled="true"]) { box-shadow: none; }
.lucian-ui .recorder #downloadVideo { display: flex; align-items: center; justify-content: center; text-decoration: none; position: relative; overflow: hidden; isolation: isolate; }
.lucian-ui .recorder #downloadVideo[data-export-state="ready"] { box-shadow: 0 4px 0 var(--ledge); }
/* 변환 진행률: 버튼 안에서 왼쪽부터 차오른다(실제 진행률) */
.lucian-ui #downloadVideo[data-export-state="preparing"] { color: var(--txt); background: var(--card); border: 1px solid var(--line); box-shadow: none; }
.lucian-ui #downloadVideo[data-export-state="preparing"]::before { content: ""; position: absolute; inset: 0; height: auto; z-index: -1; border-radius: inherit; background: color-mix(in srgb, var(--accent) 30%, transparent); transform: scaleX(var(--export-progress, 0)); transform-origin: left center; transition: transform .2s linear; pointer-events: none; }
.lucian-ui :is(.timer-panel, .review, .record-settings, .arena, .template-settings, .recording-controls, .availability) { background: var(--card); border: 1px solid var(--line); box-shadow: none; }
.lucian-ui .timer-panel strong { font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.lucian-ui .template-choice { border: 1px solid var(--line); border-radius: 14px; }
.lucian-ui .template-choice:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--tint); }
.lucian-ui .highlight-list li { background: var(--bg2); border: 1px solid var(--line); }
/* 대결 */
.lucian-ui .duel .arena { background: var(--card); }
.lucian-ui .duel #readyButton { min-height: 56px; border-radius: var(--r-md); font-size: 17px; font-weight: 700; letter-spacing: -.01em; color: #04200e; background: var(--green); box-shadow: 0 4px 0 color-mix(in srgb, var(--green) 55%, #000); }
.lucian-ui .duel #readyButton:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 transparent; }
.lucian-ui .duel #readyButton:disabled { opacity: 1; color: var(--muted); background: var(--bg2); border: 1px solid var(--line); box-shadow: none; }
.lucian-ui .duel #readyButton.is-ready { color: var(--green); background: color-mix(in srgb, var(--green) 14%, var(--card)); box-shadow: inset 0 0 0 1px var(--green); transform: none; }
.lucian-ui .duel .arena[data-outcome] .result { font-family: var(--font); font-style: normal; font-weight: 800; letter-spacing: -.02em; text-shadow: none; }
.lucian-ui .duel .arena[data-outcome] .result::after { font-family: var(--font); font-weight: 600; letter-spacing: 0; }
.lucian-ui .duel .players::after { font-family: var(--font); font-style: normal; font-weight: 800; }
.lucian-ui .duel #countdown { font-family: var(--font); font-weight: 800; text-shadow: none; }
.lucian-ui .duel .players .player { border-width: 1px; box-shadow: inset 0 -3px var(--vs-me); }
.lucian-ui .duel .players .player:last-child { box-shadow: inset 0 -3px var(--vs-them); }
.lucian-ui .invite-notice { border-width: 1px; box-shadow: 0 12px 30px -16px #000c; }
/* 좁은 화면(360px)에서 줄바꿈으로 흐트러지지 않게 */
.lucian-ui .records-actions > button { padding: 0 10px; white-space: nowrap; }
.lucian-ui .record-item .rdate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 380px) { .lucian-ui .records-actions .ghost-btn { font-size: 14px; } .lucian-ui .record-item .badge { min-width: 48px; } }
