:root {
  color-scheme: dark;
  --bg: #080b0a;
  --surface: rgba(17, 22, 20, 0.92);
  --surface-strong: #121816;
  --line: rgba(220, 194, 132, 0.18);
  --line-soft: rgba(255, 255, 255, 0.075);
  --gold: #d9b66f;
  --gold-bright: #f4d995;
  --gold-deep: #7d5b27;
  --ivory: #f4efe3;
  --muted: #918f86;
  --good: #6fc9d6;
  --evil: #db7168;
  --silver: #b9c1c3;
  --bronze: #b97851;
  --radius: 18px;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 960px;
  height: 100%;
  margin: 0;
  background: var(--bg);
  touch-action: pan-x pan-y;
}

body {
  overflow: hidden;
  color: var(--ivory);
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

.screen {
  position: relative;
  isolation: isolate;
  width: 100vw;
  height: 100vh;
  min-height: 680px;
  padding: clamp(18px, 2vw, 38px) clamp(24px, 2.6vw, 52px) clamp(14px, 1.5vw, 26px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: clamp(12px, 1.25vw, 22px);
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 12%, rgba(165, 123, 54, 0.15), transparent 29%),
    radial-gradient(circle at 86% 80%, rgba(37, 93, 86, 0.13), transparent 32%),
    linear-gradient(145deg, #0d1210 0%, #070908 48%, #0b100e 100%);
}

.screen::before,
.screen::after {
  position: absolute;
  z-index: -1;
  content: "";
  pointer-events: none;
}

.screen::before {
  inset: 0;
  opacity: 0.24;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

.screen::after {
  width: 420px;
  height: 420px;
  right: -250px;
  top: -250px;
  border: 1px solid rgba(217, 182, 111, 0.25);
  border-radius: 50%;
  box-shadow: 0 0 0 55px rgba(217, 182, 111, 0.025), 0 0 0 110px rgba(217, 182, 111, 0.018);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(460px, 1.55fr) minmax(230px, 1fr);
  align-items: center;
  gap: 24px;
}

.brand {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.brand img {
  width: clamp(54px, 4vw, 72px);
  height: clamp(54px, 4vw, 72px);
  object-fit: cover;
  border: 1px solid rgba(217, 182, 111, 0.35);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.brand-copy {
  display: grid;
  gap: 3px;
}

.brand-copy strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(21px, 1.55vw, 29px);
  letter-spacing: 0.07em;
}

.brand-copy small {
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.22em;
}

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

.eyebrow,
.panel-heading p {
  margin: 0;
  color: var(--gold);
  font-size: clamp(9px, 0.68vw, 13px);
  font-weight: 900;
  letter-spacing: 0.28em;
}

.eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
}

.eyebrow span {
  width: clamp(22px, 2vw, 42px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}

.eyebrow span:last-child {
  transform: rotate(180deg);
}

.title-lockup h1 {
  margin: 5px 0 2px;
  font-size: clamp(27px, 2.45vw, 47px);
  font-weight: 950;
  letter-spacing: 0.09em;
  line-height: 1.1;
}

.title-lockup > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: clamp(10px, 0.78vw, 14px);
  letter-spacing: 0.08em;
}

.screen-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.icon-button {
  width: clamp(54px, 3.5vw, 66px);
  height: clamp(54px, 3.5vw, 66px);
  padding: 6px;
  display: grid;
  place-items: center;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ivory);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: rgba(244, 217, 149, 0.62);
  background: rgba(217, 182, 111, 0.09);
  outline: none;
  transform: translateY(-2px);
}

.icon-button span {
  font-size: clamp(20px, 1.45vw, 28px);
  line-height: 1;
}

.icon-button small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.icon-button.is-spinning span {
  animation: spin 700ms linear infinite;
}

.control-deck {
  min-height: clamp(58px, 4.6vw, 78px);
  padding: 8px 12px;
  display: grid;
  grid-template-columns: minmax(240px, auto) minmax(0, 1fr) minmax(175px, auto);
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(217, 182, 111, 0.07), rgba(255, 255, 255, 0.025) 35%, rgba(255, 255, 255, 0.015));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
}

.season-switcher {
  display: grid;
  grid-template-columns: 38px minmax(150px, auto) 38px;
  align-items: center;
  gap: 9px;
}

.season-switcher button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  cursor: pointer;
}

.season-switcher button:hover:not(:disabled),
.season-switcher button:focus-visible:not(:disabled) {
  border-color: var(--gold);
  outline: none;
}

.season-switcher button:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.season-switcher div {
  min-width: 0;
  text-align: center;
}

.season-switcher span,
.live-status small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.season-switcher strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--gold-bright);
  font-size: clamp(14px, 1.05vw, 19px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-tabs {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.board-tabs::-webkit-scrollbar {
  display: none;
}

.board-tab {
  flex: none;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #aaa89f;
  background: transparent;
  font-size: clamp(10px, 0.72vw, 13px);
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.board-tab:hover,
.board-tab:focus-visible {
  color: var(--ivory);
  border-color: var(--line);
  outline: none;
}

.board-tab[aria-pressed="true"] {
  color: #231b0e;
  border-color: var(--gold-bright);
  background: linear-gradient(135deg, var(--gold-bright), #ad8240);
  box-shadow: 0 7px 20px rgba(164, 119, 49, 0.2);
}

.board-tab.good:not([aria-pressed="true"]) {
  color: var(--good);
}

.board-tab.evil:not([aria-pressed="true"]) {
  color: var(--evil);
}

.live-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  text-align: right;
}

.live-status i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #778079;
  box-shadow: 0 0 0 5px rgba(119, 128, 121, 0.09);
}

.live-status i.online {
  background: #68c693;
  box-shadow: 0 0 0 5px rgba(104, 198, 147, 0.09), 0 0 18px rgba(104, 198, 147, 0.45);
}

.live-status i.error {
  background: var(--evil);
}

.live-status strong {
  display: block;
  font-size: 12px;
}

.live-status small {
  margin-top: 3px;
  letter-spacing: 0.04em;
}

.leaderboard-shell {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(560px, 1.08fr) minmax(620px, 0.92fr);
  gap: clamp(12px, 1.25vw, 22px);
}

.panel {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 6px 22px 6px 22px;
  background: linear-gradient(150deg, rgba(22, 29, 26, 0.96), rgba(10, 14, 12, 0.96));
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.34), inset 0 1px rgba(255, 255, 255, 0.035);
  overflow: hidden;
}

.panel-heading {
  min-height: clamp(62px, 4.4vw, 82px);
  padding: clamp(13px, 1vw, 19px) clamp(18px, 1.35vw, 27px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line-soft);
}

.panel-heading h2 {
  margin: 4px 0 0;
  font-size: clamp(18px, 1.45vw, 27px);
  line-height: 1.1;
}

.metric-pill {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--gold-bright);
  background: rgba(217, 182, 111, 0.07);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.podium-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-color: rgba(225, 192, 111, 0.27);
}

.podium {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 32%, rgba(255, 220, 139, 0.15), transparent 28%),
    linear-gradient(112deg, rgba(20, 150, 181, 0.22) 0%, rgba(8, 18, 22, 0.08) 43%, transparent 47%),
    linear-gradient(248deg, rgba(207, 50, 58, 0.24) 0%, rgba(25, 10, 12, 0.08) 43%, transparent 47%),
    linear-gradient(180deg, #101716 0%, #080b0a 100%);
}

.podium::before,
.podium::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}

.podium::before {
  z-index: 1;
  opacity: 0.24;
  background: repeating-linear-gradient(0deg, transparent 0 5px, rgba(255, 255, 255, 0.045) 6px);
  mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);
}

.podium::after {
  z-index: 1;
  left: 49.25%;
  width: 1.5%;
  background: linear-gradient(180deg, transparent, rgba(244, 217, 149, 0.9) 25%, #fff1bf 53%, rgba(244, 217, 149, 0.25) 82%, transparent);
  filter: blur(1px) drop-shadow(0 0 12px rgba(244, 217, 149, 0.82));
  clip-path: polygon(44% 0, 100% 0, 62% 16%, 85% 30%, 40% 46%, 70% 61%, 24% 78%, 56% 100%, 0 100%, 29% 79%, 3% 61%, 48% 45%, 20% 29%, 61% 15%);
  animation: energy-pulse 2.6s ease-in-out infinite;
}

.podium-arena {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
}

.arena-camp {
  position: absolute;
  top: clamp(15px, 1.1vw, 22px);
  padding: 5px 9px;
  border: 1px solid currentColor;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(9px, 0.62vw, 12px);
  letter-spacing: 0.18em;
  opacity: 0.68;
}

.arena-good {
  left: clamp(15px, 1.1vw, 22px);
  color: #5fe3ff;
  border-right: 0;
  background: linear-gradient(90deg, rgba(27, 173, 207, 0.15), transparent);
}

.arena-evil {
  right: clamp(15px, 1.1vw, 22px);
  color: #ff6f70;
  border-left: 0;
  background: linear-gradient(270deg, rgba(218, 49, 57, 0.17), transparent);
}

.arena-ring {
  position: absolute;
  top: 7%;
  left: 50%;
  width: clamp(210px, 28vw, 460px);
  aspect-ratio: 1;
  border: 1px solid rgba(244, 217, 149, 0.26);
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow:
    0 0 0 clamp(20px, 2vw, 40px) rgba(244, 217, 149, 0.018),
    0 0 0 clamp(42px, 4vw, 80px) rgba(244, 217, 149, 0.012),
    inset 0 0 45px rgba(244, 217, 149, 0.055);
}

.arena-ring::before,
.arena-ring::after {
  position: absolute;
  content: "";
  background: rgba(244, 217, 149, 0.27);
}

.arena-ring::before {
  top: 50%;
  left: -24%;
  width: 148%;
  height: 1px;
}

.arena-ring::after {
  top: -24%;
  left: 50%;
  width: 1px;
  height: 148%;
}

.arena-collision {
  position: absolute;
  left: 50%;
  bottom: -12%;
  width: 76%;
  height: 34%;
  border: 1px solid rgba(244, 217, 149, 0.16);
  border-radius: 50% 50% 0 0;
  transform: translateX(-50%) perspective(340px) rotateX(67deg);
  box-shadow: 0 0 80px rgba(217, 182, 111, 0.14);
}

.podium-card {
  position: absolute;
  z-index: 3;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
}

.podium-card.rank-1 {
  z-index: 5;
  top: 3%;
  bottom: 0;
  left: 50%;
  width: 38%;
  transform: translateX(-50%);
}

.podium-card.rank-2 {
  bottom: 0;
  left: 1.8%;
  width: 32%;
  height: 73%;
}

.podium-card.rank-3 {
  right: 1.8%;
  bottom: 0;
  width: 32%;
  height: 69%;
}

.podium-card::before {
  position: absolute;
  z-index: -1;
  top: 15%;
  bottom: 0;
  left: 50%;
  width: 120%;
  content: "";
  transform: translateX(-50%);
  clip-path: polygon(42% 0, 58% 0, 100% 100%, 0 100%);
  opacity: 0.24;
}

.rank-1::before {
  top: 5%;
  width: 150%;
  background: linear-gradient(180deg, rgba(255, 229, 160, 0.68), transparent 75%);
  filter: drop-shadow(0 0 22px rgba(244, 217, 149, 0.32));
}

.rank-2::before {
  background: linear-gradient(180deg, rgba(79, 222, 255, 0.62), transparent 78%);
}

.rank-3::before {
  background: linear-gradient(180deg, rgba(255, 81, 85, 0.64), transparent 78%);
}

.podium-rank-ghost {
  position: absolute;
  z-index: -1;
  top: -7%;
  left: 50%;
  color: rgba(255, 255, 255, 0.075);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(90px, 9.6vw, 184px);
  font-style: italic;
  letter-spacing: -0.06em;
  line-height: 1;
  transform: translateX(-52%);
  text-shadow: 0 0 40px rgba(255, 255, 255, 0.06);
}

.rank-1 .podium-rank-ghost {
  top: 3%;
  color: rgba(244, 217, 149, 0.13);
  font-size: clamp(130px, 13vw, 250px);
  -webkit-text-stroke: 1px rgba(244, 217, 149, 0.18);
}

.champion-crown {
  position: relative;
  z-index: 2;
  margin-bottom: -3px;
  color: var(--gold-bright);
  font-size: clamp(28px, 2.4vw, 46px);
  line-height: 1;
  filter: drop-shadow(0 0 11px rgba(244, 217, 149, 0.65));
  animation: crown-float 2.8s ease-in-out infinite;
}

.podium-place {
  position: relative;
  z-index: 2;
  display: inline-flex;
  margin-bottom: clamp(7px, 0.7vw, 13px);
  padding: 4px 12px;
  color: #d4d8d7;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(4, 8, 7, 0.72);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(8px, 0.58vw, 11px);
  font-weight: 900;
  letter-spacing: 0.18em;
  clip-path: polygon(7px 0, 100% 0, calc(100% - 7px) 100%, 0 100%);
}

.rank-1 .podium-place {
  color: #20170a;
  border-color: transparent;
  background: linear-gradient(90deg, #98702f, var(--gold-bright), #98702f);
  box-shadow: 0 0 22px rgba(217, 182, 111, 0.22);
}

.podium-avatar-frame {
  position: relative;
  z-index: 3;
  width: clamp(78px, 5.6vw, 108px);
  height: clamp(78px, 5.6vw, 108px);
  padding: 4px;
  display: grid;
  place-items: center;
  --avatar-frame: linear-gradient(145deg, #dce5e7, #667277 46%, #d9e2e3);
  filter: drop-shadow(0 13px 20px rgba(0, 0, 0, 0.45));
}

.podium-avatar-frame::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  content: "";
  background: var(--avatar-frame);
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
}

.podium-avatar {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #171b19;
  background: linear-gradient(145deg, #d9dbd7, #787d7a);
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
  overflow: hidden;
}

.rank-1 .podium-avatar-frame {
  width: clamp(118px, 8.4vw, 162px);
  height: clamp(118px, 8.4vw, 162px);
  padding: 6px;
  --avatar-frame: linear-gradient(145deg, #fff0b4, #8d6325 40%, #f6d57c 70%, #6f4718);
  filter: drop-shadow(0 0 25px rgba(244, 217, 149, 0.28)) drop-shadow(0 18px 24px rgba(0, 0, 0, 0.46));
}

.rank-2 .podium-avatar-frame {
  --avatar-frame: linear-gradient(145deg, #b8f3ff, #277b91 50%, #d9fbff);
  filter: drop-shadow(0 0 18px rgba(77, 216, 248, 0.2)) drop-shadow(0 13px 20px rgba(0, 0, 0, 0.45));
}

.rank-3 .podium-avatar-frame {
  --avatar-frame: linear-gradient(145deg, #ffb19f, #8d2f34 50%, #f68d79);
  filter: drop-shadow(0 0 18px rgba(255, 83, 86, 0.2)) drop-shadow(0 13px 20px rgba(0, 0, 0, 0.45));
}

.podium-avatar img,
.rank-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-fallback {
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(23px, 2.1vw, 40px);
  font-weight: 900;
}

.podium-medal {
  position: absolute;
  z-index: 4;
  right: -8px;
  bottom: -5px;
  width: clamp(25px, 1.75vw, 34px);
  height: clamp(25px, 1.75vw, 34px);
  display: grid;
  place-items: center;
  border: 2px solid #f1eee5;
  border-radius: 2px 9px 2px 9px;
  color: #181611;
  background: var(--silver);
  font-family: Georgia, serif;
  font-size: clamp(12px, 0.82vw, 16px);
  font-weight: 900;
}

.rank-1 .podium-medal {
  width: clamp(31px, 2.15vw, 42px);
  height: clamp(31px, 2.15vw, 42px);
  background: var(--gold-bright);
  box-shadow: 0 0 18px rgba(244, 217, 149, 0.58);
}

.rank-3 .podium-medal {
  color: white;
  background: var(--bronze);
}

.podium-name {
  position: relative;
  z-index: 3;
  width: 100%;
  margin: clamp(9px, 0.8vw, 15px) 0 0;
  overflow: hidden;
  font-size: clamp(14px, 1.08vw, 21px);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
}

.rank-1 .podium-name {
  color: var(--gold-bright);
  font-size: clamp(21px, 1.65vw, 32px);
  letter-spacing: 0.07em;
  text-shadow: 0 0 16px rgba(217, 182, 111, 0.24), 0 5px 15px rgba(0, 0, 0, 0.95);
}

.podium-record {
  position: relative;
  z-index: 3;
  margin: 5px 0 clamp(9px, 0.85vw, 16px);
  color: rgba(240, 239, 232, 0.64);
  font-size: clamp(9px, 0.64vw, 12px);
  white-space: nowrap;
}

.podium-base {
  position: relative;
  z-index: 2;
  width: 100%;
  height: clamp(82px, 7vw, 134px);
  padding: clamp(13px, 1.1vw, 21px) 8px 6px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.16), transparent 14% 86%, rgba(255, 255, 255, 0.12)),
    linear-gradient(180deg, #4a5e62, #172124);
  clip-path: polygon(10% 0, 90% 0, 100% 17%, 94% 100%, 6% 100%, 0 17%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.24);
}

.rank-1 .podium-base {
  height: clamp(115px, 10vw, 192px);
  background:
    linear-gradient(90deg, rgba(255, 245, 201, 0.25), transparent 14% 86%, rgba(255, 245, 201, 0.2)),
    linear-gradient(180deg, #b98a3a 0%, #68451b 42%, #211507 100%);
  filter: drop-shadow(0 -7px 20px rgba(217, 182, 111, 0.14));
}

.rank-3 .podium-base {
  height: clamp(70px, 6vw, 114px);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.13), transparent 14% 86%, rgba(255, 255, 255, 0.1)),
    linear-gradient(180deg, #803b40, #2b1114);
}

.rank-2 .podium-base {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.16), transparent 14% 86%, rgba(255, 255, 255, 0.12)),
    linear-gradient(180deg, #316f7e, #10282d);
}

.podium-value {
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(30px, 2.7vw, 52px);
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.02em;
  line-height: 1;
}

.rank-1 .podium-value {
  color: #fff1bd;
  font-size: clamp(48px, 4.2vw, 80px);
  text-shadow: 0 0 18px rgba(255, 224, 144, 0.26);
}

.podium-label {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.65);
  font-size: clamp(8px, 0.55vw, 10px);
  font-weight: 800;
  letter-spacing: 0.18em;
}

.podium-empty,
.loading-card {
  position: relative;
  z-index: 4;
  height: 100%;
  display: grid;
  place-content: center;
  color: var(--muted);
  text-align: center;
}

.podium-footer {
  min-height: clamp(64px, 4.7vw, 86px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(244, 217, 149, 0.18);
  background:
    linear-gradient(90deg, rgba(31, 156, 188, 0.08), transparent 42% 58%, rgba(204, 53, 59, 0.08)),
    rgba(0, 0, 0, 0.31);
}

.podium-footer div {
  position: relative;
  display: grid;
  place-content: center;
  gap: 2px;
  text-align: center;
}

.podium-footer div + div {
  border-left: 1px solid var(--line-soft);
}

.podium-footer div::before {
  position: absolute;
  top: 0;
  left: 18%;
  width: 64%;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, transparent, #55d5f0, transparent);
}

.podium-footer div:nth-child(2)::before {
  background: linear-gradient(90deg, transparent, var(--gold-bright), transparent);
}

.podium-footer div:nth-child(3)::before {
  background: linear-gradient(90deg, transparent, #f15a61, transparent);
}

.podium-footer span {
  color: var(--muted);
  font-size: clamp(9px, 0.62vw, 12px);
}

.podium-footer strong {
  color: var(--gold-bright);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(22px, 1.7vw, 33px);
  font-style: italic;
}

.ranking-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.ranking-heading {
  align-items: center;
}

.ranking-rule {
  max-width: 55%;
  color: var(--muted) !important;
  font-size: clamp(9px, 0.64vw, 12px) !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em !important;
  line-height: 1.55;
  text-align: right;
}

.ranking-table {
  min-height: 0;
  padding: 0 clamp(13px, 1vw, 20px) clamp(10px, 0.8vw, 15px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.ranking-table-head,
.rank-row {
  display: grid;
  grid-template-columns: clamp(46px, 3.2vw, 64px) minmax(170px, 1fr) repeat(4, minmax(57px, 0.48fr)) minmax(72px, 0.62fr);
  align-items: center;
  column-gap: clamp(6px, 0.55vw, 11px);
}

.ranking-table-head {
  min-height: clamp(34px, 2.6vw, 48px);
  color: #777d79;
  border-bottom: 1px solid var(--line-soft);
  font-size: clamp(8px, 0.57vw, 11px);
  font-weight: 900;
  letter-spacing: 0.1em;
  text-align: center;
}

.ranking-table-head span:nth-child(2) {
  text-align: left;
}

.ranking-table-body {
  min-height: 0;
  display: grid;
  grid-auto-rows: minmax(30px, 1fr);
  overflow: hidden;
}

.rank-row {
  position: relative;
  min-height: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  transition: background 150ms ease;
}

.rank-row:last-child {
  border-bottom: 0;
}

.rank-row:hover {
  background: rgba(217, 182, 111, 0.04);
}

.rank-number {
  color: #777c78;
  font-family: Georgia, serif;
  font-size: clamp(15px, 1.12vw, 21px);
  font-weight: 900;
  text-align: center;
}

.rank-player {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: clamp(7px, 0.65vw, 12px);
}

.rank-avatar {
  flex: none;
  width: clamp(25px, 2vw, 38px);
  height: clamp(25px, 2vw, 38px);
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: #252a27;
  background: #a7aba7;
  overflow: hidden;
}

.rank-avatar .avatar-fallback {
  font-size: clamp(10px, 0.75vw, 14px);
}

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

.rank-player-copy strong {
  display: block;
  overflow: hidden;
  font-size: clamp(11px, 0.78vw, 15px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-player-copy small {
  display: block;
  margin-top: 2px;
  color: #767c78;
  font-size: clamp(7px, 0.5vw, 9px);
  font-weight: 800;
  letter-spacing: 0.07em;
}

.rank-player-copy small.qualified {
  color: var(--gold);
}

.rank-stat {
  color: #b8bbb6;
  font-family: Georgia, "Microsoft YaHei UI", serif;
  font-size: clamp(10px, 0.77vw, 15px);
  font-weight: 800;
  text-align: center;
}

.rank-stat.primary {
  color: var(--gold-bright);
  font-size: clamp(14px, 1vw, 19px);
}

.rank-status {
  display: inline-flex;
  justify-self: center;
  padding: 3px 7px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: #7e837f;
  font-family: inherit;
  font-size: clamp(7px, 0.48vw, 9px);
  white-space: nowrap;
}

.rank-status.qualified {
  color: var(--gold-bright);
  border-color: rgba(217, 182, 111, 0.3);
  background: rgba(217, 182, 111, 0.07);
}

.empty-board {
  min-height: 100%;
  display: grid;
  place-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.empty-board strong {
  color: var(--ivory);
  font-size: clamp(17px, 1.3vw, 24px);
}

.loading-row {
  display: grid;
  grid-template-columns: 8% 52% 26%;
  align-items: center;
  gap: 7%;
  border-bottom: 1px solid var(--line-soft);
}

.loading-row span {
  height: 8px;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.035));
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
}

.screen-footer {
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #666b67;
  font-size: clamp(8px, 0.58vw, 11px);
  letter-spacing: 0.08em;
}

.screen-footer p {
  margin: 0;
}

.footer-mark {
  margin-right: 7px;
  color: var(--gold);
  font-family: Georgia, serif;
  font-weight: 900;
}

kbd {
  padding: 2px 5px;
  border: 1px solid #3a403c;
  border-radius: 4px;
  color: #aaa;
  background: #151a17;
  font: inherit;
}

.message-layer {
  position: absolute;
  z-index: 20;
  inset: 0;
  padding: 30px;
  place-items: center;
  background: rgba(4, 6, 5, 0.82);
  backdrop-filter: blur(10px);
}

.message-layer:not([hidden]) {
  display: grid;
}

.message-card {
  width: min(480px, 90vw);
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #121714;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
  text-align: center;
}

.message-icon {
  display: block;
  color: var(--gold);
  font-size: 46px;
}

.message-card > p {
  color: var(--muted);
  line-height: 1.7;
}

.message-card > p:first-of-type {
  margin-top: 16px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.2em;
}

.message-card h2 {
  margin: 7px 0 0;
}

.message-card button {
  margin-top: 14px;
  padding: 11px 24px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: #21190c;
  background: var(--gold-bright);
  font-weight: 900;
  cursor: pointer;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes energy-pulse {
  0%, 100% {
    opacity: 0.58;
    filter: blur(1px) drop-shadow(0 0 10px rgba(244, 217, 149, 0.58));
  }
  50% {
    opacity: 1;
    filter: blur(0) drop-shadow(0 0 20px rgba(255, 226, 154, 0.92));
  }
}

@keyframes crown-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-5px) scale(1.05); }
}

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

  .screen {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .leaderboard-shell {
    grid-template-columns: 1fr;
  }

  .podium {
    min-height: 470px;
  }

  .ranking-table-body {
    grid-auto-rows: 50px;
    overflow: visible;
  }
}

@media (max-height: 760px) and (min-width: 1321px) {
  .screen {
    min-height: 640px;
    padding-top: 14px;
    padding-bottom: 10px;
    gap: 9px;
  }

  .podium-footer,
  .panel-heading {
    min-height: 56px;
  }

  .control-deck {
    min-height: 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
