/* 아이돌마스터 노래 맞추기 — 화면 스타일
   토큰은 형제 앱(노래 폴더·허브)과 같은 결: 라이트 #f5f5f7 / 다크 순검정 + #1c1c1e 카드 */
:root {
  --bg: #f5f5f7; --bg-blur: rgba(245, 245, 247, .8);
  --card: #ffffff; --card-2: #f2f2f5;
  --label: #0e0e12; --label-2: rgba(28, 28, 40, .6); --label-3: rgba(28, 28, 40, .34);
  --sep: rgba(20, 20, 40, .1); --fill: rgba(118, 118, 140, .12); --fill-2: rgba(118, 118, 140, .22);
  --tint: #6a4cff;
  --ok: #17b26a; --ok-bg: rgba(23, 178, 106, .12); --bad: #f04461; --bad-bg: rgba(240, 68, 97, .11);
  --shadow-s: 0 1px 2px rgba(10, 10, 30, .04), 0 8px 24px -14px rgba(20, 20, 60, .25);
  --shadow-l: 0 30px 70px -30px rgba(20, 20, 60, .45);
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Noto Sans JP", "Hiragino Sans", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.4, .5, 1);
  --top: env(safe-area-inset-top); --bottom: env(safe-area-inset-bottom);
  --gutter: 20px; --r-card: 20px; --r-btn: 14px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #000000; --bg-blur: rgba(0, 0, 0, .72);
  --card: #1c1c1e; --card-2: #2c2c2e;
  --label: #f5f5f7; --label-2: rgba(235, 235, 245, .6); --label-3: rgba(235, 235, 245, .32);
  --sep: rgba(255, 255, 255, .09); --fill: rgba(120, 120, 128, .22); --fill-2: rgba(120, 120, 128, .34);
  --tint: #8f7bff;
  --ok: #30d158; --ok-bg: rgba(48, 209, 88, .14); --bad: #ff5a74; --bad-bg: rgba(255, 90, 116, .14);
  --shadow-s: 0 0 0 .5px rgba(255, 255, 255, .06);
  --shadow-l: 0 30px 70px -30px rgba(0, 0, 0, .9);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--label);
  font-family: var(--font); font-size: 16px; line-height: 1.45; letter-spacing: -.012em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: hidden;
}
button { font: inherit; color: inherit; letter-spacing: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2.5px solid var(--tint); outline-offset: 2px; }
a { color: inherit; }
img { display: block; }
[lang="ja"] { letter-spacing: 0; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 공통 버튼 */
.icon-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--label-2); background: var(--fill); transition: transform .2s var(--ease), background .2s; }
.icon-btn:active { transform: scale(.9); }
.icon-btn svg { width: 19px; height: 19px; }
.cta { width: 100%; height: 56px; border-radius: 16px; background: var(--c-fill, var(--c, var(--tint))); color: var(--ink, #fff); font-size: 17px; font-weight: 750;
  display: flex; align-items: center; justify-content: center; gap: 8px; transition: transform .2s var(--ease), filter .2s; box-shadow: 0 14px 30px -16px var(--c, var(--tint)); }
.cta:active { transform: scale(.97); filter: brightness(.95); }
.cta svg { width: 20px; height: 20px; }
.btn2 { width: 100%; height: 50px; border-radius: var(--r-btn); background: var(--fill); font-size: 16px; font-weight: 650; display: flex; align-items: center; justify-content: center; gap: 8px; transition: transform .2s var(--ease); }
.btn2:active { transform: scale(.97); }
.btn2 svg { width: 19px; height: 19px; }

/* 세그먼트 */
.seg { position: relative; display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; padding: 3px; border-radius: 12px; background: var(--fill); }
.seg button { position: relative; z-index: 1; height: 36px; border-radius: 9px; font-size: 14.5px; font-weight: 600; color: var(--label-2); transition: color .2s; white-space: nowrap; }
.seg button[aria-selected="true"] { color: var(--label); }
.seg .thumb { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; border-radius: 9px; background: var(--card);
  box-shadow: 0 2px 8px -2px rgba(0, 0, 0, .18), 0 0 0 .5px rgba(0, 0, 0, .04); transition: transform .32s var(--ease); }
[data-theme="dark"] .seg .thumb { background: #48484a; }
.seg.lg button { height: 40px; font-size: 15px; }

/* ───────── 홈 */
.home { max-width: 880px; margin: 0 auto; padding: calc(10px + var(--top)) var(--gutter) calc(28px + var(--bottom)); }
.topbar { display: flex; align-items: center; gap: 8px; height: 44px; }
.topbar .logo { width: 32px; height: 32px; border-radius: 9px; box-shadow: 0 2px 8px -3px rgba(90, 51, 230, .6); }
.topbar .sp { flex: 1; }
.page-title { margin: 14px 0 16px; font-size: 32px; line-height: 1.15; font-weight: 850; letter-spacing: -.035em; word-break: keep-all; }
@media (min-width: 640px) { .page-title { font-size: 40px; margin: 18px 0 20px; } }

/* 바로 시작: 커버 콜라주 카드 전체가 버튼 */
.hero { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; width: 100%; min-height: 196px; padding: 20px;
  border-radius: 24px; overflow: hidden; color: #fff; text-align: left; background: #1f1a3a; isolation: isolate; box-shadow: var(--shadow-l);
  transition: transform .25s var(--ease); }
.hero:active { transform: scale(.985); }
@media (hover: hover) { .hero:hover .hero-play { transform: scale(1.06); } }
.hero-bg { position: absolute; inset: -22% -12%; z-index: -2; display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; transform: rotate(-8deg); }
.hero-bg i { aspect-ratio: 1; border-radius: 12px; background: #3a3160 center/cover; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(20, 12, 50, .1) 0%, rgba(20, 12, 50, .55) 55%, rgba(14, 8, 36, .92) 100%),
              linear-gradient(90deg, rgba(90, 51, 230, .35), rgba(90, 51, 230, 0) 60%); }
.hero-text { position: relative; min-width: 0; }
.hero-text small { display: block; font-size: 13px; font-weight: 700; letter-spacing: .01em; color: rgba(255, 255, 255, .78); }
.hero-text b { display: block; margin-top: 4px; font-size: 30px; font-weight: 850; letter-spacing: -.03em; line-height: 1.1; text-shadow: 0 2px 14px rgba(0, 0, 0, .35); }
.hero-play { position: relative; flex: none; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #1a1030;
  box-shadow: 0 12px 28px -10px rgba(0, 0, 0, .7); transition: transform .25s var(--spring); }
.hero-play svg { width: 26px; height: 26px; margin-left: 1px; }   /* 삼각형 무게중심이 이미 가운데라 아주 조금만 */
@media (min-width: 640px) { .hero { min-height: 240px; padding: 26px; } .hero-text b { font-size: 36px; } .hero-play { width: 66px; height: 66px; } }

.tabs-wrap { position: sticky; top: 0; z-index: 10; margin: 24px calc(-1 * var(--gutter)) 0; padding: calc(8px + var(--top)) var(--gutter) 10px; background: var(--bg-blur);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }

/* 시리즈 카드 */
.brands { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 14px; }
@media (min-width: 640px) { .brands { grid-template-columns: repeat(3, 1fr); gap: 14px; } }
.bcard { position: relative; display: flex; flex-direction: column; align-items: flex-start; min-height: 150px; padding: 16px; border-radius: var(--r-card); overflow: hidden; text-align: left;
  color: var(--ink); isolation: isolate; box-shadow: var(--shadow-s);
  background: linear-gradient(160deg, var(--c) 0%, var(--c-fill) 55%, color-mix(in srgb, var(--c-fill) 78%, #000) 100%);
  transition: transform .25s var(--ease), box-shadow .25s; }
.bcard::after { content: ""; position: absolute; z-index: -1; right: -50px; top: -60px; width: 190px; height: 190px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 66%); }
.bcard:active { transform: scale(.97); }
@media (hover: hover) { .bcard:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -22px color-mix(in srgb, var(--c) 80%, #000); } }
.blogo { width: 60px; height: 38px; background: currentColor; opacity: .96; -webkit-mask: var(--m) left center/contain no-repeat; mask: var(--m) left center/contain no-repeat; }
.bname { margin-top: auto; padding-top: 22px; font-size: 17px; font-weight: 800; letter-spacing: -.03em; line-height: 1.25; word-break: keep-all; text-shadow: 0 1px 10px rgba(0, 0, 0, .18); }
.bmeta { margin-top: 3px; font-size: 13px; font-weight: 500; opacity: .84; }
.bbest { position: absolute; top: 14px; right: 14px; padding: 4px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; background: rgba(255, 255, 255, .22);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
/* 전체 시리즈: 어두운 카드 + 여섯 로고를 제 색으로 */
.bcard.all { grid-column: 1 / -1; min-height: 124px; color: #fff; background: #1c1c1e; }
.bcard.all::after { background: radial-gradient(circle, rgba(255, 255, 255, .1), transparent 66%); }
[data-theme="dark"] .bcard.all { background: #1c1c1e; box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .08); }
.bcard.all .bbest { background: rgba(255, 255, 255, .14); }
.bcard.all .all-logos { display: flex; flex-wrap: wrap; gap: 10px 12px; }
.bcard.all .all-logos i { width: 34px; height: 24px; background: var(--lc, #fff); -webkit-mask: var(--m) center/contain no-repeat; mask: var(--m) center/contain no-repeat; }

/* 아이돌 */
.search { position: relative; display: block; margin-top: 14px; }
.search input { width: 100%; height: 44px; padding: 0 40px 0 40px; border: 0; border-radius: 12px; background: var(--fill); color: var(--label); font: inherit; font-size: 16px; }
.search input::placeholder { color: var(--label-3); }
.search input::-webkit-search-cancel-button, .search input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.search > svg { position: absolute; left: 12px; top: 12px; width: 20px; height: 20px; color: var(--label-3); }
.search .clear { position: absolute; right: 8px; top: 8px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--label-3); }
.search .clear svg { width: 18px; height: 18px; }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 10px calc(-1 * var(--gutter)) 0; padding: 2px var(--gutter) 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 99px; background: var(--fill); font-size: 14px; font-weight: 600; color: var(--label-2);
  transition: background .2s, color .2s; }
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.chip[aria-pressed="true"] { background: var(--label); color: var(--bg); }
.idol-group { margin-top: 24px; }
.idol-group h3 { display: flex; align-items: center; gap: 8px; margin: 0 2px 12px; font-size: 15px; font-weight: 700; color: var(--label-2); }
.idol-group h3 i { width: 22px; height: 16px; background: var(--c); -webkit-mask: var(--m) center/contain no-repeat; mask: var(--m) center/contain no-repeat; }
.idols { display: grid; grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); gap: 18px 8px; }
.itile { display: flex; flex-direction: column; align-items: center; padding: 4px 2px; border-radius: 16px; text-align: center; transition: transform .2s var(--ease); }
.itile:active { transform: scale(.94); }
.face { position: relative; width: 72px; height: 72px; border-radius: 50%; background: color-mix(in srgb, var(--c) 30%, var(--card)); flex: none;
  box-shadow: 0 0 0 2.5px var(--bg), 0 0 0 5px var(--c); overflow: hidden; }
.face img { width: 100%; height: 100%; object-fit: cover; }
.face .ini { position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; font-weight: 800; color: var(--ink); }
.itile .nm { margin-top: 11px; font-size: 13.5px; font-weight: 650; line-height: 1.25; word-break: keep-all; }
.itile .ct { margin-top: 2px; font-size: 12px; color: var(--label-2); }
.itile .best { color: var(--tint); font-weight: 700; }
.empty { padding: 60px 20px; text-align: center; color: var(--label-2); font-size: 15px; }

.foot { margin-top: 48px; padding-top: 20px; border-top: .5px solid var(--sep); color: var(--label-3); font-size: 12.5px; line-height: 1.7; text-align: center; word-break: keep-all; }
.foot a { color: var(--label-2); text-decoration: none; }
.foot .hub { display: inline-block; margin-top: 10px; padding: 4px 10px; border-radius: 99px; background: var(--fill); font-size: 12px; }

/* 처음 불러오기 */
.splash { min-height: 100dvh; display: grid; place-items: center; }
.splash .spinner { width: 28px; height: 28px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--fill-2); border-top-color: var(--label-2); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────── 시트 (아래에서 올라옴, 넓은 화면은 가운데) */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; pointer-events: none; }
.sheet-wrap .backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .4); opacity: 0; transition: opacity .3s var(--ease); }
.sheet { position: relative; width: 100%; max-width: 520px; max-height: 92dvh; overflow: auto; padding: 8px var(--gutter) calc(20px + var(--bottom)); border-radius: 26px 26px 0 0; background: var(--card);
  transform: translateY(100%); transition: transform .38s var(--ease); box-shadow: var(--shadow-l); }
.sheet-wrap.open { pointer-events: auto; }
.sheet-wrap.open .backdrop { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
@media (min-width: 640px) {
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 26px; padding-bottom: 22px; transform: translateY(24px) scale(.96); opacity: 0; transition: transform .32s var(--ease), opacity .25s; }
  .sheet-wrap.open .sheet { opacity: 1; }
}
.grab { width: 38px; height: 5px; margin: 0 auto 10px; border-radius: 9px; background: var(--fill-2); }
@media (min-width: 640px) { .grab { visibility: hidden; height: 0; margin-bottom: 4px; } }

.setup-head { display: flex; align-items: center; gap: 16px; padding: 10px 0 18px; }
.setup-head .face { width: 64px; height: 64px; }
.setup-head .badge { width: 64px; height: 64px; flex: none; border-radius: 18px; display: grid; place-items: center; color: var(--ink);
  background: linear-gradient(150deg, var(--c), color-mix(in srgb, var(--c-fill) 70%, #000)); }
.setup-head .badge i { width: 42px; height: 30px; background: currentColor; -webkit-mask: var(--m) center/contain no-repeat; mask: var(--m) center/contain no-repeat; }
.setup-head .badge.all { background: #1c1c1e; }
[data-theme="dark"] .setup-head .badge.all { background: #2c2c2e; }
.setup-head .badge svg { width: 30px; height: 30px; color: #fff; }
.setup-head h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.03em; line-height: 1.25; word-break: keep-all; }
.setup-head p { margin: 2px 0 0; color: var(--label-2); font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border-radius: 16px; background: var(--card-2); padding: 14px 6px; margin-bottom: 20px; }
.stats div { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.stats div + div { border-left: .5px solid var(--sep); }
.stats b { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.stats span { font-size: 12px; color: var(--label-2); }
.opt { margin-bottom: 16px; }
.opt-label { display: block; margin: 0 2px 8px; font-size: 13px; font-weight: 600; color: var(--label-2); }
.opt .seg button { height: 38px; }
.dialog h2 { margin: 18px 0 6px; font-size: 20px; font-weight: 800; text-align: center; }
.dialog p { margin: 0 0 22px; color: var(--label-2); text-align: center; font-size: 15px; }
.dialog .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* 문제 수 직접 입력 */
.stepper { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.stepper button { width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--fill); font-size: 22px; font-weight: 600; line-height: 1; transition: transform .15s var(--ease); }
.stepper button:active { transform: scale(.92); }
.stepper label { flex: 1; height: 44px; display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: 12px; background: var(--fill); }
.stepper input { width: 4.2em; border: 0; background: none; color: var(--label); font: inherit; font-size: 19px; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { outline: none; }
.stepper label:focus-within { box-shadow: 0 0 0 2px var(--c-text) inset; }
.stepper span { color: var(--label-2); font-size: 14px; }

/* 언어 */
.lang-sheet h2 { margin-bottom: 18px; }
.lang-sheet .opt { text-align: left; }
.lang-sample { display: grid; gap: 6px; margin-top: 4px; padding: 12px 14px; border-radius: 14px; background: var(--fill); font-size: 15px; font-weight: 650; text-align: left; }
.lang-sample small { display: block; font-size: 12.5px; font-weight: 500; color: var(--label-2); }

/* 음량 */
.vol-pop { position: fixed; z-index: 70; display: flex; align-items: center; gap: 12px; width: 260px; padding: 10px 16px 10px 10px; border-radius: 18px;
  background: var(--card); box-shadow: var(--shadow-l), 0 0 0 .5px var(--sep); opacity: 0; transform: translateY(-6px) scale(.97); transform-origin: top right;
  transition: opacity .18s, transform .22s var(--ease); }
[data-theme="dark"] .vol-pop { background: #2c2c2e; }
.vol-pop.open { opacity: 1; transform: none; }
.vol-ic { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; color: var(--label-2); background: var(--fill); }
.vol-ic svg { width: 19px; height: 19px; }
.vol-pop output { width: 2.4em; flex: none; text-align: right; font-size: 17px; font-weight: 800; }
.vol-pop input { flex: 1; min-width: 0; height: 28px; margin: 0; background: none; -webkit-appearance: none; appearance: none; cursor: pointer; }
.vol-pop input::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--label) var(--p), var(--fill-2) var(--p)); }
.vol-pop input::-moz-range-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--label) var(--p), var(--fill-2) var(--p)); }
.vol-pop input::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, .35); }
.vol-pop input::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, .35); }

/* ───────── 퀴즈 */
.play { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); overflow: hidden; isolation: isolate; }
.play::before { content: ""; position: absolute; inset: -20% -20% 40%; z-index: -1; pointer-events: none; transition: background .6s;
  background: radial-gradient(60% 60% at 50% 40%, color-mix(in srgb, var(--c) 30%, transparent), transparent 72%); filter: blur(10px); }
[data-theme="dark"] .play::before { background: radial-gradient(60% 60% at 50% 40%, color-mix(in srgb, var(--c) 38%, transparent), transparent 72%); }
.play-in { flex: 1; display: flex; flex-direction: column; width: 100%; max-width: 560px; margin: 0 auto; padding: calc(8px + var(--top)) 18px calc(16px + var(--bottom)); min-height: 0; }
.play-top { display: flex; align-items: center; gap: 12px; height: 48px; flex: none; }
.prog { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; }
.prog-txt { font-size: 15px; font-weight: 700; color: var(--label-2); letter-spacing: -.01em; }
.prog-txt b { color: var(--label); }
.dots { display: flex; gap: 4px; width: 100%; max-width: 280px; }
.dots i { flex: 1; height: 4px; border-radius: 4px; background: var(--fill-2); transition: background .3s; }
.dots i.ok { background: var(--ok); }
.dots i.ok.p { background: linear-gradient(90deg, #ffbf1f, #ff5fae); }
.dots i.bad { background: var(--bad); }
.dots i.now { background: var(--label-2); }

.stage { position: relative; flex: 1; min-height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.disc-wrap { position: relative; width: min(272px, 66vw, 30dvh); aspect-ratio: 1; transition: opacity .25s, transform .4s var(--spring); }
.viz { position: absolute; inset: 0; width: 100%; height: 100%; }
.disc { position: absolute; inset: 21%; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--card); box-shadow: 0 20px 50px -24px color-mix(in srgb, var(--c) 70%, #000), 0 0 0 .5px var(--sep); }
.timer { font-size: clamp(34px, 11vw, 46px); font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.timer small { font-size: .42em; font-weight: 700; margin-left: 2px; color: var(--label-2); letter-spacing: 0; }
.disc-sub { margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--label-2); }
.count { position: absolute; inset: 0; display: grid; place-items: center; font-size: 64px; font-weight: 850; color: var(--c-text); pointer-events: none; }
.count span { animation: pop .8s var(--ease) both; }
@keyframes pop { 0% { transform: scale(1.8); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 80% { opacity: 1; } 100% { transform: scale(.7); opacity: 0; } }

.reveal { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; opacity: 0; pointer-events: none; transition: opacity .25s; }
.reveal .art { position: relative; width: min(206px, 50vw, 22dvh); aspect-ratio: 1; border-radius: 18px; background: var(--fill) center/cover; box-shadow: 0 24px 50px -22px rgba(0, 0, 0, .55);
  transform: scale(.86) translateY(10px); transition: transform .5s var(--spring); }
.reveal .mark { position: absolute; right: -10px; top: -10px; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; box-shadow: 0 0 0 4px var(--bg); }
.reveal .mark svg { width: 24px; height: 24px; }
.reveal .mark.ok { background: var(--ok); }
.reveal .mark.bad { background: var(--bad); }
.reveal .r-title { margin-top: 18px; max-width: 100%; font-size: 20px; font-weight: 800; line-height: 1.3; letter-spacing: -.01em; overflow-wrap: anywhere; }
.reveal .r-ko { margin-top: 2px; font-size: 14px; color: var(--label-2); }
.reveal .r-artist { margin-top: 6px; max-width: 100%; font-size: 13px; color: var(--label-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reveal .r-verdict { margin-top: 10px; font-size: 13.5px; font-weight: 700; }
.reveal .r-verdict.ok { color: var(--ok); }
.reveal .r-verdict.bad { color: var(--bad); }
.stage.revealed .disc-wrap { opacity: 0; transform: scale(.9); transition: opacity .2s, transform .3s; }
.stage.revealed .reveal { opacity: 1; pointer-events: auto; }
.stage.revealed .reveal .art { transform: none; animation: artIn .6s var(--spring); }
@keyframes artIn { from { transform: scale(.7) rotate(-4deg); } }

.choices { display: grid; gap: 8px; flex: none; margin-top: 10px; }
.choice { position: relative; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 16px 8px 10px; border-radius: 16px; text-align: left;
  background: var(--card); box-shadow: var(--shadow-s); font-size: 16.5px; font-weight: 650; line-height: 1.3;
  transition: transform .18s var(--ease), background .25s, opacity .25s, box-shadow .25s; }
.choice:active { transform: scale(.975); }
.choice .k { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-size: 13.5px; font-weight: 800; color: var(--label-2); background: var(--fill); transition: background .25s, color .25s; }
.choice .t { flex: 1; min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.choice .t small { display: block; margin-top: 1px; font-size: 12.5px; font-weight: 500; color: var(--label-2); }
.choice .ic { flex: none; width: 22px; height: 22px; opacity: 0; transform: scale(.5); transition: opacity .2s, transform .3s var(--spring); }
.choices.done .choice { pointer-events: none; }
.choices.done .choice:not(.ok):not(.bad) { opacity: .42; }
.choice.ok { background: var(--ok-bg); box-shadow: 0 0 0 2px var(--ok) inset; }
.choice.ok .k { background: var(--ok); color: #fff; }
.choice.ok .ic { opacity: 1; transform: none; color: var(--ok); }
.choice.bad { background: var(--bad-bg); box-shadow: 0 0 0 2px var(--bad) inset; animation: shake .4s; }
.choice.bad .k { background: var(--bad); color: #fff; }
.choice.bad .ic { opacity: 1; transform: none; color: var(--bad); }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.choices.wait .choice { opacity: .5; pointer-events: none; }
.choices.wait .choice .t { color: transparent; background: var(--fill); border-radius: 6px; }
.choices.wait .choice .t * { visibility: hidden; }   /* 한국어 부제(small)도 같이 가림 */
.choice.ok.j-perfect, .choice.ok.j-great, .choice.ok.j-good { animation: okPop .5s var(--spring); }
@keyframes okPop { 0% { transform: scale(.96); } 45% { transform: scale(1.045); box-shadow: 0 0 0 2px var(--ok) inset, 0 0 0 7px color-mix(in srgb, var(--ok) 25%, transparent), 0 12px 30px -10px var(--ok); } 100% { transform: none; } }
.choice.ok.j-perfect { background: linear-gradient(100deg, rgba(255, 211, 77, .2), rgba(255, 122, 200, .18), rgba(122, 215, 255, .2)); box-shadow: 0 0 0 2px #ffbf1f inset; }
.choice.ok.j-perfect .k { background: linear-gradient(135deg, #ffbf1f, #ff5fae); }
.choice.ok.j-perfect .ic { color: #ff9f1a; }

.next-row { flex: none; height: 56px; margin-top: 12px; }
.next { position: relative; overflow: hidden; width: 100%; height: 56px; border-radius: 16px; background: var(--label); color: var(--bg); font-size: 16.5px; font-weight: 750;
  display: flex; align-items: center; justify-content: center; gap: 6px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .25s, transform .3s var(--ease); }
.next svg { width: 18px; height: 18px; }
.next.show { opacity: 1; transform: none; pointer-events: auto; }
.next .fill { position: absolute; inset: 0; background: rgba(127, 127, 127, .28); transform-origin: left; transform: scaleX(0); }
.next.auto .fill { animation: fill var(--dur, 3s) linear forwards; }
@keyframes fill { to { transform: scaleX(1); } }
.play-in.shake { animation: screenShake .36s; }
@keyframes screenShake { 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }

.play-msg { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 20px; }
.play-msg p { margin: 0; color: var(--label-2); }
.play-msg .row { display: flex; gap: 10px; }
.play-msg .row button { width: auto; padding: 0 22px; }

/* 정답 연출 */
.fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 5; pointer-events: none; }
.judge { position: absolute; left: 0; right: 0; top: 4%; z-index: 6; display: flex; flex-direction: column; align-items: center; pointer-events: none; opacity: 0; }
.judge b { position: relative; font-size: clamp(40px, 13vw, 58px); font-weight: 900; font-style: italic; letter-spacing: .02em; line-height: 1;
  color: var(--jc, #fff); -webkit-text-stroke: 1.5px rgba(0, 0, 0, .12); text-shadow: 0 6px 24px color-mix(in srgb, var(--jc, #000) 55%, transparent); }
.judge span { margin-top: 6px; padding: 3px 12px; border-radius: 99px; font-size: 14px; font-weight: 850; letter-spacing: .12em; color: #fff; background: var(--jc, #333); }
.judge.show { animation: judgeIn 1.05s var(--ease) forwards; }
.judge.show span { animation: comboIn .5s var(--spring) .08s both; }
@keyframes judgeIn {
  0% { opacity: 0; transform: scale(1.9); filter: blur(6px); }
  14% { opacity: 1; transform: scale(.94); filter: none; }
  24% { transform: scale(1.04); }
  34%, 72% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: translateY(-18px) scale(.96); }
}
@keyframes comboIn { from { opacity: 0; transform: translateY(8px) scale(.6); } }
.judge.j-perfect { --jc: #ffbf1f; }
.judge.j-perfect b { background: linear-gradient(100deg, #ffd34d 10%, #ff7ac8 45%, #7ad7ff 80%); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-stroke: 0;
  filter: drop-shadow(0 4px 14px rgba(255, 140, 200, .55)); }
.judge.j-perfect b::after { content: attr(data-t); position: absolute; inset: 0; color: transparent; -webkit-background-clip: text; background-clip: text;
  background-image: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, .95) 50%, transparent 65%); background-size: 250% 100%; animation: shine .9s .12s ease-out both; }
@keyframes shine { from { background-position: 120% 0; } to { background-position: -40% 0; } }
.judge.j-perfect span { background: linear-gradient(90deg, #ffb21f, #ff5fae); }
.judge.j-great { --jc: var(--ok); }
.judge.j-good { --jc: #4fa9ea; }
.judge.j-miss { --jc: var(--bad); }
.judge.j-miss b { font-size: clamp(32px, 10vw, 44px); }

/* ───────── 결과 */
.result { max-width: 640px; margin: 0 auto; padding: calc(8px + var(--top)) 18px calc(30px + var(--bottom)); }
.result .play-top { margin-bottom: 6px; }
.res-hero { position: relative; overflow: hidden; isolation: isolate; padding: 26px 22px 22px; border-radius: 26px; color: #fff; text-align: center;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 90%, #fff) 0%, color-mix(in srgb, var(--c) 60%, #000) 100%); box-shadow: var(--shadow-l); }
.res-hero::before { content: ""; position: absolute; inset: -4px; z-index: -1; background: var(--covers) center/cover; opacity: .26; filter: blur(3px) saturate(1.2); }
.res-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 10%, rgba(0, 0, 0, .34)); }
.rank { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 14px; border-radius: 99px; background: rgba(255, 255, 255, .2); font-size: 13px; font-weight: 800; letter-spacing: .14em;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.rank.mplus { background: linear-gradient(90deg, #ffd86b, #ff8fd0, #8fd3ff); color: #2a1660; }
.res-hero h1 { margin: 12px 0 0; font-size: 25px; font-weight: 850; letter-spacing: -.03em; line-height: 1.25; word-break: keep-all; text-shadow: 0 2px 16px rgba(0, 0, 0, .25); }
.res-hero .sub { margin-top: 2px; font-size: 13.5px; opacity: .82; }
.res-nums { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 22px; }
.res-nums div + div { border-left: 1px solid rgba(255, 255, 255, .22); }
.res-nums b { display: block; font-size: 30px; font-weight: 850; letter-spacing: -.04em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.res-nums b small { font-size: .5em; font-weight: 700; margin-left: 1px; opacity: .85; }
.res-nums span { font-size: 12.5px; opacity: .8; }
.newbest { display: inline-flex; margin-top: 16px; padding: 6px 12px; border-radius: 99px; background: #fff; color: #222; font-size: 12.5px; font-weight: 750; animation: pop2 .6s var(--spring) both .2s; }
@keyframes pop2 { from { transform: scale(.6); opacity: 0; } }
.res-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0 6px; }
.res-actions .cta { grid-column: 1 / -1; }
.by-series { margin-top: 18px; padding: 16px 16px 10px; border-radius: var(--r-card); background: var(--card); box-shadow: var(--shadow-s); }
.by-series h3 { margin: 0 0 10px; font-size: 14px; font-weight: 700; color: var(--label-2); }
.bs-row { display: flex; align-items: center; gap: 10px; height: 36px; }
.bs-logo { width: 26px; height: 18px; flex: none; background: var(--c); -webkit-mask: var(--m) center/contain no-repeat; mask: var(--m) center/contain no-repeat; }
.bs-name { width: 4.2em; flex: none; font-size: 14px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bs-bar { flex: 1; height: 8px; border-radius: 8px; background: var(--fill); overflow: hidden; }
.bs-bar i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--c), var(--c-fill)); transform-origin: left; animation: barIn .8s var(--ease) both .15s; }
@keyframes barIn { from { transform: scaleX(0); } }
.bs-num { width: 3.6em; flex: none; text-align: right; font-size: 14px; color: var(--label-2); }
.bs-num b { color: var(--label); font-weight: 800; }
.res-list { margin: 18px 0 0; padding: 0; list-style: none; border-radius: var(--r-card); background: var(--card); box-shadow: var(--shadow-s); overflow: hidden; }
.res-list li + li { border-top: .5px solid var(--sep); }
.row-btn { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; text-align: left; transition: background .15s; }
.row-btn:active { background: var(--fill); }
.row-art { position: relative; flex: none; width: 52px; height: 52px; border-radius: 10px; background: var(--fill) center/cover; overflow: hidden; }
.row-art .pl { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .38); color: #fff; opacity: 0; transition: opacity .2s; }
.row-art .pl svg { width: 20px; height: 20px; }
.row-btn.playing .row-art .pl, .row-btn:hover .row-art .pl { opacity: 1; }
.row-txt { display: block; flex: 1; min-width: 0; }
.row-t { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 650; line-height: 1.3; }
.row-t span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-t svg { flex: none; width: 16px; height: 16px; }
.row-t .ok { color: var(--ok); }
.row-t .bad { color: var(--bad); }
.row-s { display: block; margin-top: 2px; font-size: 12.5px; color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-time { flex: none; font-size: 15px; font-weight: 750; font-variant-numeric: tabular-nums; }
.row-time.bad { color: var(--bad); font-size: 13px; font-weight: 650; }
.am { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--label-3); }
.am svg { width: 18px; height: 18px; }

/* 결과 이미지 미리보기 */
.share-img { width: 100%; border-radius: 16px; box-shadow: var(--shadow-s); margin: 6px 0 16px; background: var(--fill); }
.share-actions { display: grid; gap: 10px; }

/* 토스트 */
#toast { position: fixed; left: 50%; bottom: calc(26px + var(--bottom)); z-index: 80; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; max-width: calc(100% - 40px);
  padding: 11px 18px; border-radius: 99px; background: rgba(30, 30, 36, .92); color: #fff; font-size: 14px; font-weight: 600; transition: opacity .25s, transform .3s var(--ease);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 화면 전환·모드 */
.fade-in { animation: fadeIn .35s var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } }
/* 모드 전환: 요소별 전환은 끄고(탭 막대 둘레가 비침), 화면 전체를 한 장으로 겹쳐 바꿈 (View Transitions) */
.theming, .theming * { transition: none !important; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; animation-timing-function: ease; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* 키 낮은 화면 (가로 폰 등) */
@media (max-height: 640px) {
  .choice { min-height: 50px; padding-top: 7px; padding-bottom: 7px; font-size: 15.5px; }
  .choices { gap: 8px; }
  .next, .next-row { height: 48px; }
}

/* ───────── 멀티플레이 */
.mp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.mp-btn { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 10px 14px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow-s); text-align: left; transition: transform .2s var(--ease); }
.mp-btn:active { transform: scale(.97); }
.mp-btn > svg { flex: none; width: 22px; height: 22px; color: var(--tint); }
.mp-btn b { display: block; font-size: 15px; font-weight: 750; letter-spacing: -.02em; }
.mp-btn small { display: block; margin-top: 1px; font-size: 12px; color: var(--label-2); }
.mp-resume { grid-column: 1 / -1; background: var(--label); color: var(--bg); }
.mp-resume > svg { color: inherit; }
.mp-resume small { color: inherit; opacity: .7; }
.mp-make { margin-top: 10px; }
.field { display: block; margin-bottom: 12px; text-align: left; }
.field > span { display: block; margin: 0 2px 6px; font-size: 13px; font-weight: 600; color: var(--label-2); }
.field input { width: 100%; height: 48px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--fill); color: var(--label); font: inherit; font-size: 16px; }
.field input::placeholder { color: var(--label-3); }
.field input.code-in { font-size: 24px; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; text-align: center; font-variant-numeric: tabular-nums; }
.mp-sheet h2 { margin-top: 14px; }
.mp-sheet p { margin-bottom: 16px; }
.mp-sheet .cta { margin-top: 6px; }
.cta:disabled, .btn2:disabled { opacity: .5; pointer-events: none; }

.mp-top .prog { gap: 2px; }
.mp-code-mini { font-size: 12px; font-weight: 700; letter-spacing: .14em; color: var(--label-3); }
.mp-codecard { padding: 22px 18px 18px; border-radius: 26px; text-align: center; color: #fff;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 90%, #fff) 0%, color-mix(in srgb, var(--c) 60%, #000) 100%); box-shadow: var(--shadow-l); }
.mp-codelabel { font-size: 12.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .8; }
.mp-code { display: block; margin: 6px 0 16px; font-size: 44px; font-weight: 900; letter-spacing: .2em; line-height: 1; text-indent: .2em; }
.mp-codecard .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mp-codecard .btn2 { background: rgba(255, 255, 255, .18); color: #fff; height: 44px; font-size: 14.5px; }
.mp-settings { margin: 14px 0 0; font-size: 13.5px; opacity: .85; }
.mp-card { margin-top: 14px; padding: 16px; border-radius: var(--r-card); background: var(--card); box-shadow: var(--shadow-s); }
.mp-card h3 { margin: 0 0 10px; font-size: 14px; font-weight: 700; color: var(--label-2); }
.mp-card h3 span { font-weight: 600; opacity: .8; }
.plist { margin: 0; padding: 0; list-style: none; }
.prow { display: flex; align-items: center; gap: 10px; height: 44px; }
.prow.away { opacity: .45; }
.pav { display: inline-grid; place-items: center; flex: none; border-radius: 50%; background: var(--c); color: #fff; font-weight: 800; }
.pname { flex: 1; min-width: 0; font-size: 15.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pname small { margin-left: 6px; font-size: 12px; font-weight: 600; color: var(--label-3); }
.ptag { padding: 3px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 750; background: var(--fill); color: var(--label-2); }
.pkick { width: 30px; height: 30px; }
.pkick svg { width: 15px; height: 15px; }
.mp-foot { margin-top: 16px; }
.mp-hint { margin: 10px 2px 0; font-size: 12.5px; color: var(--label-3); text-align: center; word-break: keep-all; }
.mp-wait { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 12px 0; font-size: 14.5px; color: var(--label-2); }
.mp-wait .spinner { width: 16px; height: 16px; border-width: 2px; }

/* 채팅 */
.chat-log { height: 200px; overflow-y: auto; padding: 4px 2px; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.sheet-chat .chat-log { height: min(46dvh, 380px); }
.sheet-chat h3 { margin: 6px 0 10px; font-size: 16px; font-weight: 800; }
.cmsg { display: flex; align-items: flex-start; gap: 8px; max-width: 92%; }
.cmsg.mine { align-self: flex-end; }
.cmsg > div { display: flex; flex-direction: column; gap: 2px; }
.cname { font-size: 11.5px; font-weight: 700; }
.cmsg.mine .cname { display: none; }
.ctext { display: inline-block; padding: 7px 11px; border-radius: 14px 14px 14px 4px; background: var(--fill); font-size: 14.5px; line-height: 1.35; overflow-wrap: anywhere; }
.cmsg.mine .ctext { border-radius: 14px 14px 4px 14px; background: var(--c-fill, var(--tint)); color: var(--ink, #fff); }
.chat-form { display: flex; gap: 8px; margin-top: 10px; }
.chat-form input { flex: 1; min-width: 0; height: 40px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--fill); color: var(--label); font: inherit; font-size: 15px; }
.chat-form .icon-btn { width: 40px; height: 40px; border-radius: 12px; background: var(--label); color: var(--bg); }
.chat-btn { position: relative; }
.chat-btn .badge { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.chat-peek { position: absolute; left: 18px; right: 18px; bottom: calc(84px + var(--bottom)); z-index: 7; padding: 9px 14px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow-l), 0 0 0 .5px var(--sep);
  font-size: 13.5px; pointer-events: none; opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .25s var(--ease); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-peek.show { opacity: 1; transform: none; }
.chat-peek b { margin-right: 6px; }

/* 점수판 (퀴즈 중 위쪽) */
.board { display: flex; gap: 6px; overflow-x: auto; flex: none; margin: 2px -18px 0; padding: 4px 18px; scrollbar-width: none; }
.board::-webkit-scrollbar { display: none; }
.bp { position: relative; flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px 0 4px; border-radius: 99px; background: var(--card); box-shadow: var(--shadow-s); font-size: 13.5px; font-weight: 750; transition: opacity .3s; }
.bp.me { box-shadow: 0 0 0 1.5px var(--c-text) inset; }
.bp.away { opacity: .4; }
.bp i { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; color: #fff; }
.bp i svg { width: 11px; height: 11px; }
.bp.got i { background: var(--ok); }
.bp.miss i { background: var(--bad); }
.mp-actions { display: flex; align-items: center; gap: 10px; }
.mp-status { flex: 1; font-size: 13.5px; font-weight: 600; color: var(--label-2); }
.skip-btn { width: auto; height: 44px; padding: 0 16px; font-size: 14.5px; }
.skip-btn svg { width: 17px; height: 17px; }

/* 최종 순위 */
.rank-list { margin: 16px 0 0; padding: 0; list-style: none; border-radius: var(--r-card); background: var(--card); box-shadow: var(--shadow-s); overflow: hidden; }
.rank-list li { display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 12px; }
.rank-list li + li { border-top: .5px solid var(--sep); }
.rank-list li.me { background: color-mix(in srgb, var(--c) 8%, transparent); }
.rank-list .rk { width: 1.6em; font-size: 17px; font-weight: 850; color: var(--label-2); text-align: center; }
.rank-list li:first-child .rk { color: #e6a400; }
.rank-list .pname small { display: block; margin: 1px 0 0; font-size: 12px; color: var(--label-2); }
.rank-list b { font-size: 18px; font-weight: 850; letter-spacing: -.02em; }
.mp-end .res-hero h1 { font-size: 30px; }
.mp-end .res-actions { margin-top: 14px; }

/* 퀴즈 중 맨 아래 채팅 바 */
.mp-actions { flex: none; margin-top: 10px; }
.chat-bar { flex: none; margin: 8px -18px calc(-16px - var(--bottom)); padding: 8px 18px calc(10px + var(--bottom)); background: var(--bg-blur); border-top: .5px solid var(--sep);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.chat-mini { display: flex; flex-direction: column; gap: 3px; min-height: 0; max-height: 58px; overflow: hidden; justify-content: flex-end; }
.chat-mini:empty { display: none; }
.cm { flex: none; display: flex; gap: 6px; font-size: 13px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm b { flex: none; font-weight: 700; }
.cm span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cm.mine span { color: var(--label-2); }
.chat-bar .chat-form { margin-top: 6px; }
.chat-bar .chat-form input { height: 38px; background: var(--card); box-shadow: var(--shadow-s); }
.chat-bar .chat-form .icon-btn { width: 38px; height: 38px; }
/* 채팅 줄 수: 화면 높이에 맞춰 3 → 5 → 7줄 (한 줄 17.55px + 간격 3px, 맨 위 줄이 반쯤 잘리지 않게 줄 단위로) */
@media (min-height: 860px) { .chat-mini { max-height: 100px; } }
@media (min-height: 960px) { .chat-mini { max-height: 141px; } }
@media (max-height: 700px) { .chat-mini { max-height: 20px; } .choice { min-height: 48px; } .choices { gap: 6px; } }

/* 채팅 구분선 · 말풍선 */
.cdiv { display: flex; align-items: center; gap: 10px; margin: 4px 0; font-size: 11.5px; font-weight: 700; color: var(--label-3); letter-spacing: .02em; }
.cdiv::before, .cdiv::after { content: ""; flex: 1; height: .5px; background: var(--sep); }
.bubbles { position: relative; z-index: 8; height: 0; pointer-events: none; }
.bub { position: absolute; top: 8px; max-width: 72%; padding: 6px 12px; border-radius: 15px; background: var(--pc, #888); color: #fff; font-size: 13.5px; font-weight: 650; line-height: 1.3;
  box-shadow: 0 8px 22px -10px color-mix(in srgb, var(--pc, #000) 70%, #000); text-shadow: 0 1px 2px rgba(0, 0, 0, .18);
  opacity: 0; transform: translateY(-6px) scale(.96); transform-origin: var(--tail, 16px) 0; transition: opacity .18s, transform .25s var(--spring), left .25s var(--ease), top .25s var(--ease); }
.bub > span { position: relative; z-index: 1; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 꼬리: 아바타 쪽(위)을 가리키는 삼각형 */
.bub::before { content: ""; position: absolute; left: calc(var(--tail, 16px) - 8px); top: -8px; width: 16px; height: 9px; background: var(--pc, #888);
  clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.bub.show { opacity: 1; transform: none; }

/* 주관식 입력 */
.tq { position: relative; flex: none; margin-top: 10px; }
.tq.wait { opacity: .55; pointer-events: none; }
.hints { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.hint { display: flex; flex-direction: column; gap: 1px; min-height: 48px; padding: 7px 12px; border-radius: 14px; background: var(--fill); color: var(--label-3); transition: background .3s, color .3s; min-width: 0; }
.hint i { font-style: normal; font-size: 11.5px; font-weight: 700; }
.hint b { font-size: 14.5px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hint.open { background: var(--card); color: var(--label); box-shadow: var(--shadow-s); animation: pop2 .45s var(--spring); }
.hint.open i { color: var(--c-text); }
.tq-form { position: relative; }
.tq-form input { width: 100%; height: 56px; padding: 0 16px; border: 0; border-radius: 16px; background: var(--card); color: var(--label); font: inherit; font-size: 17px; font-weight: 650;
  box-shadow: var(--shadow-s), 0 0 0 2px color-mix(in srgb, var(--c-text) 35%, transparent) inset; }
.tq-form input:focus { outline: none; box-shadow: var(--shadow-s), 0 0 0 2px var(--c-text) inset; }
.tq.got .tq-form input { box-shadow: 0 0 0 2px var(--ok) inset; background: var(--ok-bg); }
.tq.shake .tq-form { animation: shake .4s; }
.tq-wrong { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); max-width: 45%; font-size: 13px; font-weight: 700; color: var(--bad); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.ac { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 9; display: none; flex-direction: column; padding: 6px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow-l), 0 0 0 .5px var(--sep); }
[data-theme="dark"] .ac { background: #2c2c2e; }
.ac.show { display: flex; }
.ac-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 9px 12px; border-radius: 11px; text-align: left; font-size: 15.5px; font-weight: 650; line-height: 1.3; }
.ac-item small { font-size: 12.5px; font-weight: 500; color: var(--label-2); }
.ac-item.sel, .ac-item:hover { background: var(--fill); }
.ac-item span, .ac-item small { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 정답 공개: 누가 맞혔는지 */
.rv-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; width: 100%; max-width: 420px; }
.rv { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 6px; border-radius: 12px; background: var(--fill); font-size: 13px; font-weight: 650; text-align: left; min-width: 0; }
.rv .rv-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv .rv-tag { flex: none; display: inline-flex; align-items: center; gap: 4px; font-weight: 800; }
.rv .rv-tag svg { width: 14px; height: 14px; }
.rv .rv-tag small { font-size: 11px; font-weight: 600; opacity: .8; }
.rv.got { background: var(--ok); color: #fff; }
.rv.got .pav { box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }
.rv.miss { background: var(--bad-bg); color: var(--bad); box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--bad) 45%, transparent) inset; }
.rv.miss .rv-name { color: var(--label); }
.rv.skip, .rv.none { color: var(--label-3); }
.rv.skip .rv-name, .rv.none .rv-name { color: var(--label-2); }
.rv.me { outline: 2px solid var(--c-text); outline-offset: 1px; }

/* 방 만들기 시트 */
.room-sheet h2 { margin-bottom: 16px; }
.room-sheet .opt { text-align: left; }
.rs-targets { margin-top: 10px; }
.opt-label small { float: right; font-weight: 500; color: var(--label-3, var(--label-2)); }
/* 시리즈: 전체 한 줄 + 3×2 */
.tchip { position: relative; border-radius: 14px; background: var(--fill); font-weight: 700; transition: transform .15s var(--ease), background .15s; }
.tchip:active { transform: scale(.97); }
.tchip.on { background: color-mix(in srgb, var(--c) 16%, var(--card)); box-shadow: 0 0 0 2px var(--c) inset; }
.tchip .ck { position: absolute; top: 7px; right: 7px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff; opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s var(--ease); }
.tchip .ck svg { width: 12px; height: 12px; }
.tchip.on .ck { opacity: 1; transform: none; }
.tchip.tall { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 8px 40px 8px 14px; text-align: left; font-size: 15px; }
.tchip.tall small { margin-left: auto; font-size: 13px; font-weight: 500; color: var(--label-2); }
.tchip.tall .ck { top: 50%; right: 12px; margin-top: -9px; }
.tgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.tgrid .tchip { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 92px; padding: 14px 6px 10px; text-align: center; font-size: 13px; line-height: 1.25; word-break: keep-all; }
.tgrid .tlogo { width: 44px; height: 30px; }
.tlogo { flex: none; width: 30px; height: 22px; background: var(--c); -webkit-mask: var(--m) center/contain no-repeat; mask: var(--m) center/contain no-repeat; }
.tlogo.all { display: grid; place-items: center; background: none; -webkit-mask: none; mask: none; color: var(--c); }
.tlogo.all svg { width: 20px; height: 20px; }
/* 아이돌: 시리즈 필터 + 고른 사람 + 목록 */
.chips.wrap { flex-wrap: wrap; overflow: visible; margin: 0 0 10px; padding: 0; gap: 6px; }
.chips.wrap .chip { height: 30px; padding: 0 12px; font-size: 13px; }
.rs-targets .search { margin-top: 0; }
.itray { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.ipill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px 0 4px; border-radius: 99px; background: color-mix(in srgb, var(--c, var(--tint)) 14%, var(--card)); font-size: 13px; font-weight: 600; }
.ipill .face { box-shadow: none; }
.ipill > svg { width: 14px; height: 14px; color: var(--label-2); }
.itray-n { font-size: 12px; color: var(--label-2); margin-left: 4px; }
.ilist { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; margin-top: 8px; overscroll-behavior: contain; }
.irow { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; text-align: left; }
.irow .face { box-shadow: 0 0 0 2px var(--card), 0 0 0 3.5px var(--c); }
.irow .pname { flex: 1; min-width: 0; }
.irow .pname small { display: block; margin: 1px 0 0; font-size: 12px; color: var(--label-2); }
.irow .ck { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 0 0 1.5px var(--sep, var(--fill)) inset; color: #fff; transition: background .15s; }
.irow .ck svg { width: 14px; height: 14px; opacity: 0; }
.irow.on { background: var(--fill); }
.irow.on .ck { background: var(--tint); box-shadow: none; }
.irow.on .ck svg { opacity: 1; }
.mp-btn { justify-content: center; }
.mp-resume { justify-content: flex-start; }

/* 점수판 이름표 (커서·터치): 말풍선과 같은 자리, 차분한 색 */
.bub.tag { padding: 4px 10px; background: var(--label); color: var(--bg); font-size: 12.5px; font-weight: 700; }
.bub.tag::before { background: var(--label); }
.board .bp { cursor: default; }

/* 혼자 주관식: 답하기 전에는 다음 버튼 자리에 스킵 */
.next-row { position: relative; }
.skip-solo { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 16px; font-size: 15.5px; }
.skip-solo svg { width: 17px; height: 17px; }
.skip-solo:disabled { opacity: .45; }

/* 멀티 결과: 사람마다 곡별 결과 */
.end-songs .es-who { margin: 0 0 8px; }
.es-p { gap: 6px; padding: 0 12px 0 5px; }
.es-p .pav { flex: none; }
.es-p[aria-pressed="true"] { background: color-mix(in srgb, var(--c) 22%, var(--card)); color: var(--label); box-shadow: 0 0 0 1.5px var(--c) inset; }
.es-sum { margin: 2px 2px 8px; font-size: 13px; font-weight: 600; color: var(--label-2); }
.es-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.es-row { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 12px; }
.es-n { flex: none; width: 20px; text-align: right; font-size: 12px; font-weight: 700; color: var(--label-3); }
.es-art { flex: none; width: 38px; height: 38px; border-radius: 8px; background: var(--fill) center/cover; }
.es-t { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14.5px; font-weight: 700; line-height: 1.3; }
.es-t > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.es-t small { font-size: 12px; font-weight: 500; color: var(--label-2); }
.es-tag { flex: none; display: inline-flex; align-items: center; gap: 5px; font-size: 13px; }
.es-tag svg { width: 15px; height: 15px; }
.es-tag small { color: var(--label-2); font-weight: 600; }
.es-row.ok .es-tag { color: var(--ok); }
.es-row.ok .es-tag b { color: var(--label); }
.es-row.bad .es-tag { color: var(--bad); }
.es-row.skip .es-tag, .es-row.none .es-tag { color: var(--label-3); }
.es-row:not(.ok) .es-t { color: var(--label-2); }
.top-btns { display: flex; gap: 6px; flex: none; }

/* 멀티: 오래 가만히 있어 연결을 잠시 끊었을 때 */
.away-veil { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 100%;
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: var(--label); animation: pop2 .3s var(--ease); }
.away-veil b { font-size: 22px; font-weight: 800; }
.away-veil span { font-size: 14px; color: var(--label-2); }

/* 버튼 안 스피너 (A.busy) */
.spinner-btn { border-color: rgba(255, 255, 255, .4); border-top-color: #fff; }

/* 최고 기록 아래 평균 시간 */
.stats b small { display: block; margin-top: 1px; font-size: 11.5px; font-weight: 650; letter-spacing: 0; color: var(--label-2); text-align: center; }

/* 결과: 2초 안에 맞힌 곡 (PERFECT) */
.res-list li.fast { background: linear-gradient(100deg, rgba(255, 211, 77, .13), rgba(255, 122, 200, .09) 55%, transparent); }
.row-time.fast { background: linear-gradient(100deg, #f5a800, #ff4fa3); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 850; }
.es-row.fast { background: linear-gradient(100deg, rgba(255, 211, 77, .14), rgba(255, 122, 200, .08) 60%, transparent); }
.es-row.fast .es-tag small { background: linear-gradient(100deg, #f5a800, #ff4fa3); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; }

/* 결과 목록의 맞힘·틀림 표시 (A.markHTML): 제목이 길어도 줄어들지 않게 */
.mk { flex: none; display: grid; place-items: center; width: 20px; height: 20px; min-width: 20px; overflow: visible; }
.row-t .mk { min-width: 20px; overflow: visible; }
.mk svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.mk .trk { stroke-width: 2.4; opacity: .22; }
.mk .arc { stroke-width: 2.4; }
.mk path { stroke-width: 2.4; }
.mk.ok { color: var(--ok); }
.mk.ok.fast { color: #f5a800; }
.mk.bad { border-radius: 50%; background: var(--bad); color: #fff; }
.mk.bad svg { width: 12px; height: 12px; stroke-width: 3.2; }
.es-tag .mk svg { width: 18px; height: 18px; }
.es-tag .mk.bad svg { width: 11px; height: 11px; }

/* 앱 안 브라우저 안내 (홈·대기실 위쪽) */
.inapp { display: flex; align-items: center; gap: 8px; margin: 4px 0 14px; padding: 8px 6px 8px 14px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow-s); font-size: 13px; line-height: 1.35; color: var(--label-2); }
.inapp span { flex: 1; min-width: 0; }
.inapp-open { flex: none; height: 32px; padding: 0 12px; border-radius: 99px; background: var(--fill-2); color: var(--label); font-weight: 700; font-size: 13px; }
.inapp-x { flex: none; width: 30px; height: 30px; }
.inapp-x svg { width: 16px; height: 16px; }
.share-hint { margin: 8px 0 0; text-align: center; font-size: 13px; color: var(--label-2); }

/* 홈: 오늘의 문제 */
.daily { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 12px; padding: 12px 14px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow-s); text-align: left; transition: transform .2s var(--ease); }
.daily:active { transform: scale(.98); }
.daily-ic { flex: none; display: flex; flex-direction: column; align-items: center; width: 46px; height: 48px; border-radius: 12px; overflow: hidden; background: var(--card-2); box-shadow: inset 0 0 0 .5px var(--sep); }
.daily-ic small { align-self: stretch; height: 15px; background: linear-gradient(135deg, #a28bff, #5a33e6); color: #fff; font-size: 9.5px; font-weight: 750; line-height: 15px; text-align: center; letter-spacing: .02em; }
.daily-ic b { flex: 1; display: grid; place-items: center; font-size: 21px; font-weight: 800; letter-spacing: -.03em; color: var(--label); }
.daily-t { flex: 1; min-width: 0; }
.daily-t b { display: block; font-size: 16px; font-weight: 750; letter-spacing: -.02em; }
.daily-t small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.daily-st { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; padding: 6px 12px; border-radius: 99px; background: var(--tint); color: #fff; font-size: 14px; font-weight: 750; }
.daily-st.done { padding: 0; background: none; color: var(--label); }
.daily-st.done b { font-size: 18px; font-weight: 850; }
.daily-st small { font-size: 11.5px; font-weight: 650; color: var(--label-2); }
.daily-st:not(.done) small { color: rgba(255, 255, 255, .85); }
.res-actions .wide { grid-column: 1 / -1; }

/* 멀티 반응: 이모지 줄 · 아바타에서 떠오르는 이모지 */
.chat-form .react-btn { background: var(--fill); color: var(--label); }
.chat-form .react-btn[aria-expanded="true"] { background: var(--label); color: var(--bg); }
.chat-form .react-btn svg { width: 22px; height: 22px; }
.react-bar { display: flex; justify-content: space-between; gap: 4px; margin-top: 8px; animation: pop2 .25s var(--spring) both; }
.react-bar button { flex: 1; height: 40px; border-radius: 12px; background: var(--fill); font-size: 22px; line-height: 1; transition: transform .15s var(--ease); }
.react-bar button:active { transform: scale(.86); }
.fly { position: absolute; z-index: 9; font-size: 26px; line-height: 1; pointer-events: none; transform: translate(-50%, -50%); animation: fly 1.5s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes fly {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); }
  15% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + 64px)) scale(.9); }
}
@media (prefers-reduced-motion: reduce) { .fly { animation-duration: .8s; } }

/* 인트로 다시 듣기: 원판을 누를 수 있음 */
.disc-wrap.again { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.disc-wrap.again .disc { transition: transform .15s var(--ease); }
.disc-wrap.again:active .disc { transform: scale(.96); }
.disc-wrap.again .disc-sub { color: var(--c-text); font-weight: 750; }
