:root {
  --navy: #111827;
  --ink: #1b1235;
  --muted: #5f6675;
  --purple: #5f249f;
  --purple-bright: #8f45ff;
  --lavender: #ede7ff;
  --pale: #f4f7fb;
  --panel: rgba(255, 255, 255, 0.76);
  --panel-strong: rgba(255, 255, 255, 0.9);
  --purple-panel: rgba(39, 18, 82, 0.92);
  --gold: #d59b20;
  --green: #088a4b;
  --red: #cc2f46;
  --shadow: 0 24px 70px rgba(43, 31, 84, 0.22);
  --soft-shadow: 0 14px 36px rgba(43, 31, 84, 0.14);
  --radius: 22px;
  color: var(--navy);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--pale);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(244, 247, 251, 0.97), rgba(244, 247, 251, 0.58) 42%, rgba(255, 255, 255, 0.2)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(95, 36, 159, 0.18)),
    url("aveva-city-background.png") center top / cover fixed no-repeat;
  color: var(--navy);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 18% 16%, rgba(143, 69, 255, 0.22), transparent 28%),
    radial-gradient(circle at 80% 82%, rgba(95, 36, 159, 0.22), transparent 34%);
}

a {
  color: inherit;
  text-decoration: none;
}

main,
.site-header {
  width: min(1180px, calc(100vw - 28px));
  margin: 0 auto;
}

.site-header {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  align-items: start;
  gap: 24px;
  padding: 22px 0 10px;
}

.brand img {
  width: 132px;
  height: auto;
  filter: drop-shadow(0 18px 22px rgba(47, 20, 96, 0.2));
}

.brand.small img {
  width: 96px;
}

.primary-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 28px;
  min-height: 52px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.primary-nav a {
  position: relative;
  padding: 10px 0;
}

.primary-nav a.active,
.primary-nav a:hover {
  color: var(--purple);
}

.primary-nav a.active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  height: 3px;
  border-radius: 999px;
  background: var(--purple-bright);
}

.live-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 52px;
  color: var(--muted);
  font-size: 12px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #7031be, #35116d);
  color: #fff;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(95, 36, 159, 0.28);
}

.live-pill i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #fff;
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.72);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(255, 255, 255, 0);
  }
}

.glass-panel {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

@supports (backdrop-filter: blur(18px)) {
  .glass-panel {
    background: rgba(255, 255, 255, 0.68);
    backdrop-filter: blur(18px);
  }
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: center;
  gap: 28px;
  min-height: 310px;
  padding: 30px 0 28px;
}

.hero-copy {
  padding-left: 176px;
}

.eyebrow,
.panel-label {
  margin: 0 0 8px;
  color: var(--purple);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1,
.page-title h1,
.team-card h1,
.pre-event h1 {
  margin: 0;
  color: #241442;
  font-size: clamp(44px, 6vw, 76px);
  line-height: 0.98;
  text-transform: uppercase;
}

.hero h2 {
  margin: 8px 0 16px;
  color: var(--purple-bright);
  font-size: clamp(22px, 3vw, 34px);
  text-transform: uppercase;
}

.hero p:not(.eyebrow),
.page-title p,
.team-card p {
  color: var(--navy);
  font-size: 18px;
  line-height: 1.55;
}

.event-status {
  min-height: 148px;
  padding: 24px;
}

.event-status strong {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 8px 0 14px;
  color: var(--navy);
  font-size: 24px;
  text-transform: uppercase;
}

.event-status span:not(.status-dot) {
  display: block;
  color: var(--navy);
  font-weight: 800;
}

.status-dot {
  width: 14px;
  height: 14px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: #2fc77f;
  box-shadow: 0 0 0 2px rgba(47, 199, 127, 0.24);
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 28px;
  align-items: start;
  padding-bottom: 42px;
}

.leaderboard-panel {
  overflow: hidden;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 26px 14px;
}

.panel-heading.compact {
  padding: 0 0 14px;
}

.panel-heading h2 {
  margin: 0;
  color: var(--purple);
  font-size: 24px;
  text-transform: uppercase;
}

.panel-heading a {
  color: var(--purple);
  font-size: 13px;
  font-weight: 900;
}

.leaderboard-list {
  padding: 0 18px 18px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 58px 44px minmax(0, 1fr) 150px 78px;
  align-items: center;
  gap: 18px;
  min-height: 74px;
  border: 1px solid rgba(95, 36, 159, 0.1);
  border-radius: 12px;
  margin-top: 10px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--soft-shadow);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.leaderboard-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(43, 31, 84, 0.18);
}

.leaderboard-row.first-place {
  border-color: rgba(213, 155, 32, 0.44);
  background: linear-gradient(90deg, rgba(255, 223, 137, 0.86), rgba(255, 255, 255, 0.82) 24%, rgba(255, 255, 255, 0.74));
}

.rank {
  color: var(--navy);
  font-size: 34px;
  font-weight: 950;
  text-align: center;
}

.team-mark,
.activity-icon,
.team-avatar {
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--purple-bright), var(--purple));
  color: #fff;
  font-weight: 950;
}

.team-mark,
.activity-icon {
  width: 36px;
  height: 36px;
}

.team-cell strong,
.activity-item strong {
  display: block;
  color: var(--navy);
  font-size: 15px;
  text-transform: uppercase;
}

.team-cell small,
.activity-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.points {
  color: var(--purple);
  font-size: 30px;
  font-weight: 950;
  text-align: right;
}

.points small {
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

.trend {
  font-size: 15px;
  font-weight: 950;
  text-align: right;
}

.positive {
  color: var(--green);
}

.negative {
  color: var(--red);
}

.neutral {
  color: var(--muted);
}

.side-stack {
  display: grid;
  gap: 20px;
}

.quick-links,
.recent-activity {
  padding: 22px;
  background: var(--purple-panel);
  color: #fff;
}

.quick-links .panel-label,
.recent-activity .panel-label {
  color: #fff;
}

.quick-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  padding: 13px 0;
  color: #fff;
  font-weight: 800;
}

.activity-list {
  display: grid;
  gap: 12px;
}

.activity-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.activity-item strong,
.activity-item small {
  color: #fff;
}

.activity-item b {
  white-space: nowrap;
}

.inner-page {
  background:
    linear-gradient(90deg, rgba(244, 247, 251, 0.97), rgba(244, 247, 251, 0.84)),
    url("aveva-city-background.png") center top / cover fixed no-repeat;
}

.page-title {
  padding: 42px 0 24px;
}

.page-title h1 {
  font-size: clamp(42px, 6vw, 64px);
}

.filters {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-bottom: 20px;
  padding: 14px;
}

.filters span {
  min-width: 160px;
  border: 1px solid rgba(95, 36, 159, 0.24);
  border-radius: 8px;
  padding: 10px 14px;
  background: #fff;
  color: var(--navy);
  font-weight: 800;
}

.event-log,
.score-history {
  margin-bottom: 44px;
  padding: 24px;
}

.event-log-heading,
.event-row {
  display: grid;
  grid-template-columns: 130px 190px minmax(180px, 1fr) 90px minmax(160px, 1fr);
  align-items: center;
  gap: 18px;
}

.event-log-heading,
.history-heading {
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.event-row,
.history-row {
  border-top: 1px solid rgba(95, 36, 159, 0.14);
  min-height: 58px;
  padding: 12px 0;
}

.event-row a,
.event-row strong,
.history-row strong {
  color: var(--navy);
}

.event-row p,
.history-row p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.event-row b,
.history-row b {
  font-weight: 950;
}

.back-link {
  display: inline-block;
  margin: 28px 0 18px;
  color: var(--purple);
  font-weight: 900;
}

.team-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
}

.team-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding: 34px;
}

.team-avatar {
  width: 92px;
  height: 92px;
  font-size: 42px;
}

.team-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
}

.team-card h1 {
  font-size: clamp(34px, 5vw, 52px);
}

.organisation {
  margin: 6px 0 18px;
  font-weight: 900;
}

.team-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.team-links a {
  border: 1px solid rgba(95, 36, 159, 0.2);
  border-radius: 999px;
  padding: 9px 13px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--purple);
  font-size: 13px;
  font-weight: 900;
}

.score-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.score-card {
  min-height: 138px;
  padding: 24px;
}

.score-card span {
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.score-card strong {
  display: block;
  margin-top: 18px;
  color: var(--purple);
  font-size: 36px;
}

.score-card small {
  font-size: 14px;
  text-transform: uppercase;
}

.team-media {
  height: 220px;
  margin: 28px 0;
  overflow: hidden;
}

.team-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-heading,
.history-row {
  display: grid;
  grid-template-columns: 140px minmax(180px, 1fr) 90px minmax(160px, 1fr);
  align-items: center;
  gap: 18px;
}

.pre-event-mode {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background:
    linear-gradient(90deg, rgba(244, 247, 251, 0.55), rgba(255, 255, 255, 0.22)),
    url("aveva-city-background.png") center / cover no-repeat;
}

.pre-event {
  width: min(720px, calc(100vw - 28px));
  text-align: center;
}

.pre-event-logo {
  width: 150px;
  filter: drop-shadow(0 18px 24px rgba(47, 20, 96, 0.24));
}

.pre-event p {
  color: var(--navy);
  font-size: 18px;
}

.countdown-placeholder {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 24px;
}

.countdown-placeholder span {
  border-radius: 12px;
  padding: 16px 12px;
  background: rgba(39, 18, 82, 0.82);
  color: #fff;
  box-shadow: var(--soft-shadow);
}

.countdown-placeholder b {
  display: block;
  font-size: 32px;
}

.event-starting-message {
  display: inline-block;
  margin: 24px 0 0;
  border-radius: 16px;
  padding: 18px 28px;
  background: rgba(39, 18, 82, 0.9);
  color: #fff !important;
  font-size: clamp(28px, 5vw, 54px) !important;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
  box-shadow: var(--shadow);
}

.event-starting-message[hidden],
.countdown-placeholder[hidden] {
  display: none;
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 100px minmax(0, 1fr);
  }

  .live-meta {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .brand img {
    width: 92px;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding-left: 0;
  }

  .home-grid,
  .team-overview {
    grid-template-columns: 1fr;
  }

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

  .event-log-heading,
  .history-heading {
    display: none;
  }

  .event-row,
  .history-row {
    grid-template-columns: 1fr auto;
    align-items: start;
    border: 1px solid rgba(95, 36, 159, 0.12);
    border-radius: 14px;
    margin-top: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.62);
  }

  .event-row time,
  .history-row time,
  .event-row p,
  .history-row p {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  body,
  .inner-page {
    background:
      linear-gradient(180deg, rgba(244, 247, 251, 0.94), rgba(244, 247, 251, 0.88)),
      url("aveva-city-background.png") center top / auto 520px no-repeat;
  }

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

  .brand img,
  .brand.small img {
    width: 76px;
  }

  .primary-nav {
    justify-content: flex-start;
    gap: 6px 14px;
    font-size: 11px;
  }

  .live-meta {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .hero {
    min-height: 0;
    padding-top: 22px;
  }

  .hero h1,
  .page-title h1,
  .pre-event h1 {
    font-size: 42px;
  }

  .hero h2 {
    font-size: 24px;
  }

  .leaderboard-row {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 10px 14px;
    min-height: 0;
    padding: 16px;
  }

  .leaderboard-row .team-mark {
    display: none;
  }

  .points,
  .trend {
    text-align: left;
  }

  .points {
    font-size: 26px;
  }

  .side-stack,
  .score-summary,
  .team-card,
  .countdown-placeholder {
    grid-template-columns: 1fr;
  }

  .team-card,
  .event-log,
  .score-history {
    padding: 20px;
  }

  .filters {
    justify-content: stretch;
    flex-direction: column;
  }

  .filters span {
    min-width: 0;
  }
}
