* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #f1f5f9;
  color: #0f172a;
}

/* ===== kopbalk: klok, dagteller, knoppen ===== */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: #1e293b;
  color: #f8fafc;
}
.topbar h1 { font-size: 18px; margin: 0 10px 0 0; font-weight: 700; }
#clock {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 22px;
  font-weight: 700;
  background: #0f172a;
  padding: 4px 12px;
  border-radius: 6px;
  min-width: 84px;
  text-align: center;
}
#day { font-size: 16px; font-weight: 600; }
.controls { display: flex; gap: 8px; margin-left: auto; }
.tbtn {
  padding: 7px 16px;
  border: 1px solid #64748b;
  border-radius: 6px;
  background: #334155;
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.tbtn:hover { background: #475569; }
.tbtn.active {
  background: #f59e0b;
  border-color: #fbbf24;
  color: #1e293b;
  font-weight: 800;
  box-shadow: inset 0 0 0 2px #fde68a;
}

/* ===== twee kolommen ===== */
.columns {
  display: flex;
  gap: 14px;
  padding: 14px;
  align-items: flex-start;
}
/* smalle weergave: panelen stapelen — huis boven, dagboek direct daaronder */
@media (max-width: 800px) {
  .columns {
    flex-direction: column;
    align-items: stretch;
  }
  .scene-col { flex: none; width: 100%; }
  .diary-col { width: 100%; }
  #diary { height: 320px; }
}
.scene-col { flex: 0 0 62%; min-width: 0; }
.diary-col { flex: 1 1 auto; min-width: 260px; }
#scene {
  display: block;
  width: 100%;
  height: auto;
  background: #f8fafc;
  border: 2px solid #334155;
  border-radius: 10px;
}

/* kamerlabels */
.room-label { font-size: 14px; font-weight: 700; fill: #334155; }
.room-label-small { font-size: 10px; font-weight: 700; fill: #475569; }
.bubble-text { font-size: 12px; fill: #475569; text-anchor: middle; font-family: monospace; }

/* televisie: data-attribuut stuurt het zichtbare aan/uit effect */
#tv-screen { fill: #1e293b; }
#tv-glow { opacity: 0; }
#tv-sound { opacity: 0; }
#scene[data-tv="aan"] #tv-screen { fill: #bae6fd; }
#scene[data-tv="aan"] #tv-glow { opacity: 0.35; }
#scene[data-tv="aan"] #tv-sound { opacity: 1; }

/* ===== dagboekpaneel ===== */
#diary-col h2 { margin: 0 0 8px; font-size: 18px; }
#diary {
  height: 500px;
  overflow-y: auto;
  background: #fffbeb;
  border: 2px solid #d4c9a8;
  border-radius: 10px;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  line-height: 1.7;
}
#diary-text { margin: 0; white-space: pre-wrap; word-break: break-word; }
#diary-caret {
  display: inline-block;
  width: 9px;
  height: 16px;
  background: #334155;
  vertical-align: middle;
  animation: caret-blink 1s steps(1) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }
