/* ============================================================
   ESCAPE DE BUS – BERLIJN — v0.01
   Design tokens:
   - achtergrond: #0B0F14 (beton/nacht), panelen #141A22
   - neon geel (S-Bahn/Alarm): #F5D90A
   - neon cyaan: #2DE1C2
   - alarm rood: #FF3B30
   - tekst: #ECEDEF / grijs #8A93A3
   - display font: 'Big Shoulders', body: 'Inter', mono: 'JetBrains Mono'
   ============================================================ */

@font-face { font-family: 'Big Shoulders'; src: local('Big Shoulders'); }

:root{
  --bg: #0B0F14;
  --panel: #141A22;
  --panel-2: #1B222C;
  --line: #2A3340;
  --text: #ECEDEF;
  --text-dim: #8A93A3;
  --yellow: #F5D90A;
  --cyan: #2DE1C2;
  --red: #FF3B30;
  --radius: 14px;
  --font-display: 'Big Shoulders Display', 'Oswald', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background:
    radial-gradient(circle at 15% -10%, rgba(45,225,194,0.10), transparent 45%),
    radial-gradient(circle at 90% 10%, rgba(245,217,10,0.08), transparent 40%),
    var(--bg);
  color:var(--text);
  font-family:var(--font-body);
  -webkit-font-smoothing:antialiased;
  min-height:100vh;
}

/* concrete/scanline texture overlay */
body::before{
  content:"";
  position:fixed; inset:0;
  pointer-events:none;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,0.015) 0px, rgba(255,255,255,0.015) 1px, transparent 1px, transparent 3px);
  z-index: 0;
}

#app{ position:relative; z-index:1; max-width:640px; margin:0 auto; min-height:100vh; display:flex; flex-direction:column; padding-bottom:90px; }

.hidden{ display:none !important; }

/* ---------- Topbar ---------- */
.topbar{
  position:sticky; top:0; z-index:20;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 16px;
  background:rgba(11,15,20,0.88);
  backdrop-filter: blur(8px);
  border-bottom:1px solid var(--line);
}
.brand{ display:flex; align-items:center; gap:10px; min-width:0; overflow:hidden; }
.brand-mark{ font-size:22px; }
.brand-text{ font-family:var(--font-display); font-weight:700; letter-spacing:0.5px; font-size:20px; line-height:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.brand-text small{ display:block; font-family:var(--font-mono); font-size:10px; color:var(--cyan); letter-spacing:1.5px; font-weight:400; }

.timer-pill{
  font-family:var(--font-mono);
  font-size:18px; font-weight:700;
  padding:6px 12px;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--panel);
  color:var(--cyan);
  letter-spacing:1px;
  min-width:76px; text-align:center;
  white-space:nowrap; flex-shrink:0;
}
.timer-pill.warn{ color:var(--yellow); border-color:var(--yellow); animation:pulse 1.4s infinite; }
.timer-pill.danger{ color:var(--red); border-color:var(--red); animation:pulse 0.8s infinite; }
@keyframes pulse{ 0%,100%{opacity:1;} 50%{opacity:0.45;} }

/* ---------- Sections & cards ---------- */
.screen{ padding:20px 16px 8px; flex:1; }
.card{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:18px;
  margin-bottom:14px;
}
.eyebrow{
  font-family:var(--font-mono); font-size:11px; letter-spacing:2px; text-transform:uppercase;
  color:var(--cyan); margin:0 0 6px;
}
h1,h2,h3{ font-family:var(--font-display); font-weight:700; margin:0 0 10px; letter-spacing:0.3px; }
.highlight{ background:var(--cyan); color:#04140F; padding:1px 7px; border-radius:5px; font-weight:700; }
h1{ font-size:34px; line-height:1.05; }
h2{ font-size:24px; }
h3{ font-size:19px; }
p{ line-height:1.5; color:var(--text); margin:0 0 12px; }
.muted{ color:var(--text-dim); font-size:14px; }

/* ---------- Buttons ---------- */
.btn{
  appearance:none; border:none; cursor:pointer;
  font-family:var(--font-body); font-weight:700; font-size:15px;
  padding:13px 20px; border-radius:10px;
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  transition:transform .12s ease, box-shadow .12s ease, opacity .12s ease;
  width:100%;
}
.btn:active{ transform:scale(0.97); }
.btn-primary{ background:var(--cyan); color:#04211C; box-shadow:0 0 0 rgba(45,225,194,0); }
.btn-primary:hover{ box-shadow:0 0 22px rgba(45,225,194,0.45); }
.btn-accent{ background:var(--yellow); color:#241E00; }
.btn-accent:hover{ box-shadow:0 0 22px rgba(245,217,10,0.45); }
.btn-danger{ background:var(--red); color:#2B0000; }
.btn-ghost{ background:transparent; color:var(--text); border:1px solid var(--line); }
.btn-ghost:hover{ border-color:var(--cyan); color:var(--cyan); }
.btn-sm{ width:auto; padding:9px 14px; font-size:13px; }
.btn:disabled{ opacity:0.35; cursor:not-allowed; }
.btn-row{ display:flex; gap:10px; }

/* ---------- Inputs ---------- */
label{ display:block; font-size:13px; font-weight:600; color:var(--text-dim); margin-bottom:6px; }
input[type=text], input[type=number], input[type=password], input[type=datetime-local], textarea, select{
  width:100%; background:var(--panel-2); border:1px solid var(--line); color:var(--text);
  border-radius:10px; padding:12px 14px; font-family:var(--font-body); font-size:15px; margin-bottom:14px;
}
textarea{ min-height:90px; resize:vertical; }
input:focus, textarea:focus, select:focus{ outline:none; border-color:var(--cyan); box-shadow:0 0 0 3px rgba(45,225,194,0.15); }
input[type=file]{ width:100%; margin-bottom:14px; color:var(--text-dim); }

/* ---------- Progress bar ---------- */
.progress-wrap{ margin:10px 0 18px; }
.progress-track{ height:10px; background:var(--panel-2); border-radius:999px; overflow:hidden; border:1px solid var(--line); }
.progress-fill{ height:100%; background:linear-gradient(90deg, var(--cyan), var(--yellow)); transition:width .4s ease; }
.progress-label{ font-family:var(--font-mono); font-size:12px; color:var(--text-dim); margin-top:6px; }

/* ---------- Mission list ---------- */
.mission-grid{ display:flex; flex-direction:column; gap:12px; }
.mission-card{
  display:flex; align-items:center; gap:14px;
  background:var(--panel); border:1px solid var(--line); border-radius:var(--radius);
  padding:14px; cursor:pointer; text-align:left; width:100%;
  position:relative; overflow:hidden;
}
.mission-card::before{
  content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--m-color, var(--cyan));
}
.mission-card .m-icon{ font-size:28px; width:44px; text-align:center; flex-shrink:0; }
.mission-card .m-body{ flex:1; min-width:0; }
.mission-card .m-name{ font-weight:700; font-size:16px; margin-bottom:2px; }
.mission-card .m-status{ font-size:12px; color:var(--text-dim); font-family:var(--font-mono); }
.mission-card.locked{ opacity:0.45; cursor:not-allowed; }
.mission-card.done{ border-color:var(--cyan); }
.mission-card .m-check{ font-size:20px; flex-shrink:0; }
.badge-tag{
  font-family:var(--font-mono); font-size:10px; padding:3px 8px; border-radius:999px;
  border:1px solid var(--line); color:var(--text-dim); text-transform:uppercase; letter-spacing:1px;
}

/* ---------- Task items ---------- */
.task{
  border:1px solid var(--line); border-radius:10px; padding:14px; margin-bottom:12px; background:var(--panel-2);
}
.task-type{
  display:inline-block; font-family:var(--font-mono); font-size:10px; letter-spacing:1.5px;
  text-transform:uppercase; padding:3px 8px; border-radius:6px; margin-bottom:8px;
}
.task-type.observatie{ background:rgba(45,225,194,0.15); color:var(--cyan); }
.task-type.foto{ background:rgba(245,217,10,0.15); color:var(--yellow); }
.task-type.samenwerking{ background:rgba(255,59,48,0.15); color:var(--red); }
.task-type.reflectie{ background:rgba(140,120,255,0.18); color:#B7A9FF; }
.task-type.video{ background:rgba(245,217,10,0.15); color:var(--yellow); }
.task h4{ margin:0 0 6px; font-size:16px; font-family:var(--font-body); font-weight:700; }
.task-check{ display:flex; align-items:center; gap:10px; margin-top:10px; }
.task-check input{ width:20px; height:20px; margin:0; }

/* ---------- Code fragment reveal ---------- */
.fragment-reveal{
  text-align:center; padding:22px; border:2px dashed var(--cyan); border-radius:var(--radius);
  background:rgba(45,225,194,0.06); margin-top:16px;
}
.fragment-code{
  font-family:var(--font-mono); font-size:28px; letter-spacing:3px; color:var(--yellow);
  text-shadow:0 0 18px rgba(245,217,10,0.5); margin:8px 0;
}

/* ---------- Approval / teacher gate ---------- */
.gate-box{
  border:1px solid var(--yellow); border-radius:var(--radius); padding:16px; background:rgba(245,217,10,0.06);
}
.gate-box .lock-icon{ font-size:30px; }
.pin-dots{ display:flex; gap:10px; justify-content:center; margin:12px 0; }
.pin-dots span{ width:14px; height:14px; border-radius:50%; border:2px solid var(--line); }
.pin-dots span.filled{ background:var(--cyan); border-color:var(--cyan); }

/* ---------- Scoreboard ---------- */
.score-row{
  display:flex; align-items:center; justify-content:space-between; padding:12px 14px;
  border:1px solid var(--line); border-radius:10px; margin-bottom:8px; background:var(--panel-2);
}
.score-row .rank{ font-family:var(--font-display); font-size:22px; width:34px; color:var(--text-dim); }
.score-row.top1 .rank{ color:var(--yellow); }
.score-row .name{ flex:1; font-weight:700; }
.score-row .pts{ font-family:var(--font-mono); color:var(--cyan); }

/* ---------- Badges ---------- */
.badge-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.badge-item{
  text-align:center; padding:12px 6px; border-radius:10px; border:1px solid var(--line); background:var(--panel-2);
}
.badge-item .b-icon{ font-size:26px; display:block; margin-bottom:6px; filter:grayscale(1); opacity:0.3; }
.badge-item.earned .b-icon{ filter:none; opacity:1; }
.badge-item .b-name{ font-size:11px; font-weight:700; }

/* ---------- Vault / final screen ---------- */
.vault-grid{ display:flex; flex-direction:column; gap:8px; margin:16px 0; }
.vault-slot{
  display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:8px;
  border:1px solid var(--line); background:var(--panel-2); font-family:var(--font-mono);
}
.vault-slot .slot-name{ flex:0 0 130px; font-size:12px; color:var(--text-dim); }
.vault-slot .slot-code{ flex:1; letter-spacing:2px; }
.vault-slot.filled{ border-color:var(--cyan); color:var(--cyan); }
.vault-slot .slot-empty{ color:var(--line); }

/* ---------- Bottom nav ---------- */
.bottom-nav{
  position:fixed; bottom:0; left:0; right:0; z-index:20;
  display:flex; justify-content:center;
  background:rgba(11,15,20,0.92); backdrop-filter:blur(8px); border-top:1px solid var(--line);
  padding:10px 16px calc(10px + env(safe-area-inset-bottom));
}
.nav-row{ display:flex; gap:8px; width:100%; max-width:640px; }
.nav-btn{
  flex:1; background:transparent; border:none; color:var(--text-dim); font-family:var(--font-body);
  font-size:11px; display:flex; flex-direction:column; align-items:center; gap:2px; padding:6px; border-radius:8px; cursor:pointer;
}
.nav-btn .n-icon{ font-size:18px; }
.nav-btn.active{ color:var(--cyan); }

/* ---------- Toast ---------- */
.toast{
  position:fixed; bottom:88px; left:50%; transform:translateX(-50%);
  background:var(--panel); border:1px solid var(--cyan); color:var(--text);
  padding:12px 18px; border-radius:10px; font-size:14px; z-index:50;
  box-shadow:0 8px 30px rgba(0,0,0,0.5);
  animation: toastin .25s ease, toastout .25s ease 2.5s forwards;
}
@keyframes toastin{ from{opacity:0; transform:translate(-50%,10px);} to{opacity:1; transform:translate(-50%,0);} }
@keyframes toastout{ to{opacity:0; transform:translate(-50%,10px);} }

/* ---------- End screens ---------- */
.end-screen{ text-align:center; padding:40px 20px; }
.end-screen .big-emoji{ font-size:64px; display:block; margin-bottom:14px; }
.end-screen.success h1{ color:var(--cyan); text-shadow:0 0 30px rgba(45,225,194,0.4); }
.end-screen.fail h1{ color:var(--red); text-shadow:0 0 30px rgba(255,59,48,0.4); }

/* ---------- Install banner ---------- */
.install-banner{
  display:flex; align-items:center; gap:10px; padding:12px 14px; border-radius:10px;
  background:var(--panel-2); border:1px solid var(--yellow); margin-bottom:14px; font-size:13px;
}
.install-banner button{ margin-left:auto; }

/* ---------- QR scan area ---------- */
#qr-video{ width:100%; border-radius:10px; border:1px solid var(--line); background:#000; }

/* ---------- Misc ---------- */
.divider{ height:1px; background:var(--line); margin:16px 0; }
.center{ text-align:center; }
.flex-between{ display:flex; align-items:center; justify-content:space-between; }
a{ color:var(--cyan); }

@media (min-width:700px){
  .badge-grid{ grid-template-columns:repeat(6,1fr); }
}
