:root {
  color-scheme: dark;
  --bg: #020b18;
  --panel: rgba(4, 22, 42, 0.86);
  --panel-2: rgba(2, 35, 65, 0.72);
  --line: rgba(35, 155, 255, 0.48);
  --cyan: #23b9ff;
  --blue: #287cff;
  --green: #27d38a;
  --gold: #ffc646;
  --orange: #ff9f31;
  --red: #ff6578;
  --text: #eef7ff;
  --muted: #8fb5d6;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #020914;
  color: var(--text);
  font-family: "DIN Alternate", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  letter-spacing: 0;
}

body {
  overflow: hidden;
}

.screen {
  width: 100vw;
  min-height: 100vh;
  padding: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(29, 145, 255, 0.22), transparent 34%),
    radial-gradient(circle at 18% 80%, rgba(35, 185, 255, 0.12), transparent 26%),
    linear-gradient(180deg, #030915 0%, #03142a 48%, #020914 100%);
  display: grid;
  grid-template-rows: 86px 1fr 138px;
  gap: 14px;
}

.screen::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(35, 185, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(35, 185, 255, 0.08) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(180deg, transparent, #000 20%, #000 80%, transparent);
}

.screen-header {
  display: grid;
  grid-template-columns: 220px 1fr 220px;
  align-items: center;
  border-bottom: 1px solid rgba(35, 185, 255, 0.4);
  position: relative;
}

.screen-header::after {
  content: "";
  position: absolute;
  left: 28%;
  right: 28%;
  bottom: -2px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  box-shadow: 0 0 18px var(--cyan);
}

.screen-logo strong {
  display: block;
  color: #f3c66c;
  font-size: 30px;
  line-height: 1;
  font-family: Georgia, serif;
}

.screen-logo span {
  display: block;
  color: #f3c66c;
  letter-spacing: 7px;
  font-size: 12px;
}

.screen-title {
  text-align: center;
}

.screen-title h1 {
  margin: 0;
  font-size: clamp(28px, 3.2vw, 48px);
  line-height: 1.1;
  text-shadow: 0 0 18px rgba(35, 185, 255, 0.45);
}

.screen-title p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 18px;
  letter-spacing: 8px;
}

.screen-clock {
  text-align: right;
}

.screen-clock strong {
  display: block;
  font-size: 30px;
}

.screen-clock span {
  color: #c9dcf1;
}

.screen-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 360px;
  gap: 14px;
}

.left-stack,
.right-stack {
  min-height: 0;
  display: grid;
  gap: 12px;
}

.left-stack {
  grid-template-rows: 1.05fr 0.9fr 0.9fr;
}

.right-stack {
  grid-template-rows: 0.95fr 1.35fr 0.9fr;
}

.screen-card {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(8, 34, 63, 0.88), rgba(2, 16, 34, 0.88));
  box-shadow: inset 0 0 30px rgba(35, 185, 255, 0.07), 0 0 28px rgba(0, 111, 255, 0.14);
  padding: 16px;
  overflow: hidden;
}

.screen-card h2 {
  margin: 0 0 14px;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.screen-card h2::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}

dl {
  margin: 0;
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 7px 12px;
  color: #dbeaff;
  font-size: 14px;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
}

.progress-wrap {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 16px;
  align-items: center;
}

.progress-ring {
  width: 126px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--cyan) var(--progress), rgba(35, 185, 255, 0.16) 0);
  position: relative;
}

.progress-ring::before {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  background: #06172d;
}

.progress-ring span,
.progress-ring small {
  position: relative;
  display: block;
  text-align: center;
}

.progress-ring span {
  font-size: 32px;
  font-weight: 800;
}

.progress-ring small {
  color: var(--muted);
  margin-top: 34px;
  font-size: 12px;
}

.progress-list,
.stats-four,
.announcements {
  display: grid;
  gap: 10px;
}

.progress-line,
.stat-box,
.announcement,
.judge-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  color: #dbeaff;
}

.progress-line i,
.stat-box i {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 50%;
  margin-right: 8px;
  background: var(--cyan);
}

.stats-four {
  grid-template-columns: 1fr 1fr;
}

.stat-box {
  border: 1px solid rgba(35, 185, 255, 0.22);
  border-radius: 8px;
  padding: 10px;
  background: rgba(35, 185, 255, 0.06);
}

.stat-box strong {
  color: var(--cyan);
  font-size: 24px;
}

.rank-card {
  padding: 18px;
}

.rank-head,
.card-head-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rank-head span,
.card-head-link span {
  color: var(--muted);
}

.rank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 18px;
}

.rank-table th,
.rank-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(35, 185, 255, 0.18);
  text-align: center;
}

.rank-table th {
  color: #b9d5ef;
  font-size: 14px;
  font-weight: 500;
}

.rank-table td:nth-child(3),
.rank-table td:nth-child(4) {
  text-align: left;
}

.rank-table .score {
  color: var(--gold);
  font-size: 26px;
  font-weight: 900;
}

.rank-table tr:nth-child(3) .score {
  color: var(--red);
}

.medal {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 900;
}

.medal.gold { background: linear-gradient(135deg, #fff2a5, #f6a413); color: #6b3f00; }
.medal.silver { background: linear-gradient(135deg, #ffffff, #9ca8ba); color: #253040; }
.medal.bronze { background: linear-gradient(135deg, #ffd0a1, #b76223); color: #3d1804; }

.session-name {
  margin: 0 0 18px;
  color: #dbeaff;
}

.current-count {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  align-items: center;
}

.current-count div {
  width: 112px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 6px solid rgba(35, 185, 255, 0.24);
  display: grid;
  place-items: center;
  text-align: center;
}

.current-count strong {
  font-size: 28px;
}

.current-count span,
.current-count li {
  color: var(--muted);
}

.current-count ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
}

.judge-table {
  display: grid;
  gap: 8px;
}

.judge-row {
  grid-template-columns: 72px 46px 46px 1fr 42px;
  font-size: 13px;
}

.judge-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.judge-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.announcement {
  grid-template-columns: auto 1fr auto;
  font-size: 13px;
}

.announcement b {
  min-width: 38px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 5px;
  background: rgba(35, 185, 255, 0.22);
  color: var(--cyan);
}

.bottom-strip {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(8, 34, 63, 0.88), rgba(2, 16, 34, 0.88));
  display: grid;
  grid-template-columns: 1.1fr 1.25fr 1.1fr 220px;
  gap: 0;
  overflow: hidden;
}

.contestant-card {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 16px;
  align-items: center;
  padding: 16px 24px;
  border-right: 1px solid rgba(35, 185, 255, 0.24);
}

.contestant-card.current {
  background: rgba(35, 185, 255, 0.08);
}

.player-avatar {
  width: 88px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid var(--cyan);
  background: linear-gradient(135deg, #164b83, #0b1a33);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 28px;
  font-weight: 900;
  overflow: hidden;
}

.player-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.contestant-card h3 {
  margin: 0;
  font-size: 28px;
}

.contestant-card p {
  margin: 5px 0;
  color: #c8daf0;
}

.contestant-card .state {
  color: var(--gold);
  font-weight: 800;
  font-size: 18px;
}

.contestant-card.current .state {
  color: var(--cyan);
  font-size: 24px;
}

.qr-card {
  display: grid;
  place-items: center;
  padding: 14px;
  text-align: center;
  color: #dbeaff;
}

.fake-qr {
  width: 98px;
  aspect-ratio: 1;
  background:
    linear-gradient(90deg, #111 50%, transparent 0) 0 0/12px 12px,
    linear-gradient(#111 50%, transparent 0) 0 0/12px 12px,
    #fff;
  border: 8px solid #fff;
  box-shadow: 0 0 20px rgba(35, 185, 255, 0.28);
}

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

  .screen {
    min-height: 100vh;
    height: auto;
    grid-template-rows: auto auto auto;
  }

  .screen-header,
  .screen-grid,
  .bottom-strip {
    grid-template-columns: 1fr;
  }

  .screen-clock,
  .screen-logo,
  .screen-title {
    text-align: center;
  }

  .bottom-strip {
    display: grid;
  }
}
