/* tools/animlab/site/app.css - the animation review page (ANIM A42) */
:root {
  --bg: #0f1113;
  --panel: #171a1e;
  --panel2: #1e2227;
  --line: #2a3037;
  --text: #e9ebed;
  --dim: #8f979f;
  --faint: #5d656d;
  --accent: #f0a742;
  --accent2: #ffd59a;
  --ok: #58c27d;
  --bad: #ef6450;
  --warn: #e7b544;
  --pin: #ff5a45;
  --sound: #6fb6ff;
  --violet: #a58cff;
  --r: 12px;
  --head: 52px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
a { color: var(--accent2); }
button, select, input, textarea { font: inherit; color: inherit; }
select { background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; max-width: 100%; }
textarea { width: 100%; background: #0c0e10; border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; resize: vertical; }
textarea:focus, select:focus, input:focus { outline: 2px solid rgba(240, 167, 66, .45); outline-offset: 0; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg .f { fill: currentColor; stroke: none; }

/* buttons */
.btn { border: 1px solid var(--line); background: var(--panel2); border-radius: 10px; padding: 8px 14px; cursor: pointer; }
.btn:hover { border-color: #46505a; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #1c1306; font-weight: 600; }
.btn.ok { background: #1f3a29; border-color: var(--ok); color: #c9f2d6; font-weight: 600; }
.btn.bad { background: #3b1f1b; border-color: var(--bad); color: #ffd1ca; font-weight: 600; }
.btn:disabled { opacity: .45; cursor: default; }
.ibtn { width: 38px; height: 38px; display: inline-grid; place-items: center; border: 0; border-radius: 10px; background: transparent; cursor: pointer; flex: none; }
.ibtn:hover { background: rgba(255, 255, 255, .08); }
.ibtn.play { background: var(--accent); color: #1c1306; }
.ibtn.play:hover { background: #ffb95a; }
.ibtn.on { color: var(--accent2); }
#loopBtn:not(.on) { color: var(--faint); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px 0 11px; border-radius: 19px; border: 0; cursor: pointer; font-weight: 600; }
.pill.accent { background: var(--accent); color: #1c1306; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.pill.accent.on { background: var(--pin); color: #fff; }
.glass { background: rgba(14, 16, 19, .74); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .08); border-radius: var(--r); }

/* segmented control */
.seg { display: inline-flex; gap: 2px; padding: 3px; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: 0; background: transparent; color: var(--dim); padding: 6px 11px; border-radius: 9px; white-space: nowrap; cursor: pointer; font-size: 13px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: rgba(240, 167, 66, .2); color: var(--accent2); }
.seg.small { background: rgba(255, 255, 255, .05); border-radius: 10px; }
.seg.small button { padding: 5px 8px; min-width: 32px; }

/* header */
header.top { position: sticky; top: 0; z-index: 20; height: var(--head); display: flex; align-items: center; gap: 12px; padding: 0 14px;
  background: rgba(15, 17, 19, .94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.back { display: none; align-items: center; gap: 2px; color: var(--dim); text-decoration: none; padding: 6px 8px 6px 2px; border-radius: 8px; }
.back:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
body.viewing .back { display: inline-flex; }
.title { position: relative; display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; }
.title b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title .caret { display: none; width: 18px; height: 18px; color: var(--dim); flex: none; margin-right: 4px; }
body.viewing .title .caret { display: block; }
/* the clip's name is the picker: a tap opens the phone's own list of clips */
#clip { display: none; position: absolute; inset: 0; width: 100%; max-width: none; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
body.viewing #clip { display: block; }
body.viewing .title { border-radius: 9px; padding: 4px 6px; margin-left: -6px; }
body.viewing .title:hover { background: rgba(255, 255, 255, .05); }
.nav { display: none; align-items: center; gap: 0; background: var(--panel2); border: 1px solid var(--line); border-radius: 11px; flex: none; }
body.viewing .nav { display: inline-flex; }
.nav .ibtn { width: 36px; height: 34px; }
#pos { color: var(--dim); font-size: 12px; font-variant-numeric: tabular-nums; min-width: 44px; text-align: center; white-space: nowrap; }
#pos:empty { display: none; }
.sync { color: var(--faint); font-size: 12px; white-space: nowrap; }
.file { color: var(--faint); font-size: 12px; font-family: ui-monospace, Consolas, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file:empty { display: none; }
.title .file { flex: 0 1 auto; min-width: 0; }
.chip { font-size: 12px; padding: 2px 9px; border-radius: 10px; border: 1px solid var(--line); color: var(--dim); white-space: nowrap; }
.chip:empty { display: none; }
.chip.pending { color: var(--accent2); border-color: var(--accent); }
.chip.rejected { color: #ffc2b9; border-color: var(--bad); }
.chip.approved { color: #bdf0cc; border-color: var(--ok); }
.chip.working { color: #d6ccff; border-color: var(--violet); }

/* the list */
#list { max-width: 1240px; margin: 0 auto; padding: 18px 16px 40px; }
.listbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
#search { flex: 1 1 240px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button { border: 1px solid var(--line); background: var(--panel); color: var(--dim); border-radius: 16px; padding: 5px 12px; cursor: pointer; font-size: 13px; }
.filters button.on { color: var(--text); border-color: var(--accent); background: rgba(240, 167, 66, .12); }
.filters button b { color: var(--faint); font-weight: 500; margin-left: 4px; }
.cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.cards h2 { grid-column: 1 / -1; margin: 14px 0 0; font-size: 12px; color: var(--dim); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.cards h2:first-child { margin-top: 0; }
.cards h5 { grid-column: 1 / -1; margin: 6px 0 -2px; font-size: 13px; color: var(--accent2); font-weight: 600; }
.clipcard .file { margin-top: 1px; }
.clipcard { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px 12px 18px; cursor: pointer; transition: border-color .15s, transform .15s; }
.clipcard:hover { border-color: #4a535d; transform: translateY(-1px); }
.clipcard::before { content: ""; position: absolute; left: 7px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--st, var(--faint)); }
.clipcard.pending { --st: var(--accent); }
.clipcard.rejected { --st: var(--bad); }
.clipcard.approved { --st: var(--ok); }
.clipcard.working { --st: var(--violet); }
.clipcard.library { --st: #4b5a68; }
.clipcard .name { font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.clipcard .name span { color: var(--faint); font-weight: 500; font-size: 12px; }
.clipcard .sub { color: var(--dim); font-size: 13px; margin-top: 3px; }
.clipcard .open { color: var(--pin); font-weight: 600; }
.empty { color: var(--dim); padding: 30px 0; text-align: center; }

/* the viewer */
.viewer { display: grid; grid-template-columns: minmax(0, 1fr) 380px; height: calc(100vh - var(--head)); height: calc(100dvh - var(--head)); }
.rail { display: none; }
@media (min-width: 1280px) {
  .viewer { grid-template-columns: 236px minmax(0, 1fr) 380px; }
  .rail { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: #121417; }
  #railSearch { margin: 10px 10px 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; }
  #railList { overflow-y: auto; padding: 0 6px 16px; }
  .rail h4 { margin: 12px 8px 4px; font-size: 11px; color: var(--faint); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
  .ri { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 8px 6px 14px; border-radius: 8px;
    color: var(--dim); text-decoration: none; font-size: 13px; }
  .ri::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--st, #4b5a68); }
  .ri.pending { --st: var(--accent); } .ri.rejected { --st: var(--bad); } .ri.approved { --st: var(--ok); } .ri.working { --st: var(--violet); }
  .ri span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ri i { font-style: normal; color: var(--faint); font-size: 11px; }
  .ri b { background: var(--pin); color: #fff; font-size: 11px; border-radius: 8px; padding: 0 6px; }
  .ri:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
  .ri.on { background: rgba(240, 167, 66, .16); color: var(--text); }
}
#stage { position: relative; height: 100%; min-height: 320px; overflow: hidden; touch-action: none;
  background: radial-gradient(120% 90% at 50% 30%, #222a32 0%, #12161a 70%); }
#cv { width: 100%; height: 100%; display: block; }
aside.side { overflow-y: auto; border-left: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: 12px; background: #121417; }
.ov { position: absolute; z-index: 3; }
.ov.tl { top: 10px; left: 10px; right: 170px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; pointer-events: none; }
.ov.tl > * { pointer-events: auto; }
.ov.tr { top: 10px; right: 10px; display: flex; gap: 8px; }
#hint { color: var(--dim); font-size: 12px; text-shadow: 0 1px 2px #000; padding: 0 4px; pointer-events: none !important; }
#stage.marking #hint { color: #fff; background: rgba(255, 90, 69, .85); border-radius: 8px; padding: 4px 9px; text-shadow: none; }
#stage.marking { box-shadow: inset 0 0 0 2px var(--pin); cursor: crosshair; }
#loading { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; color: var(--dim); background: rgba(0, 0, 0, .35); z-index: 2; }
#loading.show { display: flex; }
#soundBtn .off { display: none; }
#soundBtn.muted .on { display: none; }
#soundBtn.muted .off { display: block; }
#soundBtn.muted { color: var(--faint); }

/* the phone's frame in the game views */
#frame { position: absolute; pointer-events: none; display: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .5); outline: 1px solid rgba(255, 255, 255, .14); }
#frame.show { display: block; }
.cross { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.cross i { position: absolute; background: rgba(255, 255, 255, .85); }
.cross i:nth-child(1), .cross i:nth-child(2) { width: 2px; height: 8px; left: -1px; }
.cross i:nth-child(1) { top: -13px; } .cross i:nth-child(2) { top: 5px; }
.cross i:nth-child(3), .cross i:nth-child(4) { height: 2px; width: 8px; top: -1px; }
.cross i:nth-child(3) { left: -13px; } .cross i:nth-child(4) { left: 5px; }
.cross b { position: absolute; width: 2px; height: 2px; left: -1px; top: -1px; background: #fff; }

/* pins */
#pins { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.pin { position: absolute; transform: translate(-50%, -100%); background: var(--pin); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 10px 10px 10px 0; padding: 2px 7px; white-space: nowrap; pointer-events: auto; cursor: pointer; opacity: .6; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.pin.now { opacity: 1; box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(0, 0, 0, .4); }
.pin.old { background: #c8781f; }

/* the mark form */
#markform { position: absolute; left: 50%; transform: translateX(-50%); bottom: 104px; width: min(520px, calc(100% - 20px)); z-index: 5;
  padding: 12px; display: grid; gap: 8px; border-color: rgba(255, 90, 69, .6); }
#markform .where { color: var(--dim); font-size: 12px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* transport */
#transport { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 4; padding: 6px 8px 6px; }
#scrub { position: relative; padding: 9px 6px 7px; }
#time { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; margin: 0; background: transparent; cursor: pointer; display: block; }
#time::-webkit-slider-runnable-track { height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--accent) var(--p, 0%), rgba(255, 255, 255, .18) var(--p, 0%)); }
#time::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .18); }
#time::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
#time::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .6); }
#time::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: #fff; }
#ticks, #sticks { position: absolute; left: 14px; right: 14px; height: 8px; pointer-events: none; }
#ticks { top: 2px; }
#sticks { bottom: 0; }
#ticks i { position: absolute; width: 3px; height: 8px; margin-left: -1px; background: var(--pin); border-radius: 1px; }
#sticks i { position: absolute; width: 2px; height: 7px; margin-left: -1px; background: var(--sound); border-radius: 1px; opacity: .9; }
#sticks i.missing { background: var(--faint); }
#sticks i.step { height: 4px; opacity: .55; }
.trow { display: flex; align-items: center; gap: 2px; }
#clock { margin-left: 6px; font-variant-numeric: tabular-nums; color: var(--dim); font-size: 12px; white-space: nowrap; }
.spacer { flex: 1; }

/* the side cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.card:empty { display: none; }
.card h3 { margin: 0 0 10px; font-size: 12px; color: var(--dim); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.cardhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cardhead h3 { margin: 0; }
details.card summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; }
details.card summary::-webkit-details-marker { display: none; }
details.card summary::after { content: "▾"; color: var(--faint); }
details.card[open] summary::after { content: "▴"; }
details.card summary h3 { margin: 0; }
details.card[open] summary { margin-bottom: 10px; }
.form { display: grid; gap: 9px; }
.form label { display: grid; grid-template-columns: 130px minmax(0, 1fr); align-items: center; gap: 8px; color: var(--dim); font-size: 13px; }
.form label.check { display: flex; gap: 8px; color: var(--text); }
.form input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.ver { color: var(--dim); font-size: 13px; }
.vtitle { font-size: 15px; font-weight: 600; margin-bottom: 2px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vtitle .chip { font-weight: 500; }
.note { margin: 8px 0 0; padding: 8px 10px; background: var(--panel2); border-radius: 9px; font-size: 13px; }
.decide-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.decide-row .btn { padding: 10px; }
kbd { display: inline-block; margin-left: 6px; padding: 0 5px; min-width: 18px; border-radius: 5px; font: 600 11px/16px ui-monospace, Consolas, monospace;
  background: rgba(0, 0, 0, .25); border: 1px solid rgba(255, 255, 255, .18); opacity: .8; }
@media (hover: none) { kbd { display: none; } }  /* a phone has no keyboard */
#toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); z-index: 50; max-width: min(560px, calc(100% - 24px));
  padding: 10px 16px; border-radius: 12px; background: #23282e; border: 1px solid var(--line); box-shadow: 0 8px 28px rgba(0, 0, 0, .5);
  font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.approved { border-color: var(--ok); color: #c9f2d6; }
#toast.rejected, #toast.bad { border-color: var(--bad); color: #ffd1ca; }
#toast.warn { border-color: var(--warn); color: #ffe7b0; }
.decision { font-size: 12px; color: var(--dim); padding: 3px 0; }
.decision.approved b { color: var(--ok); } .decision.rejected b { color: var(--bad); }
.mark { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 10px; padding: 9px 0; border-top: 1px solid var(--line); align-items: start; }
.mark:first-child { border-top: 0; padding-top: 0; }
.mark .id { background: var(--pin); color: #fff; font-weight: 700; font-size: 11px; border-radius: 9px 9px 9px 0; padding: 1px 7px; cursor: pointer; margin-top: 2px; }
.mark.done .id { background: var(--faint); }
.mark .meta { color: var(--dim); font-size: 12px; }
.mark.done { opacity: .65; }
.mark .fix { grid-column: 2 / 4; color: #b5f0bd; font-size: 12px; }
.mark .x { border: 0; background: transparent; color: var(--faint); cursor: pointer; padding: 2px 4px; }
.mark .x:hover { color: var(--bad); }
.meta { color: var(--dim); font-size: 13px; }
.chk { padding: 3px 0; font-size: 13px; }
.lvl-fail { color: #ff9a8c; } .lvl-warn { color: var(--warn); } .lvl-info { color: var(--dim); }
.snd { display: grid; grid-template-columns: 44px 1fr auto; gap: 8px; align-items: center; padding: 4px 0; font-size: 13px; }
.snd .t { color: var(--dim); font-variant-numeric: tabular-nums; }
.snd .what small { display: block; color: var(--faint); font-size: 11px; }
.snd.missing .what { color: var(--dim); }
.snd button { border: 0; background: rgba(111, 182, 255, .14); color: var(--sound); border-radius: 8px; padding: 3px 9px; cursor: pointer; }
details summary { cursor: pointer; color: var(--dim); }

/* phone and narrow windows: the stage on top, the cards under it */
@media (max-width: 899px) {
  :root { --head: 48px; }
  header.top { padding: 0 10px; gap: 8px; }
  .back span, .sync, #pos, .title .file { display: none; }
  /* a long Russian name gets two lines; the status moves into the version card */
  header.top .chip { display: none; }
  .title b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 14px; line-height: 1.15; }
  .title b { font-size: 15px; }
  .viewer { display: block; height: auto; }
  #stage { height: 64vh; height: 64dvh; }
  aside.side { border-left: 0; padding: 10px; background: transparent; }
  .ov.tl { right: 10px; top: 56px; }
  .ov.tr { top: 8px; right: 8px; }
  .ov.tl { top: 52px; }
  #clock { margin-left: 2px; }
  #clock .more, #tStart { display: none; }
  .ibtn { width: 36px; height: 36px; }
  .seg#views { flex-wrap: wrap; overflow: visible; }
  .seg#views button { padding: 5px 8px; font-size: 12px; }
  #views button.nofp { opacity: .5; }
.draft { margin: 8px 0 2px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--warn); color: #ffe7b0; background: rgba(255, 190, 80, .08); font-size: 13px; }
.draft a { color: inherit; font-weight: 600; }
  .form label { grid-template-columns: 110px minmax(0, 1fr); }
  #markform { bottom: 96px; }
}
/* a phone held sideways: the stage beside the cards */
@media (max-width: 999px) and (orientation: landscape) and (max-height: 560px) {
  :root { --head: 44px; }
  .viewer { display: grid; grid-template-columns: minmax(0, 1fr) 300px; height: calc(100dvh - var(--head)); }
  #stage { height: 100%; }
  aside.side { border-left: 1px solid var(--line); }
  .ov.tl { top: 8px; right: 150px; }
  #clock .more { display: inline; }
  #markform { bottom: 92px; }
}
