:root {
  --field: #0d5c46;
  --field-dark: #083d33;
  --ink: #111827;
  --muted: #5b6472;
  --line: #d9dee5;
  --paper: #f8fafc;
  --white: #ffffff;
  --gold: #c88419;
  --red: #b42318;
  --green: #13795b;
  --shadow: 0 18px 50px rgba(17, 24, 39, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background: var(--paper);
}

button,
input {
  font: inherit;
}

button {
  min-height: 44px;
  border: 1px solid var(--field-dark);
  border-radius: 8px;
  padding: 0 16px;
  color: var(--white);
  background: var(--field-dark);
  cursor: pointer;
}

button.primary {
  border-color: var(--gold);
  background: var(--gold);
}

button.ghost {
  color: var(--field-dark);
  background: var(--white);
}

button:disabled {
  border-color: #c9ced6;
  color: #7d8591;
  background: #eef1f5;
  cursor: not-allowed;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(200, 132, 25, 0.38);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
}

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 36px;
  align-items: end;
  padding: 48px min(5vw, 64px) 36px;
  color: var(--white);
  background:
    linear-gradient(135deg, rgba(8, 61, 51, 0.96), rgba(13, 92, 70, 0.9)),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.12) 0 2px, transparent 2px 84px),
    var(--field);
}

.kicker {
  margin: 0 0 12px;
  color: #cfe7df;
  font-size: 15px;
}

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

h1 {
  margin-bottom: 14px;
  font-size: clamp(42px, 7vw, 86px);
  line-height: 0.98;
  letter-spacing: 0;
}

.lede {
  max-width: 720px;
  margin-bottom: 0;
  color: #f4faf8;
  font-size: 19px;
  line-height: 1.7;
}

.draw-panel {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.status-line {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 14px;
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--white);
  background: var(--muted);
  white-space: nowrap;
}

.mode-badge.ready {
  background: var(--green);
}

.mode-badge.locked {
  background: var(--red);
}

.seed-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.seed-field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--white);
}

.reveal-box {
  display: grid;
  gap: 8px;
  min-height: 86px;
  border: 1px solid #d8e4df;
  border-radius: 8px;
  padding: 14px;
  background: #f4faf7;
}

.reveal-box span {
  color: var(--muted);
  font-size: 13px;
}

.reveal-box strong {
  color: var(--field-dark);
  font-size: 20px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.reveal-box.rolling {
  border-color: var(--gold);
  background: #fff8eb;
}

.reveal-box.rolling strong {
  animation: drawPulse 0.42s ease-in-out infinite alternate;
}

@keyframes drawPulse {
  from {
    transform: translateY(0);
    opacity: 0.78;
  }
  to {
    transform: translateY(-2px);
    opacity: 1;
  }
}

.action-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.action-row.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pots-band,
.schedule-band,
.integrity-band {
  padding: 34px min(5vw, 64px);
}

.section-head {
  display: flex;
  gap: 24px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-head h2,
.integrity-band h2 {
  margin-bottom: 0;
  font-size: 24px;
}

.section-head p {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.pots-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.pot-card,
.round-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.06);
}

.pot-card {
  padding: 18px;
}

.pot-card h3 {
  margin-bottom: 14px;
  color: var(--field-dark);
  font-size: 18px;
}

.pot-card ol,
.round-card ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.team-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  border: 1px solid #e4e8ee;
  border-radius: 8px;
  padding: 0 12px;
  background: #fbfcfe;
}

.team-pill strong {
  font-size: 15px;
}

.team-pill span {
  color: var(--muted);
  font-size: 13px;
}

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

.empty-state {
  display: block;
  border: 1px dashed #aab3c0;
  border-radius: 8px;
  padding: 28px;
  color: var(--muted);
  background: var(--white);
}

.empty-state p {
  margin: 0;
}

.round-card h3 {
  margin: 0;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--field-dark);
  font-size: 18px;
}

.round-card ol {
  padding: 14px;
}

.round-card .empty-round {
  min-height: 42px;
  color: var(--muted);
  display: grid;
  align-items: center;
}

.match-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 46px;
  border: 1px solid #e7ebf0;
  border-radius: 8px;
  padding: 8px 10px;
}

.match-row .team {
  min-width: 0;
}

.match-row .team:last-child {
  text-align: right;
}

.team-name {
  display: block;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.pot-note {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.versus {
  color: var(--gold);
  font-weight: 700;
}

.integrity-band {
  background: #eef3f1;
}

.integrity-band dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 0;
}

.integrity-band dl div {
  border: 1px solid #d0dad7;
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.75);
}

.integrity-band dt {
  margin-bottom: 8px;
  color: var(--field-dark);
  font-weight: 700;
}

.integrity-band dd {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

code {
  color: var(--red);
  font-family: Consolas, "SFMono-Regular", monospace;
}

@media (max-width: 960px) {
  .stage {
    grid-template-columns: 1fr;
    padding-top: 36px;
  }

  .pots-grid,
  .schedule-grid,
  .integrity-band dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .stage,
  .pots-band,
  .schedule-band,
  .integrity-band {
    padding-left: 18px;
    padding-right: 18px;
  }

  h1 {
    font-size: 44px;
  }

  .lede {
    font-size: 16px;
  }

  .status-line,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .action-row,
  .action-row.compact,
  .pots-grid,
  .schedule-grid,
  .integrity-band dl {
    grid-template-columns: 1fr;
  }
}
