:root {
  --page-background: #ece7dc;
  --page-foreground: #162033;
  --muted-foreground: #667489;
  --card-background: #f9f6ef;
  --card-border: rgba(22, 32, 51, 0.08);
  --card-shadow: 0 24px 60px rgba(22, 32, 51, 0.1);
  --button-background: #fffdf7;
  --button-border: rgba(22, 32, 51, 0.1);
  --button-selected: #162033;
  --button-selected-text: #f7f2e8;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page-background);
  color: var(--page-foreground);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button {
  font: inherit;
}

.page {
  width: min(1280px, calc(100vw - 96px));
  margin: 0 auto;
  padding: 56px 0 72px;
}

.page .app-menu-bar {
  margin-bottom: 20px;
}

.match-card {
  padding: 36px;
  border: 1px solid var(--card-border);
  border-radius: 32px;
  background: var(--card-background);
  box-shadow: var(--card-shadow);
  will-change: transform, opacity;
}

.match-card.is-animating {
  pointer-events: none;
}

.match-header {
  max-width: 720px;
}

.match-label {
  margin: 0 0 12px;
  color: var(--muted-foreground);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.match-title {
  margin: 0;
  font-size: clamp(2.6rem, 4vw, 4.2rem);
  line-height: 1.02;
}

.match-copy {
  margin: 16px 0 0;
  color: var(--muted-foreground);
  font-size: 1rem;
  line-height: 1.7;
}

.team-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
  margin-top: 32px;
}

.versus-mark {
  display: grid;
  place-items: center;
  min-width: 80px;
  color: var(--muted-foreground);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.team-button {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 16px;
  min-height: 420px;
  padding: 36px;
  border: 1px solid var(--button-border);
  border-radius: 28px;
  background: var(--button-background);
  color: var(--page-foreground);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease,
    color 180ms ease;
}

.team-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 32px rgba(22, 32, 51, 0.08);
}

.team-button[data-selected="true"] {
  background: var(--button-selected);
  color: var(--button-selected-text);
  box-shadow: 0 24px 40px rgba(22, 32, 51, 0.18);
}

.flag-slot {
  display: grid;
  place-items: center;
  width: min(100%, 280px);
  aspect-ratio: 4 / 3;
  border: 1px solid rgba(22, 32, 51, 0.08);
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(239, 234, 224, 0.96));
}

.team-button[data-selected="true"] .flag-slot {
  border-color: rgba(247, 242, 232, 0.16);
  background: rgba(247, 242, 232, 0.08);
}

.flag-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flag-slot.is-square-flag {
  padding: 18px;
}

.flag-slot.is-square-flag .flag-image {
  object-fit: contain;
}

.flag-placeholder {
  padding: 0 20px;
  color: var(--muted-foreground);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
}

.team-button[data-selected="true"] .flag-placeholder {
  color: rgba(247, 242, 232, 0.78);
}

.team-name {
  font-size: clamp(2rem, 3vw, 3rem);
  font-weight: 700;
  line-height: 1.04;
  text-align: center;
}

.match-footer {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--card-border);
}

.selection-text {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 1rem;
}

@media (max-width: 1100px) {
  .page {
    width: min(1280px, calc(100vw - 32px));
    padding: 32px 0 48px;
  }

  .match-card {
    padding: 24px;
  }

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

  .versus-mark {
    min-height: 60px;
  }

  .team-button {
    min-height: 300px;
  }
}
