@import url('/fonts/pretendard/pretendard.css');
@import url('/fonts/exo2/exo2.css');

:root {
  --bg: #0b1026;
  --bg2: #121838;
  --panel: rgba(20, 26, 62, 0.74);
  --panel-solid: #161d46;
  --panel-hi: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.13);
  --text: #f5f7ff;
  --muted: #a9b2d6;
  --cyan: #22d3c5;
  --sky: #33ccff;
  --pink: #ff5fa2;
  --violet: #8b5cf6;
  --gold: #ffd34d;
  --red: #ff4d6d;
  --green: #4ade80;
  --grad: linear-gradient(100deg, #22d3c5 0%, #33ccff 30%, #ff5fa2 68%, #8b5cf6 100%);
  --grad-btn: linear-gradient(100deg, #1fc8d8, #ff5fa2);
  --radius: 18px;
  --topbar-h: 64px;
  --tabbar-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', system-ui, sans-serif;
  --font-d: 'Exo 2', 'Pretendard Variable', Pretendard, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { min-height: 100dvh; overflow-x: hidden; overscroll-behavior-y: none; }
body.fullscreen-mode { overflow: hidden; touch-action: none; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
p { margin: 0; }
.num { font-family: var(--font-d); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.muted { color: var(--muted); }
.sm { font-size: 13px; }
.pre { white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; }
.hide { display: none !important; }
.up { color: #4ade80; }
.down { color: #ff7a90; }
.warn { color: #ffb4c0; }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }

/* ------------------------------------------------------------------ icons */
.ico { display: inline-flex; align-items: center; justify-content: center; flex: none; line-height: 0; }

/* ------------------------------------------------------------------ boot */
#boot { position: fixed; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #2a1f6b, #0b1026 70%); z-index: 1000; }
#boot img { width: min(60vw, 360px); animation: float 3s ease-in-out infinite; }
#boot .bar { width: 160px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.15); overflow: hidden; margin: 22px auto 0; }
#boot .bar i { display: block; height: 100%; width: 40%; background: var(--grad); animation: load 1s ease-in-out infinite; }
@keyframes load { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.boot-err { min-height: 100dvh; display: grid; place-items: center; text-align: center; gap: 14px; padding: 24px; }
.boot-err img { width: 260px; margin: 0 auto; }

/* ------------------------------------------------------------------ app shell */
.app-bg { position: fixed; inset: 0; z-index: -1; background: url('/img/bg-home.webp') center/cover no-repeat, var(--bg); }
.app-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 16, 38, 0.55) 0%, rgba(11, 16, 38, 0.82) 45%, rgba(11, 16, 38, 0.94) 100%), url('/img/pattern-stars.svg'); }
@media (orientation: portrait) { .app-bg { background-image: url('/img/bg-home-portrait.webp'); } }

.topbar { position: sticky; top: 0; z-index: 50; height: calc(var(--topbar-h) + var(--safe-t)); padding: var(--safe-t) max(16px, var(--safe-r)) 0 max(16px, var(--safe-l)); display: flex; align-items: center; gap: 18px; background: rgba(11, 16, 38, 0.72); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3); border-bottom: 1px solid var(--line); }
.brand img { height: 40px; width: auto; filter: drop-shadow(0 2px 10px rgba(51, 204, 255, 0.35)); }
.topnav { display: none; gap: 4px; margin-left: 8px; }
.tn { display: flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 999px; color: var(--muted); font-weight: 700; transition: background 0.2s, color 0.2s; }
.tn:hover { color: var(--text); background: var(--panel-hi); }
.tn.on { color: #0b1026; background: var(--grad); }
.top-r { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.pchip { display: flex; align-items: center; gap: 9px; padding: 4px 14px 4px 4px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); max-width: 200px; }
.pc-t { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.pc-t b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-t small { font-size: 11px; color: var(--cyan); font-weight: 700; font-family: var(--font-d); }
.iconbtn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--text); transition: transform 0.15s, background 0.2s; flex: none; }
.iconbtn:hover { background: rgba(255, 255, 255, 0.12); }
.iconbtn:active { transform: scale(0.94); }
.iconbtn.sm { width: 32px; height: 32px; }
.bell { position: relative; }
.bell .dot { position: absolute; top: 8px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 2px var(--bg); }
.site-notice { margin: 10px 16px 0; padding: 10px 14px; border-radius: 12px; background: linear-gradient(90deg, rgba(255, 95, 162, 0.22), rgba(139, 92, 246, 0.22)); border: 1px solid rgba(255, 95, 162, 0.4); font-weight: 600; font-size: 14px; }

.view { min-height: calc(100dvh - var(--topbar-h)); padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 18px); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; height: calc(var(--tabbar-h) + var(--safe-b)); padding: 0 var(--safe-r) var(--safe-b) var(--safe-l); display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(11, 16, 38, 0.9); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--line); }
.tb { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; font-weight: 700; color: var(--muted); position: relative; }
.tb.on { color: var(--text); }
.tb.on .ico { color: var(--cyan); filter: drop-shadow(0 0 8px rgba(34, 211, 197, 0.7)); }
.tb.on::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 4px 4px; background: var(--grad); }
@media (min-width: 900px) {
  .topnav { display: flex; }
  .tabbar { display: none; }
  .view { padding-bottom: 40px; }
}
@media (max-width: 899px) {
  .topbar { height: calc(56px + var(--safe-t)); }
  .brand img { height: 34px; }
  .pc-t { display: none; }
  .pchip { padding: 3px; }
}

/* ------------------------------------------------------------------ layout primitives */
.page { max-width: 1240px; margin: 0 auto; padding: 18px max(16px, var(--safe-r)) 0 max(16px, var(--safe-l)); display: flex; flex-direction: column; gap: 16px; animation: fadein 0.3s ease; }
/* 주의: .page 에 transform 애니메이션을 걸면 모바일 곡 상세 시트(position:fixed)의 기준 박스가 .page 로 바뀐다 */
@keyframes pagein { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.page-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-h h2 { display: flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 800; }
.lead { color: var(--muted); font-size: 14.5px; max-width: 780px; word-break: keep-all; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.glass { backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); }
.sec-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sec-h h3 { display: flex; align-items: center; gap: 7px; font-size: 16px; font-weight: 800; }
.sec-title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 800; margin-top: 4px; }
.more { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); font-size: 13px; font-weight: 600; }
.empty { display: grid; place-items: center; gap: 10px; padding: 34px 16px; color: var(--muted); text-align: center; }
.empty p { max-width: 360px; word-break: keep-all; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 28px; color: var(--muted); }
.spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.15); border-top-color: var(--cyan); animation: rot 0.8s linear infinite; flex: none; }
.spin.sm { width: 18px; height: 18px; border-width: 2px; }
@keyframes rot { to { transform: rotate(360deg); } }
.bar { height: 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.12); overflow: hidden; flex: 1; min-width: 60px; }
.bar i { display: block; height: 100%; background: var(--grad); border-radius: inherit; transition: width 0.6s ease; }
.bar.sm { height: 5px; margin-top: 6px; }
.note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.note.big { padding: 26px; gap: 18px; }
.note.big h3 { margin-bottom: 4px; }
.err h3 { margin-bottom: 8px; }
.err p { margin-bottom: 14px; color: var(--muted); }

/* ------------------------------------------------------------------ buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-weight: 800; letter-spacing: -0.01em; transition: transform 0.12s, filter 0.2s, background 0.2s, box-shadow 0.2s; white-space: nowrap; user-select: none; }
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.4); transform: none; }
.btn.primary { background: var(--grad-btn); border-color: transparent; color: #fff; box-shadow: 0 6px 20px rgba(255, 95, 162, 0.28); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); }
.btn.ghost { background: rgba(255, 255, 255, 0.06); }
.btn.danger { background: linear-gradient(100deg, #ff4d6d, #e11d48); border-color: transparent; color: #fff; }
.btn.danger-t { color: #ff8da1; }
.btn.sm { min-height: 36px; padding: 6px 14px; font-size: 13.5px; }
.btn.lg { min-height: 52px; font-size: 16px; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.start-btn { min-height: 60px; font-size: 19px; font-family: var(--font-d); font-style: italic; font-weight: 900; letter-spacing: 0.04em; color: #fff; border: none; background: linear-gradient(100deg, #12c2e9, #c471ed 55%, #f64f59); background-size: 200% 100%; animation: shimmer 4s ease-in-out infinite; box-shadow: 0 10px 30px rgba(196, 113, 237, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35); text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); width: 100%; }
.start-btn.ready { background: linear-gradient(100deg, #22c55e, #14b8a6); animation: none; }
@keyframes shimmer { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* ------------------------------------------------------------------ forms */
.form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.flabel { font-size: 13px; font-weight: 700; color: var(--muted); }
.hint { color: var(--muted); font-size: 12px; }
input[type='text'], input[type='email'], input[type='password'], input[type='search'], input[type='number'], input[type='datetime-local'], select, textarea, .sel {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(5, 8, 24, 0.55); color: var(--text); outline: none; transition: border 0.2s, box-shadow 0.2s; font-size: 16px; }
.sel { width: auto; min-height: 42px; font-size: 14px; padding: 8px 34px 8px 12px; appearance: none; background: rgba(5, 8, 24, 0.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a9b2d6' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 12px center; }
.sel option { background: #161d46; }
input:focus, select:focus, textarea:focus { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(51, 204, 255, 0.2); }
textarea { min-height: 120px; resize: vertical; }
.chk { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.chk input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--pink); flex: none; }
.ferr { color: #ff8da1; font-size: 13.5px; min-height: 1.2em; font-weight: 600; }
input[type='range'] { width: 100%; accent-color: var(--cyan); height: 28px; }
.tgl { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.tgl-in { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tgl-sw { width: 46px; height: 26px; border-radius: 999px; background: rgba(255, 255, 255, 0.18); position: relative; transition: background 0.2s; flex: none; }
.tgl-sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.2s; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); }
.tgl-in:checked + .tgl-sw { background: linear-gradient(90deg, var(--cyan), var(--pink)); }
.tgl-in:checked + .tgl-sw::after { transform: translateX(20px); }
.tgl-in:focus-visible + .tgl-sw { outline: 2px solid var(--sky); outline-offset: 2px; }
.tgl-l { font-weight: 700; font-size: 14px; }
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: rgba(5, 8, 24, 0.55); border: 1px solid var(--line); flex-wrap: wrap; max-width: 100%; }
.seg-b { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: none; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 700; font-size: 13.5px; }
.seg-b.on { background: var(--grad); color: #0b1026; }

/* ------------------------------------------------------------------ toasts / modal */
.toasts { position: fixed; top: calc(12px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 460px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: rgba(22, 29, 70, 0.96); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); font-weight: 600; font-size: 14px; opacity: 0; transform: translateY(-12px); transition: opacity 0.25s, transform 0.25s; pointer-events: auto; max-width: 100%; }
.toast.in { opacity: 1; transform: none; }
.toast.t-ok .ico { color: var(--green); }
.toast.t-error .ico { color: var(--red); }
.toast.t-warn .ico { color: var(--gold); }
.toast.t-info .ico { color: var(--sky); }
.modal-wrap { position: fixed; inset: 0; z-index: 1500; display: grid; place-items: center; padding: 16px; background: rgba(4, 6, 20, 0.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.2s; }
.modal-wrap.in { opacity: 1; }
.modal { width: min(100%, 460px); max-height: calc(100dvh - 32px); overflow: auto; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); transform: translateY(14px) scale(0.98); transition: transform 0.22s; }
.modal.wide { width: min(100%, 720px); }
.modal-wrap.in .modal { transform: none; }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 0 20px; }
.modal-h h3 { font-size: 18px; font-weight: 800; }
.modal-b { padding: 16px 20px; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; padding: 0 20px 18px; flex-wrap: wrap; }
.steps { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; margin: 0; }
.bul { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: #d7dcf5; word-break: keep-all; }

/* ------------------------------------------------------------------ avatars / badges */
.avatar { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; flex: none; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35), 0 4px 14px rgba(0, 0, 0, 0.3); }
.dpill { display: inline-flex; align-items: stretch; border-radius: 8px; overflow: hidden; font-family: var(--font-d); font-weight: 900; font-size: 11.5px; line-height: 1; border: 1px solid rgba(255, 255, 255, 0.25); flex: none; }
.dpill b { padding: 5px 7px; background: var(--dc); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); font-style: italic; }
.dpill i { padding: 5px 7px; background: rgba(255, 255, 255, 0.92); color: #111; font-style: normal; }
.d-easy { --dc: #66dd11; } .d-normal { --dc: #33bbee; } .d-hard { --dc: #ffaa00; } .d-expert { --dc: #ee4466; } .d-master { --dc: #bb33ee; } .d-append { --dc: #ff77dd; }
.dpill.d-append b, .lvchip.d-append, .diff-btn.d-append.on, .dmini.d-append { background: linear-gradient(120deg, #ff77dd, #aa88ff); }
.rankb { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; font-family: var(--font-d); font-weight: 900; font-style: italic; font-size: 20px; color: #fff; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35); flex: none; }
.rankb.sm { width: 26px; height: 26px; font-size: 15px; border-radius: 8px; }
.r-s { background: linear-gradient(135deg, #ffe066, #ff9f1a); }
.r-a { background: linear-gradient(135deg, #ff7ad9, #ff4f9a); }
.r-b { background: linear-gradient(135deg, #7dd3fc, #3b82f6); }
.r-c { background: linear-gradient(135deg, #86efac, #16a34a); }
.r-d { background: linear-gradient(135deg, #a3a3a3, #525252); }
.cbadge { display: inline-grid; place-items: center; min-width: 28px; height: 20px; padding: 0 5px; border-radius: 6px; font-family: var(--font-d); font-weight: 900; font-size: 11px; color: #fff; flex: none; }
.cbadge.ap { background: linear-gradient(120deg, #ffe066, #ff7ad9, #7df9ff); color: #2b1600; }
.cbadge.fc { background: linear-gradient(120deg, #7df9ff, #3b82f6); color: #001a33; }
.cbadge.cl { background: rgba(255, 255, 255, 0.2); }
.ptitle { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: linear-gradient(90deg, rgba(255, 211, 77, 0.25), rgba(255, 95, 162, 0.25)); border: 1px solid rgba(255, 211, 77, 0.5); color: #ffe7a3; }
.lvrow { display: flex; align-items: center; gap: 10px; }
.lv { font-family: var(--font-d); font-weight: 900; font-style: italic; color: var(--cyan); font-size: 16px; flex: none; }
.lvrow small { color: var(--muted); font-family: var(--font-d); font-weight: 700; flex: none; }
.pos { display: inline-grid; place-items: center; min-width: 30px; height: 30px; border-radius: 9px; font-family: var(--font-d); font-weight: 900; font-size: 15px; background: rgba(255, 255, 255, 0.08); flex: none; }
.pos.p1 { background: linear-gradient(135deg, #ffe066, #ff9f1a); color: #3a2000; }
.pos.p2 { background: linear-gradient(135deg, #e5e7eb, #94a3b8); color: #111; }
.pos.p3 { background: linear-gradient(135deg, #f5b37a, #b45309); color: #2a1200; }

/* ------------------------------------------------------------------ title */
.title-screen { position: fixed; inset: 0; overflow: hidden auto; display: flex; flex-direction: column; background: var(--bg); }
.title-bg { position: fixed; inset: 0; background: url('/img/bg-home.webp') center/cover no-repeat; animation: slowzoom 30s ease-in-out infinite alternate; }
@media (orientation: portrait) { .title-bg { background-image: url('/img/bg-home-portrait.webp'); } }
@keyframes slowzoom { from { transform: scale(1); } to { transform: scale(1.08); } }
.title-glow { position: fixed; inset: 0; background: radial-gradient(ellipse at 50% 45%, rgba(11, 16, 38, 0) 0%, rgba(11, 16, 38, 0.55) 70%, rgba(11, 16, 38, 0.9) 100%); }
.title-sparkles { position: fixed; inset: 0; background: url('/img/pattern-stars.svg'); opacity: 0.8; animation: drift 40s linear infinite; }
@keyframes drift { to { background-position: 160px -320px; } }
.title-center { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: calc(24px + var(--safe-t)) 18px 24px; min-height: 100%; }
.title-logo { width: min(82vw, 680px); height: auto; filter: drop-shadow(0 10px 40px rgba(51, 204, 255, 0.45)); animation: float 4s ease-in-out infinite; }
.title-center.with-auth .title-logo { width: min(64vw, 380px); }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.title-tag { font-size: clamp(14px, 2.2vw, 19px); font-weight: 700; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6); text-align: center; word-break: keep-all; }
.tap-start { margin-top: 18px; border: none; background: none; padding: 14px 30px; }
.tap-start span { font-family: var(--font-d); font-style: italic; font-weight: 900; font-size: clamp(22px, 4vw, 34px); letter-spacing: 0.12em; background: linear-gradient(90deg, #fff, #7df9ff, #ff9ad5, #fff); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 3s linear infinite, blink 1.6s ease-in-out infinite; filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.5)); }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.title-foot { position: relative; z-index: 2; display: flex; justify-content: space-between; gap: 12px; padding: 0 18px calc(14px + var(--safe-b)); font-size: 12px; color: rgba(255, 255, 255, 0.6); flex-wrap: wrap; }
.auth { width: min(100%, 420px); padding: 18px; display: flex; flex-direction: column; gap: 14px; animation: pagein 0.35s ease both; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px; background: rgba(5, 8, 24, 0.55); border: 1px solid var(--line); }
.auth-tab { border: none; background: none; padding: 9px; border-radius: 999px; font-weight: 800; color: var(--muted); }
.auth-tab.on { background: var(--grad); color: #0b1026; }
.closed { display: grid; place-items: center; text-align: center; gap: 8px; padding: 18px 6px; color: var(--muted); }
.closed h4 { color: var(--text); font-size: 16px; }

/* ------------------------------------------------------------------ home */
.home-top { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .home-top { grid-template-columns: 1fr auto; } }
.player-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pc-info { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 6px; }
.pc-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pc-name b { font-size: 18px; }
.player-card.guest .pc-info small { color: var(--muted); }
.pc-stats { display: flex; gap: 6px; }
.pc-stats div { display: flex; flex-direction: column; align-items: center; min-width: 54px; padding: 6px 8px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); }
.pc-stats b { font-family: var(--font-d); font-size: 18px; font-weight: 900; }
.pc-stats small { font-size: 10.5px; color: var(--muted); font-weight: 700; font-family: var(--font-d); }
.install-card { display: flex; align-items: center; gap: 12px; }
.install-card img { border-radius: 12px; }
.install-card small { display: block; color: var(--muted); font-size: 12.5px; }
.hero { position: relative; display: flex; align-items: center; gap: 22px; padding: 20px; min-height: 200px; border-radius: 24px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.2); background: linear-gradient(110deg, color-mix(in srgb, var(--song, #8b5cf6) 55%, #0b1026), #0b1026 75%); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35); isolation: isolate; }
.hero-bgimg { position: absolute; inset: -20px; background-size: cover; background-position: center; filter: blur(28px) saturate(1.3); opacity: 0.55; z-index: -1; transform: scale(1.1); }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11, 16, 38, 0) 30%, rgba(11, 16, 38, 0.75)); z-index: -1; }
.hero-jacket { width: clamp(120px, 22vw, 190px); aspect-ratio: 1; border-radius: 18px; box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(255, 255, 255, 0.3); flex: none; }
.hero.swap .hero-jacket, .hero.swap .hero-txt { animation: heroin 0.6s ease both; }
@keyframes heroin { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.hero-txt { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.hero-txt h2 { font-size: clamp(22px, 4vw, 34px); font-weight: 900; text-shadow: 0 3px 14px rgba(0, 0, 0, 0.5); }
.hero-txt p { color: #e2e6ff; font-size: 14px; }
.kicker { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); font-size: 12.5px; font-weight: 800; letter-spacing: 0.02em; }
.hero-diffs { display: flex; gap: 6px; flex-wrap: wrap; }
.hero.event { background: linear-gradient(110deg, color-mix(in srgb, var(--ev) 70%, #0b1026), #1b1050); }
.hero-art { position: relative; width: 190px; height: 160px; flex: none; }
.hero-art img { position: absolute; width: 120px; border-radius: 14px; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5); left: calc(var(--i) * 34px); top: calc(var(--i) * 14px); transform: rotate(calc(-8deg + var(--i) * 8deg)); }
.hero-meta { display: flex; align-items: center; gap: 4px; font-weight: 700; }
.hero-meta .cd { font-family: var(--font-d); color: var(--gold); }
@media (max-width: 560px) {
  .hero { flex-direction: column; align-items: flex-start; gap: 14px; padding: 16px; }
  .hero-art { width: 100%; height: 130px; }
  .hero-art img { width: 100px; }
}
.mode-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .mode-grid { grid-template-columns: repeat(4, 1fr); } }
.mode-card { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; min-height: 120px; padding: 16px; border-radius: 20px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.22); color: #fff; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28); transition: transform 0.18s, box-shadow 0.18s; isolation: isolate; }
.mode-card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(0, 0, 0, 0.35); }
.mode-card:active { transform: scale(0.98); }
.mode-card.big { grid-column: span 2; min-height: 150px; }
@media (min-width: 760px) { .mode-card.big { grid-row: span 2; min-height: 252px; } }
.mc-ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.22); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.mode-card.big .mc-ic { width: 70px; height: 70px; border-radius: 22px; }
.mc-t b { display: block; font-size: 18px; font-weight: 900; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); }
.mode-card.big .mc-t b { font-size: clamp(24px, 3.4vw, 34px); font-family: var(--font); }
.mc-t small { font-size: 12.5px; opacity: 0.92; font-weight: 600; }
.mc-badge { position: absolute; top: 12px; right: 12px; padding: 3px 10px; border-radius: 999px; background: rgba(0, 0, 0, 0.35); font-family: var(--font-d); font-weight: 900; font-size: 12px; }
.mc-shine { position: absolute; inset: 0; z-index: -1; background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.25) 45%, transparent 60%); transform: translateX(-100%); animation: shine 5s ease-in-out infinite; }
@keyframes shine { 0%, 70% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.m-free { background: linear-gradient(135deg, #12c2e9 0%, #8b5cf6 55%, #ff5fa2 100%); }
.m-challenge { background: linear-gradient(135deg, #f97316, #ef4444); }
.m-rank { background: linear-gradient(135deg, #6366f1, #1e1b4b); }
.m-multi { background: linear-gradient(135deg, #10b981, #0e7490); }
.m-event { background: linear-gradient(135deg, #ec4899, #8b5cf6); }
.m-practice { background: linear-gradient(135deg, #0ea5e9, #1e3a8a); }
.m-auto { background: linear-gradient(135deg, #a855f7, #312e81); }
.m-howto { background: linear-gradient(135deg, #64748b, #1e293b); }
.m-ranking { background: linear-gradient(135deg, #eab308, #b45309); }
.news-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-top: 1px solid var(--line); }
.news-row:first-of-type { border-top: none; }
.news-row b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.news-row small { color: var(--muted); flex: none; }
.nk { padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 800; background: rgba(51, 204, 255, 0.2); color: #9ae6ff; flex: none; }
.nk.k-update { background: rgba(74, 222, 128, 0.2); color: #a7f3c0; }
.nk.k-event { background: rgba(255, 95, 162, 0.22); color: #ffb3d4; }
.nk.k-maintenance { background: rgba(255, 211, 77, 0.22); color: #ffe7a3; }

/* ------------------------------------------------------------------ song select */
.songsel { gap: 12px; }
.sl-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sl-title { display: flex; align-items: baseline; gap: 10px; }
.sl-title h2 { display: flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 900; }
.sl-tools { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; justify-content: flex-end; }
.search { max-width: 260px; min-height: 42px !important; font-size: 14px !important; }
.sl-body { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 16px; align-items: start; }
.sl-list { display: flex; flex-direction: column; gap: 8px; max-height: calc(100dvh - 200px); overflow-y: auto; padding: 2px 6px 12px 2px; scrollbar-width: thin; }
.song-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; text-align: left; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); transition: transform 0.15s, border 0.2s, background 0.2s; position: relative; overflow: hidden; }
.song-row img { width: 64px; height: 64px; border-radius: 12px; flex: none; }
.song-row:hover { background: rgba(30, 38, 86, 0.85); }
.song-row.on { border-color: var(--song); background: linear-gradient(90deg, color-mix(in srgb, var(--song) 30%, #141a3e), #141a3e); box-shadow: 0 0 0 1px var(--song), 0 8px 24px rgba(0, 0, 0, 0.3); }
.song-row.on::before { content: ''; position: absolute; left: 0; top: 10%; bottom: 10%; width: 4px; border-radius: 0 4px 4px 0; background: var(--song); }
.sr-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sr-t b { font-size: 15.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-t small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-levels { display: flex; gap: 4px; }
.lvchip { display: inline-grid; place-items: center; min-width: 25px; height: 20px; padding: 0 4px; border-radius: 6px; background: var(--dc); color: #fff; font-family: var(--font-d); font-weight: 900; font-size: 11.5px; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); opacity: 0.55; }
.lvchip.sel { opacity: 1; box-shadow: 0 0 0 2px #fff; }
.sr-badge { flex: none; }
.sl-detail { position: sticky; top: calc(var(--topbar-h) + 12px); display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: 24px; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.sheet-back { display: none; }
.sd-head { display: flex; gap: 18px; align-items: center; }
.sd-jacket { position: relative; width: clamp(130px, 18vw, 220px); flex: none; }
.sd-jacket img { width: 100%; aspect-ratio: 1; border-radius: 20px; box-shadow: 0 14px 40px color-mix(in srgb, var(--song) 45%, transparent), 0 0 0 2px rgba(255, 255, 255, 0.25); }
.ev-bonus { position: absolute; left: 8px; top: 8px; padding: 3px 9px; border-radius: 999px; background: var(--pink); font-size: 11px; font-weight: 800; }
.sd-info { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sd-info h2 { font-size: clamp(22px, 2.6vw, 32px); font-weight: 900; }
.sd-info p { color: var(--muted); font-weight: 600; }
.sd-meta { display: flex; gap: 12px; flex-wrap: wrap; color: #d7dcf5; font-size: 13px; }
.sd-meta span { display: inline-flex; align-items: center; gap: 4px; }
.diff-btns { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.diff-btn { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0; padding: 8px 2px 7px; border-radius: 14px; border: 2px solid color-mix(in srgb, var(--dc) 60%, transparent); background: color-mix(in srgb, var(--dc) 14%, rgba(5, 8, 24, 0.5)); transition: transform 0.15s, background 0.2s; min-width: 0; }
.diff-btn small { font-family: var(--font-d); font-weight: 900; font-style: italic; font-size: 10.5px; color: var(--dc); letter-spacing: 0.02em; }
.diff-btn b { font-family: var(--font-d); font-weight: 900; font-size: 24px; line-height: 1.1; }
.diff-btn .cbadge { position: absolute; top: -8px; right: -4px; min-width: 24px; height: 17px; font-size: 10px; }
.diff-btn.on { background: var(--dc); border-color: #fff; transform: translateY(-2px); box-shadow: 0 8px 20px color-mix(in srgb, var(--dc) 50%, transparent); }
.diff-btn.on small { color: #fff; }
.diff-btn:disabled { opacity: 0.25; cursor: not-allowed; }
.sd-rec { display: grid; grid-template-columns: 1.2fr 1fr; gap: 10px; }
.best, .peek-wrap { padding: 12px; border-radius: 16px; background: rgba(5, 8, 24, 0.45); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.best > small, .peek-wrap > small { color: var(--muted); font-weight: 700; font-size: 12px; display: flex; align-items: center; gap: 4px; }
.best-v { display: flex; align-items: center; gap: 10px; }
.best-v .num { font-size: 26px; }
.best-v.none { color: var(--muted); font-weight: 700; padding: 6px 0; }
.peek-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.peek-row .pos { min-width: 22px; height: 22px; font-size: 12px; border-radius: 6px; }
.peek-row b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.peek-row.mine { border-top: 1px dashed var(--line); padding-top: 6px; color: var(--cyan); }
.live-opts { display: flex; flex-direction: column; gap: 10px; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper .num { font-size: 22px; min-width: 52px; text-align: center; color: var(--cyan); }
.st-l { font-weight: 700; font-size: 14px; color: #d7dcf5; flex: 1; }
.opt-row { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.opt-row.col { flex-direction: column; align-items: stretch; gap: 6px; }
@media (max-width: 899px) {
  .sl-body { grid-template-columns: 1fr; }
  .sl-list { max-height: none; overflow: visible; padding: 0; }
  .sl-detail { position: fixed; inset: 0; z-index: 80; border-radius: 0; overflow-y: auto; padding: calc(16px + var(--safe-t)) 16px calc(24px + var(--safe-b)); transform: translateY(100%); transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); background: rgba(13, 18, 46, 0.97); visibility: hidden; }
  .songsel.detail-open .sl-detail { transform: none; visibility: visible; }
  .sheet-back { display: inline-grid; align-self: flex-start; }
  .search { max-width: none; flex: 1 1 100%; }
  .sl-tools { justify-content: stretch; }
  .sd-head { flex-direction: column; align-items: center; text-align: center; }
  .sd-meta { justify-content: center; }
  .sd-jacket { width: min(56vw, 240px); }
  .diff-btns { grid-template-columns: repeat(3, 1fr); }
  .sd-rec { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------ live */
.live-screen { position: fixed; inset: 0; background: #05060f; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; --accent: #22d3c5; --accent2: #ff5fa2; }
.live-bg { position: absolute; inset: 0; background: url('/img/bg-stage.webp') center/cover no-repeat; }
.live-jacket { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(34px) saturate(1.3); opacity: 0.45; transform: scale(1.1); }
.live-dim { position: absolute; inset: 0; background: #05060f; opacity: 0.55; }
.live-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hud { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: calc(10px + var(--safe-t)) max(12px, var(--safe-r)) 0 max(12px, var(--safe-l)); pointer-events: none; z-index: 5; }
.hud-score { display: flex; align-items: center; gap: 8px; width: min(36vw, 340px); }
.hs-rank { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; font-family: var(--font-d); font-weight: 900; font-style: italic; font-size: 26px; color: #fff; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4); flex: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5); transition: background 0.3s; }
.hs-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hs-gauge { position: relative; height: 10px; border-radius: 6px; background: rgba(0, 0, 0, 0.45); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25); }
.hs-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: linear-gradient(90deg, var(--accent), #fff 70%, var(--accent2)); transition: width 0.25s; box-shadow: 0 0 10px var(--accent); }
.hs-mark { position: absolute; top: 12px; transform: translateX(-50%); font-family: var(--font-d); font-weight: 900; font-size: 10px; color: rgba(255, 255, 255, 0.7); }
.hs-mark::before { content: ''; position: absolute; left: 50%; top: -12px; width: 2px; height: 10px; background: rgba(255, 255, 255, 0.55); }
.hs-num { font-size: clamp(18px, 2.6vw, 28px); font-style: italic; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6); margin-top: 10px; line-height: 1; }
.hud-title { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; min-width: 0; flex: 1; padding-top: 2px; }
.ht-name { font-weight: 800; font-size: 13px; opacity: 0.9; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ht-mode { font-size: 11px; font-weight: 700; color: var(--gold); }
.hud-right { display: flex; align-items: center; gap: 10px; }
.hud-life { display: flex; align-items: center; gap: 6px; width: min(28vw, 220px); }
.hl-ic { color: #ff7aa8; filter: drop-shadow(0 0 6px #ff4f9a); }
.hl-bar { flex: 1; height: 12px; border-radius: 6px; background: rgba(0, 0, 0, 0.45); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25); overflow: hidden; }
.hl-fill { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #4ade80, #a3e635); transition: width 0.2s; }
.hl-fill.low { background: linear-gradient(90deg, #ff4d6d, #f97316); animation: blink 0.6s infinite; }
.hud-life .num { font-size: 14px; min-width: 38px; text-align: right; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6); }
.hud-pause { pointer-events: auto; width: 46px; height: 46px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.35); background: rgba(0, 0, 0, 0.35); display: grid; place-items: center; backdrop-filter: blur(6px); }
@media (max-width: 700px), (max-height: 480px) {
  .hud-score { width: 40vw; }
  .hs-rank { width: 34px; height: 34px; font-size: 20px; }
  .hud-title { display: none; }
  .hud-life { width: 30vw; }
  .hud-pause { width: 40px; height: 40px; }
}
.side-panel { position: absolute; right: max(12px, var(--safe-r)); top: calc(70px + var(--safe-t)); z-index: 5; width: min(240px, 34vw); padding: 10px; border-radius: 14px; background: rgba(5, 8, 24, 0.55); border: 1px solid rgba(255, 255, 255, 0.18); backdrop-filter: blur(8px); pointer-events: none; font-size: 12px; }
.vs-row { display: grid; grid-template-columns: auto 1fr; gap: 6px 8px; align-items: center; }
.vs-t { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.vs-t small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #d7dcf5; }
.vs-t .num { font-size: 15px; }
.vs-bar { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.vs-bar i { display: block; height: 100%; background: var(--accent); transition: width 0.3s; }
.vs-row.op .vs-bar i { background: #ff7a90; }
.vs-x { display: flex; justify-content: space-between; align-items: center; margin: 6px 0; font-family: var(--font-d); font-weight: 900; font-style: italic; color: var(--gold); }
.vs-lead.up { color: #4ade80; }
.vs-lead.down { color: #ff7a90; }
.mp-h { display: flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.mp-list { display: flex; flex-direction: column; gap: 5px; }
.mp-row { display: flex; align-items: center; gap: 6px; }
.mp-row.me .mp-n { color: var(--cyan); }
.mp-row.done { opacity: 0.6; }
.mp-n { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.mp-s { font-size: 13px; }
.mp-c { color: var(--gold); font-family: var(--font-d); font-weight: 800; }
@media (max-width: 700px) { .side-panel { width: 42vw; top: calc(60px + var(--safe-t)); padding: 7px; } }
.auto-mark, .mod-tags { position: absolute; left: 50%; transform: translateX(-50%); top: calc(64px + var(--safe-t)); z-index: 5; display: flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: rgba(0, 0, 0, 0.45); font-family: var(--font-d); font-weight: 900; font-size: 12px; letter-spacing: 0.08em; color: var(--gold); pointer-events: none; }
.mod-tags { top: auto; bottom: calc(10px + var(--safe-b)); gap: 6px; background: none; }
.mod-tags span { padding: 3px 10px; border-radius: 999px; background: rgba(255, 95, 162, 0.35); color: #fff; font-family: var(--font); letter-spacing: 0; }
.ov { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; }
.ov-loading { background: rgba(5, 6, 15, 0.7); }
.ld-card, .pause-card, .fail-card { width: min(100%, 360px); display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 26px 22px; text-align: center; border-radius: 24px; background: rgba(20, 26, 62, 0.92); border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.ld-bar { width: 100%; height: 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.ld-bar i { display: block; height: 100%; width: 0; background: var(--grad); transition: width 0.2s; }
.ov-pause, .ov-fail { background: rgba(5, 6, 15, 0.65); backdrop-filter: blur(6px); }
.pause-card h2, .fail-card h2 { font-family: var(--font-d); font-weight: 900; font-style: italic; font-size: 36px; letter-spacing: 0.06em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fail-card h2 { background: linear-gradient(90deg, #ff4d6d, #a855f7); -webkit-background-clip: text; background-clip: text; }
.fail-score { font-size: 30px; }
.ov-count b { font-family: var(--font-d); font-weight: 900; font-style: italic; font-size: 120px; color: #fff; text-shadow: 0 0 40px var(--accent); animation: countpop 1s ease both; }
@keyframes countpop { 0% { transform: scale(1.6); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 100% { opacity: 0.2; } }
.ov-intro { background: radial-gradient(ellipse at center, rgba(5, 6, 15, 0.3), rgba(5, 6, 15, 0.8)); transition: opacity 0.4s; }
.ov-intro.out { opacity: 0; }
.intro-card { display: flex; align-items: center; gap: 18px; padding: 18px 24px 18px 18px; border-radius: 24px; background: linear-gradient(110deg, color-mix(in srgb, var(--song) 55%, #10153a), rgba(16, 21, 58, 0.95)); border: 1px solid rgba(255, 255, 255, 0.3); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); animation: introin 0.6s cubic-bezier(0.2, 0.9, 0.2, 1.2) both; max-width: 100%; }
.intro-card img { width: clamp(90px, 16vw, 140px); border-radius: 16px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); }
.intro-card small { font-family: var(--font-d); font-weight: 900; font-style: italic; letter-spacing: 0.1em; color: var(--gold); }
.intro-card h2 { font-size: clamp(20px, 3.6vw, 34px); font-weight: 900; }
.intro-card p { color: #d7dcf5; margin-bottom: 8px; }
@keyframes introin { from { opacity: 0; transform: translateY(30px) scale(0.92); } to { opacity: 1; transform: none; } }
.ov-finish { pointer-events: none; background: radial-gradient(ellipse at center, rgba(5, 6, 15, 0.2), rgba(5, 6, 15, 0.6)); animation: fadein 0.3s both; }
@keyframes fadein { from { opacity: 0; } }
.fin-text { display: flex; font-family: var(--font-d); font-weight: 900; font-style: italic; font-size: clamp(40px, 9vw, 110px); letter-spacing: 0.04em; }
.fin-text span { display: inline-block; animation: letterin 0.5s cubic-bezier(0.2, 0.9, 0.2, 1.3) both; animation-delay: calc(var(--i) * 0.05s); background: linear-gradient(180deg, #fff 20%, var(--fc1, #7df9ff) 60%, var(--fc2, #3b82f6)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.35)) drop-shadow(0 0 24px var(--fc1, #7df9ff)); }
.f-ap { --fc1: #ffe066; --fc2: #ff7ad9; }
.f-fc { --fc1: #7df9ff; --fc2: #3b82f6; }
.f-clear { --fc1: #ffffff; --fc2: #a78bfa; }
@keyframes letterin { from { opacity: 0; transform: translateY(-60px) scale(1.5); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ result */
.result-screen { position: fixed; inset: 0; overflow-y: auto; background: var(--bg); }
.rs-bg { position: fixed; inset: -40px; background-size: cover; background-position: center; filter: blur(40px) saturate(1.2) brightness(0.55); transform: scale(1.1); }
.rs-wrap { position: relative; max-width: 1100px; margin: 0 auto; padding: calc(16px + var(--safe-t)) max(16px, var(--safe-r)) calc(24px + var(--safe-b)) max(16px, var(--safe-l)); display: flex; flex-direction: column; gap: 14px; }
.rs-title { display: flex; align-items: baseline; gap: 12px; }
.rs-title span { font-family: var(--font-d); font-weight: 900; font-style: italic; font-size: 34px; letter-spacing: 0.08em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rs-title small { color: var(--muted); font-weight: 700; }
.rs-main { display: grid; grid-template-columns: 260px 1fr; gap: 22px; padding: 20px; animation: pagein 0.5s ease both; }
.rs-left { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.rs-jacket img { width: 100%; max-width: 240px; border-radius: 20px; box-shadow: 0 16px 40px color-mix(in srgb, var(--song) 40%, transparent); }
.rs-left h2 { font-size: 20px; font-weight: 900; }
.rs-sub { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }
.mode-tag { font-size: 12px; font-weight: 700; color: var(--gold); }
.rs-right { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.rs-top { display: flex; align-items: center; gap: 18px; }
.rs-rank { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 26px; font-family: var(--font-d); font-weight: 900; font-style: italic; font-size: 64px; color: #fff; text-shadow: 0 4px 10px rgba(0, 0, 0, 0.35); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.6), 0 14px 40px rgba(0, 0, 0, 0.4); animation: rankin 0.7s cubic-bezier(0.2, 0.9, 0.2, 1.4) 0.3s both; flex: none; }
@keyframes rankin { from { transform: scale(2.2) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
.rs-scorebox { display: flex; flex-direction: column; min-width: 0; }
.rs-scorebox > small:first-child { font-family: var(--font-d); font-weight: 900; color: var(--muted); letter-spacing: 0.1em; }
.rs-score { font-size: clamp(36px, 6vw, 58px); font-style: italic; line-height: 1.05; }
.rs-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.big-badge { padding: 6px 14px; border-radius: 10px; font-family: var(--font-d); font-weight: 900; font-style: italic; letter-spacing: 0.05em; font-size: 15px; animation: pagein 0.4s ease 0.8s both; }
.big-badge.ap { background: linear-gradient(120deg, #ffe066, #ff7ad9, #7df9ff); color: #2b1600; }
.big-badge.fc { background: linear-gradient(120deg, #7df9ff, #3b82f6); color: #001a33; }
.big-badge.clear { background: rgba(74, 222, 128, 0.25); color: #bbf7d0; border: 1px solid rgba(74, 222, 128, 0.5); }
.big-badge.fail { background: rgba(255, 77, 109, 0.25); color: #ffc2cd; border: 1px solid rgba(255, 77, 109, 0.5); }
.big-badge.nb { background: linear-gradient(120deg, #ff5fa2, #8b5cf6); color: #fff; animation: pagein 0.4s ease 0.8s both, blink 1.4s ease-in-out 1.2s infinite; }
.rs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.judges { display: flex; flex-direction: column; gap: 6px; }
.jrow { display: flex; justify-content: space-between; align-items: center; padding: 7px 12px; border-radius: 10px; background: rgba(5, 8, 24, 0.45); font-family: var(--font-d); font-weight: 900; font-style: italic; }
.jrow .num { font-style: normal; font-size: 18px; }
.j-perfect span, tr.j-perfect td:first-child { background: linear-gradient(90deg, #7df9ff, #ff7ad9, #fff27a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.j-great span, tr.j-great td:first-child { color: #ff7ac4; }
.j-good span, tr.j-good td:first-child { color: #6ac7ff; }
.j-bad span, tr.j-bad td:first-child { color: #b794ff; }
.j-miss span, tr.j-miss td:first-child { color: #9ca3af; }
.rs-side { display: flex; flex-direction: column; gap: 8px; }
.stat { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: rgba(5, 8, 24, 0.45); }
.stat small { color: var(--muted); font-weight: 700; font-size: 12px; }
.stat > small:first-child { width: 100%; }
.stat .num { font-size: 22px; }
.stat.fl { gap: 16px; font-family: var(--font-d); font-weight: 900; font-style: italic; }
.stat.fl .fast { color: #5ab8ff; }
.stat.fl .late { color: #ff9d4d; }
.rs-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.ex-h { display: flex; align-items: center; gap: 7px; font-weight: 800; margin-bottom: 8px; }
.lvup { margin-left: auto; padding: 2px 10px; border-radius: 999px; background: linear-gradient(90deg, #ffe066, #ff7ad9); color: #2b1600; font-family: var(--font-d); font-weight: 900; font-style: italic; font-size: 12px; animation: blink 1s infinite; }
.exp .lvrow { margin-bottom: 6px; }
.extra p { margin-top: 6px; font-weight: 700; }
.extra p.big { font-size: 17px; }
.medal { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 900; }
.medal.m1, .cm.m1.got { color: #e3a46b; }
.medal.m2, .cm.m2.got { color: #e2e8f0; }
.medal.m3, .cm.m3.got { color: #ffd34d; }
.medal.m0 { color: var(--muted); }
.rk-big { font-family: var(--font-d); font-weight: 900; font-style: italic; font-size: 44px; letter-spacing: 0.06em; }
.rk.s-win .rk-big { color: #ffd34d; text-shadow: 0 0 20px rgba(255, 211, 77, 0.6); }
.rk.s-lose .rk-big { color: #94a3b8; }
.rk.s-draw .rk-big { color: #7dd3fc; }
.rk-vs { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rk-vs div { display: flex; flex-direction: column; }
.rk-vs small { color: var(--muted); }
.rk-vs span { font-family: var(--font-d); font-weight: 900; color: var(--gold); }
.ev-pt { display: flex; align-items: baseline; gap: 10px; }
.ev-pt .num { font-size: 30px; color: var(--pink); }
.ach-unlock { display: flex; align-items: center; gap: 12px; border-color: rgba(255, 211, 77, 0.5); animation: pagein 0.5s ease 1s both; }
.ach-unlock .ico { color: var(--gold); }
.ach-unlock small { color: var(--gold); font-weight: 800; }
.ach-unlock p { color: var(--muted); font-size: 13px; }
.rs-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; padding-top: 4px; }
.rs-actions .btn { min-width: 130px; }
@media (max-width: 760px) {
  .rs-main { grid-template-columns: 1fr; padding: 16px; }
  .rs-left { flex-direction: row; text-align: left; }
  .rs-jacket img { width: 84px; }
  .rs-left h2 { font-size: 17px; }
  .rs-sub { justify-content: flex-start; }
  .rs-rank { width: 76px; height: 76px; font-size: 50px; border-radius: 20px; }
  .rs-grid { grid-template-columns: 1fr; }
  .rs-actions .btn { flex: 1; min-width: 0; }
}

/* ------------------------------------------------------------------ ranking rows (shared) */
.rk-row { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-top: 1px solid var(--line); min-width: 0; }
.rk-row:first-child, .card > .sec-h + .rk-row { border-top: none; }
.rk-row.me { background: linear-gradient(90deg, rgba(34, 211, 197, 0.16), transparent); border-radius: 10px; }
.rk-row > b, .rk-name { flex: 1; min-width: 0; }
.rk-row > b, .rk-name b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.rk-name small { color: var(--muted); font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-v { font-size: 17px; flex: none; }
.rk-badges { display: flex; align-items: center; gap: 6px; flex: none; }
.rk-tools { display: flex; gap: 8px; }
.rk-tools .sel { flex: 1; max-width: 420px; }
.rk-song { display: flex; align-items: center; gap: 12px; }
.rk-song img { width: 56px; height: 56px; border-radius: 12px; }
.rk-song > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rk-song small { color: var(--muted); }
.diff-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.dtab { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px; border: 2px solid color-mix(in srgb, var(--dc) 60%, transparent); background: rgba(5, 8, 24, 0.45); font-family: var(--font-d); font-weight: 900; font-style: italic; font-size: 13px; color: var(--dc); }
.dtab i { font-style: normal; color: var(--text); }
.dtab.on { background: var(--dc); color: #fff; border-color: #fff; }
.rk-mine { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 8px; border-radius: 12px; background: rgba(34, 211, 197, 0.12); border: 1px solid rgba(34, 211, 197, 0.4); }
.rk-mine small { color: var(--cyan); font-weight: 800; }
.rk-mine .num:last-child { margin-left: auto; }
@media (max-width: 560px) { .hide-sm { display: none; } }

/* ------------------------------------------------------------------ challenge */
.ch-stage { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; background: linear-gradient(110deg, rgba(249, 115, 22, 0.35), rgba(20, 26, 62, 0.8)); }
.chs-num { display: flex; flex-direction: column; }
.chs-num small { font-family: var(--font-d); font-weight: 900; letter-spacing: 0.08em; color: #ffd0a8; font-size: 12px; }
.chs-num b { font-size: 48px; line-height: 1; font-style: italic; }
.chs-prog { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 8px; }
.chs-prog small { color: #ffe6d1; }
.pips { display: flex; gap: 6px; }
.pips i { width: 40px; height: 10px; border-radius: 5px; background: rgba(255, 255, 255, 0.2); }
.pips i.on { background: linear-gradient(90deg, #ffd34d, #f97316); box-shadow: 0 0 10px rgba(249, 115, 22, 0.7); }
.chs-reset { display: flex; align-items: center; gap: 4px; font-weight: 700; color: #ffe6d1; }
.chs-reset b { font-family: var(--font-d); }
.ch-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.ch-card { position: relative; display: flex; flex-direction: column; gap: 12px; overflow: hidden; border-top: 4px solid var(--song); }
.chc-top { display: flex; align-items: center; gap: 8px; }
.chc-slot { padding: 3px 9px; border-radius: 8px; background: var(--song); color: #0b1026; font-family: var(--font-d); font-weight: 900; font-size: 12px; }
.chc-body { display: flex; gap: 12px; }
.chc-body img { width: 96px; height: 96px; border-radius: 14px; flex: none; }
.chc-body h3 { font-size: 17px; margin-bottom: 6px; }
.mods { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.modtag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: #ffc2d9; }
.modtag.plain { color: var(--muted); }
.chc-medals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cm { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px; background: rgba(5, 8, 24, 0.45); color: rgba(255, 255, 255, 0.25); }
.cm small { font-size: 11px; color: var(--muted); }
.cm.got { background: rgba(255, 255, 255, 0.1); }
.chc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chc-foot span { color: var(--muted); font-size: 13px; }
.medal-ribbon { position: absolute; top: 12px; right: -34px; transform: rotate(35deg); padding: 3px 40px; font-weight: 900; font-size: 12px; color: #1a1000; }
.medal-ribbon.m1 { background: #e3a46b; }
.medal-ribbon.m2 { background: #e2e8f0; }
.medal-ribbon.m3 { background: linear-gradient(90deg, #ffe066, #ffb800); }
.medals { letter-spacing: -2px; font-size: 12px; }

/* ------------------------------------------------------------------ rank */
.rank-top { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 760px) { .rank-top { grid-template-columns: 1fr; } }
.tier { display: inline-flex; align-items: center; gap: 4px; color: var(--tc); font-family: var(--font-d); font-weight: 900; font-style: italic; flex: none; }
.tier.sm { font-size: 12px; }
.tier.lg { flex-direction: column; font-size: 22px; filter: drop-shadow(0 0 16px var(--tc)); }
.tier-card { display: flex; align-items: center; gap: 22px; border-color: color-mix(in srgb, var(--tc) 50%, transparent); background: linear-gradient(120deg, color-mix(in srgb, var(--tc) 22%, rgba(20, 26, 62, 0.85)), rgba(20, 26, 62, 0.85)); }
.tc-info { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.tc-pts { display: flex; align-items: baseline; gap: 6px; }
.tc-pts .num { font-size: 36px; }
.tc-info .bar i { background: var(--tc); }
.match-box { display: flex; flex-direction: column; gap: 10px; }
.match-box > small { color: var(--muted); font-weight: 700; }
.rank-diffs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.rank-diffs .diff-btn b { font-size: 13px; }
.tier-list { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.tl-i { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--tc); flex: 1 0 auto; min-width: 84px; }
.tl-i b { font-family: var(--font-d); font-style: italic; font-size: 12px; }
.tl-i small { color: var(--muted); font-size: 11px; }
.match-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-top: 1px solid var(--line); }
.mr-st { width: 52px; font-family: var(--font-d); font-weight: 900; font-style: italic; flex: none; }
.s-win .mr-st { color: var(--gold); }
.s-lose .mr-st, .s-abandon .mr-st { color: #94a3b8; }
.s-draw .mr-st { color: #7dd3fc; }
.mr-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mr-t b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mr-t small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mr-d { font-family: var(--font-d); font-weight: 900; min-width: 36px; text-align: right; }
.match-ov { position: fixed; inset: 0; z-index: 1400; display: grid; place-items: center; padding: 16px; background: rgba(4, 6, 20, 0.85); backdrop-filter: blur(8px); animation: fadein 0.3s both; }
.match-card { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.radar { position: relative; width: 140px; height: 140px; }
.radar i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--cyan); animation: radar 1.8s ease-out infinite; }
.radar i:nth-child(2) { animation-delay: 0.6s; }
.radar i:nth-child(3) { animation-delay: 1.2s; }
@keyframes radar { from { transform: scale(0.2); opacity: 1; } to { transform: scale(1.2); opacity: 0; } }
.vs-card { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; width: min(100%, 720px); animation: introin 0.5s both; }
.vs-side { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.vs-side.me { animation: slidein-l 0.5s both; }
.vs-side.op { animation: slidein-r 0.5s both; }
@keyframes slidein-l { from { transform: translateX(-80px); opacity: 0; } }
@keyframes slidein-r { from { transform: translateX(80px); opacity: 0; } }
.vs-side b { font-size: 18px; }
.vs-side small { color: var(--muted); }
.vs-mid { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.vs-mid img { width: 120px; border-radius: 14px; }
.vs-big { font-family: var(--font-d); font-weight: 900; font-style: italic; font-size: 54px; color: var(--gold); text-shadow: 0 0 30px rgba(255, 211, 77, 0.7); }

/* ------------------------------------------------------------------ multi */
.multi-actions { display: flex; flex-direction: column; gap: 10px; }
.ma-row { display: flex; gap: 10px; flex-wrap: wrap; }
.ma-row > .btn { flex: 1; }
.join { display: flex; gap: 8px; flex: 1.4; min-width: 240px; }
.code-in { text-transform: uppercase; letter-spacing: 0.3em; font-family: var(--font-d); font-weight: 800; text-align: center; }
.room-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.room-row { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; }
.room-row img, .room-noart { width: 56px; height: 56px; border-radius: 12px; flex: none; display: grid; place-items: center; background: rgba(255, 255, 255, 0.08); }
.room-row > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.room-row > div b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-row small { color: var(--muted); }
.room-cnt { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-d); font-weight: 800; }
.room-code { padding: 4px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.1); font-family: var(--font-d); font-weight: 900; letter-spacing: 0.15em; border: none; display: inline-flex; align-items: center; gap: 6px; }
.room-code.big { margin-left: auto; font-size: 18px; padding: 8px 14px; background: var(--grad); color: #0b1026; }
.room-song { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border-left: 4px solid var(--song, var(--line)); }
.room-song img, .room-song .room-noart { width: 88px; height: 88px; border-radius: 14px; }
.rs-t { flex: 1; min-width: 180px; }
.rs-t small { color: var(--muted); font-weight: 700; }
.rs-t h3 { font-size: 19px; }
.rs-t p { color: var(--muted); font-size: 13px; }
.my-diff { display: flex; flex-direction: column; gap: 8px; }
.my-diff > small { color: var(--muted); font-weight: 700; }
.members { display: grid; gap: 10px; grid-template-columns: repeat(5, 1fr); }
@media (max-width: 900px) { .members { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .members { grid-template-columns: repeat(2, 1fr); } }
.member { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 16px 8px 12px; min-height: 170px; justify-content: center; }
.member b { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member small { color: var(--muted); }
.member.me { border-color: var(--cyan); }
.member.ready { box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.6) inset; }
.member.empty { border-style: dashed; color: var(--muted); background: rgba(255, 255, 255, 0.03); }
.member .host { position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 800; color: var(--gold); }
.mstate { font-family: var(--font-d); font-weight: 900; font-size: 12px; color: var(--muted); }
.member.ready .mstate { color: #4ade80; }
.room-result .team { font-size: 18px; color: var(--gold); }
.rr-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-top: 1px solid var(--line); }
.rr-row b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr-row.mvp { background: linear-gradient(90deg, rgba(255, 211, 77, 0.18), transparent); border-radius: 10px; }
.mvp-tag { padding: 2px 8px; border-radius: 6px; background: linear-gradient(90deg, #ffe066, #ff9f1a); color: #2b1600; font-family: var(--font-d); font-weight: 900; font-size: 11px; }
.stamp-box { display: flex; flex-direction: column; gap: 10px; }
.stamps { display: flex; gap: 6px; flex-wrap: wrap; }
.stamp-b { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); font-weight: 700; font-size: 13px; }
.stamp-b:active { transform: scale(0.95); background: var(--grad); color: #0b1026; }
.stamp-feed { display: flex; flex-direction: column; gap: 4px; min-height: 20px; }
.sf-row { display: flex; gap: 8px; font-size: 13px; animation: pagein 0.3s both; }
.sf-row b { color: var(--cyan); }
.room-actions { display: flex; gap: 10px; position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-b) + 8px); z-index: 5; }
.room-actions .btn.ghost { flex: none; }
@media (min-width: 900px) { .room-actions { bottom: 12px; } }

/* ------------------------------------------------------------------ events */
.ev-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.ev-card { display: flex; flex-direction: column; gap: 8px; border-left: 5px solid var(--ev); background: linear-gradient(120deg, color-mix(in srgb, var(--ev) 22%, rgba(20, 26, 62, 0.85)), rgba(20, 26, 62, 0.85)); }
.ev-card p { color: #d7dcf5; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ev-state { align-self: flex-start; padding: 2px 10px; border-radius: 999px; background: var(--ev); color: #fff; font-size: 12px; font-weight: 800; }
.st-ended { opacity: 0.7; }
.ev-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: #d7dcf5; }
.ev-meta b { font-family: var(--font-d); color: var(--gold); }
.ev-meta .bonus { margin-left: auto; color: var(--pink); font-weight: 800; }
.ev-hero { display: flex; flex-direction: column; gap: 10px; padding: 24px; border: 1px solid rgba(255, 255, 255, 0.25); background: linear-gradient(120deg, color-mix(in srgb, var(--ev) 60%, #10153a), #10153a); }
.ev-hero h2 { font-size: clamp(24px, 4vw, 36px); font-weight: 900; }
.ev-hero small { color: #d7dcf5; }
.ev-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
@media (max-width: 860px) { .ev-cols { grid-template-columns: 1fr; } }
.ev-mine { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.ev-mine div { display: flex; flex-direction: column; align-items: center; padding: 10px; border-radius: 12px; background: rgba(5, 8, 24, 0.45); }
.ev-mine small { color: var(--muted); font-size: 12px; }
.ev-mine .num { font-size: 20px; color: var(--pink); }
.bonus-songs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 12px; }
.bsong { display: flex; flex-direction: column; gap: 4px; }
.bsong img { border-radius: 12px; box-shadow: 0 0 0 2px var(--song); }
.bsong b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bsong small { color: var(--pink); font-weight: 800; font-family: var(--font-d); }

/* ------------------------------------------------------------------ profile */
.prof-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.av-btn { position: relative; border: none; background: none; padding: 0; border-radius: 50%; }
.av-edit-ic { position: absolute; right: 0; bottom: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #0b1026; box-shadow: 0 0 0 3px var(--bg); }
.ph-info { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 8px; }
.ph-name { display: flex; align-items: center; gap: 8px; }
.ph-name h2 { font-size: 24px; font-weight: 900; }
.title-pick { display: inline-flex; align-items: center; gap: 6px; color: var(--gold); }
.title-pick .sel { min-height: 36px; }
.stat-grid { display: grid; gap: 10px; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 640px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.sg-i { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 8px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); text-align: center; }
.sg-i .ico { color: var(--cyan); }
.sg-i .num { font-size: 22px; }
.sg-i small { color: var(--muted); font-size: 12px; font-weight: 700; }
.prof-cols { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; align-items: start; }
@media (max-width: 860px) { .prof-cols { grid-template-columns: 1fr; } }
.diff-table { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.dt-row { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 6px; align-items: center; padding: 7px 10px; border-radius: 10px; background: rgba(5, 8, 24, 0.4); text-align: center; }
.dt-row.head { background: none; color: var(--muted); font-family: var(--font-d); font-weight: 900; font-size: 12px; padding: 0 10px; }
.dt-n { text-align: left; font-family: var(--font-d); font-weight: 900; font-style: italic; color: var(--dc); }
.top-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-top: 1px solid var(--line); }
.top-row b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dmini { padding: 2px 6px; border-radius: 6px; background: var(--dc); font-family: var(--font-d); font-weight: 900; font-style: italic; font-size: 10.5px; flex: none; min-width: 64px; text-align: center; }
.ach-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ach { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(5, 8, 24, 0.4); border: 1px solid var(--line); opacity: 0.65; }
.ach.on { opacity: 1; }
.ach > div { flex: 1; min-width: 0; }
.ach b { display: block; }
.ach small { color: var(--muted); font-size: 12px; }
.ach-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.08); flex: none; color: var(--muted); }
.ach.on.t-bronze .ach-ic { background: linear-gradient(135deg, #f5b37a, #b45309); color: #fff; }
.ach.on.t-silver .ach-ic { background: linear-gradient(135deg, #f1f5f9, #94a3b8); color: #1e293b; }
.ach.on.t-gold .ach-ic { background: linear-gradient(135deg, #ffe066, #f59e0b); color: #3a2000; }
.ach.on.t-rainbow .ach-ic { background: linear-gradient(135deg, #7df9ff, #ff7ad9, #ffe066); color: #2b1600; }
.ach-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.achip { padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: rgba(255, 255, 255, 0.08); }
.achip.t-gold, .achip.t-rainbow { background: linear-gradient(90deg, rgba(255, 211, 77, 0.3), rgba(255, 95, 162, 0.3)); }
.acct-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.av-edit { display: flex; flex-direction: column; gap: 8px; }
.av-edit > small { color: var(--muted); font-weight: 700; }
.av-prev { display: grid; place-items: center; padding: 6px; }
.av-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.av-opt { aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); display: grid; place-items: center; }
.col-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.col-opt { aspect-ratio: 1; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.4); }

/* ------------------------------------------------------------------ settings */
.set-cols { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; align-items: start; }
.set-cols > div { display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 860px) { .set-cols { grid-template-columns: 1fr; } }
.set-sec { display: flex; flex-direction: column; gap: 12px; }
.set-sec h3 { display: flex; align-items: center; gap: 7px; font-size: 16px; font-weight: 800; }
.set-row { display: flex; flex-direction: column; gap: 2px; }
.set-row.inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.sr-l { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.set-row.inline .sr-l { flex-direction: column; align-items: flex-start; gap: 0; }
.sr-l span { font-weight: 700; font-size: 14px; }
.sr-l small { color: var(--muted); font-size: 12px; }
.sr-l .num { color: var(--cyan); }
.push-box { display: flex; flex-direction: column; gap: 12px; }
.about { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 10px 0; }
.about img { height: 44px; width: auto; }
.about small { color: var(--muted); font-size: 12px; word-break: keep-all; }
.cal { display: flex; flex-direction: column; gap: 14px; }
.cal p { color: var(--muted); font-size: 14px; word-break: keep-all; }
.cal-pad { height: 170px; border-radius: 20px; border: 2px dashed var(--line); background: rgba(5, 8, 24, 0.5); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-weight: 700; touch-action: manipulation; transition: background 0.08s; }
.cal-pad.beat { background: rgba(34, 211, 197, 0.18); border-color: var(--cyan); }
.cal-dot { width: 40px; height: 40px; border-radius: 50%; background: var(--grad); }
.cal-dot.hit { animation: dotpop 0.25s ease; }
@keyframes dotpop { from { transform: scale(1.6); } }
.cal-res { display: flex; align-items: baseline; justify-content: space-between; }
.cal-v { font-size: 24px; color: var(--cyan); }

/* ------------------------------------------------------------------ howto / news */
.note-demos { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.note-demo { display: flex; gap: 14px; align-items: center; }
.note-demo p { color: var(--muted); font-size: 13.5px; word-break: keep-all; }
.nd-stage { position: relative; width: 96px; height: 96px; flex: none; border-radius: 14px; background: linear-gradient(180deg, rgba(5, 8, 24, 0.2), rgba(5, 8, 24, 0.85)); overflow: hidden; border: 1px solid var(--line); }
.nd-line { position: absolute; left: 6px; right: 6px; bottom: 16px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--cyan), #fff, var(--pink)); box-shadow: 0 0 8px var(--cyan); }
.nd-note { position: absolute; left: 18px; right: 18px; height: 16px; border-radius: 10px; border: 2px solid #fff; animation: ndfall 1.6s linear infinite; }
@keyframes ndfall { from { top: -20px; } 80% { top: 70px; opacity: 1; } to { top: 70px; opacity: 0; } }
.nd-note.tap { background: linear-gradient(180deg, #b9f6ff, #1287f0); }
.nd-note.crit { background: linear-gradient(180deg, #fff6c2, #ff9a12); }
.nd-note.flick { background: linear-gradient(180deg, #ffd0e8, #f0206a); }
.nd-note.hold { background: linear-gradient(180deg, #d4ffe4, #11b85c); }
.nd-note.hold.flickend { background: linear-gradient(180deg, #ffd0e8, #f0206a); }
.nd-note.trace { height: 10px; background: linear-gradient(180deg, #e6fff4, #22c79a); }
.nd-arrow { position: absolute; left: 50%; top: -18px; transform: translateX(-50%); color: #ff5fae; font-size: 14px; text-shadow: 0 0 4px #fff; }
.nd-tail { position: absolute; left: 4px; right: 4px; bottom: 100%; height: 60px; background: linear-gradient(0deg, rgba(79, 240, 154, 0.7), rgba(79, 240, 154, 0)); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 8px 6px; text-align: center; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--muted); font-size: 12px; }
.tbl td:first-child { font-family: var(--font-d); font-weight: 900; font-style: italic; }
.diff-guide { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.dg { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 14px; background: color-mix(in srgb, var(--dc) 18%, rgba(20, 26, 62, 0.85)); border: 1px solid color-mix(in srgb, var(--dc) 50%, transparent); }
.dg b { font-family: var(--font-d); font-weight: 900; font-style: italic; color: var(--dc); font-size: 18px; }
.dg span { font-family: var(--font-d); font-weight: 800; }
.dg small { color: var(--muted); }
.news-item summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.news-item summary::-webkit-details-marker { display: none; }
.news-item summary b { flex: 1; min-width: 160px; }
.news-item summary small { color: var(--muted); }
.news-body { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); color: #d7dcf5; font-size: 14.5px; line-height: 1.7; }
.inbox-row { display: flex; align-items: flex-start; gap: 12px; }
.inbox-row > div { flex: 1; min-width: 0; }
.inbox-row p { color: var(--muted); font-size: 13.5px; }
.inbox-row small { color: var(--muted); flex: none; }
.inbox-row.unread { border-color: rgba(255, 95, 162, 0.6); }
.inbox-row .ico { color: var(--cyan); margin-top: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ------------------------------------------------------------------ characters (MyStage Stars) */
.title-bg { background: url('/img/keyvisual.webp') center/cover no-repeat, url('/img/bg-home.webp') center/cover no-repeat; }
@media (orientation: portrait) { .title-bg { background: url('/img/keyvisual-portrait.webp') center/cover no-repeat, url('/img/bg-home-portrait.webp') center/cover no-repeat; } }
.title-glow { background: linear-gradient(180deg, rgba(11, 16, 38, 0.35) 0%, rgba(11, 16, 38, 0) 35%, rgba(11, 16, 38, 0) 60%, rgba(11, 16, 38, 0.85) 100%); }
.title-center.with-auth { background: radial-gradient(ellipse at center, rgba(11, 16, 38, 0.55), rgba(11, 16, 38, 0.2) 70%); }
.home-top { grid-template-columns: 1fr; }
@media (min-width: 760px) { .home-top { grid-template-columns: 1fr 1fr; } }
.member-greet { position: relative; display: flex; align-items: flex-end; gap: 12px; min-height: 128px; padding: 12px 14px 12px 0; overflow: hidden; background: linear-gradient(120deg, color-mix(in srgb, var(--cc) 35%, rgba(20, 26, 62, 0.85)), rgba(20, 26, 62, 0.85) 70%); }
.mg-img { width: 128px; height: 150px; object-fit: cover; object-position: top center; margin-bottom: -12px; flex: none; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35)); animation: float 4s ease-in-out infinite; }
.mg-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding-left: 14px; }
.mg-name { display: flex; align-items: baseline; gap: 8px; }
.mg-name b { font-size: 17px; }
.mg-name small { color: var(--muted); font-size: 12px; }
.bubble { position: relative; padding: 9px 13px; border-radius: 14px; background: rgba(255, 255, 255, 0.94); color: #1b1f4a; font-weight: 700; font-size: 14px; line-height: 1.45; word-break: keep-all; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2); }
.bubble::before { content: ''; position: absolute; left: -7px; bottom: 12px; border: 7px solid transparent; border-right-color: rgba(255, 255, 255, 0.94); border-left: 0; }
.member-greet .more { align-self: flex-end; }
.avatar.face { overflow: hidden; }
.avatar.face img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.av-opt.face { padding: 3px; }
.sd-chars { display: flex; gap: 4px; margin-top: 2px; }
.sd-chars img { width: 30px; height: 30px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6); }
@media (max-width: 899px) { .sd-chars { justify-content: center; } }
.cheer { display: flex; align-items: flex-end; gap: 10px; padding: 10px 14px 10px 0; overflow: hidden; background: linear-gradient(120deg, color-mix(in srgb, var(--cc) 35%, rgba(20, 26, 62, 0.85)), rgba(20, 26, 62, 0.85) 70%); animation: pagein 0.5s ease 0.5s both; }
.cheer img { width: 110px; height: 130px; object-fit: cover; object-position: top center; margin-bottom: -10px; flex: none; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35)); }
.ch-txt { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; padding-left: 12px; }
.ld-char { position: absolute; right: 4%; bottom: 0; height: min(78%, 620px); width: auto; filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5)); animation: introin 0.6s ease both; pointer-events: none; }
.ov-loading { align-content: center; }
.ld-card { position: relative; z-index: 1; }
.ld-tip { color: #d7dcf5; font-size: 13.5px; word-break: keep-all; }
@media (max-width: 700px) { .ld-char { height: 46%; right: -4%; opacity: 0.9; } }
.member-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.mcard { display: flex; flex-direction: column; border-radius: 22px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); }
.mc-art { position: relative; height: 300px; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--cc) 75%, #fff 10%), color-mix(in srgb, var(--cc) 45%, #10153a) 70%), url('/img/pattern-stars.svg'); }
.mc-art img { height: 100%; width: auto; object-fit: contain; object-position: bottom; filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.35)); transition: transform 0.3s; }
.mcard:hover .mc-art img { transform: scale(1.04) translateY(-4px); }
.mc-en { position: absolute; left: 14px; top: 10px; font-family: var(--font-d); font-weight: 900; font-style: italic; font-size: 40px; color: rgba(255, 255, 255, 0.35); letter-spacing: 0.04em; }
.mc-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; }
.mc-name { display: flex; align-items: center; gap: 8px; }
.mc-name h3 { font-size: 20px; font-weight: 900; }
.mc-role { padding: 2px 10px; border-radius: 999px; background: var(--cc); color: #fff; font-size: 12px; font-weight: 800; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }
.mc-body > p:not(.bubble) { color: #d7dcf5; font-size: 14px; word-break: keep-all; }
.mc-body .bubble { margin-left: 8px; }
.mc-songs { display: flex; gap: 6px; flex-wrap: wrap; }
.mc-songs img { width: 44px; height: 44px; border-radius: 10px; box-shadow: 0 0 0 2px var(--cc); }
