:root {
  --bg-0: #090b11;
  --bg-1: #121622;
  --panel: #171c2b;
  --panel-soft: #1d2335;
  --text: #edf2ff;
  --muted: #9ea8c4;
  --accent: #6a84ff;
  --ok: #2fd07f;
  --danger: #f04f65;
  --line: #2a334d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1000px 500px at 10% -10%, #273157 0%, transparent 60%),
    radial-gradient(900px 500px at 95% 110%, #1f2948 0%, transparent 65%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: linear-gradient(180deg, #1a2031, #131827);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  display: grid;
  gap: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

h1,
h2 {
  margin: 0;
}

.login-subtitle {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 14px;
}

input,
button {
  font: inherit;
}

input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0e1220;
  color: var(--text);
}

input:focus {
  outline: 1px solid #6a84ff;
}

#join-btn {
  border: 0;
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(135deg, #6a84ff, #5d70ff);
  color: #fff;
  cursor: pointer;
}

.room {
  width: 100%;
  max-width: 980px;
  background: linear-gradient(180deg, #161c2b, #121722);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 16px 16px 116px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.4);
}

.room-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 12px;
}

.room-title-wrap {
  display: grid;
  gap: 4px;
}

.self-name {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.participants {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
}

.participant {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.participant:last-child:nth-child(odd) {
  grid-column: 1 / span 2;
  width: calc(50% - 6px);
  justify-self: center;
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  border: 3px solid transparent;
  position: relative;
  overflow: hidden;
  background: var(--panel-soft);
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
}

.avatar:not(.has-video) {
  width: 92px;
  height: 92px;
  border-radius: 999px;
}

.avatar.speaking {
  border-color: var(--ok);
}

.avatar.muted {
  border-color: var(--danger);
}

.avatar-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.avatar.has-video .avatar-video {
  display: block;
}

.avatar.has-video .avatar-letter {
  display: none;
}

.dock {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: flex;
  gap: 14px;
  padding: 10px 14px;
  border: 1px solid #303953;
  border-radius: 999px;
  background: rgba(13, 18, 30, 0.78);
  backdrop-filter: blur(8px);
}

.room {
  position: relative;
}

.icon-btn {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #f4f7ff;
  background: #2a3147;
  transition: background-color 120ms ease, transform 120ms ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
}

.icon-btn.is-off {
  background: #4d2330;
}

.icon-btn.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.leave-btn {
  background: #5a2631;
}

.icon {
  width: 22px;
  height: 22px;
}

.icon-btn .icon-off {
  display: none;
}

.icon-btn.is-off .icon-on {
  display: none;
}

.icon-btn.is-off .icon-off {
  display: block;
}

.hidden {
  display: none;
}

@media (max-width: 740px) {
  .room {
    padding: 14px 14px 106px;
  }

  .participants {
    grid-template-columns: 1fr;
  }

  .participant:last-child:nth-child(odd) {
    grid-column: auto;
    width: 100%;
  }
}
