* { box-sizing: border-box; }

:root {
  --bg: #08111f;
  --bg-2: #101a2d;
  --ink: #f8fafc;
  --muted: #9fb0c7;
  --line: rgba(255, 255, 255, .12);
  --panel: rgba(14, 25, 44, .82);
  --panel-strong: rgba(18, 31, 53, .94);
  --gold: #f7c948;
  --gold-2: #fff1a8;
  --silver: #d7e1ef;
  --bronze: #d38a4c;
  --cyan: #35d4ff;
  --green: #4ade80;
  --red: #ff6b63;
}

html, body { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(115deg, rgba(247, 201, 72, .14) 0%, transparent 28%),
    linear-gradient(245deg, rgba(53, 212, 255, .12) 0%, transparent 34%),
    linear-gradient(180deg, #101a2d 0%, #08111f 58%, #050914 100%);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.8), rgba(0,0,0,.08));
}

.screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 28px;
  display: grid;
  grid-template-rows: auto minmax(360px, 46vh) 1fr;
  gap: 22px;
}

.ambient-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(110deg, transparent 0 34%, rgba(247,201,72,.11) 35%, transparent 50%),
    linear-gradient(250deg, transparent 0 45%, rgba(53,212,255,.1) 46%, transparent 62%);
  opacity: .9;
}

.top-shell {
  min-height: 124px;
  padding: 26px 32px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(247,201,72,.18), transparent 35%),
    linear-gradient(120deg, rgba(21,34,58,.96), rgba(11,21,39,.86));
  box-shadow: 0 24px 80px rgba(0,0,0,.36), inset 0 1px 0 rgba(255,255,255,.16);
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
}

.eyebrow {
  color: var(--gold);
  font-size: 15px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .12em;
}

h1 {
  margin: 10px 0 0;
  font-size: clamp(42px, 4.2vw, 78px);
  line-height: .95;
  letter-spacing: 0;
  text-shadow: 0 6px 28px rgba(0,0,0,.38);
}

.top-meta { display: flex; align-items: center; gap: 14px; }

.status, .clock {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.08);
  color: #dbeafe;
  font-size: 17px;
  font-weight: 900;
}

.clock {
  min-width: 180px;
  justify-content: center;
  color: #1a1300;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  border-color: rgba(255,255,255,.4);
  box-shadow: 0 10px 32px rgba(247,201,72,.22);
}

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(340px, .72fr);
  gap: 22px;
  min-height: 0;
}

.podium-shell,
.rank-shell,
.call-card,
.event-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.1);
  backdrop-filter: blur(18px);
}

.podium-shell {
  position: relative;
  padding: 24px 28px 30px;
  overflow: hidden;
}

.podium-shell::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 18px;
  height: 28%;
  background: linear-gradient(180deg, rgba(247,201,72,.12), rgba(247,201,72,0));
  transform: perspective(800px) rotateX(62deg);
  transform-origin: bottom;
  border-radius: 50%;
  pointer-events: none;
}

.section-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .14em;
}

.section-head strong {
  color: #f8fafc;
  font-size: 27px;
  line-height: 1;
  font-weight: 950;
}

.podium {
  position: relative;
  z-index: 1;
  min-height: 315px;
  display: grid;
  grid-template-columns: 1.2fr .95fr .9fr;
  gap: 18px;
  align-items: end;
}

.podium-item {
  position: relative;
  min-height: 230px;
  padding: 24px 24px 86px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.2);
}

.podium-item::after {
  content: "";
  position: absolute;
  inset: auto -20px 0;
  height: 78px;
  background: rgba(0,0,0,.2);
  border-top: 1px solid rgba(255,255,255,.2);
}

.podium-item.first {
  min-height: 300px;
  border-color: rgba(255,241,168,.64);
  background:
    linear-gradient(145deg, rgba(255,241,168,.92), rgba(247,201,72,.64) 42%, rgba(74,48,7,.96) 100%);
  color: #fff9d6;
}

.podium-item.second {
  min-height: 252px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.88), rgba(172,190,214,.58) 44%, rgba(42,55,78,.94) 100%);
  color: #eef5ff;
}

.podium-item.third {
  min-height: 236px;
  background:
    linear-gradient(145deg, rgba(255,210,158,.86), rgba(211,138,76,.54) 42%, rgba(70,38,24,.96) 100%);
  color: #fff1e7;
}

.podium-item.highlight {
  animation: winnerPulse 1.1s ease-in-out infinite alternate;
}

.medal {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #191308;
  background: linear-gradient(180deg, #fff7c2, var(--gold));
  box-shadow: 0 10px 28px rgba(0,0,0,.25), inset 0 2px 0 rgba(255,255,255,.8);
  font-size: 30px;
  font-weight: 950;
}

.second .medal { background: linear-gradient(180deg, #ffffff, var(--silver)); }
.third .medal { background: linear-gradient(180deg, #ffe0bd, var(--bronze)); }

.rank-label {
  width: fit-content;
  margin-top: 18px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #111827;
  background: rgba(255,255,255,.9);
  box-shadow: 0 8px 22px rgba(0,0,0,.2);
  font-size: 17px;
  font-weight: 950;
}

.first .rank-label { background: #fff4b8; color: #3b2a00; }
.second .rank-label { background: #f8fbff; color: #243244; }
.third .rank-label { background: #ffe3c5; color: #4b2411; }

.team-name {
  margin-top: 10px;
  font-size: clamp(30px, 2.8vw, 54px);
  line-height: 1.02;
  font-weight: 950;
  overflow-wrap: anywhere;
  text-shadow: 0 6px 20px rgba(0,0,0,.32);
}

.team-score {
  margin-top: 18px;
  color: #fff;
  font-size: clamp(66px, 7vw, 132px);
  line-height: .82;
  font-variant-numeric: tabular-nums;
  font-weight: 950;
  text-shadow: 0 10px 28px rgba(0,0,0,.28);
}

.podium-base {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  min-height: 64px;
  padding: 18px 24px;
  color: #ffffff;
  background: rgba(5, 9, 20, .58);
  font-size: 28px;
  font-weight: 950;
  text-align: center;
  letter-spacing: .08em;
  text-shadow: 0 3px 12px rgba(0,0,0,.55);
}

.side-rail {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 22px;
  min-height: 0;
}

.call-card,
.event-card {
  padding: 26px;
  min-height: 0;
}

.call-card {
  background:
    linear-gradient(145deg, rgba(91,64,174,.92), rgba(26,35,73,.94)),
    var(--panel-strong);
}

.label {
  color: rgba(255,255,255,.68);
  font-size: 16px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.call-name {
  margin-top: 14px;
  color: #fff;
  font-size: clamp(46px, 4.8vw, 82px);
  line-height: .92;
  font-weight: 950;
  overflow-wrap: anywhere;
  text-shadow: 0 10px 28px rgba(0,0,0,.28);
}

.previous {
  margin-top: 20px;
  color: rgba(255,255,255,.74);
  font-size: 22px;
  font-weight: 900;
}

.event-card {
  background:
    linear-gradient(135deg, rgba(255,107,99,.14), transparent 46%),
    rgba(18, 31, 53, .92);
}

.event-text {
  margin-top: 18px;
  color: #fff;
  font-size: clamp(30px, 3vw, 54px);
  line-height: 1.06;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.rank-shell {
  min-height: 0;
  padding: 22px 28px;
  overflow: hidden;
}

.rank-list {
  height: calc(100% - 50px);
  overflow: auto;
  padding-right: 4px;
}

.rank-row {
  min-height: 70px;
  padding: 10px 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: grid;
  grid-template-columns: 86px 1fr minmax(120px, 180px);
  align-items: center;
  gap: 16px;
}

.rank-row:first-child { border-top: 0; }

.rank-row.highlight {
  border-radius: 14px;
  background: rgba(247,201,72,.16);
  box-shadow: inset 0 0 0 1px rgba(247,201,72,.28);
}

.rank-no {
  color: var(--gold);
  font-size: 26px;
  font-weight: 950;
}

.rank-list .team-name {
  margin: 0;
  color: #e5edf8;
  font-size: 30px;
  text-shadow: none;
}

.rank-score {
  color: var(--gold);
  text-align: right;
  font-size: 42px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-weight: 950;
}

.empty {
  padding: 28px;
  color: var(--muted);
  font-size: 28px;
  font-weight: 900;
}

@keyframes winnerPulse {
  from { box-shadow: 0 24px 48px rgba(0,0,0,.28), 0 0 0 rgba(247,201,72,0); }
  to { box-shadow: 0 24px 48px rgba(0,0,0,.28), 0 0 44px rgba(247,201,72,.5); }
}

@media (max-width: 980px) {
  body {
    min-height: 100vh;
    overflow: auto;
  }

  .screen {
    min-height: 100vh;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .top-shell {
    min-height: auto;
    padding: 18px;
    border-radius: 18px;
    display: block;
  }

  .eyebrow {
    font-size: 11px;
    letter-spacing: .08em;
  }

  h1 {
    margin-top: 8px;
    font-size: 30px;
    line-height: 1.08;
  }

  .top-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 14px;
  }

  .status,
  .clock {
    width: 100%;
    min-height: 38px;
    padding: 0 12px;
    justify-content: center;
    font-size: 13px;
  }

  .clock { min-width: 0; }

  .stage {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .side-rail {
    order: -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .call-card,
  .event-card {
    padding: 16px;
    border-radius: 16px;
    min-height: 126px;
  }

  .label {
    font-size: 11px;
    letter-spacing: .06em;
  }

  .call-name {
    margin-top: 10px;
    font-size: 30px;
    line-height: 1.02;
  }

  .previous {
    margin-top: 10px;
    font-size: 13px;
  }

  .event-text {
    margin-top: 12px;
    font-size: 24px;
    line-height: 1.15;
  }

  .podium-shell,
  .rank-shell {
    padding: 16px;
    border-radius: 18px;
  }

  .section-head {
    margin-bottom: 12px;
  }

  .section-head span {
    font-size: 11px;
    letter-spacing: .1em;
  }

  .section-head strong {
    font-size: 20px;
  }

  .podium {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    align-items: stretch;
  }

  .podium-item,
  .podium-item.first,
  .podium-item.second,
  .podium-item.third {
    width: 100%;
    min-height: 150px;
    padding: 18px 18px 56px;
    border-radius: 18px;
  }

  .podium-item.first {
    min-height: 178px;
  }

  .medal {
    width: 46px;
    height: 46px;
    font-size: 22px;
  }

  .rank-label {
    margin-top: 12px;
    padding: 6px 10px;
    font-size: 13px;
  }

  .team-name {
    margin-top: 10px;
    font-size: 28px;
    line-height: 1.08;
  }

  .team-score {
    margin-top: 10px;
    font-size: 56px;
  }

  .podium-base {
    min-height: 46px;
    padding: 12px 18px;
    font-size: 20px;
  }

  .rank-list {
    height: auto;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .rank-row {
    min-height: 58px;
    padding: 10px 4px;
    grid-template-columns: 54px 1fr 72px;
    gap: 10px;
  }

  .rank-no {
    font-size: 20px;
  }

  .rank-list .team-name {
    font-size: 22px;
  }

  .rank-score {
    font-size: 30px;
  }

  .empty {
    padding: 18px 0;
    font-size: 18px;
  }
}

@media (max-width: 520px) {
  .screen {
    padding: 12px;
    gap: 12px;
  }

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

  h1 {
    font-size: 28px;
  }

  .podium-shell,
  .rank-shell,
  .call-card,
  .event-card,
  .top-shell {
    border-radius: 16px;
  }

  .podium-item,
  .podium-item.first,
  .podium-item.second,
  .podium-item.third {
    min-height: 138px;
  }
}

@media (min-width: 521px) and (max-width: 760px) {
  .screen {
    padding: 16px;
  }

  .top-shell,
  .podium-shell,
  .rank-shell,
  .call-card,
  .event-card {
    border-radius: 18px;
  }

  .podium {
    gap: 14px;
  }

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

  .podium-item,
  .podium-item.first,
  .podium-item.second,
  .podium-item.third {
    min-height: 168px;
    padding: 20px 20px 58px;
  }

  .podium-item.first {
    min-height: 190px;
  }

  .team-name {
    font-size: 32px;
  }

  .team-score {
    font-size: 64px;
  }
}
