:root {
  color-scheme: light dark;
  --bg: #f6f2e9;
  --ink: #151719;
  --muted: #626665;
  --line: #d8d0c1;
  --panel: #fffaf0;
  --accent: #cc2e44;
  --accent-ink: #fff8f1;
  --shadow: 0 18px 60px rgb(40 30 15 / 12%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100svh;
  background:
    linear-gradient(135deg, rgb(204 46 68 / 9%), transparent 42%),
    radial-gradient(circle at 100% 0, rgb(41 107 161 / 10%), transparent 34%),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0 22px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(38px, 8vw, 72px);
  line-height: 0.92;
}

.controls {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(300px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}

.mode-button {
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.mode-button.active {
  background: var(--ink);
  color: var(--bg);
}

.control {
  display: grid;
  gap: 8px;
  min-width: 112px;
}

.control label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.control input {
  width: 112px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 8px 12px;
  font-size: 22px;
  font-weight: 800;
}

.status {
  min-height: 44px;
  padding: 14px 0;
  color: var(--muted);
}

.results {
  display: grid;
  gap: 16px;
}

.league {
  background: color-mix(in srgb, var(--panel) 88%, white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.league-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
}

h2 {
  font-size: 19px;
  line-height: 1.15;
}

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

.copy,
.details-toggle {
  min-width: 78px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 12px;
  font-weight: 800;
}

.copy {
  background: var(--accent);
  color: var(--accent-ink);
}

.details-toggle {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.copy-small {
  min-height: 36px;
  min-width: 66px;
  font-size: 13px;
}

textarea {
  display: block;
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  line-height: 1.55;
}

.specific {
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 74%, transparent);
}

.specific-item + .specific-item {
  border-top: 1px solid var(--line);
}

.specific-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 0;
}

h3 {
  margin: 0;
  font-size: 15px;
}

.specific textarea {
  min-height: 84px;
  font-size: 13px;
}

@media (max-width: 560px) {
  .shell {
    padding: 18px 12px 32px;
  }

  .intro {
    align-items: start;
    flex-direction: column;
  }

  .control,
  .control input {
    width: 100%;
  }

  .controls {
    width: 100%;
    justify-items: stretch;
  }

  .mode {
    width: 100%;
  }

  textarea {
    min-height: 190px;
  }

  .league-head {
    align-items: stretch;
    flex-direction: column;
  }

  .actions {
    justify-content: stretch;
  }

  .actions button {
    flex: 1;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151413;
    --ink: #f4efe7;
    --muted: #aaa199;
    --line: #38322d;
    --panel: #1f1d1a;
    --accent: #f05a6d;
    --accent-ink: #23070d;
    --shadow: 0 18px 60px rgb(0 0 0 / 32%);
  }
}
