/* Bucket. Apple materials over a live camera, after Sandtable: system font, system colours, frosted glass
   with a soft top highlight, sentence case. Blue is the one control colour. Green to red is load, nothing else.
   Left leg is white, right leg is blue, everywhere. */
:root {
  --label: #F5F5F7;
  --label-2: rgba(235, 235, 245, 0.62);
  --label-3: rgba(235, 235, 245, 0.36);
  --label-4: rgba(235, 235, 245, 0.18);
  --sep: rgba(84, 84, 88, 0.6);
  --hair: rgba(255, 255, 255, 0.09);
  --fill: rgba(118, 118, 128, 0.24);
  --fill-2: rgba(118, 118, 128, 0.36);
  --fill-3: rgba(118, 118, 128, 0.12);
  --material: rgba(30, 30, 32, 0.52);
  --material-thick: rgba(28, 28, 30, 0.76);
  --blue: #0A84FF;
  --blue-2: #3395FF;
  --link: #409CFF;
  --green: #30D158;
  --yellow: #FFD60A;
  --orange: #FF9F0A;
  --red: #FF453A;
  --gray: #8E8E93;
  --leg-L: #F5F5F7;
  --leg-R: #0A84FF;
  --shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.5), 0 20px 50px rgba(0, 0, 0, 0.42);
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --r: 22px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Inter", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  --top: 16px;
  --side: 16px;
  --panel-top: 92px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; color: var(--label); font: 400 14px/1.4 var(--font); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; letter-spacing: -0.006em; overflow: hidden; }
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 10px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; }
p { margin: 0; }

/* ---------- materials ---------- */
.glass {
  background: var(--material);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid var(--hair);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.11);
  border-radius: var(--r);
}
.glass.thick {
  background: var(--material-thick);
  -webkit-backdrop-filter: blur(40px) saturate(180%) brightness(0.72);
  backdrop-filter: blur(40px) saturate(180%) brightness(0.72);
}
.glass-fill { background: var(--fill); -webkit-backdrop-filter: blur(30px) saturate(160%); backdrop-filter: blur(30px) saturate(160%); }

/* ---------- top bar ---------- */
.top { position: fixed; top: var(--top); left: var(--side); right: var(--side); display: flex; gap: 12px; align-items: center; z-index: 20; pointer-events: none; }
.top > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 16px; border-radius: 18px; min-width: 196px; }
.brand b { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.brand small { display: block; color: var(--label-2); font-size: 12px; white-space: nowrap; transition: color 0.3s; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gray); flex: none; transition: background-color 0.4s var(--ease), box-shadow 0.4s var(--ease); }
.dot.live { background: var(--green); box-shadow: 0 0 0 3px rgba(48, 209, 88, 0.22); animation: breathe 2.4s ease-in-out infinite; }
.dot.busy { background: var(--orange); box-shadow: 0 0 0 3px rgba(255, 159, 10, 0.22); }
@keyframes breathe { 50% { box-shadow: 0 0 0 5px rgba(48, 209, 88, 0.1); } }

.seg { position: relative; display: flex; padding: 3px; gap: 0; border-radius: 13px; }
.seg button { position: relative; z-index: 1; border: 0; background: none; padding: 7px 20px; border-radius: 10px; cursor: pointer; font-weight: 500; font-size: 13px; color: var(--label-2); transition: color 0.3s var(--ease); }
.seg button[aria-selected="true"] { color: var(--label); font-weight: 600; }
.seg button:hover { color: var(--label); }
.seg__thumb { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 10px; background: #636366; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.16), 0 3px 1px rgba(0, 0, 0, 0.05), inset 0 0.5px 0 rgba(255, 255, 255, 0.16); transition: transform 0.5s var(--ease), width 0.5s var(--ease); }

.stats { margin-left: auto; display: flex; align-items: center; gap: 24px; padding: 9px 20px; border-radius: 18px; transition: opacity 0.35s var(--ease), transform 0.45s var(--ease); }
.stats div { display: flex; flex-direction: column; line-height: 1.12; min-width: 44px; }
.stats b { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.stats span { font-size: 11px; color: var(--label-2); white-space: nowrap; }
body:not([data-view="live"]) .stats { opacity: 0; transform: translateY(-6px); pointer-events: none; }
.round-btn { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--label-2); padding: 0; transition: color 0.2s, transform 0.2s var(--ease); }
body:not([data-view="live"]) .round-btn { margin-left: auto; }
.round-btn:hover { color: var(--label); }
.round-btn:active { transform: scale(0.94); }
.round-btn svg { width: 20px; height: 20px; }

/* ---------- views ---------- */
.view { position: fixed; inset: 0; opacity: 1; transform: none; transition: opacity 0.42s var(--ease), transform 0.55s var(--ease); }
.view.leaving { opacity: 0; transform: scale(0.985); pointer-events: none; }
.view.entering { opacity: 0; transform: scale(1.012); }
.panel { position: fixed; top: var(--panel-top); z-index: 5; padding: 12px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent; animation: rise 0.6s var(--ease) both; }
.panel::-webkit-scrollbar { width: 6px; }
.panel::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 3px; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 4px 8px 10px; }
.head h2 { font-size: 17px; letter-spacing: -0.015em; }
.head > span { color: var(--label-2); font-size: 12px; text-align: right; }

/* ---------- controls ---------- */
.btn { border: 0; background: var(--fill); border-radius: 10px; padding: 9px 14px; cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background-color 0.2s var(--ease), transform 0.18s var(--ease), opacity 0.2s; white-space: nowrap; }
.btn:hover { background: var(--fill-2); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: default; transform: none; }
.btn.primary { background: var(--blue); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--blue-2); }
.big-btn { padding: 13px 18px; border-radius: 13px; font-size: 15px; }
.row2 { display: flex; gap: 8px; align-items: center; }
.row2 > .btn { flex: 1; }
.x { border: 0; background: var(--fill); color: var(--label-2); cursor: pointer; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; line-height: 1; padding: 0; flex: none; transition: background-color 0.2s; }
.x:hover { color: var(--label); background: var(--fill-2); }
.tabs { display: flex; gap: 2px; padding: 2px; border-radius: 10px; background: var(--fill); }
.tabs button { flex: 1; border: 0; background: none; border-radius: 8px; padding: 6px 8px; cursor: pointer; font-weight: 500; font-size: 13px; color: var(--label-2); transition: background-color 0.3s var(--ease), color 0.3s; }
.tabs button:hover { color: var(--label); }
.tabs button[aria-selected="true"], .tabs button.on { background: #636366; color: var(--label); font-weight: 600; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.14); }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; color: var(--label-2); font-size: 13px; user-select: none; white-space: nowrap; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch > span, .switch span:not([class]) { position: relative; width: 38px; height: 23px; border-radius: 12px; background: var(--fill-2); transition: background-color 0.3s var(--ease); flex: none; }
.switch > span::after, .switch span:not([class])::after { content: ""; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.16); transition: transform 0.4s var(--ease); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(15px); }
.switch input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.switch.small { font-size: 12px; margin: 12px 8px 4px; }

.chip { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 6px; font-size: 11px; font-weight: 700; flex: none; }
.chip--L { background: var(--leg-L); color: #1c1c1e; }
.chip--R { background: var(--leg-R); color: #fff; }
.lg { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin: 0 5px 2px 0; vertical-align: middle; }
.lg--L { background: var(--leg-L); }
.lg--R { background: var(--leg-R); }
.lg--cam { background: var(--leg-L); }
.lg--plate { background: var(--orange); }
.note { color: var(--label-3); font-size: 12px; }

/* ---------- Live ---------- */
.stage { position: fixed; inset: 0; background: radial-gradient(120% 90% at 50% 40%, #1a1a1c 0%, #000 70%); overflow: hidden; }
/* the whole frame always shows (feet included), above the force trace; the side panels float over the margins */
.stage { bottom: calc(var(--side) + 150px + 8px); }
.stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: brightness(0.82) saturate(0.92); opacity: 0; transition: opacity 0.8s var(--ease); }
.stage.on video { opacity: 1; }
/* the frame's edges fade into the stage instead of ending on a hard line */
.stage video {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 5%, #000 95%, transparent 100%), linear-gradient(to bottom, #000 0, #000 88%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0, #000 5%, #000 95%, transparent 100%), linear-gradient(to bottom, #000 0, #000 88%, transparent 100%);
  mask-composite: intersect;
}
@media (max-width: 900px) { .stage video { -webkit-mask-image: none; mask-image: none; } }
.stage.mirror video { transform: scaleX(-1); }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.legs { left: var(--side); width: 316px; max-height: calc(100vh - var(--panel-top) - 172px); }
.name-input { width: 128px; border: 0; background: transparent; text-align: right; color: var(--label-2); font-size: 12px; padding: 2px 4px; border-radius: 6px; transition: background-color 0.2s; }
.name-input:hover, .name-input:focus { background: var(--fill-3); color: var(--label); outline: none; }
.legcols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.legcol { background: rgba(255, 255, 255, 0.04); border-radius: 16px; padding: 12px 12px 12px; }
.legcol__tag { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--label-2); }
.big { display: flex; align-items: baseline; gap: 1px; margin-top: 10px; }
.big b { font-size: 40px; font-weight: 600; letter-spacing: -0.035em; line-height: 1; transition: color 0.5s var(--ease); }
.big i { font-style: normal; font-size: 20px; font-weight: 500; color: var(--label-2); }
.big__lbl { font-size: 11px; color: var(--label-2); margin-top: 4px; }
.mini { margin: 12px 0 0; display: grid; gap: 6px; }
.mini div { display: flex; justify-content: space-between; font-size: 13px; }
.mini dt { color: var(--label-2); }
.mini dd { margin: 0; font-weight: 600; }
.meter { height: 5px; border-radius: 3px; background: var(--fill); margin-top: 12px; overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--leg-L); transition: width 0.8s var(--ease); }
.legcol[data-side="R"] .meter span { background: var(--leg-R); }
.meter__lbl { font-size: 11px; color: var(--label-2); margin-top: 6px; }
.vsnormal { font-size: 11px; margin-top: 8px; color: var(--label-2); min-height: 0; }
.vsnormal b { font-weight: 600; }
.vsnormal .dn { color: var(--orange); }
.vsnormal .up { color: var(--label); }
.legs .foot { color: var(--label-3); font-size: 11.5px; padding: 12px 6px 12px; }

.roundp { right: var(--side); width: 348px; max-height: calc(100vh - var(--panel-top) - 172px); }
.roundp__hint { color: var(--label-2); font-size: 13px; padding: 0 8px 12px; }
.dots { display: grid; gap: 8px; padding: 10px 10px; background: rgba(255, 255, 255, 0.04); border-radius: 14px; }
.dots__row { display: flex; align-items: center; gap: 10px; }
.dots__row b { margin-left: auto; font-weight: 600; font-size: 13px; color: var(--label-2); min-width: 18px; text-align: right; }
.dots__d { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.dots__d i { width: 11px; height: 11px; border-radius: 50%; background: var(--fill); transition: background-color 0.4s var(--ease), transform 0.4s var(--ease); }
.dots__d i.on { transform: scale(1); }
.dots__d i.new { animation: pop 0.5s var(--ease); }
@keyframes pop { 0% { transform: scale(0.4); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }

.call { margin: 10px 0; border-radius: 16px; background: rgba(255, 255, 255, 0.04); padding: 14px; min-height: 68px; display: grid; align-items: center; }
.call > div { grid-area: 1 / 1; transition: opacity 0.45s var(--ease), transform 0.55s var(--ease), filter 0.55s var(--ease); }
.call:not([data-state="watching"]) .call__watching, .call:not([data-state="ready"]) .call__ready, .call:not([data-state="shown"]) .call__shown { opacity: 0; transform: translateY(6px); filter: blur(6px); pointer-events: none; }
.call__watching { display: flex; align-items: center; gap: 10px; color: var(--label-2); font-size: 13px; }
.call__ready { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }
.call__ready .btn { margin-left: auto; padding: 9px 20px; }
.call__pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 0 rgba(10, 132, 255, 0.5); animation: ping 1.6s var(--ease) infinite; }
@keyframes ping { 70%, 100% { box-shadow: 0 0 0 10px rgba(10, 132, 255, 0); } }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--fill-2); border-top-color: var(--label-2); animation: spin 0.9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.verdict { font-size: 26px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.verdict.L { color: var(--leg-L); }
.verdict.R { color: var(--link); }
.verdict__sub { color: var(--label-2); font-size: 13px; margin-top: 6px; }

.cmp { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 2px 0 8px; }
.cmp th { font-weight: 500; color: var(--label-3); text-align: right; padding: 4px 6px; font-size: 11px; }
.cmp th:first-child { text-align: left; }
.cmp td { padding: 6px 6px; text-align: right; border-top: 0.5px solid var(--sep); }
.cmp td:first-child { text-align: left; color: var(--label-2); }
.cmp td.d { font-weight: 600; }
.cmp td.d.lo { color: var(--orange); }
.cmp td.d.m { color: var(--label-3); font-weight: 500; }
.cmp.hide-dir td.d { color: var(--label-3); filter: blur(5px); }

.truth { margin: 6px 0 12px; padding: 12px; border-radius: 14px; background: rgba(10, 132, 255, 0.1); animation: rise 0.5s var(--ease) both; }
.truth__q { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.roundp .row2 { justify-content: space-between; padding-top: 4px; }
.roundp .row2 .btn { flex: none; }

.trace { position: fixed; left: calc(var(--side) + 316px + 12px); right: calc(var(--side) + 348px + 12px); bottom: var(--side); height: 150px; padding: 10px 14px 8px; z-index: 5; animation: rise 0.7s var(--ease) both; }
.trace__head { display: flex; gap: 14px; align-items: baseline; font-size: 12px; color: var(--label-2); }
.trace__head > span:first-child { color: var(--label); font-weight: 600; font-size: 13px; }
.trace__unit { margin-left: auto; color: var(--label-3); }
.legend { display: inline-flex; align-items: center; gap: 2px; }
.legend .lg + .lg, .legend .lg--R { margin-left: 10px; }
.trace canvas { width: 100%; height: calc(100% - 22px); display: block; margin-top: 4px; }

.dock { position: fixed; left: var(--side); bottom: var(--side); display: flex; gap: 2px; padding: 5px; border-radius: 16px; z-index: 6; animation: rise 0.6s var(--ease) both; }
.dock__btn { border: 0; background: none; color: var(--label); height: 36px; min-width: 36px; border-radius: 11px; cursor: pointer; display: grid; place-items: center; transition: background-color 0.2s; padding: 0 10px; font-size: 13px; font-weight: 500; }
.dock__btn:hover { background: var(--fill); }
.dock__btn[aria-pressed="true"] { background: var(--fill-2); }
.dock__btn svg { width: 16px; height: 16px; fill: currentColor; }
.dock__btn .i-play { display: none; }
.dock__btn.paused .i-play { display: block; }
.dock__btn.paused .i-pause { display: none; }
.legs { max-height: calc(100vh - var(--panel-top) - 84px); }
body.has-source .legs { max-height: calc(100vh - var(--panel-top) - 84px); }

/* start sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, 0.32); transition: opacity 0.45s var(--ease), background-color 0.45s; }
.sheet-wrap.closing { opacity: 0; pointer-events: none; }
.sheet-wrap.closing > * { transform: translateY(14px) scale(0.98); }
.start { width: min(460px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 26px 26px 20px; text-align: center; transition: transform 0.5s var(--ease); animation: sheet 0.7s var(--ease) both; }
@keyframes sheet { from { opacity: 0; transform: translateY(24px) scale(0.98); } }
.start h1 { font-size: 24px; letter-spacing: -0.025em; }
.start p { color: var(--label-2); font-size: 14px; margin: 8px auto 18px; line-height: 1.45; max-width: 34em; }
.start p.start__tip { color: var(--label-3); font-size: 12.5px; margin: 12px auto 0; }
.start p.start__credit { color: var(--label-4); font-size: 11px; margin: 6px auto 0; }
.start__btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 520px) { .start { padding: 20px 16px 16px; } .start__btns { grid-template-columns: 1fr; } }
.start__status { margin-top: 14px; font-size: 12px; color: var(--label-3); min-height: 16px; }
.start__status.err { color: var(--red); }
.field { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--fill-3); border-radius: 12px; padding: 8px 8px 8px 14px; margin-bottom: 10px; color: var(--label-2); font-size: 13px; }
.field select { background: var(--fill); border: 0; border-radius: 8px; padding: 7px 10px; max-width: 230px; color: var(--label); }

/* ---------- Game ---------- */
#view-game { background: radial-gradient(120% 90% at 40% 40%, #18181a 0%, #000 72%); }
.gstage { position: fixed; left: var(--side); right: calc(var(--side) + 372px + 12px); top: 84px; bottom: calc(var(--side) + 132px + 12px); border-radius: 18px; overflow: hidden; background: #000; box-shadow: 0 0 0 1px var(--hair), 0 20px 50px rgba(0,0,0,0.5); animation: rise 0.6s var(--ease) both; }
.gstage video, .gstage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.gstage video { object-fit: contain; }
.gstatus { position: absolute; inset: 0; display: grid; place-items: center; color: var(--label-2); font-size: 13px; pointer-events: none; }
.gstatus:empty { display: none; }
.gside { right: var(--side); width: 372px; top: var(--panel-top); bottom: var(--side); padding: 12px 12px 14px; }
.rhead { display: grid; grid-template-columns: 30px 1fr 38px 40px; gap: 8px; padding: 0 10px 4px; font-size: 10.5px; color: var(--label-3); }
.rhead span:nth-child(2) { padding-left: 2px; }
.rhead span:last-child { text-align: right; }
.roster { display: grid; gap: 6px; }
.rgroup { background: rgba(255,255,255,0.035); border-radius: 14px; padding: 4px; }
.rgroup__h { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--label-2); padding: 5px 8px 3px; }
.tdot { width: 9px; height: 9px; border-radius: 50%; }
.tdot.t0 { background: #1c1c1e; box-shadow: 0 0 0 1.5px rgba(245,245,247,0.9); }
.tdot.t1 { background: #F5F5F7; box-shadow: 0 0 0 1.5px var(--blue); }
.rrow { display: grid; grid-template-columns: 30px 1fr 38px 40px; gap: 8px; align-items: center; width: 100%; border: 0; background: none; border-radius: 10px; padding: 5px 8px; cursor: pointer; transition: background-color 0.2s var(--ease); text-align: left; }
.rrow:hover { background: rgba(255,255,255,0.05); }
.rrow.sel { background: rgba(10,132,255,0.2); }
.jchip { display: inline-grid; place-items: center; min-width: 28px; height: 22px; padding: 0 6px; border-radius: 11px; font-size: 12px; font-weight: 700; letter-spacing: -0.01em; }
.jchip.t0 { background: #1c1c1e; color: #F5F5F7; box-shadow: inset 0 0 0 1px rgba(245,245,247,0.55); }
.jchip.t1 { background: #F5F5F7; color: #0A64D8; }
.jchip.big { min-width: 34px; height: 26px; border-radius: 13px; font-size: 14px; margin-right: 8px; }
.rrow__bar { height: 5px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.rrow__bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--green), var(--yellow) 60%, var(--orange)); transition: width 0.8s var(--ease); }
.rrow__n { font-size: 13px; font-weight: 600; text-align: right; }
.rrow__c { font-size: 12px; color: var(--label-2); text-align: right; }
.gsel { margin-top: 12px; padding: 12px 6px 0; border-top: 0.5px solid var(--sep); }
.gsel__name { display: flex; align-items: center; font-size: 19px; font-weight: 600; letter-spacing: -0.02em; padding: 0 4px; }
.gsel__name b { font-weight: 600; margin-left: 6px; }
.gsel__seen { color: var(--label-2); font-size: 12px; padding: 3px 4px 10px; }
#gCloseup { width: 100%; aspect-ratio: 4 / 3; display: block; border-radius: 14px; background: #000; }
.gsel__now { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.gsel__now div { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.045); border-radius: 12px; padding: 8px 10px; }
.gsel__now b { font-size: 24px; font-weight: 600; letter-spacing: -0.03em; transition: color 0.4s var(--ease); }
.gsel__now small { grid-column: 1 / -1; color: var(--label-3); font-size: 11px; padding: 0 4px; }
.ggrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.ggrid div { background: rgba(255,255,255,0.045); border-radius: 12px; padding: 8px 10px; }
.ggrid div:first-child { grid-column: span 3; display: flex; align-items: baseline; gap: 10px; }
.ggrid b { display: block; font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.ggrid div:first-child b { font-size: 26px; }
.ggrid span { color: var(--label-2); font-size: 11px; }
.gsec { font-size: 12px; font-weight: 600; color: var(--label-2); margin: 14px 4px 6px; }
.evs { display: grid; gap: 1px; }
.ev { display: grid; grid-template-columns: 36px 78px 1fr; gap: 8px; align-items: baseline; width: 100%; text-align: left; border: 0; background: none; border-radius: 9px; padding: 6px 6px; cursor: pointer; font-size: 12.5px; transition: background-color 0.2s; }
.ev:hover { background: rgba(255,255,255,0.05); }
.ev__t { color: var(--label-3); font-variant-numeric: tabular-nums; }
.ev__k { font-weight: 600; }
.ev__k.cut, .ev__k.stop { color: var(--orange); }
.ev__d { color: var(--label-2); }
.gside .note { margin: 12px 4px 0; line-height: 1.4; }
.gbar { position: fixed; left: var(--side); right: calc(var(--side) + 372px + 12px); bottom: var(--side); height: 132px; padding: 8px 10px 6px; z-index: 5; animation: rise 0.7s var(--ease) both; }
.gbar__ctl { display: flex; align-items: center; gap: 4px; }
.gbar__time { font-size: 12px; color: var(--label-2); font-variant-numeric: tabular-nums; margin: 0 8px 0 4px; }
.gbar__lbl { margin-left: auto; font-size: 11.5px; color: var(--label-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gbar__lbl b { color: var(--label); font-weight: 600; }
.gbar .dock__btn { height: 30px; min-width: 30px; }
.gbar #gPlay svg { width: 14px; height: 14px; fill: currentColor; }
#gPlay .i-play { display: none; }
#gPlay.paused .i-play { display: block; }
#gPlay.paused .i-pause { display: none; }
.tri { display: inline-block; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 7px solid var(--orange); margin: 0 3px 0 2px; vertical-align: 1px; }
#gTimeline { width: 100%; height: calc(100% - 34px); display: block; cursor: pointer; margin-top: 2px; }
body:not([data-view="live"]) .stats { display: none; }

/* film picker */
.filmbtn { display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 16px; border-radius: 18px; cursor: pointer; text-align: left; max-width: 420px; transition: transform 0.2s var(--ease), background-color 0.2s; }
.filmbtn:hover { background: rgba(44,44,46,0.6); }
.filmbtn:active { transform: scale(0.98); }
.filmbtn__txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.filmbtn b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filmbtn small { font-size: 11.5px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filmbtn svg { width: 12px; height: 8px; color: var(--label-2); flex: none; }
body:not([data-view="game"]) .filmbtn { display: none; }
.films { width: min(860px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; padding: 16px 18px 20px; animation: sheet 0.55s var(--ease) both; transition: transform 0.45s var(--ease); }
.films .head { align-items: center; }
.films__sub { color: var(--label-2); font-size: 13px; padding: 0 8px 6px; }
.fgroup__h { font-size: 13px; font-weight: 600; color: var(--label-2); margin: 14px 8px 8px; }
.fcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; padding: 0 4px; }
.fcard { position: relative; display: block; padding: 0; border: 0; border-radius: 16px; overflow: hidden; cursor: pointer; aspect-ratio: 16 / 9; background: #1c1c1e; text-align: left; box-shadow: 0 0 0 1px var(--hair); transition: transform 0.45s var(--ease), box-shadow 0.3s var(--ease); isolation: isolate; }
.fcard img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(0.8); transition: transform 0.7s var(--ease), filter 0.4s; }
.fcard::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(0,0,0,0.85) 100%); z-index: 1; }
.fcard:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(255,255,255,0.2), 0 14px 30px rgba(0,0,0,0.45); }
.fcard:hover img { transform: scale(1.04); filter: brightness(0.95); }
.fcard.sel { box-shadow: 0 0 0 2px var(--blue), 0 14px 30px rgba(0,0,0,0.45); }
.fcard__txt { position: absolute; left: 12px; right: 12px; bottom: 10px; z-index: 2; }
.fcard__txt b { display: block; color: #fff; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.fcard__txt small { display: block; color: rgba(255,255,255,0.75); font-size: 11.5px; margin-top: 1px; }
.fcard__dur { position: absolute; top: 9px; right: 9px; z-index: 2; font-size: 11px; font-weight: 600; color: #fff; padding: 3px 7px; border-radius: 8px; background: rgba(28,28,30,0.6); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
@media (max-width: 900px) { .filmbtn { order: 4; width: 100%; max-width: none; } }

/* ---------- method sheet, toast ---------- */
.method { width: min(560px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; padding: 16px 16px 20px; animation: sheet 0.55s var(--ease) both; transition: transform 0.45s var(--ease); }
.method .head { align-items: center; }
.method__body { padding: 0 8px; color: var(--label-2); font-size: 14px; line-height: 1.5; }
.method__body > p:first-child { color: var(--label); }
.method dl { margin: 14px 0; display: grid; grid-template-columns: 112px 1fr; gap: 10px 14px; }
.method dt { color: var(--label); font-weight: 600; font-size: 13px; }
.method dd { margin: 0; font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: 186px; transform: translateX(-50%); padding: 11px 18px; border-radius: 14px; font-size: 13px; font-weight: 500; z-index: 40; animation: toast 0.5s var(--ease) both; white-space: nowrap; }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 10px) scale(0.97); } }

/* ---------- smaller screens ---------- */
@media (max-width: 1180px) {
  .legs { width: 288px; }
  .roundp { width: 312px; }
  .trace { left: calc(var(--side) + 288px + 12px); right: calc(var(--side) + 312px + 12px); }
  .stats { gap: 16px; padding: 9px 14px; }
  .brand { min-width: 0; }
}
@media (max-width: 900px) {
  :root { --top: 10px; --side: 10px; --panel-top: 118px; }
  html, body { overflow: auto; }
  .top { flex-wrap: wrap; }
  .brand { order: 1; }
  .round-btn { order: 2; margin-left: auto; }
  .seg { order: 3; width: 100%; }
  .seg button { flex: 1; padding: 7px 4px; }
  .stats { display: none; }
  body:not([data-view="live"]) .round-btn { margin-left: auto; }
  .legs, .roundp, .gside { position: relative; top: auto; left: auto; right: auto; width: auto; max-height: none; margin: 0 var(--side) 10px; }
  .view { overflow-y: auto; padding-top: var(--panel-top); padding-bottom: 20px; }
  .stage { position: relative; inset: auto; height: 56vh; margin: 0 var(--side) 10px; border-radius: var(--r); }
  .trace { position: relative; left: auto; right: auto; bottom: auto; margin: 0 var(--side) 10px; }
  .dock { position: sticky; bottom: 10px; left: auto; margin: 0 var(--side) 10px; width: max-content; }
  .gstage { position: relative; left: auto; right: auto; top: auto; bottom: auto; margin: 0 var(--side) 10px; aspect-ratio: 16 / 9; }
  .gbar { position: relative; left: auto; right: auto; bottom: auto; margin: 0 var(--side) 10px; }
  .gbar__lbl { display: none; }
  .gside { bottom: auto; }
  .method dl { grid-template-columns: 1fr; gap: 2px; }
  .method dd { margin-bottom: 10px; }
  .toast { bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
