:root {
  color-scheme: light;
  --bg: #f6efe4;
  --face: #fffaf3;
  --ink: #3a2418;
  --muted: #8a6248;
  --line: rgba(196, 122, 62, 0.28);
  --amber: #f07832;
  --live: #e23b3b;
  --aqua: #b7e0e2;
  --shadow: 0 18px 40px rgba(120, 72, 32, 0.14);
  font-family: Nunito, "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(520px 320px at 8% 10%, rgba(183, 224, 226, 0.95), transparent 70%),
    radial-gradient(460px 300px at 96% 16%, rgba(255, 186, 140, 0.55), transparent 68%),
    radial-gradient(420px 280px at 92% 92%, rgba(183, 224, 226, 0.8), transparent 70%),
    radial-gradient(340px 220px at 4% 88%, rgba(240, 120, 100, 0.22), transparent 70%),
    var(--bg);
  color: var(--ink);
}

button, input { font: inherit; color: inherit; }

a { color: #d25a22; }

.chassis,
.booth {
  width: min(440px, calc(100% - 32px));
  margin: max(16px, env(safe-area-inset-top)) auto 32px;
  padding: 22px 22px 24px;
  border: 3px solid #f3d2ae;
  border-radius: 32px;
  background: var(--face);
  box-shadow: var(--shadow);
}

.booth { width: min(880px, calc(100% - 32px)); }

.logo {
  display: block;
  width: 100%;
  height: auto;
  margin: 16px 0 0;
  border-radius: 22px;
}

.booth .logo {
  width: min(100%, 560px);
  margin-right: auto;
  margin-left: auto;
}

.logo-mark,
.booth .logo.logo-mark {
  width: min(100%, 168px);
  margin: 8px auto 0;
}

.mast {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  letter-spacing: 0.08em;
  font-family: Fredoka, Nunito, sans-serif;
  font-size: 15px;
  font-weight: 600;
}

.brand.link { text-decoration: none; color: var(--ink); }

.freq {
  margin-right: auto;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.air {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.air::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e7cbb0;
}

.air.on {
  padding: 4px 8px 4px 10px;
  border-radius: 8px;
  background: var(--live);
  color: #fffaf3;
  box-shadow: 0 2px 0 #c42e2e;
}

.air.on::before {
  background: #fffaf3;
  box-shadow: none;
}

h1 {
  margin: 8px 0 0;
  font-family: Fredoka, Nunito, sans-serif;
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 0.95;
}

.tag, .hint, .note, .listeners {
  color: var(--muted);
  line-height: 1.45;
}

.tag { margin: 10px 0 0; font-weight: 700; }

.now {
  min-height: 1.4em;
  margin: 18px 0 0;
  font-size: 18px;
  font-weight: 800;
}

.host-message {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
}

.host-message[hidden] {
  display: none;
}

.scope {
  display: block;
  width: 100%;
  height: 48px;
  margin-top: 10px;
}

.tune {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 16px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--amber);
  color: #fffaf3;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 3px 0 #d85a18;
}

.tune:focus-visible,
.channel-btn:focus-visible,
.chat-send:focus-visible,
.text-btn:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}

.tune[aria-pressed="true"] { background: #ff8d4d; }

.fader, .title-field {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 44px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: #f0d3b0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  margin-top: -10px;
  border: 3px solid #fffaf3;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 1px 0 #e7c49a;
}

input[type="range"]::-moz-range-track {
  height: 8px;
  border: 0;
  border-radius: 999px;
  background: #f0d3b0;
}

input[type="range"]::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border: 3px solid #fffaf3;
  border-radius: 50%;
  background: var(--amber);
}

.listeners, .note { margin: 14px 0 0; font-weight: 700; }

.listeners:empty, .note:empty { display: none; }

.quiet {
  display: block;
  width: max-content;
  margin: -28px auto 40px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.quiet.in-booth { margin: 22px 0 0; }

.channels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 28px;
}

.guest-channel,
.remote-channel,
.mix-modes { grid-column: 1 / -1; }

.mix-modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.studio-grid { margin-top: 8px; }

.mix { min-width: 0; }

.studio-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}

.studio-head h1 { margin: 0; }

.booth .studio-head .logo.logo-mark {
  width: 72px;
  margin: 0;
  border-radius: 16px;
}

.dock {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 12px;
  align-items: center;
  margin-top: 16px;
}

.dock .tune {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 14px 22px;
}

.dock .phones {
  grid-column: 1 / -1;
  margin-top: 0;
}

.phones-hint {
  grid-column: 1 / -1;
  margin: 0;
}

.dock .listeners { margin: 0; min-height: 0; }

.fader > span {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.level {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.guest-share {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.guest-share input {
  flex: 1;
  min-width: 12rem;
  padding: 12px 14px;
  border: 2px solid #f3d2ae;
  border-radius: 14px;
  background: #fff;
  font-size: 14px;
  font-weight: 700;
}

.guest-share .channel-btn {
  width: auto;
  margin-top: 0;
  padding: 12px 16px;
}

.channel {
  padding: 18px;
  border: 2px solid #f3d7b8;
  border-radius: 22px;
  background: #fff6ea;
}

.channel h2,
.chat h2 {
  margin: 0;
  font-family: Fredoka, Nunito, sans-serif;
  font-size: 20px;
  font-weight: 600;
}

.hint { margin: 8px 0 0; font-size: 14px; font-weight: 700; text-transform: none; letter-spacing: 0; }

.channel > .channel-btn:first-child { margin-top: 0; }

.channel-btn {
  width: 100%;
  margin-top: 16px;
  padding: 12px 14px;
  border: 2px solid #f3c49a;
  border-radius: 999px;
  background: #fffaf3;
  font-weight: 800;
  cursor: pointer;
}

.channel-btn:disabled { opacity: 0.55; cursor: wait; }

.channel-btn[aria-pressed="true"] {
  border-color: transparent;
  background: var(--amber);
  color: #fffaf3;
}

.meter {
  display: block;
  width: 100%;
  height: 22px;
  margin-top: 14px;
}

.fades {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.fade-btn {
  min-height: 44px;
  margin-top: 0;
  padding: 12px 14px;
  font-size: 14px;
}

.title-field input,
.chat-compose input {
  padding: 12px 14px;
  border: 2px solid #f3d2ae;
  border-radius: 14px;
  background: #fff;
  text-transform: none;
  letter-spacing: 0;
  font-size: 16px;
  font-weight: 700;
}

.chat {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 2px solid #f3d7b8;
}

.chat-gate { margin-top: 8px; }

.chat-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}

.chat-send {
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--amber);
  color: #fffaf3;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 0 #d85a18;
}

.picture-field {
  margin: 14px 0 0;
  padding: 0;
  border: 0;
}

.picture-field legend {
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.picture-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.picture-choice {
  width: 52px;
  height: 52px;
  padding: 4px;
  border: 2px solid #f3d2ae;
  border-radius: 16px;
  background: #fffaf3;
  cursor: pointer;
}

.picture-choice svg { display: block; width: 100%; height: 100%; }

.picture-choice[aria-pressed="true"] {
  border-color: var(--amber);
  box-shadow: 0 0 0 2px var(--amber);
}

.picture-choice:disabled { cursor: default; opacity: 0.55; }

.chat-picture {
  display: inline-flex;
  width: 28px;
  height: 28px;
  flex: none;
}

.chat-picture svg { display: block; width: 100%; height: 100%; }

.chat-you {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 14px 0;
  color: var(--muted);
  font-weight: 700;
}

.chat-you .chat-picture { width: 24px; height: 24px; }

.chat-you strong {
  color: var(--ink);
  font-weight: 800;
}

.chat-scroll {
  max-height: 280px;
  min-height: 120px;
  overflow-y: auto;
  padding: 14px;
  border: 2px solid #f3d7b8;
  border-radius: 18px;
  background: #fff6ea;
}

.chat-log {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.chat-empty {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.chat-msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: min(100%, 460px);
}

.chat-msg.admin {
  flex-direction: row-reverse;
  align-self: flex-end;
}

.chat-bubble {
  min-width: 0;
  padding: 8px 12px 10px;
  border: 2px solid #f3d7b8;
  border-radius: 18px 18px 18px 6px;
  background: #fff;
}

.chat-msg.admin .chat-bubble {
  border-color: #f3c49a;
  border-radius: 18px 18px 6px 18px;
  background: #fff1e4;
}

.chat-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.chat-notice {
  align-self: center;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.chat-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.chat-time {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.chat-msg.admin .chat-name { color: #d25a22; }

.chat-badge {
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(240, 120, 50, 0.16);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chat-text {
  margin: 2px 0 0;
  line-height: 1.4;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.chat-reacts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chat-react {
  padding: 2px 8px;
  border: 2px solid #f3d2ae;
  border-radius: 999px;
  background: #fffaf3;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.chat-react[aria-pressed="true"] {
  border-color: transparent;
  background: var(--amber);
  color: #fffaf3;
}

.chat-remove { margin-top: 6px; }

.chat-compose {
  position: sticky;
  bottom: calc(8px + var(--keyboard, 0px) + env(safe-area-inset-bottom));
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 8px;
  background: var(--face);
}

.chat-compose input {
  flex: 1 1 160px;
  min-width: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 16px;
}

.text-btn {
  padding: 0;
  border: 0;
  background: none;
  color: #d25a22;
  font-size: 14px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.chat-people { margin: 4px 0 12px; }

.chat-people h3 {
  margin: 0;
  color: var(--muted);
  font-family: Fredoka, Nunito, sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chat-person {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-weight: 800;
}

.chat-person-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] { display: none !important; }

.chassis .chat-scroll { max-height: min(42vh, 360px); }

@media (min-width: 980px) {
  .booth { width: min(1100px, calc(100% - 48px)); }
  .studio-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
    gap: 28px;
    align-items: start;
  }
  .booth .chat {
    margin-top: 14px;
    padding: 18px 18px 20px;
    border: 2px solid #f3d7b8;
    border-radius: 22px;
    background: #fff6ea;
    min-height: 280px;
    position: sticky;
    top: 16px;
  }
  .booth .chat-scroll { max-height: min(60vh, 560px); }
  .mix .channels { margin-top: 16px; }
}

@media (max-width: 979px) {
  .channels { grid-template-columns: 1fr; }
  .booth { padding-bottom: calc(128px + env(safe-area-inset-bottom)); }
  .dock {
    position: fixed;
    z-index: 5;
    left: 12px;
    right: 12px;
    bottom: calc(10px + var(--keyboard, 0px) + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 2px 12px;
    align-items: center;
    margin-top: 0;
    padding: 10px 12px 12px;
    border: 3px solid #f3d2ae;
    border-radius: 22px;
    background: var(--face);
    box-shadow: var(--shadow);
  }
  .dock .tune { margin: 0; }
  .dock .listeners { text-align: right; }
  .booth .chat-compose {
    bottom: calc(120px + var(--keyboard, 0px) + env(safe-area-inset-bottom));
  }
  .booth .studio-head .logo.logo-mark { width: 64px; }
}

.chassis.remote {
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
}

.remote .channel,
.remote .mix-modes { margin-top: 16px; }

.remote .mix-modes { grid-template-columns: 1fr 1fr; }

.remote .studio-head .logo.logo-mark {
  width: 64px;
  margin: 0;
  border-radius: 16px;
}

@media (prefers-reduced-motion: reduce) {
  .air.on::before { box-shadow: none; }
}
