html {
  background: var(--bg-deep);
  color: var(--text-primary);
}

.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.app.is-ready {
  opacity: 1;
}

.transport-mount {
  flex: 0 0 auto;
}

.deck {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(8px, 1.5vw, 20px);
  padding: clamp(10px, 2vh, 24px);
  align-items: stretch;
}

.statusbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.statusbar__link {
  text-decoration: none;
  opacity: 0.7;
}

.statusbar__link:hover {
  opacity: 1;
}

/* Below tablet width, stack the deck into two columns so pads stay big
   enough to be comfortably tappable rather than shrinking indefinitely. */
@media (max-width: 820px) {
  .deck {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(120px, 1fr);
  }
}

@media (min-width: 821px) and (max-width: 1100px) {
  .deck {
    gap: 10px;
  }
}

.orientation-hint {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 20;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(10, 12, 15, 0.92);
  color: var(--text-primary);
  text-align: center;
  padding: 24px;
  font-size: 18px;
}

.orientation-hint__icon {
  font-size: 42px;
  animation: rotate-hint 1.6s ease-in-out infinite;
}

/* Only nudge toward landscape on small handheld screens — tablets and
   desktops are fine in either orientation. */
@media (max-width: 600px) and (orientation: portrait) {
  .orientation-hint {
    display: flex;
  }
}
