: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: 130px 274px 126px 270px 168px;
  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: 96px minmax(0, 1fr) 220px minmax(0, 345px) minmax(0, 440px);
  align-items: center;
  gap: 34px;
  padding: 0 38px;
  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: 58px;
  font-weight: 950;
  line-height: 1.08;
  white-space: nowrap;
}

.status-pill {
  justify-self: center;
  padding: 11px 30px 14px;
  border: 2px solid rgba(102, 218, 83, 0.78);
  border-radius: 10px;
  background: rgba(31, 128, 30, 0.72);
  color: #f4fff0;
  font-size: 38px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
  box-shadow: inset 0 0 22px rgba(103, 214, 79, 0.16);
}

.top-meta {
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 18px;
  border-left: 1px solid rgba(255, 255, 255, 0.32);
  padding-left: 32px;
  color: #f5f7fa;
  font-size: 34px;
  font-weight: 850;
  line-height: 1.1;
  white-space: nowrap;
}

.meta-icon {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.15em;
}

.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) {
  min-width: 0;
}

.team-logo {
  width: 148px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 4px solid var(--blue);
  border-radius: 28%;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.22), transparent 36%),
    rgba(5, 34, 71, 0.95);
  color: #ffffff;
  font-size: 68px;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 0 28px rgba(59, 148, 255, 0.24);
}

.team-logo-away {
  border-color: var(--orange);
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.2), transparent 36%),
    rgba(78, 35, 8, 0.95);
  box-shadow: 0 0 28px rgba(255, 152, 31, 0.24);
}

.team-logo.has-image {
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  color: transparent;
}

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

.team-subtitle {
  margin-top: 11px;
  color: #74b6ff;
  font-size: 30px;
  font-weight: 950;
  line-height: 1.08;
  letter-spacing: 0;
  white-space: nowrap;
}

.team-subtitle-away {
  color: var(--orange);
}

.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: minmax(0, 25%) minmax(0, 23%) minmax(0, 24%) minmax(0, 28%);
  border-color: rgba(50, 146, 255, 0.78);
}

.player-panel,
.over-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 0 30px;
  border-right: 1px solid rgba(53, 145, 255, 0.7);
  background: rgba(3, 16, 30, 0.7);
  overflow: hidden;
}

.player-panel-orange {
  border-right-color: rgba(255, 152, 31, 0.62);
}

.over-panel {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 28px;
  border-right: 0;
}

.player-avatar {
  width: 112px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 3px solid var(--blue);
  border-radius: 50%;
  background: rgba(13, 62, 131, 0.86);
  color: #ffffff;
  font-size: 44px;
  font-weight: 950;
  line-height: 1;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.player-avatar-orange {
  border-color: var(--orange);
  background: rgba(112, 58, 8, 0.86);
}

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

.player-copy {
  min-width: 0;
}

.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 {
  margin-top: 16px;
  color: #ffffff;
  font-size: 68px;
  font-weight: 950;
  line-height: 1.02;
  white-space: nowrap;
}

.player-stat {
  margin-top: 14px;
  color: #f8fafc;
  font-size: 58px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.player-panel-orange .player-stat {
  font-size: 38px;
}

.ball-strip {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.ball-chip {
  width: 64px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.36);
  border-radius: 50%;
  background: rgba(67, 77, 90, 0.78);
  color: #ffffff;
  font-size: 40px;
  font-weight: 950;
  line-height: 1;
}

.ball-run {
  border-color: rgba(152, 222, 75, 0.88);
  background: rgba(77, 153, 31, 0.88);
}

.ball-boundary {
  border-color: rgba(152, 222, 75, 0.94);
  background: rgba(59, 134, 34, 0.94);
}

.ball-wicket {
  border-color: rgba(255, 110, 55, 0.94);
  background: rgba(199, 45, 20, 0.94);
}

.ball-pending {
  color: rgba(255, 255, 255, 0.72);
  background: rgba(36, 42, 51, 0.9);
}

.bottom-bar {
  display: grid;
  grid-template-columns: minmax(0, 29%) minmax(0, 15%) minmax(0, 15%) minmax(0, 24%) minmax(0, 17%);
  align-items: center;
  border-radius: 7px;
  background: rgba(5, 8, 11, 0.75);
}

.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;
}

.bottom-icon {
  width: 82px;
  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: 44px;
  font-weight: 900;
  line-height: 1;
}

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

.bottom-value {
  margin-top: 12px;
  color: #f8fafc;
  font-size: 46px;
  font-weight: 950;
  line-height: 1.02;
  white-space: nowrap;
}

.match-title,
.top-meta span:last-child,
.team-name,
.team-subtitle,
.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: hidden;
  text-overflow: ellipsis;
}

.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;
}

.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);
}

.screen-portrait .scoreboard {
  width: 1080px;
  height: 1920px;
  padding: 32px;
  grid-template-rows: 150px 500px 210px 590px 322px;
  gap: 18px;
}

.screen-portrait .top-bar {
  grid-template-columns: 96px minmax(0, 1fr) 340px;
  grid-template-rows: 84px 48px;
  gap: 8px 22px;
  padding: 0 26px;
}

.screen-portrait .brand-mark {
  width: 74px;
  grid-row: 1 / 2;
}

.screen-portrait .match-title {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  font-size: 52px;
}

.screen-portrait .status-pill {
  grid-column: 3 / 4;
  grid-row: 1 / 2;
  padding: 10px 22px 13px;
  font-size: 34px;
}

.screen-portrait .top-meta {
  grid-row: 2 / 3;
  height: auto;
  border-left: 0;
  padding-left: 0;
  gap: 12px;
  font-size: 28px;
}

.screen-portrait .top-meta:not(.top-meta-time) {
  grid-column: 2 / 3;
}

.screen-portrait .top-meta-time {
  grid-column: 3 / 4;
}

.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 .team-subtitle {
  margin-top: 8px;
  font-size: 26px;
}

.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: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

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

.screen-portrait .player-panel:nth-child(2),
.screen-portrait .over-panel {
  border-right: 0;
}

.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 .player-panel-orange .player-stat {
  font-size: 36px;
}

.screen-portrait .ball-strip {
  gap: 9px;
}

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

.screen-portrait .bottom-bar {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, 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:first-child {
  grid-column: 1 / -1;
  border-right: 0;
}

.screen-portrait .bottom-item:nth-child(2n + 1) {
  border-right: 0;
}

.screen-portrait .bottom-item:nth-last-child(-n + 2) {
  border-bottom: 0;
}

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

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

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