/* Daily Sparks touch targets; keep upstream viewport styles unchanged.
   These size floors deliberately override compact mode-specific controls. */
:is(button, select, summary, a[href]),
input:not([type='checkbox']):not([type='radio']):not([type='hidden']) {
  min-height: 44px !important;
  min-width: 44px !important;
}

/* The label supplies the hit area without enlarging the native check mark. */
label:has(input[type='checkbox']),
label:has(input[type='radio']) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
}

/* Header and toolbar containers must grow with their controls. The field
   remains the flexible region, while long controls retain their own scroll. */
.site-header {
  height: auto;
  min-height: 44px;
}
.brand {
  align-items: center;
}
.mode-bar {
  flex-shrink: 0;
}
:is(.field-toolbar, .challenge-field-toolbar, .pvp-field-toolbar):has(
  button,
  select,
  input
) {
  height: auto;
  min-height: 44px;
  flex-shrink: 0;
  padding-block: 4px;
}

@media (max-height: 500px) and (min-aspect-ratio: 6/5) {
  /* In landscape, Manage team shares the header rather than adding a row. */
  .intro {
    height: 44px;
    min-height: 44px;
    align-items: center;
  }
  .intro-actions {
    align-items: center;
  }
  .mode-bar {
    padding-block: 2px;
  }
  .help-panel {
    top: 50px;
  }
}

/* A short portrait window needs the same single header row as landscape.
   Keep all actions at 44px and reserve a usable field before panel scrolling. */
@media (max-width: 519px) and (max-height: 450px) {
  .site-header {
    height: 44px;
    padding-inline: 6px;
  }
  .brand {
    width: 44px;
    justify-content: center;
    font-size: 0;
    gap: 0;
  }
  .brand-mark {
    margin: 0;
    font-size: 18px;
  }
  .brand > span:last-child,
  .header-note,
  .intro > div:first-child {
    display: none;
  }
  .intro {
    position: fixed;
    top: env(safe-area-inset-top);
    right: calc(8px + env(safe-area-inset-right));
    height: 44px;
    min-height: 44px;
    padding: 0;
    z-index: 10;
    align-items: center;
  }
  .intro-actions {
    align-items: center;
    gap: 6px;
  }
  main {
    grid-template-rows: auto minmax(0, 1fr);
    gap: 4px;
    padding: 0 6px 4px;
  }
  main > [role='tabpanel'] {
    grid-row: 2;
    overflow: auto;
  }
  .mode-bar {
    padding-block: 2px;
  }
  .help-panel {
    top: 50px;
  }
  .play-layout {
    min-height: 244px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(180px, 1fr) minmax(60px, 0.4fr);
    gap: 4px;
  }
  .play-stage {
    gap: 3px;
  }
  .play-controls {
    padding-top: 4px;
  }
  .challenge-scoreboard {
    padding: 4px 8px;
    grid-template-columns: 50px minmax(0, 1fr) 50px;
    gap: 6px;
  }
  .challenge-main-stat,
  .challenge-limit,
  .challenge-situation {
    gap: 1px;
  }
  .challenge-main-stat strong,
  .challenge-limit strong {
    font-size: 20px;
    line-height: 1;
  }
  .challenge-main-stat > span,
  .challenge-limit > span {
    font-size: 7px;
    letter-spacing: 0.5px;
  }
  .challenge-main-stat > small,
  .challenge-limit > small,
  .challenge-situation > small {
    display: none;
  }
  .challenge-situation > b {
    font-size: 10px;
    line-height: 1.2;
  }
  .field-toolbar,
  .challenge-field-toolbar,
  .pvp-play-layout .pvp-field-toolbar {
    padding: 3px 8px;
    min-height: 20px;
    font-size: 8px;
  }
  :is(.field-toolbar, .challenge-field-toolbar, .pvp-field-toolbar):has(
    button,
    select,
    input
  ) {
    min-height: 44px;
    padding-block: 0;
  }
  .match-bar,
  .pvp-play-layout .pvp-scoreboard {
    padding: 4px 7px;
    gap: 5px;
  }
  .team-score strong,
  .pvp-play-layout .pvp-seat-score > strong {
    font-size: 20px;
  }
  .match-center {
    gap: 1px;
  }
  .match-center > b,
  .pvp-play-layout .pvp-score-center > b {
    font-size: 10px;
  }
  .match-center > span:last-child,
  .pvp-play-layout .pvp-score-center > span {
    display: none;
  }
  .pvp-play-layout .pvp-score-center,
  .pvp-play-layout .pvp-seat-score {
    gap: 1px 4px;
  }
  .rush-arena.play-stage {
    gap: 0;
  }
  .rush-arena .rush-scoreboard {
    padding: 3px 8px;
    gap: 6px;
  }
  .rush-arena .rush-scoreboard strong {
    font-size: 20px;
    line-height: 1;
  }
  .rush-arena .rush-scoreboard > div > span {
    margin-bottom: 1px;
  }
  .rush-arena .rush-personal-best {
    display: none;
  }
  .rush-play-actions {
    padding: 0;
    gap: 0;
  }
  .rush-play-actions .rush-steering {
    gap: 4px;
  }
}
