:root {
  --primary: #0b74ff;
  --primary-dark: #0649d8;
  --cyan: #04d9f3;
  --navy: #061a50;
  --ink: #172038;
  --muted: #7d879e;
  --line: #e7ebf3;
  --surface: #ffffff;
  --page: #f4f7fb;
  --success: #18b968;
  --warning: #ff8a1f;
  --danger: #ff4f5e;
  --shadow: 0 10px 28px rgba(25, 65, 145, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}
a{
  text-decoration:none;
}

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

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.mobile-shell {
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--page);
  position: relative;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}

.hero {
  position: relative;
  overflow: hidden;
  background: #0860e6;
}

.hero img {
  display: block;
  width: 100%;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 52px;
  background: linear-gradient(to top, rgba(4, 23, 69, 0.38), transparent);
  pointer-events: none;
}

.top-switch {
  height: 48px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.top-switch button {
  border: 0;
  background: transparent;
  color: #2e3445;
  font-size: 15px;
  position: relative;
  cursor: pointer;
}

.top-switch button.active {
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, #12a9ef, #0878e9);
}

.top-switch button.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 28px;
  height: 3px;
  border-radius: 99px;
  background: #8affff;
  transform: translateX(-50%);
}

.page-body {
  padding: 0 14px 24px;
}

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(88, 129, 204, 0.14);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 1px;
  min-height: 64px;
  background: linear-gradient(135deg, #063ec8, #0b7bff 64%, #02d7e8);
  border-radius: 18px 18px 0 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  margin: 10px;
  text-align: center;
}

.section-title::before,
.section-title::after {
  content: "";
  width: 38px;
  height: 8px;
  background: repeating-linear-gradient(120deg, transparent 0 6px, #04d9f3 6px 11px);
  opacity: 0.9;
}

.group-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px;
  background: #eef5ff;
  border-bottom: 1px solid #dce7f8;
}

.group-tabs button {
  min-height: 42px;
  border: 1px solid #cbdaf4;
  border-radius: 12px;
  color: #64708b;
  background: #fff;
  cursor: pointer;
  font-size: 17px;
  font-weight: 700;
}

.group-tabs button.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #1fcdf0, #086ef4);
  box-shadow: 0 7px 15px rgba(21, 116, 247, 0.26);
}

.match-list {
  /* padding: 0 14px 8px; */
}
.match-list img{
  width:100%;
}
.match-card {
  display: grid;
  grid-template-columns: 1fr 76px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 112px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--line);
}

.match-card:last-child {
  border-bottom: 0;
}

.player {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.player.right {
  flex-direction: row-reverse;
  text-align: right;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(145deg, #45bfff, #1456e8);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.45);
}

.player-name {
  font-weight: 800;
  font-size: 17px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-dept {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.versus {
  text-align: center;
}

.score {
  font-size: 22px;
  font-weight: 900;
  color: #1d2a4a;
  letter-spacing: 1px;
}

.vs-pill {
  margin: 7px auto 0;
  width: 42px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  color: #fff;
  background: linear-gradient(135deg, #13bff0, #0a5ff4);
  font-size: 13px;
  font-weight: 800;
}

.focus-card {
  margin-top: 14px;
  padding: 15px 16px;
  color: #fff;
  background: radial-gradient(circle at 15% 20%, rgba(6, 218, 242, .32), transparent 34%), linear-gradient(135deg, #072b80, #081b50);
  border: 1px solid rgba(69, 171, 255, .5);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.focus-card .eyebrow {
  color: #a8c8ff;
  font-size: 13px;
}

.focus-card strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
  color: #fff;
}

.focus-card strong span {
  color: #19e5f5;
}

.focus-card small {
  display: block;
  margin-top: 6px;
  color: #acc0e9;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 480px);
  height: calc(72px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(255,255,255,.97);
  border-top: 1px solid #dce3ee;
  box-shadow: 0 -8px 28px rgba(31, 66, 120, .11);
  z-index: 50;
  backdrop-filter: blur(12px);
}

.bottom-nav a {
  text-decoration: none;
  color: #5e6677;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 13px;
}

.bottom-nav a .nav-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-size: 20px;
}

.bottom-nav a.active {
  color: #06c5d8;
  font-weight: 800;
}

.bottom-nav a.active .nav-icon {
  color: #fff;
  /* background: linear-gradient(135deg, #15cdf0, #0876f7); */
  /* box-shadow: 0 6px 14px rgba(10, 126, 247, .25); */
}

/* History page */
.history-hero {
  min-height: 230px;
  padding: 26px 20px 34px;
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 12%, rgba(78, 183, 255, .6), transparent 26%),
    radial-gradient(circle at 82% 6%, rgba(5, 207, 255, .32), transparent 25%),
    linear-gradient(145deg, #0b79f4 0%, #0648c8 52%, #04287e 100%);
}

.history-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(105deg, transparent 0 36px, rgba(255,255,255,.035) 36px 38px),
    linear-gradient(to bottom, transparent 55%, rgba(0,0,0,.18));
}

.history-hero > * {
  position: relative;
  z-index: 1;
}

.history-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  font-style: italic;
  font-size: 13px;
}

.history-brand .cup {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: #fff;
  color: #e9a600;
  font-size: 28px;
  box-shadow: 0 7px 18px rgba(3, 31, 92, .3);
}

.history-year {
  margin-top: 8px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 3px;
}

.history-title {
  margin: 3px 0 0;
  font-size: 42px;
  line-height: 1.08;
  font-weight: 950;
  letter-spacing: 3px;
  text-shadow: 0 5px 18px rgba(0,0,0,.22);
}

.history-subtitle {
  margin-top: 8px;
  font-size: 15px;
  letter-spacing: 4px;
}

.progress-card {
  margin: -26px 14px 16px;
  padding: 18px;
  position: relative;
  z-index: 4;
  background: rgba(255,255,255,.96);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.progress-title {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 17px;
  font-weight: 700;
}

.progress-title b {
  color: var(--primary);
}

.progress-line {
  margin-top: 17px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  position: relative;
}

.progress-line::before {
  content: "";
  position: absolute;
  left: 9%;
  right: 9%;
  top: 6px;
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(to right, var(--primary) 0 31%, #cdd5e1 31% 100%);
}

.progress-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin: 0 auto;
  background: #cbd3df;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #cbd3df;
  z-index: 1;
}

.progress-dot.done,
.progress-dot.current {
  background: var(--primary);
  box-shadow: 0 0 0 2px var(--primary);
}

.timeline {
  padding: 0 14px 22px 34px;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 16px;
  bottom: 24px;
  width: 2px;
  background: #d8e1ef;
}

.stage-card {
  position: relative;
  margin-bottom: 14px;
  background: #fff;
  border: 1px solid #dce6f6;
  border-radius: 18px;
  box-shadow: 0 9px 24px rgba(38, 83, 155, .10);
  overflow: hidden;
}

.stage-card::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 29px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #a7b9d6;
  box-shadow: 0 0 0 3px #fff;
}

.stage-card.current::before {
  border-color: var(--primary);
}

.stage-head {
  width: 100%;
  border: 0;
  background: #fff;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 15px;
  cursor: pointer;
  text-align: left;
}

.stage-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 23px;
  background: linear-gradient(135deg, #18c7ee, #0869ef);
}

.stage-card:nth-child(2) .stage-icon { background: linear-gradient(135deg, #ff9d2f, #ff6f00); }
.stage-card:nth-child(3) .stage-icon { background: linear-gradient(135deg, #aa5cff, #6737e9); }
.stage-card:nth-child(4) .stage-icon { background: linear-gradient(135deg, #4fd06d, #159f45); }
.stage-card:nth-child(5) .stage-icon { background: linear-gradient(135deg, #f7c43f, #ef8700); }

.stage-name {
  font-size: 19px;
  font-weight: 850;
}

.stage-date {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.status-chip {
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 12px;
  white-space: nowrap;
  background: #edf0f5;
  color: #5d6677;
}

.status-chip.ongoing {
  color: #fff;
  background: var(--primary);
}

.status-chip.pending {
  color: #e56700;
  background: #fff1df;
}

.stage-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
  background: #fbfdff;
}

.stage-card.open .stage-detail {
  max-height: 580px;
  border-top: 1px solid var(--line);
}

.round-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

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

.round-name {
  font-weight: 750;
}

.round-date {
  color: #5b6373;
  font-size: 13px;
}

.empty-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  padding: 34px;
}

.rules-card {
  margin: 14px;
  padding: 20px;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.rules-card h2 {
  margin-top: 0;
}

.rules-card li {
  margin: 10px 0;
  line-height: 1.7;
  color: #4c566b;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  color: #fff;
  background: rgba(20, 28, 45, .92);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 99;
  transition: .2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 481px) {
  body {
    padding: 18px 0;
  }

  .mobile-shell {
    min-height: calc(100vh - 36px);
    border-radius: 24px;
    box-shadow: 0 20px 70px rgba(21, 50, 99, .18);
    overflow: hidden;
  }

  .bottom-nav {
    bottom: 0;
    border-radius: 0 0 24px 24px;
  }
}
