/* Broadcast-inspired football game presentation over the existing controls. */
:root {
  color-scheme: dark;
  --bg: #070a11;
  --panel: #111722;
  --panel-raised: #192230;
  --line: #293648;
  --line-bright: #46566d;
  --muted: #98a7ba;
  --text: #f3f6fb;
  --green: #d7fa4b;
  --green-dark: #283315;
  --red: #ff6f77;
  --sans: 'DM Sans', Arial, sans-serif;
  --display: 'Barlow Condensed', Impact, sans-serif;
}

body {
  background: radial-gradient(ellipse at 50% -24%, #26364e 0, transparent 43%),
    radial-gradient(ellipse at 50% 105%, #10201d 0, transparent 45%), #070a11;
}

body::before {
  opacity: .055;
  background-size: 32px 32px;
}

.topbar {
  height: 68px;
  border-color: #293448;
  background: #080c13ed;
}

.brand-mark {
  border-radius: 9px;
  background: linear-gradient(145deg, #e6ff78, #a6d52d);
  box-shadow: 0 0 25px #d7fa4b35;
}

.layout {
  max-width: 1600px;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  padding-top: 20px;
}

.main-column,
.side-column {
  gap: 16px;
}

.card {
  padding: 19px;
  border-color: #293548;
  border-radius: 11px;
  background: linear-gradient(135deg, #151d29, #101620 75%);
  box-shadow: 0 15px 40px #0005, inset 0 1px #ffffff0a;
}

.section-heading {
  margin-bottom: 14px;
}

.eyebrow {
  color: #b5c77f;
  letter-spacing: 1.8px;
}

.section-heading h1 {
  font-size: 32px;
  letter-spacing: .5px;
}

.section-heading h2 {
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: .25px;
}

.badge {
  border-radius: 4px;
}

.match-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 24px;
  align-items: center;
  padding: 15px 20px;
}

.match-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 11px 0 0 11px;
  background: var(--green);
  content: '';
}

.match-card .section-heading {
  grid-column: 1;
  margin: 0;
}

.match-card .section-heading h1 {
  font-size: 26px;
}

.match-card .section-heading .eyebrow {
  margin-bottom: 4px;
}

.match-form {
  grid-column: 2;
  grid-row: 1;
  grid-template-columns: 190px auto;
  gap: 8px;
}

.match-form label {
  font: 9px var(--mono);
  letter-spacing: 1px;
}

.match-form input {
  height: 38px;
  border-radius: 5px;
  background: #0a0f18;
}

.match-form .button-primary {
  height: 38px;
  border-radius: 5px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.match-details {
  grid-column: 1;
  min-height: 0;
  margin: 7px 0 0;
  padding: 0;
  border: 0;
  font-size: 10px;
}

.actions {
  grid-column: 2;
  justify-content: flex-end;
  margin: 8px 0 0;
}

.button {
  min-height: 34px;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: .35px;
}

.button-live {
  background: #273216;
}

.notice {
  grid-column: 1/-1;
  min-height: 0;
  margin: 5px 0 0;
}

.pitch-card {
  padding: 14px;
  border-color: #2a3749;
  background: #0b111a;
  border-radius: 12px;
  overflow: hidden;
}

.pitch-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  border-radius: 10px;
  background: #111a26;
  border: 1px solid #28374a;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  padding: 10px 12px 12px;
}

.pitch-wrap {
  position: relative;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #090a0d;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  border: 1px solid #2a3749;
}

.pitch-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1.50;
}

.empty-state {
  color: #e5f0df;
  font-weight: 600;
  text-shadow: 0 1px 8px #0009;
}

/* Drifted FM TV Match View Header (Above the pitch) */
.fm-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 2px 4px;
}

.fm-clock {
  background: linear-gradient(180deg, rgba(24, 34, 48, 0.94), rgba(12, 17, 24, 0.96));
  backdrop-filter: blur(8px);
  color: #f8fafc;
  font: 800 16px/1 var(--sans);
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.5px;
}

.fm-scoreboard-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.fm-scoreboard {
  display: flex;
  align-items: center;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

.fm-team-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  height: 32px;
  min-width: 130px;
  font: 700 13px/1 var(--sans);
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.2);
}

.fm-home-banner {
  background: linear-gradient(180deg, #d3202a 0%, #a0121a 100%);
  justify-content: space-between;
}

.fm-away-banner {
  background: linear-gradient(180deg, #5b2a79 0%, #3f1956 100%);
  justify-content: space-between;
}

.fm-team-name {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.fm-score {
  display: inline-block;
  font: 800 16px/1 var(--sans);
  background: rgba(0, 0, 0, 0.28);
  padding: 3px 8px;
  border-radius: 4px;
  min-width: 20px;
  text-align: center;
}

.fm-sub-actions {
  display: flex;
  gap: 6px;
}

.fm-sub-btn {
  background: rgba(30, 41, 59, 0.88);
  backdrop-filter: blur(6px);
  color: #e2e8f0;
  font: 600 10px/1 var(--sans);
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: background .15s, color .15s;
}

.fm-sub-btn:hover {
  background: rgba(51, 65, 85, 0.95);
  color: #fff;
}

.fm-top-controls {
  display: flex;
  gap: 6px;
}

.fm-glass-btn {
  background: linear-gradient(180deg, rgba(45, 60, 80, 0.9), rgba(20, 30, 45, 0.92));
  backdrop-filter: blur(8px);
  color: #f1f5f9;
  font: 600 11px/1 var(--sans);
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  transition: background .15s, border-color .15s, transform .1s;
  white-space: nowrap;
}

.fm-glass-btn:hover {
  background: linear-gradient(180deg, rgba(55, 75, 100, 0.95), rgba(28, 42, 60, 0.95));
  border-color: rgba(255, 255, 255, 0.35);
}

.fm-glass-btn:active {
  transform: translateY(1px);
}

.fm-btn-exit {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.35);
}

.fm-btn-exit:hover {
  border-color: #f87171;
  color: #fff;
}

/* Drifted FM Match View Scrubber Console (Below the pitch) */
.fm-scrubber-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  width: 100%;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
  backdrop-filter: blur(10px);
  border: 1px solid #475569;
  border-radius: 7px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.fm-view-btn {
  font-size: 10px;
  padding: 5px 9px;
  background: linear-gradient(180deg, #475569, #334155);
}

.fm-timeline-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 140px;
  height: 24px;
}

.fm-timeline-wrap input[type=range] {
  width: 100%;
  accent-color: #22c55e;
  height: 8px;
  border-radius: 4px;
  background: #0f291e;
  outline: none;
  cursor: pointer;
}

.fm-phase-mark {
  position: absolute;
  top: -11px;
  font: 700 8.5px var(--sans);
  color: #94a3b8;
  letter-spacing: 0.5px;
  pointer-events: none;
}

.fm-phase-ko {
  left: 2px;
}

.fm-phase-ht {
  left: 50%;
  transform: translateX(-50%);
}

.fm-phase-ft {
  right: 2px;
}

.fm-live-btn {
  padding: 4px 9px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid #334155;
  border-radius: 5px;
  color: #22c55e;
  font: 700 10px/1 var(--sans);
  text-transform: uppercase;
  cursor: default;
}

.fm-playback-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.fm-ctrl-btn {
  min-width: 27px;
  height: 27px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  background: linear-gradient(180deg, #475569, #334155);
  border: 1px solid #64748b;
  border-radius: 5px;
  color: #f8fafc;
  font-size: 10px;
  cursor: pointer;
  transition: background .15s;
}

.fm-ctrl-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #5b6f8a, #3f4f66);
}

.fm-ctrl-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.fm-ctrl-play {
  min-width: 32px;
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
  border-color: #60a5fa;
  font-weight: 700;
}

.fm-ctrl-play:hover:not(:disabled) {
  background: linear-gradient(180deg, #3b82f6, #2563eb);
}

.fm-readout-pos {
  font: 10px var(--mono);
  color: #94a3b8;
  white-space: nowrap;
  margin-left: 4px;
}

.pitch-controls {
  padding: 10px 18px 0;
}

.player-inspector {
  margin: 10px 18px 0;
  border-color: #344157;
  border-radius: 7px;
  background: #0c121c;
}

.metrics-card,
.token-card,
.activity-card,
.library-card {
  border-radius: 8px;
}

.metric {
  border-color: #283446;
}

.metric strong {
  color: #f3f6fb;
  font: 700 18px var(--display);
}

.token-form input {
  border-radius: 5px;
  background: #0a0f18;
}

.activity-log li {
  grid-template-columns: 45px 48px minmax(0, 1fr);
}

@media(max-width:1050px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 280px;
    padding-inline: 18px;
  }

  .match-card {
    grid-template-columns: 1fr;
  }

  .match-card .section-heading,
  .match-form,
  .match-details,
  .actions {
    grid-column: 1;
    grid-row: auto;
  }

  .match-form {
    grid-template-columns: minmax(0, 1fr) auto;
    margin-top: 12px;
  }

  .actions {
    justify-content: flex-start;
  }
}

@media(max-width:920px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

@media(max-width:760px) {
  .layout {
    padding: 13px 12px 28px;
  }

  .side-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .activity-card {
    grid-column: 1/-1;
  }
}

@media(max-width:560px) {
  .topbar {
    height: 60px;
  }

  .card {
    padding: 14px;
  }

  .match-form {
    grid-template-columns: 1fr;
  }

  .match-form .button-primary {
    width: 100%;
  }

  .side-column {
    grid-template-columns: 1fr;
  }

  .activity-card {
    grid-column: auto;
  }

  .pitch-card {
    padding: 0 0 12px;
  }

  .pitch-card>.section-heading {
    padding: 13px 14px 10px;
  }

  .pitch-wrap {
    min-height: 160px;
  }

  .pitch-controls {
    padding-inline: 12px;
  }

  .player-inspector {
    margin-inline: 12px;
  }

  .frame-readout {
    min-width: 100px;
  }
}