@font-face {
  font-family: "League Spartan";
  src: url("fonts/league-spartan.woff2") format("woff2");
  font-weight: 500 900;
  font-display: block;
}

:root {
  --navy-900: #050d1d;
  --navy-800: #081632;
  --navy-700: #0d2247;
  --navy-600: #153163;
  --gold: #c9a44c;
  --gold-bright: #f3d98f;
  --gold-dim: #7d672f;
  --ink: #f4f1e8;

  /* Layout, in stage pixels. Change here; overlay.js reads the resulting rects. */
  /* 352px panels leave two 608×1080 board slots: a 16:9 camera turned 90° fits exactly. */
  --panel-w: 352px;
  --board-w: calc((1920px - 2 * var(--panel-w)) / 2);
  --pad: 16px;
  --legend-top: 70px;
  --legend-h: 120px;
  --face-top: 202px;
  --face-h: 180px;
  --bf-h: 64px;
  --hand-top: 495px;
  --hand-bottom: 16px;
}

* {
  box-sizing: border-box;
}

/* Author display rules (flex/grid) would otherwise beat the hidden attribute. */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: transparent;
}

#stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1920px;
  height: 1080px;
  transform-origin: 0 0;
  font-family: "League Spartan", "Avenir Next", Futura, sans-serif;
  color: var(--ink);
  text-transform: uppercase;
}

/* ---- side panels ------------------------------------------------------- */

.panel {
  position: absolute;
  top: 0;
  width: var(--panel-w);
  height: 1080px;
}
.panel[data-player="0"] {
  left: 0;
}
.panel[data-player="1"] {
  right: 0;
}

/* Painted with holes cut for the camera slots (clip-path set by overlay.js). */
.panel-bg {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(118deg, rgba(120, 170, 255, 0.045) 0 2px, transparent 2px 46px),
    radial-gradient(120% 60% at 50% 0%, var(--navy-600) 0%, transparent 70%),
    linear-gradient(180deg, var(--navy-700) 0%, var(--navy-800) 45%, var(--navy-900) 100%);
}
.panel::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold) 30%, var(--gold-dim));
}
.panel[data-player="0"]::after {
  right: 0;
}
.panel[data-player="1"]::after {
  left: 0;
}

.panel > :not(.panel-bg) {
  position: absolute;
  left: var(--pad);
  right: var(--pad);
}

.name {
  top: 14px;
  height: 46px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
}
.name span {
  padding-top: 0.12em; /* League Spartan caps sit high in the line box */
}

.legend,
.battlefield,
.slot {
  box-shadow: inset 0 0 0 2px var(--gold);
}

.legend {
  top: var(--legend-top);
  height: var(--legend-h);
  overflow: hidden;
  background: var(--navy-900);
}
.legend .art,
.battlefield .art {
  position: absolute;
  inset: 2px;
  background-repeat: no-repeat;
}
.legend .art {
  background-size: 118% auto; /* zoomed past the card's own gold frame */
  background-position-x: 50%; /* y comes from the player's artFocus */
}
.legend .lines {
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 2px;
  padding-top: 18px;
  background: linear-gradient(180deg, transparent, rgba(5, 13, 29, 0.92) 42%);
}
.legend .line {
  height: 24px;
  padding: 3px 6px 0;
  overflow: hidden;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  line-height: 21px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.legend .line:empty {
  display: none;
}
.legend .champion-name {
  color: var(--gold-bright);
  border-top: 1px solid rgba(201, 164, 76, 0.45);
}

.slot.face {
  top: var(--face-top);
  height: var(--face-h);
}

.panel > .record {
  top: calc(var(--face-top) + var(--face-h) - 30px);
  right: auto;
  height: 30px;
  min-width: 78px;
  padding: 4px 14px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: var(--navy-900);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.record:empty {
  display: none;
}

.battlefield {
  top: calc(var(--face-top) + var(--face-h));
  height: var(--bf-h);
  background: var(--navy-900);
  display: flex;
  align-items: center;
  justify-content: center;
}
.battlefield .art {
  background-size: 112% auto;
  background-position: 50% 38%;
}
.battlefield .art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(70% 120% at 50% 50%, rgba(5, 13, 29, 0.62), rgba(5, 13, 29, 0.15));
}
.battlefield-name {
  position: relative;
  max-width: 100%;
  padding: 3px 8px 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 6px #000, 0 0 2px #000;
}

.pips {
  top: calc(var(--face-top) + var(--face-h) + var(--bf-h) - 17px);
  display: flex;
  justify-content: center;
  gap: 10px;
}
.pip {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: var(--navy-900);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
.pip.won {
  background: radial-gradient(circle at 35% 30%, #fff3c4, var(--gold-bright) 35%, var(--gold) 75%);
  box-shadow: 0 0 14px rgba(243, 217, 143, 0.7);
}

.slot.hand {
  top: var(--hand-top);
  bottom: var(--hand-bottom);
}
.panel > .hand-tab {
  top: calc(var(--hand-top) - 22px);
  right: auto;
  height: 22px;
  padding: 4px 12px 0;
  background: var(--gold);
  color: var(--navy-900);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

/* ---- centre: boards, seam, score track -------------------------------- */

/* Each board sits beside its own player's panel, turned so the players face
   each other across the vertical seam. */
.board {
  position: absolute;
  top: 0;
  width: var(--board-w);
  height: 1080px;
}
.board[data-board="0"] {
  left: var(--panel-w);
}
.board[data-board="1"] {
  right: var(--panel-w);
}

.seam {
  position: absolute;
  left: 959px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--gold), rgba(201, 164, 76, 0.35) 30% 70%, var(--gold));
}

.track {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.step {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 4px;
  border: 2px solid var(--gold);
  background: var(--navy-900);
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
  transition: background 0.25s, color 0.25s, transform 0.25s;
}
.step.goal {
  width: 46px;
  height: 46px;
  font-size: 25px;
  margin: 0 3px;
}
.step.past {
  color: var(--gold-bright);
  background: var(--navy-700);
}
.step.current {
  background: radial-gradient(circle at 35% 30%, #fff3c4, var(--gold-bright) 40%, var(--gold));
  border-color: #fff3c4;
  color: var(--navy-900);
  transform: scale(1.12);
  box-shadow: 0 0 14px rgba(243, 217, 143, 0.75);
}

/* ---- ?guide=1: show where each OBS source goes ------------------------- */

body.guide {
  background: repeating-conic-gradient(#3a3f4b 0% 25%, #2c303a 0% 50%) 0 0 / 40px 40px;
}
.guide-label {
  display: none;
}
body.guide .guide-label {
  display: flex;
  position: absolute;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  text-shadow: 0 1px 4px #000;
}
body.guide .guide-label small {
  font-size: 15px;
  font-weight: 600;
  color: var(--gold-bright);
  text-transform: none;
  letter-spacing: 0.02em;
}
body.guide .board {
  outline: 2px dashed rgba(255, 255, 255, 0.5);
  outline-offset: -8px;
}

/* ---- ?scoreboard: read-only view for the opponent (no camera holes) ------ */

body.scoreboard {
  background: var(--navy-900);
}
body.scoreboard .slot {
  background: rgba(0, 0, 0, 0.35);
}
body.scoreboard .slot::after {
  content: attr(data-slot);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(244, 241, 232, 0.25);
}
