:root {
  color-scheme: dark;
  --bg: #111318;
  --rail: #16191f;
  --sidebar: #20242c;
  --panel: #272c35;
  --panel-2: #303743;
  --line: #3d4654;
  --text: #f4f7fb;
  --muted: #aeb8c5;
  --accent: #43d6a8;
  --accent-2: #66a3ff;
  --danger: #f05f6b;
  --warn: #f0c45a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 76px 296px 1fr;
}

.rail {
  background: var(--rail);
  padding: 16px 12px;
  display: grid;
  align-content: start;
  gap: 12px;
  border-right: 1px solid #0c0e12;
}

.server-icon {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-weight: 850;
}

.server-icon.active {
  background: var(--accent);
  color: #051713;
}

.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-width: 0;
}

.guild-header,
.topbar,
.control-dock {
  min-height: 72px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

p,
h1,
h2 {
  margin: 0;
}

.guild-header p,
.topbar p,
.channel span,
.self span,
.voice-card span,
.profile-card label {
  color: var(--muted);
}

.guild-header h1,
.topbar h2 {
  font-size: 20px;
  line-height: 1.15;
}

.live-pill {
  border-radius: 999px;
  padding: 5px 9px;
  background: #36313a;
  color: var(--warn);
  font-size: 12px;
  font-weight: 800;
}

.live-pill.online {
  background: rgba(67, 214, 168, 0.14);
  color: var(--accent);
}

.profile-card {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.profile-card label {
  display: grid;
  gap: 7px;
  font-size: 13px;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #151920;
  color: var(--text);
  outline: none;
  padding: 11px 12px;
}

input:focus,
select:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(102, 163, 255, 0.16);
}

.profile-card button,
.invite-button,
.join {
  border-radius: 8px;
  background: var(--accent);
  color: #041713;
  font-weight: 800;
  padding: 11px 14px;
}

.channels {
  padding: 14px 10px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.channel {
  width: 100%;
  text-align: left;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 11px 12px;
  display: grid;
  gap: 3px;
}

.channel:hover,
.channel.active {
  background: var(--panel);
}

.channel strong {
  overflow-wrap: anywhere;
}

.stage {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  background:
    linear-gradient(140deg, rgba(67, 214, 168, 0.08), transparent 36%),
    linear-gradient(320deg, rgba(102, 163, 255, 0.08), transparent 32%),
    #171a20;
}

.invite-button {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
}

.voice-board {
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  align-content: start;
  gap: 14px;
}

.voice-card {
  min-height: 116px;
  border-radius: 8px;
  background: rgba(39, 44, 53, 0.9);
  border: 1px solid var(--line);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.voice-card.speaking {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(67, 214, 168, 0.35);
}

.voice-card header,
.self {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #0e1116;
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 900;
  flex: 0 0 auto;
}

.voice-card strong,
.self strong {
  display: block;
  overflow-wrap: anywhere;
}

.meter {
  height: 8px;
  border-radius: 999px;
  background: #171b22;
  overflow: hidden;
}

.meter div {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.12s ease;
}

.volume-control {
  display: grid;
  gap: 6px;
}

.volume-control span {
  font-size: 12px;
}

.volume-control input {
  min-height: 28px;
  padding: 0;
  accent-color: var(--accent-2);
}

.settings-strip {
  border-top: 1px solid var(--line);
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: rgba(17, 19, 24, 0.72);
}

.field-control {
  min-width: 190px;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.field-control input[type="range"] {
  min-height: 40px;
  padding: 0;
  accent-color: var(--accent);
}

.toggle {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(39, 44, 53, 0.7);
}

.control-dock {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  background: #12151b;
}

.controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.round {
  min-width: 78px;
  min-height: 44px;
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 800;
}

.round.danger {
  background: rgba(240, 95, 107, 0.14);
  border-color: rgba(240, 95, 107, 0.5);
  color: #ff9ca5;
}

.join.connected {
  background: var(--danger);
  color: #27070b;
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 64px 1fr;
  }

  .sidebar {
    display: none;
  }

  .rail {
    padding-inline: 8px;
  }
}

@media (max-width: 620px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .rail {
    display: none;
  }

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

  .controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .join {
    grid-column: 1 / -1;
  }

  .voice-board {
    grid-template-columns: 1fr;
    padding: 12px;
  }
}
