/* theme.css — Miku Stage 공용 디자인 토큰 · 기본 컴포넌트 (index.html / benchmark.html)
   방향: 무대 뒤 콘솔. 거의 검은 잉크 + 단 하나의 청록 액센트, 헤어라인, 절제된 유리. */
:root {
  color-scheme: dark;
  --ink: #06080a;
  --ink-2: #0b0f12;
  --ink-3: #10161a;
  --line: rgba(222, 240, 240, 0.09);
  --line-2: rgba(222, 240, 240, 0.17);
  --text: #e9f1f1;
  --mute: #8fa0a5;
  --dim: #65757a;
  --accent: #55e3d3;
  --accent-soft: rgba(85, 227, 211, 0.14);
  --accent-ink: #032420;
  --hot: #ff6b93;
  --warn: #f2bd60;
  --ok: #6ee7a0;
  --glass: rgba(9, 13, 16, 0.74);
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --r-s: 8px;
  --r-m: 12px;
  --r-l: 16px;
  --shadow-float: 0 18px 50px -12px rgba(0, 0, 0, 0.7), 0 2px 10px rgba(0, 0, 0, 0.35);
  --font: "Geist", "Noto Sans KR", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--ink); color: var(--text); font-family: var(--font); }
body { font-size: 14px; line-height: 1.5; word-break: keep-all; overflow-wrap: break-word; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
* { scrollbar-width: thin; scrollbar-color: rgba(222, 240, 240, 0.2) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(222, 240, 240, 0.16); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(222, 240, 240, 0.3); background-clip: padding-box; border: 2px solid transparent; }
input, select { caret-color: var(--accent); }

/* --- 아이콘 (authored SVG sprite, 1.5px 라인) --- */
.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; display: block; }
.i.fill { fill: currentColor; stroke: none; }

/* --- 버튼 --- */
.ibtn {
  width: 40px; height: 40px; display: inline-grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--text);
  transition: background 0.35s var(--ease), color 0.35s var(--ease), transform 0.35s var(--ease);
}
.ibtn:hover { background: rgba(222, 240, 240, 0.1); }
.ibtn:active { transform: scale(0.92); }
.ibtn.primary { background: var(--text); color: var(--ink); }
.ibtn.primary:hover { background: #fff; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 46px; padding: 0 22px; border-radius: 999px; border: 1px solid var(--line-2);
  background: rgba(222, 240, 240, 0.06); color: var(--text); font-weight: 600; text-decoration: none;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), transform 0.4s var(--ease);
}
.btn:hover { background: rgba(222, 240, 240, 0.12); border-color: rgba(222, 240, 240, 0.3); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.solid { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.solid:hover { background: #7aeee1; border-color: #7aeee1; }
.btn.small { height: 36px; padding: 0 16px; font-size: 13px; }
/* 버튼 속 버튼: 우측 화살표를 자체 원 안에 둔다 */
.btn .nest {
  width: 28px; height: 28px; margin-right: -12px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(222, 240, 240, 0.1); transition: transform 0.4s var(--ease), background 0.4s var(--ease);
}
.btn.solid .nest { background: rgba(3, 36, 32, 0.16); }
.btn:hover .nest { transform: translate(2px, -1px); }
.btn .nest .i { width: 15px; height: 15px; }

/* --- 스위치 --- */
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .slider { position: absolute; inset: 0; border-radius: 22px; background: rgba(222, 240, 240, 0.16); transition: background 0.35s var(--ease); }
.switch .slider::before {
  content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform 0.4s var(--ease); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(16px); background: var(--accent-ink); }
.switch input:focus-visible + .slider { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled { cursor: not-allowed; }

/* --- 세그먼트 컨트롤 --- */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; gap: 2px; border-radius: 12px; background: rgba(222, 240, 240, 0.06); border: 1px solid var(--line); }
.seg button { height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--mute); font-weight: 600; font-size: 13px; transition: background 0.35s var(--ease), color 0.35s var(--ease); }
.seg button:hover { color: var(--text); }
.seg button[aria-checked="true"], .seg button.on { background: var(--text); color: var(--ink); }

.tier { display: inline-grid; place-items: center; min-width: 34px; height: 22px; padding: 0 8px; border-radius: 6px; font: 700 11px/1 var(--mono); letter-spacing: 0.02em; }
.tier-SSS { background: #f5f0ff; color: #2a1250; }
.tier-SS { background: #b8a4ff; color: #1e0f4d; }
.tier-S { background: var(--accent); color: var(--accent-ink); }
.tier-A { background: var(--ok); color: #05261a; }
.tier-B { background: var(--warn); color: #3a2603; }
.tier-C { background: #ff9d7a; color: #401403; }
.tier-D { background: #4a5a5f; color: #dfeaea; }

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