/* De Ward PWA: rustig, groot genoeg voor een kind, donker als de rest. */
:root {
  --bg: #141a24;
  --card: #1c2431;
  --ink: #eef2f8;
  --dim: #9aa7bb;
  --accent: #5a32e6;
  --alarm: #ef9f27;
  --ok: #46c26a;
}
* { box-sizing: border-box; }
body {
  margin: 0; padding: 16px calc(16px + env(safe-area-inset-right)) 32px calc(16px + env(safe-area-inset-left));
  background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
h1 { font-size: 1.4rem; margin: 8px 0 20px; }
h2 { font-size: 1rem; margin: 24px 0 10px; color: var(--dim); font-weight: 600; }

/* De hulpknop is het belangrijkste element op deze pagina en ziet er ook zo
   uit: vol breed, grote raakzone, geen concurrentie eromheen. */
.help button {
  width: 100%; padding: 18px; border: 0; border-radius: 14px;
  background: var(--accent); color: #fff; font-size: 1.1rem; font-weight: 600;
}
.help button:disabled { background: #3a3f4d; color: var(--dim); }
.help .hint { margin: 8px 2px 0; color: var(--dim); font-size: .85rem; }

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.card { background: var(--card); border-radius: 12px; padding: 12px 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.name { font-weight: 600; margin: 0; }
.hint { color: var(--dim); font-size: .85rem; margin: 6px 0 0; }
.empty { color: var(--dim); }

.chip { margin-left: auto; font-size: .75rem; padding: 3px 9px; border-radius: 999px; background: #2a3342; color: var(--dim); }
.chip.ok { background: rgba(70,194,106,.16); color: var(--ok); }
.chip.away { background: rgba(239,159,39,.16); color: var(--alarm); }

/* Misvormd krijgt de alarmkleur, onbereikbaar bewust NIET: niet-weten is geen
   misconfiguratie. Maar het is ook geen goedkeuring, dus het staat er wel. */
.note { margin: 8px 0 0; font-size: .85rem; padding: 6px 9px; border-radius: 8px; }
.note.alarm { background: rgba(239,159,39,.16); color: var(--alarm); }
.note.unknown { background: rgba(154,167,187,.14); color: var(--dim); }

/* ── De feed ──────────────────────────────────────────────────────────── */
.cards { display: grid; gap: 12px; }
.post { background: var(--card); border-radius: 12px; padding: 12px 14px; border: 2px solid transparent; }
.post .avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.post .when { margin-left: auto; color: var(--dim); font-size: .8rem; }
.post .cw { color: var(--alarm); font-size: .85rem; margin: 6px 0 0; }
.post .body { margin-top: 8px; overflow-wrap: anywhere; }
.post .body img, .post .body video { max-width: 100%; height: auto; border-radius: 8px; }
/* Waar de boei zou landen. Zichtbaar oplichten, want mikken met een vinger
   zonder terugkoppeling is gokken. */
.post.hover { border-color: var(--accent); }

/* ── De reddingsboei ──────────────────────────────────────────────────── */
#buoy {
  position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom));
  width: 76px; height: 76px; border: 0; border-radius: 50%;
  background: transparent; font-size: 52px; line-height: 1;
  /* Zonder dit vecht slepen met scrollen en verlies je hem halverwege. */
  touch-action: none; cursor: grab; z-index: 50;
}
#buoy.dragging { cursor: grabbing; transform: scale(1.1); }

dialog#help-dialog {
  border: 0; border-radius: 16px; padding: 18px; max-width: 420px; width: calc(100% - 32px);
  background: var(--card); color: var(--ink);
}
dialog#help-dialog::backdrop { background: rgba(0,0,0,.5); }
dialog#help-dialog h2 { margin: 0 0 10px; font-size: 1.05rem; color: var(--ink); }
dialog#help-dialog label { display: block; color: var(--dim); font-size: .85rem; margin-bottom: 4px; }
dialog#help-dialog textarea {
  width: 100%; border-radius: 10px; border: 1px solid #2a3342;
  background: #131a25; color: var(--ink); padding: 8px; font: inherit;
}
dialog#help-dialog menu { display: flex; gap: 8px; justify-content: flex-end; margin: 14px 0 0; padding: 0; }
dialog#help-dialog button { border: 0; border-radius: 10px; padding: 10px 14px; background: #2a3342; color: var(--ink); font: inherit; }
dialog#help-dialog button.primary { background: var(--accent); color: #fff; font-weight: 600; }

/* Voor schermlezers, niet voor het oog. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── De hemel ─────────────────────────────────────────────────────────── */
/* Ligt achter alles en draait altijd. In kaartenstand is hij decor; in
   berichtenstand vallen de kaarten weg en is hij de interface. */
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
#app { position: relative; z-index: 1; }
.topbar { display: flex; align-items: center; gap: 12px; }
.topbar h1 { margin: 8px 0 20px; }
.topbar #mode {
  margin-left: auto; border: 0; border-radius: 999px; padding: 8px 16px;
  background: #2a3342; color: var(--ink); font: inherit;
}
/* De kaarten vallen weg, de hemel blijft: dezelfde beweging als in de app. */
body.messages-mode .help, body.messages-mode .cards { display: none; }

/* ── De zwaai-hand ────────────────────────────────────────────────────── */
/* Zelfde hoek als de boei; ze wisselen elkaar af met de stand. */
#hand {
  position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom));
  width: 76px; height: 76px; border: 0; border-radius: 50%;
  background: transparent; font-size: 52px; line-height: 1;
  touch-action: none; cursor: grab; z-index: 50;
}
#hand.dragging { cursor: grabbing; transform: scale(1.1); }

/* ── Het gesprek over de hemel ────────────────────────────────────────── */
#thread {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column;
  /* Doorschijnend: de hemel eronder blijft zichtbaar draaien, net als de
     glazen bubbels in de app. */
  background: rgba(20, 26, 36, .72); backdrop-filter: blur(14px);
}
#thread header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
#thread header h2 { margin: 0; font-size: 1.05rem; }
#thread-close { border: 0; background: #2a3342; color: var(--ink); border-radius: 10px; padding: 8px 12px; font-size: 1rem; }
#thread-list { flex: 1; overflow-y: auto; padding: 8px 16px; display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 78%; padding: 10px 12px; border-radius: 14px; background: var(--card); }
.bubble.out { align-self: flex-end; background: var(--accent); }
.bubble.wave { font-size: 1.4rem; }
.bubble .when { display: block; margin-top: 4px; font-size: .7rem; color: rgba(255,255,255,.55); }
.bubble .body img { max-width: 100%; border-radius: 8px; }
#thread-form { display: flex; gap: 8px; padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); }
#thread-form input {
  flex: 1; border-radius: 999px; border: 1px solid #2a3342;
  background: #131a25; color: var(--ink); padding: 10px 16px; font: inherit;
}
#thread-form button { border: 0; border-radius: 999px; padding: 10px 18px; background: var(--accent); color: #fff; font: inherit; font-weight: 600; }

/* ── Het zwaai-paneel ─────────────────────────────────────────────────── */
dialog#wave-dialog {
  border: 0; border-radius: 16px; padding: 18px; max-width: 320px; width: calc(100% - 48px);
  background: var(--card); color: var(--ink); text-align: center;
}
dialog#wave-dialog::backdrop { background: rgba(0,0,0,.4); }
dialog#wave-dialog h2 { margin: 0 0 12px; font-size: 1.05rem; }
.wave-answers { display: grid; gap: 8px; }
.wave-answers button { border: 0; border-radius: 10px; padding: 12px; background: var(--accent); color: #fff; font: inherit; font-weight: 600; }
#wave-cancel { margin-top: 10px; border: 0; background: none; color: var(--dim); font: inherit; }
