/* The browser site's own look, over listen.css. */

/* A song with no recording, or sound the browser holds back until a tap: a
   calm strip in the reconnecting strip's place, in the theme's accent rather
   than a warning. Paused sound is the one to fix, so it hides the other, and
   reconnecting hides both. */
#listen-paused, #listen-unrecorded {
  grid-area: lost;
  margin: 0;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--board-text);
  background: color-mix(in srgb, var(--brass) 10%, var(--board));
  border-bottom: 1px solid color-mix(in srgb, var(--brass) 24%, var(--board-line));
}
#listen-paused[hidden], #listen-unrecorded[hidden] { display: none; }
#listen-paused:not([hidden]) ~ #listen-unrecorded, .lost #listen-paused { display: none; }

/* The lost banner holds its line and, once the page stops dialing, Try
   again. */
#listen-lost:not([hidden]) { display: flex; align-items: center; gap: 12px; }
#listen-lost-line { margin: 0; flex: 1; }
#listen-redial {
  flex: none;
  padding: 3px 12px;
  font: inherit;
  font-weight: 600;
  color: var(--board-text);
  background: var(--board);
  border: 1px solid color-mix(in srgb, var(--warn) 50%, var(--board-line));
  border-radius: 6px;
  cursor: pointer;
}
#listen-redial[hidden] { display: none; }

/* The room the link opens, over the name field, which is the form's only
   field here and so not the invite's monospace one. */
#door-link { color: var(--board-text); font-weight: 600; }
.door-fields input:first-child { font-family: inherit; letter-spacing: normal; }

/* About has no Updates between its head and foot, so one rule divides them. */
.about-foot { margin-top: 0; border-top: none; }

/* Phones: below 640 px the bar grows to 48 px, every control is at least
   44 px, the stage takes the width, and the chat and Settings come up over
   it. The safe-area insets keep the notch and the home bar clear. */
@media (max-width: 639px) {
  html, body { height: 100dvh; }
  body { --chat-w: 0px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "bar" "lost" "stage" "transport"; }
  #listen-bar { height: 48px; padding: 0 max(4px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left)); padding-top: env(safe-area-inset-top); box-sizing: content-box; gap: 2px; }
  #listen-bar > button:not(.icon) { min-height: 44px; padding: 0 12px; font-size: 14px; }
  #listen-bar > button.icon { width: 44px; height: 44px; }
  #listen-room { font-size: 15px; }
  #door { inset: calc(48px + env(safe-area-inset-top)) 0 0; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  .door-fields input { padding: 11px 12px; font-size: 16px; }
  .door-panel button { min-height: 44px; }
  #listen-lost, #listen-paused, #listen-unrecorded { padding: 8px max(14px, env(safe-area-inset-left)); font-size: 13px; }
  #listen-redial { min-height: 44px; }

  body.audience #audience { padding: 18px max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  #audience-title { font-size: 21px; }
  #audience-players { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 8px; margin-top: 20px; }
  .audience-player { width: auto; min-width: 0; }
  #audience-foot { flex-wrap: wrap; gap: 10px; }
  #audience-reacts { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; width: 100%; }
  #audience-reacts[hidden] { display: none; }
  #audience-reacts button { min-width: 0; min-height: 44px; padding: 0; }
  #audience-volume { flex: 1; margin: 0 52px 0 0; min-height: 44px; }
  #listen-volume { flex: 1; min-width: 0; height: 44px; }
  #chat-corner { right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); }
  #chat-open { width: 44px; height: 44px; }

  /* The chat covers the stage while it is open. */
  #chat-panel { position: fixed; inset: calc(48px + env(safe-area-inset-top)) 0 0; z-index: 6; border-left: 0; padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
  #chat-close { width: 44px; height: 44px; font-size: 18px; }
  #chat-emotes button { height: 44px; }
  #chat-panel .chat-input { font-size: 16px; }
  #audience-step button { min-height: 44px; padding: 0 14px; }

  /* Who's here takes the width under the bar. */
  #people { inset: calc(52px + env(safe-area-inset-top)) 8px auto 8px; width: auto; max-height: calc(100dvh - 64px - env(safe-area-inset-top)); }
  #people li, #people-song { min-height: 44px; }
  .people-mute { width: 44px; height: 44px; }
  .people-level input { width: 96px; height: 44px; }
  #people-copy, #people-leave { min-height: 44px; }

  /* Settings is a sheet from the bottom, its panes as tabs across the top. */
  #settings[open] { display: flex; flex-direction: column; }
  #settings { inset: auto 0 0; width: 100%; max-width: 100%; height: auto; max-height: 88dvh; margin: 0; border-radius: 14px 14px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); }
  #settings .settings-side { padding: 14px 12px 8px; border-right: 0; border-bottom: 1px solid var(--board-line); }
  #settings .settings-side h2 { margin: 0 4px 8px; }
  #settings-panes { display: flex; gap: 4px; overflow-x: auto; }
  #settings-panes button { flex: none; min-height: 44px; padding: 0 14px; }
  #settings .settings-body { flex: 1; min-height: 0; padding: 16px; }
  #settings .settings-close { top: 8px; right: 8px; width: 44px; height: 44px; }
  #settings .setting { flex-wrap: wrap; }
  #settings-audio select { flex: 1 1 100%; width: 100%; min-height: 44px; }
  #settings .segments button { min-height: 40px; }
}
