/* Video Studio: same dark theme as pools.vincentho.uk (Figma betting kit tokens) + Streamline Pixel icons. */
:root {
  --bg: #1a1a19; --card: #21201f; --sunken: #171615; --raised: #2a2928;
  --text: #ffffff; --body: #c9c6c3; --text-dim: #8d8a86;
  --border: #2a2928; --border-strong: #3d3b39;
  --accent: #ed3440; --accent-2: #ff535e; --accent-tint: #2e1c1e;
  --ok: #2fe04a; --warn: #ffb020; --bad: #ff5c66; --info: #5aa9ff;
  --radius: 16px; --radius-sm: 10px;
  --font: Fredoka, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --display: 'Lilita One', Fredoka, 'Segoe UI', sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.5; padding-bottom: 96px; }
a { color: var(--accent-2); }
.pix { fill: currentColor; shape-rendering: crispEdges; flex: none; vertical-align: -0.2em; }

.top { padding: 18px 16px 10px; max-width: 760px; margin: 0 auto; }
.brand { font-family: var(--display); font-size: 1.9rem; letter-spacing: .04em; line-height: 1; }
.brand span { color: var(--accent); }
.sub { color: var(--text-dim); font-size: .85rem; margin-top: 4px; }
main { max-width: 760px; margin: 0 auto; padding: 0 16px; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin: 12px 0; }
.hero { background: radial-gradient(120% 140% at 0% 0%, rgba(237,52,64,.2), transparent 55%), var(--card); }
.hero-row { display: flex; gap: 12px; align-items: flex-start; }
.hero-row > div:first-child { flex: 1; }
.hero-icon { color: var(--accent); }
.hero-icon .pix { width: 56px; height: 56px; }
h1 { font-family: var(--display); font-weight: 400; font-size: 1.6rem; margin: 0 0 6px; letter-spacing: .02em; }
h2 { font-family: var(--display); font-weight: 400; font-size: 1.15rem; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; letter-spacing: .02em; }
h2 .pix { color: var(--accent); margin-left: auto; width: 20px; height: 20px; }
.step { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--accent); color: #fff; font-size: .85rem; box-shadow: inset 0 -2px 0 rgba(0,0,0,.3); }
.opt { font-family: var(--font); font-size: .72rem; color: var(--text-dim); background: var(--sunken); border-radius: 999px; padding: 2px 8px; }
.dim, .hint { color: var(--text-dim); font-size: .85rem; margin: 6px 0; }
.hint:empty { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { background: var(--sunken); border: 1px solid var(--border-strong); border-radius: 999px; padding: 3px 10px; font-size: .75rem; color: var(--body); }

textarea, input:not([type]), input[type=text] { width: 100%; background: var(--sunken); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 10px 12px; font: inherit; font-size: 16px; resize: vertical; }
textarea:focus, input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.fld { display: block; font-size: .8rem; color: var(--text-dim); margin: 10px 0 0; }
.fld > input, .fld > textarea { margin-top: 4px; }
.label { font-size: .8rem; color: var(--text-dim); margin: 14px 0 6px; }
.label b { color: var(--text); }

.row { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; flex-wrap: wrap; }
.grow { flex: 1; }
.mini { font-size: .75rem; color: var(--text-dim); display: flex; flex-direction: column; gap: 4px; }
.stepper { display: flex; align-items: center; background: var(--sunken); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); height: 44px; }
.stepper button { width: 40px; height: 100%; background: none; border: 0; color: var(--text); font-size: 1.3rem; cursor: pointer; }
.stepper b { min-width: 22px; text-align: center; font-family: var(--display); font-weight: 400; font-size: 1.1rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--raised); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-ghost { background: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--raised); }
.btn-red { background: linear-gradient(180deg, var(--accent-2), var(--accent)); border-color: transparent; font-family: var(--display); font-weight: 400; letter-spacing: .04em; text-transform: uppercase; box-shadow: 0 6px 18px rgba(237,52,64,.35), inset 0 -3px 0 rgba(0,0,0,.25); }
.btn .pix { width: 18px; height: 18px; }
.full { width: 100%; margin-top: 4px; }

.seg { display: flex; background: var(--sunken); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { flex: 1; min-height: 44px; border: 0; border-radius: 10px; background: none; color: var(--body); font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.seg button[aria-checked=true] { background: var(--accent); color: #fff; box-shadow: inset 0 -2px 0 rgba(0,0,0,.25); }
.seg.small button { min-height: 40px; font-size: .9rem; }
.frame { display: inline-block; border: 2px solid currentColor; border-radius: 3px; }
.frame.wide { width: 22px; height: 13px; }
.frame.tall { width: 12px; height: 20px; }

input[type=range] { width: 100%; accent-color: var(--accent); height: 28px; }
.toggle { display: flex; gap: 10px; align-items: center; font-size: .85rem; color: var(--body); margin-top: 10px; }
.toggle input { width: 20px; height: 20px; accent-color: var(--accent); }

.cost { margin-top: 14px; background: var(--sunken); border-radius: 12px; padding: 10px 12px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: .85rem; color: var(--text-dim); }
.cost b { font-family: var(--display); font-weight: 400; font-size: 1.3rem; color: var(--text); }

details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details > summary h2 { margin: 0; }
details[open] > summary h2 { margin-bottom: 8px; }

.shot { border: 1px solid var(--border-strong); border-radius: 14px; padding: 12px; margin-bottom: 10px; background: var(--sunken); }
.shot-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.shot-head b { font-family: var(--display); font-weight: 400; font-size: 1rem; }
.tc { font-size: .72rem; color: #111; background: var(--warn); border-radius: 999px; padding: 1px 8px; font-weight: 700; }
.shot-head .x { margin-left: auto; background: none; border: 0; color: var(--text-dim); font-size: 1.3rem; cursor: pointer; width: 36px; height: 36px; }
.shot .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.shot .grid .fld { min-width: 0; }
.shot .wide { grid-column: 1 / -1; }
.shot textarea, .shot input { background: var(--card); }
.fld .pix { width: 13px; height: 13px; margin-right: 4px; color: var(--accent); }

.drop { display: flex; align-items: center; justify-content: center; gap: 10px; border: 2px dashed var(--border-strong); border-radius: 14px; min-height: 84px; color: var(--body); cursor: pointer; }
.drop.over { border-color: var(--accent); background: var(--accent-tint); }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumb { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border-strong); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 2px; right: 2px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.7); color: #fff; cursor: pointer; }
.thumb span { position: absolute; left: 0; right: 0; bottom: 0; font-size: .65rem; text-align: center; background: rgba(0,0,0,.65); }

.preview { margin-top: 12px; }
.preview summary { color: var(--accent-2); font-size: .9rem; font-weight: 600; }
pre { white-space: pre-wrap; word-break: break-word; background: var(--sunken); border-radius: 12px; padding: 12px; font-size: .8rem; color: var(--body); max-height: 320px; overflow: auto; }

.result { border-color: var(--accent); }
.progress { display: flex; gap: 14px; align-items: center; }
.progress .pix { width: 40px; height: 40px; color: var(--accent); animation: tilt 1.6s steps(2, end) infinite; }
@keyframes tilt { 50% { transform: rotate(180deg); } }
.bar { height: 8px; background: var(--sunken); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--accent) 0 8px, var(--accent-2) 8px 16px); transition: width .8s linear; }
.player { width: 100%; border-radius: 12px; background: #000; display: block; max-height: 70vh; }
.err { background: #361719; border: 1px solid var(--bad); border-radius: 12px; padding: 10px 12px; color: #ffd6d9; font-size: .9rem; white-space: pre-wrap; }

.hist { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.hist:first-child { border-top: 0; }
.hist video { width: 96px; height: 64px; object-fit: cover; border-radius: 8px; background: #000; }
.hist .t { font-size: .85rem; color: var(--body); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hist .m { font-size: .72rem; color: var(--text-dim); }
.hist .a { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.hist .a .btn { min-height: 34px; padding: 0 10px; font-size: .8rem; }

.dock { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(16,14,20,.92); backdrop-filter: blur(8px); border-top: 1px solid var(--border); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 12px; align-items: center; justify-content: center; z-index: 10; }
.dock-cost { font-size: .8rem; color: var(--text-dim); line-height: 1.25; }
.dock-cost b { color: var(--text); font-size: 1rem; }
.dock .btn { min-width: 160px; }
.foot { text-align: center; color: var(--text-dim); font-size: .75rem; padding: 18px 0 8px; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--raised); border: 1px solid var(--border-strong); padding: 8px 14px; border-radius: 10px; font-size: .85rem; z-index: 20; }

@media (max-width: 480px) { .shot .grid { grid-template-columns: 1fr; } .hero-icon .pix { width: 44px; height: 44px; } }
@media (prefers-reduced-motion: reduce) { .progress .pix { animation: none; } }
