:root {
  --bg: #FBF8F6;
  --navy: #26303A;
  --me: #26303A;
  --orange: #C62A35;
  --peach: #FBEAE9;
  --chip: #F8E3E2;
  --muted: #69737E;
  --white: #FFFFFF;
  --green: #2FBF62;
  --check: #5B8DEF;
  --shadow: 0 6px 24px rgba(38, 48, 58, 0.07);
  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
}
*, *::before, *::after { box-sizing: inherit; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--navy);
  font-family: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 1.05rem;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  max-width: 34rem;
  margin: 0 auto;
}

/* ---------- Kop ---------- */
.top { display: flex; align-items: center; gap: 0.9rem; padding: 1rem 1.1rem 0.8rem; }
.top img { width: 3.6rem; height: 3.6rem; border-radius: 50%; object-fit: cover; }
.top h1 { margin: 0; font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.status { display: flex; align-items: center; gap: 0.45rem; color: var(--muted); font-weight: 600; font-size: 0.95rem; }
.status::before { content: ""; flex: none; width: 0.65rem; height: 0.65rem; border-radius: 50%; background: var(--green); }

/* ---------- Scrollgebied ---------- */
main { flex: 1; overflow-y: auto; padding: 0 0.9rem 1rem; }

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 13.5rem;
  background: linear-gradient(180deg, #FBEDEC, #FDF1EF);
  border-radius: 1.4rem;
  overflow: hidden;
  margin-bottom: 1.4rem;
}
.hero .text { position: relative; z-index: 1; padding: 1.4rem 0 1.4rem 1.3rem; width: 52%; }
.hero h2 { margin: 0; font-size: clamp(1.9rem, 8.5vw, 2.6rem); font-weight: 900; letter-spacing: -0.03em; line-height: 1.02; }
.hero p { margin: 0.6rem 0 0; color: #47525E; font-weight: 600; font-size: 1rem; }
.hero img {
  position: absolute; right: 0; bottom: 0;
  height: 100%; width: auto; max-width: 54%;
  object-fit: cover; object-position: left bottom;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 5%);
  mask-image: linear-gradient(90deg, transparent 0, #000 5%);
}

/* ---------- Berichten ---------- */
.log { display: flex; flex-direction: column; gap: 1.1rem; }
.row { display: flex; gap: 0.7rem; align-items: flex-start; }
.row.me { justify-content: flex-end; }
.row > img { width: 2.6rem; height: 2.6rem; border-radius: 50%; object-fit: cover; flex: none; }
.col { display: flex; flex-direction: column; max-width: 78%; }
.row.me .col { align-items: flex-end; }
.bubble {
  padding: 0.85em 1.1em;
  border-radius: 1.4em;
  font-weight: 600;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.remco .bubble { background: var(--white); box-shadow: var(--shadow); border-top-left-radius: 0.5em; }
.me .bubble { background: var(--me); color: var(--white); border-bottom-right-radius: 0.5em; }
.time { margin-top: 0.35rem; font-size: 0.8rem; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 0.3rem; padding: 0 0.4rem; }
.time svg { width: 1.1rem; height: 1.1rem; color: var(--check); }
.note { align-self: center; text-align: center; color: var(--muted); font-size: 0.9rem; font-weight: 600; max-width: 30ch; }

.dots { display: inline-flex; gap: 0.3rem; padding: 0.2em 0; }
.dots i { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--muted); opacity: 0.4; animation: dot 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 0.9; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .dots i { animation: none; opacity: 0.6; } }

/* ---------- Onderkant ---------- */
.bottom { padding: 0.6rem 0.9rem calc(0.5rem + env(safe-area-inset-bottom, 0px)); background: var(--bg); }


form {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--white); border-radius: 1.6rem; box-shadow: var(--shadow);
  padding: 0.55rem;
}
.plus { width: 2.9rem; height: 2.9rem; border-radius: 50%; border: 0; background: #EFF0F2; color: var(--muted); display: grid; place-items: center; cursor: pointer; flex: none; transition: transform .2s; }
.plus.spin { animation: spin 0.5s ease; }
@keyframes spin { to { transform: rotate(360deg); } }
.plus svg { width: 1.3rem; height: 1.3rem; }
form input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; font-weight: 600; color: var(--navy); padding: 0.4rem 0.2rem; }
form input::placeholder { color: #8C949D; }
.send { width: 3.3rem; height: 3.3rem; border-radius: 50%; border: 0; background: var(--orange); color: var(--white); display: grid; place-items: center; cursor: pointer; flex: none; }
.send:disabled { opacity: 0.5; cursor: default; }
.send svg { width: 1.5rem; height: 1.5rem; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
form:focus-within { box-shadow: var(--shadow), 0 0 0 2px var(--chip); }

.foot { white-space: nowrap; display: flex; align-items: center; gap: 0.8rem; justify-content: center; color: var(--muted); font-size: 0.85rem; font-weight: 600; margin-top: 0.7rem; }
.foot::before, .foot::after { content: ""; width: 2rem; height: 1px; background: #D3D6DA; }

@media (max-width: 360px) {
    .hero .text { width: 60%; }
}
[hidden] { display: none !important; }

/* Verstopte grapjes */
.hero { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.top img { cursor: pointer; }
.hero img.wobble { animation: wobble 0.6s ease; transform-origin: 70% 100%; }
@keyframes wobble { 20% { transform: rotate(-4deg); } 50% { transform: rotate(3deg); } 80% { transform: rotate(-2deg); } }
.confetti { position: fixed; top: -48px; z-index: 50; pointer-events: none; animation: fall 2.4s ease-in forwards; }
.confetti.bal { border-radius: 50%; box-shadow: inset -4px -6px 9px rgba(0,0,0,.28); }
.confetti.bal::before { content: ""; position: absolute; left: 50%; top: -17%; width: 30%; height: 20%; transform: translateX(-50%); background: #D9A441; border-radius: 2px 2px 0 0; }
.confetti.bal::after { content: ""; position: absolute; left: 50%; top: 52%; width: 80%; height: 0; padding-bottom: 15.2%; transform: translate(-50%, -50%); background: url("../img/tapas2000-logo.png") center / contain no-repeat; }
.confetti.rood { background: radial-gradient(circle at 32% 30%, #F0646C 0, #C62A35 38%, #8E1A24 100%); }
.confetti.goud { background: radial-gradient(circle at 32% 30%, #F7E2A0 0, #D9A441 40%, #9C6F1F 100%); }
.confetti.zilver { background: radial-gradient(circle at 32% 30%, #FFFFFF 0, #C9CED4 40%, #8A9099 100%); }
@keyframes fall { to { transform: translateY(115vh) rotate(var(--zwaai, 20deg)); } }
body.disco { animation: disco 1s linear 5; }
@keyframes disco { to { filter: hue-rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hero img.wobble, body.disco, .confetti, .plus.spin { animation: none; } }

/* Geen zoomen: de pagina is een app-achtig scherm */
html, body { touch-action: manipulation; -webkit-text-size-adjust: 100%; }

.bubble img.foto { display: block; width: 100%; max-width: 15rem; height: auto; margin-top: 0.7rem; border-radius: 1rem; background: var(--peach); pointer-events: none; }
.status.offline::before { background: var(--orange); }
/* Offline: compactere kop en bubbel, zodat de hele begroeting op één scherm past */
body.offline .hero { min-height: 9.5rem; margin-bottom: 1rem; }
body.offline .hero h2 { font-size: clamp(1.6rem, 7vw, 2.1rem); }
body.offline .bubble { padding: 0.7em 1em; font-size: 0.95rem; }
body.offline .log { gap: 0.7rem; }

/* Spraakberichten */
.voice { display: flex; align-items: center; gap: 0.7rem; min-width: 13.5rem; margin-top: 0.1rem; }
.bubble:not(:empty) .voice:not(:first-child) { margin-top: 0.7rem; }
.vplay { flex: none; width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 0; background: var(--orange); color: #fff; display: grid; place-items: center; cursor: pointer; }
.vplay svg { width: 1.2rem; height: 1.2rem; }
.vplay:disabled { opacity: 0.4; cursor: default; }
.vbars { flex: 1; min-width: 0; height: 1.8rem; display: flex; align-items: center; gap: 2px; }
.vbars span { flex: 1; min-width: 2px; max-width: 4px; border-radius: 2px; background: #D3D6DA; }
.vbars span.on { background: var(--orange); }
.vtime { flex: none; font-size: 0.8rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Menukaart (Tapas 2000-stijl: rood, wit, vet). Staat er geen avond open, dan is dit de hele pagina. */
.plaats-wrap { display: none; flex: 1; overflow-y: auto; padding: 1.2rem 0.9rem 1.6rem; }
body.plaats .top, body.plaats main, body.plaats .bottom { display: none; }
body.plaats .plaats-wrap { display: flex; flex-direction: column; }
.plaats-wrap > :first-child { margin-top: auto; }
.plaats-wrap > :last-child { margin-bottom: auto; }
body.plaats { justify-content: center; }
.merch { width: 100%; background: #fff; border-radius: 1.2rem; box-shadow: var(--shadow); padding: 1.3rem 1.1rem 0.6rem; max-width: 30rem; align-self: center; overflow: hidden; }
.merch-kop { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; margin-bottom: 0.9rem; }
.merch-kop img { width: 70%; max-width: 16rem; height: auto; }
.merch-kop span { color: var(--orange); font-weight: 900; letter-spacing: 0.06em; font-size: 1.2rem; text-transform: uppercase; }
.merch-rij { display: flex; align-items: center; gap: 0.8rem; padding: 0.7rem 0; border-top: 2px dotted #E6D6D4; }
.merch-rij:first-of-type { border-top: 0; }
.merch-rij img, .merch-leeg { flex: none; width: 4.2rem; height: 4.2rem; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0,0,0,.18)); }
.merch-leeg { filter: none; }
.merch-naam { flex: 1; min-width: 0; font-weight: 800; text-transform: uppercase; letter-spacing: 0.01em; font-size: 0.95rem; line-height: 1.2; overflow-wrap: anywhere; }
.merch-prijs { flex: none; background: var(--orange); color: #fff; border-radius: 0.5rem; padding: 0.4rem 0.75rem; font-weight: 900; font-size: 1rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.merch-hint { text-align: center; color: var(--muted); font-weight: 600; font-size: 0.9rem; margin: 1rem 0 0; }
