:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #0b0d12;
  --panel: #151821;
  --panel-2: #1c202b;
  --line: #2b3040;
  --text: #f7f8fb;
  --muted: #9ca4b8;
  --brand: #da2149;
  --brand-hover: #ef3158;
  --success: #38c786;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 15% 0%, #29131c 0, transparent 35%), var(--bg); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }

.site-header {
  height: 72px;
  padding: 0 clamp(20px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.07);
  background: rgba(11,13,18,.8);
  backdrop-filter: blur(16px);
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font-weight: 700; }
.brand img { width: 129px; height: 32px; filter: brightness(0) invert(1); }
.brand span { padding-left: 12px; border-left: 1px solid #3b4050; font-size: 18px; }
.secure-label { color: var(--muted); font-size: 14px; }

main { width: min(1280px, 100%); margin: 0 auto; padding: clamp(28px, 5vw, 72px); }
.hero { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(540px, 1.2fr); gap: clamp(36px, 6vw, 90px); align-items: center; min-height: 580px; }
.eyebrow, .room-kicker { color: #ff6485; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .16em; }
.hero-copy h1 { margin: 16px 0 20px; max-width: 680px; font-size: clamp(40px, 6vw, 72px); line-height: .98; letter-spacing: -.05em; }
.hero-copy > p { color: #bec4d2; font-size: clamp(17px, 2vw, 21px); line-height: 1.55; max-width: 620px; }
.hero-points { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 32px; }
.hero-points span { padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; color: #d7dbe5; font-size: 13px; background: rgba(255,255,255,.025); }

.entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.entry-card { padding: 28px; border: 1px solid var(--line); border-radius: 24px; background: rgba(21,24,33,.94); box-shadow: 0 24px 60px rgba(0,0,0,.22); }
.entry-card.accent-card { border-color: rgba(218,33,73,.48); background: linear-gradient(150deg, rgba(218,33,73,.13), rgba(21,24,33,.96) 46%); }
.entry-card h2 { margin: 20px 0 8px; font-size: 24px; }
.entry-card p, .prejoin-card p { min-height: 54px; margin: 0 0 22px; color: var(--muted); line-height: 1.45; }
.card-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; color: white; background: var(--brand); font-size: 26px; }
.card-icon.secondary { background: #2a3040; }
label { display: block; color: #d8dce5; font-size: 13px; font-weight: 650; margin-top: 14px; }
input { width: 100%; margin-top: 7px; padding: 13px 14px; color: var(--text); background: #0f1118; border: 1px solid #343a4c; border-radius: 11px; outline: 0; }
input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(218,33,73,.14); }
.primary-button, .secondary-button, .ghost-button { border: 0; border-radius: 11px; cursor: pointer; text-decoration: none; text-align: center; }
.primary-button, .secondary-button { width: 100%; margin-top: 20px; padding: 13px 18px; font-weight: 750; }
.primary-button { color: white; background: var(--brand); }
.primary-button:hover { background: var(--brand-hover); }
.secondary-button { color: white; background: #303647; }
.secondary-button:hover { background: #3a4154; }
button:disabled { opacity: .55; cursor: wait; }

.trust-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding-top: 24px; border-top: 1px solid var(--line); }
.trust-row article { display: grid; gap: 5px; }
.trust-row strong { font-size: 14px; }
.trust-row span { color: var(--muted); font-size: 13px; line-height: 1.4; }

.room-page { overflow: hidden; }
.room-page main { height: calc(100dvh - 72px); padding-top: 22px; padding-bottom: 92px; overflow: hidden; }
.room-view { height: 100%; min-height: 0; display: flex; flex-direction: column; }
.room-header { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; }
.room-header h1 { margin: 8px 0 6px; font-size: clamp(28px, 4vw, 44px); }
.room-meta { color: var(--muted); }
.owner-badge { margin-left: 8px; padding: 5px 9px; border-radius: 999px; background: rgba(56,199,134,.14); color: #72e7ae; font-size: 12px; }
.room-header-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.ghost-button { width: auto; padding: 10px 13px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 13px; }
.ghost-button:hover { border-color: #495168; }
.status-banner { margin: 24px 0; padding: 12px 15px; border-radius: 11px; background: #161a24; color: var(--muted); font-size: 14px; }
.status-banner.error { background: rgba(218,33,73,.13); color: #ff91a8; }
.status-banner.success { background: rgba(56,199,134,.1); color: #72e7ae; }

.prejoin-card { max-width: 540px; margin: 70px auto; padding: 34px; border: 1px solid var(--line); border-radius: 24px; background: var(--panel); text-align: center; }
.prejoin-card h2 { margin: 18px 0 8px; }
.prejoin-card p { min-height: 0; }
.prejoin-card label { text-align: left; }
.permission-panel { margin: 16px 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.025); text-align: left; }
.permission-heading { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.permission-heading span { color: var(--muted); font-size: 13px; }
.permission-states { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 8px; }
.permission-state { padding: 6px 9px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--muted); font-size: 12px; }
.permission-state.granted { background: rgba(46,204,113,.13); color: #7be5a7; }
.permission-state.denied { background: rgba(239,49,88,.13); color: #ff8ba2; }
.permission-help { margin: 0 0 10px !important; color: var(--muted); font-size: 13px; line-height: 1.4; }
.permission-help.is-error { color: #ff9caf; }
.permission-button { width: 100%; }
.prejoin-avatar, .video-placeholder span { display: grid; place-items: center; margin: auto; border-radius: 50%; background: linear-gradient(145deg, #ef3158, #8e1732); color: white; font-weight: 800; }
.prejoin-avatar { width: 76px; height: 76px; font-size: 30px; }

.conference { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.conference-stage { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-gutter: stable; padding-right: 6px; }
.video-grid { --grid-columns: 1; width: 100%; min-height: 100%; margin: 0 auto; display: grid; grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr)); align-content: center; gap: 12px; }
.video-grid[data-count="1"] { grid-template-columns: minmax(0, 960px); justify-content: center; }
.video-grid[data-count="1"] .video-tile { width: 100%; margin: auto; }
.video-grid.is-scrollable { align-content: start; }
.video-tile { position: relative; min-width: 0; overflow: hidden; aspect-ratio: 16/9; border: 1px solid #262c3b; border-radius: 18px; background: #090b10; box-shadow: 0 14px 36px rgba(0,0,0,.18); }
.video-tile video { width: 100%; height: 100%; display: block; object-fit: contain; background: #090b10; transition: opacity .2s ease; }
.video-placeholder { position: absolute; inset: 0; display: none; place-content: center; gap: 12px; text-align: center; background: radial-gradient(circle at 50% 40%, #252a37, #10131a); color: var(--muted); }
.video-placeholder span { width: 82px; height: 82px; font-size: 30px; }
.video-tile.video-off video { opacity: 0; }
.video-tile.video-off .video-placeholder { display: grid; }
.tile-footer { position: absolute; inset: auto 0 0; display: flex; align-items: center; justify-content: space-between; padding: 28px 14px 12px; background: linear-gradient(transparent, rgba(0,0,0,.78)); font-weight: 700; }
.media-state { display: grid; place-items: center; min-width: 28px; height: 28px; border-radius: 50%; background: rgba(20,24,32,.82); color: #89eabc; }
.media-state.muted { color: #ff8ba4; }
.admin-actions { position: absolute; top: 10px; right: 10px; display: flex; gap: 7px; opacity: 0; transform: translateY(-4px); transition: .18s ease; }
.video-tile:hover .admin-actions, .admin-actions:focus-within { opacity: 1; transform: none; }
.admin-actions button { padding: 7px 9px; border: 1px solid rgba(255,255,255,.15); border-radius: 9px; color: white; background: rgba(12,14,20,.86); cursor: pointer; font-size: 12px; }
.admin-actions button:hover { background: #2a3040; }
.admin-actions .kick:hover { background: var(--brand); }
.empty-room { color: var(--muted); text-align: center; margin: 28px 0; }
.participant-scroll-hint { flex: 0 0 auto; margin: 8px 0 0; color: var(--muted); text-align: center; font-size: 12px; }

.control-dock { position: fixed; z-index: 20; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; gap: 9px; padding: 9px; border: 1px solid rgba(255,255,255,.12); border-radius: 18px; background: rgba(20,23,31,.9); box-shadow: 0 18px 50px rgba(0,0,0,.4); backdrop-filter: blur(18px); }
.round-control { min-width: 82px; padding: 9px 13px; display: grid; justify-items: center; gap: 3px; border: 0; border-radius: 12px; background: #303646; color: white; cursor: pointer; }
.round-control:hover { background: #3b4255; }
.round-control.is-off { background: #eceef3; color: #171a22; }
.round-control.leave-control { background: var(--brand); }
.control-icon { font-size: 19px; line-height: 1; }
.control-label { font-size: 11px; }
.media-settings { width: min(460px, calc(100% - 28px)); padding: 0; border: 1px solid var(--line); border-radius: 22px; color: var(--text); background: var(--panel); box-shadow: 0 28px 90px rgba(0,0,0,.6); }
.media-settings::backdrop { background: rgba(3,5,9,.72); backdrop-filter: blur(6px); }
.media-settings-card { padding: 24px; }
.settings-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.settings-heading h2 { margin: 5px 0 12px; }
.settings-close { width: 38px; height: 38px; border: 0; border-radius: 50%; color: white; background: #303646; cursor: pointer; font-size: 24px; }
select { width: 100%; margin-top: 7px; padding: 12px 38px 12px 13px; border: 1px solid #343a4c; border-radius: 11px; outline: 0; color: var(--text); background: #0f1118; }
select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(218,33,73,.14); }
.switch-camera { width: 100%; margin-top: 10px; }
.settings-help { margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.toast { position: fixed; z-index: 40; top: 86px; left: 50%; transform: translateX(-50%); padding: 11px 16px; border: 1px solid var(--line); border-radius: 11px; background: #202533; box-shadow: 0 12px 34px rgba(0,0,0,.35); }

@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-copy { text-align: center; }
  .hero-copy > p { margin-left: auto; margin-right: auto; }
  .hero-points { justify-content: center; }
  .room-header { align-items: flex-start; flex-direction: column; }
  .room-page .conference-stage { scrollbar-gutter: auto; padding-right: 0; }
  .room-page .video-grid { gap: 10px; align-content: start; }
  .room-page .video-grid.is-scrollable .video-tile { aspect-ratio: 16/9; }
  .room-page .video-tile.portrait-video { aspect-ratio: 3/4; max-height: calc(100dvh - 190px); }
}
@media (max-width: 920px) and (orientation: landscape) {
  .site-header { height: 48px; padding: 0 12px; }
  .brand img { width: 100px; }
  .brand span, .secure-label { display: none; }
  .room-page main { height: calc(100dvh - 48px); padding: 6px 10px 64px; }
  .room-page .room-header { min-height: 25px; flex-direction: row; align-items: center; }
  .room-page .room-header h1 { margin: 0; font-size: 18px; }
  .room-page .room-kicker, .room-page .room-meta, .room-page .room-header-actions { display: none; }
  .room-page .status-banner { margin: 4px 0 6px; padding: 5px 8px; font-size: 11px; }
  .control-dock { bottom: 4px; }
}
@media (max-width: 640px) {
  .site-header { height: 62px; padding: 0 16px; }
  .brand img { width: 110px; }
  .brand span { font-size: 15px; }
  .secure-label { display: none; }
  main { padding: 26px 16px 110px; }
  .room-page main { height: calc(100dvh - 62px); padding: 14px 10px 88px; }
  .room-page .room-header { gap: 10px; }
  .room-page .room-header h1 { margin-top: 3px; font-size: 24px; }
  .room-page .room-header-actions { display: none; }
  .room-page .status-banner { margin: 10px 0; padding: 9px 11px; font-size: 12px; }
  .entry-grid, .trust-row { grid-template-columns: 1fr; }
  .entry-card { padding: 22px; }
  .hero-copy h1 { font-size: 42px; }
  .room-header-actions { justify-content: flex-start; }
  .conference-stage { scrollbar-gutter: auto; padding-right: 0; }
  .video-grid { gap: 10px; align-content: start; }
  .video-grid[data-count="1"] { grid-template-columns: minmax(0, 1fr); }
  .video-grid[data-count="1"] .video-tile { width: 100%; }
  .video-tile { border-radius: 12px; }
  .tile-footer { padding: 22px 9px 8px; font-size: 12px; }
  .video-placeholder span { width: 54px; height: 54px; font-size: 22px; }
  .admin-actions { opacity: 1; transform: none; }
  .control-dock { bottom: 8px; max-width: calc(100vw - 12px); gap: 5px; padding: 6px; }
  .round-control { min-width: 62px; padding: 8px 9px; }
  .control-label { font-size: 9px; }
  .media-settings-card { padding: 20px; }
}
