﻿:root {
  color-scheme: dark;
  --stage-width: 1920px;
  --stage-height: 216px;
  --score-speed: 64s;
  --news-speed: 110s;
  --news-bg: #112033;
  --stripe-width: 1920px;
  --stack-height: 216px;
  --brand-image-size: 190px;
  --brand-card-width: 460px;
  --pac-speed: 12s;
  --bg: #080a0d;
  --panel: #15181d;
  --line: #2d333c;
  --text: #f7f9fc;
  --muted: #aab2bd;
  --accent: #00e0ff;
  --gold: #ffca2c;
  --red: #ff3b5f;
  --maze-line: rgb(47 83 180 / 22%);
  --maze-dot: rgb(255 202 44 / 16%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: #0f1115;
}

body.player-mode,
body.fullscreen {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

.ticker-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  padding: 20px;
}

.preview-area {
  min-width: 0;
  display: grid;
  align-self: start;
  gap: 10px;
}

.preview-toolbar {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.preview-toolbar div {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.preview-toolbar strong {
  font-size: 15px;
}

.preview-toolbar span,
.preview-toolbar a {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.preview-toolbar a {
  color: var(--accent);
  text-decoration: none;
}

.admin-link {
  min-height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--accent);
  background: #0e1218;
  text-decoration: none;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding: 24px;
}

.admin-shell-wide {
  place-items: start stretch;
}

.admin-panel {
  width: min(100%, 420px);
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.admin-panel-wide {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.admin-header,
.admin-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.admin-header h1 {
  margin: 0;
}

.admin-header span {
  color: var(--muted);
  font-size: 13px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-span-2 {
  grid-column: 1 / -1;
}

.admin-section {
  display: grid;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.admin-section h2 {
  margin: 0;
  color: var(--gold);
  font-size: 15px;
  letter-spacing: 0;
}

.admin-check-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ticker-list {
  display: grid;
  gap: 8px;
}

.ticker-client {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0c1016;
}

.ticker-client summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 10px;
  color: var(--text);
  cursor: pointer;
}

.ticker-client summary small,
.ticker-row-id {
  color: var(--muted);
}

.ticker-client-players {
  display: grid;
  gap: 8px;
  padding: 0 8px 8px;
}

.ticker-row {
  min-height: 38px;
  display: grid;
  grid-template-columns: 12px minmax(120px, 1fr) minmax(80px, 0.65fr) auto auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: #0e1218;
  text-align: left;
  cursor: pointer;
}

.ticker-row.selected {
  border-color: rgb(0 224 255 / 70%);
  box-shadow: inset 0 0 0 1px rgb(0 224 255 / 35%);
}

.ticker-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticker-row span,
.ticker-row small,
.ticker-list-empty {
  color: var(--muted);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px rgb(255 59 95 / 60%);
}

.status-dot.online {
  background: #35d07f;
  box-shadow: 0 0 8px rgb(53 208 127 / 75%);
}

.online-text {
  color: #35d07f !important;
}

.offline-text {
  color: var(--red) !important;
}

.primary-button {
  border-color: rgb(0 224 255 / 55%);
  color: #001015;
  background: var(--accent);
  font-weight: 900;
}

.preview-frame {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 8px;
}

.player-stack {
  display: none;
}

.stacked-preview {
  display: grid;
  gap: 8px;
}

.viewport-strip {
  width: min(100%, var(--stripe-width));
  height: 46px;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  border: 1px solid rgb(0 224 255 / 48%);
  border-radius: 6px;
  background: #0b1017;
}

.viewport-strip-label {
  height: 100%;
  display: grid;
  place-items: center;
  color: #051014;
  background: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.viewport-strip-fill {
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.viewport-strip.partial {
  width: min(100%, var(--partial-width));
}

.fullscreen .stacked-preview,
.player-mode .stacked-preview,
.fullscreen .preview-frame,
.player-mode .preview-frame {
  display: none;
}

.score-stage {
  position: relative;
  width: var(--stage-width);
  height: var(--stage-height);
  align-self: start;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 44px;
  overflow: hidden;
  contain: strict;
  isolation: isolate;
  background:
    radial-gradient(circle at 16px 16px, var(--maze-dot) 0 2px, transparent 2px),
    linear-gradient(90deg, transparent 0 30px, var(--maze-line) 30px 34px, transparent 34px 62px, var(--maze-line) 62px 66px, transparent 66px),
    linear-gradient(0deg, transparent 0 26px, var(--maze-line) 26px 30px, transparent 30px 58px, var(--maze-line) 58px 62px, transparent 62px),
    var(--bg);
  background-size: 64px 64px, 128px 64px, 128px 64px, auto;
  border: 1px solid #202832;
  box-shadow: 0 16px 42px rgb(0 0 0 / 34%);
}

.score-stage::before {
  content: "";
  position: absolute;
  inset: 0 0 44px;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 20px, rgb(0 224 255 / 12%) 20px 24px, transparent 24px 108px, rgb(0 224 255 / 12%) 108px 112px, transparent 112px),
    linear-gradient(0deg, transparent 0 18px, rgb(0 224 255 / 10%) 18px 22px, transparent 22px 98px, rgb(0 224 255 / 10%) 98px 102px, transparent 102px);
  background-size: 256px 120px;
  opacity: .55;
}

.pac-chase {
  position: absolute;
  left: 0;
  top: 7px;
  z-index: 3;
  width: 250px;
  height: 38px;
  filter: drop-shadow(0 2px 2px rgb(0 0 0 / 70%));
  will-change: transform;
}

.player-stack .pac-chase {
  animation: none;
}

.pacman {
  position: absolute;
  left: 118px;
  top: 5px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: conic-gradient(from 38deg, transparent 0 78deg, #ffd928 78deg 360deg);
  animation: pac-chomp 220ms steps(2, end) infinite, pac-surge 1450ms ease-in-out infinite;
}

.powered .pacman {
  scale: -1 1;
  animation: pac-chomp 220ms steps(2, end) infinite, pac-surge-back 1450ms ease-in-out infinite;
}

.db-power {
  position: absolute;
  left: 176px;
  top: -3px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 0 10px rgb(255 117 24 / 70%);
  transition: opacity 180ms ease;
}

.db-power img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.powered .db-power {
  opacity: 0;
}

.ghost {
  position: absolute;
  top: 4px;
  width: 28px;
  height: 30px;
  border-radius: 14px 14px 5px 5px;
  animation: ghost-chase-gap 1650ms ease-in-out infinite;
}

.ghost::before,
.ghost::after {
  content: "";
  position: absolute;
  top: 9px;
  width: 6px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 2px 0 0 #1a2b6e;
}

.ghost::before {
  left: 6px;
}

.ghost::after {
  right: 6px;
}

.ghost-a {
  left: 0;
  --ghost-near: 18px;
  --ghost-far: -8px;
  background: linear-gradient(#ff4b80 0 78%, transparent 78%), repeating-linear-gradient(90deg, #ff4b80 0 7px, transparent 7px 14px);
}

.ghost-b {
  left: 40px;
  --ghost-near: 10px;
  --ghost-far: -16px;
  background: linear-gradient(#29d8ff 0 78%, transparent 78%), repeating-linear-gradient(90deg, #29d8ff 0 7px, transparent 7px 14px);
  animation-delay: 180ms;
}

.ghost-c {
  left: 80px;
  --ghost-near: 4px;
  --ghost-far: -24px;
  background: linear-gradient(#ff9f2e 0 78%, transparent 78%), repeating-linear-gradient(90deg, #ff9f2e 0 7px, transparent 7px 14px);
  animation-delay: 360ms;
}

.powered .ghost {
  background: linear-gradient(#4f8cff 0 78%, transparent 78%), repeating-linear-gradient(90deg, #4f8cff 0 7px, transparent 7px 14px);
  filter: drop-shadow(0 0 5px rgb(79 140 255 / 80%));
}

.disabled-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  place-items: center;
  gap: 8px;
  padding: 20px;
  text-align: center;
  background: #050609;
}

.disabled-overlay strong {
  color: var(--red);
  font-size: 34px;
  font-weight: 950;
  line-height: 1;
}

.disabled-overlay span {
  color: var(--muted);
  font-size: 18px;
}

.ticker-disabled .disabled-overlay {
  display: grid;
}

.disabled-overlay[hidden] {
  display: none !important;
}

.ticker-disabled .ticker-track,
.ticker-disabled .news-track {
  animation-play-state: paused;
}

.ticker-window,
.news-window {
  position: relative;
  z-index: 1;
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  backface-visibility: hidden;
  contain: layout paint;
  transform: translateZ(0);
}

.ticker-track {
  display: flex;
  align-items: stretch;
  width: max-content;
  animation: marquee var(--score-speed) linear infinite;
}

.player-stack .ticker-track {
  animation: none;
  backface-visibility: hidden;
  contain: layout style paint;
  pointer-events: none;
  text-rendering: geometricPrecision;
  transform: translate3d(0, 0, 0);
  transform-origin: 0 0;
  will-change: transform;
}

.ticker-track:hover,
.news-track:hover {
  animation-play-state: paused;
}

.news-window {
  align-items: center;
  background: var(--news-bg);
  border-top: 1px solid rgb(255 255 255 / 10%);
}

.news-track {
  display: flex;
  align-items: center;
  width: max-content;
  height: 100%;
  animation: marquee var(--news-speed) linear infinite;
}

.player-stack .news-track {
  animation: none;
  backface-visibility: hidden;
  contain: layout style paint;
  pointer-events: none;
  text-rendering: geometricPrecision;
  transform: translate3d(0, 0, 0);
  transform-origin: 0 0;
  will-change: transform;
}

.player-stack .ticker-track:hover,
.player-stack .news-track:hover {
  animation-play-state: running;
}

.news-item {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 28px;
  border-right: 1px solid rgb(255 255 255 / 14%);
  white-space: nowrap;
  font-size: 22px;
  font-weight: 800;
}

.news-league {
  color: var(--gold);
  font-size: 15px;
  font-weight: 900;
}

.game-card {
  width: 720px;
  min-width: 720px;
  display: grid;
  grid-template-rows: 18px 108px 34px;
  padding: 4px 18px;
  border-right: 1px solid rgb(255 255 255 / 16%);
  background:
    linear-gradient(90deg, rgb(8 10 13 / 82%) 0 16px, rgb(8 10 13 / 48%) 16px calc(100% - 16px), rgb(8 10 13 / 82%) calc(100% - 16px)),
    linear-gradient(180deg, rgb(16 20 25 / 56%) 0%, rgb(8 10 13 / 36%) 100%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 6%);
}

.brand-card {
  width: var(--brand-card-width);
  min-width: var(--brand-card-width);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-right: 1px solid rgb(255 255 255 / 16%);
  background: linear-gradient(135deg, rgb(0 224 255 / 16%), rgb(8 10 13 / 42%) 62%);
  overflow: hidden;
  text-align: center;
}

.brand-card strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--accent);
  font-size: 30px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.brand-card img {
  display: block;
  flex: 0 0 auto;
  width: var(--brand-image-size);
  height: var(--brand-image-size);
  max-width: none;
  max-height: none;
  object-fit: contain;
  filter:
    drop-shadow(0 0 1px rgb(255 255 255 / 80%))
    drop-shadow(0 2px 3px rgb(0 0 0 / 70%));
}

.brand-card.has-image {
  background: linear-gradient(135deg, rgb(255 255 255 / 7%), rgb(8 10 13 / 34%) 62%);
}

.game-meta,
.leader-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.game-meta strong {
  color: var(--gold);
}

.leader-line {
  justify-content: center;
}

.leader-line span {
  min-width: 0;
}

.meta-separator {
  color: var(--muted);
  opacity: .65;
}

.odds-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.odds-label {
  color: var(--gold);
}

.odds-over-under {
  color: #38a7ff;
  text-shadow: 0 0 10px rgb(56 167 255 / 45%);
}

.score-row {
  display: grid;
  grid-template-columns: 136px minmax(340px, auto) 136px;
  align-items: center;
  justify-content: center;
  gap: 20px;
  align-self: center;
  overflow: visible;
}

.golf-card {
  grid-template-rows: 24px 1fr 32px;
}

.golf-main {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  align-items: center;
  gap: 14px;
}

.golf-main div {
  min-width: 0;
}

.golf-main strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 32px;
  font-weight: 950;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.golf-main span {
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.15;
  text-align: right;
  text-overflow: ellipsis;
}

.golf-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--gold) !important;
  font-size: 12px !important;
  font-weight: 950 !important;
  text-align: left !important;
}

.team {
  min-width: 0;
  display: grid;
  justify-items: start;
  align-items: center;
  gap: 2px;
}

.team.home {
  justify-items: end;
  text-align: right;
}

.team-logo {
  box-sizing: border-box;
  width: 136px;
  height: 108px;
  display: grid;
  place-items: center;
  overflow: visible;
  background: transparent;
  padding: 0;
}

.team-logo img {
  width: auto;
  height: 108px;
  max-width: 136px;
  max-height: none;
  object-fit: contain;
  filter:
    drop-shadow(0 0 1px rgb(255 255 255 / 95%))
    drop-shadow(0 0 5px rgb(255 255 255 / 32%))
    drop-shadow(0 2px 2px rgb(0 0 0 / 70%));
}

.team-logo-fallback {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.team-logo-away {
  justify-self: end;
}

.team-logo-home {
  justify-self: start;
}

.team-text {
  width: 150px;
  min-width: 0;
  text-align: center;
}

.team-code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
}

.record {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.score {
  display: grid;
  grid-template-columns: minmax(110px, auto) auto minmax(110px, auto);
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 62px;
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.score-side {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.score-team-name {
  max-width: 112px;
  overflow: hidden;
  color: var(--text) !important;
  font-size: 28px;
  font-weight: 950;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-divider {
  color: var(--line);
}

.score span {
  color: var(--line);
}

.leader-line {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  align-self: start;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.control-panel {
  align-self: start;
  display: grid;
  gap: 16px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

h1 {
  margin: 0;
  font-size: 20px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
.icon-button,
.secondary-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: #0e1218;
}

input[type="text"],
input[type="number"],
input[type="color"],
input[type="file"],
select {
  padding: 0 10px;
}

input[type="color"] {
  width: 100%;
  padding: 4px;
}

.icon-button {
  width: 40px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.secondary-button {
  cursor: pointer;
}

.fullscreen-icon {
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 2px;
  box-shadow: inset 0 0 0 5px #0e1218;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.check-item,
.switch-row,
.fixed-height {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0e1218;
  color: var(--text);
}

.check-item input,
.switch-row input {
  min-height: auto;
}

.fixed-height strong {
  color: var(--accent);
  text-align: right;
}

.fullscreen .ticker-shell {
  display: block;
  padding: 0;
  background: #000;
}

.fullscreen .preview-toolbar,
.fullscreen .control-panel {
  display: none;
}

.fullscreen .preview-area,
.fullscreen .player-stack {
  display: block;
  overflow: hidden;
  border-radius: 0;
}

.fullscreen .player-stack {
  width: var(--stripe-width);
}

.fullscreen .score-stage {
  width: var(--stripe-width);
  height: var(--stage-height);
  border: 0;
  box-shadow: none;
}

.player-mode .ticker-shell {
  min-height: var(--stack-height);
  display: block;
  padding: 0;
  background: #000;
}

.player-mode .score-stage {
  width: var(--stripe-width);
  height: var(--stage-height);
  border: 0;
  box-shadow: none;
}

.player-mode .preview-toolbar {
  display: none;
}

.player-mode .preview-area,
.player-mode .player-stack {
  display: block;
  overflow: hidden;
  border-radius: 0;
}

.player-mode .player-stack {
  width: var(--stripe-width);
}

.player-mode .control-panel {
  display: none;
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@keyframes pac-cross {
  from {
    left: -210px;
  }
  to {
    left: calc(100% + 24px);
  }
}

@keyframes pac-chomp {
  0% {
    background: conic-gradient(from 38deg, transparent 0 78deg, #ffd928 78deg 360deg);
  }
  100% {
    background: conic-gradient(from 10deg, transparent 0 22deg, #ffd928 22deg 360deg);
  }
}

@keyframes pac-surge {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 8px 0;
  }
}

@keyframes pac-surge-back {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: -8px 0;
  }
}

@keyframes ghost-chase-gap {
  0%,
  100% {
    translate: var(--ghost-far) 0;
  }
  35% {
    translate: var(--ghost-near) -5px;
  }
  62% {
    translate: calc(var(--ghost-near) - 8px) 2px;
  }
}


@media (max-width: 900px) {
  .ticker-shell {
    grid-template-columns: 1fr;
  }

  .admin-grid,
  .admin-check-grid {
    grid-template-columns: 1fr;
  }

  .ticker-row {
    grid-template-columns: 12px minmax(0, 1fr) auto;
  }

  .ticker-row span:nth-of-type(3),
  .ticker-row small:last-child {
    display: none;
  }

  .control-panel {
    order: -1;
  }

  .score-stage {
    height: var(--stage-height);
  }
}

