/* Beatpause — paper-and-ink look: warm cream, hard black rules, one loud
   signal colour. Same features, completely different skin. */

:root {
  --paper: #f2ebdd;
  --paper-2: #e7ddc7;
  --card: #fffaf0;
  --ink: #141110;
  --ink-2: #3d372e;
  --muted: #7a7160;
  --accent: #ff4a1c;
  --lemon: #ffe45c;
  --line: 2px solid var(--ink);
  --shadow: 6px 6px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --radius: 16px;
  --sans: ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background-color: var(--paper);
  background-image:
    radial-gradient(90% 55% at 100% 0%, rgba(255, 228, 92, 0.55), transparent 70%),
    linear-gradient(rgba(20, 17, 16, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 17, 16, 0.045) 1px, transparent 1px);
  background-size: 100% 100%, 26px 26px, 26px 26px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  overflow-x: hidden;
  padding: max(16px, env(safe-area-inset-top)) 0 max(26px, env(safe-area-inset-bottom));
}

main {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 18px;
}

.screen {
  animation: rise 0.35s ease-out both;
}

.hidden {
  display: none !important;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* ── Home ───────────────────────────────────────────── */
.home {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 50px);
  padding-top: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 14px;
  border-bottom: var(--line);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand-mark {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 15px;
}

.brand-mark i {
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
  animation: bounce 1.1s ease-in-out infinite;
}

.brand-mark i:nth-child(1) { height: 45%; animation-delay: -0.3s; }
.brand-mark i:nth-child(2) { height: 100%; animation-delay: -0.15s; }
.brand-mark i:nth-child(3) { height: 70%; animation-delay: -0.45s; }

.brand-name {
  font-weight: 700;
  letter-spacing: 0.2em;
}

.brand-note {
  margin-left: auto;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.hero {
  padding: 26px 0 4px;
}

.kicker {
  display: inline-block;
  margin: 0 0 12px;
  padding: 5px 10px;
  border: 1.5px solid var(--ink);
  background: var(--lemon);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(40px, 13.5vw, 58px);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.035em;
}

h1 em {
  font-style: italic;
  color: var(--accent);
  box-shadow: inset 0 -0.16em 0 var(--lemon);
}

.lede {
  margin: 16px 0 0;
  font-size: 16px;
  color: var(--ink-2);
  max-width: 30em;
}

/* ── Buttons ────────────────────────────────────────── */
.btn {
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  background: var(--card);
  border: var(--line);
  border-radius: 12px;
  padding: 13px 18px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s ease;
  touch-action: manipulation;
}

.btn:active {
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 var(--ink);
}

.btn.primary {
  background: var(--accent);
  color: #fff;
}

.btn.wide {
  width: 100%;
  padding: 17px 18px;
  font-size: 17px;
  letter-spacing: 0.01em;
}

.btn.small {
  padding: 9px 13px;
  font-size: 13px;
  border-radius: 10px;
  box-shadow: 2px 2px 0 var(--ink);
}

.btn.small:active {
  transform: translate(2px, 2px);
}

.btn.ghost {
  background: transparent;
}

.btn:disabled {
  opacity: 0.4;
  box-shadow: none;
  transform: none;
  cursor: default;
}

/* ── Start / join card ──────────────────────────────── */
.ticket {
  margin: 22px 0 0;
  padding: 18px;
  background: var(--card);
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.or::before,
.or::after {
  content: "";
  flex: 1;
  border-top: 1.5px dashed rgba(20, 17, 16, 0.35);
}

.or span {
  white-space: nowrap;
}

.join-row {
  display: flex;
  gap: 10px;
}

.code-input {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-align: center;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px dashed var(--ink);
  border-radius: 12px;
  padding: 12px 10px;
}

.code-input::placeholder {
  color: #a2987f;
  letter-spacing: 0.18em;
  font-weight: 500;
}

.code-input:focus,
.field:focus,
.seek:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.msg {
  min-height: 20px;
  margin: 10px 0 0;
  font-size: 13.5px;
  font-weight: 600;
  color: #c22f08;
}

/* ── Little how-it-works strip ──────────────────────── */
.how {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.how li {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px 7px 7px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.7);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.how li span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 10px;
}

.fine {
  margin: 0;
  padding-top: 24px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.home .fine {
  margin-top: auto;
}

/* ── Room ───────────────────────────────────────────── */
.room {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 4px;
}

.room-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: var(--line);
}

.code-chip {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.code-chip .label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.code-chip strong {
  font-family: var(--mono);
  font-size: 26px;
  letter-spacing: 0.16em;
  line-height: 1.1;
}

.bar-actions {
  display: flex;
  gap: 8px;
}

.room-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: -4px;
}

.tag {
  padding: 4px 10px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.tag.host {
  background: var(--ink);
  color: var(--paper);
}

.people {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(255, 74, 28, 0.55);
  animation: pulse 2s ease-out infinite;
}

.eyebrow.offline .pip {
  background: var(--muted);
  animation: none;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(255, 74, 28, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 74, 28, 0); }
}

/* ── Now playing card ───────────────────────────────── */
.now {
  position: relative;
  padding: 16px;
  background: var(--card);
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.now-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.art {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  background:
    radial-gradient(120% 120% at 20% 10%, var(--lemon), transparent 65%),
    var(--accent);
  transform: rotate(-3deg);
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
}

.bars i {
  width: 3px;
  border-radius: 2px;
  background: var(--ink);
  height: 25%;
  animation: bounce 1s ease-in-out infinite;
  animation-play-state: paused;
}

.art.playing .bars i {
  animation-play-state: running;
}

.bars i:nth-child(1) { animation-delay: -0.1s; height: 45%; }
.bars i:nth-child(2) { animation-delay: -0.5s; height: 90%; }
.bars i:nth-child(3) { animation-delay: -0.25s; height: 60%; }
.bars i:nth-child(4) { animation-delay: -0.7s; height: 100%; }
.bars i:nth-child(5) { animation-delay: -0.35s; height: 55%; }
.bars i:nth-child(6) { animation-delay: -0.6s; height: 75%; }

@keyframes bounce {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1); }
}

.now h2 {
  margin: 14px 0 0;
  font-family: var(--serif);
  font-size: 27px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.artist {
  margin: 5px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.progress {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 14px;
}

.seek {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 26px;
  background: transparent;
  cursor: pointer;
}

.seek:disabled {
  opacity: 0.45;
  cursor: default;
}

.seek::-webkit-slider-runnable-track {
  height: 8px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--paper-2);
}

.seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--ink);
}

.seek::-moz-range-track {
  height: 8px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--paper-2);
}

.seek::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--accent);
}

.times {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ── Transport ──────────────────────────────────────── */
.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 2px 0;
}

.btn.round {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  padding: 0;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
}

.btn.round.big {
  width: 76px;
  height: 76px;
  font-size: 24px;
  border-width: 2.5px;
  background: var(--accent);
  color: #fff;
  box-shadow: 5px 5px 0 var(--ink);
}

.btn.round.big:active {
  transform: translate(5px, 5px);
  box-shadow: 0 0 0 var(--ink);
}

.btn.round:disabled,
.btn.round.big:disabled {
  opacity: 0.35;
  box-shadow: none;
}

.control-note {
  margin: -2px 0 0;
  padding: 11px 13px;
  border-left: 3px solid var(--accent);
  background: rgba(255, 250, 240, 0.75);
  font-size: 13px;
  color: var(--ink-2);
}

/* ── Queue ──────────────────────────────────────────── */
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 -4px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.section-title::before {
  content: "";
  width: 9px;
  height: 9px;
  background: var(--accent);
}

.playlist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.playlist li {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1.5px solid transparent;
  border-radius: 11px;
  background: rgba(255, 250, 240, 0.72);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.playlist li:active {
  background: var(--paper-2);
}

.playlist.locked li {
  cursor: default;
  opacity: 0.8;
}

.playlist.locked li:active {
  background: rgba(255, 250, 240, 0.72);
}

.playlist li.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.playlist .num {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  font-family: var(--mono);
  font-size: 10px;
  opacity: 0.7;
}

.playlist li.active .num {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  opacity: 1;
}

.playlist .name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14.5px;
  font-weight: 600;
}

.playlist .dur {
  font-family: var(--mono);
  font-size: 10.5px;
  opacity: 0.75;
}

.queue-remove {
  flex: none;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  background: transparent;
  color: inherit;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.queue-remove:active {
  background: var(--accent);
  color: #fff;
}

/* ── Empty state + messages ─────────────────────────── */
.empty {
  padding: 18px 14px;
  border: 1.5px dashed rgba(20, 17, 16, 0.4);
  border-radius: 12px;
  background: rgba(255, 250, 240, 0.55);
  font-size: 14px;
  text-align: center;
  color: var(--ink-2);
}

.room-msg {
  margin: 0;
  padding: 10px 12px;
  border: 1.5px solid var(--ink);
  border-left-width: 5px;
  border-radius: 8px;
  background: var(--lemon);
  font-size: 13px;
  font-weight: 600;
}

/* ── Search + links ─────────────────────────────────── */
.add-panel {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 15px;
  background: var(--card);
  border: var(--line);
  border-radius: var(--radius);
}

.panel-title {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.search-row,
.link-row {
  display: flex;
  gap: 8px;
}

.field {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  padding: 11px 12px;
}

.field::placeholder {
  color: #a2987f;
}

.search-msg {
  min-height: 17px;
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-2);
}

.results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
}

.results li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 7px 7px 10px;
  border-radius: 9px;
  background: var(--paper);
}

.result-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.result-body strong {
  font-size: 13.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-body span {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

/* ── Streaming stage ────────────────────────────────────
   The player lives here but is never seen: it is kept tiny and transparent so
   phones only carry the sound, not the video or a picture of it. */
.stage {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 2px;
  height: 2px;
  overflow: hidden;
  opacity: 0.01;
  pointer-events: none;
  z-index: -1;
}

.stage #player,
.stage iframe {
  width: 2px;
  height: 2px;
  border: 0;
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
