:root {
  --bg: #f6f7fb;
  --card: #fff;
  --ink: #1b1f29;
  --muted: #5e677a;
  --accent: #5b7cfa;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial;
  color: var(--ink);
  background: var(--bg);
}

header {
  padding: 1.25rem 1.25rem 0;
  max-width: 1200px;
  margin: auto;
}

h1 { margin: 0 0 .25rem; font-size: 1.4rem; }

p.lead { margin: .25rem 0 1rem; color: var(--muted); }

.wrap { max-width: 1200px; margin: 1rem auto; padding: 1.25rem; }

.bar {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
  margin: 0 0 1rem;
}

button {
  appearance: none;
  border: 0;
  background: var(--accent);
  color: #fff;
  padding: .6rem .9rem;
  border-radius: .5rem;
  cursor: pointer;
  font-weight: 600;
}

button.secondary { background: #e9ecff; color: #2a3af5; }

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
}

.pitch-line {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .5rem;
  padding: .35rem 0;
  border-top: 0;
}

.card {
  grid-column: span 12;
  background: var(--card);
  border-radius: .8rem;
  padding: 1rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .06);
}

.card h2 { margin: .1rem 0 .5rem; font-size: 1.1rem; }

.row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: .75rem;
  padding: .35rem 0;
  border-top: 1px solid #eef1f7;
}

.row:first-of-type { border-top: 0; }

.key-inline { color: #6b7390; font-weight: 600; }

/* default look for label cells before JS upgrades them */
.key {
  display: inline-block;
  padding: 0 .35rem;
  margin-right: .25rem;
  color: #6b7390;
  font-weight: 700;
  border-radius: .35rem;
  line-height: 1.2;
}

.val { white-space: pre-wrap; }

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: .93em;
}

.muted { color: var(--muted); }
.tiny { font-size: .85em; }

@media (min-width:900px) {
  .card.span6 { grid-column: span 6; }
  .card.span4 { grid-column: span 4; }
}

details { margin-top: .75rem; }
summary { cursor: pointer; color: #2a3af5; }

.hr { height: 1px; background: #eef1f7; margin: .75rem 0; }

/* inline reroll buttons after JS upgrades .key to <button> */
button.key {
  background: transparent;
  color: #6b7390;
  padding: 0 .35rem;
  border-radius: .35rem;
  font-weight: 700;
  border: 1px solid transparent;
  line-height: 1.2;
  cursor: pointer;
}
button.key:hover { background: #eef1f7; border-color: #d6d9e3; }

button[disabled] {
    opacity: .5;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(0.2);
}

button.danger {
    background: #f56565;
}

button.danger:hover {
    filter: brightness(0.95);
}
