/* ---------- floor screen section: the TV on the wall ---------- */
.floorsec { background: linear-gradient(180deg, var(--board) 0, #04101d clamp(160px, 22vw, 320px)); color: var(--on-board); padding: clamp(72px, 9vw, 120px) 0; position: relative; overflow: hidden; }
.floorsec::before { content: ""; position: absolute; left: 50%; top: 42%; width: 70%; height: 60%; transform: translate(-50%, -50%); background: radial-gradient(ellipse, rgba(90,169,255,.16), transparent 70%); pointer-events: none; }
.floorsec > .wrap { position: relative; max-width: 1400px; }
.floorsec-title { color: #fff; text-align: center; margin: 0 auto 14px; }
.floorsec-sub { text-align: center; max-width: 34em; margin: 0 auto clamp(32px, 4.5vw, 48px); color: var(--on-board-dim); font-size: clamp(1.02rem, 1.3vw, 1.15rem); line-height: 1.5; }

.tv-stage { position: relative; max-width: 1240px; margin: 0 auto; }
.tv-toggle { display: flex; width: max-content; margin: 0 auto 14px; max-width: 1240px; display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--on-board); cursor: pointer; user-select: none; }
.tv-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tv-toggle .sw { width: 40px; height: 22px; border-radius: 999px; background: rgba(255,255,255,.14); position: relative; transition: background .2s; }
.tv-toggle .sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.tv-toggle input:checked + .sw { background: var(--accent); }
.tv-toggle input:checked + .sw::after { transform: translateX(18px); }
.tv-toggle input:focus-visible + .sw { outline: 2px solid var(--idle); outline-offset: 3px; }

/* the TV: thin bezel, slight sheen, wall shadow */
.tv { margin: 0 auto; max-width: 1240px; padding: 10px; border-radius: 16px; background: linear-gradient(#141821, #07090d); box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 50px 120px -40px rgba(0,0,0,.9), 0 0 80px -10px rgba(90,169,255,.18); transform-origin: 50% 50%; transition: transform .9s cubic-bezier(.2,.7,.2,1), filter .9s; }
.tv-screen { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 6px; background: #0c1224; }
.tv-screen::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, rgba(255,255,255,.06), transparent 35%); }
.tv-stage.far .tv { transform: scale(.4); filter: blur(2.6px); }
.tv-far-note { position: absolute; left: 0; right: 0; top: calc(36px + 5%); text-align: center; margin: 0 auto; max-width: 30em; padding: 0 16px; font-size: clamp(1.1rem, 2vw, 1.6rem); font-weight: 600; line-height: 1.35; color: #fff; opacity: 0; transition: opacity .6s .4s; pointer-events: none; }
.tv-stage.far .tv-far-note { opacity: 1; }

/* legend */
.tv-legend { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 1240px; margin: 0 auto 20px; }
.tv-legend button { display: flex; align-items: flex-start; gap: 12px; text-align: left; padding: 14px 16px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid var(--board-line); color: var(--on-board-dim); font-size: .88rem; line-height: 1.35; transition: background .2s, border-color .2s; }
.tv-legend button b { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: rgba(90,169,255,.18); color: var(--accent); font-size: .78rem; }
.tv-legend button strong { display: block; color: #fff; font-size: 1rem; font-weight: 650; margin-bottom: 2px; }
.tv-legend button:hover, .tv-legend button[aria-pressed="true"] { background: rgba(90,169,255,.12); border-color: rgba(90,169,255,.45); }
.tv-legend button[aria-pressed="true"] b { background: var(--accent); color: #fff; }
.tv-facts { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px; font-size: .82rem; color: var(--on-board-dim); }
.tv-facts .bi { color: var(--accent); margin-right: 8px; }

@media (max-width: 900px) {
  .tv-legend { grid-template-columns: 1fr 1fr; }
  .tv { padding: 6px; border-radius: 10px; }
}
@media (max-width: 520px) {
  .tv-legend { grid-template-columns: 1fr; }
  .tv-stage.far .tv { transform: scale(.4) translateY(45%); }   /* leave room for the note above */
}
@media (prefers-reduced-motion: reduce) { .tv, .tv-far-note { transition: none; } }

/* ---------- the board (floor/page.tsx), 1920 x 1080, scaled ---------- */
.fl { position: absolute; top: 0; left: 0; width: 1920px; height: 1080px; transform-origin: 0 0; box-sizing: border-box;
  display: flex; flex-direction: column; gap: 16px; padding: 20px; background: #0c1224; color: #f4f6fb;
  font-family: "Manrope", "Helvetica Neue", Arial, sans-serif; font-feature-settings: "tnum"; line-height: 1.25; text-align: left; }
.fl * { box-sizing: border-box; }
.fl-head { display: flex; justify-content: space-between; align-items: baseline; }
.fl-head h1 { margin: 0; font-size: 36px; font-weight: 800; letter-spacing: -0.025em; color: #f4f6fb; }
.fl-head .sep { margin: 0 12px; font-weight: 500; color: #64739e; }
.fl-head .crew { color: #8fa0c4; }
.fl-head p { margin: 0; font-size: 36px; font-weight: 800; }
.fl-head .lbl { margin-left: 12px; font-size: 18px; font-weight: 500; color: #8fa0c4; }
.fl-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 1fr; gap: 8px; }
.fl-card { position: relative; margin: 22px; min-height: 0; overflow: hidden; border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; transition: background-color .5s, box-shadow .5s; }
.fl-card.chg { animation: fl-chg 1s ease-out; }
@keyframes fl-chg { from { filter: brightness(1.35); } to { filter: none; } }
.fl-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.fl-names { display: flex; align-items: center; gap: 12px; min-width: 0; }
.fl-name { font-size: 30px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-corner { margin-left: auto; flex: none; font-size: 24px; font-weight: 800; white-space: nowrap; }
.fl-corner .bi { font-size: 20px; margin-right: 4px; }
.fl-corner span { margin-left: 6px; font-size: 16px; font-weight: 500; }
.fl-mid { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.fl-big { position: relative; font-size: 96px; font-weight: 800; line-height: 1; }
.fl-big .bi { position: absolute; right: 100%; top: 50%; transform: translateY(-50%); font-size: 60px; }
.fl-big span { position: absolute; left: 100%; bottom: 8px; margin-left: 8px; font-size: 24px; font-weight: 500; white-space: nowrap; }
.fl-stop { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.fl-timer { font-size: 72px; font-weight: 800; line-height: 1; }
.fl-reason { font-size: 30px; font-weight: 600; }
.fl-al { margin-top: auto; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.18); }
table.fl-al { width: 100%; border-collapse: collapse; font-size: 24px; }
table.fl-al td { padding: 4px 0; white-space: nowrap; }
.fl-al td.t { width: 36px; font-size: 30px; } .fl-al td.t .bi { display: block; line-height: 1; }
.fl-al td.n { font-weight: 600; max-width: 1px; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.fl-al td.d { text-align: right; font-weight: 700; padding-left: 12px; }
.fl-al td.c { text-align: right; font-size: 20px; padding-left: 12px; }
.fl-al .new { display: inline-block; margin-right: 8px; padding: 0 6px; border-radius: 4px; background: rgba(255,255,255,.22); font-size: 16px; font-weight: 700; text-transform: uppercase; vertical-align: 3px; }
.fl-al.empty { font-size: 20px; font-weight: 500; }

/* legend highlights: dim the board, lift the part being explained */
.fl-dim { position: absolute; inset: 0; z-index: 2; background: rgba(4, 8, 20, .74); opacity: 0; pointer-events: none; transition: opacity .3s; }
.fl.hl .fl-dim { opacity: 1; }
.fl.hl-fill .fl-card { z-index: 3; box-shadow: 0 0 0 4px #0c1224 !important; }
.fl.hl-fill .fl-card > * { opacity: .25; }
.fl.hl-frame .fl-card { z-index: 3; }
.fl.hl-frame .fl-card::after { content: ""; position: absolute; inset: 0; background: rgba(4, 8, 20, .82); border-radius: inherit; }
.fl.hl-alarms .alarms, .fl.hl-operator .op { position: relative; z-index: 3; }
.fl.hl-alarms .fl-card, .fl.hl-operator .fl-card { box-shadow: 0 0 0 4px #0c1224 !important; }
.fl.hl-alarms .alarms { outline: 3px solid #5AA9FF; outline-offset: 6px; border-radius: 6px; }
.fl.hl-operator .op { outline: 4px solid #5AA9FF; outline-offset: 6px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { .fl-card, .fl-dim { transition: none; } .fl-card.chg { animation: none; } }
