:root {
  --bg: #0b0f14;
  --panel: #111824;
  --panel-2: #1a2433;
  --text: #e8edf4;
  --muted: #96a2b5;
  --border: rgba(255, 255, 255, 0.1);
  --accent: #4c8dff;
  --danger: #ff5d6e;
  --success: #3ccf91;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 20px;
  --space-5: 24px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body.room-page {
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a {
  color: inherit;
}

.page {
  min-height: 100vh;
  width: 100%;
}

.container {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0;
}

.auth-layout {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.card {
  width: min(420px, 100%);
  background: linear-gradient(180deg, #131d2b 0%, #101722 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
}

.card h1,
.card h2,
.title {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 650;
}

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

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.label {
  color: var(--muted);
  font-size: 13px;
}

input,
button {
  font: inherit;
}

input {
  width: 100%;
  background: #0d1420;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  height: 44px;
  padding: 0 12px;
  outline: none;
  transition: border-color 0.18s ease;
}

input:focus {
  border-color: rgba(76, 141, 255, 0.9);
}

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

.btn {
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 0 14px;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.2s ease, background-color 0.18s ease;
}

.icon-btn {
  width: 42px;
  min-width: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  line-height: 1;
}

.icon-svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

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

.btn:active {
  transform: translateY(0);
}

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

.btn-secondary {
  background: #1a2739;
  color: var(--text);
  border-color: var(--border);
}

.btn-danger {
  background: rgba(255, 93, 110, 0.18);
  color: #ffb6bf;
  border-color: rgba(255, 93, 110, 0.4);
}

.hint,
.error {
  margin-top: 10px;
  font-size: 13px;
}

.hint {
  color: var(--muted);
}

.error {
  color: #ff93a1;
  min-height: 16px;
}

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

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.chip {
  font-size: 12px;
  color: #c8d7ef;
  border: 1px solid var(--border);
  background: #122033;
  border-radius: 999px;
  padding: 5px 10px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.profile-form-grid {
  display: grid;
  gap: 10px;
  max-width: 420px;
}

.conference-item {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.conference-item h3 {
  margin: 0;
  font-size: 16px;
}

.conference-item p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.room-layout {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px;
  overflow: hidden;
}

.room-header,
.room-controls {
  background: #111a27;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.room-actions {
  margin-left: auto;
  justify-content: flex-end;
}

.header-time {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.room-main {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
}

.room-layout main {
  min-height: 0;
  overflow: hidden;
}

.participant-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  align-items: flex-start;
  padding: 2px 1px 4px;
  scrollbar-width: none;
}

.participant-strip::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.participant-strip-wrap {
  display: grid;
  grid-template-rows: minmax(0, auto) minmax(0, auto);
  gap: 8px;
  align-items: start;
}

.strip-nav-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.strip-nav {
  height: 34px;
  width: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #1a2739;
  color: #ffffff;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.12s ease;
}

.strip-nav:hover {
  transform: translateY(-1px);
}

.strip-nav:disabled {
  opacity: 0.35;
  cursor: default;
  transform: none;
}

.stage-area {
  /* background: #0e1622; */
  border: none;
  border-radius: var(--radius-lg);
  padding: 10px;
  min-height: 0;
  display: grid;
  overflow: hidden;
}

.video-card {
  position: relative;
  background: #0c1320;
  border: 1px solid var(--border);
  border-radius: 14px;
  min-height: 180px;
  overflow: hidden;
}

.participant-strip .video-card {
  flex: 0 0 180px;
  height: 110px;
  min-height: 110px;
  max-height: 110px;
}

.stage-area .video-card {
  width: 100%;
  min-height: 0;
  height: 100%;
  border: none;
}

.video-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #090d14;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #9db1cf;
  font-size: 14px;
}

.video-name {
  position: absolute;
  left: 8px;
  bottom: 8px;
  font-size: 12px;
  background: rgba(4, 8, 14, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 4px 9px;
}

.video-flags {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  pointer-events: none;
}

.mic-muted-badge {
  display: none;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(8, 14, 22, 0.72);
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.mic-muted-badge.active {
  display: inline-flex;
}

.status-ok {
  color: var(--success);
  font-size: 13px;
}

.room-notice {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 14, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.room-notice.active {
  display: flex;
}

.room-notice-card {
  width: min(420px, 100%);
  background: #111a27;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  gap: 12px;
}

.room-notice-title {
  margin: 0;
  font-size: 18px;
}

.room-notice-text {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 768px) {
  .container {
    width: calc(100% - 20px);
  }

  .room-layout {
    height: 100vh;
    height: 100dvh;
    padding: 8px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .participant-strip .video-card {
    flex-basis: 150px;
    height: 95px;
    min-height: 95px;
    max-height: 95px;
  }

  .stage-area .video-card {
    min-height: 0;
  }
}
