:root {
  color-scheme: light;
  --ink: #172126;
  --muted: #69757b;
  --line: #dce4e7;
  --surface: #ffffff;
  --surface-2: #f4f7f8;
  --accent: #1f8f75;
  --accent-2: #e24f3d;
  --gold: #d59b28;
  --shadow: 0 18px 60px rgba(23, 33, 38, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(31, 143, 117, 0.14), transparent 34%),
    linear-gradient(315deg, rgba(226, 79, 61, 0.11), transparent 36%),
    #eef4f3;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 32px 0;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 24px;
  align-items: stretch;
}

.predictor-panel,
.results-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(220, 228, 231, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.predictor-panel {
  padding: 28px;
  border-radius: 8px;
}

.results-panel {
  padding: 24px;
  border-radius: 8px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.subtitle {
  max-width: 560px;
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.field,
.slider-field {
  display: grid;
  gap: 8px;
}

.field span,
.slider-field span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

select {
  width: 100%;
  min-height: 44px;
  padding: 0 38px 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.matchup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.team-editor {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  display: grid;
  gap: 18px;
}

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

.flag {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0;
}

.team-heading p {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.team-heading h2 {
  margin-bottom: 0;
  font-size: 1.3rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.versus {
  align-self: center;
  justify-self: center;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

output {
  float: right;
  color: var(--ink);
  font-weight: 900;
}

.scoreline {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.scoreline p {
  margin-bottom: 4px;
  color: var(--accent-2);
  font-size: 0.85rem;
  font-weight: 800;
}

.scoreline h2 {
  margin-bottom: 0;
  font-size: 1.55rem;
  line-height: 1.18;
}

.xg-box {
  min-width: 108px;
  padding: 12px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  text-align: right;
}

.xg-box span {
  display: block;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.75rem;
  font-weight: 800;
}

.xg-box strong {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
}

.warning {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 6px;
  background: #fff1e9;
  color: #9e3d1f;
  font-weight: 800;
}

.probability-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.prob-card {
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.prob-card span {
  display: block;
  min-height: 34px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.25;
}

.prob-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.7rem;
}

.meter {
  height: 7px;
  margin-top: 10px;
  border-radius: 999px;
  background: #d9e1e3;
  overflow: hidden;
}

.meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.section-row {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.section-row + .section-row {
  margin-top: 20px;
}

.section-row h3 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.goal-bars {
  display: grid;
  gap: 12px;
}

.goal-bar {
  display: grid;
  grid-template-columns: 84px 1fr 62px;
  gap: 10px;
  align-items: center;
  font-weight: 800;
}

.track {
  height: 10px;
  border-radius: 999px;
  background: #d9e1e3;
  overflow: hidden;
}

.track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
}

.score-list {
  margin: 0;
  padding-left: 0;
  display: grid;
  gap: 8px;
  list-style: none;
}

.score-list li {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--surface-2);
  font-weight: 800;
}

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

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding: 10px 0;
  }

  .predictor-panel,
  .results-panel {
    padding: 18px;
  }

  .control-grid,
  .matchup,
  .probability-grid {
    grid-template-columns: 1fr;
  }

  .versus {
    width: 44px;
    height: 44px;
  }

  .scoreline {
    flex-direction: column;
  }

  .xg-box {
    width: 100%;
    text-align: left;
  }

  .goal-bar {
    grid-template-columns: 70px 1fr 54px;
  }
}
