/*
 * The picked unit's panel on a phone (match/deck-sheet.js). Closed, it is one
 * row: what the next order carries, and Settings. Open, the options sit above
 * that row, so Settings / Done never moves. Desktop never shows the row.
 */
.deck-sheet {
  display: none;
}

:root[data-phone='true'] .deck-sheet {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

/* A unit with nothing to set has no row: its description says what it is. */
:root[data-phone='true'] .deck__panel[data-has-options='false'] .deck-sheet {
  display: none;
}

.deck-sheet__summary {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font: 600 var(--text-xs) / 1.3 var(--font-mono);
  color: var(--text);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.deck-sheet__toggle {
  flex: none;
  width: 6.5rem;
  min-height: var(--target);
}

.deck-sheet__toggle[aria-expanded='true'] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

:root[data-phone='true'] .deck__panel {
  padding: var(--space-2);
}

/* Closed: only the row. The map above stays free to tap. */
:root[data-phone='true'] .deck__panel[data-has-options='true'][data-open='false'] .card__options,
:root[data-phone='true'] .deck__panel[data-has-options='true'][data-open='false'] .deck__about {
  display: none;
}

/* Open: the options, without the one-line notes, and the description kept to two lines. */
:root[data-phone='true'] .deck__panel .option__note {
  display: none;
}

:root[data-phone='true'] .deck__about {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* Sideways the panel is narrower and shorter: no description when open, a
   narrower label, and smaller words so every button fits its column. */
:root[data-phone='true'][data-orient='landscape']
  .deck__panel[data-has-options='true']
  .deck__about {
  display: none;
}

/* Open sideways, the panel also covers the overview, which comes back on Done. */
:root[data-phone='true'][data-orient='landscape'] .deck__panel[data-open='true'] {
  right: 0;
  z-index: 3;
}

:root[data-phone='true'][data-orient='landscape'] .deck__panel .option__label {
  flex: 0 0 3rem;
  font-size: 0.625rem;
  letter-spacing: 0.04em;
}

:root[data-phone='true'][data-orient='landscape'] .deck__panel .option,
:root[data-phone='true'][data-orient='landscape'] .deck__panel .stepper {
  flex-wrap: nowrap;
  gap: var(--space-1);
  min-width: 0;
}

/* A longer word takes more of the row, so "Rearm, return" is not cut short. */
:root[data-phone='true'][data-orient='landscape'] .deck__panel .segment {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 0.125rem;
  overflow: hidden;
  font-size: 0.6875rem;
  text-overflow: ellipsis;
}
