/* ═══════════════════════════════════════════════════════════════
   css/core.css — Base layout, TV board, typography, animations.
   Brand-agnostic. Never edit for branding — use brand-*.css instead.
   ═══════════════════════════════════════════════════════════════ */

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Self-hosted board font ────────────────────────────────── */
@font-face {
  font-family: 'Anton';
  src: url('../fonts/Anton-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ── Design tokens (defaults — overridden by brand CSS) ─────── */
:root {
  --brand-primary:       #FF6A00;
  --brand-bg:            #0F1117;
  --brand-header-accent: transparent;   /* bottom border on header */
  --brand-surface:       rgba(255,255,255,0.06);
  --brand-border:        rgba(255,255,255,0.10);
  --brand-text:          #FFFFFF;
  --brand-subtext:       rgba(255,255,255,0.45);

  --font-board: 'Anton', Impact, Haettenschweiler, 'Arial Narrow Bold', Arial, sans-serif;
  --font-ui:    system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;

  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-full: 9999px;
}

html, body {
  min-height: 100%;
  background: var(--brand-bg);
  color: var(--brand-text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

/* ── TV display: prevent overflow ───────────────────────────── */
body:not(.settings-page) { overflow: hidden; }

/* ═══════════════════════════════════════════════════════════════
   TV DISPLAY LAYOUT
   ═══════════════════════════════════════════════════════════════ */

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* ── Header ─────────────────────────────────────────────────── */
.board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  padding: clamp(8px, 1.5vh, 20px) clamp(16px, 2.5vw, 44px);
  background: var(--brand-bg);
  border-bottom: 3px solid var(--brand-header-accent);
}

.header-clock {
  flex: 1;
  font-family: var(--font-board);
  font-size: clamp(1.8rem, 4vw, 4.5rem);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: left;
}

.header-label {
  flex: 1;
  font-family: var(--font-board);
  font-size: clamp(1.8rem, 4vw, 4.5rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: right;
  line-height: 1;
}

/* ── Header logo (centre) ──────────────────────────────────── */
.header-logo {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 clamp(8px, 1.5vw, 24px);
}

.header-logo-img {
  height: clamp(2.8rem, 6vw, 6.5rem);
  max-width: 300px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.25));
}

.header-logo-text {
  font-family: var(--font-board);
  font-size: clamp(1.8rem, 4vw, 4.5rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--brand-text);
}

/* ── Board body (fills remaining height) ────────────────────── */
.board-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ── Sessions list ──────────────────────────────────────────── */
.sessions-list {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 2px;
  padding: 2px 0;
}

/* ── Session bar ────────────────────────────────────────────── */
.session-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  min-height: 0;
  padding: 0 clamp(14px, 3vw, 52px);
  /* background-color and color are set by JS from colour.hex */
}

.session-bar-name,
.session-bar-timer {
  font-family: var(--font-board);
  font-size: clamp(1.6rem, 5vw, 5.5rem);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* < 5 min: pulse the entire bar for urgency */
.session-bar.expiring-soon {
  animation: barPulse 1s ease-in-out infinite;
}

@keyframes barPulse {
  0%, 100% { filter: brightness(1);    }
  50%       { filter: brightness(1.25); }
}

/* Ended: visibly dimmed */
.session-bar.ended { opacity: 0.42; }

/* ── Off-schedule state screens ─────────────────────────────── */
.state-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 10px;
  text-align: center;
  padding: 20px;
}

.state-time {
  font-family: var(--font-board);
  font-size: clamp(3rem, 10vw, 10rem);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  opacity: 0.18;
  line-height: 1;
}

.state-label {
  font-size: clamp(0.9rem, 1.8vw, 1.4rem);
  color: var(--brand-subtext);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.state-hint {
  font-size: clamp(0.7rem, 1.2vw, 1rem);
  color: var(--brand-subtext);
  opacity: 0.5;
}

.state-hint kbd {
  display: inline-block;
  padding: 1px 7px;
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: 4px;
  font-family: inherit;
}

/* ── Corner zone (secret settings entry) ───────────────────── */
#corner-zone {
  position: fixed;
  top: 0; left: 0;
  width: 80px; height: 80px;
  z-index: 999;
}

/* ── Theme particle layer ───────────────────────────────────── */
.theme-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 500;
  overflow: hidden;
}

.theme-particle {
  position: absolute;
  top: -8%;
  animation: particleFall linear infinite;
  user-select: none;
  line-height: 1;
}

.theme-particle--bat {
  animation-name: batFloat;
}

@keyframes particleFall {
  0%   { transform: translateY(-5vh) rotate(0deg);   opacity: 1; }
  100% { transform: translateY(110vh) rotate(540deg); opacity: 0; }
}

@keyframes batFloat {
  0%   { transform: translateY(-5vh) translateX(0)    rotate(-10deg); opacity: 1; }
  25%  { transform: translateY(25vh) translateX(20px)  rotate(10deg);  }
  50%  { transform: translateY(55vh) translateX(-15px) rotate(-8deg);  }
  75%  { transform: translateY(80vh) translateX(10px)  rotate(6deg);   }
  100% { transform: translateY(110vh) translateX(0)   rotate(0deg);   opacity: 0; }
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--brand-border); border-radius: 3px; }
