:root {
  color-scheme: dark;
  --ink: #f9f6fa;
  --muted: #a69caa;
  --line: rgba(255, 255, 255, 0.1);
  --glass: rgba(24, 17, 29, 0.78);
  --panel: #18111e;
  --coral: #ff625f;
  --pink: #ff3976;
  --gold: #f3ca6b;
  --mint: #71dec3;
  --danger: #ff7e91;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body {
  color: var(--ink);
  background:
    radial-gradient(circle at 18% -10%, rgba(255, 57, 118, 0.18), transparent 30rem),
    radial-gradient(circle at 105% 18%, rgba(53, 210, 197, 0.12), transparent 26rem),
    #0e0a13;
}
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.z-room-app {
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 420px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}
.z-room-app::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.17;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.72' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
}

.z-room-header {
  position: relative;
  z-index: 20;
  min-height: calc(72px + env(safe-area-inset-top));
  padding: max(10px, env(safe-area-inset-top)) 12px 10px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 9, 17, 0.76);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(24px) saturate(130%);
}
.z-icon-button, .z-lang-button, .z-live-pill, .z-room-context button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 9px 24px rgba(0, 0, 0, 0.18);
}
.z-icon-button {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  display: grid;
  place-items: center;
}
.z-room-brand { min-width: 0; display: flex; align-items: center; gap: 10px; }
.z-room-brand > span:last-child { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.z-room-brand strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; letter-spacing: -0.25px; }
.z-room-brand small { color: var(--muted); font-size: 9px; letter-spacing: 0.15px; }
.z-brand-mark { position: relative; width: 27px; height: 27px; flex: 0 0 27px; transform: rotate(-10deg); }
.z-brand-mark i, .z-brand-mark b { position: absolute; width: 14px; height: 24px; border-radius: 12px 12px 9px 9px; transform: rotate(-38deg); }
.z-brand-mark i { left: 4px; top: 1px; background: linear-gradient(180deg, #ff467f, #ff6b61); }
.z-brand-mark b { left: 12px; top: 7px; background: linear-gradient(180deg, #ffd676, #f2b75a); }
.z-header-actions { display: flex; align-items: center; gap: 6px; }
.z-live-pill { height: 38px; padding: 0 10px; border-radius: 14px; display: flex; align-items: center; gap: 5px; }
.z-live-pill b { font-size: 10px; }
.z-live-pill > span:last-child { color: #d9d0dc; font-size: 9px; }
.z-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 5px rgba(113, 222, 195, 0.1), 0 0 15px rgba(113, 222, 195, 0.55); animation: zPulse 1.8s infinite; }
.z-lang-button { width: 39px; height: 38px; border-radius: 14px; font-size: 10px; font-weight: 850; }

.z-room-main { position: relative; z-index: 2; min-height: 0; padding: 10px 10px max(8px, env(safe-area-inset-bottom)); }
.z-room-stage {
  width: min(820px, 100%);
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(25, 41, 45, 0.2), transparent 28%),
    rgba(18, 13, 22, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055), 0 24px 70px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}
.z-room-context { min-height: 52px; padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.06); }
.z-room-context > div { display: flex; align-items: center; gap: 8px; }
.z-room-context strong { font-size: 12px; }
.z-room-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 18px rgba(113,222,195,.6); }
.z-room-context button { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; }
.z-room-context svg { width: 17px; height: 17px; }

.z-room-messages { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 11px 18px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.14) transparent; }
.z-room-messages::before { content: ""; margin-top: auto; }
.z-room-loading, .z-room-empty { margin: auto; width: min(330px, 92%); text-align: center; color: var(--muted); }
.z-room-loading strong, .z-room-empty strong { display: block; margin-top: 14px; color: var(--ink); font-size: 19px; letter-spacing: -0.5px; }
.z-room-loading p, .z-room-empty p { margin: 7px 0 0; font-size: 11px; line-height: 1.55; }
.z-loading-orb { position: relative; width: 72px; height: 72px; margin: 0 auto; display: grid; place-items: center; border: 1px solid rgba(113,222,195,.22); border-radius: 25px; background: linear-gradient(145deg, rgba(113,222,195,.17), rgba(255,255,255,.035)); transform: rotate(8deg); }
.z-loading-orb::before { content: ""; width: 23px; height: 23px; border: 2px solid rgba(255,255,255,.2); border-top-color: var(--mint); border-radius: 50%; animation: zSpin .9s linear infinite; }

.z-message { position: relative; align-self: flex-start; max-width: min(84%, 560px); padding: 9px 38px 8px 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 7px 18px 18px 18px; background: rgba(255,255,255,.065); box-shadow: 0 10px 28px rgba(0,0,0,.14); }
.z-message.own { align-self: flex-end; padding-right: 38px; border-radius: 18px 7px 18px 18px; border-color: rgba(255,91,111,.17); background: linear-gradient(145deg, rgba(255,57,118,.2), rgba(255,98,95,.1)); }
.z-message header { display: flex; align-items: center; gap: 7px; margin-bottom: 3px; }
.z-message header strong, .z-message-name { color: #f8d98f; font-size: 10px; }
.z-message-name { padding: 0; border: 0; background: transparent; font-weight: 800; text-decoration: underline; text-decoration-color: rgba(248,217,143,.26); text-underline-offset: 3px; }
.z-message time { color: #847a88; font-size: 8px; }
.z-message p { margin: 0; overflow-wrap: anywhere; font-size: 12px; line-height: 1.45; color: #f6f1f7; }
.z-message small { display: block; margin-top: 5px; color: var(--gold); font-size: 8px; }
.z-message-menu { position: absolute; right: 5px; top: 5px; width: 30px; height: 28px; border: 0; background: transparent; color: #948999; font-weight: 900; }
.z-reaction-bar { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.z-reaction-pill { min-width: 35px; height: 22px; padding: 0 7px; border: 1px solid rgba(255,255,255,.1); border-radius: 999px; background: rgba(255,255,255,.07); font-size: 10px; }
.z-reaction-pill.selected { border-color: rgba(243,202,107,.55); background: rgba(243,202,107,.14); }
.z-moderation-notice { align-self: stretch; padding: 9px 12px; border: 1px solid rgba(243,202,107,.16); border-radius: 13px; background: rgba(243,202,107,.07); color: #e8ca84; font-size: 10px; text-align: center; }

.z-room-feedback { min-height: 0; padding: 0 14px; color: var(--mint); font-size: 9px; text-align: center; transition: .2s; }
.z-room-feedback:not(:empty) { padding-block: 5px; border-top: 1px solid rgba(255,255,255,.045); }
.z-room-feedback.error { color: var(--danger); }
.z-emoji-tray { padding: 7px 10px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; border-top: 1px solid rgba(255,255,255,.06); background: rgba(8,6,11,.62); }
.z-emoji-tray button { height: 36px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.055); font-size: 18px; }
.z-room-composer { padding: 9px 9px calc(9px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: 40px minmax(0,1fr) 44px; gap: 7px; align-items: end; border-top: 1px solid var(--line); background: rgba(15,10,18,.93); backdrop-filter: blur(18px); }
.z-composer-icon, .z-send-button { height: 42px; border-radius: 14px; border: 1px solid var(--line); }
.z-composer-icon { background: rgba(255,255,255,.06); color: var(--gold); font-size: 18px; }
.z-composer-field { min-width: 0; min-height: 42px; padding: 8px 12px; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.055); }
.z-composer-field:focus-within { border-color: rgba(113,222,195,.42); box-shadow: 0 0 0 3px rgba(113,222,195,.07); }
.z-composer-field textarea { width: 100%; max-height: 96px; resize: none; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; line-height: 1.45; }
.z-composer-field textarea::placeholder { color: #827787; }
.z-send-button { display: grid; place-items: center; border: 0; color: #fff; background: linear-gradient(145deg, var(--pink), var(--coral)); box-shadow: 0 9px 22px rgba(255,57,118,.27); }
.z-send-button:disabled { opacity: .5; }
.z-send-button svg { width: 19px; height: 19px; }

.z-entry-layer, .z-menu-layer, .z-action-layer { position: fixed; z-index: 80; inset: 0; display: flex; align-items: flex-end; justify-content: center; visibility: hidden; pointer-events: none; }
.z-entry-layer.open, .z-menu-layer.open, .z-action-layer.open { visibility: visible; pointer-events: auto; }
.z-entry-backdrop, .z-menu-backdrop, .z-action-backdrop { position: absolute; inset: 0; border: 0; background: rgba(5,3,8,.7); opacity: 0; backdrop-filter: blur(8px); transition: opacity .25s; }
.z-entry-layer.open .z-entry-backdrop, .z-menu-layer.open .z-menu-backdrop, .z-action-layer.open .z-action-backdrop { opacity: 1; }
.z-entry-card, .z-action-card {
  position: relative;
  z-index: 2;
  width: min(520px, 100%);
  max-height: min(86dvh, 760px);
  overflow-y: auto;
  padding: 12px 18px calc(18px + env(safe-area-inset-bottom));
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 27px 27px 0 0;
  background:
    radial-gradient(circle at 100% 0, rgba(255,57,118,.18), transparent 18rem),
    linear-gradient(160deg, rgba(31,20,35,.98), rgba(17,12,21,.99));
  box-shadow: 0 -30px 80px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.07);
  transform: translateY(105%);
  transition: transform .28s cubic-bezier(.2,.8,.2,1);
}
.z-entry-layer.open .z-entry-card, .z-action-layer.open .z-action-card { transform: translateY(0); }
.z-entry-handle { width: 44px; height: 4px; margin: 0 auto 14px; border-radius: 999px; background: rgba(255,255,255,.18); }
.z-entry-kicker { color: #f07b9a; font-size: 9px; font-weight: 850; letter-spacing: 1.2px; }
.z-entry-card h1 { margin: 7px 0 6px; font-size: clamp(28px, 8vw, 39px); line-height: .98; letter-spacing: -1.4px; }
.z-entry-card > p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.z-entry-tabs { margin: 16px 0 13px; padding: 4px; display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; border: 1px solid rgba(255,255,255,.08); border-radius: 15px; background: rgba(0,0,0,.18); }
.z-entry-tabs button { min-height: 38px; padding: 4px 6px; border: 0; border-radius: 11px; background: transparent; color: #988f9c; font-size: 9px; font-weight: 800; }
.z-entry-tabs button[aria-selected="true"] { color: #fff; background: linear-gradient(145deg, rgba(255,57,118,.78), rgba(255,98,95,.62)); box-shadow: 0 7px 18px rgba(255,57,118,.18); }
.z-entry-pane { display: none; gap: 10px; }
.z-entry-pane.active { display: grid; }
.z-entry-pane label:not(.z-check) { display: grid; gap: 6px; color: #c8becb; font-size: 9px; font-weight: 760; letter-spacing: .45px; text-transform: uppercase; }
.z-entry-pane input[type="text"], .z-entry-pane input[type="email"], .z-entry-pane input[type="password"] { width: 100%; height: 46px; padding: 0 13px; border: 1px solid rgba(255,255,255,.1); border-radius: 14px; outline: 0; color: #fff; background: rgba(255,255,255,.055); font-size: 12px; text-transform: none; letter-spacing: 0; }
.z-entry-pane input:focus { border-color: rgba(255,98,95,.46); box-shadow: 0 0 0 3px rgba(255,98,95,.08); }
.z-check { display: grid; grid-template-columns: 20px 1fr; align-items: start; gap: 9px; color: #aaa0ad; font-size: 9px; line-height: 1.45; }
.z-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--pink); }
.z-primary-button { min-height: 49px; padding: 0 10px 0 16px; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 15px; color: #fff; background: linear-gradient(120deg, var(--pink), var(--coral)); font-size: 11px; font-weight: 850; box-shadow: 0 12px 27px rgba(255,57,118,.21); }
.z-primary-button b { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: rgba(255,255,255,.14); font-size: 17px; }
.z-primary-button:disabled { opacity: .55; }
.z-text-link { justify-self: center; color: #f5cf77; font-size: 10px; text-decoration: underline; text-underline-offset: 3px; }
.z-entry-note { min-height: 16px; margin-top: 8px; color: var(--mint); font-size: 9px; text-align: center; }
.z-entry-note.error { color: var(--danger); }
.z-entry-safety { margin-top: 9px !important; padding-top: 9px; border-top: 1px solid rgba(255,255,255,.07); text-align: center; font-size: 8px !important; }
.z-entry-safety a { color: var(--gold); text-decoration: underline; }
.z-verification-card { padding: 19px 16px 16px; border: 1px solid rgba(99,222,196,.2); border-radius: 22px; background: radial-gradient(circle at 100% 0,rgba(99,222,196,.18),transparent 45%),linear-gradient(150deg,rgba(255,255,255,.09),rgba(255,255,255,.025)); box-shadow: inset 0 1px rgba(255,255,255,.1),0 22px 55px rgba(0,0,0,.2); text-align: center; }
.z-verification-icon { width: 54px; height: 54px; margin: 0 auto 12px; display: grid; place-items: center; border: 1px solid rgba(99,222,196,.35); border-radius: 18px; color: #0d201c; background: linear-gradient(145deg,#80efd5,#54c8b0); font-size: 27px; font-weight: 900; box-shadow: 0 15px 34px rgba(99,222,196,.19); }
.z-verification-card > small { display: block; color: var(--mint); font-size: 8px; font-weight: 900; letter-spacing: 1.3px; }
.z-verification-card h2 { margin: 7px 0; font-size: 26px; letter-spacing: -1px; }
.z-verification-card p { margin: 0; color: #afa5b2; font-size: 10px; line-height: 1.5; }
.z-verification-card p strong { color: #fff; overflow-wrap: anywhere; }
.z-verification-card ol { margin: 14px 0; padding: 0; display: grid; gap: 6px; list-style: none; text-align: left; counter-reset: verify-step; }
.z-verification-card li { min-height: 34px; padding: 8px 9px; display: flex; align-items: center; gap: 8px; border: 1px solid rgba(255,255,255,.065); border-radius: 11px; background: rgba(0,0,0,.13); color: #d8cfd9; font-size: 9px; counter-increment: verify-step; }
.z-verification-card li::before { content: counter(verify-step); width: 20px; height: 20px; display: grid; place-items: center; border-radius: 7px; color: #111; background: var(--gold); font-weight: 900; }

.z-room-menu { position: relative; z-index: 2; width: min(380px, calc(100% - 18px)); margin: auto 9px 9px auto; padding: 13px; display: grid; gap: 5px; border: 1px solid var(--line); border-radius: 23px; background: rgba(24,17,29,.98); box-shadow: 0 25px 80px rgba(0,0,0,.5); transform: translateX(110%); transition: transform .25s ease; }
.z-menu-layer.open .z-room-menu { transform: translateX(0); }
.z-room-menu > div { padding: 5px 6px 10px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,.07); }
.z-room-menu > div strong { font-size: 15px; }
.z-room-menu > div button { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.06); font-size: 21px; }
.z-room-menu a, .z-room-menu > button { position: relative; min-height: 46px; padding: 0 12px; display: grid; grid-template-columns: 28px 1fr; align-items: center; border: 0; border-radius: 13px; color: #ddd4df; background: rgba(255,255,255,.045); text-align: left; }
.z-room-menu a span, .z-room-menu > button span { color: var(--gold); font-size: 18px; }
.z-room-menu b { font-size: 11px; }
.z-menu-signout { width: 100%; color: var(--danger) !important; }
.z-menu-unread { position: absolute; right: 12px; min-width: 21px; height: 21px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; color: #fff; background: linear-gradient(145deg,var(--pink),var(--coral)); font-size: 9px; font-style: normal; box-shadow: 0 6px 18px rgba(255,57,118,.26); }

.z-action-card { padding-top: 12px; }
.z-action-card > strong { display: block; margin-bottom: 12px; text-align: center; font-size: 15px; }
.z-action-reactions { display: grid; grid-template-columns: repeat(6,1fr); gap: 5px; margin-bottom: 10px; }
.z-action-reactions button { height: 42px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.055); font-size: 19px; }
.z-action-card > button { width: 100%; min-height: 45px; margin-top: 6px; border: 1px solid rgba(255,126,145,.16); border-radius: 13px; background: rgba(255,126,145,.08); color: #ff9cab; font-size: 11px; font-weight: 760; }
.z-action-card > button.private { border-color: rgba(113,222,195,.2); background: linear-gradient(145deg,rgba(113,222,195,.14),rgba(255,255,255,.045)); color: #93f2dc; }
.z-action-card > button.friend { border-color: rgba(245,200,103,.24); background: linear-gradient(145deg,rgba(245,200,103,.16),rgba(246,50,128,.08)); color: #f7d98f; }
.z-action-card > button:disabled { opacity:.65; cursor:default; }
.z-action-card > button.secondary { border-color: var(--line); background: rgba(255,255,255,.045); color: #ccc2cf; }

@keyframes zSpin { to { transform: rotate(360deg); } }
@keyframes zPulse { 50% { opacity: .55; transform: scale(.82); } }
@media (min-width: 700px) {
  .z-room-main { padding: 14px; }
  .z-room-stage { border-radius: 28px; }
  .z-room-header { padding-inline: 20px; }
  .z-message p { font-size: 13px; }
}
@media (min-width: 960px) {
  .z-room-header { grid-template-columns: auto minmax(430px,1fr) auto; padding-inline: max(22px,calc((100vw - 1240px)/2)); gap: 22px; }
  .z-back, #roomMenuButton { display: none; }
  .z-room-desktop-nav { justify-self: center; }
  .z-room-main { padding: 18px; }
  .z-room-stage { max-width: 900px; margin: auto; }
}
@media (max-width: 380px) {
  .z-room-header { grid-template-columns: 40px minmax(0,1fr) auto; padding-inline: 8px; }
  .z-icon-button { width: 38px; height: 38px; border-radius: 13px; }
  .z-room-brand strong { font-size: 13px; }
  .z-live-pill { padding-inline: 8px; }
  .z-live-pill > span:last-child { display: none; }
  .z-room-main { padding: 7px 6px max(6px,env(safe-area-inset-bottom)); }
  .z-room-stage { border-radius: 20px; }
  .z-room-messages { padding-inline: 8px; }
  .z-entry-card { padding-inline: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .z-room-header, .z-room-stage, .z-room-composer { backdrop-filter: none; }
}
