:root {
  --bg: #fff7eb;
  --paper: #fffdf8;
  --ink: #211b2b;
  --muted: #6f6573;
  --line: #e8d7c9;
  --rose: #d94f78;
  --rose-dark: #8b2947;
  --navy: #20284f;
  --yellow: #f2c94c;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 5%, rgba(242,201,76,.24), transparent 30rem),
    radial-gradient(circle at 90% 20%, rgba(217,79,120,.15), transparent 32rem),
    var(--bg);
}
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.shell { width: min(920px, calc(100% - 32px)); margin-inline: auto; }
.join-view { min-height: 100vh; display: grid; align-content: center; padding: 48px 0; }
.eyebrow { margin: 0 0 12px; color: var(--rose-dark); font-size: .76rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; font: 700 clamp(3.4rem, 10vw, 7.5rem)/.88 Georgia, serif; letter-spacing: -.055em; }
h1 em { color: var(--rose); font-weight: 500; }
.lead { margin: 22px 0 30px; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.25rem); }

.join-card { width: min(620px, 100%); padding: clamp(20px, 4vw, 30px); border: 1px solid var(--line); border-radius: 24px; background: rgba(255,253,248,.9); box-shadow: 0 18px 60px rgba(80,45,62,.1); }
.join-card > label:first-child { display: block; margin-bottom: 7px; font-size: .84rem; font-weight: 850; }
.room-field { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.room-field input { min-width: 0; padding: 14px; border: 1px solid #cfbdb1; border-radius: 13px; background: white; color: var(--ink); }
.room-field input:focus { outline: 3px solid rgba(217,79,120,.2); border-color: var(--rose); }
.consent { display: flex; gap: 11px; align-items: flex-start; margin: 22px 0; color: var(--muted); line-height: 1.45; }
.consent input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--rose); }

.button { border: 0; border-radius: 13px; padding: 12px 16px; font-weight: 850; }
.button:disabled { cursor: not-allowed; opacity: .48; }
.button.primary { color: white; background: var(--navy); }
.button.secondary { color: var(--ink); background: white; border: 1px solid var(--line); }
.button.danger { color: white; background: var(--rose-dark); }
.button.wide { width: 100%; }
.status { color: var(--muted); font-size: .84rem; }
.join-card .status { margin: 12px 0 0; text-align: center; }

.room-view { min-height: 100vh; padding-bottom: 50px; }
.room-bar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; background: rgba(255,247,235,.96); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.room-bar div { min-width: 0; }
.room-bar span { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; font-weight: 850; }
.room-bar strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.invite-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 24px 0 14px; }
.video-grid { min-height: 62vh; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 12px; align-content: center; border-radius: 22px; padding: 12px; background: #181929; overflow: hidden; }
.empty-room { color: #d9d8e6; text-align: center; }
.video-tile { position: relative; min-height: 260px; overflow: hidden; border-radius: 14px; background: #25263b; }
.video-tile video { width: 100%; height: 100%; display: block; object-fit: cover; }
.video-tile span { position: absolute; left: 10px; bottom: 10px; padding: 5px 8px; border-radius: 8px; color: white; background: rgba(0,0,0,.6); font-size: .78rem; }
.media-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding-top: 14px; }
.jitsi-container { height: calc(100vh - 150px); min-height: 520px; overflow: hidden; border-radius: 20px; background: #171717; }
.jitsi-container iframe { display: block; width: 100%; height: 100%; }

@media (max-width: 600px) {
  .shell { width: min(100% - 22px, 920px); }
  .room-field { grid-template-columns: 1fr; }
  .join-view { padding: 30px 0; }
  .room-bar { padding: 10px 0; }
  .invite-row { align-items: stretch; flex-direction: column; }
  .jitsi-container { min-height: 440px; height: calc(100vh - 170px); }
}
