/*
  poster.maavis.nl – vormgeving
  Donker, rustig vlak zodat de kleuren van het beeld het woord voeren.
  Roze accent voor video, paars voor afbeelding.
*/
:root {
  color-scheme: dark;
  --bg: #0d0d0c;
  --podium: #141413;
  --kaart: #191918;
  --vlak: #232321;
  --lijn: #2e2e2b;
  --ink: #f1f0ec;
  --tekst: #d6d4cc;
  --zacht: #a3a29b;
  --roze: #ff2d84;
  --paars: #a07cff;
  --accent: var(--roze);
  --accent-knop: #d1005f;
  --accent-vlak: #2a1520;
  --r: 20px;
}
body[data-mode=image] {
  --accent: var(--paars);
  --accent-knop: #6f42c1;
  --accent-vlak: #1f1830;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.4 "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
button:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
.zacht { color: var(--zacht); }
.klein { margin: 0; font-size: 12px; color: var(--zacht); }

.app {
  height: 100dvh;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 12px;
}
.werk {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 44px minmax(0, 1fr) 96px;
  gap: 12px;
}

/* ---------- kop ---------- */
.kop { display: flex; align-items: center; gap: 8px; padding: 0 4px; min-width: 0; }
.merk { font-size: 16px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.merk span { color: var(--zacht); }
.vul { flex: 1; }
.tip {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px;
  border-radius: 999px; background: var(--kaart); font-size: 12.5px; color: var(--zacht);
  white-space: nowrap; overflow: hidden;
}
.tip svg { width: 15px; height: 15px; }
.pil { height: 32px; padding: 0 12px; border-radius: 999px; border: 0; background: var(--kaart); color: var(--tekst); font-size: 12.5px; }
.pil.aan { background: var(--accent-knop); color: #fff; }
.rond { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--kaart); color: var(--tekst); font-weight: 600; }

/* ---------- podium ---------- */
.podium {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border-radius: var(--r);
  background: var(--podium);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.podium.heeft-bron { cursor: move; }
.beeld { position: absolute; display: block; }

.kader {
  position: absolute;
  box-shadow: 0 0 0 6000px rgba(13, 13, 12, .62);
  outline: 1.5px solid rgba(255, 255, 255, .85);
  will-change: transform;
}
.kader canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.steel { position: absolute; left: 50%; top: -30px; width: 1.5px; height: 30px; margin-left: -.75px; background: rgba(255, 255, 255, .85); pointer-events: none; }
.greep {
  position: absolute; width: 14px; height: 14px; padding: 0;
  border-radius: 3px; border: 2px solid var(--accent); background: #fff;
  touch-action: none;
}
.greep::after { content: ""; position: absolute; inset: -10px; } /* groter raakvlak */
.greep.lb { left: -8px; top: -8px; cursor: nwse-resize; }
.greep.rb { right: -8px; top: -8px; cursor: nesw-resize; }
.greep.lo { left: -8px; bottom: -8px; cursor: nesw-resize; }
.greep.ro { right: -8px; bottom: -8px; cursor: nwse-resize; }
.greep.draai { left: calc(50% - 8px); top: -44px; width: 16px; height: 16px; border-radius: 50%; cursor: grab; }

.leeg {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px;
  text-align: center; padding: 24px; cursor: default;
}
.leeg .groot { margin: 0; font-size: 20px; font-weight: 500; color: var(--tekst); }
.leeg .rij { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.kies { height: 40px; padding: 0 18px; border-radius: 12px; border: 0; background: #d1005f; color: #fff; font-weight: 600; }
.kies.paars { background: #6f42c1; }

.chip {
  position: absolute; top: 14px; display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px; border-radius: 999px; background: var(--kaart);
  font-size: 12px; color: var(--tekst); font-variant-numeric: tabular-nums; pointer-events: none;
}
.chip.links { left: 16px; }
.chip.rechts { right: 16px; }
.chip.links::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.chip.let-op { color: #f0a040; }
.aanwijzing { position: absolute; right: 16px; bottom: 14px; font-size: 12px; color: var(--zacht); pointer-events: none; text-shadow: 0 1px 2px #000; }

.sleepvlak {
  position: absolute; inset: 10px; display: grid; place-items: center; border-radius: 14px;
  border: 2px dashed var(--accent); background: rgba(13, 13, 12, .7); font-size: 18px; font-weight: 600;
  pointer-events: none; z-index: 5;
}
.melding {
  position: absolute; left: 50%; bottom: 44px; translate: -50% 8px; max-width: 80%;
  padding: 10px 16px; border-radius: 12px; background: var(--vlak); color: var(--ink);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4); font-size: 13px;
  opacity: 0; pointer-events: none; transition: opacity .2s, translate .2s; z-index: 6;
}
.melding.zichtbaar { opacity: 1; translate: -50% 0; }

/* ---------- transport ---------- */
.transport {
  display: flex; align-items: center; gap: 10px; padding: 0 14px; min-width: 0;
  background: var(--kaart); border-radius: 16px;
}
.speel { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 0; background: var(--accent-knop); color: #fff; display: grid; place-items: center; }
.speel svg { fill: currentColor; stroke: none; }
.speel .icoon-pauze { display: none; }
.speel.speelt .icoon-speel { display: none; }
.speel.speelt .icoon-pauze { display: block; }
.stap { width: 32px; height: 32px; flex: none; border-radius: 50%; border: 0; background: var(--vlak); color: var(--tekst); display: grid; place-items: center; }
.stap svg { stroke-width: 2.4; }
.strip { position: relative; flex: 1; min-width: 0; height: 58px; touch-action: none; cursor: pointer; }
.strip[aria-disabled=true] { cursor: default; }
.duimen { display: flex; gap: 4px; height: 100%; }
.duimen canvas { flex: 1; min-width: 0; height: 100%; border-radius: 6px; background: var(--vlak); object-fit: cover; display: block; }
.stripinfo { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12.5px; color: var(--zacht); pointer-events: none; }
.afspeelkop { position: absolute; top: -6px; bottom: -6px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 0 1px rgba(0,0,0,.35); pointer-events: none; }
.tijd { flex: none; display: grid; justify-items: end; font-size: 13px; line-height: 1.4; font-variant-numeric: tabular-nums; min-width: 120px; }
.tijd .zacht { font-size: 12px; }

/* ---------- paneel ---------- */
.paneel { min-height: 0; display: flex; flex-direction: column; background: var(--kaart); border-radius: var(--r); overflow: hidden; }
.paneel-inhoud { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; padding: 16px 16px 10px; display: flex; flex-direction: column; gap: 16px; }
.sectie { display: flex; flex-direction: column; gap: 6px; }
.sectie h2 { margin: 0 0 2px; font-size: 11px; font-weight: 600; letter-spacing: .08em; color: var(--zacht); }

.bronknop {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; min-width: 0;
  border-radius: 10px; border: 1px solid var(--lijn); background: var(--vlak); text-align: left;
}
.bronknop b { font-size: 13px; font-weight: 600; flex: none; }
.bronknop .naam { font-size: 12px; color: var(--zacht); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bronknop.actief { border-color: var(--accent); background: var(--accent-vlak); }
.stip { width: 8px; height: 8px; border-radius: 50%; background: var(--roze); flex: none; }
.stip.paars { background: var(--paars); }

.veldrij { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 10px; font-size: 12.5px; color: var(--tekst); }
.veld { width: 100%; height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--lijn); background: var(--vlak); color: var(--ink); font: inherit; font-size: 13px; }
.veld:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.veld:disabled { opacity: .5; }

.knoppen { display: flex; gap: 6px; }
.knop {
  flex: 1; height: 30px; border-radius: 8px; border: 0; background: var(--vlak); color: var(--tekst);
  font-size: 12.5px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 8px;
}
.knop svg { width: 15px; height: 15px; }
.knop.accent { border: 1px solid var(--accent); background: var(--accent-vlak); color: var(--ink); font-weight: 600; }
.sectie .knoppen { margin-bottom: 6px; }

.schuiven { display: flex; flex-direction: column; gap: 2px; }
.schuif { display: grid; grid-template-columns: 84px minmax(0, 1fr) 42px; align-items: center; gap: 10px; height: 26px; font-size: 12.5px; color: var(--tekst); }
.schuif output { text-align: right; font-variant-numeric: tabular-nums; color: var(--zacht); }
.schuif.gewijzigd output { color: #ff7ab0; }
body[data-mode=image] .schuif.gewijzigd output { color: #c3a8ff; }
.rng { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 4px; background: #3a3a37; margin: 0; cursor: pointer; }
.rng:disabled { cursor: default; opacity: .5; }
.rng::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); border: 2px solid var(--accent); }
.rng::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); border: 2px solid var(--accent); }
.rng.temp { background: linear-gradient(90deg, #6fb3e8, #d9d7cf 50%, #f0a040); }

.voet { flex: none; padding: 12px 16px 16px; border-top: 1px solid var(--lijn); }
.voetrij { display: flex; gap: 8px; }
.opslaan {
  flex: 1; height: 44px; border-radius: 12px; border: 0; background: var(--accent-knop); color: #fff;
  font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.opslaan svg { width: 18px; height: 18px; }
.mapknop { width: 44px; height: 44px; flex: none; border-radius: 12px; border: 0; background: var(--vlak); color: var(--tekst); display: grid; place-items: center; }
.mapknop.aan { color: var(--accent); }
.mapnaam { margin: 8px 0 0; font-size: 12px; color: var(--zacht); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.verborgen { position: fixed; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.verborgen video { width: 1px; height: 1px; }

/* ---------- hulp ---------- */
.hulpvenster {
  border: 0; border-radius: var(--r); padding: 24px; width: min(460px, 92vw);
  background: var(--kaart); color: var(--ink); box-shadow: 0 24px 64px rgba(0, 0, 0, .6);
}
.hulpvenster::backdrop { background: rgba(0, 0, 0, .55); }
.hulpvenster h2 { margin: 0 0 14px; font-size: 18px; }
.hulpvenster dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 18px; font-size: 13px; }
.hulpvenster dt { color: var(--ink); font-weight: 600; }
.hulpvenster dd { margin: 0; color: var(--tekst); }
.hulpvenster .knop { width: 100%; height: 36px; }

/* smalle schermen: paneel onder het beeld */
@media (max-width: 900px) {
  body { overflow: auto; }
  .app { height: auto; grid-template-columns: minmax(0, 1fr); }
  .werk { grid-template-rows: 44px 62vh 96px; }
  .tip { display: none; }
}
