/* Corporate Display — player styles (free-positioned layouts) */

:root {
  --bg: #0d1117;
  --panel: #161b22;
  --line: #2a313c;
  --text: #e8eef6;
  --muted: #9fb0c3;
  --accent: #7ab800;
  --up: #3fb950;
  --down: #e5484d;
  --urgent: #e5484d;
  --radius: 14px;
  --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; width: 100%; overflow: hidden;
  background: #000; color: var(--text); font-family: var(--font);
  cursor: none; -webkit-user-select: none; user-select: none;
}

/* Boot splash */
#boot {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
  background: var(--bg); z-index: 9999; transition: opacity .5s ease;
}
#boot.hidden { opacity: 0; pointer-events: none; }
.boot-logo { font-size: 42px; font-weight: 700; }
.boot-status { color: var(--muted); font-size: 16px; }

/* Stage + layout layers (cross-fade) */
#stage { position: absolute; inset: 0; transform-origin: center center; }
.layout-layer {
  position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease;
}
.layout-layer.show { opacity: 1; }

/* A freely-positioned module box. It is a size container, so module text can
   auto-scale to the box (and the box is a % of the screen — so fonts scale up on
   bigger displays). Putting it on .placed lets a module's own root also size to
   the box (e.g. the weather block's base font-size). */
.placed { position: absolute; overflow: hidden; container-type: size; }
.placed > .mod { width: 100%; height: 100%; overflow: hidden; }
.mod-error {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--down); background: #1a1113; border: 1px solid var(--down); border-radius: var(--radius);
  font-size: 14px; text-align: center; padding: 10px;
}

/* Shared card look for panel-style modules */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px;
}
.card-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--muted); margin-bottom: 10px;
}

/* Clock */
.mod-clock { display: flex; flex-direction: column; justify-content: center; align-items: flex-end; text-align: right; line-height: 1.05; }
.mod-clock.card { align-items: flex-end; }
.mod-clock .time { font-size: clamp(20px, 42cqh, 520px); font-weight: 700; font-variant-numeric: tabular-nums; }
.mod-clock .date { font-size: clamp(12px, 16cqh, 180px); color: var(--muted); margin-top: 2px; }

/* Announcement (in-flow) */
.mod-announcement { display: flex; align-items: center; padding: 0 18px; }
.mod-announcement .headline {
  font-size: clamp(16px, 52cqh, 320px); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%;
}
/* Announcement (urgent full-screen overlay) */
#urgent-overlay {
  position: fixed; inset: 0; z-index: 8000;
  background: linear-gradient(160deg, #7a1114, var(--urgent));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 6vw; gap: 24px;
}
#urgent-overlay .label { font-size: 20px; letter-spacing: 3px; text-transform: uppercase; opacity: .85; }
#urgent-overlay .msg { font-size: 5vw; font-weight: 700; line-height: 1.2; }

/* Slideshow + video share the stage look */
.mod-slideshow, .mod-video { position: relative; width: 100%; height: 100%; background: #000; border-radius: var(--radius); overflow: hidden; }
.mod-slideshow .slide {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .8s ease;
}
.mod-slideshow .slide.active { opacity: 1; }
.mod-slideshow img, .mod-video video { width: 100%; height: 100%; }
.fit-contain img, .fit-contain video { object-fit: contain; }
.fit-cover img, .fit-cover video { object-fit: cover; }
.mod-slideshow .empty, .mod-video .empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 15px; text-align: center; padding: 24px;
}

/* Weather — everything sizes off one base font-size (em), so a single
   "Font size" control scales the whole block (label, temp, forecast). The base
   auto-scales to the box; a manual font size overrides it (set inline as vh). */
.mod-weather { display: flex; flex-direction: column; justify-content: center; font-size: clamp(13px, 7cqh, 110px); }
.mod-weather .card-title { font-size: .52em; margin-bottom: .4em; }
.mod-weather .now { display: flex; align-items: center; gap: .45em; }
.mod-weather .icon { font-size: 2.4em; line-height: 1; }
.mod-weather .temp { font-size: 2.2em; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.mod-weather .cond { color: var(--muted); font-size: .82em; margin-top: .1em; }
.mod-weather .forecast { display: flex; justify-content: space-between; margin-top: .55em; gap: .4em; }
.mod-weather .day { text-align: center; flex: 1; }
.mod-weather .day .d { font-size: .58em; color: var(--muted); }
.mod-weather .day .di { font-size: 1.7em; line-height: 1.1; margin: .12em 0; }
.mod-weather .day .dt { font-size: .62em; font-variant-numeric: tabular-nums; }

/* Webframe */
.mod-webframe { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.mod-webframe .card-title { padding: 14px 16px 8px; margin: 0; }
.mod-webframe iframe { border: 0; width: 100%; flex: 1; background: #fff; border-radius: 0 0 var(--radius) var(--radius); }

/* Text module */
.mod-text { display: flex; padding: 10px 14px; }
.mod-text .text { width: 100%; }

/* News ticker */
.mod-news { display: flex; align-items: center; width: 100%; height: 100%; gap: 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 16px; }
.mod-news .tag { background: var(--accent); color: #fff; font-size: clamp(10px, 22cqh, 90px); font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; padding: 6px 14px; border-radius: 8px; white-space: nowrap; flex: 0 0 auto; }
.mod-news .track-wrap { flex: 1; overflow: hidden; white-space: nowrap; }
.mod-news .track { display: inline-block; white-space: nowrap; will-change: transform; }
.mod-news .item { display: inline-block; font-size: clamp(14px, 40cqh, 220px); padding: 0 32px; }
.mod-news .item .src { color: var(--muted); font-size: .8em; margin-left: 8px; }
.mod-news .item::before { content: "•"; color: var(--accent); margin-right: 32px; }
@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Stock ticker */
.mod-stocks { display: flex; align-items: center; width: 100%; height: 100%; gap: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 16px; overflow: hidden; }
.mod-stocks .tag { background: #7ab800; color: #fff; font-size: clamp(10px, 22cqh, 90px); font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; padding: 6px 14px; border-radius: 8px; white-space: nowrap; flex: 0 0 auto; }
.mod-stocks .track-wrap { flex: 1; overflow: hidden; white-space: nowrap; }
.mod-stocks .track { display: inline-block; white-space: nowrap; will-change: transform; }
.mod-stocks .q { display: inline-flex; align-items: baseline; gap: 8px; padding: 0 26px; font-size: clamp(14px, 40cqh, 220px); }
.mod-stocks .q .sym { font-weight: 700; }
.mod-stocks .q .px { font-variant-numeric: tabular-nums; }
.mod-stocks .q .chg { font-size: .85em; font-variant-numeric: tabular-nums; }
.mod-stocks .q .up { color: var(--up); }
.mod-stocks .q .down { color: var(--down); }
.mod-stocks.static .track { animation: none !important; }
