:root {
  color-scheme: dark;
  --bg: #07110d;
  --gold: #e5bf57;
  --amber: #f4d35e;
  --text: #f4f1e8;
  --soft: #d9dfd6;
  --muted: #9ca7a9;
  --glass: rgba(8, 12, 14, 0.72);
  --green: #39c86a;
  --red: #ef665c;
  --blue: #58b7ff;
  --line: rgba(255, 255, 255, 0.14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  color: var(--soft);
  cursor: pointer;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  user-select: none;
}

.broadcast-bar,
.stage-switcher,
.hero-card,
.bet-card,
.ticket-card,
.teams-card,
.feed-card,
.schedule-card,
.locations-card,
.about-card,
.controls-card,
.bottom-dock {
  pointer-events: auto;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.live-preview {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.field-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #1599dc;
}

.field-backdrop #world-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

body.camera-grabbing #world-canvas,
body.camera-locked #world-canvas {
  cursor: grabbing;
}

.world-hidden-hooks {
  position: fixed;
  left: -10000px;
  top: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
}

.map-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 34%, transparent 0 36%, rgba(7, 17, 13, 0.1) 58%, rgba(7, 17, 13, 0.34) 100%),
    linear-gradient(180deg, rgba(6, 13, 10, 0.02), rgba(6, 13, 10, 0.18));
}

.broadcast-bar {
  position: absolute;
  top: 14px;
  left: 18px;
  right: 18px;
  z-index: 3;
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 238px;
  min-height: 62px;
  padding: 0;
  color: var(--text);
  text-decoration: none;
  filter: drop-shadow(0 14px 28px rgba(0,0,0,0.35));
}

.brand-lockup img {
  display: block;
  width: min(238px, 18vw);
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.scoreboard,
.admin-gate,
.stage-switcher,
.hero-card,
.bet-card,
.ticket-card,
.teams-card,
.feed-card {
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.12), transparent 34%),
    var(--glass);
  box-shadow: 0 24px 80px rgba(0,0,0,0.42);
  backdrop-filter: blur(18px) saturate(1.16);
}

.scoreboard {
  justify-self: center;
  display: grid;
  grid-template-columns: 1fr 70px minmax(190px, auto) 70px 1fr;
  align-items: center;
  width: min(980px, calc(100vw - 32px));
  min-height: 62px;
  padding: 8px;
  border-radius: 18px;
  text-align: center;
  gap: 8px;
}

.scoreboard span,
.scoreboard strong,
.scoreboard b {
  min-width: 0;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  background: rgba(5, 7, 8, 0.56);
}

.scoreboard span {
  color: var(--soft);
  font-size: clamp(15px, 2vw, 24px);
  font-weight: 900;
}

.scoreboard strong {
  color: var(--gold);
  font-size: clamp(24px, 4vw, 42px);
  line-height: 1;
}

.scoreboard b {
  color: var(--gold);
  font-size: clamp(15px, 1.4vw, 18px);
  font-weight: 900;
}

.admin-gate {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px;
  border-radius: 14px;
}

.admin-gate span {
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.admin-gate button {
  min-height: 38px;
  padding: 0 14px;
  border-color: rgba(229,191,87,0.34);
  background: rgba(229,191,87,0.12);
  color: var(--soft);
}

.stage-switcher {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 88px;
  display: flex;
  gap: 6px;
  max-width: min(920px, calc(100vw - 36px));
  padding: 7px;
  overflow-x: auto;
  border-radius: 999px;
  transform: translateX(-50%);
}

.schedule-card,
.locations-card,
.about-card,
.controls-card {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 88px;
  width: min(620px, calc(100vw - 36px));
  max-height: 42vh;
  overflow: auto;
  padding: 16px;
  border-radius: 20px;
  transform: translateX(-50%);
}

.schedule-card,
.locations-card,
.about-card,
.controls-card,
.bottom-dock {
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.12), transparent 34%),
    var(--glass);
  box-shadow: 0 24px 80px rgba(0,0,0,0.42);
  backdrop-filter: blur(18px) saturate(1.16);
}

.schedule-card header,
.locations-card header,
.about-card header,
.controls-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.schedule-card header span,
.locations-card header span,
.about-card header span,
.controls-card header span {
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.schedule-card header strong,
.locations-card header strong,
.about-card header strong,
.controls-card header strong {
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.schedule-row {
  display: grid;
  grid-template-columns: 78px 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  background: rgba(0,0,0,0.28);
  color: inherit;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
}

.schedule-row.open {
  border-color: rgba(57,200,106,0.38);
  background:
    linear-gradient(90deg, rgba(57,200,106,0.16), transparent 48%),
    rgba(0,0,0,0.28);
}

.schedule-row.selected {
  outline: 2px solid rgba(229,191,87,0.58);
}

.schedule-row.soon {
  border-color: rgba(229,191,87,0.26);
}

.schedule-row.locked {
  opacity: 0.72;
}

.schedule-row + .schedule-row {
  margin-top: 8px;
}

.schedule-row b {
  color: var(--gold);
}

.schedule-row strong {
  color: var(--text);
}

.schedule-row span,
.schedule-row small,
.about-card p,
.locations-card p {
  color: var(--muted);
  line-height: 1.4;
}

.simulation-notice {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(229,191,87,0.28);
  border-radius: 12px;
  background: rgba(229,191,87,0.1);
  color: var(--soft);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.control-grid {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px;
}

.control-grid span,
.control-grid b {
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.24);
}

.control-grid span {
  color: var(--gold);
  font-weight: 900;
}

.control-grid b {
  color: var(--soft);
}

.dock-panel:not(.active) {
  display: none;
}

.bottom-dock {
  position: fixed;
  z-index: 1000;
  left: 18px;
  right: 18px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: 8px;
  border-radius: 18px;
  pointer-events: auto;
}

.bottom-dock button {
  position: relative;
  z-index: 1001;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  color: var(--soft);
  font-size: 11px;
  pointer-events: auto;
}

.bottom-dock button.active {
  border-color: rgba(229,191,87,0.5);
  background: rgba(229,191,87,0.16);
  color: var(--gold);
}

.lock-hint {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 138px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  max-width: min(860px, calc(100vw - 36px));
  padding: 0 16px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.12), transparent 34%),
    rgba(8, 12, 14, 0.72);
  box-shadow: 0 18px 60px rgba(0,0,0,0.32);
  backdrop-filter: blur(18px) saturate(1.16);
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transform: translateX(-50%);
  cursor: pointer;
  pointer-events: auto;
  white-space: nowrap;
  user-select: none;
}

.lock-hint.active {
  letter-spacing: 0.04em;
}

.lock-hint kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 26px;
  border: 1px solid rgba(229,191,87,0.42);
  border-radius: 8px;
  background: rgba(0,0,0,0.28);
  color: var(--text);
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.02em;
  padding: 0 7px;
}

.lock-hint span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.stage-switcher button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 11px;
}

.stage-switcher button.active {
  border-color: rgba(229,191,87,0.48);
  background: rgba(229,191,87,0.16);
  color: var(--gold);
}

.hero-card {
  position: absolute;
  z-index: 2;
  top: 188px;
  left: 18px;
  width: min(460px, calc(100vw - 36px));
  padding: 16px;
  border-radius: 20px;
  max-height: calc(100vh - 176px);
  overflow: auto;
}

.hero-card .eyebrow,
.bet-card header span,
.ticket-card span,
.teams-card header span,
.feed-card header span,
.metric span {
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-card h1 {
  margin: 7px 0 0;
  font-size: clamp(30px, 3.4vw, 54px);
  line-height: 0.98;
}

.hero-card p,
.bet-card p,
.ticket-card p,
.team-card p,
.feed-item span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.count-grid,
.market-stats,
.team-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.metric {
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
}

.metric b {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.06;
}

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

.team-stats .metric {
  min-width: 0;
}

.team-stats .metric span {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 10px;
  letter-spacing: 0.12em;
}

.bet-status {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(88,183,255,0.32);
  border-radius: 12px;
  background: rgba(88,183,255,0.1);
  color: var(--soft);
  font-size: 13px;
  font-weight: 800;
}

.bet-card {
  position: absolute;
  z-index: 2;
  right: 18px;
  top: 188px;
  width: min(460px, calc(100vw - 36px));
  padding: 16px;
  border-radius: 20px;
}

.bet-card header,
.teams-card header,
.feed-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.bet-card header strong,
.teams-card header strong,
.feed-card header strong {
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.outcomes {
  display: grid;
  gap: 8px;
}

.outcome {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  background: rgba(0,0,0,0.28);
  color: inherit;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
}

.outcome.selected {
  border-color: rgba(229,191,87,0.64);
  background:
    linear-gradient(90deg, rgba(229,191,87,0.17), transparent 54%),
    rgba(0,0,0,0.34);
}

.outcome b {
  display: block;
}

.outcome small {
  color: var(--muted);
}

.bar {
  grid-column: 1 / -1;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
}

.bar i {
  display: block;
  height: 100%;
  background: var(--gold);
}

.buy-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.buy-row.single {
  grid-template-columns: 1fr;
}

.buy-row button {
  min-height: 46px;
  border-color: rgba(229,191,87,0.34);
  background: rgba(229,191,87,0.12);
  color: var(--soft);
}

.ticket-quote {
  margin-top: 8px;
  padding: 9px 11px;
  border: 1px solid rgba(229,191,87,0.22);
  border-radius: 12px;
  background: rgba(0,0,0,0.2);
  color: var(--soft);
  font-size: 13px;
  font-weight: 900;
}

.ticket-card {
  position: absolute;
  z-index: 2;
  left: 18px;
  bottom: 88px;
  width: min(430px, calc(100vw - 36px));
  padding: 16px;
  border-radius: 20px;
}

.ticket-card strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.teams-card {
  position: absolute;
  z-index: 2;
  right: 18px;
  bottom: 88px;
  width: min(760px, calc(100vw - 56px));
  max-height: 58vh;
  overflow: auto;
  padding: 16px;
  border-radius: 20px;
}

.team-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.team-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
}

.team-card h3 {
  margin: 4px 0;
  color: var(--text);
  font-size: 22px;
  line-height: 1.05;
}

.team-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(229,191,87,0.42);
  border-radius: 999px;
  color: var(--gold);
  background: rgba(229,191,87,0.1);
  font-size: 11px;
  font-weight: 900;
}

.trait-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.trait-list span {
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(229,191,87,0.16);
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
}

.feed-card {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 88px;
  width: min(420px, 24vw);
  max-height: 30vh;
  overflow: auto;
  padding: 16px;
  border-radius: 20px;
  transform: translateX(-50%);
}

.feed-item {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
  padding: 8px 9px;
  border-top: 0;
  border-left: 3px solid var(--gold);
  background: rgba(0,0,0,0.28);
}

.feed-item b {
  color: var(--gold);
}

.settled {
  border-color: rgba(57, 200, 106, 0.45);
}

@media (max-width: 1180px) {
  body {
    overflow: auto;
  }

  .live-preview {
    min-height: 100vh;
    height: auto;
    padding: 12px;
  }

  .field-backdrop {
    position: fixed;
  }

  .broadcast-bar,
  .stage-switcher,
  .lock-hint,
  .hero-card,
  .bet-card,
  .ticket-card,
  .teams-card,
  .feed-card {
    position: relative;
    inset: auto;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    width: 100%;
    margin: 10px 0;
    transform: none;
  }

  .schedule-card,
  .locations-card,
  .about-card,
  .controls-card,
  .bottom-dock {
    position: relative;
    inset: auto;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    width: 100%;
    margin: 10px 0;
    transform: none;
  }

  .bottom-dock {
    flex-wrap: wrap;
  }

  .broadcast-bar {
    grid-template-columns: 1fr;
  }

  .scoreboard {
    min-width: 0;
    width: 100%;
  }

  .stage-switcher {
    max-width: none;
  }

}

@media (max-width: 720px) {
  .scoreboard,
  .count-grid,
  .market-stats,
  .team-columns,
  .team-stats,
  .buy-row,
  .schedule-row {
    grid-template-columns: 1fr;
  }

  .scoreboard strong {
    font-size: 2rem;
  }
}
