* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: #f6f6f4;
  color: #272b29;
  font-family: system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

.page {
  width: calc(100% - 2rem);
  max-width: 60rem;
  margin: 3rem auto;
}

.wiki-page {
  max-width: 47.5rem;
}

h1 {
  margin: 0 0 1.5rem;
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

h2 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  line-height: 1.3;
}

p {
  margin: 0.75rem 0;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

:where(a, button, input, select, [tabindex]):focus-visible {
  outline: 3px solid #476e60;
  outline-offset: 3px;
}

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  display: flex;
  align-items: center;
  height: 100%;
  min-height: 7rem;
  padding: 1.5rem;
  border: 1px solid #dadeda;
  border-radius: 0.5rem;
  background: #fff;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
}

.card:hover {
  border-color: #9ca69f;
  background: #fdfefc;
}

.picker {
  padding: 1.5rem;
  border: 1px solid #dadeda;
  border-radius: 0.5rem;
  background: #fff;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.5rem;
}

.action-help,
.help,
.field-header {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.help {
  position: relative;
}

button,
select,
input {
  font: inherit;
}

button,
input[type="radio"] {
  cursor: pointer;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 2.6rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid #303a35;
  border-radius: 0.35rem;
  background: #303a35;
  color: #fff;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
}

.button:hover {
  background: #202923;
}

.button.secondary {
  border-color: #c8cec9;
  background: #fff;
  color: #272b29;
}

.button.secondary:hover {
  background: #f2f4f1;
}

.tooltip {
  position: fixed;
  z-index: 20;
  width: max-content;
  max-width: min(18rem, calc(100vw - 2rem));
  padding: 0.65rem 0.8rem;
  border-radius: 0.35rem;
  background: #272f2a;
  color: #fff;
  box-shadow: 0 2px 8px #0002;
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
}

.vital-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem 1.5rem;
}

.field {
  min-width: 0;
}

.field-header,
.field-label {
  margin-bottom: 0.4rem;
  font-weight: 600;
}

select {
  width: 100%;
  min-height: 2.6rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid #b9c1ba;
  border-radius: 0.35rem;
  background: #fff;
  color: #272b29;
}

.level-range {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.level-range select {
  width: 4.5rem;
}

.balance {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0;
  border: 0;
}

.balance legend {
  margin-bottom: 0.4rem;
  padding: 0;
  font-weight: 600;
}

.balance-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.25rem;
}

input[type="radio"] {
  margin: 0 0.25rem 0 0;
  accent-color: #303a35;
}

.draw-action {
  margin-top: 1.25rem;
}

.picker-note {
  margin: 1rem 0 0;
  color: #59625c;
  font-size: 0.85rem;
}

.rules {
  margin-top: 2rem;
}

.boosters {
  width: 100%;
  margin-top: 1rem;
  border-collapse: collapse;
  text-align: left;
}

.boosters th,
.boosters td {
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid #dadeda;
  vertical-align: top;
}

.boosters th:first-child,
.boosters td:first-child {
  width: 4rem;
  padding-left: 0;
}

.back-link {
  display: inline-block;
  margin-top: 2rem;
}

@media (min-width: 600px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vital-controls {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  }
}

@media (min-width: 900px) {
  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
