:root {
  --bg: #0b1016;
  --bg2: #111821;
  --panel: #151e29;
  --panel2: #1b2633;
  --line: #263344;
  --line2: #324256;
  --text: #e6edf3;
  --muted: #8b9bb0;
  --dim: #5f7086;
  --accent: #2dd4a7;
  --accent-ink: #052019;
  --accent2: #38bdf8;
  --danger: #f87171;
  --warn: #fbbf24;
  --ok: #4ade80;
  --radius: 10px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); }
#root { height: 100%; }
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
.boot { display: grid; place-items: center; height: 100%; color: var(--muted); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; }
.between { justify-content: space-between; }
.right { margin-left: auto; }
.center { text-align: center; }
.hidden { display: none !important; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.err { color: var(--danger); }
.pad { padding: 16px; }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line2); background: var(--panel2); cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: #223041; border-color: #3e5169; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { background: #4ee3bb; }
.btn.danger { color: var(--danger); border-color: #5b2a2a; background: #2a1618; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--panel2); }
.btn.sm { padding: 4px 8px; font-size: 12px; border-radius: 6px; }
.btn.icon { padding: 6px; width: 32px; height: 32px; justify-content: center; }
.btn.active { border-color: var(--accent); color: var(--accent); }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=search], input:not([type]), select, textarea {
  background: var(--bg2); border: 1px solid var(--line2); border-radius: 8px; padding: 7px 10px; outline: none; min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
label.field > input, label.field > select, label.field > textarea { font-size: 14px; color: var(--text); }
label.check { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-rows: 52px 1fr; height: 100%; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 0 16px; background: var(--bg2); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .2px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { width: 26px; height: 26px; }
.nav { display: flex; gap: 2px; }
.nav a { padding: 6px 12px; border-radius: 8px; color: var(--muted); position: relative; white-space: nowrap; }
.nav a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.nav a.on { color: var(--text); background: var(--panel2); }
.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; margin-left: 4px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11px; background: var(--panel2); border: 1px solid var(--line2); color: var(--muted); white-space: nowrap; }
.pill.ok { color: var(--ok); border-color: #22543d; }
.pill.warn { color: var(--warn); border-color: #5c4813; }
.pill.err { color: var(--danger); border-color: #5b2a2a; }
.pill.accent { color: var(--accent); border-color: #1d5c4c; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #24405a; font-weight: 600; font-size: 12px; flex: none; }
.main { overflow: auto; min-height: 0; }
.page { max-width: 1400px; margin: 0 auto; padding: 22px 24px 60px; }
.page h1 { font-size: 22px; margin: 0; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.empty { padding: 48px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line2); border-radius: var(--radius); }

/* ---------- library ---------- */
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.game-card { overflow: hidden; cursor: pointer; transition: transform .12s, border-color .12s; color: var(--text); display: block; }
.game-card:hover { transform: translateY(-2px); border-color: var(--line2); text-decoration: none; }
.thumb { aspect-ratio: 16/9; background: linear-gradient(135deg, #12202c, #0d151d); position: relative; display: grid; place-items: center; color: var(--dim); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .status { position: absolute; left: 8px; top: 8px; }
.thumb .dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.7); padding: 1px 6px; border-radius: 4px; font-size: 11px; }
.game-card .meta { padding: 10px 12px 12px; }
.game-card .title { font-weight: 600; }
.score { font-weight: 700; font-variant-numeric: tabular-nums; }
.score.w { color: var(--ok); } .score.l { color: var(--danger); } .score.d { color: var(--warn); }
.progress { height: 6px; background: var(--bg2); border-radius: 3px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); transition: width .3s; }

/* ---------- workspace (game / playlist) ---------- */
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 420px; height: 100%; min-height: 0; }
.workspace.wide-side { grid-template-columns: minmax(0, 1fr) 480px; }
.stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--line); }
.stage-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--bg2); flex-wrap: wrap; }
.stage-head h2 { margin: 0; font-size: 16px; }
.stage-body { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: auto; }
.side { display: flex; flex-direction: column; min-height: 0; background: var(--bg2); }
.tabs { display: flex; gap: 2px; padding: 6px 8px 0; border-bottom: 1px solid var(--line); overflow-x: auto; flex: none; }
.tabs button { background: none; border: none; padding: 8px 8px; font-size: 13px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.side-body { flex: 1; overflow: auto; min-height: 0; }
.side-section { padding: 12px; border-bottom: 1px solid var(--line); }
.toolbar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }

/* ---------- player ---------- */
.player { position: relative; background: #000; display: flex; flex-direction: column; user-select: none; }
.player:fullscreen { height: 100vh; }
.viewport { position: relative; overflow: hidden; flex: 1; aspect-ratio: 16/9; max-height: calc(100vh - 400px); min-height: 220px; background: #000; touch-action: none; }
.viewport.wide { aspect-ratio: 32/9; }
.player:fullscreen .viewport { max-height: none; aspect-ratio: auto; }
.player.fill { height: 100%; }
.player.fill .viewport { aspect-ratio: auto; max-height: none; min-height: 0; flex: 1 1 auto; }
.vgrid { position: absolute; inset: 0; display: grid; gap: 2px; background: #05080b; }
.vgrid.l1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.vgrid.l2 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
.vgrid.l4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.tile { position: relative; overflow: hidden; background: #000; min-width: 0; min-height: 0; }
.vgrid.l2 .tile.focus, .vgrid.l4 .tile.focus { box-shadow: inset 0 0 0 2px var(--accent); }
.angle-tag { position: absolute; left: 8px; bottom: 8px; background: rgba(10,16,22,.8); border: 1px solid var(--line2); padding: 2px 8px 2px 3px; border-radius: 6px; font-size: 11px; pointer-events: none; z-index: 2; display: flex; align-items: center; gap: 4px; }
.audio-btn { pointer-events: auto; background: rgba(255,255,255,.06); border: 1px solid var(--line2); border-radius: 5px; padding: 1px 5px; cursor: pointer; font-size: 12px; opacity: .75; }
.audio-btn.on { opacity: 1; border-color: var(--accent); }
.audio-ctrl { display: inline-flex; align-items: center; gap: 2px; }
.audio-ctrl input[type=range] { width: 70px; }
.angle-bar { display: inline-flex; align-items: center; gap: 2px; padding: 0 6px; margin: 0 4px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.zoomer { position: absolute; inset: 0; transform-origin: 0 0; }
.zoomer video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.zoomer canvas { position: absolute; }
.viewport.drawing { cursor: crosshair; }
.viewport.panning { cursor: grab; }
.overlay-msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 20px; }
.hold-chip { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background: rgba(10,16,22,.85); border: 1px solid var(--line2); padding: 4px 10px; border-radius: 999px; font-size: 12px; }
.clip-chip { position: absolute; top: 10px; left: 10px; background: rgba(10,16,22,.85); border: 1px solid var(--line2); padding: 4px 10px; border-radius: 8px; font-size: 12px; max-width: 70%; }
.zoom-chip { position: absolute; bottom: 10px; right: 10px; background: rgba(10,16,22,.85); padding: 2px 8px; border-radius: 6px; font-size: 11px; }
.controls { background: #0d141c; border-top: 1px solid var(--line); padding: 6px 10px 8px; }
.scrub { position: relative; height: 18px; cursor: pointer; }
.scrub .track { position: absolute; left: 0; right: 0; top: 7px; height: 4px; background: #24313f; border-radius: 2px; }
.scrub .fill { position: absolute; left: 0; top: 7px; height: 4px; background: var(--accent); border-radius: 2px; }
.scrub .knob { position: absolute; top: 3px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(45,212,167,.35); }
.scrub .mark { position: absolute; top: 4px; width: 3px; height: 10px; margin-left: -1px; background: var(--warn); border-radius: 1px; }
.ctrl-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ctrl-row .btn { padding: 5px 8px; background: transparent; border-color: transparent; }
.ctrl-row .btn:hover { background: var(--panel2); }
.ctrl-row .btn.active { border-color: var(--accent); }
.ctrl-row select { padding: 3px 6px; font-size: 12px; }
.time { font-family: var(--mono); font-size: 12px; color: var(--muted); padding: 0 6px; }
.draw-bar { display: flex; align-items: center; gap: 4px; padding: 6px 10px; background: #13202b; border-top: 1px solid var(--line); flex-wrap: wrap; }
.swatch { width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.swatch.on { border-color: #fff; }

/* ---------- timeline ---------- */
.timeline { border-top: 1px solid var(--line); background: var(--bg2); position: relative; display: flex; flex-direction: column; min-height: 0; }
.timeline.fill { height: 100%; }
.timeline-head { display: flex; align-items: center; gap: 8px; padding: 4px 10px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); flex: none; }
.timeline canvas { display: block; }
.tl-body { display: grid; grid-template-columns: 190px minmax(0, 1fr); grid-template-rows: 20px minmax(0, 1fr); flex: 1; min-height: 0; }
.tl-corner { background: #0d141c; border-right: 1px solid var(--line); font-size: 10px; color: var(--dim); padding: 4px 8px; text-transform: uppercase; letter-spacing: .5px; }
.tl-ruler { overflow: hidden; background: #0d141c; }
.tl-names { overflow: hidden; border-right: 1px solid var(--line); background: #111821; }
.tl-lanes { overflow: auto; position: relative; background: #111821; }
.tl-playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; box-shadow: 0 0 6px rgba(255,255,255,.6); pointer-events: none; }
.stage-body.split { overflow: hidden; }
.player-wrap { position: relative; min-height: 160px; display: flex; flex-direction: column; }
.player-wrap > .player { flex: 1; min-height: 0; }
.upload-cta { position: absolute; left: 0; right: 0; bottom: 84px; text-align: center; }
.timeline-wrap { min-height: 0; display: flex; flex-direction: column; }
.splitter { flex: none; height: 7px; cursor: row-resize; background: var(--bg2); border-top: 1px solid var(--line); position: relative; }
.splitter::after { content: ''; position: absolute; left: 50%; top: 2px; width: 44px; height: 3px; margin-left: -22px; border-radius: 2px; background: var(--line2); }
.splitter:hover::after, body.resizing .splitter::after { background: var(--accent); }
body.resizing { cursor: row-resize; user-select: none; }
body.resizing iframe, body.resizing video { pointer-events: none; }
.workspace.side-hidden, .workspace.wide-side.side-hidden { grid-template-columns: minmax(0, 1fr) 0; }
.workspace.side-hidden > .side { display: none; }
.workspace.side-hidden > .stage { border-right: none; }
.tag-overlay { position: absolute; top: 10px; right: 10px; max-width: min(40%, 430px); max-height: calc(100% - 20px); overflow: hidden; display: flex; flex-direction: column; gap: 6px; pointer-events: none; z-index: 3; }
.tag-card { background: rgba(8,12,18,.72); border: 1px solid rgba(255,255,255,.12); border-radius: 8px; padding: 6px 9px; font-size: 12px; backdrop-filter: blur(2px); }
.tag-card.primary { border-color: var(--accent); background: rgba(8,20,18,.86); font-size: 13px; }
.tag-code { display: flex; align-items: center; gap: 0; font-weight: 600; }
.tag-labels { margin-top: 3px; }
.tag-line { color: #c9d4e0; line-height: 1.35; }
.tag-line b { color: var(--muted); font-weight: 500; }
.tag-more { font-size: 11px; color: var(--muted); text-align: right; text-shadow: 0 1px 2px #000; }

/* ---------- lists / tables ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.list-item.clickable { cursor: pointer; }
.list-item.clickable:hover { background: var(--panel); }
.list-item.on { background: #16303a; box-shadow: inset 3px 0 var(--accent); }
.events-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.events-table th { position: sticky; top: 0; background: var(--panel); text-align: left; font-weight: 500; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; padding: 6px 8px; border-bottom: 1px solid var(--line); z-index: 1; }
.events-table td { padding: 6px 8px; border-bottom: 1px solid #1c2734; vertical-align: top; }
.events-table tr { cursor: pointer; }
.events-table tr:hover td { background: #152230; }
.events-table tr.on td { background: #16303a; }
.events-table tr.sel td { background: #142a2a; }
.code-dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: 1px; flex: none; }
.lab { display: inline-block; font-size: 11px; padding: 0 5px; margin: 1px 3px 1px 0; border-radius: 4px; background: #1f2c3a; color: #b8c6d6; }
.lab b { color: var(--muted); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; font-size: 12px; background: var(--panel2); border: 1px solid var(--line2); cursor: pointer; }
.chip.on { border-color: var(--accent); background: #12302a; }
.chip .n { color: var(--muted); font-size: 11px; }

/* ---------- code window ---------- */
.codepad { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; padding: 12px; }
.codebtn { position: relative; padding: 12px 8px 10px; border-radius: 8px; border: 1px solid var(--line2); background: var(--panel2); cursor: pointer; text-align: center; font-weight: 600; font-size: 13px; line-height: 1.2; min-height: 56px; border-left-width: 5px; }
.codebtn:hover { filter: brightness(1.2); }
.codebtn .key { position: absolute; top: 3px; right: 6px; font-size: 10px; color: var(--dim); font-family: var(--mono); text-transform: uppercase; }
.codebtn.live { animation: pulse 1s infinite; background: #3a1a1d; }
.codebtn .sub { display: block; font-size: 10px; font-weight: 400; color: var(--muted); margin-top: 3px; }
@keyframes pulse { 50% { box-shadow: 0 0 0 3px rgba(248,113,113,.4); } }

/* ---------- comments ---------- */
.comment { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.comment .who { font-weight: 600; font-size: 13px; }
.comment .body { white-space: pre-wrap; margin-top: 3px; }
.comment .replies { margin: 8px 0 0 18px; border-left: 2px solid var(--line2); padding-left: 10px; }
.ts { font-family: var(--mono); font-size: 11px; padding: 1px 6px; border-radius: 4px; background: #13303a; color: var(--accent2); cursor: pointer; border: none; }
.composer { padding: 10px 12px; border-top: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; gap: 6px; }

/* ---------- playlist ---------- */
.clip-item { display: flex; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); cursor: pointer; align-items: center; }
.clip-item:hover { background: var(--panel); }
.clip-item.on { background: #16303a; box-shadow: inset 3px 0 var(--accent); }
.clip-item .num { width: 22px; text-align: right; color: var(--dim); font-family: var(--mono); font-size: 12px; flex: none; }
.clip-item .grip { cursor: grab; color: var(--dim); padding: 0 2px; }
.clip-item.drag-over { box-shadow: inset 0 2px var(--accent); }
.playlist-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.playlist-card { padding: 14px; cursor: pointer; display: block; color: var(--text); }
.playlist-card:hover { border-color: var(--line2); text-decoration: none; }

/* ---------- modal & toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(3,6,10,.7); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { background: var(--panel); border: 1px solid var(--line2); border-radius: 14px; width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.modal.wide { width: min(900px, 100%); }
.modal-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 16px 18px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--panel2); border: 1px solid var(--line2); border-left: 4px solid var(--accent); padding: 10px 14px; border-radius: 8px; max-width: 380px; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.toast.error { border-left-color: var(--danger); }
.upload-tray { position: fixed; left: 16px; bottom: 16px; width: 320px; z-index: 55; }
.upload-tray .card { padding: 10px 12px; margin-top: 8px; }
.menu { position: relative; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 4px); background: var(--panel2); border: 1px solid var(--line2); border-radius: 10px; min-width: 220px; padding: 4px; z-index: 30; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.menu-pop button { display: flex; width: 100%; text-align: left; gap: 8px; background: none; border: none; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.menu-pop button:hover { background: #2a3a4d; }
.menu-pop hr { border: none; border-top: 1px solid var(--line2); margin: 4px 0; }
.kbd { font-family: var(--mono); font-size: 11px; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line2); background: var(--bg2); }
table.plain { width: 100%; border-collapse: collapse; }
table.plain th, table.plain td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); font-size: 13px; }
table.plain th { color: var(--muted); font-weight: 500; font-size: 12px; }
table.plain input, table.plain select { padding: 4px 6px; font-size: 13px; width: 100%; }
.notice { padding: 10px 12px; border-radius: 8px; background: #172433; border: 1px solid var(--line2); font-size: 13px; }
.notice.warn { background: #2a2312; border-color: #5c4813; }
.notice.err { background: #2a1618; border-color: #5b2a2a; }

@media (max-width: 1000px) {
  .workspace, .workspace.wide-side { grid-template-columns: minmax(0, 1fr); height: auto; }
  .main { overflow: auto !important; }
  .viewport { flex: none; width: 100%; }
  .stage-body { overflow: visible; }
  .stage { border-right: none; }
  .side { min-height: 60vh; }
  .viewport { max-height: none; }
  .nav a { padding: 6px 8px; }
}

@media (max-width: 700px) {
  .topbar { gap: 8px; padding: 0 8px; overflow-x: auto; }
  .brand span, .brand { font-size: 0; gap: 0; }
  .brand img { width: 24px; height: 24px; }
  .topbar select { max-width: 120px; min-width: 80px; }
  .hold-chip { top: auto; bottom: 10px; font-size: 11px; }
  .topbar .small { display: none; }
  .nav a { padding: 6px 6px; font-size: 13px; }
  .page { padding: 16px 12px 40px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .stage-head { padding: 8px 10px; }
  .stage-head h2 { font-size: 15px; }
  .ctrl-row .btn { padding: 5px 6px; }
  .time { font-size: 11px; }
}

.marker-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.marker-cell { display: flex; flex-direction: column; gap: 6px; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.marker-cell video { width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 4px; cursor: pointer; }
.marker-backdrop { position: fixed; inset: 0; background: rgba(3,6,10,.82); z-index: 60; }
.marker-cell.marker-big { position: fixed; z-index: 61; inset: 3vh 3vw; padding: 12px; gap: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.marker-cell.marker-big video { flex: 1; min-height: 0; aspect-ratio: auto; object-fit: contain; }
.marker-cell.marker-big:fullscreen { inset: 0; border-radius: 0; border: 0; }
@media (max-width: 700px) { .marker-grid { grid-template-columns: 1fr; } }

/* ---------- matrix ---------- */
.matrix-page { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.matrix-top { display: grid; grid-template-columns: minmax(0, 1fr) 380px; border-bottom: 1px solid var(--line); flex: none; }
.matrix-top { --vh: 26vh; }
.matrix-top.vs-large { --vh: 46vh; }
.matrix-player .viewport { max-height: var(--vh); min-height: 160px; }
.matrix-empty { height: calc(var(--vh) + 64px); display: grid; place-items: center; padding: 24px; background: #000; text-align: center; color: var(--text); }
.matrix-empty > div { max-width: 520px; }
.matrix-queue { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); background: var(--bg2); max-height: calc(var(--vh) + 64px); }
.matrix-queue-list { overflow: auto; flex: 1; min-height: 0; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; }
.seg button { background: transparent; border: none; padding: 5px 12px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.matrix-wrap { flex: 1; min-height: 160px; overflow: auto; background: #f4f5f7; color: #111; }
.matrix { border-collapse: separate; border-spacing: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.matrix th, .matrix td { border-right: 1px solid #e3e5e8; border-bottom: 1px solid #e3e5e8; }
.matrix thead th { position: sticky; background: #eef0f2; z-index: 2; font-weight: 400; color: #222; }
.matrix .mx-groups th { top: 0; height: 84px; vertical-align: bottom; padding: 6px 0; }
.matrix .mx-vals th { top: 84px; height: 150px; vertical-align: bottom; padding: 6px 0; min-width: 30px; max-width: 30px; cursor: pointer; }
.matrix .mx-gh { border-bottom: 1px solid #d5d8dc; }
.matrix .mx-corner { left: 0; z-index: 4 !important; min-width: 220px; text-align: left; vertical-align: top !important; padding: 10px !important; }
.matrix .mx-corner select { font-size: 12px; padding: 3px 6px; background: #fff; color: #111; border-color: #cfd3d8; }
.matrix .mx-corner .dim { color: #777; }
.matrix .mx-total-h { min-width: 40px; }
.vert { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; display: inline-block; max-height: 140px; overflow: hidden; text-overflow: ellipsis; }
.matrix .mx-gh .vert { max-height: 74px; color: #333; }
.matrix tbody th.mx-rh, .matrix tfoot th.mx-rh { position: sticky; left: 0; background: #fbfbfc; text-align: left; font-weight: 400; padding: 4px 10px 4px 8px; white-space: nowrap; z-index: 1; cursor: pointer; min-width: 220px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.matrix tbody tr:hover th.mx-rh, .matrix tbody tr:hover td { background-color: #eaf6f2; }
.matrix td { text-align: center; padding: 4px 0; min-width: 30px; height: 26px; background: #fff; }
.matrix td.n { cursor: pointer; }
.matrix td.n:hover { background: #2dd4a7 !important; color: #052019; font-weight: 600; }
.matrix td.hover, .matrix th.hover { background-color: #eaf6f2; }
.matrix td.sel, .matrix th.sel { background: #0f766e !important; color: #fff !important; font-weight: 600; }
.matrix td.mx-total { font-weight: 600; background: #f6f7f8; cursor: pointer; }
.matrix .gstart { border-left: 2px solid #c9cdd2; }
.matrix tfoot td, .matrix tfoot th { position: sticky; bottom: 0; background: #eef0f2; z-index: 1; height: 52px; vertical-align: top; cursor: pointer; font-size: 12px; padding-top: 6px; }
.matrix tfoot th.mx-rh { z-index: 3; font-weight: 600; }
.mx-short .matrix .mx-groups th { height: 24px; padding: 2px 4px; }
.mx-short .matrix .mx-gh .vert { writing-mode: horizontal-tb; transform: none; max-height: none; max-width: 100%; font-size: 11px; vertical-align: bottom; }
.mx-short .matrix .mx-vals th { top: 24px; height: 96px; padding: 4px 0; }
.mx-short .matrix .mx-vals .vert, .mx-short .matrix .mx-total-h .vert { max-height: 88px; font-size: 11px; }
.mx-short .matrix .mx-corner { padding: 4px 8px !important; }
.mx-short .matrix .mx-corner .tiny { display: none; }
.mx-short .matrix tfoot td, .mx-short .matrix tfoot th { height: 36px; padding-top: 3px; font-size: 11px; }
@media (max-width: 1000px) { .matrix-top { grid-template-columns: 1fr; } .matrix-queue { max-height: 260px; border-left: none; } }
@media (max-width: 1000px) {
  .stage-body.split { overflow: visible; }
  .timeline-wrap { min-height: 280px; }
  .splitter { display: none; }
}
.tag-card.compact { display: flex; align-items: center; gap: 0; padding: 4px 8px; white-space: nowrap; overflow: hidden; }
.tag-card.compact b { font-weight: 600; flex: none; }
.tag-inline { color: #aebccb; margin-left: 8px; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

.version-banner { display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: #3a2d0c; border-bottom: 1px solid #6b5216; color: #fde68a; font-size: 13px; }
.version-banner .btn { margin-left: auto; }
.shell.with-banner { grid-template-rows: 52px auto 1fr; }

.btn.pulse { animation: btnpulse 1.2s infinite; }
@keyframes btnpulse { 50% { box-shadow: 0 0 0 4px rgba(45,212,167,.35); } }
.warn { color: var(--warn); }

.steps { display: flex; gap: 6px; flex-wrap: wrap; }
.step { font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line2); color: var(--muted); }
.step.on { border-color: var(--accent); color: var(--accent); }
.step.done { color: var(--ok); border-color: #22543d; }

/* ---------- export settings (quality, frame, watermark, ownership, audio, presets) ---------- */
.modal.xwide { width: min(1180px, 100%); }
.accent { color: var(--accent); }
.enc { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, 1fr); gap: 14px; align-items: start; }
.enc-left { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 0; }
.enc-right { display: flex; flex-direction: column; gap: 10px; }
.enc-card { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; }
.enc-card-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.enc-card-body { display: flex; flex-direction: column; gap: 9px; padding: 2px 12px 12px; }
.enc-title { font-weight: 600; }
.enc-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 15px; background: var(--panel2); flex: none; color: #fff; }
.enc-icon.blue { background: linear-gradient(135deg, #38bdf8, #2563eb); }
.enc-icon.teal { background: linear-gradient(135deg, #2dd4bf, #0e7490); }
.enc-icon.orange { background: linear-gradient(135deg, #fb923c, #ea580c); }
.enc-icon.purple { background: linear-gradient(135deg, #c084fc, #7e22ce); }
.enc-icon.pink { background: linear-gradient(135deg, #f472b6, #9d174d); }
.enc-row { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 4px 8px; }
.enc-label { font-size: 13px; color: var(--text); }
.enc-ctl { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; }
.enc-ctl select, .enc-ctl input:not([type]) { max-width: 230px; }
.enc-ctl input:not([type]) { flex: 1; }
.enc-hint { grid-column: 1 / -1; text-align: right; margin-top: -2px; }
.enc-slider { display: flex; flex-direction: column; gap: 4px; }
.enc-slider input[type=range], .enc-preview input[type=range] { width: 100%; accent-color: var(--accent); }
.enc-wm-thumb { height: 26px; max-width: 70px; object-fit: contain; background: repeating-conic-gradient(#333 0 25%, #555 0 50%) 0 0 / 10px 10px; border-radius: 4px; }
.enc-presets { display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; }
.enc-presets .grow { min-width: 0; }
.enc-preview { display: flex; flex-direction: column; gap: 6px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.enc-canvas { display: grid; place-items: center; background: #000; border-radius: 8px; position: relative; overflow: hidden; }
.enc-canvas canvas { display: block; cursor: pointer; }
.crop-box { position: absolute; border: 2px solid var(--accent); box-shadow: 0 0 0 1px rgba(0,0,0,.5); cursor: move; touch-action: none; }
.crop-box::before, .crop-box::after { content: ''; position: absolute; border: 1px dashed rgba(255,255,255,.35); }
.crop-box::before { left: 33.3%; right: 33.3%; top: 0; bottom: 0; border-top: 0; border-bottom: 0; }
.crop-box::after { top: 33.3%; bottom: 33.3%; left: 0; right: 0; border-left: 0; border-right: 0; }
.crop-h { position: absolute; width: 14px; height: 14px; background: var(--accent); border-radius: 3px; z-index: 1; touch-action: none; }
.crop-h.tl { left: -8px; top: -8px; cursor: nwse-resize; }
.crop-h.br { right: -8px; bottom: -8px; cursor: nwse-resize; }
.crop-h.tr { right: -8px; top: -8px; cursor: nesw-resize; }
.crop-h.bl { left: -8px; bottom: -8px; cursor: nesw-resize; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--line2); border-radius: 999px; transition: background .15s; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent2); outline-offset: 2px; }
@media (max-width: 900px) { .enc { grid-template-columns: 1fr; } .enc-left { position: static; } }

/* ---------- timelines: picker, editing ---------- */
.tl-name { display: flex; align-items: center; gap: 6px; padding: 0 6px 0 6px; font-size: 11px; color: #b8c6d6; white-space: nowrap; cursor: default; user-select: none; }
.tl-name:nth-child(even) { background: rgba(255,255,255,0.025); }
.tl-name.active { background: rgba(45,212,167,0.12); color: var(--text); }
.tl-name.sel { background: rgba(56,189,248,0.18); color: #fff; }
.editing .tl-name { cursor: pointer; }
.tl-name.playable { cursor: pointer; }
.tl-name.playable:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.tl-name.playing { background: rgba(45,212,167,0.22); color: #fff; box-shadow: inset 2px 0 0 var(--accent); }
.tl-play { display: none; border: 0; background: var(--panel2); color: var(--accent); font-size: 8px; line-height: 14px; height: 14px; padding: 0 4px; border-radius: 7px; cursor: pointer; }
.tl-name:hover .tl-play, .tl-name.playing .tl-play { display: inline-block; }
.tl-dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.tl-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tl-n { font-size: 10px; color: var(--dim); background: var(--panel2); border-radius: 8px; padding: 0 5px; line-height: 14px; }
.tl-name input { flex: 1; min-width: 0; padding: 0 4px; height: 15px; font-size: 11px; border-radius: 3px; }
.tl-count { white-space: nowrap; }
.timeline-edit { display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-bottom: 1px solid var(--line); background: #0f1a24; flex-wrap: wrap; font-size: 12px; flex: none; }
.timeline-edit .sep { width: 1px; height: 18px; background: var(--line2); }
.timeline.editing .tl-lanes { box-shadow: inset 0 0 0 1px rgba(56,189,248,.35); }
.tl-drag-tip { position: absolute; z-index: 3; pointer-events: none; background: #0b1016ee; border: 1px solid var(--line2); color: var(--text); font: 11px ui-monospace, Menlo, monospace; padding: 2px 6px; border-radius: 5px; white-space: nowrap; }
.tl-picker { padding: 3px 8px; font-size: 12px; max-width: 220px; }
.tl-table td { vertical-align: middle; }
.tl-table input[type=text] { width: 100%; }
.danger-text { color: var(--danger) !important; }

/* ---------- export folder picker ---------- */
.out-folder { display: flex; flex-direction: column; gap: 4px; }
.folder-browser { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; }
.folder-places { display: flex; flex-direction: column; gap: 2px; align-items: stretch; }
.folder-places .btn { justify-content: flex-start; }
.folder-list { height: 300px; overflow: auto; padding: 4px; }
.folder-item { padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.folder-item:hover { background: var(--panel2); }

/* ---------- help / documentation ---------- */
.help { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100%; }
.help-nav { border-right: 1px solid var(--line); background: var(--bg2); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; align-self: start; height: calc(100vh - 56px); overflow: auto; }
.help-brand { font-weight: 700; font-size: 16px; padding: 0 8px 6px; }
.help-group { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: var(--dim); padding: 12px 8px 4px; }
.help-nav a { display: block; padding: 5px 8px; border-radius: 6px; color: var(--muted); font-size: 13px; }
.help-nav a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.help-nav a.on { background: var(--panel2); color: var(--text); }
.help-main { padding: 24px 32px 60px; max-width: 920px; }
.help-body { line-height: 1.6; font-size: 14.5px; }
.help-body h1 { font-size: 26px; margin: 0 0 14px; }
.help-body h2 { font-size: 19px; margin: 28px 0 8px; padding-top: 6px; border-top: 1px solid var(--line); }
.help-body h3 { font-size: 15px; margin: 20px 0 6px; }
.help-body p, .help-body ul, .help-body ol { margin: 8px 0; }
.help-body li { margin: 3px 0; }
.help-body code { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; background: var(--panel2); padding: 1px 5px; border-radius: 4px; }
.help-body pre { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow: auto; }
.help-body pre code { background: none; padding: 0; font-size: 12px; line-height: 1.5; }
.help-body table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 13.5px; }
.help-body th, .help-body td { border: 1px solid var(--line); padding: 6px 9px; text-align: left; vertical-align: top; }
.help-body th { background: var(--bg2); color: var(--muted); font-weight: 600; }
.help-body blockquote { border-left: 3px solid var(--accent); margin: 10px 0; padding: 2px 12px; color: var(--muted); }
.help-pager { display: flex; justify-content: space-between; margin-top: 36px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; }
.about-copy { background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; padding: 14px 16px; margin-bottom: 22px; }
.about-title { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--dim); }
.about-version { font-size: 22px; margin: 2px 0 8px; }
.about-version b { color: var(--accent); }
.about-copy td:first-child { color: var(--muted); width: 160px; }
@media (max-width: 800px) { .help { grid-template-columns: 1fr; } .help-nav { position: static; max-height: none; } .help-main { padding: 16px; } }

/* ---------- reports ---------- */
.report-page { display: flex; flex-direction: column; min-height: 100%; }
.report-toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--bg2); flex-wrap: wrap; position: sticky; top: 0; z-index: 5; }
.report-toolbar h2 { margin: 0; font-size: 17px; }
.report-title { font-size: 16px; font-weight: 700; background: transparent; border-color: transparent; min-width: 280px; max-width: 520px; flex: 1; }
.report-title:hover, .report-title:focus { border-color: var(--line2); background: var(--bg); }
.report-options { display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.report-options label { display: inline-flex; align-items: center; gap: 6px; }
.report-options select { padding: 4px 8px; font-size: 12px; }
.report-options input[type=color] { width: 34px; height: 24px; padding: 0; border: 1px solid var(--line2); border-radius: 5px; background: none; }
.report-scroll { padding: 18px; overflow: auto; }
.report-paper { max-width: 1280px; margin: 0 auto; background: #fff; border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.45); overflow: hidden; }
.report-svg { display: block; width: 100%; height: auto; }
.report-svg .rv-clk { cursor: pointer; }
.report-svg .rv-clk:hover .rv-hit { fill: rgba(56,189,248,.18); }
.report-svg .rv-clk:hover > text { text-decoration: underline; }
.report-svg .rv-band:hover { fill: rgba(56,189,248,.08); }
.report-svg .rv-clk:hover .rv-row { fill: #EFF6FF; }
.report-kind { font-size: 22px; width: 32px; text-align: center; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 6px 0 8px; }
.clips-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 12px; min-height: 420px; }
.clips-player { min-width: 0; display: flex; flex-direction: column; }
.clips-player .player { aspect-ratio: 16 / 9; }
.clips-list { overflow: auto; max-height: 560px; border: 1px solid var(--line); border-radius: 8px; }
.clips-item { display: flex; gap: 8px; align-items: center; padding: 6px 10px; font-size: 12.5px; cursor: pointer; border-bottom: 1px solid var(--line); }
.clips-item:hover { background: var(--panel2); }
.clips-item.on { background: #12302a; }
.teams-table td { vertical-align: middle; }
.teams-table input:not([type=color]) { width: 100%; }
.team-logo { border: 0; padding: 0; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 6px; background: #fff; cursor: pointer; overflow: hidden; }
.team-logo img { max-width: 40px; max-height: 40px; object-fit: contain; }
.tpl-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; }
.tpl-item { display: block; width: 100%; text-align: left; justify-content: flex-start; }
.tpl-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px; border: 1px dashed var(--line2); border-radius: 8px; margin-bottom: 6px; }
.tpl-row select { padding: 3px 6px; font-size: 12px; }
.link-btn { background: none; border: none; color: inherit; cursor: pointer; padding: 0 2px; font-size: 12px; opacity: .7; }
.link-btn:hover { opacity: 1; }
.link-btn:disabled { opacity: .25; cursor: default; }
.defs-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.weights { display: flex; flex-wrap: wrap; gap: 6px; }
.weight { display: inline-flex; align-items: center; gap: 4px; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 3px 6px; }
.weight input[type=number] { width: 64px; padding: 3px 6px; }
.report-details summary { cursor: pointer; color: var(--muted); }
@media (max-width: 900px) { .clips-grid, .tpl-grid { grid-template-columns: 1fr; } .defs-grid { grid-template-columns: 1fr; } }
@media print {
  @page { size: A4 portrait; margin: 8mm; }
  body, html, .main { background: #fff !important; overflow: visible !important; height: auto !important; }
  .topbar, .no-print, .version-banner, .upload-tray, .toasts { display: none !important; }
  .report-scroll { padding: 0; overflow: visible; }
  .report-paper { box-shadow: none; border-radius: 0; max-width: none; }
  .shell { display: block !important; height: auto !important; }
}

/* ---------- matrix: same layout as the match view ---------- */
.workspace.matrix-ws { grid-template-columns: minmax(0, 1fr) 380px; }
.workspace.matrix-ws.side-hidden { grid-template-columns: minmax(0, 1fr) 0; }
.matrix-ws .side .matrix-queue { max-height: none; border-left: none; height: 100%; display: flex; flex-direction: column; }
.matrix-ws .matrix-empty { height: 100%; min-height: 160px; }
.matrix-pane { min-height: 0; display: flex; flex-direction: column; }
.matrix-pane .matrix-wrap { flex: 1; min-height: 0; }
@media (max-width: 1000px) { .workspace.matrix-ws { grid-template-columns: minmax(0, 1fr); } .matrix-pane { min-height: 320px; } }

/* player view: on-pitch summary bar */
.mine-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 7px 14px; background: linear-gradient(90deg, rgba(45,212,167,0.16), rgba(45,212,167,0.04)); border-bottom: 1px solid rgba(45,212,167,0.35); }
.mine-bar .mine-who { font-size: 13px; }
table.mymatches tr.clickable { cursor: pointer; }
table.mymatches tr.clickable:hover td { background: rgba(255,255,255,0.03); }

/* previous / next event while a list of events is playing */
.queue-nav { display: inline-flex; align-items: center; gap: 2px; padding: 0 6px; margin: 0 2px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.queue-nav .queue-pos { font-family: var(--mono, ui-monospace, monospace); font-size: 12px; color: var(--accent); min-width: 44px; text-align: center; }
/* team logos: upload window and batch standardising */
.checker { background-color: #fff; background-image: linear-gradient(45deg, #dfe3e8 25%, transparent 25%), linear-gradient(-45deg, #dfe3e8 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #dfe3e8 75%), linear-gradient(-45deg, transparent 75%, #dfe3e8 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; border-radius: 8px; display: grid; place-items: center; outline: 1px dashed #94a3b8; overflow: hidden; }
.logo-cols { display: grid; grid-template-columns: 1fr 1fr 1.35fr; gap: 14px; }
.logo-box { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; min-width: 0; }
.logo-box h4 { margin: 0 0 8px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.logo-big { width: 100%; aspect-ratio: 1; }
.logo-big img { width: 100%; height: 100%; object-fit: contain; }
.logo-big.orig img { width: auto; height: auto; max-width: 100%; max-height: 100%; }
.logo-meta { color: var(--muted); font-size: 12px; margin-top: 8px; line-height: 1.5; }
.logo-hdr { height: 150px; border-radius: 8px; position: relative; overflow: hidden; background: #fff; }
.logo-glow { position: absolute; right: 0; top: 0; width: 150px; height: 150px; }
.logo-hdr img { position: absolute; right: 15px; top: 15px; width: 120px; height: 120px; object-fit: contain; }
.logo-hdr-name { position: absolute; right: 155px; top: 30px; font-weight: 800; font-size: 30px; white-space: nowrap; max-width: calc(100% - 290px); overflow: hidden; text-overflow: ellipsis; }
.logo-hdr-score { position: absolute; left: 18px; top: 38px; font-weight: 900; font-size: 42px; color: #1e293b; }
.logo-sizes { display: flex; gap: 14px; align-items: flex-end; margin-top: 12px; }
.logo-sizes > div { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--dim); font-size: 11px; }
.logo-sizes img.dark { background: var(--panel); }
.logo-sizes img.light { background: #fff; border-radius: 4px; }
.logo-sizes .team-logo { cursor: default; }
.logo-ctl { display: grid; grid-template-columns: auto 1fr auto; gap: 10px 14px; align-items: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.logo-ctl input[type=range] { width: 100%; accent-color: var(--accent); }
.logo-ctl .num { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.logo-card { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 9px; min-width: 0; }
.logo-card.saved { opacity: .55; }
.logo-card-hd { display: flex; gap: 6px; align-items: center; font-size: 12px; white-space: nowrap; overflow: hidden; margin-bottom: 6px; cursor: pointer; }
.logo-card-hd .dim { overflow: hidden; text-overflow: ellipsis; }
.logo-pair { display: flex; align-items: center; gap: 6px; justify-content: center; }
.logo-pair .checker { width: 68px; height: 68px; }
.logo-pair img { max-width: 60px; max-height: 60px; }
.logo-card-row { display: flex; justify-content: space-between; align-items: center; margin-top: 7px; gap: 4px; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); font-size: 11.5px; cursor: pointer; }
.linkish:hover { text-decoration: underline; }
.pill-btn { padding: 3px 10px; border-radius: 999px; font-size: 11.5px; background: var(--panel2); border: 1px solid var(--line2); color: var(--muted); cursor: pointer; }
.pill-btn.on { border-color: var(--accent); color: var(--accent); }
@media (max-width: 800px) { .logo-cols { grid-template-columns: 1fr; } }
/* game packages (Mac version) */
.pkg-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; backdrop-filter: blur(4px); }
.pkg-badge.local { background: #fbbf2426; color: var(--warn); border: 1px solid #5c4813; }
.pkg-badge.pub { background: #4ade8022; color: var(--ok); border: 1px solid #22543d; }
.pkg-badge.chg { background: #38bdf822; color: var(--accent2); border: 1px solid #1e4f6b; }
.pkg-badge.onl { background: #c084fc22; color: #c084fc; border: 1px solid #5b3b7a; }
.pkg-badge.cloud { background: #8b9bb022; color: #cbd5e1; border: 1px solid var(--line2); }
.pkg-badge.miss { background: #f8717122; color: var(--danger); border: 1px solid #5b2a2a; }
.thumb .pkg { position: absolute; left: 8px; top: 8px; }
.thumb .pkg + .status { top: 34px; }
.pkg-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 8px; }
.pkg-foot .linkish { font-weight: 600; white-space: nowrap; }
.pkg-foot .linkish.muted { color: var(--muted); }
.online-card .thumb { opacity: .6; }
.online-card .thumb:hover { opacity: .8; text-decoration: none; }
.pkg-sec { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.pkg-sec h4 { margin: 0 0 8px; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.pkg-sec td { padding: 4px 4px; }
td.r, .r { text-align: right; }
.blue { color: var(--accent2); } .purple { color: #c084fc; }
.pkg-filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: -6px 0 14px; }
.ok { color: var(--ok); }
