/* camper.daniel.frl
   Kleuren komen van een oude luifel: pijnboomgroen, zand, mosterd en roest. */

:root {
    --ink-900: #0C1917;
    --ink-800: #112320;
    --ink-700: #1A322D;
    --ink-600: #24423B;
    --sand:    #F1E7D4;
    --sand-70: rgba(241, 231, 212, .70);
    --sand-45: rgba(241, 231, 212, .45);
    --mustard: #E8A73A;
    --rust:    #C4562C;
    --sage:    #7FAF9D;

    --display: 'Bricolage Grotesque', 'Instrument Sans', system-ui, sans-serif;
    --body:    'Instrument Sans', system-ui, -apple-system, sans-serif;
    --mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

    --r-lg: 18px;
    --r-md: 13px;
    --r-sm: 9px;
    --pad: 18px;
}

* { box-sizing: border-box; }

/* Het attribuut hidden moet altijd winnen, ook van eigen display-regels hieronder. */
[hidden] { display: none !important; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: var(--ink-900);
    color: var(--sand);
    font-family: var(--body);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior: none;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible {
    outline: 2px solid var(--mustard);
    outline-offset: 2px;
}

/* ---------- Toegangspoort ---------- */

.gate {
    display: grid;
    place-items: center;
    padding: 28px 20px calc(28px + env(safe-area-inset-bottom));
    background:
        radial-gradient(120% 80% at 50% 0%, #1A332D 0%, var(--ink-900) 62%);
}

.gate__inner { width: 100%; max-width: 340px; text-align: center; }

.gate__eyebrow {
    margin: 0 0 22px;
    font-size: 11px;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--sand-45);
}

.gate__title {
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(30px, 8vw, 40px);
    line-height: 1.03;
    letter-spacing: -.025em;
    margin: 0 0 10px;
}

.gate__sub { margin: 0 0 30px; color: var(--sand-70); font-size: 15px; }

.gate__error {
    margin: 0 0 18px;
    color: var(--mustard);
    font-size: 14px;
}

.pin {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 30px;
}

.pin__dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--ink-700);
    transition: transform .16s ease, background .16s ease;
}

.pin__dot.is-on { background: var(--mustard); transform: scale(1.18); }

.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.key {
    padding: 17px 0;
    border: 0;
    border-radius: var(--r-md);
    background: var(--ink-800);
    color: var(--sand);
    font-family: var(--mono);
    font-size: 21px;
    transition: background .12s ease, transform .12s ease;
}

.key:active { background: var(--ink-600); transform: scale(.96); }

.key--quiet {
    background: transparent;
    color: var(--sand-45);
    font-family: var(--body);
    font-size: 14px;
}

/* ---------- Bovenbalk ---------- */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
    background: var(--ink-900);
    flex: 0 0 auto;
}

.topbar__brand { display: flex; align-items: baseline; gap: 11px; min-width: 0; }

.brand__mark {
    font-size: 11px;
    letter-spacing: .2em;
    color: var(--mustard);
    flex: 0 0 auto;
}

.brand__where {
    font-family: var(--display);
    font-weight: 600;
    font-size: 16px;
    letter-spacing: -.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar__right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.topbar__ago { font-size: 12px; color: var(--sand-45); }

.pulse {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--sand-45);
}

.pulse[data-state="moving"] { background: var(--mustard); animation: beat 1.6s infinite; }
.pulse[data-state="parked"] { background: var(--sage); }
.pulse[data-state="stale"]  { background: var(--rust); }

@keyframes beat {
    0%, 100% { box-shadow: 0 0 0 0 rgba(232, 167, 58, .55); }
    70%      { box-shadow: 0 0 0 8px rgba(232, 167, 58, 0); }
}

/* ---------- Indeling ---------- */

.app {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 10px;
    padding: 0 10px calc(10px + env(safe-area-inset-bottom));
}

.mapwrap {
    position: relative;
    flex: 1 1 34%;
    min-height: 180px;
    border-radius: var(--r-lg);
    overflow: hidden;
    background: var(--ink-800);
}

#map { position: absolute; inset: 0; }
.leaflet-container { background: #0A1513; font-family: var(--body); }
.leaflet-control-attribution {
    background: rgba(12, 25, 23, .78) !important;
    color: var(--sand-45) !important;
    font-size: 10px !important;
}
.leaflet-control-attribution a { color: var(--sand-70) !important; }
.leaflet-control-zoom a {
    background: var(--ink-800) !important;
    color: var(--sand) !important;
    border-color: rgba(241, 231, 212, .10) !important;
}

.instruments {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 500;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    padding: 11px 6px;
    border-radius: var(--r-md);
    background: rgba(12, 25, 23, .84);
    backdrop-filter: blur(9px);
}

.instrument { text-align: center; min-width: 0; }

.instrument__value {
    display: block;
    font-size: 17px;
    font-weight: 500;
    line-height: 1.1;
    color: var(--sand);
}

.instrument__label {
    display: block;
    margin-top: 3px;
    font-size: 9.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--sand-45);
}

.follow {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 500;
    padding: 8px 13px;
    border: 0;
    border-radius: 100px;
    background: rgba(12, 25, 23, .84);
    backdrop-filter: blur(9px);
    color: var(--sand-45);
    font-size: 12px;
}

.follow[aria-pressed="true"] { color: var(--ink-900); background: var(--mustard); }

/* ---------- Paneel ---------- */

.panel {
    flex: 1 1 56%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-radius: var(--r-lg);
    background: var(--ink-800);
    overflow: hidden;
}

.tabs {
    display: flex;
    gap: 4px;
    padding: 8px 8px 0;
    flex: 0 0 auto;
}

.tab {
    flex: 1;
    padding: 10px 4px;
    border: 0;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--sand-45);
    font-size: 14px;
    font-weight: 500;
    transition: background .14s ease, color .14s ease;
}

.tab.is-active { background: var(--ink-700); color: var(--sand); }

.tabpanes {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: var(--pad);
}

.pane { display: none; }
.pane.is-active { display: block; animation: fade .22s ease; }

@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.pane__eyebrow {
    margin: 0 0 8px;
    font-size: 10.5px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--sand-45);
}

.bigplace {
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(26px, 7vw, 38px);
    line-height: 1.02;
    letter-spacing: -.03em;
    margin: 0 0 8px;
}

.bigplace__sub { margin: 0 0 20px; color: var(--sand-70); font-size: 14.5px; }

.readouts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    gap: 2px;
    margin: 0 0 16px;
    border-radius: var(--r-md);
    overflow: hidden;
}

.readout { padding: 12px 13px; background: var(--ink-700); }
.readout dt { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--sand-45); }
.readout dd { margin: 4px 0 0; font-family: var(--mono); font-size: 16px; }

.weather {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--r-md);
    background: var(--ink-700);
}

.weather__icon { font-size: 26px; line-height: 1; }
.weather__temp { font-size: 20px; display: block; }
.weather__desc { font-size: 13px; color: var(--sand-70); }

/* ---------- Camera: staat altijd in beeld ---------- */

.stage {
    flex: 0 0 auto;
    padding: 8px 8px 0;
}

.viewport {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--r-md);
    overflow: hidden;
    background: #000;
}

.viewport img,
.viewport video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #000;
}

.viewport__empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    text-align: center;
    color: var(--sand-45);
    font-size: 14px;
    background: var(--ink-700);
}

.viewport__tools {
    position: absolute;
    right: 8px;
    top: 8px;
    display: flex;
    gap: 6px;
    opacity: .55;
    transition: opacity .16s ease;
}

.viewport:hover .viewport__tools,
.viewport__tools:focus-within { opacity: 1; }

.iconbtn {
    padding: 5px 10px;
    border: 0;
    border-radius: 100px;
    background: rgba(12, 25, 23, .82);
    color: var(--sand-70);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .1em;
    text-transform: uppercase;
    backdrop-filter: blur(6px);
}

.iconbtn[aria-pressed="true"] { background: var(--mustard); color: var(--ink-900); }

.livepill {
    position: absolute;
    top: 10px;
    left: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 100px;
    background: rgba(12, 25, 23, .82);
    backdrop-filter: blur(6px);
    color: var(--sand-45);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.livepill::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.livepill[data-state="live"] { background: var(--rust); color: var(--sand); }
.livepill[data-state="live"]::before { animation: beat 1.6s infinite; }
.livepill[data-state="rewind"] { color: var(--mustard); }

/* Grootbeeld: de camera neemt het scherm over, de rest schuift weg */
body.is-cinema .mapwrap,
body.is-cinema .tabs,
body.is-cinema .tabpanes { display: none; }

body.is-cinema .app { padding: 0 10px calc(10px + env(safe-area-inset-bottom)); }
body.is-cinema .panel { flex: 1 1 auto; background: transparent; }
body.is-cinema .stage { padding: 0; height: 100%; display: flex; align-items: center; }
body.is-cinema .viewport { width: 100%; aspect-ratio: auto; height: min(100%, 78vh); }
body.is-cinema .viewport img,
body.is-cinema .viewport video { object-fit: contain; }

.hint { margin: 14px 0 0; font-size: 12.5px; color: var(--sand-45); }

.stamp {
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 4px 9px;
    border-radius: var(--r-sm);
    background: rgba(12, 25, 23, .8);
    font-size: 11px;
    color: var(--sand-70);
}

.rewind__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.rewind__head .pane__eyebrow { margin: 0; }

.select {
    padding: 7px 10px;
    border: 0;
    border-radius: var(--r-sm);
    background: var(--ink-700);
    color: var(--sand);
    font-size: 12.5px;
}

.range {
    width: 100%;
    margin: 0 0 10px;
    accent-color: var(--mustard);
    background: transparent;
}

.rewind__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    color: var(--sand-45);
}

/* ---------- Stops ---------- */

.stops { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.stop {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 12px;
    padding: 13px 14px;
    border-radius: var(--r-md);
    background: var(--ink-700);
    cursor: pointer;
    transition: background .14s ease;
}

.stop:hover { background: var(--ink-600); }

.stop__n {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--mustard);
    padding-top: 2px;
}

.stop__name {
    font-family: var(--display);
    font-weight: 600;
    font-size: 17px;
    letter-spacing: -.015em;
    margin: 0 0 3px;
}

.stop__meta { font-family: var(--mono); font-size: 11.5px; color: var(--sand-45); }
.stop__note { margin: 7px 0 0; font-size: 13.5px; color: var(--sand-70); }
.stop--open .stop__n { color: var(--rust); }

.empty { color: var(--sand-45); font-size: 14px; }

/* ---------- Kaartmarkeringen ---------- */

.marker-van {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--mustard);
    color: var(--ink-900);
    font-size: 17px;
    box-shadow: 0 0 0 6px rgba(232, 167, 58, .18);
}

.marker-stop {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--ink-900);
    color: var(--sand);
    font-family: var(--mono);
    font-size: 10px;
    box-shadow: 0 0 0 2px rgba(196, 86, 44, .9);
}

.leaflet-popup-content-wrapper {
    background: var(--ink-800);
    color: var(--sand);
    border-radius: var(--r-md);
}
.leaflet-popup-tip { background: var(--ink-800); }
.leaflet-popup-content { margin: 12px 14px; font-size: 13.5px; }
.leaflet-popup-content strong { font-family: var(--display); font-size: 15px; }

/* ---------- Knoppen en velden ---------- */

.btn {
    padding: 9px 15px;
    border: 0;
    border-radius: var(--r-sm);
    background: var(--mustard);
    color: var(--ink-900);
    font-size: 13.5px;
    font-weight: 600;
}

.btn--quiet { background: var(--ink-600); color: var(--sand-70); }

.field {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 8px;
    border: 0;
    border-radius: var(--r-sm);
    background: var(--ink-800);
    color: var(--sand);
    font-size: 14px;
    resize: vertical;
}

/* ---------- Camerapagina op de telefoon ---------- */

.cam { padding: 16px; max-width: 620px; margin: 0 auto; }
.cam h1 { font-family: var(--display); font-size: 22px; margin: 0 0 4px; }
.cam p.lead { color: var(--sand-70); font-size: 14px; margin: 0 0 18px; }

.cam__preview {
    position: relative;
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--ink-800);
    aspect-ratio: 4 / 3;
    margin-bottom: 14px;
}

.cam__preview video { width: 100%; height: 100%; object-fit: cover; }
.cam__preview .livepill { top: 10px; left: 10px; }

.cam__log {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--sand-45);
    background: var(--ink-800);
    border-radius: var(--r-md);
    padding: 12px 14px;
    max-height: 170px;
    overflow-y: auto;
    margin-top: 14px;
}

.cam__row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }

.cam__field { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--sand-70); }
.cam__field span { letter-spacing: .04em; }

.cam__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    border-radius: var(--r-md);
    overflow: hidden;
}

.cam__stat { padding: 12px; background: var(--ink-800); text-align: center; }
.cam__stat b { display: block; font-family: var(--mono); font-size: 17px; }
.cam__stat span { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--sand-45); }

/* ---------- Beheer ---------- */

.admin-body { display: block; background: var(--ink-900); }
.admin-wrap { max-width: 760px; margin: 0 auto; padding: 28px 18px 60px; }
.admin-title { font-family: var(--display); font-size: 30px; margin: 0 0 20px; }
.admin-subtitle { font-family: var(--display); font-size: 20px; margin: 30px 0 12px; }
.admin-flash { background: var(--ink-700); border-radius: var(--r-sm); padding: 10px 14px; font-size: 14px; }
.admin-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 2px; border-radius: var(--r-md); overflow: hidden; }
.admin-card { background: var(--ink-800); padding: 14px 16px; }
.admin-card__label { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--sand-45); }
.admin-card__value { display: block; font-family: var(--mono); font-size: 22px; margin: 4px 0 2px; }
.admin-card__meta { font-size: 12px; color: var(--sand-45); }
.admin-inline { margin: 18px 0; }
.admin-stop { background: var(--ink-700); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 10px; }
.admin-stop__head { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--sand-45); margin-bottom: 10px; flex-wrap: wrap; }
.admin-stop__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Groter scherm ---------- */

@media (min-width: 900px) {
    .app {
        flex-direction: row-reverse;
        gap: 12px;
        padding: 0 12px 12px;
    }
    .mapwrap { flex: 1 1 auto; }
    .panel { flex: 0 0 440px; }
    body.is-cinema .app { flex-direction: column; }
    body.is-cinema .viewport { height: min(100%, 84vh); }
    .topbar { padding: 16px 20px 12px; }
    .brand__where { font-size: 18px; }
    .instrument__value { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
