@font-face { font-family: Gelasio; src: url("/fonts/gelasio.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: Gelasio; src: url("/fonts/gelasio-italic.woff2") format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #12141b; --panel: #1b1e28; --line: #2e3342; --ink: #e9e6dc; --dim: #9a9fae;
  --accent-bg: #e2b23a; --accent-ink: #1a1608; --mark: #e2b23a;
  --read: Gelasio, Georgia, serif;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--ui); }
body { padding: env(safe-area-inset-top, 0px) max(16px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
[hidden] { display: none !important; }
.hide { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
main, #login { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; padding-top: 16px; }
h1 { font: 700 32px/1 var(--read); margin: 0; letter-spacing: -0.01em; }
h2 { font: 700 24px/1.25 var(--read); margin: 0; text-wrap: balance; }
h3 { font: 600 14px var(--ui); margin: 0; color: var(--dim); text-transform: uppercase; letter-spacing: 0.06em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--mark); outline-offset: 2px; }

button, input, #outside { font: 600 16px var(--ui); min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 0 16px; }
button { cursor: pointer; transition: transform 0.12s, border-color 0.2s; }
button:active { transform: scale(0.96); }
.primary, button[aria-pressed="true"] { background: var(--accent-bg); color: var(--accent-ink); border-color: var(--accent-bg); }
input { width: 100%; min-width: 0; font-weight: 400; }
#outside { display: inline-flex; align-items: center; text-decoration: none; }
.row { display: flex; flex-wrap: wrap; gap: 8px; }

header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
#tabs { display: flex; gap: 6px; }
#tabs button { min-height: 40px; padding: 0 14px; border-radius: 999px; }
#add { display: flex; gap: 8px; }
#notice, #saved, #login-error { color: var(--dim); font-size: 14px; min-height: 21px; }
#login-error { color: var(--mark); }

#list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; }
#list:empty { display: none; }
#list li { border-bottom: 1px solid var(--line); animation: rise 0.35s ease-out backwards; }
#list li:last-child { border-bottom: 0; }
#list li:nth-child(2) { animation-delay: 0.03s; } #list li:nth-child(3) { animation-delay: 0.06s; }
#list li:nth-child(4) { animation-delay: 0.09s; } #list li:nth-child(5) { animation-delay: 0.12s; }
#list li:nth-child(n+6) { animation-delay: 0.15s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.item { display: flex; gap: 12px; align-items: center; width: 100%; min-height: 78px; padding: 12px; border: 0; border-radius: 0; background: none; text-align: left; font-weight: 400; }
.thumb { flex: none; width: 104px; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: var(--line); position: relative; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb progress { position: absolute; left: 0; bottom: 0; width: 100%; height: 4px; appearance: none; border: 0; background: transparent; }
.thumb progress::-webkit-progress-bar { background: transparent; }
.thumb progress::-webkit-progress-value { background: var(--mark); }
.thumb progress::-moz-progress-bar { background: var(--mark); }
.words { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.words strong { font: 600 16px/1.25 var(--read); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.words small { color: var(--dim); font-size: 14px; }
.words .resume { color: var(--mark); font-weight: 700; font-variant-numeric: tabular-nums; }

#stage { aspect-ratio: 16 / 9; width: 100%; background: #000; border-radius: 12px; overflow: hidden; }
#stage iframe { width: 100%; height: 100%; border: 0; display: block; }
#stage p { padding: 24px; color: var(--dim); }
#byline { color: var(--dim); }
#saved { font-variant-numeric: tabular-nums; }
#saved.fresh { color: var(--mark); animation: glow 0.6s ease-out; }
@keyframes glow { from { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
