/* Live display layouts (1920×1080 stage). */

body.live { overflow: hidden; width: 100vw; height: 100vh; background: #000; }
#phase-root { position: absolute; inset: 0; }
#phase-root.enter { animation: phase-in 0.7s ease-out; }
@keyframes phase-in { from { opacity: 0; transform: scale(1.015); } }
#offline {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 99;
  background: rgba(0, 0, 0, 0.75); color: var(--muted); padding: 8px 18px; border-radius: 999px; font-size: 14px;
}
.error, .empty { color: var(--muted); font-size: 28px; padding: 40px; text-align: center; }

/* ---------- top bar ---------- */
.top-bar { display: flex; align-items: center; gap: 28px; height: 130px; padding: 0 60px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent); }
.tb-logo { width: 84px; height: 84px; }
.tb-titles h1 { font-size: 56px; line-height: 1; color: var(--gold); }
.tb-sub { font-family: var(--head); font-size: 24px; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; margin-top: 6px; }
.tb-event { margin-left: auto; text-align: right; font-family: var(--head); font-size: 28px; text-transform: uppercase; letter-spacing: 0.08em; }
.tb-edition { color: var(--muted); font-size: 20px; }

/* ---------- split screen ---------- */
.sys-split { display: grid; gap: 40px; padding: 24px 60px; height: calc(1080px - 130px); }
/* minmax(0, 1fr) everywhere: a plain 1fr track can't shrink below its content,
   which is what pushed columns over their neighbours. */
.sys-split { grid-template-columns: repeat(var(--n, 1), minmax(0, 1fr)); }
.sys-col { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 14px; }
/* One system at a time in a half-width pane. */
.sys-rotate { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sys-rotate > .pager > .page > .sys-col { height: 100%; }
.sys-head { font-size: 30px; color: var(--text); padding: 8px 18px; border-radius: 10px; text-shadow: 0 2px 6px #000;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.85)), var(--tex, none) center / 400px; }

/* ---------- pager ---------- */
.pager { position: relative; flex: 1; min-height: 0; }
.pager > .page { position: absolute; inset: 0; opacity: 0; transition: opacity 0.8s; pointer-events: none;
  display: flex; flex-direction: column; min-height: 0; }
.pager > .page.on { opacity: 1; }
.pager:not([data-pages]) > .page { position: relative; inset: auto; }
.page-dots { position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.page-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.page-dots i.on { background: var(--gold); }

/* ---------- registration ---------- */
.registration { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); height: 100%; padding: 80px; gap: 60px; }
.reg-hero { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.reg-logo { width: 260px; height: 260px; margin-bottom: 30px; filter: drop-shadow(0 10px 30px rgba(233, 200, 107, 0.25)); }
.reg-title { font-size: 128px; line-height: 0.95; color: var(--gold); }
.reg-edition { font-family: var(--head); font-size: 46px; text-transform: uppercase; letter-spacing: 0.1em; margin-top: 12px; }
.reg-counts { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 50px; }
.count-card { display: flex; align-items: center; gap: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px 28px; }
.count-num { font-family: var(--head); font-size: 72px; color: var(--gold); line-height: 1; }
.count-label { color: var(--muted); font-size: 20px; line-height: 1.3; }
.reg-side { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 24px; }
.panel-h { font-size: 30px; color: var(--gold); margin-bottom: 16px; }
.big-p { font-size: 28px; line-height: 1.45; }

/* ---------- two-pane ---------- */
.two-pane { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; padding: 24px 60px 40px; height: calc(1080px - 130px); }
.two-pane.wide-l { grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr); }
.two-pane .sys-split { padding: 0; height: 100%; }
.pane-l, .pane-r { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.pane-r.stack { gap: 24px; }
.panel.grow { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.matrix { display: grid; gap: 12px; }
.matrix.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.matrix-cell { min-width: 0; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.painters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sub-h { font-size: 26px; color: var(--muted); }

/* ---------- rounds ---------- */
.rounds { height: 100%; display: flex; flex-direction: column; }
.rounds-head { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; padding: 26px 60px 8px; }
.rounds-title { min-width: 0; display: flex; align-items: center; gap: 22px; }
.rounds-title img { width: 72px; height: 72px; }
.rounds-title h1 { font-size: 64px; line-height: 1; color: var(--gold); }
.rounds .sys-split { height: auto; flex: 1; min-height: 0; padding-top: 10px; }
.pager > .page { height: 100%; }
/* Fills whatever height is left in its page (below a heading, progress line, …). */
.tables-grid { display: grid; gap: 14px; flex: 1 1 0; min-height: 0; max-height: calc(var(--rows, 4) * 164px);
  grid-template-rows: repeat(var(--rows, 4), minmax(0, 1fr)); }
.tables-grid .table-card { height: 100%; min-height: 0; padding-top: 4px; padding-bottom: 4px; }
.tables-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tables-grid.cols-1 { grid-template-columns: minmax(0, 1fr); }
.tables-grid.small .table-card { padding: 6px 14px; }
.report-progress { font-family: var(--head); font-size: 26px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.report-progress b { color: var(--ok); font-size: 34px; }

/* countdown: high-contrast core element */
.timer { text-align: center; font-family: var(--head); }
.timer-label { font-size: 22px; letter-spacing: 0.4em; color: var(--muted); text-transform: uppercase; }
.timer-value { font-variant-numeric: tabular-nums; line-height: 1; color: #fff; }
.timer-hero { background: #000; border: 3px solid rgba(255, 255, 255, 0.85); border-radius: 22px; padding: 14px 56px 18px; }
.timer-hero .timer-value { font-size: 170px; font-weight: 700; text-shadow: 0 0 30px rgba(255, 255, 255, 0.25); }
.timer[data-state='warn'] .timer-value { color: #ffd23e; }
.timer[data-state='warn'].timer-hero { border-color: #ffd23e; }
.timer[data-state='zero'] .timer-value { color: var(--alert); animation: blink 1s steps(2) infinite; }
.timer[data-state='zero'].timer-hero { border-color: var(--alert); }
.timer[data-state='paused'] .timer-value { color: var(--muted); }
.timer[data-state='idle'] { opacity: 0.5; }
.timer[data-state='idle'] .timer-value { font-size: 40px; padding: 20px 0; }
.timer-corner[data-state='idle'] { display: none; }
.timer-corner { position: absolute; right: 50px; top: 22px; background: #000; border: 2px solid rgba(255, 255, 255, 0.6); border-radius: 14px; padding: 6px 22px; z-index: 5; }
.timer-corner .timer-label { font-size: 13px; }
.timer-corner .timer-value { font-size: 58px; }
.slides ~ .timer-corner, .slides .timer-corner { top: 22px; }
.phase-between_rounds_main .tb-event, .phase-between_rounds_ending .tb-event { margin-right: 250px; }
@keyframes blink { 50% { opacity: 0.35; } }

/* ---------- submit scores ---------- */
.submit { position: absolute; inset: 0; display: grid; place-items: center; background: #1a0503; overflow: hidden; }
.submit-stripes { position: absolute; inset: -200px; background: repeating-linear-gradient(-45deg, #2c0906 0 60px, #1a0503 60px 120px); animation: stripes 3s linear infinite; }
@keyframes stripes { to { transform: translateX(170px); } }
.submit-banner { position: relative; text-align: center; padding: 60px 120px; background: var(--alert); color: #fff; border-radius: 26px;
  box-shadow: 0 0 120px rgba(255, 75, 62, 0.6); animation: pulse 1.4s ease-in-out infinite; }
.submit-banner h1 { font-size: 190px; line-height: 1; }
.submit-time { font-family: var(--head); font-size: 44px; letter-spacing: 0.3em; }
.submit-banner p { font-size: 34px; margin-top: 16px; }
@keyframes pulse { 50% { transform: scale(1.03); box-shadow: 0 0 200px rgba(255, 75, 62, 0.85); } }

/* ---------- between rounds slides ---------- */
.slides { position: absolute; inset: 0; }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1s; }
.slide.on { opacity: 1; }
.slide-body { height: calc(1080px - 130px); }
.slide-body > .sys-split { height: 100%; }
.standings-cols { display: grid; gap: 30px; align-items: start; }
.standings-cols.cols-2 .standings .c-num { width: 80px; }
.standings-cols.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.factions { display: grid; gap: 8px; }
.faction-row { display: grid; grid-template-columns: 60px minmax(0, 1fr) minmax(0, 1fr) 160px; gap: 18px; align-items: center; background: var(--panel-2); border-radius: 10px; padding: 4px 16px; }
.fr-head .fr-num { white-space: nowrap; font-family: var(--head); font-size: 18px; }
.fr-head { background: none; color: var(--muted); font-family: var(--head); text-transform: uppercase; letter-spacing: 0.12em; font-size: 18px; }
.fr-name { font-size: 26px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-name span { display: block; color: var(--muted); font-size: 16px; font-weight: 400; }
.fr-bar { position: relative; height: 30px; background: rgba(255, 255, 255, 0.06); border-radius: 6px; overflow: hidden; }
.fr-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--gold-2), var(--gold)); }
.fr-bar b { position: relative; padding-left: 10px; line-height: 30px; font-size: 18px; color: #111; mix-blend-mode: normal; text-shadow: 0 0 6px rgba(255, 255, 255, 0.6); }
.fr-num { text-align: right; font-family: var(--head); font-size: 30px; }
.full-map { margin: 24px 60px; height: calc(100% - 64px); }

/* ---------- upcoming tables ---------- */
.upcoming-single { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 36px; height: 100%; }
.upcoming-single > div:first-child { min-width: 0; display: flex; flex-direction: column; }
.upcoming-side { min-width: 0; display: flex; flex-direction: column; gap: 20px; min-height: 0; }
.find-table { min-height: 0; display: flex; flex-direction: column; }
.upcoming-side > .pager { flex: 1; }
.find-table h3 { font-size: 28px; color: var(--gold); margin-bottom: 10px; }
.find-table ul { list-style: none; columns: 2; column-gap: 26px; }
.find-table li { min-width: 0; display: flex; justify-content: space-between; gap: 12px; font-size: 22px; padding: 5px 0; border-bottom: 1px solid var(--line); break-inside: avoid; }
.find-table li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.find-table b { font-family: var(--head); color: var(--gold); font-size: 26px; }
.mini-map { flex: 1; min-height: 0; padding: 18px; }
.pending { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 50px; height: calc(1080px - 130px); }
.pending h2 { font-size: 64px; color: var(--muted); }

/* ---------- center screens ---------- */
.center-screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 20px; }
.cs-logo { width: 300px; height: 300px; margin-bottom: 20px; }
.center-screen h1 { font-size: 110px; color: var(--gold); }
.cs-sub { font-size: 36px; color: var(--muted); }
.breathe { animation: breathe 3.2s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.06); filter: drop-shadow(0 0 40px rgba(233, 200, 107, 0.45)); } }
.dots { display: flex; gap: 18px; margin-top: 20px; }
.dots i { width: 22px; height: 22px; border-radius: 50%; background: var(--gold); animation: dot 1.4s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: 0.2s; }
.dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot { 50% { transform: translateY(-18px); opacity: 0.4; } }
.ceremony-video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
.play-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font: 700 48px var(--head); padding: 24px 48px; border-radius: 16px; border: 0; background: var(--gold); color: #111; cursor: pointer; }

/* ---------- credits ---------- */
.credits { position: absolute; inset: 0; overflow: hidden;
  mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent); }
.credits-roll { position: absolute; left: 0; right: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 90px;
  animation: roll var(--roll-duration, 60s) linear infinite; }
@keyframes roll { from { transform: translateY(1080px); } to { transform: translateY(-100%); } }
.cr-block { text-align: center; width: 1100px; }
.cr-intro img { width: 220px; height: 220px; }
.cr-block h1 { font-size: 96px; color: var(--gold); }
.cr-block h2 { font-size: 54px; color: var(--gold); margin-bottom: 30px; }
.cr-block h3 { font-size: 34px; color: var(--muted); margin: 30px 0 12px; }
.cr-list { list-style: none; display: grid; gap: 14px; }
.cr-list li { display: grid; grid-template-columns: 90px auto minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 22px; text-align: left; font-size: 30px; }
.cr-list li.podium { font-size: 44px; }
.cr-list li.p1 .cr-name { color: var(--gold); }
.cr-rank { font-family: var(--head); color: var(--gold); text-align: right; }
.cr-army { color: var(--muted); }
.cr-names { font-size: 34px; line-height: 1.5; }
