:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #f6f2ea;
  --surface: #fffaf2;
  --surface-strong: #ffffff;
  --text: #161616;
  --muted: #64615b;
  --line: #ded6c8;
  --accent: #d6402f;
  --accent-dark: #a62d22;
  --success: #126b41;
  --danger: #b42318;
  --shadow: 0 18px 45px rgba(54, 43, 27, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

.shell {
  min-height: 100vh;
  padding: 24px;
}

.workspace {
  width: min(1040px, 100%);
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.1;
}

h1 {
  font-size: clamp(28px, 5vw, 48px);
  max-width: 720px;
}

h2 {
  font-size: 22px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.joinForm {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) auto;
  gap: 14px;
  align-items: end;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--text);
  outline: none;
  padding: 11px 12px;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(214, 64, 47, 0.18);
}

button,
.playlistLink {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  padding: 12px 16px;
  text-align: center;
  text-decoration: none;
}

button:hover,
.playlistLink:hover {
  background: var(--accent-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.roomGrid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 16px;
  margin-top: 16px;
}

.sectionHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.count {
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding: 6px 10px;
}

.state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.trackList {
  display: grid;
  gap: 10px;
  list-style-position: inside;
  margin: 0;
  padding: 0;
}

.trackList li {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.trackList a {
  color: var(--text);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.trackMeta {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 5px;
}

.addPanel {
  align-self: start;
  display: grid;
  gap: 14px;
}

.status {
  min-height: 22px;
  color: var(--muted);
  font-weight: 700;
  margin: 14px 0 0;
}

.status.success { color: var(--success); }
.status.error { color: var(--danger); }
.is-hidden { display: none; }

@media (max-width: 760px) {
  .shell {
    padding: 14px;
  }

  .topbar,
  .sectionHeader {
    align-items: stretch;
    flex-direction: column;
  }

  .joinForm,
  .roomGrid {
    grid-template-columns: 1fr;
  }

  .playlistLink,
  button {
    width: 100%;
  }
}
