/* Phone layout: every player screen is exactly one viewport tall and never scrolls. */

html:has(body.player-shell) {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body.player-shell {
  position: fixed;
  inset: 0;
  overflow: hidden;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

body.player-shell input,
body.player-shell select {
  user-select: text;
  -webkit-user-select: text;
}

.player-frame {
  height: 100vh;
  height: 100dvh;
  width: min(520px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: max(16px, calc(env(safe-area-inset-top) + 12px)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  overflow: hidden;
}

.player-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}

.player-header .title-block {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1;
}

.player-header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.player-status,
.status-line {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.35;
  color: var(--muted);
}

.player-badge {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  background: var(--accent);
}

.player-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.player-card h2 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

/* Grows to fill the space left under the header. */
.player-fill {
  flex: 1;
  min-height: 0;
}

body.player-shell input[type='text'],
body.player-shell input[type='number'],
body.player-shell select {
  width: 100%;
  font: inherit;
  /* 16px minimum stops iOS from zooming in on focus */
  font-size: max(16px, 1rem);
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: inherit;
}

body.player-shell input:focus,
body.player-shell select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Short-lived message pinned above the controls. */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  font-size: 0.9rem;
  text-align: center;
  z-index: 50;
  pointer-events: none;
}

.toast.good {
  color: var(--success);
}

.toast.bad {
  color: var(--danger);
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
}

.sheet__panel {
  width: min(520px, 100%);
  background: var(--surface);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1.25rem 1rem max(16px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  text-align: center;
}

.sheet__panel h2 {
  margin: 0;
  font-size: 1.15rem;
}

.sheet__panel p {
  margin: 0;
  color: var(--muted);
}
