/* Sports Animation — studio (SRL, 2026-10-10) */
:root {
  --bg: #0c1017; --panel: #11161f; --card: #161b25; --card2: #1b2230; --line: #232b3a; --line2: #2d3748;
  --text: #e9edf4; --muted: #8b95a8; --dim: #5d677a;
  --gold: #ffc21a; --gold2: #ffd65c; --ink: #1b1400; --ok: #39d98a; --bad: #ff6b6b;
  --r: 12px; --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
svg { fill: currentColor; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- header */
.top { height: 60px; display: flex; align-items: center; gap: 28px; padding: 0 20px; border-bottom: 1px solid var(--line); background: var(--panel); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: -.01em; font-size: 16px; }
.mark { width: 32px; height: 32px; border-radius: 9px; background: var(--gold); color: var(--ink); display: grid; place-items: center; }
.mark svg { width: 24px; height: 24px; }
.beta { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--gold); border: 1px solid rgba(255,194,26,.4); border-radius: 99px; padding: 1px 7px; }
.tabs { display: flex; gap: 4px; margin-right: auto; }
.tabs a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 600; }
.tabs a.on { color: var(--text); background: var(--card2); }
.tabs a.soon { opacity: .55; }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 10px; padding: 10px 16px; font-weight: 700; transition: transform .08s, background .15s, box-shadow .15s; }
.btn svg { width: 18px; height: 18px; }
.btn.gold { background: var(--gold); color: var(--ink); box-shadow: 0 4px 18px rgba(255,194,26,.18); }
.btn.gold:hover { background: var(--gold2); }
.btn.gold:active { transform: translateY(1px); }
.btn.ghost { background: transparent; border: 1px solid var(--line2); color: var(--text); }
.btn.wide { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------------------------------------------------------------- layout */
.studio { display: grid; grid-template-columns: 432px 1fr; height: calc(100% - 60px); }
.library { border-right: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.lib-head { padding: 18px 18px 10px; }
h1 { font-size: 18px; margin: 0 0 12px; letter-spacing: -.01em; }
.count { color: var(--dim); font-weight: 600; font-size: 14px; margin-left: 4px; }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--dim); }
.search input { width: 100%; height: 40px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg); color: var(--text); padding: 0 12px 0 36px; font: inherit; outline: none; }
.search input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255,194,26,.15); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { border: 1px solid var(--line2); background: transparent; color: var(--muted); padding: 5px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 600; }
.chip b { color: var(--dim); font-weight: 600; margin-left: 4px; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip.on b { color: #4a5263; }
.chip:disabled { opacity: .4; cursor: default; }
.grid { padding: 6px 18px 24px; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start; }
.grid::-webkit-scrollbar { width: 10px; } .grid::-webkit-scrollbar-thumb { background: var(--line); border-radius: 9px; border: 3px solid var(--panel); }

/* ---------------------------------------------------------------- move cards (preview on hover) */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; text-align: left; padding: 0; position: relative; transition: border-color .15s, transform .15s, box-shadow .15s; }
.card:hover { border-color: var(--line2); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.35); }
.card.on { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset, 0 8px 22px rgba(0,0,0,.35); }
.card .media { aspect-ratio: 1; position: relative; background: #161b25; }
.card img, .card video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.card video { opacity: 0; transition: opacity .12s; }
.card.playing video { opacity: 1; }
.card .tag { position: absolute; left: 8px; top: 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: rgba(12,16,23,.75); color: var(--muted); padding: 3px 7px; border-radius: 6px; backdrop-filter: blur(4px); }
.card .tick { position: absolute; right: 8px; top: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--gold); color: var(--ink); display: none; place-items: center; }
.card.on .tick { display: grid; }
.card .tick svg { width: 14px; height: 14px; }
.card .meta { padding: 10px 12px 12px; }
.card .nm { font-weight: 700; font-size: 13.5px; line-height: 1.25; }
.card .sub { color: var(--dim); font-size: 12px; margin-top: 3px; display: flex; gap: 6px; align-items: center; }
.card .loop { color: var(--muted); border: 1px solid var(--line2); border-radius: 5px; padding: 0 5px; font-size: 10.5px; font-weight: 700; }
.empty { grid-column: 1 / -1; color: var(--dim); text-align: center; padding: 40px 0; }

/* ---------------------------------------------------------------- the stage */
.stage { position: relative; min-width: 0; background: radial-gradient(120% 90% at 50% 18%, #1f2838 0%, #131924 52%, #0c1017 100%); }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
.who { position: absolute; left: 18px; top: 18px; display: flex; align-items: center; gap: 12px; background: rgba(17,22,31,.82); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px 10px 10px; backdrop-filter: blur(8px); }
.avatar { width: 38px; height: 38px; border-radius: 10px; background: var(--card2); display: grid; place-items: center; font-weight: 800; font-size: 13px; color: var(--gold); border: 1px solid var(--line2); }
.who-name { font-weight: 700; }
.who-sub { color: var(--muted); font-size: 12px; }
.link { background: none; border: 0; color: var(--gold); font-weight: 700; padding: 4px 6px; font-size: 13px; }
.link:hover { text-decoration: underline; }
.dl { position: absolute; right: 18px; top: 18px; }
.dl-panel { position: absolute; right: 0; top: 52px; width: 300px; background: var(--panel); border: 1px solid var(--line2); border-radius: 14px; padding: 16px; box-shadow: 0 18px 50px rgba(0,0,0,.5); }
.dl-title { font-weight: 700; margin-bottom: 12px; }
.field { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-weight: 600; font-size: 13px; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line2); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; color: var(--muted); padding: 5px 12px; border-radius: 7px; font-weight: 700; font-size: 12.5px; }
.seg button.on { background: var(--card2); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,.04) inset; }
.seg.small button { padding: 4px 9px; }
.hint { color: var(--dim); font-size: 12px; margin: 6px 0 14px; }
.hint.small { margin: 10px 0 0; min-height: 1em; }
.toggle { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; font-size: 13px; margin-bottom: 16px; cursor: pointer; }
.toggle em { color: var(--dim); font-style: normal; font-weight: 500; }
.toggle input { display: none; }
.toggle span { width: 34px; height: 20px; border-radius: 99px; background: var(--line2); position: relative; transition: background .15s; flex: none; }
.toggle span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.toggle input:checked + span { background: var(--gold); }
.toggle input:checked + span::after { transform: translateX(14px); }
.movetitle { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); font-weight: 800; font-size: 15px; letter-spacing: .01em; color: var(--text); opacity: .9; pointer-events: none; text-shadow: 0 2px 10px rgba(0,0,0,.4); }
.bar { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(720px, calc(100% - 36px)); display: flex; align-items: center; gap: 12px; background: rgba(17,22,31,.85); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; backdrop-filter: blur(8px); }
.icon { width: 34px; height: 34px; border-radius: 9px; border: 0; background: var(--card2); display: grid; place-items: center; font-weight: 800; font-size: 12px; color: var(--muted); flex: none; }
.icon:hover { color: var(--text); }
.icon svg { width: 16px; height: 16px; }
#play { background: var(--gold); color: var(--ink); }
#play .i-play { display: none; } #play.paused .i-play { display: block; } #play.paused .i-pause { display: none; }
#scrub { flex: 1; accent-color: var(--gold); height: 4px; }
.time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12.5px; width: 92px; text-align: right; }
.views { display: flex; gap: 4px; }
.busy { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; background: rgba(12,16,23,.55); color: var(--muted); font-weight: 600; backdrop-filter: blur(2px); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line2); border-top-color: var(--gold); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- joint markers */
.markers { position: absolute; inset: 0; }
.mk-help { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); background: rgba(17,22,31,.9); border: 1px solid var(--line2); border-radius: 12px; padding: 10px 16px; color: var(--muted); }
.mk-help b { color: var(--text); margin-right: 8px; }
.mk-layer { position: absolute; inset: 0; }
.mk { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 3px solid #fff; cursor: grab; box-shadow: 0 2px 10px rgba(0,0,0,.5); touch-action: none; }
.mk:active { cursor: grabbing; }
.mk span { position: absolute; left: 26px; top: 50%; transform: translateY(-50%); white-space: nowrap; font-size: 11.5px; font-weight: 700; background: rgba(12,16,23,.85); padding: 2px 7px; border-radius: 6px; pointer-events: none; }
.mk.r span { left: auto; right: 26px; }
.mk-actions { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; gap: 10px; }

/* ---------------------------------------------------------------- upload */
.modal { position: fixed; inset: 0; background: rgba(5,8,12,.66); display: grid; place-items: center; z-index: 20; backdrop-filter: blur(3px); }
.sheet { width: min(520px, calc(100% - 32px)); background: var(--panel); border: 1px solid var(--line2); border-radius: 18px; padding: 26px; position: relative; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.sheet h2 { margin: 0 0 6px; font-size: 20px; }
.sheet .sub { color: var(--muted); margin: 0 0 18px; }
.x { position: absolute; right: 14px; top: 10px; background: none; border: 0; color: var(--dim); font-size: 26px; line-height: 1; }
.drop { display: grid; justify-items: center; gap: 8px; border: 2px dashed var(--line2); border-radius: 14px; padding: 34px 16px; color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; text-align: center; }
.drop svg { width: 42px; height: 42px; color: var(--gold); }
.drop b { color: var(--text); }
.drop u { color: var(--gold); text-decoration: none; font-weight: 700; }
.drop.over, .drop:hover { border-color: var(--gold); background: rgba(255,194,26,.04); }
.formats { font-size: 12px; color: var(--dim); }
.steps { display: grid; gap: 8px; margin: 4px 0 16px; }
.steps div { color: var(--dim); font-weight: 600; padding-left: 26px; position: relative; }
.steps div::before { content: ''; position: absolute; left: 0; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; border: 2px solid var(--line2); }
.steps div.now { color: var(--text); }
.steps div.now::before { border-color: var(--gold); border-top-color: transparent; animation: spin .8s linear infinite; }
.steps div.done { color: var(--muted); }
.steps div.done::before { background: var(--ok); border-color: var(--ok); }
.track { height: 6px; border-radius: 9px; background: var(--card2); overflow: hidden; }
.fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold2)); border-radius: 9px; transition: width .4s; }
.progress .sub { margin: 10px 0 0; font-size: 12.5px; }
.toast { position: fixed; left: calc(50% + 216px); top: 84px; transform: translateX(-50%); background: var(--text); color: var(--bg); font-weight: 700; padding: 10px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.4); z-index: 30; display: flex; gap: 12px; align-items: center; }
.toast button { background: none; border: 0; color: #9a6b00; font-weight: 800; }

@media (max-width: 900px) {
  body { overflow: auto; }
  .studio { grid-template-columns: 1fr; height: auto; }
  .stage { height: 70vh; order: -1; }
  .library { border-right: 0; }
  .tabs { display: none; }
  .top { gap: 12px; padding: 0 16px; } .top .btn { margin-left: auto; padding: 9px 12px; }
  .views { display: none; }
}

/* ---------------------------------------------------------------- 0.2.0: rigging in the browser */
.busybar { width: 260px; height: 6px; border-radius: 9px; background: var(--card2); overflow: hidden; }
.busybar div { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold2)); transition: width .25s; }
.spinner.small { width: 26px; height: 26px; border-width: 3px; margin: 6px auto 0; }
.progress { text-align: center; }
.mk-panel { position: absolute; left: 18px; top: 18px; width: 220px; background: rgba(17,22,31,.92); border: 1px solid var(--line2); border-radius: 14px; padding: 16px; backdrop-filter: blur(8px); z-index: 2; }
.mk-title { font-weight: 800; font-size: 15px; margin-bottom: 10px; }
.mk-steps { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 7px; }
.mk-steps li { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 13px; }
.mk-steps i { width: 13px; height: 13px; border-radius: 50%; border: 2px solid #fff; display: inline-block; }
.mk-note { color: var(--muted); font-size: 12px; margin: 0 0 12px; }
.mk-panel .toggle { margin-bottom: 8px; }
.mk-help { display: none; }
