/* ── Base ── */
html, body {
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: 'JetBrains Mono', monospace;
  background-color: #131313;
  color: #e5e2e1;
}

/* ── Material Icons ── */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ── Glass panel ── */
.glass {
  background: rgba(25, 25, 25, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid #30363D;
}

/* ── Terminal glow on hover ── */
.terminal-glow {
  transition: box-shadow 0.3s, border-color 0.3s;
}
.terminal-glow:hover {
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.12);
  border-color: #22C55E !important;
}

/* ── Blinking cursor ── */
.blink {
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}

/* ── CRT scanline ── */
.scanline {
  background: linear-gradient(
    0deg,
    transparent 50%,
    rgba(34, 197, 94, 0.03) 51%,
    transparent 100%
  );
  background-size: 100% 4px;
  pointer-events: none;
}

/* ── Custom scrollbar ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: #131313; }
::-webkit-scrollbar-thumb { background: #30363D; border-radius: 2px; }

/* ── Skills ticker ── */
.ticker-outer {
  overflow: hidden;
  background: #0e0e0e;
  border-top: 1px solid #30363D;
  border-bottom: 1px solid #30363D;
  padding: 10px 0;
  position: relative;
  z-index: 5;
  margin-bottom: 2rem;
}
.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker-scroll 40s linear infinite;
  white-space: nowrap;
}
.ticker-track span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: #8B949E;
  padding-right: 3rem;
}
.ticker-track span em {
  color: #22C55E;
  font-style: normal;
}
@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── Speed Grid ── */
.speed-grid-wrapper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  aspect-ratio: 1;
}
.grid-btn {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #30363D;
  background: #1c1b1b;
  color: #c2c6d6;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.grid-btn:hover:not(:disabled) { border-color: #adc6ff; }
.grid-btn.hit {
  background: rgba(173, 198, 255, 0.2);
  color: #adc6ff;
  opacity: 0.5;
  cursor: default;
}

/* ── Memory card flip ── */
.memory-grid-wrapper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  aspect-ratio: 1;
}
.mem-card {
  perspective: 1000px;
  aspect-ratio: 1;
  cursor: pointer;
}
.mem-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.4s ease;
}
.mem-card.flipped .mem-inner { transform: rotateY(180deg); }
.mem-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}
.mem-face-front {
  border: 1px solid #30363D;
  background: #1c1b1b;
  transition: border-color 0.2s;
}
.mem-face-front:hover { border-color: #adc6ff; }
.mem-face-back {
  transform: rotateY(180deg);
  border: 1px solid #adc6ff;
  background: rgba(77, 142, 255, 0.1);
}
.mem-card.matched .mem-face-back {
  border-color: #22C55E;
  background: rgba(34, 197, 94, 0.1);
}

/* ── Game result overlays ── */
.game-result {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(13, 13, 13, 0.92);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 20;
  border-radius: 6px;
  padding: 20px;
  text-align: center;
}
.game-result.show { display: flex; }
.game-result-title {
  font-size: 1rem;
  font-weight: 700;
  color: #22C55E;
  font-family: 'JetBrains Mono', monospace;
}
.game-result-time {
  font-size: 1.5rem;
  font-weight: 700;
  color: #adc6ff;
  font-family: 'JetBrains Mono', monospace;
}
.game-result-btn {
  padding: 8px 20px;
  border: 1px solid;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn-play-again {
  border-color: #22C55E;
  color: #22C55E;
  background: transparent;
}
.btn-play-again:hover { background: #22C55E; color: #131313; }
.btn-quit {
  border-color: #30363D;
  color: #8B949E;
  background: transparent;
}
.btn-quit:hover { border-color: #8B949E; color: #e5e2e1; }

/* ── Mobile nav ── */
#mobile-menu { display: none; }
#mobile-menu.open { display: flex; }

/* ── Mouse glow ── */
#mouse-glow {
  position: fixed;
  pointer-events: none;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.04) 0%, transparent 70%);
  z-index: 0;
  transition: left 0.08s, top 0.08s;
}

/* ── Form inputs — visible text ── */
/* !important: Tailwind CDN injects styles AFTER this file loads; without it,
   any form-related plugin styles win at equal specificity (white bg bug). */
.form-input {
  width: 100%;
  background: #1c1b1b !important;
  border: 1px solid #30363D !important;
  border-radius: 0 !important;
  padding: 12px;
  font-size: 0.875rem;
  font-family: 'JetBrains Mono', monospace;
  color: #e5e2e1 !important;
  transition: border-color 0.2s;
  outline: none;
  box-shadow: none !important;
}
.form-input:focus { border-color: #22C55E !important; }
.form-input::placeholder { color: rgba(139, 148, 158, 0.5) !important; }

/* ── Section header pattern ── */
/* All section headers outside boxes use this class */
.section-cmd {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #8B949E;
  margin-bottom: 8px;
}
.section-cmd .prompt { color: #22C55E; }

.section-heading {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: #e5e2e1;
  font-family: 'JetBrains Mono', monospace;
}

/* ── Inside-box header (e.g. Core_Expertise) ── */
.box-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: #adc6ff;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 1.5rem;
}

/* ═══════════════════════════════════════════════
   v3.1 — Boot sequence, scroll reveals, polish
   ═══════════════════════════════════════════════ */

/* ── Smooth anchor scrolling ── */
html { scroll-behavior: smooth; }

/* ── Boot sequence (first visit per session) ── */
.booting #hero-output   { visibility: hidden; }
.booting #hero-cmd-text { visibility: hidden; }
.boot-el {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.boot-el.on { opacity: 1; transform: none; }

/* ── CRT flicker (fires once when hero output renders) ── */
@keyframes crt-flicker {
  0%   { opacity: 1; }
  30%  { opacity: 0.82; }
  60%  { opacity: 0.96; }
  100% { opacity: 1; }
}
.crt-flicker { animation: crt-flicker 0.18s steps(2, end) 1; }

/* ── Scroll-triggered section reveals ── */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* Block cursor while a section command types itself */
.cmd-typing::after {
  content: '▌';
  color: #22C55E;
  animation: blink 1s step-end infinite;
}

/* ── Phosphor glow on terminal-green text ── */
.phosphor,
.section-cmd .prompt {
  text-shadow: 0 0 8px rgba(34, 197, 94, 0.45);
}

/* ── ASCII corner brackets on card hover ── */
.terminal-glow { position: relative; }
.terminal-glow::before,
.terminal-glow::after {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: #22C55E;
  opacity: 0;
  position: absolute;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 2;
}
.terminal-glow::before { content: '┌'; top: 3px;    left: 7px; }
.terminal-glow::after  { content: '┘'; bottom: 3px; right: 7px; }
.terminal-glow:hover::before,
.terminal-glow:hover::after { opacity: 1; }

/* ── Film grain overlay ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ── Ticker pause on hover ── */
.ticker-outer:hover .ticker-track { animation-play-state: paused; }

/* ── Nav link hover: blinking block cursor ── */
.nav-link { position: relative; }
.nav-link::after {
  content: '▌';
  position: absolute;
  right: -13px;
  top: 0;
  color: #22C55E;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.nav-link:hover::after {
  opacity: 1;
  animation: blink 1s step-end infinite;
}

/* ── Reduced motion: kill all of the above gracefully ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker-track,
  .blink,
  .crt-flicker,
  .cmd-typing::after,
  .nav-link:hover::after { animation: none !important; }
  .reveal,
  .boot-el {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}


/* ═══════════════════════════════════════════════
   FLOOR_OPS — boardroom floor management sim
   ═══════════════════════════════════════════════ */
.floor-stage {
  position: relative;
  width: 100%;
  max-width: 760px;
  margin: 14px auto 0;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(rgba(34,197,94,0.025) 1px, transparent 1px) 0 0 / 100% 28px,
    linear-gradient(90deg, rgba(34,197,94,0.025) 1px, transparent 1px) 0 0 / 28px 100%,
    #0a0c0b;
  border: 1px solid var(--border-subtle, #30363D);
  overflow: hidden;
  user-select: none;
  /* subtle elevation — tilts the whole floor back like a tabletop diorama */
  transform: perspective(1100px) rotateX(11deg);
  transform-origin: center 55%;
  box-shadow: 0 28px 40px -22px rgba(0,0,0,0.75);
}
/* gentler tilt on small screens so far rooms stay readable */
@media (max-width: 640px) {
  /* taller floor in portrait = bigger rooms + room for the menu */
  .floor-stage { aspect-ratio: 4 / 3; transform: perspective(900px) rotateX(7deg); }
  /* top-align + scroll so CLOCK_IN / buttons are never pushed off-screen */
  .floor-overlay { justify-content: flex-start; gap: 6px; padding: 12px 10px; }
  .floor-overlay p { font-size: 10px !important; line-height: 1.4; }
  .floor-overlay .text-lg { font-size: 0.95rem; }
  .floor-overlay .text-xl { font-size: 1.05rem; }
}

/* generic room box (positioned inline by JS via %) */
.fo-room {
  position: absolute;
  border: 1px solid rgba(139,148,158,0.35);
  background: rgba(28,27,27,0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-family: 'JetBrains Mono', monospace;
  color: #8B949E;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
}
.fo-room .fo-label {
  font-size: clamp(7px, 1.4vw, 11px);
  font-weight: 700;
  letter-spacing: 0.05em;
}
.fo-room .fo-sub {
  font-size: clamp(6px, 1.1vw, 9px);
  opacity: 0.7;
  text-align: center;
  padding: 0 4px;
  line-height: 1.2;
}

/* clickable rooms get a pointer + hover */
.fo-room.fo-clickable { cursor: pointer; }
.fo-room.fo-clickable:hover { border-color: rgba(34,197,94,0.5); }

/* ── faux-3D low cubicle walls (beveled raised rim) ── */
.fo-room::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;        /* clicks pass through to the room */
  border-style: solid;
  border-width: 3px 4px 5px 3px;   /* a touch thicker on the front/right (toward viewer) */
  border-color:
    rgba(210, 220, 228, 0.16)  /* top    — wall edge catching light */
    rgba(0, 0, 0, 0.42)        /* right  — shadowed side */
    rgba(0, 0, 0, 0.50)        /* bottom — front wall, darkest */
    rgba(210, 220, 228, 0.09); /* left   — faint highlight */
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.25),
    inset 0 7px 12px -8px rgba(0,0,0,0.55);   /* soft shadow the wall casts inward */
  z-index: 1;
}
/* walls pick up the alert colour so the whole room glows together */
.fo-room.fault::before   { border-top-color: rgba(255,180,171,0.42); border-left-color: rgba(255,180,171,0.18); }
.fo-room.request::before { border-top-color: rgba(245,217,122,0.42); border-left-color: rgba(245,217,122,0.18); }
.fo-room.resolving::before { border-top-color: rgba(126,226,168,0.45); border-left-color: rgba(126,226,168,0.20); }
/* keep room content above the wall rim (::before is z-index 1) */
.fo-room .fo-label,
.fo-room .fo-sub,
.fo-fault-text { position: relative; z-index: 2; }
.fo-ring, .fo-progress, .fo-occ, .fo-event-bar-wrap { z-index: 2; }

/* fault state */
.fo-room.fault {
  border-color: #ffb4ab;
  background: rgba(186,26,26,0.18);
  color: #ffb4ab;
  box-shadow: 0 0 0 1px rgba(255,180,171,0.4), 0 0 16px rgba(186,26,26,0.35) inset;
  animation: fo-fault-pulse 1s ease-in-out infinite;
}
@keyframes fo-fault-pulse {
  0%,100% { box-shadow: 0 0 0 1px rgba(255,180,171,0.4), 0 0 16px rgba(186,26,26,0.30) inset; }
  50%     { box-shadow: 0 0 0 1px rgba(255,180,171,0.8), 0 0 22px rgba(186,26,26,0.55) inset; }
}

/* resolving state */
.fo-room.resolving {
  border-color: var(--primary, #22C55E);
  background: rgba(34,197,94,0.12);
  color: var(--primary, #22C55E);
  animation: none;
}

/* SLA countdown ring (top-right corner of a faulted room) */
.fo-ring {
  position: absolute;
  top: 4px; right: 4px;
  width: clamp(14px, 3vw, 22px);
  height: clamp(14px, 3vw, 22px);
  border-radius: 50%;
  background:
    conic-gradient(var(--ring, #ffb4ab) calc(var(--p,1) * 360deg), rgba(255,255,255,0.08) 0deg);
  -webkit-mask: radial-gradient(closest-side, transparent 58%, #000 60%);
          mask: radial-gradient(closest-side, transparent 58%, #000 60%);
}

/* hospitality request state (coffee/tea) — amber, not alarming red */
.fo-room.request {
  --ring: #EAB308;
  border-color: #EAB308;
  background: rgba(234,179,8,0.16);
  color: #EAB308;
  box-shadow: 0 0 0 1px rgba(234,179,8,0.4), 0 0 16px rgba(234,179,8,0.25) inset;
  animation: fo-req-pulse 1.3s ease-in-out infinite;
}
@keyframes fo-req-pulse {
  0%,100% { box-shadow: 0 0 0 1px rgba(234,179,8,0.4), 0 0 16px rgba(234,179,8,0.22) inset; }
  50%     { box-shadow: 0 0 0 1px rgba(234,179,8,0.75), 0 0 20px rgba(234,179,8,0.42) inset; }
}
.fo-room.request .fo-fault-text { color: #f5d97a; }

/* reconfig (last-minute room flip) — violet */
.fo-room.reconfig {
  --ring: #c084fc;
  border-color: #c084fc;
  background: rgba(168,85,247,0.17);
  color: #d8b4fe;
  box-shadow: 0 0 0 1px rgba(192,132,252,0.4), 0 0 16px rgba(168,85,247,0.30) inset;
  animation: fo-reconfig-pulse 1.05s ease-in-out infinite;
}
@keyframes fo-reconfig-pulse {
  0%,100% { box-shadow: 0 0 0 1px rgba(192,132,252,0.4), 0 0 16px rgba(168,85,247,0.26) inset; }
  50%     { box-shadow: 0 0 0 1px rgba(192,132,252,0.85), 0 0 22px rgba(168,85,247,0.5) inset; }
}
.fo-room.reconfig .fo-fault-text { color: #e9d5ff; }
.fo-room.reconfig::before { border-top-color: rgba(216,180,254,0.45); border-left-color: rgba(216,180,254,0.20); }
/* reconfig banner sits near the top of the big event hall (above the centred label) */
.fo-reconfig-banner {
  position: absolute;
  top: 10px; left: 50%; transform: translateX(-50%);
  width: 92%;
  text-align: center;
  font-size: clamp(7px, 1.2vw, 11px);
  color: #e9d5ff;
}

/* dispatch progress bar (bottom of resolving room) */
.fo-progress {
  position: absolute;
  left: 0; bottom: 0;
  height: 3px;
  width: var(--p, 0%);
  background: var(--primary, #22C55E);
}

/* fault label inside room */
.fo-fault-text {
  font-size: clamp(6px, 1.05vw, 8.5px);
  color: #ffb4ab;
  text-align: center;
  padding: 0 3px;
  line-height: 1.15;
}

/* live event hall — health bar */
.fo-event-bar-wrap {
  position: absolute;
  left: 6%; right: 6%; bottom: 8px;
  height: 7px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
}
.fo-event-bar {
  height: 100%;
  width: 100%;
  background: var(--primary, #22C55E);
  transition: width 0.2s linear, background 0.2s;
}
.fo-event-bar.warn { background: #EAB308; }
.fo-event-bar.crit { background: #ba1a1a; }
.fo-room.event-crit {
  animation: fo-event-flash 0.6s ease-in-out infinite;
}
@keyframes fo-event-flash {
  0%,100% { border-color: rgba(186,26,26,0.5); }
  50%     { border-color: rgba(255,180,171,0.95); }
}

/* ── walking exec sprite (CSS figure with walk cycle) ── */
.fo-exec {
  position: absolute;
  width: clamp(10px, 2vw, 16px);
  height: clamp(22px, 4.4vw, 34px);
  transform: translate(-50%, -90%);
  transition: left var(--walk, 2.2s) linear, top var(--walk, 2.2s) linear, opacity 0.4s;
  pointer-events: none;
  z-index: 8;
}
.fo-exec .fo-body {
  position: absolute;
  left: 50%; top: 14%;
  width: 64%; height: 52%;
  transform: translateX(-50%);
  background: var(--suit, #3B82F6);
  border-radius: 2px 2px 0 0;
}
.fo-exec .fo-head {
  position: absolute;
  left: 50%; top: 0;
  width: 42%; aspect-ratio: 1;
  transform: translateX(-50%);
  background: #d8b48a;
  border-radius: 50%;
}
.fo-exec .fo-leg {
  position: absolute;
  bottom: 0;
  width: 28%; height: 38%;
  background: #1f2937;
  transform-origin: top center;
}
.fo-exec .fo-leg.l { left: 14%; animation: fo-walk-l 0.42s linear infinite; }
.fo-exec .fo-leg.r { right: 14%; animation: fo-walk-r 0.42s linear infinite; }
.fo-exec.arrived .fo-leg { animation: none; }       /* stop walking when seated */
.fo-exec .fo-bob { position: absolute; inset: 0; animation: fo-bob 0.42s ease-in-out infinite; }
.fo-exec.arrived .fo-bob { animation: none; }
@keyframes fo-walk-l { 0%,100%{transform:rotate(18deg);} 50%{transform:rotate(-18deg);} }
@keyframes fo-walk-r { 0%,100%{transform:rotate(-18deg);} 50%{transform:rotate(18deg);} }
@keyframes fo-bob   { 0%,100%{transform:translateY(0);} 50%{transform:translateY(-7%);} }

/* a "fixer" sprite (you) is tinted green */
.fo-exec.fixer .fo-body { background: var(--primary, #22C55E); }
.fo-exec.fixer .fo-head { background: #cfe8d6; }

/* occupancy: little seated heads in a room corner */
.fo-occ {
  position: absolute;
  bottom: 4px; left: 4px;
  display: flex; gap: 3px;
}
.fo-occ i {
  width: 6px; height: 6px; border-radius: 50% 50% 50% 50%;
  background: #d8b48a; display: block;
  box-shadow: 0 3px 0 -1px var(--suit, #3B82F6);
}

/* "+points" floater */
.fo-float {
  position: absolute;
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(11px, 2vw, 15px); font-weight: 700;
  color: var(--primary, #22C55E);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9;
  white-space: nowrap;
  animation: fo-float-up 1s ease-out forwards;
}
.fo-float.bad { color: #ffb4ab; }
@keyframes fo-float-up {
  0%   { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -180%); }
}

/* ── fullscreen / bigscreen ── */
.fo-shell { position: relative; }
.fo-shell.fo-big {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;               /* iOS: dynamic viewport accounts for the address bar */
  z-index: 9999;
  background: #07090a;
  margin: 0;
  padding: max(10px, env(safe-area-inset-top)) 12px max(10px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
/* in fullscreen, the stage fills as much as it can by BOTH width and height */
.fo-shell.fo-big .floor-stage {
  max-width: min(98vw, calc((100dvh - 150px) * 16 / 9));
  width: 100%;
  flex: 0 0 auto;
  transform: perspective(1400px) rotateX(6deg);   /* flatter when playing big */
}
.fo-fullscreen-btn {
  display: inline-flex; align-items: center; gap: 4px;
  cursor: pointer;
}
/* "rotate for a bigger view" hint — only shown in fullscreen + portrait + small screens */
.fo-rotate-hint { display: none; }
@media (max-width: 820px) and (orientation: portrait) {
  .fo-shell.fo-big .fo-rotate-hint {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px; color: #f5d97a;
    padding: 6px; border: 1px dashed rgba(245,217,122,0.4);
  }
}
/* landscape phones in fullscreen: let the stage use the height */
@media (orientation: landscape) and (max-height: 520px) {
  .fo-shell.fo-big { padding: 6px 10px; gap: 6px; }
  .fo-shell.fo-big .floor-stage { max-width: min(96vw, calc((100dvh - 92px) * 16 / 9)); }
}

/* full-stage overlay (start / game over) */
.floor-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: rgba(0,0,0,0.80);
  backdrop-filter: blur(3px);
  z-index: 20;
  text-align: center;
  overflow-y: auto;                 /* never trap the start button off-screen */
  -webkit-overflow-scrolling: touch;
}
/* compact the overlay on short/narrow screens so CLOCK_IN is always visible */
@media (max-width: 640px), (max-height: 520px) {
  .floor-overlay { gap: 5px; justify-content: flex-start; padding: 8px 8px 12px; }
  .floor-overlay p { font-size: 10px; line-height: 1.45; max-width: 100%; }
  .floor-overlay .text-lg { font-size: 0.95rem; }
  .floor-overlay .text-xl { font-size: 1.05rem; }
}
.floor-overlay.hidden { display: none; }

/* brief shake on a mishap */
.floor-stage.fo-shake { animation: fo-shake 0.3s ease; }
@keyframes fo-shake {
  0%,100% { transform: translate(0,0); }
  25% { transform: translate(-3px, 1px); }
  75% { transform: translate(3px, -1px); }
}

@media (prefers-reduced-motion: reduce) {
  .fo-room.fault, .fo-room.request, .fo-room.reconfig, .fo-room.event-crit, .floor-stage.fo-shake, .fo-float,
  .fo-exec .fo-leg, .fo-exec .fo-bob { animation: none !important; }
}

/* ── Floor Ops (canvas game on the boardroom floor) ── */
.fo2-canvas { display:block; width:100%; border:1px solid var(--border-subtle,#30363D); border-radius:6px; background:#0a0c0b; cursor:pointer; touch-action:manipulation; }
.fo2-bar { height:12px; flex:1; min-width:120px; background:#1c211e; border:1px solid #2a2f2c; border-radius:3px; overflow:hidden; }
.fo2-bar > i { display:block; height:100%; background:#22C55E; transition:width .2s, background .3s; }
.fo2-ov { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; gap:10px; padding:16px; background:rgba(6,8,7,.86); backdrop-filter:blur(3px); border-radius:6px; }
.fo2-ov.hidden { display:none; }
.fo2-ov h2 { margin:0; color:#22C55E; font-size:18px; }
.fo2-ov p { margin:0; font-size:12px; color:#a8b0b8; max-width:400px; line-height:1.5; }
.fo2-btn { margin-top:6px; padding:8px 18px; background:#161b18; border:1px solid #2a3f30; color:#ddffee; font-family:'JetBrains Mono',ui-monospace,monospace; font-size:13px; cursor:pointer; border-radius:4px; }
.fo2-btn:hover { background:#22C55E; color:#063; }
.fo2-log { height:54px; overflow:hidden; font-size:10px; color:#6f7a72; line-height:1.5; font-family:'JetBrains Mono',ui-monospace,monospace; }
.fo2-log .ok { color:#7ee2a8; } .fo2-log .err { color:#ffb4ab; } .fo2-log .vio { color:#d8b4fe; }
