:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans TC", "PingFang HK", "Helvetica Neue", Arial, sans-serif;
  background: #070707;
  color: #f3ead7;
  --bg: #070707;
  --panel: #101010;
  --panel-2: #16130d;
  --line: rgba(214, 178, 94, 0.22);
  --line-strong: rgba(214, 178, 94, 0.52);
  --gold: #d6b25e;
  --gold-soft: #ead49c;
  --muted: #a99f8d;
  --text: #f3ead7;
  --text-dim: #d7ceb9;
  --danger: #e36f55;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.38);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 0%, rgba(214, 178, 94, 0.18), transparent 32rem),
    radial-gradient(circle at 92% 12%, rgba(234, 212, 156, 0.09), transparent 30rem),
    linear-gradient(180deg, #090806 0%, #070707 46%, #0d0b08 100%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(7, 7, 7, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(20px, 3vw, 30px);
  letter-spacing: 0;
}

h2 {
  color: var(--text);
  font-size: clamp(22px, 3vw, 36px);
  line-height: 1.18;
}

.eyebrow {
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

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

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(214, 178, 94, 0.24), rgba(7, 7, 7, 0.8));
  color: var(--gold-soft);
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

select,
button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}

button {
  cursor: pointer;
  background: linear-gradient(135deg, #d6b25e, #8f6f29);
  color: #080806;
  border-color: rgba(234, 212, 156, 0.6);
  font-weight: 700;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:focus-visible,
select:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

select {
  color: var(--gold-soft);
}

select option {
  background: #101010;
  color: var(--text);
}

.ghost-button {
  background: rgba(214, 178, 94, 0.08);
  color: var(--gold-soft);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 22px auto 52px;
}

.hero-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 18px;
  overflow: hidden;
  margin-bottom: 18px;
  padding: clamp(20px, 4vw, 36px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(214, 178, 94, 0.16), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02)),
    #0b0a08;
  box-shadow: var(--shadow);
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -10% -55% 28%;
  height: 320px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(214, 178, 94, 0.16), transparent 68%);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.hero-copy p:last-child {
  max-width: 660px;
  margin-top: 14px;
  color: var(--text-dim);
  line-height: 1.7;
}

.hero-card {
  position: relative;
  z-index: 1;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 5, 5, 0.55);
}

.hero-card span,
.hero-card small {
  color: var(--muted);
}

.hero-card strong {
  color: var(--gold-soft);
  font-size: 24px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.stat,
.match-card,
.leaderboard,
.control-dock {
  background: rgba(16, 16, 16, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat {
  position: relative;
  overflow: hidden;
  padding: 16px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.stat::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--gold), transparent);
}

.stat:hover,
.match-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  background: rgba(22, 19, 13, 0.88);
}

.stat strong {
  display: block;
  font-size: 26px;
  margin-top: 6px;
  color: var(--gold-soft);
}

.stat span,
.leaderboard span {
  color: var(--muted);
  font-size: 13px;
}

.control-dock {
  position: sticky;
  top: 71px;
  z-index: 6;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 6px 0 22px;
  padding: 14px;
  backdrop-filter: blur(18px);
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.segmented button {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  border-color: var(--line);
  font-size: 14px;
}

.segmented button.active {
  background: linear-gradient(135deg, rgba(214, 178, 94, 0.95), rgba(151, 116, 45, 0.95));
  color: #090806;
  border-color: var(--gold-soft);
  box-shadow: 0 10px 24px rgba(214, 178, 94, 0.12);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 26px 0 12px;
}

.count-pill,
.tag,
.status-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--gold-soft);
  background: rgba(214, 178, 94, 0.08);
  font-size: 12px;
  font-weight: 700;
}

.count-pill {
  padding: 8px 12px;
}

.tag,
.status-pill {
  padding: 5px 8px;
}

.match-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.match-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.match-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.teams {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.status {
  color: var(--muted);
  font-size: 13px;
}

.match-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.prediction {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(214, 178, 94, 0.12);
  border-radius: 8px;
  padding: 12px;
}

.prediction > p {
  color: var(--text-dim);
  line-height: 1.55;
}

.bets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.bet {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(7, 7, 7, 0.46);
  transition: border-color 160ms ease, background 160ms ease;
}

.bet:hover {
  border-color: var(--line-strong);
  background: rgba(214, 178, 94, 0.07);
}

.bet strong {
  display: block;
  margin-bottom: 4px;
  color: var(--gold-soft);
}

.bet-line {
  color: var(--text-dim);
  font-size: 14px;
}

.details {
  display: none;
}

.match-card.expanded .details {
  display: grid;
  gap: 10px;
}

.match-toggle {
  justify-self: start;
  background: transparent;
  color: var(--gold-soft);
  border-color: var(--line);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.leaderboard {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
}

.leaderboard div {
  padding: 14px;
  border-right: 1px solid var(--line);
}

.leaderboard strong {
  display: block;
  margin-top: 6px;
  color: var(--gold-soft);
  font-size: 20px;
}

.leaderboard div:last-child {
  border-right: 0;
}

footer {
  padding: 18px clamp(16px, 4vw, 48px);
  color: var(--muted);
  background: rgba(7, 7, 7, 0.86);
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.risk-gate {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.78);
  padding: 16px;
  backdrop-filter: blur(12px);
}

.risk-gate.hidden {
  display: none;
}

.risk-box {
  width: min(460px, 100%);
  background: linear-gradient(180deg, #16130d, #0b0b0b);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.risk-box p {
  color: var(--text-dim);
  line-height: 1.6;
  margin: 12px 0 18px;
}

@media (max-width: 900px) {
  .hero-panel,
  .control-dock,
  .match-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .topbar,
  .section-head,
  .match-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  select,
  .top-actions button {
    width: 100%;
  }

  .control-dock {
    top: 132px;
  }

  .stats-grid,
  .bets,
  .leaderboard {
    grid-template-columns: 1fr;
  }

  .leaderboard div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
