:root {
  color-scheme: dark;
  --bg: #080504;
  --panel: rgba(22, 13, 9, 0.9);
  --panel-strong: rgba(35, 20, 12, 0.95);
  --line: rgba(255, 207, 71, 0.22);
  --gold: #ffd24d;
  --red: #e1193f;
  --green: #4ade80;
  --cream: #fff6dc;
  --muted: #cfb987;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--cream);
  background:
    radial-gradient(circle at top left, rgba(225, 25, 63, 0.22), transparent 28rem),
    radial-gradient(circle at bottom right, rgba(255, 210, 77, 0.16), transparent 26rem),
    linear-gradient(145deg, #080504 0%, #130a07 55%, #220f08 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  display: grid;
  place-items: center;
  width: min(100% - 28px, 980px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0;
}

.panel {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--panel);
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(16px);
}

.auth-panel {
  max-width: 560px;
  padding: clamp(22px, 5vw, 42px);
}

.app-panel {
  padding: clamp(18px, 4vw, 34px);
}

.hidden {
  display: none;
}

.brand {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 28px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  color: #160902;
  background: linear-gradient(135deg, var(--gold), #ff9d1c);
  font-weight: 950;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: clamp(2.2rem, 7vw, 4.8rem);
  line-height: 0.9;
  letter-spacing: -0.08em;
  text-transform: uppercase;
}

h2 {
  margin-bottom: 0;
  font-size: 1.1rem;
}

p {
  color: var(--muted);
  line-height: 1.55;
}

.code-form {
  display: grid;
  gap: 12px;
}

label,
.eyebrow,
.status-grid span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  color: var(--cream);
  background: rgba(0, 0, 0, 0.28);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 210, 77, 0.12);
}

.code-form input {
  padding: 16px 18px;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0.3em;
  text-align: center;
}

.code-form button,
.mute-button,
.small-button {
  border: 0;
  border-radius: 999px;
  font-weight: 950;
}

.code-form button {
  min-height: 54px;
  color: #160902;
  background: linear-gradient(135deg, var(--gold), #ff9d1c);
}

.message {
  min-height: 24px;
  margin: 18px 0 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.player-identity {
  display: flex;
  gap: 16px;
  align-items: center;
  min-width: 0;
}

.skin-head {
  width: 42px;
  height: 42px;
  image-rendering: pixelated;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
}

.skin-head-fallback {
  background:
    linear-gradient(135deg, rgba(255, 210, 77, 0.9), rgba(225, 25, 63, 0.75)),
    rgba(0, 0, 0, 0.28);
}

.skin-head-large {
  width: 62px;
  height: 62px;
  border-radius: 18px;
}

.topbar h1 {
  margin: 8px 0 4px;
}

.topbar p {
  margin-bottom: 0;
}

.mute-button {
  min-width: 120px;
  min-height: 48px;
  color: var(--cream);
  background: var(--red);
}

.mute-button.is-muted {
  color: #210b04;
  background: var(--gold);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 24px 0;
}

.status-grid article,
.settings,
.player-card {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 22px;
  background: rgba(0, 0, 0, 0.22);
}

.status-grid article {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.status-grid strong {
  font-size: 1.2rem;
}

.settings,
.control-card {
  display: grid;
  gap: 16px;
}

.settings {
  margin-bottom: 26px;
  padding: 18px;
}

.voice-section {
  margin-top: 22px;
}

.settings-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.settings-head span {
  color: var(--muted);
  font-size: 0.88rem;
}

.setting-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.4fr) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.primary-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.control-card {
  align-content: start;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.18);
}

.setting-row input,
.setting-row select {
  min-height: 44px;
  padding: 0 14px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
}

.tab-button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 950;
}

.tab-button.is-active {
  color: #160902;
  border-color: transparent;
  background: linear-gradient(135deg, var(--gold), #ff9d1c);
}

.tab-panel {
  display: none;
  gap: 16px;
}

.tab-panel.is-active {
  display: grid;
}

.range-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.range-control span {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.small-button {
  width: fit-content;
  min-height: 42px;
  padding: 0 16px;
  color: var(--gold);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.ptt-control {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.ptt-status {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.22);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ptt-status.is-pressed {
  color: #120803;
  border-color: transparent;
  background: var(--green);
}

.player-list {
  display: grid;
  gap: 10px;
}

.player-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
}

.player-card.has-volume {
  grid-template-columns: minmax(0, 1fr) auto minmax(180px, 0.42fr);
}

.player-info {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.player-card strong {
  display: block;
}

.player-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.muted-tag {
  color: #ffe4e9;
  border-color: rgba(225, 25, 63, 0.55);
  background: rgba(225, 25, 63, 0.2);
}

.player-volume {
  display: grid;
  grid-template-columns: auto minmax(90px, 1fr) auto;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.player-volume input {
  min-height: 28px;
  padding: 0;
}

.player-volume-value {
  min-width: 40px;
  text-align: right;
}

.meter {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.meter div {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--gold), var(--green));
  transition: width 120ms linear;
}

.empty {
  margin: 0;
  padding: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  text-align: center;
}

@media (max-width: 720px) {
  .topbar,
  .settings-head {
    display: grid;
  }

  .status-grid,
  .setting-row,
  .primary-controls,
  .player-card {
    grid-template-columns: 1fr;
  }

  .player-card.has-volume {
    grid-template-columns: 1fr;
  }

  .mute-button {
    width: 100%;
  }
}
