/* Digimon Evolution Video Maker - the "plum & lavender" dark theme of Digivice Color Modifier (it matches the Crest of
   Kindness logo): its colours, type and controls, and the styles of its Autogenerate Cinematics screen. */
:root {
  color-scheme: dark;
  --bg: #1c1825; --panel: #25202f; --panel2: #2d2738; --line: #362f43; --line2: #453d56;
  --text: #e2dfe9; --muted: #a198b3; --faint: #786f8c;
  --accent: #bc98f9; --accent2: #d1b9fe; --accent-bg: #4f4365; --crest: #fea3fc; --orange: #f4c459; --green: #7bd88f; --red: #f17b7b; --blue: #7fb5ff;
  --radius: 6px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 13px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; overflow: hidden; }
#app { display: flex; flex-direction: column; height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: #322b3f; border: 1px solid #473f58; color: var(--text); border-radius: 5px; padding: 6px 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
button:hover:not(:disabled) { background: #3f374e; }
button:disabled { opacity: .4; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: #262033; font-weight: 650; }
button.primary:hover:not(:disabled) { background: var(--accent2); }
button.danger { color: var(--red); border-color: #6b3b3b; }
button.ghost { background: transparent; border-color: transparent; }
button.ghost:hover:not(:disabled) { background: #352e42; }
button.icon-only { padding: 6px; }
button.small { padding: 3px 8px; font-size: 12px; }
input, select, textarea { background: #1a1623; border: 1px solid #463c57; border-radius: 4px; padding: 6px 8px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9f87cb; outline-offset: -1px; }
input[type=number] { width: 90px; }
input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; }
input.bad { border-color: var(--red); }
.icon { flex-shrink: 0; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.spacer { flex: 1; }
canvas.pic, .pic { image-rendering: pixelated; image-rendering: crisp-edges; }
a { color: var(--accent2); }


/* top bar */
.topbar { height: 48px; flex-shrink: 0; display: flex; align-items: center; gap: 4px; padding: 0 10px; background: #292333; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 7px; margin-right: 10px; cursor: pointer; flex-shrink: 0; }
.brand-logo { width: 32px; height: 32px; display: block; filter: drop-shadow(0 0 6px #fea3fc40); }
.brand-name { font-size: 14px; font-weight: 800; letter-spacing: .2px; white-space: nowrap; background: linear-gradient(90deg, var(--crest), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.topbar .sep { width: 1px; height: 22px; background: var(--line2); margin: 0 6px; }

/* body */
.body { flex: 1; display: flex; min-height: 0; }
.center { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.workspace { flex: 1; min-height: 0; position: relative; }
.ws { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; }
.ws[hidden] { display: none; }
.ws-header { display: flex; align-items: center; gap: 12px; padding: 12px 18px 10px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.ws-header h1 { font-size: 18px; margin: 0; font-weight: 700; }
.ws-sub { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.ws-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ws-layout { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 360px; min-height: 0; }
.ws-main { overflow: auto; padding: 14px 18px 40px; min-width: 0; }
.ws-inspector { border-left: 1px solid var(--line); background: var(--panel); overflow-y: auto; padding: 12px 14px 40px; }
.ws-inspector h2 { font-size: 15px; margin: 2px 0 10px; display: flex; align-items: center; gap: 10px; }
.error-box { margin: 20px; padding: 14px; border: 1px solid #6b3b3b; background: #3a2428; border-radius: 8px; }

/* statusbar */
.statusbar { height: 28px; flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding: 0 10px; border-top: 1px solid var(--line); background: #231e2d; font-size: 12px; color: var(--muted); }

/* dropping files */
.drop-hover { box-shadow: 0 0 0 2px var(--accent2), 0 0 16px #bc98f9aa !important; background: #453a59 !important; }

/* fields */
.field { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.field-label { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.field-label small { color: var(--faint); }
.field-input { display: flex; align-items: center; gap: 8px; }
.field.changed > .field-label, .check.changed span { color: var(--orange); }
.field.changed input { border-color: #8c752e; }
.revert { padding: 1px 4px; background: transparent; border: 0; color: var(--orange); }
.check { display: flex; align-items: center; gap: 8px; margin: 8px 0; cursor: pointer; }
.toggles { display: flex; flex-wrap: wrap; gap: 0; }
.toggle { border-radius: 0; margin-left: -1px; padding: 5px 10px; font-size: 12px; }
.toggle:first-child { border-radius: 5px 0 0 5px; margin-left: 0; }
.toggle:last-child { border-radius: 0 5px 5px 0; }
.toggle.on { background: var(--accent-bg); border-color: #9680bf; color: #d8c6fe; position: relative; z-index: 1; }
.toggle:disabled { opacity: .4; cursor: not-allowed; }
.toggle.on:disabled { opacity: .75; }
.note-box { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 6px; margin: 8px 0; font-size: 12px; line-height: 1.5; }
.note-box.info { background: #2c243c; border: 1px solid #34405e; color: #dacff3; }
.note-box.warn { background: #3a2a22; border: 1px solid #6d532c; color: #f8ddae; }
.note-box.ok { background: #1f3326; border: 1px solid #2f6b44; color: #c9f2d6; }
.note-box .icon { margin-top: 1px; }

/* modal, picker, menus, toasts */
dialog.modal { background: var(--panel); color: var(--text); border: 1px solid var(--line2); border-radius: 10px; padding: 0; width: min(560px, calc(100vw - 30px)); max-height: calc(100vh - 40px); box-shadow: 0 20px 60px #000000aa; }
dialog.modal.wide { width: min(980px, calc(100vw - 30px)); }
dialog.modal::backdrop { background: #00000099; }
dialog.modal > header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
dialog.modal > header h2 { margin: 0; font-size: 16px; }
.modal-body { padding: 14px; overflow: auto; max-height: calc(100vh - 170px); }
dialog.modal > footer { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }
.ctx-menu { position: fixed; z-index: 1000; min-width: 210px; background: #2a2336; border: 1px solid #5a516d; border-radius: 7px; padding: 4px; box-shadow: 0 8px 28px #00000099; }
.ctx-menu button { display: flex; width: 100%; border: 0; background: none; padding: 7px 8px; justify-content: flex-start; }
.ctx-menu button:hover:not(:disabled) { background: #5d4f77; }
.ctx-menu button.danger { color: var(--red); }
.ctx-menu .sep { height: 1px; background: #453b57; margin: 4px 3px; }
.toasts { position: fixed; right: 16px; bottom: 40px; display: flex; flex-direction: column; gap: 8px; z-index: 2000; }
.toast { display: flex; gap: 8px; align-items: center; background: #2e273b; border: 1px solid #4d4360; border-radius: 8px; padding: 9px 12px; max-width: 420px; box-shadow: 0 8px 24px #00000088; transition: opacity .3s, transform .3s; }
.toast.ok { border-color: #3c6b4a; }
.toast.error { border-color: #7a3b3b; background: #3a2528; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* rows of buttons */
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0; }

/* (1.46) Autogenerate Cinematics */
.cine-slots { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; margin: 8px 0 16px; }
.cine-slot { border: 2px dashed var(--border, #444); border-radius: 10px; padding: 10px 12px; min-height: 150px; display: flex; flex-direction: column; gap: 6px; }
.cine-slot.full { border-style: solid; }
.cine-slot h3 { margin: 0; font-size: 15px; }
.cine-slot p { margin: 0; }
.cine-files { margin: 0; padding-left: 16px; font-size: 12px; max-height: 90px; overflow: auto; word-break: break-all; }
.cine-schemes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
.cine-scheme { display: flex; align-items: center; gap: 6px; justify-content: flex-start; padding: 4px 6px; font-size: 12px; }
.cine-scheme.on { outline: 2px solid var(--accent, #6af); }
.cine-scheme .swatch { width: 16px; height: 16px; border-radius: 4px; display: inline-block; }
.cine-busy { margin: 10px 0; }
.cine-progress { width: 100%; }
.cine-live { display: block; margin-top: 6px; max-width: 100%; border-radius: 4px; }
.cine-results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cine-results h2 { display: flex; align-items: center; gap: 8px; }
.cine-hint { font-size: 12px; margin: 4px 0 2px; }
.cine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(392px, 1fr)); gap: 14px; }
.cine-still { margin: 0; }
.cine-pic { width: 384px; height: 256px; display: block; border-radius: 4px; background: #000; }
.cine-px { image-rendering: pixelated; }
.cine-still figcaption { font-size: 12px; margin: 4px 0; }
.cine-adjust { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.cine-adjust select { max-width: 220px; font-size: 12px; }
.cine-adjust input[type=range] { width: 140px; }
.cine-video { width: 100%; max-width: 960px; border-radius: 6px; background: #000; }
.cine-info { font-size: 11px; opacity: 0.8; word-break: break-word; }
.cine-main { display: flex; flex-direction: column; gap: 2px; font-size: 11px; margin: 4px 0; }
.cine-main select { font-size: 11px; max-width: 100%; }
/* (1.50) a Digimon from the DSTS viewer, the video alone, one download */
.cine-dsts { position: relative; display: flex; flex-direction: column; gap: 2px; }
.cine-dsts-label { font-size: 11px; color: var(--muted); }
.cine-dsts-in { width: 100%; box-sizing: border-box; font-size: 12px; padding: 5px 8px; border-radius: 5px; border: 1px solid var(--line2); background: var(--panel2); color: var(--text); }
.cine-dsts-in:focus { outline: none; border-color: var(--accent); }
.cine-dsts-list { position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 30; margin: 0; padding: 3px 0; list-style: none; max-height: 260px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line2); border-radius: 6px; box-shadow: 0 8px 24px #0008; }
.cine-dsts-list li { padding: 4px 9px; font-size: 12px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cine-dsts-list li.on, .cine-dsts-list li:hover { background: var(--accent-bg); }
.cine-dsts-list li.cine-dsts-none { color: var(--muted); cursor: default; background: none; }
.cine-dsts-no { color: var(--faint); font-variant-numeric: tabular-nums; margin-right: 6px; }
.cine-dl { font-size: 11px; margin: 0; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.cine-dl.ok { color: var(--green); }
.cine-dl.bad { display: block; color: var(--red); }
.cine-dl.bad p { margin: 0 0 2px; }
.cine-or { font-size: 11px; text-align: center; }
.cine-dl-all { margin-top: 10px; width: 100%; justify-content: center; }
.cine-results .cine-live { width: 100%; max-width: 960px; height: auto; aspect-ratio: 16 / 9; background: #000; border-radius: 6px; }

/* (1.56.0) Autogenerate Cinematics, Images: the pictures as they are made */
.cine-pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 10px; margin-top: 6px; }
.cine-pics figure { margin: 0; }
.cine-pics canvas { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; image-rendering: pixelated; border-radius: 4px; background: #000; }
.cine-pics figcaption { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* (1.56.1) Autogenerate Cinematics: what to make, two big choices at the top of the bar */
.cine-make { margin: 0 0 14px; padding: 12px; border: 1px solid var(--accent); border-radius: 12px; background: linear-gradient(180deg, rgba(188, 152, 249, .16), rgba(188, 152, 249, .05)); box-shadow: 0 0 0 3px rgba(188, 152, 249, .08); }
.cine-make-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 750; color: var(--accent2, #d1b9fe); margin-bottom: 10px; }
.cine-mode { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.cine-mode-opt { display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; height: auto; box-sizing: border-box; white-space: normal; text-align: left; padding: 12px 14px; border-radius: 10px; border: 2px solid var(--line, #362f43); background: var(--panel2, rgba(255, 255, 255, .03)); color: var(--text); cursor: pointer; transition: border-color .15s, background .15s; }
.cine-mode-opt:hover:not(:disabled) { border-color: var(--accent); }
.cine-mode-opt.on { border-color: var(--accent); background: var(--accent-bg, #4f4365); box-shadow: 0 0 0 2px rgba(188, 152, 249, .35); }
.cine-mode-opt .cine-mode-ico { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(188, 152, 249, .18); color: var(--accent2, #d1b9fe); }
.cine-mode-opt.on .cine-mode-ico { background: var(--accent); color: #262033; }
.cine-mode-opt .cine-mode-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cine-mode-opt .cine-mode-text b { font-size: 14px; line-height: 1.25; overflow-wrap: anywhere; }
.cine-mode-opt .cine-mode-text small { font-size: 12px; line-height: 1.3; color: var(--muted); overflow-wrap: anywhere; }
.cine-mode-opt.on .cine-mode-text small { color: var(--text); opacity: .85; }
.cine-make .cine-hint { margin: 10px 0 0; }

/* ---------- the maker's own page ---------- */
.about-btn { color: var(--accent2); }
.about-btn:hover:not(:disabled) { background: #bc98f91f; }
.statusbar .spacer { flex: 1; }
.status-note { color: var(--faint); }
.status-version { color: var(--faint); }
.about { line-height: 1.5; }
.about p { margin: 0 0 10px; }
.about ol { margin: 0 0 10px; padding-left: 20px; }
.about li { margin-bottom: 6px; }
.about code { background: #16121d; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; font-size: 12px; }
.about-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.about-head b { font-size: 16px; background: linear-gradient(90deg, var(--crest), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
/* narrower windows: the settings go under the cards, the cards two by two */
@media (max-width: 980px) {
  html, body { height: auto; overflow: visible; }
  #app { height: auto; min-height: 100vh; }
  .body, .center, .workspace, .ws, .ws-layout, .ws-main, .ws-inspector { display: block; position: static; overflow: visible; height: auto; min-height: 0; }
  .topbar { position: sticky; top: 0; z-index: 50; }
  .ws-inspector { border-left: 0; border-top: 1px solid var(--line); }
  .cine-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-note { display: none; }
}
@media (max-width: 520px) {
  .cine-slots { grid-template-columns: minmax(0, 1fr); }
  .brand-name { font-size: 13px; }
  .about-btn span { display: none; }
}
