@font-face { font-family: 'Anton'; src: url(../vendor/Anton.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Inter'; src: url(../vendor/Inter.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #0b0b0c;
  --bg2: #141416;
  --fg: #f3f0ea;
  --muted: #8d8a85;
  --accent: #c8ff3e;
  --line: rgba(243, 240, 234, .14);
  --display: 'Anton', Impact, 'Arial Narrow', sans-serif;
  --body: 'Inter', system-ui, -apple-system, sans-serif;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font-family: var(--body); overflow: hidden; overscroll-behavior: none; }
body { -webkit-font-smoothing: antialiased; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
[hidden] { display: none !important; }

.app { height: 100dvh; display: flex; flex-direction: column; padding-top: var(--sat); }

.top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.logo { font-family: var(--display); font-size: 26px; letter-spacing: .02em; line-height: 1; }
.logo span { color: var(--accent); }
.file { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; flex: none; }
.icon-btn:active { background: var(--line); }

.stage { position: relative; flex: 1 1 auto; min-height: 120px; display: grid; place-items: center; overflow: hidden; margin: 0 16px; border-radius: 14px; background: #050506; touch-action: none; }
.stage canvas { max-width: 100%; max-height: 100%; display: block; object-fit: contain; width: auto; height: auto; }
.empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(60% 60% at 30% 70%, rgba(200, 255, 62, .16), transparent 60%), radial-gradient(60% 60% at 80% 20%, rgba(0, 168, 107, .14), transparent 60%), #06140c; }
.big-open { text-align: left; display: flex; flex-direction: column; gap: 14px; }
.big-open__t { font-family: var(--display); text-transform: uppercase; font-size: clamp(44px, 14vw, 72px); line-height: .9; }
.big-open__s { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.badge { position: absolute; top: 12px; left: 12px; background: var(--accent); color: #000; font-weight: 700; font-size: 11px; letter-spacing: .14em; padding: 5px 9px; border-radius: 999px; opacity: 0; transition: opacity .15s; pointer-events: none; }
.stage.compare .badge { opacity: 1; }
.hint { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: rgba(243, 240, 234, .55); pointer-events: none; transition: opacity .4s; }
.hint.off { opacity: 0; }

.vbar { display: flex; align-items: center; gap: 8px; padding: 6px 12px 0; }
.time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; }

input[type=range] { -webkit-appearance: none; appearance: none; flex: 1; height: 28px; background: transparent; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 3px; background: linear-gradient(90deg, var(--accent) var(--fill, 0%), var(--line) var(--fill, 0%)); border-radius: 2px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9.5px; border-radius: 50%; background: var(--fg); box-shadow: 0 1px 6px rgba(0, 0, 0, .5); }
input[type=range]::-moz-range-track { height: 3px; background: var(--line); }
input[type=range]::-moz-range-progress { height: 3px; background: var(--accent); }
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--fg); border: 0; }

.tabs { display: flex; gap: 4px; padding: 10px 16px 0; }
.tabs button { flex: 1 1 auto; padding: 10px 0; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--fg); border-color: var(--accent); }
.tabs button.has::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--accent); vertical-align: middle; transform: translateY(-1px); }

.panel { flex: 0 0 38dvh; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 16px 8px; border-top: 1px solid var(--line); }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 10px; padding: 0 16px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; white-space: nowrap; }
.chip.on { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 600; }
.chip--mine { border-style: dashed; }
.chip--add { color: var(--accent); border-color: rgba(200, 255, 62, .4); }

.save-row { display: flex; gap: 8px; margin-bottom: 10px; }
.save-row input { flex: 1; min-width: 0; background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; color: var(--fg); font: inherit; font-size: 16px; padding: 8px 14px; -webkit-user-select: text; user-select: text; }

.mode { display: flex; gap: 8px; margin-bottom: 6px; }
.mode button { flex: 1; padding: 8px; border-radius: 10px; border: 1px solid var(--line); font-size: 13px; }
.mode button.on { border-color: var(--accent); color: var(--accent); }

.group { margin: 14px 0 2px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.group:first-child { margin-top: 4px; }
.row { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 10px; padding: 2px 0; }
.row label { font-size: 13px; color: var(--fg); }
.row .val { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 32px; text-align: right; }
.row input { grid-column: 1 / -1; width: 100%; }
.row.zero label { color: var(--muted); }
.field { display: block; margin: 8px 0 10px; }
.field span { display: block; font-size: 13px; margin-bottom: 6px; }
.field input { width: 100%; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; color: var(--fg); font: inherit; font-size: 16px; padding: 10px 12px; -webkit-user-select: text; user-select: text; }
.field input:focus { outline: none; border-color: var(--accent); }
.tip { font-size: 12px; line-height: 1.5; color: var(--muted); margin: 14px 0 4px; }

.bar { display: flex; gap: 10px; padding: 10px 16px calc(var(--sab) + 10px); border-top: 1px solid var(--line); }
.pill { flex: 1; height: 48px; border-radius: 999px; border: 1px solid var(--line); font-weight: 600; font-size: 14px; letter-spacing: .1em; text-transform: uppercase; }
.pill--accent { background: var(--accent); color: #000; border-color: var(--accent); }
.pill:disabled { opacity: .35; }
.pill:active:not(:disabled) { transform: scale(.98); }

.sheet { position: fixed; inset: 0; z-index: 10; background: rgba(0, 0, 0, .6); display: flex; align-items: flex-end; }
.sheet__box { width: 100%; background: var(--bg2); border-radius: 20px 20px 0 0; padding: 18px 16px calc(var(--sab) + 16px); border-top: 1px solid var(--line); }
.sheet__item { display: block; width: 100%; text-align: left; padding: 15px 4px; font-size: 15px; border-bottom: 1px solid var(--line); }
.sheet__item:last-child { border: 0; }
.sheet__item--muted { color: var(--muted); }
.sheet__title { font-family: var(--display); text-transform: uppercase; font-size: 34px; line-height: 1; margin-bottom: 14px; }
.sheet__note { font-size: 13px; color: var(--muted); line-height: 1.45; margin: 12px 0; }
.sheet__note b { color: var(--fg); font-weight: 600; }
.sheet__stat { font-size: 13px; color: var(--fg); font-variant-numeric: tabular-nums; margin: 8px 0 14px; min-height: 1em; }
.sheet__actions { display: flex; gap: 10px; }
.seg { display: flex; gap: 8px; }
.seg button { flex: 1; padding: 11px 6px; border-radius: 12px; border: 1px solid var(--line); font-size: 13px; line-height: 1.3; }
.seg button small { display: block; color: var(--muted); font-size: 11px; }
.seg button.on { border-color: var(--accent); }
.seg button.on small { color: var(--accent); }
.progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 16px; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

.toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--sab) + 84px); z-index: 20; background: var(--fg); color: var(--bg); padding: 12px 16px; border-radius: 14px; font-size: 14px; line-height: 1.4; opacity: 0; transform: translateY(8px); transition: .25s; pointer-events: none; }
.toast.on { opacity: 1; transform: none; }

@media (min-width: 900px) {
  .app { max-width: 520px; margin: 0 auto; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}
