@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400..700;1,9..144,400..700&family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
  --bg0: #0d0b08;
  --bg1: #14110c;
  --bg2: #1b1712;
  --bg3: #251f16;
  --line: #2c261c;
  --line2: #3c3425;
  --ink: #efe7d8;
  --ink2: #b3a892;
  --ink3: #7d7360;
  --amber: #f0a63a;
  --amber2: #c47f1c;
  --red: #e0563a;
  --ok: #8fc98f;
  --fd: 'Fraunces', serif;
  --fu: 'Space Grotesk', sans-serif;
  --fm: 'JetBrains Mono', monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

[hidden], .hidden {
  display: none !important;
}

html, body {
  height: 100%;
}

body {
  background: var(--bg0);
  color: var(--ink);
  font-family: var(--fu);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: var(--amber);
  color: #1a1206;
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  border-radius: 4px;
}

button {
  font-family: inherit;
  color: inherit;
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-thumb {
  background: var(--line2);
  border-radius: 6px;
  border: 2px solid var(--bg1);
}

::-webkit-scrollbar-track {
  background: transparent;
}

#grain {
  position: fixed;
  inset: -60px;
  pointer-events: none;
  z-index: 70;
  opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain .5s steps(3) infinite;
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-18px, 10px); }
  66% { transform: translate(12px, -14px); }
  100% { transform: translate(0, 0); }
}

.lamp {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3a3126;
  flex: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .4);
  transition: background .3s, box-shadow .3s;
}

.lamp.on {
  background: var(--amber);
  box-shadow: 0 0 10px 1px rgba(240, 166, 58, .55), 0 0 2px rgba(240, 166, 58, .9);
}

.lamp.big {
  width: 18px;
  height: 18px;
}

.lamp.breath {
  animation: breath 2.8s ease-in-out infinite;
}

@keyframes breath {
  0%, 100% { opacity: .45; }
  50% { opacity: 1; }
}

.lamp.ignite {
  animation: ignite 1.3s linear both;
}

@keyframes ignite {
  0% { opacity: .15; }
  7% { opacity: 1; }
  11% { opacity: .2; }
  17% { opacity: 1; }
  23% { opacity: .35; }
  32% { opacity: 1; }
  100% { opacity: 1; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font: 600 12.5px/1 var(--fu);
  letter-spacing: .09em;
  height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid var(--line2);
  background: var(--bg2);
  color: var(--ink);
  cursor: pointer;
  transition: transform .12s, border-color .15s, filter .15s;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--ink3);
}

.btn.primary {
  background: var(--amber);
  border-color: var(--amber);
  color: #1c1204;
}

.btn.primary:hover:not(:disabled) {
  filter: brightness(1.12);
}

.btn.ghost {
  background: transparent;
}

.btn.danger {
  color: var(--red);
  border-color: rgba(224, 86, 58, .45);
}

.btn.danger:hover:not(:disabled) {
  border-color: var(--red);
}

.btn.big {
  height: 50px;
  font-size: 13px;
}

.btn.tiny {
  height: 32px;
  padding: 0 12px;
  font-size: 11px;
}

.btn:disabled {
  opacity: .38;
  cursor: not-allowed;
}

.iconbtn {
  width: 38px;
  height: 38px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--line2);
  background: var(--bg2);
  color: var(--ink2);
  cursor: pointer;
  transition: all .15s;
  font-size: 15px;
}

.iconbtn:hover {
  color: var(--ink);
  border-color: var(--ink3);
}

.iconbtn.on {
  color: var(--amber);
  border-color: rgba(240, 166, 58, .55);
  background: rgba(240, 166, 58, .08);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line2);
  border-radius: 10px;
  background: var(--bg2);
  font: 600 12.5px var(--fm);
  letter-spacing: .08em;
  color: var(--ink2);
  cursor: pointer;
  transition: border-color .15s;
}

button.chip:hover {
  border-color: var(--ink3);
  color: var(--ink);
}

/* ============ LOBBY ============ */
#home-screen, #lobby {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: radial-gradient(1100px 480px at 30% -8%, rgba(240, 166, 58, .07), transparent 60%);
}

.lobby-grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) 432px;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 44px clamp(20px, 5vw, 72px) 30px;
}

.lobby-left > * {
  animation: rise .7s cubic-bezier(.2, .7, .2, 1) both;
}

.lobby-left > *:nth-child(2) { animation-delay: .06s; }
.lobby-left > *:nth-child(3) { animation-delay: .12s; }
.lobby-left > *:nth-child(4) { animation-delay: .18s; }
.lobby-left > *:nth-child(5) { animation-delay: .24s; }

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

.brandrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 44px;
}

.brand-icon-logo {
  color: var(--amber);
  font-size: 18px;
}

.wordmark {
  font: 700 14px var(--fu);
  letter-spacing: .42em;
  color: var(--ink);
}

.eyebrow {
  font: 600 11px var(--fm);
  letter-spacing: .22em;
  color: var(--amber2);
  margin-bottom: 18px;
}

h1 {
  font: 500 clamp(40px, 4.9vw, 74px)/1.03 var(--fd);
  letter-spacing: -.02em;
  max-width: 12ch;
}

h1 em {
  font-style: italic;
  color: var(--amber);
}

.lede {
  margin-top: 22px;
  font: 400 15.5px/1.65 var(--fu);
  color: var(--ink2);
  max-width: 54ch;
}

.ticks {
  list-style: none;
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 56ch;
}

.ticks li {
  display: flex;
  gap: 13px;
  font: 400 13.5px/1.55 var(--fu);
  color: var(--ink2);
}

.ticks b {
  color: var(--ink);
  font-weight: 600;
}

.ticks .lamp {
  margin-top: 6px;
}

.booth {
  position: relative;
  background: var(--bg1);
  border: 1px solid var(--line2);
  border-radius: 18px;
  padding: 30px 28px;
  animation: rise .7s .2s cubic-bezier(.2, .7, .2, 1) both;
}

.booth::before {
  content: '';
  position: absolute;
  inset: 9px;
  border: 1px dashed rgba(124, 109, 84, .35);
  border-radius: 11px;
  pointer-events: none;
}

.notch {
  position: absolute;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg0);
  border: 1px solid var(--line2);
  top: 50%;
  transform: translateY(-50%);
}

.notch.l { left: -14px; }
.notch.r { right: -14px; }

.booth-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 600 10.5px var(--fm);
  letter-spacing: .3em;
  color: var(--ink3);
  margin-bottom: 18px;
}

.booth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}

.booth-sub {
  font: 600 10px var(--fm);
  letter-spacing: .22em;
  color: var(--ink3);
}

#shuffle-avatars-btn, #refresh-avatars {
  height: 30px;
  padding: 0 11px;
  font-size: 10.5px;
  gap: 7px;
}

.avatar-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.avatar-opt {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg2);
  padding: 4px;
  cursor: pointer;
  transition: all .15s;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-opt:hover {
  border-color: var(--ink3);
  transform: translateY(-2px);
}

.avatar-opt.selected {
  border-color: var(--amber);
  box-shadow: 0 0 0 1px var(--amber), 0 6px 16px -6px rgba(240, 166, 58, .35);
}

.field-label {
  display: block;
  font: 600 10px var(--fm);
  letter-spacing: .22em;
  color: var(--ink3);
  margin: 0 0 8px;
}

#username {
  width: 100%;
  height: 48px;
  background: var(--bg0);
  border: 1px solid var(--line2);
  border-radius: 10px;
  color: var(--ink);
  font: 500 15px var(--fu);
  padding: 0 14px;
  transition: border-color .15s;
}

#username:focus {
  outline: none;
  border-color: var(--amber);
}

#create-room-btn {
  width: 100%;
  margin-top: 16px;
}

.or-rule {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0;
  color: var(--ink3);
  font: 600 10px var(--fm);
  letter-spacing: .2em;
}

.or-rule::before, .or-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

#codeBoxes {
  display: flex;
  gap: 7px;
  justify-content: center;
  margin-bottom: 16px;
}

.cdot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ink3);
  align-self: center;
  margin: 0 3px;
}

.codebox {
  width: 100%;
  max-width: 48px;
  height: 58px;
  text-align: center;
  font: 600 24px var(--fm);
  background: var(--bg0);
  border: 1px solid var(--line2);
  border-radius: 10px;
  color: var(--ink);
  caret-color: var(--amber);
  transition: border-color .15s;
  text-transform: uppercase;
}

.codebox:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(240, 166, 58, .14);
}

#join-room-btn {
  width: 100%;
}

.fineprint {
  margin-top: 16px;
  text-align: center;
  font: 500 9.5px var(--fm);
  letter-spacing: .18em;
  color: var(--ink3);
}

/* ============ ROOM ============ */
#chat-room, #room {
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

.room-header, #roomHead {
  height: 58px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg1);
}

.room-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hword {
  font: 700 12px var(--fu);
  letter-spacing: .34em;
  color: var(--ink2);
}

.hsep {
  width: 1px;
  height: 22px;
  background: var(--line2);
}

#nowShowing {
  flex: 1;
  min-width: 0;
  text-align: center;
  font: 600 10.5px var(--fm);
  letter-spacing: .16em;
  color: var(--ink3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#nowShowing.playing {
  color: var(--amber);
}

.participant-badge, #participant-count {
  font: 600 12px var(--fm);
}

.room-body, #roomBody {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 342px;
}

.chat-section {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #000;
}

.stage-wrapper {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#screen-share-video, #stageVideo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* Webcam Stage Grid (Both sides of player) */
.webcam-stage-grid {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  padding: 56px 14px 64px;
  pointer-events: none;
  z-index: 3;
  transition: opacity .2s ease;
}

.webcam-stage-grid.hidden {
  display: none !important;
}

.webcam-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 144px;
  max-height: 100%;
  overflow-y: auto;
  pointer-events: auto;
  scrollbar-width: none;
}

.webcam-column::-webkit-scrollbar {
  display: none;
}

.webcam-tile {
  width: 144px;
  height: 108px;
  border-radius: 10px;
  background: #111;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .7);
  border: 1.5px solid var(--amber);
  flex-shrink: 0;
  animation: tileSlideIn .25s ease forwards;
}

@keyframes tileSlideIn {
  from { opacity: 0; transform: scale(.9); }
  to { opacity: 1; transform: scale(1); }
}

.webcam-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.webcam-tile.local-tile video {
  transform: scaleX(-1);
}

.webcam-name {
  position: absolute;
  bottom: 5px;
  left: 5px;
  right: 5px;
  background: rgba(13, 11, 8, .75);
  backdrop-filter: blur(4px);
  color: var(--ink);
  font: 600 10.5px var(--fm);
  padding: 2px 6px;
  border-radius: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  border: 1px solid var(--line2);
}

.webcam-tile-controls {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 5px;
  z-index: 6;
  pointer-events: auto;
}

.webcam-tile-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line2);
  background: rgba(13, 11, 8, .8);
  backdrop-filter: blur(6px);
  color: var(--ink2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
  transition: all .15s ease;
}

.webcam-tile-btn:hover {
  background: var(--bg2);
  color: var(--ink);
  border-color: var(--amber);
  transform: scale(1.08);
}

.webcam-tile-btn.active {
  background: rgba(240, 166, 58, .2);
  color: var(--amber);
  border-color: var(--amber);
}

.webcam-tile-btn.active-mic {
  background: rgba(16, 185, 129, .2);
  color: var(--ok);
  border-color: var(--ok);
}

:fullscreen .webcam-tile-btn,
:-webkit-full-screen .webcam-tile-btn {
  width: 32px;
  height: 32px;
  font-size: 13px;
}

:fullscreen .webcam-stage-grid,
:-webkit-full-screen .webcam-stage-grid {
  padding: 64px 24px 84px;
}

:fullscreen .webcam-column,
:-webkit-full-screen .webcam-column {
  width: 180px;
  gap: 12px;
}

:fullscreen .webcam-tile,
:-webkit-full-screen .webcam-tile {
  width: 180px;
  height: 135px;
  border-radius: 12px;
}

:fullscreen .webcam-name,
:-webkit-full-screen .webcam-name {
  font-size: 11.5px;
  padding: 3px 8px;
}

.stage-top {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  pointer-events: none;
  z-index: 3;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 10.5px var(--fm);
  letter-spacing: .1em;
  padding: 7px 11px;
  border: 1px solid var(--line2);
  border-radius: 7px;
  background: rgba(13, 11, 8, .74);
  backdrop-filter: blur(8px);
  color: var(--ink2);
}

.badge.live {
  color: var(--amber);
  border-color: rgba(240, 166, 58, .45);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  animation: breath 1.4s ease-in-out infinite;
}

.overlay-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  background: var(--bg0);
  z-index: 2;
}

.overlay-center.hidden {
  display: none !important;
}

.se-eyebrow {
  font: 600 10.5px var(--fm);
  letter-spacing: .34em;
  color: var(--amber2);
  margin: 20px 0 12px;
}

.se-title {
  font: 500 clamp(26px, 3vw, 40px)/1.15 var(--fd);
  letter-spacing: -.01em;
}

.se-sub {
  margin: 12px auto 24px;
  font: 400 13.5px/1.6 var(--fu);
  color: var(--ink2);
  max-width: 46ch;
}

.se-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.se-urlrow {
  display: flex;
  gap: 9px;
  margin: 18px auto 0;
  max-width: 560px;
}

.se-urlrow input {
  flex: 1;
  height: 44px;
  background: var(--bg0);
  border: 1px solid var(--line2);
  border-radius: 10px;
  color: var(--ink);
  font: 500 13.5px var(--fu);
  padding: 0 14px;
  min-width: 0;
}

.se-urlrow input:focus {
  outline: none;
  border-color: var(--amber);
}

/* Movie / Stage Transport Bar */
.transport-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  background: rgba(13, 11, 8, .8);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}

.tp {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.tp-common {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mono-t {
  font: 600 11.5px var(--fm);
  letter-spacing: .06em;
  color: var(--ink2);
  white-space: nowrap;
}

/* Sidebar & Chat */
.participants-sidebar, #side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 1px solid var(--line);
  background: var(--bg1);
  width: 342px;
}

.sidebar-header, .panel-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 14px 9px;
  font: 600 10px var(--fm);
  letter-spacing: .26em;
  color: var(--ink3);
}

.sidebar-participants, #sidebar-participants-list {
  overflow-y: auto;
  list-style: none;
  padding: 4px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
}

.sidebar-participant-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg2);
}

.sidebar-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
}

.sidebar-participant-name {
  font: 500 13px var(--fu);
  color: var(--ink);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============ WHATSAPP-STYLE MINIMAL CHAT ============ */
.messages-container, #chatLog {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg0);
}

.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  max-width: 84%;
  margin: 2px 0;
}

.msg-row.outgoing {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-row.incoming {
  align-self: flex-start;
}

/* Strict 26px circle avatar only for incoming messages */
.msg-avatar-tiny,
.messages-container img,
#chatLog img {
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  min-height: 26px !important;
  max-width: 26px !important;
  max-height: 26px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  flex: none !important;
  display: block !important;
  border: 1px solid rgba(240, 166, 58, 0.25) !important;
  margin-bottom: 2px !important;
}

.msg-row.outgoing .msg-avatar-tiny {
  display: none !important;
}

.msg-bubble {
  position: relative;
  padding: 6px 9px 4px 10px;
  font: 400 13.5px/1.4 var(--fu);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .4);
  word-break: break-word;
  display: inline-block;
}

.msg-row.incoming .msg-bubble {
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: 10px 10px 10px 2px;
  color: var(--ink);
}

.msg-row.outgoing .msg-bubble {
  background: #2b2012;
  border: 1px solid rgba(240, 166, 58, .35);
  border-radius: 10px 10px 2px 10px;
  color: #f7eedf;
}

.msg-sender-name {
  font: 700 11px var(--fm);
  color: var(--amber);
  margin-bottom: 2px;
  letter-spacing: .02em;
  display: block;
}

.msg-text-content {
  display: inline;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.msg-timestamp {
  display: inline-block;
  font: 500 9.5px var(--fm);
  color: var(--ink3);
  margin-left: 10px;
  margin-top: 3px;
  float: right;
  vertical-align: bottom;
  letter-spacing: .03em;
  user-select: none;
}

.msg-row.outgoing .msg-timestamp {
  color: rgba(240, 166, 58, .75);
}

.system-message {
  align-self: center;
  margin: 6px 0;
  padding: 3px 12px;
  border-radius: 10px;
  background: rgba(44, 38, 28, .5);
  border: 1px solid var(--line);
  font: 500 10px var(--fm);
  color: var(--ink3);
  letter-spacing: .05em;
  text-align: center;
}

.message-bar, #chatForm {
  flex: none;
  display: flex;
  gap: 8px;
  padding: 11px 12px;
  border-top: 1px solid var(--line);
  background: var(--bg1);
}

.message-input-field, #chatInput {
  flex: 1;
  min-width: 0;
  height: 40px;
  background: var(--bg0);
  border: 1px solid var(--line2);
  border-radius: 9px;
  color: var(--ink);
  font: 400 13.5px var(--fu);
  padding: 0 12px;
}

.message-input-field:focus, #chatInput:focus {
  outline: none;
  border-color: var(--amber);
}

/* Modals & Toasts */
.toast-container, #toasts {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(348px, calc(100vw - 28px));
}

.toast {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: 13px;
  padding: 13px 14px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .5);
  animation: tin .28s cubic-bezier(.2, .9, .3, 1.2);
}

@keyframes tin {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
}

.modal-overlay, #modal, #brokerModal, #wtModal, #join-request-modal, #join-waiting-modal, #video-source-modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(13, 11, 8, .7);
  backdrop-filter: blur(5px);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-card, .m-panel {
  width: min(420px, 100%);
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  animation: tin .2s ease;
}

.modal-title, .m-panel h3 {
  font: 500 22px var(--fd);
  letter-spacing: -.01em;
  color: var(--ink);
}

.modal-desc, .m-panel p {
  margin: 10px 0 14px;
  font: 400 13px/1.6 var(--fu);
  color: var(--ink2);
  text-align: left;
}

.approval-user-info {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 16px 0;
  text-align: left;
}

.approval-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--amber);
}

.waiting-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--line2);
  border-top-color: var(--amber);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 1020px) {
  .lobby-grid {
    grid-template-columns: 1fr;
    align-content: start;
    gap: 36px;
    padding-top: 36px;
  }

  .booth {
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
  }

  .room-body, #roomBody {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(300px, 52vh) minmax(0, 1fr);
  }

  .participants-sidebar, #side {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--line);
  }
}
