/* ==========================================================================
   Split-flap Flight Board (Departures / Vertrek)
   Iedere letter is een fysiek flapje; animatie alleen bij gewijzigde tekens.
   ========================================================================== */
.fb-wrap { container-type: inline-size; width: 100%; }
.fb-board {
  --cols: 53;
  --cell: clamp(13px, calc((100cqw - 48px) / var(--cols)), 40px);
  --cell-h: calc(var(--cell) * 1.42);
  --gap: max(2px, calc(var(--cell) * .09));
  --col-gap: calc(var(--cell) * .55);
  background: #0f1113;
  border-radius: 16px;
  padding: calc(var(--cell) * .55) calc(var(--cell) * .6) calc(var(--cell) * .8);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .04);
  color: #f3f1e6;
  overflow-x: auto;
  user-select: none;
}
.fb-inner { min-width: max-content; }

.fb-header {
  display: flex; align-items: center; gap: calc(var(--cell) * .6);
  background: #f6c513; color: #111; border-radius: 10px;
  padding: calc(var(--cell) * .35) calc(var(--cell) * .5);
  margin-bottom: calc(var(--cell) * .5);
}
.fb-glyph {
  width: calc(var(--cell) * 1.9); height: calc(var(--cell) * 1.9); background: #111; color: #f6c513;
  border-radius: 7px; display: grid; place-items: center; flex: none;
}
.fb-glyph svg { width: 64%; height: 64%; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.fb-glyph.plane svg { fill: currentColor; stroke: none; }
.fb-title { line-height: 1.02; flex: 1; min-width: 0; }
.fb-title strong { display: block; font: 800 calc(var(--cell) * 1.15) / 1 "Inter", system-ui, sans-serif; letter-spacing: -.01em; }
.fb-title span { display: block; font: 600 calc(var(--cell) * .68) / 1.2 "Inter", system-ui, sans-serif; opacity: .78; }
.fb-clock { text-align: right; line-height: 1; }
.fb-clock .time { font: 800 calc(var(--cell) * 1.45) / 1 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.fb-clock .date { font: 600 calc(var(--cell) * .55) / 1.3 "Inter", system-ui, sans-serif; text-transform: uppercase; letter-spacing: .08em; opacity: .75; }

.fb-cols, .fb-row { display: flex; gap: var(--col-gap); align-items: center; }
.fb-cols {
  padding: 0 0 calc(var(--cell) * .3);
  font: 700 calc(var(--cell) * .48) / 1.2 "Inter", system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: #f6c513;
}
.fb-cols > div { flex: none; }
.fb-cols small { display: block; font-weight: 500; letter-spacing: .06em; color: #9a9a90; text-transform: none; font-size: .92em; }
.fb-row { padding: calc(var(--gap) * 1.5) 0; border-top: 1px solid rgba(255, 255, 255, .045); }
.fb-field { display: flex; gap: var(--gap); flex: none; }

/* Kolombreedtes in flapjes */
.w-flight { width: calc(7 * var(--cell) + 6 * var(--gap)); }
.w-time   { width: calc(5 * var(--cell) + 4 * var(--gap)); }
.w-dep    { width: calc(13 * var(--cell) + 12 * var(--gap)); }
.w-arr    { width: calc(13 * var(--cell) + 12 * var(--gap)); }
.w-status { width: calc(9 * var(--cell) + 8 * var(--gap)); }

/* ---------- Het flapje ---------- */
.flap {
  position: relative; width: var(--cell); height: var(--cell-h); flex: none;
  perspective: calc(var(--cell) * 6);
  font: 700 calc(var(--cell) * .9) / var(--cell-h) "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  text-align: center; color: var(--flap-ink, #f3f1e6);
  border-radius: max(2px, calc(var(--cell) * .1));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .05), 0 2px 3px rgba(0, 0, 0, .6);
}
.flap .half, .flap .fold {
  position: absolute; left: 0; right: 0; height: 50%; overflow: hidden;
  background: #24272b;
}
.flap .top, .flap .fold-top { top: 0; border-radius: inherit; border-bottom-left-radius: 0; border-bottom-right-radius: 0;
  background: linear-gradient(#2b2e33, #222529); }
.flap .bottom, .flap .fold-bottom { bottom: 0; border-radius: inherit; border-top-left-radius: 0; border-top-right-radius: 0;
  background: linear-gradient(#1d2023, #191b1e); }
.flap b { position: absolute; left: 0; right: 0; height: var(--cell-h); font-weight: inherit; white-space: pre; }
.flap .top b, .flap .fold-top b { top: 0; }
.flap .bottom b, .flap .fold-bottom b { bottom: 0; }
/* Scharnierlijn */
.flap::after {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: max(1px, calc(var(--cell) * .05));
  transform: translateY(-50%); background: #08090a; z-index: 5;
}
.flap::before { /* zijpinnetjes */
  content: ""; position: absolute; left: -1px; right: -1px; top: 50%; height: calc(var(--cell) * .16);
  transform: translateY(-50%); border-left: 2px solid #0b0c0d; border-right: 2px solid #0b0c0d; z-index: 6;
}
.flap .fold { z-index: 3; backface-visibility: hidden; }
.flap .fold-top { transform-origin: 50% 100%; animation: fb-fold-top var(--flip-ms, 70ms) ease-in forwards; }
.flap .fold-bottom { transform-origin: 50% 0; transform: rotateX(90deg); animation: fb-fold-bottom var(--flip-ms, 70ms) ease-out var(--flip-ms, 70ms) forwards; }
@keyframes fb-fold-top { from { transform: rotateX(0); filter: brightness(1); } to { transform: rotateX(-90deg); filter: brightness(.55); } }
@keyframes fb-fold-bottom { from { transform: rotateX(90deg); filter: brightness(1.5); } to { transform: rotateX(0); filter: brightness(1); } }

/* Statuskleuren (alleen inkt van de status-kolom) */
.fb-row[data-status="BOARDING"]  .w-status { --flap-ink: #e9e7dc; }
.fb-row[data-status="DEPARTED"]  .w-status { --flap-ink: #ffb65c; }
.fb-row[data-status="IN FLIGHT"] .w-status { --flap-ink: #7fe0d4; }
.fb-row[data-status="LANDING"]   .w-status { --flap-ink: #f6c513; }
.fb-row[data-status="ARRIVED"]   .w-status { --flap-ink: #8fdc96; }
.fb-row[data-status="ARRIVED"]   .w-flight,
.fb-row[data-status="ARRIVED"]   .w-time { --flap-ink: #c9c7bc; }

.fb-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: calc(var(--cell) * .45);
  font: 500 calc(var(--cell) * .45) / 1.3 "Inter", system-ui, sans-serif; color: #8d8d84; flex-wrap: wrap; }
.fb-foot .live-dot { display: inline-block; width: .7em; height: .7em; border-radius: 50%; background: #3ccf8e; margin-right: .4em; vertical-align: -.05em; box-shadow: 0 0 0 0 rgba(60, 207, 142, .6); animation: fb-pulse 2s infinite; }
.fb-foot .live-dot.err { background: #e5534b; animation: none; }
@keyframes fb-pulse { 0% { box-shadow: 0 0 0 0 rgba(60, 207, 142, .55); } 70% { box-shadow: 0 0 0 .6em rgba(60, 207, 142, 0); } 100% { box-shadow: 0 0 0 0 rgba(60, 207, 142, 0); } }

/* Fullscreen / kiosk */
.fb-wrap:fullscreen { background: #050607; display: grid; align-items: center; padding: 2vh 2vw; }
.fb-wrap:fullscreen .fb-board { --cell: min(calc((100cqw - 48px) / var(--cols)), calc((100vh - 4vh) / 25)); }
body.kiosk { background: #050607; margin: 0; min-height: 100vh; display: grid; align-items: center; padding: 2vh 2vw; box-sizing: border-box; }
body.kiosk .fb-board { --cell: min(calc((100cqw - 48px) / var(--cols)), calc((100vh - 4vh) / 25)); }

@media (prefers-reduced-motion: reduce) {
  .flap .fold-top, .flap .fold-bottom { animation-duration: 1ms !important; animation-delay: 0ms !important; }
}
