:root {
  color-scheme: dark;
  --bg: oklch(0.095 0 0);
  --surface: oklch(0.155 0.012 135);
  --surface-2: oklch(0.205 0.016 145);
  --ink: oklch(0.955 0.006 145);
  --muted: oklch(0.72 0.018 145);
  --line: oklch(0.34 0.024 145);
  --primary: oklch(0.66 0.105 112);
  --accent: oklch(0.64 0.145 32);
  --danger: oklch(0.62 0.19 25);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 18% 0%, oklch(0.23 0.04 145), transparent 32rem), var(--bg); }
button, input, textarea, select { font: inherit; }
button { min-height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 13px; background: var(--surface-2); color: var(--ink); font-weight: 750; cursor: pointer; transition: background .18s ease, transform .18s ease, border-color .18s ease; }
button:hover { background: oklch(0.26 0.02 145); border-color: var(--primary); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .48; cursor: not-allowed; }
button.ghost { background: transparent; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: oklch(0.115 0.008 145); color: var(--ink); padding: 10px 12px; outline: none; }
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px oklch(0.66 0.105 112 / .18); }
.app-shell { width: min(1480px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 48px; }
.topbar { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding: 14px 0 22px; }
.app-kicker { margin: 0 0 5px; color: var(--primary); font-size: 12px; font-weight: 800; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 32px; line-height: 1.05; }
h2 { margin-bottom: 0; font-size: 18px; }
.top-actions, .settings-actions, .gate-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.live-pill { display: inline-flex; align-items: center; min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-weight: 800; }
.live-pill.is-on { color: oklch(0.88 0.12 140); border-color: oklch(0.66 0.105 112); }
.notice { margin: 0 0 14px; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--line); }
.notice.error { border-color: var(--danger); color: oklch(0.88 0.08 25); }
.notice.success { border-color: var(--primary); color: oklch(0.88 0.08 120); }
.summary-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 14px; margin-bottom: 14px; }
.hero-panel, .panel { border: 1px solid var(--line); border-radius: 8px; background: color-mix(in oklch, var(--surface) 92%, black); }
.hero-panel { min-height: 184px; display: flex; gap: 22px; align-items: center; padding: 20px; }
.progress-ring { width: 132px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--primary) calc(var(--pct) * 1%), oklch(0.24 0.016 145) 0); position: relative; flex: none; }
.progress-ring::after { content: ""; position: absolute; inset: 10px; border-radius: inherit; background: var(--surface); }
.progress-ring strong, .progress-ring span { position: relative; z-index: 1; }
.progress-ring strong { font-size: 30px; }
.progress-ring span { margin-top: 34px; color: var(--muted); position: absolute; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: 12px 0; }
.tabs button { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom-color: transparent; background: transparent; }
.tabs button.is-active { background: var(--surface); color: var(--primary); border-color: var(--line); }
.panel { padding: 14px; }
.panel-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 12px; }
.collection-panel .panel-head { display: grid; grid-template-columns: auto minmax(520px, 780px); }
.collection-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.filter-tabs { display: inline-flex; flex: none; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: oklch(0.115 0.008 145); }
.filter-tabs button { min-height: 30px; padding: 0 9px; border: 0; background: transparent; color: var(--muted); }
.filter-tabs button.is-active { background: var(--surface-2); color: var(--primary); }
.collection-toolbar input { max-width: 240px; }
.sort-control { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 800; white-space: nowrap; }
.sort-control select { width: auto; min-width: 270px; min-height: 34px; padding: 7px 28px 7px 10px; }
.load-more { display: flex; justify-content: center; padding-top: 12px; }
.achievement-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
.achievement-row { min-height: 96px; display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: start; gap: 12px; padding: 10px; border: 1px solid oklch(0.27 0.018 145); border-radius: 8px; background: oklch(0.13 0.01 145); position: relative; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.achievement-row:hover { border-color: var(--primary); background: oklch(0.155 0.014 145); transform: translateY(-1px); }
.achievement-hit { position: absolute; inset: 0; z-index: 2; width: 100%; min-height: 0; border: 0; border-radius: inherit; padding: 0; background: transparent; cursor: pointer; }
.achievement-hit:hover { background: transparent; border-color: transparent; }
.achievement-row img { width: 58px; height: 58px; object-fit: cover; border-radius: 7px; background: oklch(0.1 0 0); }
.achievement-row.is-locked img { filter: grayscale(1) brightness(.7); opacity: .72; }
.achievement-copy { min-width: 0; display: grid; gap: 5px; }
.achievement-titleline { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; min-width: 0; }
.achievement-titleline strong { min-width: 0; overflow-wrap: break-word; }
.achievement-titleline span { flex: none; color: var(--muted); font-size: 12px; font-weight: 800; }
.achievement-row p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.35; }
.achievement-row time { color: var(--primary); font-size: 12px; font-weight: 800; line-height: 1.25; }
.history-list { display: grid; gap: 8px; }
.history-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: oklch(0.13 0.01 145); }
.history-row span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.settings-panel { display: grid; gap: 12px; }
.settings-panel label { display: grid; gap: 6px; color: var(--muted); font-weight: 700; }
.switch-row { display: flex; flex-wrap: wrap; gap: 12px; }
.switch-row label { display: flex; align-items: center; width: auto; color: var(--ink); }
.switch-row input { width: auto; }
.guide { padding: 12px; border: 1px solid oklch(0.42 0.08 80); border-radius: 8px; background: oklch(0.18 0.025 80); }
.guide p { margin: 6px 0 0; color: var(--muted); }
.overlay-url { width: 100%; min-height: 46px; justify-content: flex-start; text-align: left; overflow: hidden; text-overflow: ellipsis; }
.gate-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate-panel { width: min(620px, 100%); padding: 24px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.skeleton { min-height: 420px; border-radius: 8px; background: linear-gradient(90deg, var(--surface), var(--surface-2), var(--surface)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.modal-backdrop { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 18px; background: oklch(0 0 0 / .74); }
.overlay-editor { width: min(1180px, 100%); border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 14px; }
.overlay-editor header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.overlay-editor header > div:last-child { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.editor-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 7px; color: var(--muted); font-size: 12px; }
.editor-summary strong { color: var(--ink); }
.stage { aspect-ratio: 16 / 9; width: 100%; position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(135deg, oklch(0.12 0.02 145), oklch(0.2 0.04 32)); }
.stage-alert { position: absolute; left: calc(var(--x) / 1920 * 100%); top: calc(var(--y) / 1080 * 100%); transform: scale(var(--scale)); transform-origin: top left; width: calc(var(--w) / 1920 * 100%); height: calc(var(--h) / 1080 * 100%); border: 2px solid oklch(0.72 0.12 112); border-radius: 4px; background: oklch(0.1 0 0 / .2); box-shadow: inset 0 0 0 1px oklch(0.94 0.08 112 / .28); cursor: move; }
.stage-alert.is-active { outline: 2px solid oklch(0.88 0.14 112 / .68); outline-offset: 2px; }
.resize-handle { position: absolute; width: 14px; height: 14px; border: 2px solid oklch(0.1 0 0); background: var(--primary); }
.resize-handle.is-nw { left: -7px; top: -7px; cursor: nwse-resize; }
.resize-handle.is-ne { right: -7px; top: -7px; cursor: nesw-resize; }
.resize-handle.is-sw { left: -7px; bottom: -7px; cursor: nesw-resize; }
.resize-handle.is-se { right: -7px; bottom: -7px; cursor: nwse-resize; }
.editor-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.editor-chips button { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; }
.editor-chips button.is-active { border-color: var(--primary); color: var(--primary); }
.editor-chips span { color: var(--muted); font-size: 12px; }
.empty { padding: 16px; color: var(--muted); }
@media (max-width: 820px) { .summary-grid, .collection-panel .panel-head { grid-template-columns: 1fr; } .collection-toolbar { align-items: stretch; flex-direction: column; } .collection-toolbar input, .sort-control select { max-width: none; width: 100%; } .sort-control { align-items: stretch; flex-direction: column; } .filter-tabs { width: 100%; } .filter-tabs button { flex: 1; } .topbar, .history-row { align-items: flex-start; flex-direction: column; } .achievement-titleline { align-items: flex-start; flex-direction: column; gap: 4px; } .overlay-editor header { flex-direction: column; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
