/* Degenerate Hangout: dark graffiti wall, neon spray colors. Everything is CSS/SVG so it stays sharp at 4K and loads fast. */
:root {
  --bg: #0b0b10; --panel: rgba(22, 22, 32, .9); --line: rgba(255, 255, 255, .09);
  --text: #f4f4fa; --muted: #a3a3b8;
  --pink: #ff2e88; --green: #39ff14; --cyan: #00e5ff; --yellow: #ffe600; --orange: #ff7a00; --purple: #b388ff; --red: #ff3b3b;
  --graf: 'Sedgwick Ave Display', 'Permanent Marker', cursive;
  --font: 'Rubik', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 18px; --top: calc(74px + env(safe-area-inset-top, 0px));
}
* { box-sizing: border-box; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
body.inchat { overscroll-behavior-y: contain; } /* a pull-down shouldn't reload the page and end the chat */
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 400 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--cyan); }
button, input { font: inherit; color: inherit; }
svg { flex: none; }

.wall { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40vmax 30vmax at 8% 6%, rgba(255, 46, 136, .20), transparent 60%),
    radial-gradient(36vmax 28vmax at 95% 18%, rgba(0, 229, 255, .16), transparent 60%),
    radial-gradient(40vmax 30vmax at 85% 95%, rgba(57, 255, 20, .12), transparent 60%),
    radial-gradient(34vmax 26vmax at 10% 90%, rgba(179, 136, 255, .16), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60'%3E%3Cpath d='M0 .5H120M0 30.5H120M.5 0V30M60.5 30V60' stroke='%23fff' stroke-opacity='.05' fill='none'/%3E%3C/svg%3E"),
    linear-gradient(#101017, #0a0a0f); }

/* ---------- header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: var(--top); padding: env(safe-area-inset-top, 0px) max(clamp(14px, 3vw, 40px), env(safe-area-inset-right, 0px)) 0 max(clamp(14px, 3vw, 40px), env(safe-area-inset-left, 0px)); position: sticky; top: 0; z-index: 20; background: linear-gradient(rgba(11, 11, 16, .94), rgba(11, 11, 16, .7)); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.logo { position: relative; display: inline-flex; gap: .3em; align-items: baseline; text-decoration: none; padding-bottom: 10px; }
.tag { font: 400 clamp(24px, 3.2vw, 42px)/1 var(--graf); background: linear-gradient(95deg, var(--pink), var(--yellow) 55%, var(--orange)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 10px rgba(255, 46, 136, .45)); transform: rotate(-2deg); }
.tag2 { background-image: linear-gradient(95deg, var(--cyan), var(--green)); filter: drop-shadow(0 0 10px rgba(0, 229, 255, .45)); transform: rotate(1.5deg) translateY(3px); }
.drips { position: absolute; left: 4%; bottom: 0; height: 12px; width: 92%; fill: var(--pink); opacity: .85; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 99px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); font-size: 14px; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }

/* ---------- buttons ---------- */
.btn { --c: var(--pink); display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px; padding: 12px 20px; font-weight: 800; letter-spacing: .3px; cursor: pointer; color: #0b0b10; background: var(--c); box-shadow: 0 0 0 2px rgba(0, 0, 0, .35) inset, 0 6px 22px -6px var(--c); transition: transform .12s, filter .12s; text-decoration: none; white-space: nowrap; }
.btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn:active { transform: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn svg { width: 22px; height: 22px; }
.btn.pink { --c: var(--pink); color: #fff; } .btn.cyan { --c: var(--cyan); } .btn.green { --c: var(--green); }
.btn.ghost { --c: transparent; color: var(--text); background: rgba(255, 255, 255, .06); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover { background: rgba(255, 255, 255, .11); }
.btn.sm { padding: 8px 14px; font-size: 14px; border-radius: 11px; }
.btn.big { padding: 18px 34px; font-size: 20px; border-radius: 18px; font-family: var(--graf); font-weight: 400; letter-spacing: 1px; }
kbd { font: 700 11px var(--font); padding: 2px 6px; border-radius: 6px; background: rgba(0, 0, 0, .25); }

/* ---------- home ---------- */
#home { max-width: 1000px; margin: 0 auto; padding: 0 clamp(14px, 3vw, 32px) 30px; }
.hero { text-align: center; padding: clamp(30px, 9vh, 100px) 0 30px; }
.hero h1 { margin: 0; font: 800 clamp(34px, 5.6vw, 72px)/1.05 var(--font); letter-spacing: -1px; }
.spray { font-family: var(--graf); font-weight: 400; letter-spacing: 1px; background: linear-gradient(90deg, var(--green), var(--cyan) 45%, var(--purple) 75%, var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 14px rgba(57, 255, 20, .3)); }
.sub { color: var(--muted); font-size: clamp(16px, 1.6vw, 20px); margin: 14px auto 26px; max-width: 620px; }
.start { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.soon { margin: 16px auto 0; max-width: 520px; padding: 10px 14px; border: 1px solid var(--yellow); border-radius: 14px; background: rgba(255, 230, 0, .07); }
.soon[hidden] { display: none; }
.soon b { color: var(--yellow); }
body.prelaunch [data-start] { filter: saturate(.55) brightness(.8); }
body.prelaunch [data-start]::after { content: 'Coming soon'; font: 800 11px/1 var(--font); letter-spacing: .3px; color: var(--yellow); background: #0b0b10; padding: 5px 8px; border-radius: 8px; }
body.prelaunch #saved { display: none; }
.agree { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 18px; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.agree input { width: 20px; height: 20px; accent-color: var(--green); }
.agree.shake { animation: shake .4s; color: var(--yellow); }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 20px; }
.card { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); }
.card svg { width: 30px; height: 30px; color: var(--cyan); }
.card:nth-child(1) svg { color: var(--pink); } .card:nth-child(3) svg { color: var(--green); }
.card b { font-size: 18px; } .card span { color: var(--muted); font-size: 14px; }
.foot { text-align: center; color: var(--muted); font-size: 14px; margin-top: 30px; }
.ad:empty { display: none; }
.ad { margin: 18px auto 0; text-align: center; max-width: 100%; overflow: hidden; }

/* ---------- chat layout ---------- */
#chat { display: grid; grid-template-columns: minmax(0, 1fr) clamp(320px, 30vw, 440px); gap: 14px; height: calc(100vh - var(--top)); height: calc(100dvh - var(--top)); padding: 0 14px 14px; }
.stage { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.vids { position: relative; flex: 1; min-height: 0; }
.vid { position: relative; border-radius: var(--r); overflow: hidden; background: #050508; border: 1px solid var(--line); }
.vid video { width: 100%; height: 100%; object-fit: cover; display: block; background: #050508; }
.remote { position: absolute; inset: 0; }
.local { position: absolute; right: 14px; bottom: 14px; width: clamp(120px, 22%, 260px); aspect-ratio: 4 / 3; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); z-index: 2; }
.local video { transform: scaleX(-1); }
.local.back video { transform: none; }
video.blur { filter: blur(40px) saturate(.4); }
.over { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 20px; background: rgba(5, 5, 8, .72); z-index: 1; }
.over b { font-size: 20px; } .over span { color: var(--muted); max-width: 360px; }
.spin { width: 54px; height: 54px; border-radius: 50%; border: 5px solid rgba(255, 255, 255, .12); border-top-color: var(--pink); border-right-color: var(--cyan); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* the shared browser can live big in the stage (text mode, or "make bigger") */
.slot { display: none; flex: 1; min-height: 0; }
.slothint { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; border: 2px dashed var(--line); border-radius: var(--r); color: var(--muted); padding: 20px; }
.slothint svg { width: 44px; height: 44px; color: var(--green); } .slothint b { color: var(--text); font-size: 20px; }
.stage.text .vids { display: none; }
.stage.text .slot, .stage.wide .slot { display: flex; }
.stage.hasb .slothint { visibility: hidden; }
.stage.wide .vids { flex: 0 0 auto; height: 26%; display: flex; gap: 10px; }
.stage.wide .remote, .stage.wide .local { position: relative; inset: auto; right: auto; bottom: auto; width: auto; height: 100%; aspect-ratio: 4 / 3; }
#chat { position: relative; }
.browser.float { position: absolute; z-index: 4; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 8px; }
.browser.float .frame { flex: 1; aspect-ratio: auto; }
.browser.float .note { display: none; }

.controls { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
.stage.text .controls #micBtn, .stage.text .controls #camBtn, .stage.text .controls #flipBtn { display: none; }
.cbtn { width: 48px; height: 48px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .07); display: grid; place-items: center; cursor: pointer; }
.cbtn svg { width: 22px; height: 22px; }
.cbtn:hover { background: rgba(255, 255, 255, .13); }
.cbtn.off { background: rgba(255, 59, 59, .25); border-color: var(--red); }
.cbtn.red { color: var(--red); }

/* ---------- side: link box + chat ---------- */
.side { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.linkbox { display: flex; flex-direction: column; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }
#linkForm { display: flex; align-items: center; gap: 8px; }
.lic { width: 20px; height: 20px; color: var(--green); }
#linkForm input, .msgform input { flex: 1; min-width: 0; background: #15151e; border: 1px solid var(--line); border-radius: 11px; padding: 9px 12px; }
#linkForm input:focus, .msgform input:focus { outline: 2px solid var(--cyan); outline-offset: -1px; }
.offer, .wait { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 12px; background: rgba(57, 255, 20, .08); border: 1px solid rgba(57, 255, 20, .4); font-size: 15px; }
.offer > div { display: flex; gap: 8px; }
.wait { background: rgba(255, 255, 255, .04); border-color: var(--line); color: var(--muted); }
.browser { display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.bar { display: flex; align-items: center; gap: 4px; }
.addr { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 99px; background: #15151e; border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.addr svg { width: 13px; height: 13px; color: var(--green); }
.addr span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ibtn { width: 34px; height: 34px; border-radius: 10px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--text); }
.ibtn:hover { background: rgba(255, 255, 255, .1); }
.ibtn svg { width: 18px; height: 18px; }
.frame { position: relative; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; background: #fff; }
.frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.noframe { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; text-align: center; padding: 20px; background: #15151e; color: var(--muted); }
.noframe b { color: var(--text); }
.note { margin: 0; font-size: 12px; color: var(--muted); }

.chatbox { flex: 1; min-height: 160px; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.m { max-width: 86%; padding: 8px 12px; border-radius: 14px; word-wrap: break-word; white-space: pre-wrap; }
.m.me { background: #143440; } .m.them { background: #3a1a31; } /* for older phones without color-mix */
.m.me { align-self: flex-end; background: color-mix(in srgb, var(--cyan) 22%, #15151e); border-bottom-right-radius: 4px; }
.m.them { align-self: flex-start; background: color-mix(in srgb, var(--pink) 20%, #15151e); border-bottom-left-radius: 4px; }
.m.sys { align-self: center; background: none; color: var(--muted); font-size: 14px; text-align: center; }
.m.sys.keep { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text); background: rgba(57, 255, 20, .08); border: 1px solid rgba(57, 255, 20, .35); border-radius: 14px; padding: 10px 12px; max-width: 100%; }
.m.sys.keep.guest { border-color: var(--yellow); background: rgba(255, 230, 0, .07); }
.m.sys.keep.guest b { color: var(--yellow); }
.keepbtns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.m.sys.keep code { font-size: 12px; color: var(--muted); word-break: break-all; }
.saved { margin: 22px auto 0; width: min(520px, 100%); text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.saved[hidden] { display: none; }
.saved .muted { font-size: 13px; }
.saved ul { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.saved li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.saved li span { flex: 1; min-width: 150px; }
.typing { padding: 0 14px 6px; color: var(--muted); font-size: 13px; }
.msgform { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.emojibtn { flex: none; width: 40px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255, 255, 255, .06); font-size: 20px; line-height: 1; cursor: pointer; padding: 0; }
.emojibtn:hover, .emojibtn[aria-expanded="true"] { background: rgba(255, 255, 255, .12); border-color: var(--cyan); }
.emojis { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 2px; max-height: 168px; overflow-y: auto; padding: 8px 10px; border-top: 1px solid var(--line); background: #12121a; }
.emojis[hidden] { display: none; }
.emojis button { border: 0; background: none; font-size: 22px; line-height: 1; padding: 7px 0; border-radius: 9px; cursor: pointer; }
.emojis button:hover, .emojis button:focus-visible { background: rgba(255, 255, 255, .1); outline: none; }

/* ---------- modals, toast, ban ---------- */
.modal { border: 1px solid var(--line); border-radius: var(--r); background: #15151e; color: var(--text); padding: 22px; width: min(420px, 92vw); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; }
.modal::backdrop { background: rgba(0, 0, 0, .65); }
.modal h3 { margin: 0 0 6px; }
.muted { color: var(--muted); }
.reasons { display: grid; gap: 8px; margin: 14px 0; }
.reasons button { text-align: left; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); cursor: pointer; }
.reasons button:hover { border-color: var(--red); background: rgba(255, 59, 59, .12); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; background: #1d1d29; border: 1px solid var(--line); padding: 12px 18px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); max-width: 92vw; text-align: center; }
.banned { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; background: var(--bg); }

/* ---------- header account buttons ---------- */
.right, .account { display: flex; align-items: center; gap: 10px; }
.btn svg + i.badge, .badge { font-style: normal; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--pink); color: #fff; font-size: 12px; line-height: 20px; text-align: center; }
body.inchat .account { display: none; }

/* ---------- coin box on the home page ---------- */
#home { position: relative; }
.coinbox { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: var(--r); background: var(--panel); border: 1px solid rgba(255, 230, 0, .55); box-shadow: 0 0 22px -8px var(--yellow); }
.coinbox b { font: 400 22px/1.1 var(--graf); color: var(--yellow); letter-spacing: .5px; }
.coinbox span { color: var(--muted); font-size: 14px; line-height: 1.4; }
@media (min-width: 1100px) { .coinbox { position: fixed; top: calc(var(--top) + 18px); right: clamp(14px, 3vw, 40px); width: 230px; z-index: 5; } }
@media (max-width: 1099px) { .coinbox { margin-top: 14px; text-align: center; } }

/* ---------- ad spaces: dashed boxes only appear while testing locally ---------- */
.ad.ph { display: flex; align-items: center; justify-content: center; border: 2px dashed rgba(255, 255, 255, .22); border-radius: 12px; color: var(--muted); font-size: 13px; min-height: 90px; width: 728px; }
.ad.ph[data-ad="rail"] { width: 300px; height: 250px; flex: none; margin: 0 auto; }
@media (max-height: 820px) { .side .ad { display: none; } }
.ad[data-ad="homeside"] { position: absolute; left: -185px; top: 30px; width: 160px; margin: 0; }
.ad.ph[data-ad="homeside"] { height: 600px; }
.ad[data-ad="waiting"], .ad[data-ad="textchat"] { margin: 6px auto 0; }
.ad.ph[data-ad="waiting"], .ad.ph[data-ad="textchat"] { width: 300px; height: 250px; flex: none; }
.ad[data-ad="chat"] { flex: none; margin: 0 auto; }
.ad.ph[data-ad="chat"] { height: 90px; min-height: 0; }
@media (max-width: 1419px) { .ad[data-ad="homeside"] { display: none; } }
@media (max-width: 900px), (max-height: 819px) { .ad[data-ad="chat"] { display: none; } }
@media (max-width: 900px), (max-height: 599px) { .ad[data-ad="textchat"] { display: none; } }
@media (max-height: 739px) { .ad[data-ad="waiting"] { display: none; } }

/* ---------- friends & groups page ---------- */
#social { max-width: 1100px; margin: 0 auto; padding: 8px clamp(14px, 3vw, 32px) 30px; }
.shead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.shead h2 { margin: 0; flex: 1; font-size: clamp(22px, 3vw, 30px); }
.scols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 14px; align-items: start; }
.spanel { display: flex; flex-direction: column; gap: 12px; padding: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.spanel h3 { margin: 0; font-size: 20px; }
.small { font-size: 13px; margin: 0; }
.inline { display: flex; gap: 8px; }
.joinlink { display: flex; flex-direction: column; gap: 4px; }
.inline input, .fld input, #reportWho, .invite select, .invite input { flex: 1; min-width: 0; background: #15151e; border: 1px solid var(--line); border-radius: 11px; padding: 9px 12px; color: var(--text); font: inherit; }
.inline input:focus, .fld input:focus { outline: 2px solid var(--cyan); outline-offset: -1px; }
#newGroup { display: flex; flex-direction: column; gap: 8px; }
.picks { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; }
.picks label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.picks input { width: 17px; height: 17px; accent-color: var(--pink); }
.list { display: flex; flex-direction: column; gap: 8px; }
.list:empty { display: none; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 12px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.row.ask { background: rgba(57, 255, 20, .08); border-color: rgba(57, 255, 20, .4); }
.row > b { flex: 1; min-width: 90px; overflow-wrap: anywhere; font-weight: 600; }
.acts { display: flex; gap: 6px; flex-wrap: wrap; }
.btn.tiny { padding: 6px 10px; font-size: 13px; border-radius: 9px; }
.dot.off { background: #55556a; box-shadow: none; }
.gcard { display: flex; flex-direction: column; gap: 9px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.ghead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ghead b { flex: 1; min-width: 100px; font-size: 17px; overflow-wrap: anywhere; }
.livetag { font-size: 12px; font-weight: 800; color: #0b0b10; background: var(--green); padding: 2px 8px; border-radius: 99px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: rgba(255, 255, 255, .07); font-size: 13px; }
.chip button { border: 0; background: none; padding: 0; cursor: pointer; color: var(--muted); line-height: 1; }
.chip button:hover { color: var(--red); }
.invite { display: flex; gap: 6px; }
.nothing { color: var(--muted); font-size: 14px; margin: 0; }

/* ---------- log in form ---------- */
#authForm { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.fld { display: flex; flex-direction: column; gap: 5px; font-size: 14px; color: var(--muted); }
#authSignup { display: flex; flex-direction: column; gap: 10px; }
.agree.left { justify-content: flex-start; margin: 0; }
.formerr { margin: 0; color: var(--red); font-size: 14px; }
.formrow { display: flex; gap: 8px; }
#reportWho { width: 100%; margin-top: 10px; }

/* ---------- incoming calls and friend requests ---------- */
.rings { position: fixed; top: calc(var(--top) + 8px); left: 50%; transform: translateX(-50%); z-index: 45; display: flex; flex-direction: column; gap: 8px; width: min(420px, 94vw); }
.ring { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 14px; background: #1d1d29; border: 1px solid var(--green); box-shadow: 0 10px 30px rgba(0, 0, 0, .6); }
.ring div { display: flex; gap: 8px; }

/* ---------- group calls ---------- */
.stage.room #nextBtn, .stage.room #addFriendBtn { display: none; }
.vids.grid { display: grid; gap: 8px; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); }
.vids.grid .remote { display: none; }
.vids.grid .local { position: relative; inset: auto; right: auto; bottom: auto; width: auto; aspect-ratio: auto; box-shadow: none; }
.vids.grid .vid { min-height: 0; }
.vids.grid .vid video { position: absolute; inset: 0; }
.tname { position: absolute; left: 8px; bottom: 8px; z-index: 2; padding: 2px 9px; border-radius: 99px; background: rgba(0, 0, 0, .6); font-size: 13px; }
.tname.you { display: none; }
.vids.grid .tname.you { display: block; }
.stage.wide .vids.grid { display: flex; }
.stage.wide .vids.grid .peer, .stage.wide .vids.grid .local { height: 100%; aspect-ratio: 4 / 3; flex: none; }

/* ---------- report link and the guest ad break ---------- */
.reportlink { align-self: flex-end; margin: -4px 10px 6px; padding: 2px 4px; border: 0; background: none; color: var(--muted); font-size: 12px; cursor: pointer; text-decoration: underline; }
.reportlink:hover { color: var(--red); }
.guestad { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 12px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--yellow); box-shadow: 0 0 22px -8px var(--yellow); animation: popin .25s ease-out; }
.guestad b { font: 400 22px/1.1 var(--graf); color: var(--yellow); }
.guestad span { color: var(--muted); font-size: 14px; }
.guestad i { font-style: normal; font-weight: 800; color: var(--text); }
.guestad .ad { margin: 4px auto 0; }
.ad.ph[data-ad="guestbreak"] { width: 300px; height: 250px; flex: none; }
.side.onbreak > .ad { display: none; }
@keyframes popin { from { transform: scale(.92); opacity: 0; } }

/* ---------- phones + small tablets ---------- */
@media (max-width: 600px) {
  .right .pill { display: none; }
  .shead { gap: 8px 10px; }
  .shead h2 { order: -1; flex: 0 0 100%; }
  #signedIn { flex: 1; min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
  .top { gap: 6px; padding: 0 10px; }
  .account { gap: 6px; }
  .ad.ph { width: 100%; }
  .ad.ph[data-ad="rail"] { width: 300px; }
}
@media (max-width: 900px) {
  :root { --top: calc(60px + env(safe-area-inset-top, 0px)); }
  kbd { display: none; }
  #chat { display: flex; flex-direction: column; height: auto; min-height: calc(100vh - var(--top)); min-height: calc(100dvh - var(--top)); padding: 0 max(10px, env(safe-area-inset-right, 0px)) max(10px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px)); }
  .stage { flex: none; }
  .vids { flex: none; height: 46vh; height: 46dvh; }
  .stage.wide .vids { height: 22vh; height: 22dvh; }
  .stage.text .slot { display: none; }
  .stage.text.hasb .slot, .stage.wide .slot { display: flex; height: 46vh; height: 46dvh; flex: none; }
  .local { width: 28%; aspect-ratio: 3 / 4; right: 8px; bottom: 8px; }
  .side { flex: 1; }
  .side:not(.br) .chatbox { order: -1; } /* messages first; the link box moves up again while a site is open */
  .chatbox { min-height: 34vh; min-height: 34dvh; }
  .stage.text ~ .side .chatbox { min-height: 54vh; min-height: 54dvh; }
  .controls { position: sticky; bottom: 0; padding: 6px 0; gap: 6px; flex-wrap: nowrap; background: linear-gradient(transparent, var(--bg) 40%); z-index: 5; }
  .controls .btn { padding: 11px 14px; }
  .controls .cbtn { width: 44px; height: 44px; flex: none; }
  .stage .controls { order: 3; }
  .toast { top: calc(var(--top) + 8px); bottom: auto; }
  .foot { padding-bottom: env(safe-area-inset-bottom, 0px); }
  .offer { position: fixed; top: calc(var(--top) + 8px); left: 10px; right: 10px; z-index: 40; background: #17301a; }
  .guestad { position: fixed; top: calc(var(--top) + 8px); left: 10px; right: 10px; z-index: 40; background: #15151e; }
}
@media (max-width: 400px) {
  .tag { font-size: 18px; }
  .account .btn { padding: 7px 9px; font-size: 13px; }
}
@media (max-width: 359px) {
  .controls { gap: 4px; }
  .controls .btn { padding: 10px 9px; }
  .controls .cbtn { width: 40px; height: 40px; }
}

/* ---------- anything with a touch screen: bigger tap targets, no zoom when typing ---------- */
@media (pointer: coarse) {
  kbd { display: none; }
  input, select, textarea { font-size: 16px !important; } /* iPhones zoom the page in on anything smaller */
  .btn.tiny { min-height: 40px; padding: 8px 12px; }
  .ibtn { width: 42px; height: 42px; }
  .chip button { padding: 6px; margin: -6px -6px -6px 0; font-size: 16px; }
  .reportlink { padding: 8px 6px; font-size: 13px; margin: -6px 8px 2px; }
  .agree input, .picks input { width: 24px; height: 24px; }
}
@media (hover: none) {
  .btn:hover { transform: none; filter: none; }
}

/* ---------- phones held sideways: video on the left, chat on the right ---------- */
@media (max-width: 950px) and (max-height: 500px) and (orientation: landscape) {
  :root { --top: calc(46px + env(safe-area-inset-top, 0px)); }
  .tag { font-size: 22px; }
  #chat { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 40%); gap: 8px; height: calc(100vh - var(--top)); height: calc(100dvh - var(--top)); min-height: 0; }
  .stage { flex: initial; min-height: 0; gap: 4px; }
  .vids { flex: 1; height: auto; min-height: 0; }
  .stage.wide .vids { flex: 0 0 auto; height: 28%; }
  .stage.text .slot, .stage.text.hasb .slot, .stage.wide .slot { display: flex; flex: 1; height: auto; min-height: 0; }
  .local { width: 24%; aspect-ratio: 4 / 3; }
  .side { min-height: 0; overflow-y: auto; gap: 6px; }
  .side:not(.br) .chatbox { order: 0; }
  .side .chatbox, .stage.text ~ .side .chatbox { min-height: 180px; }
  .controls { position: static; padding: 0; background: none; }
  .controls .cbtn { width: 40px; height: 40px; }
  .controls .btn { padding: 8px 12px; }
  .offer, .guestad { position: static; }
  .linkbox { padding: 8px; }
}
