:root {
  --ink: #e8edf2;
  --paper: #10151c;
  --panel: #171e27;
  --muted: #93a0af;
  --line: #2c3744;
  --orange: #5aa6f2;
  --orange-dark: #8dc2fa;
  --green: #36bd84;
  --red: #dc6d78;
  --gray: #596675;
  --navy: #0b1016;
  --shadow: 0 18px 50px rgba(0, 0, 0, .35);
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: dark;
}
body { background: var(--paper); color: var(--ink); }
.login-screen { background: #0b1016; }
.login-screen:after { border-color: rgba(90, 166, 242, .12); box-shadow: 0 0 0 30px rgba(90, 166, 242, .025), 0 0 0 90px rgba(90, 166, 242, .015); }
.login-screen h1, .page-intro h2, .panel h3, .annotator-head h2, .timeline-panel h3, .card-title { font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-weight: 700; letter-spacing: -.045em; }
.login-screen h1 { font-size: clamp(48px, 7vw, 88px); line-height: .9; }
.login-screen h1 em, h2 em { color: var(--orange); font-style: normal; }
.login-screen input { background: #141d27; border-color: #344252; color: var(--ink); border-radius: 4px; }
.primary { background: #287bc6; border-radius: 4px; }
.primary:hover { background: #3c91dd; }
.login-note code { color: #b7d7f7; }
.topbar { background: rgba(16, 21, 28, .96); border-color: var(--line); backdrop-filter: blur(12px); }
.brand-mark { background: #287bc6; color: #eef6ff; border-radius: 3px; }
.quiet { color: #b9c5d0; }
.quiet:hover, .back-link { color: #85bdfa; }
.eyebrow { color: #78b8f7; }
.intro-side p, .muted { color: var(--muted); }
.grid-toolbar { border-color: var(--line); }
.mode-toggle select { background: #131b24; border-color: #3b4958; color: var(--ink); border-radius: 3px; }
.video-card { background: var(--panel); border-color: var(--line); text-align: left; color: var(--ink); border-radius: 5px; }
.video-card:hover { border-color: #5689bb; box-shadow: 0 18px 45px rgba(0,0,0,.35); }
.card-top { background: #121a23; border-bottom: 1px solid #2b3744; }
.card-title { font-size: 18px; letter-spacing: -.02em; }
.progress-line { background: #293440; border-radius: 999px; }
.progress-fill { background: #36bd84; }
.card-arrow, .table-row button { color: #85bdfa; }
.panel { background: var(--panel); border-color: var(--line); border-radius: 5px; }
.table-list, .table-row { border-color: var(--line); }
.inline-form input { background: #121a23; border-color: #3b4958; color: var(--ink); border-radius: 3px; }
.modal-form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.modal-field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: #9fb2c4; }
.modal-field input, .modal-field select { width: 100%; background: #121a23; border-color: #3b4958; color: var(--ink); border-radius: 3px; }
.upload-label { background: #287bc6; }
.stage { position: relative; background: #080d12; border: 1px solid #283442; border-radius: 5px; }
.player-tools button { background: #18212c; border-color: #344252; color: #dce6ef; border-radius: 3px; }
.player-tools button:hover { border-color: #5aa6f2; color: #9dcbfa; }
.player-tools .danger { color: #e98790; }
.timeline-panel { background: var(--panel); border-color: var(--line); border-radius: 5px; }
.timeline { background: #0f151d; border: 1px solid #273342; }
.timeline i { background: #465363; }
.timeline i.current { box-shadow: inset 0 0 0 2px #e8edf2; }
.frame-info { border-color: var(--line); }
.toast { background: #203042; border-left: 3px solid #5aa6f2; }
.empty { border-color: #3b4958; }
@media (max-width: 800px) { .login-screen { background: #0b1016; } }

/* Footage is the tile: metadata floats directly over an unaltered thumbnail. */
.video-card { position: relative; display: block; min-height: 210px; height: 210px; padding: 0; overflow: hidden; color: #fff; background: #10151c; text-align: left; }
.card-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 1; filter: none; transition: transform .18s ease; z-index: 0; }
.video-card:hover .card-thumb { opacity: 1; transform: scale(1.025); }
.card-fps, .card-overlay { position: absolute; z-index: 1; color: #fff; text-shadow: 0 1px 2px #000, 0 0 5px #000; }
.card-fps { top: 13px; left: 14px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
/* The whole metadata stack is one bottom-anchored column so the stat line can
   wrap without colliding with the title above it. */
.card-overlay { right: 14px; bottom: 12px; left: 14px; display: flex; flex-direction: column; gap: 7px; }
.card-title { position: static; margin: 0; max-width: none; font-size: 18px; line-height: 1.05; letter-spacing: -.02em; }
.card-progress { position: static; display: flex; flex-direction: column; gap: 5px; }
.card-stats { font-size: 13px; font-weight: 700; line-height: 1.3; }
/* Detection progress rides under the stats while a job runs on this clip. */
.card-detect { display: flex; flex-direction: column; gap: 3px; font-size: 11px; font-weight: 700; color: #cfe4ff; }
.card-detect.hidden { display: none; }
.detect-bar { height: 3px; background: rgba(10, 15, 21, .75); border-radius: 2px; overflow: hidden; }
.detect-fill { height: 100%; width: 0; background: #5aa6f2; transition: width .2s linear; }
/* One canvas pixel per bucket, shown unsmoothed so run edges stay hard.
   Vendor pseudo-elements must each get their own rule: Chrome discards a whole
   selector list containing an unknown pseudo-element such as ::-moz-range-track. */
.status-strip { image-rendering: pixelated; }
body.player-active #seek-bar { image-rendering: pixelated; }
body.player-active #seek-bar::-webkit-slider-runnable-track { image-rendering: pixelated; }
body.player-active #seek-bar::-moz-range-track { image-rendering: pixelated; }
.status-strip { background: #5a5a5a var(--frame-status-track) center / 100% 100% no-repeat; border: 1px solid rgba(0, 0, 0, .55); }
/* The toast is only a surface while it carries a message. */
.toast:not(.show) { display: none; }
/* The coin counter lives in the top bar; reward toasts slide up beneath it. */
.coin-display { position: relative; display: flex; align-items: center; gap: 5px; color: #f2c14e; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; cursor: default; }
/* The reel is not plain text: every digit is its own 1em window, while
   #coin-count's strut (line-height: normal, ~1.21em) is taller — so
   `vertical-align: bottom` parked the windows on the strut's descender and the
   digits rendered a descender's depth below the icon's centre. Dropping the
   strut (flex row, line-height 1) and giving the windows explicit 1em metrics
   puts their optical centre back on the icon's. */
.coin-display #coin-count { display: flex; align-items: center; line-height: 1; }
.coin-icon { width: 15px; height: 15px; display: block; }
/* Window-complete modal with the propeller spin on the random option. */
.modal { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; background: rgba(5, 8, 12, .72); }
.modal-card { width: 380px; padding: 28px 24px; background: #121b25; border: 1px solid #2c3a48; border-radius: 8px; text-align: center; box-shadow: 0 18px 48px rgba(0, 0, 0, .55); }
/* The inventory grid is 10 cells wide (490px); the base modal card is too
   narrow, so the profile card is widened (must live after .modal-card). */
.modal-card.profile-card { width: 800px; }
.modal-card h3 { margin: 0 0 6px; font-size: 20px; }
.modal-card p { margin: 0 0 20px; color: #aebcc9; font-size: 13px; }
.modal-actions { display: flex; flex-direction: column; gap: 8px; }
.modal-actions .small { width: 100%; padding: 9px 10px; }
.propeller { width: 64px; height: 64px; margin: 0 auto 14px; color: #f2c14e; }
.propeller svg { animation: prop-spin .35s linear infinite; }
@keyframes prop-spin { to { transform: rotate(360deg); } }

/* Admin rewards panel — settings rows with fixed-width inputs. */
.rewards-form { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 10px 20px; margin-top: 14px; align-items: center; max-width: 640px; }
.rewards-form label { display: contents; }
.rewards-form label span { font-size: 12px; color: #9fb2c4; }
.rewards-form input { width: 110px; justify-self: end; padding: 9px 10px; background: #121a23; border: 1px solid #3b4958; border-radius: 3px; color: var(--ink); }
.rewards-form button { grid-column: 1 / -1; justify-self: start; margin-top: 4px; }
.card-menu { position: fixed; z-index: 40; min-width: 168px; padding: 4px; background: #17202b; border: 1px solid #35424f; box-shadow: 0 12px 32px rgba(0, 0, 0, .5); }
.card-menu button { display: block; width: 100%; padding: 8px 10px; border: 0; background: transparent; color: #f2f5f8; font-size: 12px; text-align: left; }
.card-menu button:hover { background: #24303d; color: #ff8f80; }
#grid-view.drop-active { outline: 2px dashed #5aa6f2; outline-offset: -10px; }
body.player-active .title-line { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
body.player-active .back-chevron { padding: 0 6px 4px; border: 0; background: transparent; color: #9fb2c4; font-size: 26px; line-height: 1; cursor: pointer; }
body.player-active .back-chevron:hover { color: #fff; }
body.player-active .frame-chip { flex: 0 0 auto; color: #9fb2c4; font-size: 12px; font-variant-numeric: tabular-nums; }
body.player-active .seek-row { display: flex; align-items: center; gap: 10px; }
body.player-active #cur-time-label, body.player-active #cur-frame-label,
body.player-active #end-frame-label, body.player-active #end-time-label { flex: 0 0 auto; color: #9fb2c4; font-size: 12px; font-variant-numeric: tabular-nums; }
body.player-active #end-frame-label, body.player-active #end-time-label { text-align: right; }

body { user-select: none; -webkit-user-select: none; }
input, select, textarea, .card-title, .annotator-head h2 { user-select: text; -webkit-user-select: text; }
body.player-active { overflow: hidden; }
body.player-active #app-view { height: 100dvh; display: flex; flex-direction: column; align-items: stretch; overflow: hidden; }
body.player-active .topbar { flex: 0 0 auto; height: 56px; padding-block: 0; }
/* The top-left slot carries the editor's back button + title; empty in grid
   view. Fixed height keeps the panel identical across both views. */
.topbar-left { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; }
.topbar-left h2 { margin: 0; font-size: clamp(15px, 1.4vw, 20px); font-weight: 700; letter-spacing: -.045em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Profile button with a hover-expanding Admin/Logout menu. */
.user-label { position: relative; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 12px; color: var(--muted); white-space: nowrap; }
.user-label:hover { color: #85bdfa; }
.user-label .caret { font-size: 9px; opacity: .8; }
/* Gravatar, with an inline glyph standing in whenever the identity has none
   (the d=404 miss is the common case, not an error). Both are click-through so
   the chip keeps opening the profile. */
.user-avatar { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; pointer-events: none; }
.user-glyph { padding: 3px; background: #243040; border: 1px solid var(--line); color: #8fa3b8; }
.profile-menu { position: absolute; top: calc(100% + 8px); right: 0; min-width: 148px; padding: 4px; background: #17202b; border: 1px solid #35424f; border-radius: 4px; box-shadow: 0 12px 32px rgba(0, 0, 0, .5); z-index: 50; }
.profile-menu button { display: block; width: 100%; padding: 8px 10px; border: 0; background: transparent; color: #f2f5f8; font-size: 12px; text-align: left; border-radius: 3px; }
.profile-menu button:hover { background: #24303d; color: #ff8f80; }
body.player-active .page { padding: 8px 16px 10px; }
body.player-active #annotator-view { flex: 1 1 auto; width: 100%; max-width: none; margin: 0; height: auto; min-height: 0; display: flex; flex-direction: column; align-items: stretch; overflow: hidden; }
body.player-active #annotator-root, body.player-active .annotator-shell, body.player-active .player-main { width: 100%; min-width: 0; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; max-width: none; }
body.player-active .annotator-head { flex: 0 0 auto; margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
body.player-active .annotator-head h2 { flex: 0 1 auto; min-width: 0; margin: 2px 0 0; font-size: clamp(15px, 1.4vw, 20px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.player-active .segment-note { flex: 0 0 auto; margin: 0; text-align: right; font-size: 11px; white-space: nowrap; }
body.player-active .stage { flex: 1 1 auto; min-height: 0; width: 100%; display: grid; place-items: center; overflow: hidden; touch-action: none; }
body.player-active .media-viewport { position: relative; max-width: 100%; max-height: 100%; transform-origin: center center; }
body.player-active .video-el { position: absolute; inset: 0; width: 100%; height: 100%; max-height: 100%; object-fit: contain; }
/* Shadows stay composited (opacity, not display:none) so their decoded frame
   texture stays resident: a display:none flip drops the texture and the swap
   repaints black for a frame until it re-uploads. */
body.player-active .video-off { opacity: 0; pointer-events: none; }
body.player-active #canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
body.player-active .player-row { flex: 0 0 auto; align-items: center; gap: 12px; padding: 0 2px; }
/* The tools row centres its buttons between two equal gutters; the seek row is
   a flex line so all five children (two left labels, the bar, two right
   labels) stay on one line and the bar takes every spare pixel. */
body.player-active .tools-row { display: grid; grid-template-columns: minmax(96px, auto) 1fr minmax(96px, auto); margin: 6px 0 0; }
body.player-active .seek-row { display: flex; margin-top: 8px; font-size: 12px; font-variant-numeric: tabular-nums; }
body.player-active .seek-wrap { position: relative; display: flex; flex: 1 1 auto; min-width: 0; }
/* Phantom thumb and frame readout for the hovered position. */
body.player-active .seek-ghost { position: absolute; top: -3px; width: 4px; height: 20px; margin-left: -2px; border-radius: 1px; background: rgba(255, 255, 255, .4); box-shadow: 0 0 0 1px rgba(0, 0, 0, .4); pointer-events: none; }
body.player-active .seek-tip { position: absolute; bottom: 24px; padding: 2px 7px; transform: translateX(-50%); background: #0b1016; border: 1px solid #35424f; color: #e7eef5; font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none; }
/* Timeline region selection: a translucent span above the seek bar. It is a
   display-only overlay (pointer-events: none); selection input happens on
   the bar itself. */
body.player-active .seek-sel { position: absolute; top: 0; height: 100%; background: rgba(90, 166, 242, .28); border: 1px solid rgba(157, 203, 250, .8); pointer-events: none; z-index: 2; }
body.player-active #seek-bar { --frame-status-track: #5a5a5a; width: 100%; height: 14px; margin: 0; padding: 0; appearance: none; -webkit-appearance: none; background: transparent; border: 0; cursor: pointer; }
body.player-active #seek-bar::-webkit-slider-runnable-track { height: 12px; border: 1px solid #18121c; border-radius: 2px; background: #5a5a5a var(--frame-status-track) center / 100% 100% no-repeat; }
body.player-active #seek-bar::-webkit-slider-thumb { width: 4px; height: 20px; margin-top: -5px; appearance: none; -webkit-appearance: none; border: 1px solid #111; border-radius: 1px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .45); }
body.player-active #seek-bar::-moz-range-track { height: 10px; border: 1px solid #18121c; border-radius: 2px; background: #5a5a5a var(--frame-status-track) center / 100% 100% no-repeat; }
body.player-active #seek-bar::-moz-range-progress { background: transparent; }
body.player-active #seek-bar::-moz-range-thumb { width: 3px; height: 18px; border: 1px solid #111; border-radius: 1px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .45); }
body.player-active #seek-bar:focus-visible { outline: 2px solid #5aa6f2; outline-offset: 2px; }
body.player-active .player-tools { flex: 0 0 auto; margin: 0; display: flex; align-items: center; justify-content: center; gap: 6px; }
body.player-active .icon-button { display: inline-grid; place-items: center; width: 32px; height: 26px; padding: 0; border: 1px solid #2c3742; background: #18212c; color: #cfdae5; cursor: pointer; }
body.player-active .icon-button:hover { background: #22303d; color: #fff; }
body.player-active .icon-button svg { width: 15px; height: 15px; fill: currentColor; }
/* The single confirm control carries its state in its colour. */
body.player-active #confirm-button.is-ready { background: #1d7a4c; border-color: #2ea56a; color: #fff; }
body.player-active #confirm-button.is-absent { background: #8d2f2a; border-color: #b8433c; color: #fff; }
body.player-active #confirm-button.is-review { background: #8a6d1d; border-color: #c99700; color: #fff; }

@media (max-width: 800px) {
  body.player-active .page { padding: 8px; }
  body.player-active .annotator-head h2 { max-width: 70vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.player-active .player-tools { flex-wrap: wrap; }
}

.stats-strip { border-bottom: 1px solid var(--line); }
.stats-cell { border-left-color: var(--line); }
.stats-value { color: var(--ink); }
.stats-bar { background: #36bd84; }
.stats-bar.empty { background: #273240; opacity: 1; }

/* Store / leaderboard / profile dark overrides. */
.stats-strip { border-bottom-color: var(--line); }
.agg-value { color: var(--ink); }
.agg-bar { background: #1c2733; opacity: 1; }
.agg-bar-fill { background: #36bd84; }
.crate-row { background: #18212c; border-color: #344252; }
.crate-icon { background: #121a23; border-color: #3b4958; color: #b9c6d2; }
.crate-price { color: #f2c14e; }
.crate-result { background: #16202b; border-color: #344252; }
.item-family { color: #8b98a6; }
.inventory-item { border-color: #26323f; }
.modal-close { color: #8b98a6; }
.modal-close:hover { color: #e6eef5; }

.item-art { border-color: #344252; }
.crate-result-card .modal-head .eyebrow { color: #78b8f7; }

.modal.modal-over { z-index: 80; }

/* Stepping display canvas: sits above the video elements (DOM order), below
   the box overlay, and only shows while frame stepping. drawImage reads the
   decoded frame directly, so it can never show a stale compositor texture. */
body.player-active .step-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: none; }
body.player-active .step-canvas.show { display: block; }

/* Box-zoom preview: a 300x300 square pinned to the stage's top-right corner,
   showing the part of the frame the current box covers. It is a sibling of
   the scaled viewport, so it stays 300 CSS px at any zoom. */
body.player-active .box-preview { position: absolute; top: 10px; right: 10px; width: 300px; height: 300px; border: 1px solid rgba(120, 150, 180, .55); border-radius: 4px; background: #000; box-shadow: 0 8px 24px rgba(0, 0, 0, .55); z-index: 5; pointer-events: none; }
body.player-active .box-preview canvas { width: 100%; height: 100%; image-rendering: auto; display: block; }
body.player-active .box-preview .box-preview-label { position: absolute; top: 3px; left: 5px; font-size: 10px; color: rgba(255, 255, 255, .75); text-shadow: 0 1px 2px #000; }

/* Context menus shared by the stage (box tools) and the seek bar (regions). */
body.player-active .ctx-menu { position: absolute; z-index: 90; min-width: 168px; padding: 4px; background: #17202b; border: 1px solid #35424f; border-radius: 4px; box-shadow: 0 12px 32px rgba(0, 0, 0, .5); }
body.player-active .ctx-menu button { display: block; width: 100%; padding: 7px 10px; border: 0; background: transparent; color: #f2f5f8; font-size: 12px; text-align: left; border-radius: 3px; }
body.player-active .ctx-menu button:hover { background: #24303d; color: #ff8f80; }
body.player-active .ctx-menu button.danger { color: #e98790; }
body.player-active .ctx-menu button.danger:hover { background: #2b1d20; color: #ff9aa0; }

/* Reward notifications: absolute in the stage, top-right over the frame. */
body.player-active .reward-toast { position: absolute; right: 12px; z-index: 6; text-align: right; font-family: "Doto", "Segoe UI", sans-serif; font-weight: 800; font-size: 17px; color: #f2c14e; text-shadow: 0 1px 3px #000, 0 0 8px rgba(0, 0, 0, .8); pointer-events: none; opacity: 0; }
body.player-active .reward-toast.active { animation: label-life 2.1s linear forwards; }

/* In-editor detection progress chip on the tools row. */
body.player-active .detect-status { margin-left: 10px; font-size: 11px; color: #9dcbfa; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Diablo-2 style inventory grid: 10x4 square cells, items spanning cell
   blocks. Item art is fit inside its block; non-firearms rotate 90° CCW. */
.inventory-grid { position: relative; display: grid; grid-template-columns: repeat(10, 48px); grid-template-rows: repeat(4, 48px); width: fit-content; margin: 10px 0 6px; padding: 4px; background: #0d131b; border: 1px solid var(--line); border-radius: 4px; }
.inv-cell { width: 48px; height: 48px; box-shadow: inset 0 0 0 1px rgba(44, 55, 68, .55); background: rgba(23, 30, 39, .55); }
.inv-cell.drop-target { background: rgba(90, 166, 242, .2); box-shadow: inset 0 0 0 1px #5aa6f2; }
.inv-item { position: relative; display: flex; align-items: center; justify-content: center; justify-self: stretch; align-self: stretch; border: 1px solid #596675; border-radius: 2px; background: #1b2530; cursor: grab; z-index: 2; overflow: hidden; }
.inv-item:hover { filter: brightness(1.15); }
.inv-item.dragging { opacity: .45; }
.inv-item.selected { outline: 2px solid #5aa6f2; outline-offset: -2px; }
.inv-item .inv-art { display: block; image-rendering: pixelated; transform-origin: center center; }
.inv-gem { width: 32px; height: 32px; image-rendering: pixelated; }
.inv-sockets { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 5px; opacity: .15; transition: opacity .15s ease; pointer-events: none; }
.inv-item:hover .inv-sockets, .loadout-slot:hover .inv-sockets { opacity: 1; }
.inv-socket { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #35424f; background-color: #0d131b; cursor: pointer; display: block; }
.inv-socket:hover { border-color: #5aa6f2; }
.inv-socket.filled { border-color: #5aa6f2; background-repeat: no-repeat; pointer-events: auto; }
.inventory-tip { margin-top: 4px; font-size: 12px; }
.inventory-tip.selecting { color: #b7d7f7; font-weight: 600; }
.inv-tip { position: fixed; z-index: 90; max-width: 260px; padding: 8px 10px; background: #131c26; border: 1px solid #35424f; border-radius: 4px; box-shadow: 0 10px 28px rgba(0, 0, 0, .55); font-size: 12px; opacity: 0; pointer-events: none; transition: opacity .12s ease; }
.inv-tip.show { opacity: 1; }
.inv-tip .tip-name { font-weight: 700; font-size: 13px; }
.inv-tip .tip-sub { color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.inv-tip .tip-props div { color: #cfe3f7; }
.inv-tip .tip-sockets, .inv-tip .tip-total { color: #b9c6d2; margin-top: 2px; }
.inv-tip .tip-hint { color: #7fa8d0; font-size: 11px; margin-top: 4px; font-style: italic; }
.item-gem { width: 96px; height: 96px; image-rendering: pixelated; }
.inv-cell.drop-invalid { background: rgba(220, 109, 120, .28); box-shadow: inset 0 0 0 1px #dc6d78; }

/* Diablo-2 equipment loadout: paper-doll slots in inventory-cell units
   (48px); slot spans come from LOADOUT_POSITIONS. */
.loadout-wrap { display: flex; flex-direction: column; gap: 14px; align-items: center; margin: 10px 0 6px; }
.loadout { display: grid; grid-template-columns: repeat(6, 48px); grid-template-rows: repeat(7, 48px); gap: 6px; padding: 6px; background: #0d131b; border: 1px solid var(--line); border-radius: 4px; }
.loadout-slot { position: relative; display: flex; align-items: center; justify-content: center; background: rgba(23, 30, 39, .55); box-shadow: inset 0 0 0 1px rgba(44, 55, 68, .55); border-radius: 3px; cursor: pointer; overflow: hidden; }
.loadout-slot:hover { box-shadow: inset 0 0 0 1px #5aa6f2; }
.loadout-slot .loadout-art { display: block; image-rendering: pixelated; transform-origin: center center; }
.loadout-label { position: absolute; top: 2px; left: 4px; font-size: 8px; text-transform: uppercase; letter-spacing: .05em; color: #7d8b9a; pointer-events: none; white-space: nowrap; }
.pending-drops { margin-top: 4px; padding: 6px 8px; border: 1px dashed var(--line); border-radius: 4px; }
.pending-head { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #8b98a6; margin-bottom: 4px; }
.pending-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.pending-name { font-size: 12px; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pending-sub { font-size: 11px; color: var(--muted); flex: 1 1 auto; }
.pending-row .small { padding: 3px 8px; font-size: 11px; }

/* Picked-up item: source dims, ghost follows the cursor. */
.inv-item.held, .loadout-slot.held { opacity: .3; }
.inv-ghost { position: fixed; z-index: 95; display: flex; align-items: center; justify-content: center; border: 1px solid #596675; border-radius: 2px; background: rgba(27, 37, 48, .92); box-shadow: 0 10px 28px rgba(0, 0, 0, .6); pointer-events: none; overflow: hidden; }
.inv-ghost .inv-art { display: block; image-rendering: pixelated; transform-origin: center center; }
.inv-ghost .inv-gem { width: 32px; height: 32px; image-rendering: pixelated; }
.loadout-slot.drop-target { box-shadow: inset 0 0 0 2px #36bd84; background: rgba(54, 189, 132, .18); }
.inv-item.drop-source { opacity: .3; }

/* Crate reveal: quality-tinted particle burst behind the item. */
.crate-burst { position: absolute; inset: 0; pointer-events: none; }
.crate-burst i { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; border-radius: 2px; opacity: 0; transform: translate(-50%, -50%) scale(0); animation: crate-particle .9s ease-out forwards; animation-delay: var(--delay); }
@keyframes crate-particle {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0); }
  12% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.4); }
}
.crate-item { position: relative; }
.reveal-art { display: block; image-rendering: pixelated; transform-origin: center center; }
.item-art { position: relative; }

/* Odometer coin counter: digits are 1em-tall windows over a 0-9 column that
   rolls to the new value; only changed positions animate. */
.coin-digit { display: block; height: 1em; line-height: 1em; overflow: hidden; }
.coin-digit i { display: block; font-style: normal; line-height: 1em; transition: transform .38s cubic-bezier(.22, .7, .3, 1); will-change: transform; }
.coin-sep { }

/* Reward notifications: floating SVG text above the confirmed box. The group
   fades in quickly, holds ~0.5s, then fades over ~1.5s while hue-cycling
   (total ~2.1s — half the original duration). Doto is the dotted display
   face; falls back to the system stack when offline. */
#reward-labels text { font-family: "Doto", "Segoe UI", sans-serif; font-weight: 800; fill: #f2c14e; paint-order: stroke; stroke: rgba(0, 0, 0, .8); stroke-width: 3px; stroke-linejoin: round; animation: label-hue 2.1s linear infinite; }
#reward-labels { opacity: 0; pointer-events: none; }
#reward-labels.active { animation: label-life 2.1s linear forwards; }
@keyframes label-life {
  0% { opacity: 0; }
  12% { opacity: 1; }
  25% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes label-hue { from { filter: hue-rotate(0deg); } to { filter: hue-rotate(360deg); } }

/* Confirmed boxes slowly cycle hue (enchantment tint). */
#box-rect.hue-cycle { animation: box-hue 5s linear infinite; }
@keyframes box-hue { from { filter: hue-rotate(0deg); } to { filter: hue-rotate(360deg); } }

/* Green Start button (grid view CTA). */
#annotate-button.start { background: #2e9e6f; border-color: #2e9e6f; color: #fff; }
#annotate-button.start:hover { background: #36bd84; }

/* Grid view: the stats strip sits right under the top bar. */
#grid-view.page { padding-top: 12px; }

/* Aggregate strip: full-width bar, raw values beneath. */
#grid-view .stats-strip { display: block; margin: 0 0 16px; padding: 0 0 10px; }
#grid-view .agg-bar { width: 100%; }
#grid-view .agg-meta { margin-top: 9px; font-size: 18px; letter-spacing: .01em; color: #c3d3e3; font-variant-numeric: tabular-nums; }

/* Profile: status table to the left of the gear widgets. */
.gear-row { display: flex; gap: 22px; align-items: flex-start; }
.profile-stats { flex: 0 0 auto; min-width: 170px; padding: 10px 14px; background: #0d131b; border: 1px solid var(--line); border-radius: 4px; }
.profile-stats .stat-row { display: flex; justify-content: space-between; gap: 16px; padding: 5px 0; border-bottom: 1px solid rgba(53, 66, 79, .5); font-size: 12px; }
.profile-stats .stat-row:last-child { border-bottom: 0; }
.profile-stats .stat-label { color: #8b98a6; }
.profile-stats .stat-value { color: #f2c14e; font-weight: 700; font-variant-numeric: tabular-nums; }

/* The card timebar is the only progress surface on a card: half height with
   rounded ends (the percentage bar lives on the aggregate strip only). */
.video-card .card-progress .status-strip { height: 10px; border-radius: 5px; }

/* Video editor: thin dotted crosshair guides tracking the pointer over the
   frame, plus the thin-cross cursor. */
body.player-active .stage.crosshair-mode,
body.player-active .stage.crosshair-mode * { cursor: url("/assets/crosshair.svg") 16 16, crosshair; }
body.player-active .cross-guides { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .08s ease; z-index: 6; }

/* Admin: back link, users table, role chips, row buttons. */
body .admin-back { color: #9fb2c4; }
body .admin-back:hover { color: #85bdfa; }
body .admin-table th { color: #7e93a8; }
body .admin-table td { border-top-color: #24303d; }
body .role-chip { border-color: #35424f; color: #b9c5d0; }
body .role-chip.admin { color: #ffb896; border-color: #e8a24e; }
body .btn-mini { background: #17202b; border-color: #35424f; color: #f2f5f8; }
body .btn-mini:hover { border-color: #78b8f7; color: #85bdfa; }
body .btn-mini.danger:hover { border-color: #ff8f80; color: #ff8f80; }
body .you-chip { color: #5fce9a; border-color: #2e9e6f; }
body.player-active .cross-guides.show { opacity: 1; }
body.player-active .guide-v { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dotted rgba(255, 255, 255, .7); }
body.player-active .guide-h { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dotted rgba(255, 255, 255, .7); }
