:root {
  --bg: #05080c;
  --panel: rgba(6, 13, 22, 0.84);
  --panel-strong: rgba(8, 15, 24, 0.94);
  --line: rgba(255, 255, 255, 0.22);
  --line-soft: rgba(255, 255, 255, 0.14);
  --blue: #3292ff;
  --blue-soft: rgba(50, 146, 255, 0.22);
  --orange: #ff941f;
  --orange-soft: rgba(255, 148, 31, 0.22);
  --green: #67d64f;
  --yellow: #ffd51f;
  --red: #f04f2f;
  --text: #f8fafc;
  --text-muted: #bac4d0;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 15% 38%, rgba(31, 116, 202, 0.22), transparent 28%),
    radial-gradient(circle at 86% 34%, rgba(206, 92, 19, 0.2), transparent 28%),
    linear-gradient(180deg, #030609 0%, var(--bg) 58%, #020405 100%);
  color: var(--text);
  font-family:
    "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  overflow: hidden;
}

body {
  position: relative;
}

.screen-fit {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transform-origin: 0 0;
  will-change: transform;
}

.scoreboard {
  flex: 0 0 auto;
  width: 1920px;
  height: 1080px;
  padding: 24px;
  display: grid;
  grid-template-rows: 112px 274px 126px 336px 120px;
  gap: 16px;
  background:
    linear-gradient(90deg, rgba(20, 135, 255, 0.26), transparent 16%),
    linear-gradient(270deg, rgba(255, 137, 24, 0.26), transparent 16%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0));
  overflow: hidden;
}

.top-bar,
.score-hero,
.target-strip,
.live-grid,
.bottom-bar {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  box-shadow:
    inset 0 0 44px rgba(255, 255, 255, 0.035),
    0 0 0 1px rgba(0, 0, 0, 0.28);
}

.top-bar {
  display: grid;
  grid-template-columns: minmax(0, 470px) minmax(0, 1fr) minmax(0, 360px);
  align-items: center;
  gap: 28px;
  padding: 0 42px;
  border-color: rgba(255, 255, 255, 0.16);
}

.brand-mark {
  width: 76px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 20%;
  color: #ffffff;
  font-size: 23px;
  font-weight: 950;
  line-height: 1;
}

.match-title {
  color: #ffffff;
  font-size: 54px;
  font-weight: 950;
  line-height: 1.08;
  white-space: nowrap;
}

.match-heading {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  text-align: center;
  overflow: hidden;
}

.match-heading .match-title {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
}

.status-pill {
  flex: 0 0 auto;
  padding: 10px 26px 12px;
  border: 2px solid rgba(255, 213, 31, 0.78);
  border-radius: 10px;
  background: rgba(120, 88, 10, 0.58);
  color: #fff7c2;
  font-size: 32px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
  box-shadow: inset 0 0 22px rgba(255, 213, 31, 0.14);
}

.top-meta {
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #f5f7fa;
  font-size: 32px;
  font-weight: 850;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
}

.top-meta span:last-child {
  flex: 1 1 auto;
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
}

.top-meta-date {
  justify-content: flex-end;
  text-align: right;
}

.top-meta-date span:last-child {
  flex: 0 1 auto;
}

.meta-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.92);
}

.meta-icon svg {
  width: 28px;
  height: 28px;
}

.score-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 31%) minmax(0, 38%) minmax(0, 31%);
  align-items: center;
  padding: 0 36px;
  border-left: 6px solid var(--blue);
  border-right: 6px solid var(--orange);
}

.team {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 30px;
  overflow: hidden;
}

.team-right {
  justify-content: flex-end;
  text-align: right;
}

.team > div:not(.team-logo) {
  flex: 1 1 auto;
  min-width: 0;
}

.team-logo {
  width: 148px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background-color: transparent;
  color: transparent;
  font-size: 0;
  font-weight: normal;
  line-height: 1;
  overflow: hidden;
  box-shadow: none;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.team-logo.logo-shape-original {
  width: 160px;
  height: 112px;
  aspect-ratio: auto;
  border-radius: 0;
  background-size: contain;
}

.team-logo.logo-shape-circle {
  width: 148px;
  height: 148px;
  aspect-ratio: auto;
  border-radius: 50%;
  background-size: cover;
}

.team-logo.logo-shape-rect {
  width: 168px;
  height: 104px;
  aspect-ratio: auto;
  border-radius: 0;
  background-size: contain;
}

.team-name {
  color: #ffffff;
  font-size: 74px;
  font-weight: 950;
  line-height: 1.12;
  white-space: nowrap;
}

.score-center {
  min-width: 0;
  text-align: center;
}

.score-main {
  color: #ffffff;
  font-size: 210px;
  font-weight: 950;
  line-height: 0.92;
  text-shadow: 0 5px 22px rgba(255, 255, 255, 0.15);
  white-space: nowrap;
}

.score-overs {
  margin-top: 22px;
  color: #f1f5f9;
  font-size: 55px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.target-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  border-radius: 7px;
  background: rgba(4, 8, 12, 0.75);
}

.target-item {
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 0 18px;
  border-right: 1px solid rgba(255, 255, 255, 0.32);
  white-space: nowrap;
  overflow: hidden;
}

.target-item:last-child {
  border-right: 0;
}

.target-label {
  color: #f8fafc;
  font-size: 64px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.target-value {
  color: var(--yellow);
  font-size: 98px;
  font-weight: 950;
  line-height: 0.95;
  white-space: nowrap;
}

.live-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-color: rgba(50, 146, 255, 0.78);
}

.batting-group,
.bowling-group,
.player-row,
.bowler-row,
.over-panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.batting-group,
.bowling-group {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 30px;
  background: rgba(3, 16, 30, 0.7);
}

.batting-group {
  border-right: 1px solid rgba(53, 145, 255, 0.7);
}

.bowling-group {
  border-left: 1px solid rgba(255, 152, 31, 0.44);
}

.bowling-content {
  min-width: 0;
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 48%) minmax(0, 52%);
  gap: 18px;
}

.bowling-column,
.over-column {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.bowler-row,
.over-panel {
  flex: 1 1 auto;
}

.group-label-orange {
  color: var(--orange);
}

.group-label-neutral {
  color: #e5e7eb;
}

.group-label {
  color: var(--blue);
  font-size: 34px;
  font-weight: 950;
  line-height: 1;
}

.batting-list {
  min-width: 0;
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.player-row,
.bowler-row {
  display: grid;
  grid-template-rows: auto auto;
  align-content: center;
  justify-items: center;
  row-gap: 18px;
  text-align: center;
  background: rgba(3, 16, 30, 0.7);
}

.player-row {
  border: 1px solid rgba(53, 145, 255, 0.35);
  border-radius: 8px;
  padding: 0 24px;
}

.bowler-row {
  border: 1px solid rgba(255, 152, 31, 0.38);
  border-radius: 8px;
  padding: 0 24px;
}

.over-panel {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 28px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(3, 16, 30, 0.7);
}

.player-avatar {
  width: 112px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background-color: transparent;
  color: transparent;
  font-size: 0;
  font-weight: normal;
  line-height: 1;
  overflow: hidden;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.player-avatar-orange {
  background-color: transparent;
}

.player-avatar.has-image {
  color: transparent;
}

.player-identity {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
}

.panel-label {
  color: var(--blue);
  font-size: 34px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.panel-label-orange {
  color: var(--orange);
}

.panel-label-muted {
  color: #e5e7eb;
  font-size: 44px;
}

.player-name {
  color: #ffffff;
  font-size: 64px;
  font-weight: 950;
  line-height: 1.02;
  white-space: nowrap;
}

.player-name-row {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.player-name-row .player-name {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
}

.strike-arrow {
  width: 0;
  height: 0;
  display: none;
  flex: 0 0 auto;
  border-top: 18px solid transparent;
  border-bottom: 18px solid transparent;
  border-right: 28px solid var(--yellow);
  filter: drop-shadow(0 0 8px rgba(255, 213, 31, 0.28));
}

.player-row.is-on-strike .strike-arrow {
  display: block;
}

.player-stat {
  width: 100%;
  color: #f8fafc;
  font-size: 58px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.bowler-stat-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.bowler-stat-grid span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.045);
  padding: 8px 10px;
  line-height: 1;
}

.bowler-stat-grid em {
  color: var(--text-muted);
  font-size: 20px;
  font-style: normal;
  font-weight: 850;
  white-space: nowrap;
}

.bowler-stat-grid strong {
  color: #ffffff;
  font-size: 38px;
  font-weight: 950;
  white-space: nowrap;
}

.ball-strip {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, 56px);
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.ball-chip {
  width: 56px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid #e2e8f0;
  border-radius: 9px;
  background: #ffffff;
  color: #020617;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.ball-chip svg {
  width: 100%;
  height: 100%;
}

.ball-chip text {
  fill: currentColor;
  dominant-baseline: middle;
  font-size: 20px;
  font-weight: 900;
  text-anchor: middle;
}

.ball-chip path,
.ball-chip .outline {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ball-chip .triangle-outline {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linejoin: round;
}

.ball-chip .sub,
.ball-chip .sub-center,
.ball-chip .wicket-sub,
.ball-chip .triangle-text {
  font-size: 10px;
}

.ball-chip .dot {
  fill: #64748b;
}

.ball-chip .placeholder-dot {
  fill: #e2e8f0;
}

.ball-chip .wicket-main,
.ball-chip .wicket-sub {
  fill: #b91c1c;
}

.ball-chip .penalty-text {
  font-size: 14px;
  fill: #ffffff;
}

.ball-run {
  color: #020617;
}

.ball-four {
  border-color: #e2e8f0;
  background: #4f46e5;
  color: #ffffff;
}

.ball-six {
  border-color: #e2e8f0;
  background: #16a34a;
  color: #ffffff;
}

.ball-wicket {
  border-color: rgba(255, 110, 55, 0.94);
  background: #ffffff;
  color: #b91c1c;
}

.ball-pending {
  color: #e2e8f0;
  background: #ffffff;
}

.ball-next {
  color: #e2e8f0;
  background: #ffffff;
  border-color: #fecdd3;
  animation: next-ball-pulse 1s ease-in-out 0.8s infinite alternate;
}

.ball-extra {
  color: #020617;
  background: #ffffff;
}

.ball-penalty {
  border-color: #e2e8f0;
  background: #b45309;
  color: #ffffff;
}

@keyframes next-ball-pulse {
  from {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18), 0 0 4px rgba(248, 113, 113, 0.08);
  }

  to {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18), 0 0 12px rgba(248, 113, 113, 0.18);
  }
}

.bottom-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  border-radius: 7px;
  background: rgba(5, 8, 11, 0.75);
}

.scoreboard.hide-officials .bottom-item-officials,
.scoreboard.hide-sponsors .bottom-item-sponsors {
  display: none;
}

.scoreboard.hide-officials:not(.hide-sponsors) .bottom-bar,
.scoreboard.hide-sponsors:not(.hide-officials) .bottom-bar {
  grid-template-columns: minmax(0, 1fr);
}

.scoreboard.hide-officials.hide-sponsors {
  grid-template-rows: 112px 274px 126px 472px;
}

.scoreboard.hide-officials.hide-sponsors .bottom-bar {
  display: none;
}

.bottom-item {
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 28px;
  border-right: 1px solid rgba(255, 255, 255, 0.3);
  overflow: hidden;
}

.bottom-item:last-child {
  border-right: 0;
}

.bottom-item > div {
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 18px;
}

.bottom-icon {
  width: 64px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 3px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  color: #ffffff;
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
}

.bottom-icon svg {
  width: 34px;
  height: 34px;
}

.bottom-label {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 24px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.bottom-value {
  flex: 1 1 auto;
  min-width: 0;
  color: #f8fafc;
  font-size: 38px;
  font-weight: 950;
  line-height: 1.02;
  white-space: nowrap;
}

.bottom-list {
  font-size: 30px;
}

.sponsor-strip {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #f8fafc;
  font-size: 30px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
}

.sponsor-logo {
  width: 86px;
  height: 48px;
  display: inline-block;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.92);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.match-title,
.top-meta span:last-child,
.team-name,
.score-main,
.score-overs,
.target-label,
.target-value,
.panel-label,
.player-name,
.player-stat,
.bottom-label,
.bottom-value {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  text-overflow: clip;
}

.connection-state {
  position: fixed;
  right: 18px;
  bottom: 14px;
  z-index: 2;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.live-body .connection-state,
.console-body .connection-state {
  display: none;
}

.connection-state.is-live {
  color: #d9ffe0;
  border-color: rgba(112, 209, 92, 0.48);
}

.connection-state.is-error {
  color: #ffe1d8;
  border-color: rgba(240, 79, 47, 0.52);
}

.hide-team-logos .team-logo {
  display: none;
}

.hide-player-avatars .player-avatar {
  display: none;
}

.screen-portrait .scoreboard {
  width: 1080px;
  height: 1920px;
  padding: 32px;
  grid-template-rows: 190px 500px 210px 720px 200px;
  gap: 18px;
}

.screen-portrait .scoreboard.hide-officials.hide-sponsors {
  grid-template-rows: 190px 500px 210px 902px;
}

.screen-portrait .top-bar {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 42px 96px 42px;
  gap: 5px;
  justify-items: center;
  padding: 20px 34px;
}

.screen-portrait .match-title {
  font-size: 52px;
}

.screen-portrait .match-heading {
  width: 100%;
  flex-direction: column;
  gap: 8px;
}

.screen-portrait .status-pill {
  padding: 10px 22px 13px;
  font-size: 30px;
}

.screen-portrait .top-meta {
  width: 100%;
  height: auto;
  border-left: 0;
  padding-left: 0;
  justify-content: center;
  gap: 10px;
  font-size: 28px;
  text-align: center;
}

.screen-portrait .top-meta-date {
  justify-content: center;
  text-align: center;
}

.screen-portrait .score-hero {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 142px 198px 142px;
  align-content: center;
  gap: 0;
  padding: 22px 34px;
  border-left-width: 0;
  border-right-width: 0;
  border-top: 6px solid var(--blue);
  border-bottom: 6px solid var(--orange);
}

.screen-portrait .score-center {
  order: 0;
}

.screen-portrait .team,
.screen-portrait .team-right {
  justify-content: center;
  text-align: center;
  gap: 24px;
}

.screen-portrait .team-right {
  flex-direction: row-reverse;
}

.screen-portrait .team-logo {
  width: 124px;
}

.screen-portrait .team-name {
  font-size: 62px;
}

.screen-portrait .score-main {
  font-size: 170px;
}

.screen-portrait .score-overs {
  margin-top: 16px;
  font-size: 48px;
}

.screen-portrait .target-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.screen-portrait .target-item {
  flex-direction: column;
  gap: 10px;
  padding: 0 12px;
}

.screen-portrait .target-label {
  font-size: 44px;
}

.screen-portrait .target-value {
  font-size: 92px;
}

.screen-portrait .live-grid {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.screen-portrait .batting-group,
.screen-portrait .bowling-group {
  gap: 24px;
  padding: 24px 28px;
}

.screen-portrait .player-row,
.screen-portrait .bowler-row,
.screen-portrait .over-panel {
  padding: 0 28px;
}

.screen-portrait .batting-group {
  border-right: 0;
  border-bottom: 1px solid rgba(53, 145, 255, 0.7);
}

.screen-portrait .bowling-group {
  border-left: 0;
}

.screen-portrait .bowling-content {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.screen-portrait .bowling-column,
.screen-portrait .over-column {
  gap: 24px;
}

.screen-portrait .player-avatar {
  width: 108px;
}

.screen-portrait .panel-label {
  font-size: 32px;
}

.screen-portrait .panel-label-muted {
  font-size: 40px;
}

.screen-portrait .player-name {
  font-size: 58px;
}

.screen-portrait .player-stat {
  font-size: 52px;
}

.screen-portrait .ball-strip {
  gap: 9px;
  grid-template-columns: repeat(auto-fit, 58px);
}

.screen-portrait .ball-chip {
  width: 58px;
  font-size: 30px;
}

.screen-portrait .bottom-bar {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.screen-portrait .scoreboard.hide-officials:not(.hide-sponsors) .bottom-bar,
.screen-portrait .scoreboard.hide-sponsors:not(.hide-officials) .bottom-bar {
  grid-template-rows: minmax(0, 1fr);
}

.screen-portrait .bottom-item {
  gap: 18px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.screen-portrait .bottom-item {
  border-right: 0;
}

.screen-portrait .bottom-icon {
  width: 72px;
  font-size: 38px;
}

.screen-portrait .bottom-label {
  font-size: 26px;
}

.screen-portrait .bottom-value {
  font-size: 42px;
}

.screen-portrait .bottom-list {
  font-size: 30px;
}

.screen-portrait .sponsor-strip {
  gap: 8px;
  font-size: 32px;
}

.screen-portrait .sponsor-logo {
  width: 78px;
  height: 44px;
}

html.console-mode,
html.console-mode body {
  width: 100%;
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

html.console-mode {
  background: #05080c;
}

.console-body {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(20, 85, 145, 0.14), transparent 38%),
    linear-gradient(270deg, rgba(255, 128, 27, 0.1), transparent 36%),
    #05080c;
}

.console-shell {
  height: 100vh;
  min-height: 720px;
  padding: 14px 18px;
  color: var(--text);
  font-family:
    "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

.console-header {
  height: 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.console-club {
  min-width: 0;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.console-title {
  min-width: 0;
  justify-self: center;
  display: block;
  color: #ffffff;
  font-size: 25px;
  font-weight: 950;
  text-align: center;
  white-space: nowrap;
}

.console-health {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: #f8fafc;
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
}

.console-header-item {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
}

.console-header-item strong {
  min-width: 0;
  color: #f8fafc;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #63d04f;
  box-shadow: 0 0 0 4px rgba(99, 208, 79, 0.16);
}

.console-layout {
  display: grid;
  grid-template-columns: clamp(318px, 22vw, 360px) minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
  padding-top: 12px;
  height: calc(100% - 56px);
  min-height: 0;
  overflow: hidden;
}

.console-panel {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(6, 13, 22, 0.82);
  box-shadow: inset 0 0 34px rgba(255, 255, 255, 0.025);
}

.settings-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  max-height: calc(100vh - 82px);
  overflow-y: auto;
}

.preview-panel {
  height: 100%;
  max-height: calc(100vh - 82px);
  min-height: 0;
}

.control-section {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.control-section:last-child {
  border-bottom: 0;
}

.auth-section {
  background: rgba(12, 22, 34, 0.72);
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title-row span {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.control-section h2,
.preview-toolbar h2 {
  margin: 0 0 14px;
  padding-left: 12px;
  border-left: 4px solid var(--blue);
  font-size: 20px;
  line-height: 1.1;
}

.section-title-row h2 {
  margin-bottom: 0;
}

.field-label {
  display: block;
  margin-top: 10px;
  color: #f8fafc;
  font-size: 14px;
  font-weight: 800;
}

.field-label input,
.setting-row input,
.setting-row select,
.auth-row input,
.console-row input,
.console-row select {
  width: 100%;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  background: rgba(1, 7, 13, 0.66);
  color: #f8fafc;
  font: inherit;
  font-size: 14px;
  outline: none;
  padding: 0 12px;
}

.setting-row input,
.setting-row select {
  margin: 0;
}

.auth-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 10px;
  align-items: center;
}

.auth-row input {
  height: 42px;
  font-size: 14px;
  letter-spacing: 0;
}

.auth-status {
  flex: 0 0 auto;
  min-width: 86px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.auth-status.is-authorized {
  border-color: rgba(103, 214, 79, 0.44);
  background: rgba(45, 143, 57, 0.2);
  color: #c8f7bd;
}

.auth-status.is-checking {
  border-color: rgba(255, 213, 31, 0.42);
  background: rgba(128, 99, 16, 0.2);
  color: #ffe98a;
}

.auth-status.is-denied {
  border-color: rgba(240, 79, 47, 0.5);
  background: rgba(143, 37, 28, 0.2);
  color: #ffb9ad;
}

.field-label input.is-overridden,
.setting-row input.is-overridden {
  border-color: rgba(50, 146, 255, 0.64);
  background: rgba(12, 34, 58, 0.72);
}

.field-label input:focus,
.setting-row input:focus,
.setting-row select:focus,
.console-row input:focus,
.console-row select:focus {
  border-color: rgba(50, 146, 255, 0.78);
  box-shadow: 0 0 0 3px rgba(50, 146, 255, 0.14);
}

.preview-toolbar p {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

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

.settings-list,
.nested-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-row {
  min-height: 38px;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: #f8fafc;
  font-size: 14px;
  font-weight: 850;
}

.setting-row.setting-child {
  grid-template-columns: 72px minmax(0, 1fr);
  margin-left: 8px;
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.setting-label {
  min-width: 0;
  color: #f8fafc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setting-child .setting-label {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 750;
}

.setting-value {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.setting-actions {
  gap: 10px;
}

.row-controls {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(72px, 88px) 30px;
  gap: 6px;
}

.row-controls-compact {
  grid-template-columns: minmax(0, 1fr) 30px;
}

.row-controls-official {
  grid-template-columns: minmax(0, 1fr) 30px;
}

.row-add-button {
  justify-self: end;
}

.asset-name {
  min-width: 0;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}

.switch-row,
.subsection-head {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  color: #f8fafc;
  font-size: 14px;
  font-weight: 850;
}

.switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 2;
  cursor: pointer;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.3);
  pointer-events: none;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 160ms ease;
}

.switch input:checked + span {
  background: #2f8cff;
}

.switch input:checked + span::after {
  transform: translateX(20px);
}

.upload-button,
.ghost-button,
.primary-button,
.secondary-button,
.danger-button,
.template-option,
.icon-button {
  cursor: pointer;
  font-family: inherit;
}

.upload-button,
.ghost-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(50, 146, 255, 0.52);
  border-radius: 7px;
  background: rgba(14, 33, 54, 0.72);
  color: #dcecff;
  font-size: 14px;
  font-weight: 800;
  padding: 0 14px;
}

.compact-upload {
  width: 100%;
  min-height: 36px;
}

.logo-upload-value {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 8px;
  justify-content: stretch;
}

.logo-preview {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  color: transparent;
  overflow: hidden;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  font-size: 0;
  font-weight: normal;
  line-height: 1;
}

.logo-preview.logo-shape-original {
  width: 42px;
  height: 32px;
  border-radius: 0;
  background-size: contain;
}

.logo-preview.logo-shape-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-size: cover;
}

.logo-preview.logo-shape-rect {
  width: 42px;
  height: 28px;
  border-radius: 0;
  background-size: contain;
}

.upload-button input,
.file-ghost input,
.file-add-button input {
  display: none;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
  padding: 0 22px;
}

.compact-action-button {
  min-height: 42px;
  padding: 0 14px;
  font-size: 14px;
}

.primary-button {
  background: #2478f2;
  box-shadow: 0 10px 28px rgba(36, 120, 242, 0.24);
}

.secondary-button {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.12);
}

.primary-button:disabled,
.secondary-button:disabled,
.template-option:disabled,
.icon-add-button.is-disabled {
  cursor: not-allowed;
  opacity: 0.46;
  box-shadow: none;
}

.console-locked [data-auth-required] {
  opacity: 0.62;
}

.danger-button {
  border-color: rgba(240, 79, 47, 0.45);
  background: rgba(143, 37, 28, 0.66);
}

.header-action {
  justify-self: end;
  width: 100%;
}

.stack-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.console-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 112px 30px;
  align-items: center;
  gap: 6px;
}

.console-row-icon {
  color: var(--text-muted);
  text-align: center;
}

.console-row input,
.console-row select {
  margin: 0;
}

.icon-button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  font-size: 22px;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.icon-add-button {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(50, 146, 255, 0.56);
  border-radius: 7px;
  background: rgba(14, 33, 54, 0.72);
  color: #dcecff;
  cursor: pointer;
  font: inherit;
  font-size: 22px;
  font-weight: 850;
  line-height: 1;
}

.icon-add-button:hover {
  border-color: rgba(50, 146, 255, 0.9);
  background: rgba(50, 146, 255, 0.18);
}

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

.sponsor-upload-slot {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 12px;
  padding: 0 8px;
}

.sponsor-upload-slot.is-empty {
  grid-column: 1 / -1;
  justify-content: center;
}

.template-option {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
  font-size: 15px;
  font-weight: 900;
  padding: 0 14px;
}

.template-option.is-active {
  border-color: rgba(50, 146, 255, 0.8);
  background: rgba(50, 146, 255, 0.16);
  color: #7dbbff;
}

.template-option:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.preview-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px 20px 16px;
}

.preview-toolbar {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.preview-toolbar h2 {
  margin-bottom: 6px;
}

.preview-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.template-segment {
  display: grid;
  grid-template-columns: repeat(3, minmax(74px, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.template-segment .template-option {
  min-height: 36px;
  justify-content: center;
  gap: 6px;
  padding: 0 16px;
  font-size: 14px;
  white-space: nowrap;
}

.preview-frame-shell {
  position: relative;
  width: 100%;
  max-height: 100%;
  align-self: center;
  justify-self: center;
  margin-top: 0;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  overflow: hidden;
  background: #020405;
}

.preview-frame-shell iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #020405;
}

.console-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 0;
}

@media (max-width: 1180px) {
  .console-shell {
    height: auto;
    min-height: 100vh;
  }

  .console-header {
    height: auto;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    padding-bottom: 14px;
  }

  .console-title {
    order: -1;
    grid-column: 1 / -1;
  }

  .header-action {
    justify-self: stretch;
  }
}

@media (max-width: 980px) {
  .console-shell {
    height: auto;
    min-height: 100vh;
  }

  .console-layout {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    align-items: stretch;
    overflow: visible;
  }

  .settings-panel,
  .preview-panel {
    max-height: none;
  }

  .preview-toolbar,
  .preview-tools {
    align-items: stretch;
    flex-direction: column;
  }

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

@media (max-width: 520px) {
  .console-shell {
    padding: 18px;
  }

  .console-header {
    gap: 12px 18px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .console-title {
    justify-self: center;
    font-size: 22px;
  }

  .console-club {
    font-size: 13px;
  }

  .console-header-item {
    gap: 8px;
    font-size: 13px;
  }

  .console-header-item strong {
    font-size: 14px;
  }

  .header-action {
    grid-column: 1 / -1;
  }

  .console-health {
    justify-content: flex-start;
    font-size: 14px;
  }

  .control-section,
  .preview-panel {
    padding: 16px;
  }

  .setting-row,
  .setting-row.setting-child {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .setting-row.setting-child {
    grid-template-columns: 64px minmax(0, 1fr);
    margin-left: 6px;
    padding-left: 8px;
  }

  .row-controls {
    grid-template-columns: minmax(82px, 1fr) minmax(68px, 80px) 30px;
  }

  .row-controls-official {
    grid-template-columns: minmax(0, 1fr) 30px;
  }

  .preview-toolbar {
    gap: 12px;
  }

  .preview-frame-shell {
    margin-top: 12px;
  }

  .console-actions {
    gap: 8px;
  }

  .primary-button,
  .secondary-button,
  .danger-button {
    min-height: 48px;
    padding: 0 8px;
    font-size: 13px;
    white-space: nowrap;
  }
}
