/* The TV is designed on a fixed 1920x1080 canvas and scaled to fit any screen. */
:root {
  /* club colours; overridden at runtime from settings (primary/accent) */
  --primary: #0F7E34;
  --accent: #FAEA01;
  --bg: #04200f;
  --bg-2: #0a3a1c;
  --glow: #14873c;
  --card: rgba(255, 255, 255, 0.06);
  --card-line: rgba(255, 255, 255, 0.10);
  --text: #f4f7fb;
  --muted: #a9c7b3;
  --men: var(--accent);
  --ladies: #ffffff;
  --youth: #80DB80;
  --win: #4ade80;
  --draw: #f59e0b;
  --loss: #ef4444;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Barlow', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #000; cursor: none; }
body { font-family: var(--body); color: var(--text); -webkit-font-smoothing: antialiased; }

/* The stage is laid out at (at least) 1920x1080 and scaled so it exactly fills the screen;
   on screens that aren't 16:9 the extra room goes to the layout, never to black bars. */
#viewport { position: fixed; inset: 0; overflow: hidden; background: var(--bg); }
#stage {
  position: absolute; left: 0; top: 0; width: 1920px; height: 1080px;
  transform-origin: 0 0; overflow: hidden;
  background: radial-gradient(1200px 700px at 85% -10%, var(--glow) 0%, transparent 60%),
              linear-gradient(160deg, var(--bg-2), var(--bg) 55%);
}

.bg-orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .35; pointer-events: none; }
.orb-a { width: 700px; height: 700px; background: var(--accent); left: -250px; bottom: -380px; opacity: .14; }
.orb-b { width: 600px; height: 600px; background: var(--primary); right: -200px; top: 200px; opacity: .35; }

/* ---------- top bar ---------- */
#topbar {
  position: absolute; left: 0; right: 0; top: 0; height: 120px; padding: 0 64px;
  display: flex; align-items: center; justify-content: space-between; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 24px; }
#logo { height: 100px; width: auto; filter: drop-shadow(0 6px 16px rgba(0,0,0,.45)); }
#logo[hidden] { display: none; }
#display-title { font-family: var(--display); font-weight: 800; font-size: 50px; letter-spacing: .5px; text-transform: uppercase; line-height: 1; }
#tagline { color: var(--accent); opacity: .85; font-size: 22px; margin-top: 6px; letter-spacing: 1px; }
.clock { text-align: right; }
#clock-time { font-family: var(--display); font-weight: 700; font-size: 64px; line-height: 1; font-variant-numeric: tabular-nums; }
#clock-date { color: var(--muted); font-size: 22px; margin-top: 4px; }

#progress { position: absolute; top: 120px; left: 64px; right: 64px; height: 4px; background: rgba(255,255,255,.08); border-radius: 2px; overflow: hidden; z-index: 5; }
#progress-bar { height: 100%; width: 0; background: var(--accent); }

/* ---------- slides ---------- */
#slides { position: absolute; left: 0; right: 0; top: 124px; bottom: 76px; }
.slide { position: absolute; inset: 0; padding: 36px 64px 28px; display: flex; flex-direction: column; }

.slide-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 26px; }
.eyebrow { display: inline-flex; align-items: center; gap: 12px; font-family: var(--display); font-weight: 600; font-size: 26px; letter-spacing: 3px; text-transform: uppercase; color: var(--accent); }
.eyebrow .dot { width: 12px; height: 12px; border-radius: 50%; background: currentColor; }
.slide-title { font-family: var(--display); font-weight: 800; font-size: 84px; line-height: .95; text-transform: uppercase; letter-spacing: .5px; }
.slide-note { color: var(--muted); font-size: 24px; padding-bottom: 8px; }

/* fixtures */
.fx-list { display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 0; }
.fx-day { font-family: var(--display); font-weight: 700; font-size: 28px; color: var(--muted); text-transform: uppercase; letter-spacing: 2px; margin: 10px 0 2px; }
.fx-day:first-child { margin-top: 0; }
.fx-row {
  display: grid; grid-template-columns: 150px 250px 1fr 150px; align-items: center; gap: 28px;
  background: var(--card); border: 1px solid var(--card-line); border-radius: 14px; height: 66px; padding: 0 26px;
}
.fx-time { font-family: var(--display); font-weight: 700; font-size: 38px; font-variant-numeric: tabular-nums; }
.fx-time.tbc { color: var(--muted); font-size: 28px; }
.team-pill { justify-self: start; font-family: var(--display); font-weight: 700; font-size: 30px; padding: 4px 18px; border-radius: 8px; background: var(--group, var(--men)); color: var(--bg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.fx-opp { font-size: 34px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-opp .v { color: var(--muted); margin-right: 12px; font-family: var(--display); }
.ha { justify-self: end; font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: 2px; padding: 6px 16px; border-radius: 999px; border: 2px solid var(--card-line); color: var(--muted); }
.ha.home { border-color: var(--accent); color: var(--accent); }

.g-Men { --group: var(--men); } .g-Ladies { --group: var(--ladies); } .g-Youth { --group: var(--youth); }

/* results */
.rs-grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 176px; gap: 22px; }
.rs-card {
  position: relative; background: var(--card); border: 1px solid var(--card-line); border-radius: 18px;
  padding: 22px 28px 22px 40px; display: grid; grid-template-columns: 1fr auto; align-items: center; overflow: hidden;
}
.rs-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 12px; background: var(--oc); }
.rs-card.W { --oc: var(--win); } .rs-card.D { --oc: var(--draw); } .rs-card.L { --oc: var(--loss); }
.rs-team { font-family: var(--display); font-weight: 700; font-size: 38px; line-height: 1.05; }
.rs-opp { color: var(--muted); font-size: 26px; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 330px; }
.rs-date { color: var(--muted); font-size: 18px; margin-top: 10px; letter-spacing: 1px; text-transform: uppercase; }
.rs-score { font-family: var(--display); font-weight: 800; font-size: 86px; line-height: 1; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 10px; }
.rs-score .dash { color: var(--muted); font-weight: 500; }
.rs-badge { position: absolute; top: 16px; right: 18px; font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: 2px; color: var(--oc); }

/* photo */
.slide.photo { padding: 0; }
.photo-bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(40px) brightness(.45) saturate(1.2); }
.photo-frame { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; }
.photo-frame img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.photo-caption {
  position: absolute; left: 64px; bottom: 36px; max-width: 1100px; padding: 22px 30px; border-radius: 16px;
  background: rgba(3, 26, 12, .75); backdrop-filter: blur(10px); border: 1px solid var(--card-line);
}
.photo-caption .handle { display: flex; align-items: center; gap: 12px; font-family: var(--display); font-weight: 700; font-size: 28px; color: var(--accent); }
.photo-caption .handle svg { width: 28px; height: 28px; }
.photo-caption p { font-size: 26px; line-height: 1.35; margin-top: 8px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* announcement */
.slide.announcement { justify-content: center; }
.ann { display: grid; grid-template-columns: 1fr; gap: 60px; align-items: center; }
.ann.has-image { grid-template-columns: 1fr 760px; }
.ann-title { font-family: var(--display); font-weight: 800; font-size: 120px; line-height: .92; text-transform: uppercase; margin: 18px 0 30px; }
.ann-body { font-size: 38px; line-height: 1.4; color: #dbe4ef; max-width: 1100px; white-space: pre-line; }
.ann-img { width: 760px; height: 640px; border-radius: 22px; object-fit: cover; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.ann-bar { width: 140px; height: 10px; background: var(--accent); border-radius: 5px; }

/* what's on */
.wo-cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 40px; align-content: start; }
.wo-day { grid-column: span 1; }
.wo-day h3 { font-family: var(--display); font-weight: 700; font-size: 32px; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 10px; color: var(--accent); }
.wo-day h3 small { color: var(--muted); font-weight: 600; margin-left: 10px; }
.wo-item { display: grid; grid-template-columns: 14px 150px 1fr; gap: 18px; align-items: center; padding: 12px 20px; background: var(--card); border: 1px solid var(--card-line); border-radius: 12px; margin-bottom: 10px; }
.wo-item .sw { width: 14px; height: 44px; border-radius: 4px; background: var(--sc); box-shadow: 0 0 0 2px rgba(255,255,255,.3); }
.wo-item .t { font-family: var(--display); font-weight: 700; font-size: 32px; font-variant-numeric: tabular-nums; }
.wo-item .n { font-size: 28px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wo-item .a { color: var(--muted); font-size: 21px; }

/* welcome / empty */
.slide.welcome { justify-content: center; align-items: flex-start; }
.welcome h1 { font-family: var(--display); font-weight: 800; font-size: 150px; line-height: .9; text-transform: uppercase; }
.welcome p { font-size: 40px; color: var(--muted); margin-top: 26px; }

/* ---------- ticker ---------- */
#ticker { position: absolute; left: 0; right: 0; bottom: 0; height: 76px; display: flex; align-items: stretch; background: rgba(0,0,0,.35); border-top: 1px solid var(--card-line); z-index: 5; }
.ticker-label { display: grid; place-items: center; padding: 0 34px 0 64px; background: var(--accent); color: var(--bg); font-family: var(--display); font-weight: 800; font-size: 30px; letter-spacing: 3px; clip-path: polygon(0 0, 100% 0, calc(100% - 24px) 100%, 0 100%); }
.ticker-track { position: relative; flex: 1; overflow: hidden; }
#ticker-inner { position: absolute; top: 0; bottom: 0; left: 0; display: flex; align-items: center; white-space: nowrap; font-size: 30px; font-weight: 500; }
#ticker-inner .item { padding: 0 40px; display: inline-flex; align-items: center; gap: 14px; }
#ticker-inner .sep { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); opacity: .7; }
#ticker-inner b { font-family: var(--display); font-weight: 700; }
.oc-W { color: var(--win); } .oc-D { color: var(--draw); } .oc-L { color: var(--loss); }

#offline { position: absolute; right: 24px; top: 132px; font-size: 18px; color: #111; background: var(--draw); padding: 6px 14px; border-radius: 8px; z-index: 6; }

/* club crest: watermark on photos, hero on the welcome slide */
.photo-crest { position: absolute; right: 56px; bottom: 40px; height: 150px; opacity: .92; filter: drop-shadow(0 8px 24px rgba(0,0,0,.6)); }
.welcome { display: grid; grid-template-columns: auto 1fr; gap: 70px; align-items: center; }
.welcome-crest { height: 520px; filter: drop-shadow(0 20px 50px rgba(0,0,0,.5)); }
.welcome h1 { color: #fff; } .welcome h1 span { color: var(--accent); }

#fit-debug { position: absolute; left: 12px; top: 12px; z-index: 99; font: 16px/1.3 monospace; color: #fff; background: rgba(0,0,0,.7); padding: 6px 10px; border-radius: 6px; white-space: pre; }
