/* De Kronieken van NoobNinjas — dark industrial Factorio theme */
:root {
  --bg: #141618;
  --bg2: #1a1d20;
  --panel: #202428;
  --panel2: #262b30;
  --line: #33383e;
  --text: #d8dcdf;
  --muted: #8b9299;
  --accent: #ffb545;
  --accent2: #e6a23c;
  --green: #7dc242;
  --red: #e06c5a;
  --blue: #6aa9d9;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.65;
  overflow-x: hidden;
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    radial-gradient(ellipse 80% 60% at 50% 10%, rgba(255,181,69,0.07), transparent),
    linear-gradient(180deg, #191c1f 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.gear-bg {
  position: absolute;
  right: -6rem; top: -4rem;
  width: 28rem; height: 28rem;
  fill: rgba(255,255,255,0.03);
  pointer-events: none;
  user-select: none;
}
.hero-inner { position: relative; padding: 4rem 1.5rem; max-width: 60rem; }
.overline {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.2rem;
}
h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f2f4f5;
  line-height: 1.1;
}
.accent { color: var(--accent); }
.subtitle {
  margin-top: 1.1rem;
  color: var(--muted);
  font-size: clamp(1rem, 2.4vw, 1.25rem);
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1rem;
  margin: 3rem auto 0;
  max-width: 52rem;
}
.stat {
  background: rgba(32,36,40,0.85);
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent2);
  border-radius: 8px;
  padding: 1.1rem 0.8rem;
}
.stat-num {
  font-family: var(--mono);
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}
.stat-num small { font-size: 0.85rem; color: var(--muted); margin-left: 0.3rem; }
.stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 0.35rem;
}
.hint { margin-top: 2.6rem; color: var(--muted); font-size: 0.85rem; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(4px); } }

/* ---------- CHAPTERS ---------- */
.chapter {
  max-width: 46rem;
  margin: 0 auto;
  padding: 4.5rem 1.5rem 1rem;
}
.section-title {
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 800;
  color: #f2f4f5;
  margin-bottom: 1.6rem;
  padding-bottom: 0.7rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}
.section-intro { color: var(--muted); margin-bottom: 1.8rem; }
.sub-title { color: #f2f4f5; margin: 2.6rem 0 1.2rem; font-size: 1.2rem; }
.footnote { color: var(--muted); font-size: 0.82rem; margin-top: 1rem; }

/* timeline */
.timeline { position: relative; padding-left: 1.8rem; }
.timeline::before {
  content: "";
  position: absolute;
  left: 5px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--line) 100%);
}
.tl-item { position: relative; padding-bottom: 2.8rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-marker {
  position: absolute;
  left: -1.8rem; top: 6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
}
.tl-date {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
}
.tl-item h3 { font-size: 1.35rem; color: #f2f4f5; margin-bottom: 0.7rem; }
.tl-item p { margin-bottom: 0.9rem; color: var(--text); }
.tl-item p:last-child { margin-bottom: 0; }
.tl-item em { color: var(--accent); font-style: normal; }
.tl-item strong { color: #fff; }

/* ---------- CARDS ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.4rem 1.2rem;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--pc, var(--accent));
}
.p-name { font-size: 1.15rem; font-weight: 700; color: #f2f4f5; }
.p-title { color: var(--pc, var(--accent)); font-size: 0.85rem; font-style: italic; margin-bottom: 0.8rem; }
.p-hours { font-family: var(--mono); font-size: 1.9rem; font-weight: 700; color: #fff; }
.p-hours small { font-size: 0.85rem; color: var(--muted); }
.p-hours-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.p-bar { margin-top: 0.9rem; height: 6px; background: #141618; border-radius: 3px; overflow: hidden; }
.p-bar i { display: block; height: 100%; background: var(--pc, var(--accent)); border-radius: 3px; width: 0; transition: width 1.2s cubic-bezier(.2,.8,.2,1); }
.p-status { margin-top: 0.8rem; font-size: 0.82rem; color: var(--muted); }

/* ---------- PIONIERS: activiteit per dag ---------- */
.p-chart { margin-top: 1rem; }
.p-chart-bars { display: flex; align-items: flex-end; gap: 3px; height: 46px; margin-top: 0.5rem; }
.p-chart-bars i { flex: 1 1 0; min-width: 2px; height: 0; background: var(--pc, var(--accent)); border-radius: 2px 2px 0 0; transition: height 0.8s cubic-bezier(.2,.8,.2,1); }
.p-chart-bars i.zero { background: #2a2e33; }
.p-chart-days { display: flex; gap: 3px; margin-top: 4px; font-family: var(--mono); font-size: 0.56rem; color: var(--muted); }
.p-chart-days span { flex: 1 1 0; text-align: center; }
.p-chart-days span.today { color: var(--pc, var(--accent)); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot.on { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot.off { background: #555; }

.card.big { text-align: center; padding: 1.8rem 1rem; }
.big-num { font-family: var(--mono); font-size: 1.9rem; font-weight: 700; color: var(--accent); }
.big-label { font-size: 0.95rem; color: #f2f4f5; margin-top: 0.2rem; }
.big-sub { font-size: 0.8rem; color: var(--muted); margin-top: 0.5rem; }

/* ---------- DAILY CHART ---------- */
.chart-wrap {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
}
#daily-chart { width: 100%; height: auto; display: block; }
#daily-chart .chart-bar {
  fill: var(--accent2);
  opacity: 0.85;
  rx: 3;
  transition: opacity .15s;
}
#daily-chart .chart-bar:hover { opacity: 1; }
#daily-chart .chart-bar.peak { fill: var(--accent); }
#daily-chart .bar-value { fill: #d8dcdf; font-family: var(--mono); font-size: 12px; }
#daily-chart .day-label { fill: #8b9299; font-size: 11px; }

/* ---------- BARS ---------- */
.bars { display: flex; flex-direction: column; gap: 0.55rem; }
.bar-row { display: grid; grid-template-columns: minmax(8rem, 12rem) 1fr auto; align-items: center; gap: 0.7rem; }
.bar-label { font-size: 0.9rem; color: var(--text); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: #17191b; border: none; border-radius: 4px; height: 16px; overflow: hidden; }
.bar-fill {
  display: block; height: 100%; width: 0;
  background: var(--bc, var(--accent2));
  border-radius: 3px;
  transition: width 1.1s cubic-bezier(.2,.8,.2,1);
}
.bar-value { font-family: var(--mono); font-size: 0.82rem; color: var(--muted); min-width: 5.5rem; }

.cat-grondstof  { --bc: #d99a4e; }
.cat-plaat      { --bc: #aec3d4; }
.cat-half       { --bc: #ee7f3d; }
.cat-circuit    { --bc: #86c94e; }
.cat-logistiek  { --bc: #e6cf4f; }
.cat-wetenschap { --bc: #5fc6c6; }
.cat-raket      { --bc: #eef1f5; }
.cat-robot      { --bc: #e77fb8; }
.cat-bouw       { --bc: #c2a35c; }
.cat-overig     { --bc: #94a8b5; }

/* ---------- LOGBOEK ---------- */
.logbook { display: flex; flex-direction: column; gap: 1rem; }
.log-day { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.2rem; }
.log-date { font-family: var(--mono); color: var(--accent); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.5rem; }
.log-line { font-size: 0.92rem; color: var(--text); padding: 0.15rem 0; border-bottom: 1px dashed #2a2e33; }
.log-line:last-child { border-bottom: none; }

/* inklapbaar: nieuwste 3 dagen zichtbaar + meer/minder-knop (Sam 2026-09-06) */
.log-day.old { display: none; }
#logbook.open .log-day.old { display: block; }
.log-toggle {
  display: none;               /* JS toont hem pas (.show) als er >3 dagen zijn */
  margin: 1rem auto 0;         /* zelfde tussenruimte als tussen de log-blokken (gap 1rem) */
  padding: 0.5rem 1.4rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease;
}
.log-toggle.show { display: block; }
.log-toggle:hover { border-color: var(--accent2); color: #fff; }
.log-toggle:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }

/* ---------- FOOTER ---------- */
footer {
  margin-top: 4rem;
  border-top: 1px solid var(--line);
  padding: 2.5rem 1.5rem 3rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  background: var(--bg2);
}
footer .footnote { margin-top: 0.5rem; }
.fire { color: var(--accent); }

@media (max-width: 560px) {
  .bar-row { grid-template-columns: minmax(6rem, 8rem) 1fr auto; gap: 0.4rem; }
  .chapter { padding-top: 3.2rem; }
  .hero { min-height: auto; padding: 2.5rem 0 2rem; }
  .hero-inner { padding: 0 1rem; }
  .subtitle { font-size: 0.95rem; }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
    margin-top: 2rem;
    max-width: 24rem;
  }
  .stat { padding: 0.9rem 0.6rem; border-radius: 6px; }
  .stat-num { font-size: 1.55rem; }
  .stat-num small { font-size: 0.75rem; }
  .stat-label { font-size: 0.7rem; margin-top: 0.25rem; }
  .hint { display: none; }
  .gear-bg { width: 16rem; height: 16rem; right: -4rem; top: -2rem; }
}

/* ---------- GANTT speeltijden-logboek ---------- */
/* ---------- LIVE: de fabriek draait door (v3: pioniers-stijl, vlak, geen as-labels) ---------- */
.live-badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 0.7rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  transform: translateY(-0.2rem);
}
.live-badge.on { color: var(--green); border-color: rgba(125,194,66,0.5); animation: liveBlink 2.2s ease-in-out infinite; }
.live-badge.off { color: var(--red); border-color: rgba(224,108,90,0.5); }
@keyframes liveBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.sub-range { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); letter-spacing: 0.06em; margin-left: 0.5rem; font-weight: 400; }

/* lab-paneel */
.lab {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent2);
  border-radius: 10px;
  padding: 1.2rem 1.2rem 1.1rem;
  margin-bottom: 1.3rem;
}
.lab-line1 { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.5rem 0.9rem; }
.lab-kicker { font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--muted); }
.lab-tech { font-size: 1.3rem; font-weight: 800; color: #f2f4f5; }
.lab-tech.idle { color: var(--muted); font-weight: 600; }
.lab-spm {
  margin-left: auto;
  align-self: center;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  letter-spacing: 0.03em;
}
.lab-spm.dim { color: var(--muted); font-weight: 400; }
.lab-progress { margin: 0.8rem 0 0.45rem; }
.lab-progress .track { background: #141618; border: 1px solid #2a2e33; border-radius: 6px; height: 13px; overflow: hidden; }
.lab-progress .fill {
  display: block; height: 100%; width: 0;
  background: var(--accent2);
  border-radius: 5px;
  transition: width 1s ease;
}
.lab-meta { font-family: var(--mono); font-size: 0.82rem; color: var(--muted); line-height: 1.6; }
.lab-meta b { color: var(--accent); font-weight: 600; }
.lab-meta .warn { color: var(--red); }
.lab-queue { margin-top: 0.8rem; padding-top: 0.7rem; border-top: 1px dashed #2a2e33; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; }
.lab-queue-label { font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }
.q-chip {
  font-family: var(--mono); font-size: 0.78rem; color: var(--text);
  background: #17191b; border: 1px solid #2f353b; border-radius: 999px;
  padding: 0.16rem 0.7rem;
}
.q-chip em { font-style: normal; color: var(--accent); }
.lab-done { margin-top: 0.6rem; font-size: 0.85rem; color: var(--muted); }
.lab-done b { color: var(--text); font-weight: 600; }

/* mini-kaarten (4) */
.mini-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: 0.8rem; margin-bottom: 0.4rem; }
.mini-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 0.85rem 0.9rem 0.7rem;
}
.mini-num { font-family: var(--mono); font-size: 1.45rem; font-weight: 700; color: var(--accent); line-height: 1.15; }
.mini-num.dim { color: var(--muted); }
.mini-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-top: 0.3rem; }

/* grafieken: losse, vlakke balkjes zonder as-labels (stijl = pioniers) */
.chart-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.9rem 0.9rem 0.6rem;
  margin-top: 0.2rem;
}
.bar-chart { display: flex; align-items: flex-end; gap: 3px; height: 130px; width: 100%; }
.bar-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.bar {
  display: block; width: 100%;
  background: var(--bc, var(--accent2));
  border-radius: 2px 2px 0 0;
  height: 0;
  transition: height 0.8s cubic-bezier(.2,.8,.2,1);
}
.bar:hover { filter: brightness(1.35); }
.bar.zero { background: #2a2e33; height: 2px !important; }
.bar-labels { display: flex; gap: 3px; margin-top: 5px; }
.bar-labels span { flex: 1 1 0; min-width: 0; text-align: center; font-family: var(--mono); font-size: 0.62rem; color: var(--muted); }
.bar-labels span.today { color: var(--accent); }
.chart-empty { padding: 2rem 0; text-align: center; color: var(--muted); font-size: 0.85rem; font-family: var(--mono); }

/* productie per dag (zelfde taal als pioniers-minigrafiekjes) */
.chart-card.daily { padding: 1rem 1rem 0.7rem; }
.daily-bars { display: flex; align-items: flex-end; gap: 7px; height: 150px; width: 100%; }
.daily-bars i {
  flex: 1 1 0; min-width: 0; display: block;
  background: var(--accent2);
  border-radius: 3px 3px 0 0;
  height: 0;
  transition: height 0.8s cubic-bezier(.2,.8,.2,1);
}
.daily-bars i.peak { background: var(--accent); }
.daily-bars i:hover { filter: brightness(1.3); }
.daily-days { display: flex; gap: 7px; margin-top: 6px; }
.daily-days span { flex: 1 1 0; min-width: 0; text-align: center; font-family: var(--mono); font-size: 0.62rem; color: var(--muted); line-height: 1.35; }
.daily-days span.peak { color: var(--accent); }

@media (max-width: 560px) {
  .bar-chart { height: 95px; gap: 2px; }
  .bar-labels { gap: 2px; }
  .daily-bars { height: 115px; gap: 5px; }
  .daily-days { gap: 5px; font-size: 0.58rem; }
  .lab-tech { font-size: 1.15rem; }
}

/* legacy #daily-chart-regel uit de basis-css neutraliseren (id vs class) */
#daily-chart.daily-bars { display: flex; align-items: flex-end; height: 150px; }
@media (max-width: 560px) {
  #daily-chart.daily-bars { height: 115px; }
}

/* wachtrij-tijd (lab-meta, onder de chips) */
#qeta-time { margin-top: 0.55rem; }

/* ---------- SPM-strip (hero): live wetenschap per minuut ---------- */
.spm-strip {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 1.7rem;
  padding: 0.55rem 1.35rem;
  background: rgba(32,36,40,0.85);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.spm-dot {
  align-self: center;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: liveBlink 2.2s ease-in-out infinite;
}
.spm-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  transform: translateY(1.7px);  /* ink-uitlijning op de groene bol (pixel-gemeten) */
}
.spm-num {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.spm-num.dim { color: var(--muted); }
@media (max-width: 560px) {
  .spm-strip { margin-top: 1.2rem; padding: 0.45rem 1rem; gap: 0.5rem; }
  .spm-num { font-size: 1.2rem; }
}
