/* The Morale Reel: shared by reel.html and reel-field.html. */
/* One unit, --u, sizes everything (as ops.html and network.html). Landscape wall: a 100 × 56.25 u canvas;
   portrait wall only with ?wall; phones and narrow windows get a scrolling stack. Red is for the stamp. */
:root {
  --u: clamp(8px, 2.4vw, 11px);
  --stone: #6B6458;
  --line: calc(0.22 * var(--u)) solid var(--ink);
  --drop: calc(0.5 * var(--u)) calc(0.5 * var(--u)) 0 var(--ink);
  --gap: calc(1.2 * var(--u));
}
html, body { background: var(--bg); }
body { font-size: calc(1.8 * var(--u)); line-height: 1.3; }
.board { display: grid; gap: var(--gap); padding: var(--gap); grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "top" "stage" "now" "stamp" "next" "bulletin" "about"; }
.panel { position: relative; background: var(--bg); border: var(--line); box-shadow: var(--drop); min-width: 0; min-height: 0; overflow: hidden; }
.k { font-size: calc(1.2 * var(--u)); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--stone); }
.num { font-variant-numeric: tabular-nums; }

/* ── top bar ── */
.top { grid-area: top; overflow: hidden; display: flex; align-items: center; flex-wrap: wrap; gap: calc(0.4 * var(--u)) calc(1.6 * var(--u));
  background: var(--ink); color: var(--bg); border: var(--line); box-shadow: var(--drop); padding: calc(0.6 * var(--u)) calc(1.4 * var(--u)); }
.top .logo { font-size: calc(1.8 * var(--u)); text-decoration: none; color: inherit; font-weight: 700; }
.top .logo .no { color: var(--red); }
.top h1 { font-size: calc(1.8 * var(--u)); font-weight: 500; letter-spacing: -0.01em; white-space: nowrap; }
.top .motto { font-size: calc(1.4 * var(--u)); color: #CFC8B6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.top .spacer { flex: 1; }
.top .count { font-size: calc(1.4 * var(--u)); color: #CFC8B6; white-space: nowrap; }
.top .count b { color: var(--bg); }
.top .clock { font-size: calc(2.8 * var(--u)); font-weight: 700; letter-spacing: -0.03em; line-height: 1; }

/* ── the screen ── */
.stage { grid-area: stage; background: var(--ink); aspect-ratio: 16 / 9; }
.stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity 0.5s ease; }
.stage video.on { opacity: 1; }
.stage .tag { position: absolute; left: calc(1 * var(--u)); top: calc(1 * var(--u)); z-index: 2; background: var(--yellow); color: var(--ink);
  border: var(--line); font-size: calc(1.2 * var(--u)); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; padding: calc(0.2 * var(--u)) calc(0.7 * var(--u)); }
.stage .bar { position: absolute; left: 0; right: 0; bottom: 0; height: calc(0.6 * var(--u)); z-index: 2; background: rgba(253, 250, 242, 0.15); }
.stage .bar i { display: block; height: 100%; width: 0; background: var(--red); }
.stage .msg[hidden] { display: none; }
.stage .msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--bg); font-size: calc(2 * var(--u)); text-align: center; padding: var(--gap); }

/* ── now screening ── */
.now { grid-area: now; padding: calc(1.2 * var(--u)) calc(1.4 * var(--u)); display: flex; flex-direction: column; gap: calc(0.5 * var(--u)); }
.now h2 { font-size: calc(3 * var(--u)); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; overflow-wrap: anywhere; }
.now .src { font-size: calc(1.5 * var(--u)); color: var(--stone); }
.now .ctl { display: flex; gap: calc(0.8 * var(--u)); margin-top: auto; padding-top: calc(0.6 * var(--u)); }
.now button { font: inherit; font-size: calc(1.5 * var(--u)); font-weight: 700; background: var(--yellow); color: var(--ink); border: var(--line);
  box-shadow: calc(0.3 * var(--u)) calc(0.3 * var(--u)) 0 var(--ink); padding: calc(0.5 * var(--u)) calc(1.2 * var(--u)); cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease; }
.now button.alt { background: var(--bg); }
.now button:hover { transform: translate(-2px, -2px); box-shadow: calc(0.3 * var(--u) + 2px) calc(0.3 * var(--u) + 2px) 0 var(--ink); }
.now button:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

/* ── inspection stamp ── */
.stamp { grid-area: stamp; padding: calc(1.2 * var(--u)) calc(1.4 * var(--u)); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: calc(1.4 * var(--u)); align-items: center; }
.stamp .seal { color: var(--red); border: calc(0.4 * var(--u)) solid var(--red); border-radius: calc(0.6 * var(--u)); padding: calc(0.6 * var(--u)) calc(1 * var(--u));
  text-align: center; transform: rotate(-7deg); line-height: 1; font-weight: 700; text-transform: uppercase; }
.stamp .seal small { display: block; font-size: calc(1.1 * var(--u)); letter-spacing: 0.16em; }
.stamp .seal b { display: block; font-size: calc(2.2 * var(--u)); letter-spacing: -0.01em; margin: calc(0.3 * var(--u)) 0; }
.stamp.hit .seal { animation: thump 0.35s ease-out; }
@keyframes thump { 0% { transform: rotate(-7deg) scale(1.6); opacity: 0; } 100% { transform: rotate(-7deg) scale(1); opacity: 1; } }
.stamp dl { display: grid; grid-template-columns: auto auto; gap: calc(0.2 * var(--u)) calc(1 * var(--u)); font-size: calc(1.3 * var(--u)); justify-content: start; white-space: nowrap; }
.stamp dt { color: var(--stone); }
.stamp dd { font-weight: 700; }

/* ── up next ── */
.next { grid-area: next; display: grid; grid-template-columns: calc(12 * var(--u)) minmax(0, 1fr); }
.next .pic { background: var(--ink) center / cover no-repeat; border-right: var(--line); aspect-ratio: 16 / 10; }
.next .txt { padding: calc(0.8 * var(--u)) calc(1.2 * var(--u)); display: flex; flex-direction: column; justify-content: center; gap: calc(0.3 * var(--u)); min-width: 0; }
.next .t { font-size: calc(1.7 * var(--u)); font-weight: 700; line-height: 1.15; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }

/* ── bulletin ── */
.bulletin { grid-area: bulletin; display: flex; align-items: center; gap: calc(1.2 * var(--u)); background: var(--yellow); border: var(--line); box-shadow: var(--drop);
  padding: 0 calc(1.4 * var(--u)); min-height: calc(3.6 * var(--u)); overflow: hidden; }
.bulletin .k { color: var(--ink); white-space: nowrap; }
.bulletin .line { font-size: calc(1.5 * var(--u)); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity 0.4s ease; }

/* ── about (not on the wall) ── */
.about { grid-area: about; padding: calc(2 * var(--u)); font-size: 16px; line-height: 1.6; max-width: 72ch; }
.about h2 { font-size: 26px; letter-spacing: -0.02em; margin-bottom: 8px; }
.about h3 { font-size: 18px; margin: 18px 0 6px; }
.about p, .about ul { margin-bottom: 10px; } .about ul { padding-left: 20px; }
.about nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.about nav a { border: var(--border); box-shadow: var(--shadow-sm); padding: 4px 12px; color: var(--ink); text-decoration: none; font-weight: 600; background: var(--bg);
  transition: transform 0.12s ease, box-shadow 0.12s ease; }
.about nav a:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }

@media (max-width: 999px) {
  .top .motto { white-space: normal; }
  .bulletin .line { white-space: normal; padding: calc(0.6 * var(--u)) 0; }
}

/* Landscape wall: any window ≥ 1000 px wide and wider than 13:10. */
@media (min-width: 1000px) and (min-aspect-ratio: 13/10) {
  :root { --u: min(1vw, 1.7778vh); }
  html, body { height: 100%; overflow: hidden; }
  body { display: grid; place-items: center; }
  .board {
    width: 100vw; height: 100vh;   /* fills the window (owner 2026-11-25: a 16:9 board left "a lot of space on right and left" in a browser window); the flexible columns take the extra */
    grid-template-columns: minmax(0, 1fr) calc(32 * var(--u));
    grid-template-rows: auto minmax(0, 1fr) auto auto calc(3.6 * var(--u));
    grid-template-areas: "top top" "stage now" "stage stamp" "stage next" "bulletin bulletin";
  }
  .stage { aspect-ratio: auto; }
  .top { flex-wrap: nowrap; }
  .about { display: none; }
}

/* Portrait wall (?wall only). */
@media (max-aspect-ratio: 3/4) {
  :root.wall { --u: min(1.7778vw, 1vh); }
  .wall, .wall body { height: 100%; overflow: hidden; }
  .wall body { display: grid; place-items: center; }
  .wall .board {
    width: calc(56.25 * var(--u)); height: calc(100 * var(--u));
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto auto calc(5.4 * var(--u));
    grid-template-areas: "top top" "stage stage" "now now" "stamp next" "bulletin bulletin";
  }
  .wall .stage { aspect-ratio: auto; }
  .wall .top { flex-wrap: nowrap; gap: calc(1 * var(--u)); }
  .wall .top .motto { display: none; }
  .wall .top h1 { font-size: calc(1.5 * var(--u)); }
  .wall .top .count { font-size: calc(1.2 * var(--u)); }
  .wall .top .clock { font-size: calc(2.2 * var(--u)); }
  .wall .stamp { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .wall .next { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .wall .next .pic { border-right: 0; border-bottom: var(--line); aspect-ratio: auto; }
  .wall .bulletin .line { white-space: normal; }
  .wall .about { display: none; }
}
.wall.idle body { cursor: none; }
.wall .now .ctl { display: none; }
/* Landscape wall: without its buttons "Now screening" was mostly empty (2026-11-25), so the next clip takes that height,
   its picture above its title. */
@media (min-width: 1000px) and (min-aspect-ratio: 13/10) {
  .wall .board { grid-template-rows: auto auto auto minmax(0, 1fr) calc(3.6 * var(--u)); }
  .wall .next { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .wall .next .pic { border-right: 0; border-bottom: var(--line); aspect-ratio: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .stage video, .bulletin .line { transition: none; }
  .stamp.hit .seal { animation: none; }
}
