:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, sans-serif;
}

body {
  margin: 0;
  background: #f0f6ff;
  color: #12233b;
}

#app {
  max-width: 28rem;
  margin: 3rem auto;
  padding: 1.5rem;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(18, 35, 59, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

h1 {
  margin: 0;
  font-size: 1.6rem;
}

h2 {
  margin: 0.5rem 0 0;
  font-size: 1.1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9rem;
}

input {
  padding: 0.5rem;
  border: 1px solid #b8c7dd;
  border-radius: 8px;
  font-size: 1rem;
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

button {
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 8px;
  background: #1b6ef3;
  color: #ffffff;
  font-size: 1rem;
  cursor: pointer;
}

button.nav {
  background: #e3ecfb;
  color: #12233b;
}

button[disabled] {
  opacity: 0.5;
  cursor: default;
}

/* The row of fold-open buttons under a heading. Wraps on a phone. */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Open reads as pressed-in, so it is obvious which form is showing. */
button.reveal.open {
  background: #12233b;
  color: #ffffff;
}

.hint {
  margin: 0;
  font-size: 0.85rem;
  color: #5a6b80;
}

/* "6 of 8 joined" — the line the commissioner scans while the league fills. */
.fill {
  margin: 0.2rem 0 0.4rem;
  font-size: 0.85rem;
  color: #5a6b80;
}

.banner {
  margin: 0;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.banner.error {
  background: #fde8e8;
  color: #8f1d1d;
}

.banner.notice {
  background: #e5f6ea;
  color: #17603a;
}

.kids {
  margin: 0;
  padding-left: 1.2rem;
}

.draft-clock {
  font-weight: 700;
  background: #fff4d6;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  margin: 0;
}

.draft-progress,
.draft-count {
  font-size: 0.85rem;
  color: #4a5a6e;
  margin: 0.2rem 0;
}

.draft-slots {
  margin: 0;
  padding-left: 1.4rem;
}

.draft-slot.on-the-clock {
  font-weight: 700;
}

/* Drafted players are removed from the pool, so every row here is clickable. */
.draft-pool {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 22rem;
  overflow-y: auto;
}

.draft-pool button.draft-pick {
  width: 100%;
  text-align: left;
  background: #f2f5f9;
  color: #12233b;
  margin-bottom: 0.25rem;
}

.banner.warn {
  background: #fff4e0;
  color: #8a5300;
}

.lineup-slots {
  display: grid;
  gap: 0.6rem;
  margin: 0.8rem 0;
}

.lineup-slot {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.lineup-slot select {
  font-size: 1rem;
  padding: 0.5rem;
  border-radius: 8px;
  border: 2px solid #d7dbe3;
  font-weight: 400;
}

.lineup-bench {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.9rem;
  color: #4a5160;
}

/* Avatar picker: a grid of pictures. The radio itself is hidden — the tile is
   the control — but it stays in the DOM so keyboard focus and form validation
   keep working. */
.avatar-picker {
  border: none;
  margin: 0.8rem 0;
  padding: 0;
}

.avatar-picker legend {
  padding: 0;
  font-size: 0.9rem;
  font-weight: 700;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6rem, 1fr));
  gap: 0.6rem;
  margin-top: 0.5rem;
  max-height: 22rem;
  overflow-y: auto;
  padding: 0.2rem;
}

.avatar-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem;
  border: 2px solid #d7dbe3;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  background: #fff;
}

.avatar-tile img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  display: block;
}

/* Visually hidden, still focusable and still validated. */
.avatar-tile input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.avatar-tile:has(input:checked) {
  border-color: #2f6fed;
  background: #eaf1ff;
}

.avatar-tile:has(input:focus-visible) {
  outline: 3px solid #2f6fed;
  outline-offset: 2px;
}

/*
 * Somebody else got there first. Dimmed AND unclickable: the radio inside is
 * already `disabled`, which is what actually refuses the pick, and
 * pointer-events stops the tap reaching the label at all so a kid never sees
 * a tile flicker as if it took.
 */
.avatar-tile.taken {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.avatar-tile .taken-note {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8a2a2a;
}

/*
 * The two name lists, side by side. Side by side is the whole design: the
 * commissioner is scanning for "that one is this one", which a single stacked
 * list makes needlessly hard. It wraps to one column on a phone rather than
 * squeezing two unreadable ones.
 */
.unmatched {
  border: 1px solid #d8a13a;
  background: #fdf6e6;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin: 0.8rem 0;
}

.unmatched h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.unmatched-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1rem;
}

.unmatched-column h4 {
  margin: 0 0 0.2rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b5a2a;
}

.unmatched-column ul {
  margin: 0;
  padding-left: 1.1rem;
}
