:root {
  color-scheme: dark;
  font: 16px/1.45 "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --ink: #171d19;
  --basalt: #202421;
  --fog: #f1f2e9;
  --sage: #d3dbb6;
  --line: #ffffff3d;
  --split: 43%;
  background: var(--basalt);
  color: var(--fog);
}
* { box-sizing: border-box; }
[hidden], .symbols { display: none !important; }
body { margin: 0; min-height: 100vh; min-height: 100svh; display: grid; align-content: center; padding: max(24px,env(safe-area-inset-top)) max(4vw,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(4vw,env(safe-area-inset-left)); isolation: isolate; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: linear-gradient(180deg,#141c1730,#141c1712 48%,#10161080), url("/highlands.webp") center 48% / cover no-repeat; }
.shell { width: min(1120px,100%); margin: auto; }
header, footer, .heading, nav { display: flex; align-items: center; gap: 12px; }
header { justify-content: space-between; padding: 12px clamp(16px,3vw,34px); color: var(--ink); background: #e3e5dadb; backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 9px; font-size: 24px; font-weight: 650; letter-spacing: -.065em; }
svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.brand svg { width: 24px; height: 24px; }
main { background: #151a16ed; position: relative; }
.heading { padding: 12px clamp(16px,3vw,34px); border-bottom: 1px solid var(--line); }
h1 { margin: 0; font-size: clamp(18px,2.1vw,25px); letter-spacing: -.04em; font-weight: 550; }
#phase { display: flex; align-items: center; gap: 7px; margin-left: auto; font-size: 12px; color: #dde1d6; }
#phase::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--sage); }
.stage { position: relative; display: grid; grid-template-columns: minmax(0,var(--split)) minmax(0,1fr); isolation: isolate; background: linear-gradient(0deg,#10151080,transparent 58%), url("/highlands.webp") center 51% / cover; }
#lobby { background: linear-gradient(150deg,#333d36c4,#222b24c9); backdrop-filter: blur(18px); padding: clamp(125px,12vw,165px) clamp(20px,3.8vw,54px) 28px; border-right: 1px solid var(--line); }
.mast { position: absolute; inset: 0 0 auto; display: grid; grid-template-columns: var(--split) 1fr; pointer-events: none; z-index: 1; font: 250 clamp(94px,12vw,168px)/.93 "Segoe UI Light","Helvetica Neue",Arial,sans-serif; letter-spacing: -.084em; }
.mast span:first-child { text-align: right; padding-right: .07em; color: #e4e6dcb8; }
.mast span:last-child { padding: .35em 0 0 .025em; color: #fafbf2; text-shadow: 0 2px 25px #20272255; }
button, input { font: inherit; }
button { min-height: 44px; cursor: pointer; border: 1px solid var(--line); border-radius: 5px; background: transparent; color: inherit; padding: 8px 14px; font-size: 14px; }
button:hover { background-color: #ffffff12; }
button:disabled { opacity: .58; cursor: default; }
button:focus-visible, input:focus-visible { outline: 3px solid #e1efac; outline-offset: 3px; }
#install, nav button { display: inline-flex; gap: 8px; align-items: center; justify-content: center; }
#install { border-color: #222c244d; }
#install:hover { background: #ffffff4d; }
.tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { padding: 6px 0; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: #e2e4da; }
.tabs button[aria-pressed=true] { border-color: var(--sage); font-weight: 650; color: #fff; }
label { display: block; margin-bottom: 6px; font-weight: 550; font-size: 14px; }
input { width: 100%; padding: 11px 12px; border: 1px solid #ccd4c480; border-radius: 4px; background: #151c18a8; color: white; }
input::placeholder { color: #c0c6bd; }
#roomField { margin-bottom: 12px; }
#hint, dialog p { font-size: 14px; line-height: 1.55; }
#hint { margin: 10px 0 18px; color: #e2e7db; }
.primary { width: 100%; background: var(--fog); color: var(--ink); border: none; font-weight: 650; }
.primary:hover { background: var(--sage); }
.tile { position: relative; overflow: hidden; min-height: 265px; display: grid; place-items: center; }
.placeholder { display: grid; justify-items: center; gap: 10px; }
.placeholder strong { font-size: 14px; font-weight: 550; }
.self .placeholder { position: absolute; bottom: 24px; right: 22px; display: flex; gap: 7px; }
.self .placeholder, .tag { color: #f5f6ef; padding: 6px 11px; background: #172019dd; border-radius: 4px; }
.self .placeholder svg { width: 15px; }
.avatar { font-size: 32px; }
.tag { position: absolute; bottom: 24px; left: 20px; font-size: 12px; }
.tag b { color: var(--sage); }
video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #111512; visibility: hidden; }
video.visible { visibility: visible; }
#local { transform: scaleX(-1); }
#local.screen { transform: none; }
.stage:has(video.visible) .mast, .in-call .mast { display: none; }
.stage:has(#local.visible) #lobby { padding-top: 40px; }
nav { flex-wrap: wrap; padding: 12px clamp(16px,3vw,34px); gap: 8px; border-top: 1px solid var(--line); }
nav button { color: #eceee4; }
nav button[aria-pressed=true] { color: #e2edc7; background: #85987129; border-color: #adb99f91; }
.danger { margin-left: auto; background: #763f3c; }
#notice { margin: 0; padding: 0 clamp(16px,3vw,34px) 10px; font-size: 14px; }
#notice:empty { padding: 0; }
footer { justify-content: space-between; background: #19201bea; border-top: 1px solid var(--line); padding: 9px clamp(16px,3vw,34px); font-size: 12px; color: #cbd2c8; }
.in-call .stage { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; background: #637062; }
.in-call .tile { min-height: clamp(240px,36vw,460px); background: #29312d; }
.in-call .self { background: #30362e; }
.in-call .self .placeholder { position: static; background: transparent; }
dialog { max-width: min(405px,90%); padding: 24px; background: var(--basalt); color: var(--fog); border: 1px solid var(--line); border-radius: 8px; }
dialog::backdrop { background: #121812b8; }
dialog h2 { margin-top: 0; }
@media(max-width:820px) { .self .placeholder { bottom: 58px; left: 18px; right: auto; } }
@media(max-width:620px) and (orientation:portrait) {
  body { padding-inline: max(10px,env(safe-area-inset-left)) max(10px,env(safe-area-inset-right)); padding-block: max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-bottom)); }
  header { padding-block: 7px; }
  .stage { grid-template-columns: minmax(0,1fr); }
  .mast { grid-template-columns: 43% 1fr; font-size: 83px; }
  .mast span:last-child { padding-top: .18em; }
  #lobby { padding: 92px 20px 20px; border-right: 0; background: linear-gradient(90deg,#28322ada 43%,#28322aa6 43%); backdrop-filter: blur(5px); }
  .self { min-height: 125px; }
  .self .placeholder { left: auto; right: 12px; bottom: 14px; }
  .tag { left: 10px; bottom: 14px; }
  nav { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); padding: 10px; }
  nav button { padding: 5px; font-size: 13px; }
  .danger { margin: 0; }
  .in-call .stage { grid-template-columns: 1fr; }
  .in-call .tile { min-height: clamp(150px,24svh,230px); }
  .in-call .heading { flex-wrap: wrap; }
  .in-call #phase { display: none; }
  footer { gap: 6px; font-size: 11px; }
}
@media(max-width:370px) { .self .placeholder strong { font-size: 12px; } .self .placeholder { bottom: 52px; } }
@media(max-height:500px) and (orientation:landscape) {
  body { padding: 8px max(16px,env(safe-area-inset-left)); }
  .mast { font-size: 74px; }
  #lobby { padding-top: 74px; }
  .in-call .tile { min-height: 155px; }
}
@media(display-mode:standalone) { #install { display: none; } }
