body.host { color: var(--fg); }
.host-main {
  max-width: 1100px;
  margin: 16px auto;
  padding: 0 16px;
  display: grid;
  /* minmax(0, 1fr) rather than bare 1fr: the latter is minmax(auto, 1fr),
     where a card with wide min-content (long button labels, a non-wrapping
     score row) forces the whole column wider than the viewport. */
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}
@media (max-width: 800px) {
  .host-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .host-main { padding: 0 10px; margin: 10px auto; gap: 10px; }
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  min-width: 0;
}
.card h2 { margin-bottom: 10px; font-size: 1.15rem; }
/* Rows align to the bottom so hints and buttons sit at the same baseline as
   the stacked labels' input/select controls. */
.row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.row + .row { margin-top: 12px; }
/* A label in a row always stacks: dim caption on top, the full-width control
   below with 6px between them. This gives every input its own breathing room
   and lets the row's flex-end alignment put siblings next to the input itself,
   not against the taller label-plus-input box. */
.row > label {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--dim);
}
.row > label input,
.row > label select {
  width: 100%;
  color: var(--fg);
}
/* Inline hints and non-label spans sit at the row's bottom edge. Nudge them
   up so their text baseline matches the vertical center of neighbouring
   buttons (whose internal padding is 10px top/bottom). */
.row > .hint,
.row > span.hint { padding-bottom: 10px; }
/* A label styled "flex:1" should be able to shrink below its intrinsic width
   so its contents don't push the row off the right edge on small screens. */
.row > label[style*="flex:1"] { min-width: 140px; flex: 1 1 140px !important; }
@media (max-width: 480px) {
  .card { padding: 12px; }
  .row > label[style*="flex:1"] { flex-basis: 100% !important; }
  .row > button,
  .row > select { flex: 1 1 auto; }
}
.players-mini {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px;
}
.players-mini .p {
  background: var(--panel-solid);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.95rem;
}
.players-mini .p .label { color: var(--dim); font-size: 0.8rem; }
.players-mini .p.active { outline: 2px solid var(--accent); }
.players-mini .p.ready::before { content: '● '; color: var(--good); }

.preview-row { display: flex; gap: 20px; flex-wrap: wrap; color: var(--dim); margin-top: 8px; }
.preview-row span { color: var(--fg); font-weight: 700; }

.pending { padding: 8px 10px; border-radius: 6px; background: var(--panel-solid); }
.pending.has { outline: 2px solid var(--accent); }

.score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}
@media (max-width: 440px) {
  .score-grid { grid-template-columns: 1fr; }
}
.score-grid .p {
  background: var(--panel-solid);
  padding: 10px;
  border-radius: 8px;
}
.score-grid .p .name { font-weight: 700; }
.score-grid .adjust {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  align-items: center;
}
.score-grid button { padding: 4px 8px; font-size: 0.85rem; }
.score-grid .p.active { outline: 2px solid var(--accent); }
