* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  margin: 0; height: 100%;
  background: #000; color: #8a8a8a;
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  overflow: hidden; overscroll-behavior: none;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none; -webkit-text-size-adjust: 100%;
}
body { position: fixed; inset: 0; }

#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#corner { position: fixed; left: 0; top: 0; width: 110px; height: 110px; z-index: 5; touch-action: none; }

button, .filebtn {
  font: inherit; color: #ccc; background: #1c1c1c;
  border: 1px solid #333; border-radius: 12px;
  padding: 10px 16px; cursor: pointer; touch-action: manipulation;
}
button:disabled { opacity: .35; cursor: default; }

/* Startscherm: bewust gedempt, zodat er geen helder beeld is vlak voor de sessie */
.screen {
  position: fixed; inset: 0; z-index: 10; background: #000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  text-align: center;
}
h1 { margin: 0; font-weight: 500; color: #9a9a9a; letter-spacing: .02em; }
.modes { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; width: 100%; max-width: 760px; }
.mode { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 170px; text-align: left; }
.mode span { font-size: 14px; color: #777; }
.mode[aria-pressed="true"] { border-color: #8a6a00; background: #221a00; color: #e0c060; }
#home { justify-content: flex-start; overflow-y: auto; -webkit-overflow-scrolling: touch; }
#home::before, #home::after { content: ""; flex: 1 0 0; }
.info { max-width: 620px; margin: 0; font-size: 15px; line-height: 1.5; color: #8a8a8a; text-align: left; }
.clips select { font-size: 15px; padding: 6px; }
.picks { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.pick { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 10px; min-width: 96px; font-size: 14px; }
.pick[aria-pressed="true"] { border-color: #8a6a00; background: #221a00; color: #e0c060; }
.mode-wrap { display: flex; gap: 6px; align-items: stretch; flex: 1 1 250px; max-width: 360px; }
.mode-wrap .mode { flex: 1; min-width: 0; }
.swatch { width: 22px; height: 22px; border-radius: 50%; display: inline-block; flex: none; }
.mute { font-size: 22px; padding: 0 12px; min-width: 52px; }
.mute[aria-pressed="true"] { background: #2a0e0e; border-color: #6a2020; }
.big { font-size: 26px; padding: 18px 64px; border-radius: 18px; background: #262626; color: #ddd; }
.link { background: none; border: none; color: #777; text-decoration: underline; }
.hint { max-width: 520px; margin: 0; font-size: 14px; color: #666; }
.warn { max-width: 520px; margin: 0; font-size: 14px; color: #d08040; }

/* Instellingen: voor de ouder */
.panel {
  position: fixed; inset: 0; z-index: 20; background: #0e0e0e; color: #ddd;
  overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y;
  padding: max(16px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
}
.panel header {
  position: sticky; top: calc(-1 * max(16px, env(safe-area-inset-top))); z-index: 1;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  background: #0e0e0e; padding: 8px 0 12px; margin: 0 auto; max-width: 760px;
}
.panel h2 { margin: 0; font-weight: 600; }
.actions { display: flex; gap: 10px; }
.primary { background: #3a2e00; border-color: #8a6a00; color: #f0d070; }
.danger { background: #2a0e0e; border-color: #6a2020; color: #f09090; }
.group { max-width: 760px; margin: 0 auto 18px; padding: 16px; background: #161616; border-radius: 16px; display: flex; flex-direction: column; gap: 12px; }
.group h3 { margin: 0; font-size: 18px; color: #f0d070; }
.group h4 { margin: 8px 0 0; font-size: 16px; }
.group label { display: flex; flex-direction: column; gap: 6px; }
.group label.check { flex-direction: row; align-items: center; gap: 10px; }
.group label.color { flex-direction: row; align-items: center; gap: 10px; }
.check input { width: 24px; height: 24px; }
input[type=range] { width: 100%; height: 32px; accent-color: #d0a020; }
input[type=color] { width: 56px; height: 40px; border: none; background: none; padding: 0; }
select { font: inherit; padding: 8px; border-radius: 10px; background: #222; color: #ddd; border: 1px solid #333; }
.row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches button { font-size: 14px; padding: 8px 12px; }
.note { margin: 0; font-size: 14px; color: #888; }
.panel > .note { max-width: 760px; margin: 0 auto; }
#recBtn.rec { background: #3a0e0e; border-color: #a03030; color: #ff9090; }

.clips { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.clips li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 10px; background: #1e1e1e; border-radius: 10px; }
.clips li .name { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.clips li.empty { color: #888; font-size: 14px; }
.clips button { padding: 6px 12px; font-size: 15px; }

.logwrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #262626; white-space: nowrap; }
th { color: #999; font-weight: 500; }

#debug { position: fixed; left: 8px; right: 8px; bottom: max(8px, env(safe-area-inset-bottom)); z-index: 30;
  font: 13px/1.3 ui-monospace, Menlo, monospace; color: #0f0; background: rgba(0,0,0,.7); padding: 6px 8px; border-radius: 8px; pointer-events: none; }

.camvideo { position: fixed; left: 0; top: 0; width: 2px; height: 2px; opacity: 0; pointer-events: none; }
#camPreview, #headPreview { display: block; width: 100%; border-radius: 12px; background: #000; touch-action: none; }
.clips input[type=text] { font: inherit; color: #ddd; background: #262626; border: 1px solid #333; border-radius: 8px; padding: 6px 8px; -webkit-user-select: text; user-select: text; }

.row label + button { align-self: flex-end; }
.row label { flex: 1 1 220px; }
