/* ---------- Rooms list / create ---------- */
.rcard { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; color: var(--text); background: var(--gloss), var(--surface); border: 1px solid var(--border); box-shadow: inset 0 1px 0 var(--edge), var(--shadow); }
.rcard__thumb { width: 54px; height: 54px; flex: none; display: grid; place-items: center; border-radius: 16px; color: #fff; }
.rcard__thumb--doodle, .skin-thumb--doodle { background: linear-gradient(135deg, #f5f3fa 55%, #0d0b14 56%); color: #1c1830; }
.rcard__thumb--midnight, .skin-thumb--midnight { background: linear-gradient(135deg, #07060a, #3d2c0a 60%, #e9bf55); color: #f4d675; }
.rcard__thumb--royal, .skin-thumb--royal { background: linear-gradient(135deg, #bcd7f3, #fdf6e6 55%, #e9bf55); color: #8a5a05; }
.rcard__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rcard__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rcard__meta { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.rcard__count { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-text); font-weight: 700; font-size: .85rem; }
.skin-thumb { display: block; width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--border-strong); }

/* ---------- Room screen ---------- */
.app--room #view { padding: 0; }
.room {
  --rt: #1c1830; --rm: #7a7690; --ra: #6d5bd0; --rcard: rgba(255, 255, 255, .78); --rborder: rgba(30, 24, 60, .1);
  --rchip: rgba(255, 255, 255, .85); --rbar: rgba(255, 255, 255, .92); --rseat: 0 0 0 3px rgba(109, 91, 208, .28);
  --rbubble: rgba(109, 91, 208, .1); --rsend: #6d5bd0; --rsend-text: #fff; --rowner-bg: #111; --rowner-text: #fff; --rlink: #9a90d8;
  position: relative; min-height: 100dvh; overflow: hidden; isolation: isolate; color: var(--rt);
  background: #f5f3fa;
}
.room[data-skin="midnight"] {
  --rt: #f3e9d2; --rm: #a89a78; --ra: #e9bf55; --rcard: rgba(14, 11, 6, .8); --rborder: rgba(233, 191, 85, .42);
  --rchip: rgba(18, 14, 8, .8); --rbar: rgba(10, 8, 5, .92); --rseat: 0 0 0 3px rgba(233, 191, 85, .45), 0 0 18px rgba(233, 191, 85, .35);
  --rbubble: rgba(233, 191, 85, .08); --rsend: transparent; --rsend-text: #e9bf55; --rowner-bg: #0a0805; --rowner-text: #f4d675; --rlink: #e9bf55;
  background: radial-gradient(120% 60% at 50% 0%, #1c1406 0%, #07060a 60%), #07060a;
}
.room[data-skin="royal"] {
  --rt: #2b2210; --rm: #7c6a42; --ra: #b8821a; --rcard: rgba(255, 255, 255, .6); --rborder: rgba(214, 170, 70, .6);
  --rchip: rgba(255, 255, 255, .7); --rbar: rgba(255, 252, 244, .86); --rseat: 0 0 0 3px rgba(233, 191, 85, .55), 0 0 16px rgba(255, 236, 170, .8);
  --rbubble: rgba(214, 170, 70, .14); --rsend: linear-gradient(135deg, #f6d56a, #c38a12); --rsend-text: #2a1a02; --rowner-bg: #7a5a16; --rowner-text: #fff4c8; --rlink: #c38a12;
  background: linear-gradient(180deg, #bcd7f3 0%, #eaf2fb 24%, #fdf6e6 56%, #f3e6c4 100%);
}
.room__decor { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.room__body { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 14px; padding: calc(var(--safe-t) + 12px) 14px calc(110px + var(--safe-b)); max-width: var(--maxw); margin: 0 auto; }

/* scenery: Doodle White */
.d-blob { position: absolute; background: #0d0b14; }
.d-blob--tl { top: 150px; left: -80px; width: 120px; height: 230px; border-radius: 0 70% 60% 0 / 0 55% 70% 0; transform: rotate(-8deg); }
.d-blob--br { bottom: -70px; right: -80px; width: 220px; height: 200px; border-radius: 70% 0 0 0 / 80% 0 0 0; transform: rotate(8deg); }
.d-doodle { position: absolute; color: #0d0b14; font-size: 1.6rem; opacity: .85; }
.d-doodle--heart { top: 250px; left: 10px; color: #fff; }
.d-doodle--star { top: 36%; right: 30%; font-size: 1rem; }
.d-note { position: absolute; top: 150px; right: 14px; transform: rotate(-9deg); text-align: center; font: 600 1.15rem/1.15 'Segoe Script', 'Bradley Hand', 'Comic Sans MS', cursive; color: #1c1830; }
/* Midnight Gold */
.d-curtain { position: absolute; top: 0; bottom: 0; width: 24%; background: repeating-linear-gradient(90deg, rgba(70, 52, 18, .65) 0 9px, rgba(8, 6, 3, .92) 9px 22px); }
.d-curtain--l { left: 0; -webkit-mask-image: linear-gradient(90deg, #000 30%, transparent); mask-image: linear-gradient(90deg, #000 30%, transparent); }
.d-curtain--r { right: 0; -webkit-mask-image: linear-gradient(270deg, #000 30%, transparent); mask-image: linear-gradient(270deg, #000 30%, transparent); }
.d-banner { position: absolute; top: 170px; width: 50px; padding: 14px 4px 26px; text-align: center; color: #f4d675; font: 600 .78rem/1.15 'Segoe Script', 'Bradley Hand', 'Comic Sans MS', cursive; background: linear-gradient(180deg, #14100a, #0a0805); border: 1px solid rgba(233, 191, 85, .65); clip-path: polygon(0 0, 100% 0, 100% 86%, 50% 100%, 0 86%); }
.d-banner--l { left: 4px; display: grid; place-items: start center; }
.d-banner--r { right: 4px; }
.d-candle { position: absolute; width: 10px; height: 54px; border-radius: 3px; background: linear-gradient(#f1e2b5, #b8964a); }
.d-candle::before { content: ""; position: absolute; left: 50%; top: -22px; width: 26px; height: 40px; margin-left: -13px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 214, 120, .95), rgba(255, 170, 60, .35) 55%, transparent); animation: flicker 2.4s ease-in-out infinite; }
.d-candle--1 { left: 8px; bottom: 36%; } .d-candle--2 { left: 26px; bottom: 33%; height: 40px; }
.d-candle--3 { right: 10px; bottom: 30%; } .d-candle--4 { right: 28px; bottom: 34%; height: 46px; }
@keyframes flicker { 0%, 100% { opacity: 1; } 40% { opacity: .65; } 70% { opacity: .9; } }
/* Royal Palace */
.d-rays { position: absolute; inset: 0; background: conic-gradient(from 195deg at 50% -8%, transparent 0 8%, rgba(255, 255, 255, .6) 10% 12%, transparent 14% 22%, rgba(255, 255, 255, .45) 25% 27%, transparent 30% 100%); }
.d-pillar { position: absolute; top: 0; bottom: 0; width: 15%; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .7) 0 6px, rgba(226, 196, 120, .5) 6px 8px, rgba(255, 250, 235, .6) 8px 16px); }
.d-pillar--l { left: 0; -webkit-mask-image: linear-gradient(90deg, #000 40%, transparent); mask-image: linear-gradient(90deg, #000 40%, transparent); }
.d-pillar--r { right: 0; -webkit-mask-image: linear-gradient(270deg, #000 40%, transparent); mask-image: linear-gradient(270deg, #000 40%, transparent); }
.room[data-skin="royal"] .d-banner { background: linear-gradient(180deg, #2b3a63, #1b2647); color: #fff1b8; border-color: #e9bf55; }
.d-spark { position: absolute; color: #e9bf55; font-size: 1rem; animation: twinkle 3s ease-in-out infinite; }
.d-spark--1 { top: 16%; left: 22%; } .d-spark--2 { top: 30%; right: 22%; animation-delay: .5s; } .d-spark--3 { top: 52%; left: 9%; animation-delay: 1s; }
.d-spark--4 { top: 60%; right: 8%; animation-delay: 1.5s; } .d-spark--5 { top: 78%; left: 30%; animation-delay: 2s; } .d-spark--6 { top: 10%; right: 36%; animation-delay: 2.5s; }
@keyframes twinkle { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

/* header */
.room__head { display: flex; align-items: flex-start; gap: 10px; }
.room__back, .room__more { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: none; color: var(--rt); cursor: pointer; }
.room__titles { flex: 1; min-width: 0; }
.room__title { display: flex; align-items: center; gap: 8px; font-size: 1.45rem; }
.room__title svg { stroke: var(--ra); }
.room__sparkle { color: #e9bf55; font-size: 1rem; }
.room__tagline { color: var(--rm); font-size: .9rem; margin-top: 2px; }
.room__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rchip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; font-size: .82rem; background: var(--rchip); border: 1px solid var(--rborder); color: var(--rt); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.rchip svg { stroke: var(--ra); }

/* seats */
.stage { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 4px; }
.owner-tag { padding: 4px 18px; border-radius: 999px; background: var(--rowner-bg); color: var(--rowner-text); font-size: .85rem; font-weight: 600; margin-bottom: -4px; border: 1px solid rgba(233, 191, 85, .5); }
.pair { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 4px; padding: 14px 8px 10px; border-radius: 34px; background: var(--rcard); border: 1px solid var(--rborder); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 8px 24px rgba(0, 0, 0, .1); }
.pair--top { width: 82%; }
.pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.pair__link { position: absolute; left: 50%; top: 38px; transform: translateX(-50%); color: var(--rlink); opacity: .9; display: flex; }
.pair--top .pair__link { top: 44px; }
.pair__link svg { stroke: var(--rlink); }
.seat { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: var(--rt); cursor: pointer; font: inherit; }
.seat__pic { border-radius: 50%; display: block; line-height: 0; }
.seat.is-taken .seat__pic { box-shadow: 0 0 0 2px var(--rborder); }
.seat.is-me .seat__pic { box-shadow: var(--rseat); }
.seat__empty { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; border: 1.5px dashed var(--rborder); color: var(--rm); background: rgba(127, 127, 127, .08); line-height: 1; }
.seat--big .seat__empty { width: 70px; height: 70px; }
.seat__name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: .85rem; }
.seat__sub { font-size: .72rem; color: var(--rm); }
.is-empty .seat__name { color: var(--rm); font-weight: 500; }

/* chat */
.chat { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 26px; background: var(--rcard); border: 1px solid var(--rborder); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.chat__head { display: flex; align-items: center; gap: 8px; }
.chat__head svg { stroke: var(--ra); }
.chat__count { padding: 1px 8px; border-radius: 999px; background: var(--ra); color: #fff; font-size: .72rem; font-weight: 700; }
.room[data-skin="midnight"] .chat__count { color: #1a1204; }
.members-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--rborder); background: var(--rchip); color: var(--rt); font-size: .82rem; cursor: pointer; }
.chat__list { display: flex; flex-direction: column; gap: 10px; max-height: 240px; min-height: 90px; overflow-y: auto; overscroll-behavior: contain; }
.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg__body { flex: 1; min-width: 0; }
.msg__body p { overflow-wrap: anywhere; white-space: pre-wrap; }
.msg .icon-btn--sm { color: var(--rm); }
.chat__bar { display: flex; align-items: center; gap: 8px; }
.chat__emoji { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--rborder); background: var(--rchip); color: var(--ra); cursor: pointer; }
.chat__input { flex: 1; min-width: 0; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--rborder); background: var(--rchip); color: var(--rt); outline: none; font: inherit; }
.chat__input::placeholder { color: var(--rm); }
.chat__send { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--rborder); background: var(--rsend); color: var(--rsend-text); cursor: pointer; }
.chat__send:disabled { opacity: .5; }
.emoji-bar { display: flex; flex-wrap: wrap; gap: 4px; }
.emoji-bar__btn { width: 38px; height: 38px; border: 0; background: var(--rbubble); border-radius: 12px; font-size: 1.2rem; cursor: pointer; }

/* bottom bar */
.bar { position: fixed; z-index: 5; left: 50%; transform: translateX(-50%); bottom: calc(10px + var(--safe-b)); width: min(calc(100% - 24px), calc(var(--maxw) - 24px)); display: grid; grid-template-columns: repeat(5, 1fr); padding: 8px 6px; border-radius: 30px; background: var(--rbar); border: 1px solid var(--rborder); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.bar__item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0; border: 0; background: none; color: var(--rt); font-size: .72rem; font-weight: 600; cursor: pointer; }
.bar__icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--rbubble); color: var(--ra); border: 1px solid var(--rborder); }

/* sheets */
.sheet-back { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, .45); }
.sheet { width: min(100%, var(--maxw)); max-height: 78dvh; overflow-y: auto; padding: 16px 16px calc(20px + var(--safe-b)); border-radius: 24px 24px 0 0; background: var(--solid); color: var(--text); border: 1px solid var(--border-strong); display: flex; flex-direction: column; gap: 4px; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sheet__item { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 4px; border: 0; background: none; color: var(--text); font: inherit; font-weight: 600; text-align: left; cursor: pointer; text-decoration: none; }
.sheet__item svg { stroke: var(--accent-text); }
.sheet__item--danger, .sheet__item--danger svg { color: var(--danger); stroke: var(--danger); }
.sheet__grow { flex: 1; min-width: 0; }
.sheet__block { display: flex; flex-direction: column; gap: 8px; padding: 6px 0 10px; }

/* room control: locked seats, mute badge, notices, reactions */
.seat__pic { position: relative; }
.seat.is-locked { cursor: default; }
.seat.is-locked .seat__empty { border-style: solid; opacity: .75; background: rgba(0, 0, 0, .18); }
.seat.is-locked .seat__name { color: var(--rm); }
.seat__mute { position: absolute; right: -2px; bottom: -2px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: #c0392b; border: 2px solid var(--rcard-solid, #fff); line-height: 0; }
.seat__mute svg { stroke: #fff; }
.room__notice { display: flex; align-items: flex-start; gap: 8px; padding: 9px 14px; border-radius: 16px; background: var(--rchip); border: 1px solid var(--rborder); color: var(--rt); font-size: .85rem; overflow-wrap: anywhere; }
.room__notice svg { flex: none; margin-top: 1px; stroke: var(--ra); }
.chat__note { font-size: .78rem; color: var(--rm); margin-top: -4px; }
.chat__note:empty { display: none; }
.chat__input:disabled { opacity: .55; }
.react-fab { position: fixed; z-index: 6; right: 14px; bottom: calc(176px + var(--safe-b)); width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--rborder); background: var(--rbar); font-size: 1.4rem; line-height: 1; cursor: pointer; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }
.react-fab:active { transform: scale(.92); }
.react-float { position: fixed; z-index: 7; bottom: calc(220px + var(--safe-b)); font-size: 1.7rem; pointer-events: none; animation: floatUp 2.2s ease-out forwards; }
@keyframes floatUp { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-240px) scale(1.15); opacity: 0; } }
.sheet__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sheet__label { font-size: .82rem; color: var(--muted); font-weight: 600; margin-top: 8px; }
.sheet__row { display: flex; gap: 8px; align-items: center; }
.sheet__row .input { flex: 1; min-width: 0; }
.pill--warn { background: #c0392b; color: #fff; }
.pill--gold { background: #e9bf55; color: #1a1204; }

/* stickers */
.msg__sticker { display: block; width: 116px; height: auto; margin-top: 4px; }
.sticker-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; gap: 8px; max-height: 58dvh; overflow-y: auto; overscroll-behavior: contain; padding: 2px 0 4px; }
.sticker-btn { min-width: 0; padding: 6px; border: 0; border-radius: 16px; background: var(--surface-2, rgba(127, 127, 127, .14)); cursor: pointer; display: grid; place-items: center; aspect-ratio: 1; }
.sticker-btn img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.sticker-btn:active { transform: scale(.94); }
.seat__pop { position: absolute; left: 50%; top: 50%; width: 104px; height: 104px; margin: -62px 0 0 -52px; object-fit: contain; z-index: 4; pointer-events: none; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .45)); animation: stickerPop 3.4s ease-out both; }
.seat--big .seat__pop { width: 120px; height: 120px; margin: -70px 0 0 -60px; }
@keyframes stickerPop { 0% { transform: scale(.2) rotate(-14deg); opacity: 0; } 8% { transform: scale(1.18) rotate(4deg); opacity: 1; } 16% { transform: scale(1) rotate(0); } 86% { opacity: 1; transform: translateY(-4px); } 100% { opacity: 0; transform: translateY(-14px) scale(.95); } }

/* ---------- One-screen room: seats on top, chat fills the rest, chat bar at the very bottom ---------- */
.app--room, .app--room #view { overflow: hidden; }
.room { height: 100dvh; min-height: 0; display: flex; flex-direction: column; }
.room__body { flex: 1; min-height: 0; width: 100%; gap: 8px; padding: calc(var(--safe-t) + 6px) 12px calc(8px + var(--safe-b)); }
.room__head { gap: 6px; align-items: center; }
.room__back, .room__more { width: 36px; height: 36px; }
.room__title { font-size: 1.12rem; gap: 6px; }
.room__title svg { width: 18px; height: 18px; }
.room__tagline { font-size: .78rem; margin-top: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room__chips { flex-wrap: nowrap; gap: 6px; overflow: hidden; }
.rchip { padding: 4px 10px; font-size: .74rem; gap: 5px; white-space: nowrap; }
.room__notice { padding: 6px 12px; font-size: .78rem; border-radius: 12px; }
.stage { gap: 8px; margin-top: 0; flex: none; }
.owner-tag { display: none; }
.pair { padding: 8px 6px 6px; border-radius: 24px; }
.pair--top { width: 74%; }
.pairs { gap: 8px; }
.pair__link { top: 28px; }
.pair--top .pair__link { top: 32px; }
.seat { gap: 2px; }
.seat__sub { display: none; }
.seat__name { font-size: .72rem; }
.seat__pic .avatar { --size: 46px !important; }
.seat--big .seat__pic .avatar { --size: 58px !important; }
.seat__empty { width: 46px; height: 46px; }
.seat--big .seat__empty { width: 58px; height: 58px; }
.seat__pop { width: 84px; height: 84px; margin: -52px 0 0 -42px; }
.seat--big .seat__pop { width: 100px; height: 100px; margin: -60px 0 0 -50px; }
.chat { flex: 1; min-height: 0; padding: 8px 10px; gap: 6px; border-radius: 20px; }
.chat__list { flex: 1; min-height: 0; max-height: none; gap: 8px; }
.chat__note { margin-top: 0; }
.msg { gap: 8px; }
.msg .avatar { --size: 28px !important; }
.msg__sticker { width: 84px; }
.chat__emoji { width: 36px; height: 36px; }
.chat__input { min-height: 40px; padding: 0 12px; min-width: 0; }
.chat__send { width: 40px; height: 40px; }
.chat__bar { gap: 6px; }
.react-fab { width: 40px; height: 40px; font-size: 1.2rem; bottom: calc(66px + var(--safe-b)); right: 10px; }
.react-float { bottom: calc(110px + var(--safe-b)); }
@media (max-height: 700px) {
  .seat__pic .avatar { --size: 40px !important; }
  .seat--big .seat__pic .avatar { --size: 50px !important; }
  .seat__empty { width: 40px; height: 40px; }
  .seat--big .seat__empty { width: 50px; height: 50px; }
  .pair__link { top: 24px; }
  .pair--top .pair__link { top: 28px; }
}
