/* Shared rooms (feature branch feature/shared-rooms). Used by static/rooms.js and the two screens in index.html. */
.rooms-screen { display:none; flex-direction:column; height:100%; background:var(--bg); color:var(--text); }
.rooms-screen > .pg-banner { width:100%; box-sizing:border-box; }
.rm-body { flex:1; overflow-y:auto; padding:12px 16px 24px; max-width:720px; width:100%; margin:0 auto; box-sizing:border-box; }

.rm-box { background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:12px; margin-bottom:12px; }
.rm-box h3 { margin:0 0 8px; font-size:.95rem; color:#a9d6ff; font-weight:600; }
.rm-row { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.rm-input, .rm-select, .rm-textarea {
  flex:1; min-width:0; background:#0d0d1a; color:var(--text); border:1px solid var(--border); border-radius:10px;
  padding:9px 11px; font:inherit; font-size:.95rem; box-sizing:border-box; width:100%;
}
.rm-textarea { resize:vertical; min-height:60px; }
.rm-btn {
  background:rgba(27,253,197,.12); color:#1bfdc5; border:1px solid rgba(27,253,197,.45); border-radius:999px;
  padding:8px 15px; font:inherit; font-size:.9rem; cursor:pointer; white-space:nowrap;
}
.rm-btn:hover { background:rgba(27,253,197,.22); }
.rm-btn:disabled { opacity:.4; cursor:default; }
.rm-btn.quiet { background:none; color:var(--dim); border-color:var(--border); }
.rm-btn.hot { background:#1bfdc5; color:#000; border-color:#1bfdc5; font-weight:600; }
.rm-label { display:block; font-size:.8rem; color:var(--dim); margin:10px 0 4px; }

.rm-chars { display:flex; flex-wrap:wrap; gap:6px; }
.rm-char { display:flex; align-items:center; gap:6px; padding:3px 10px 3px 3px; border-radius:999px; border:1px solid var(--border); background:#0d0d1a; color:var(--text); font-size:.82rem; cursor:pointer; }
.rm-char img { width:26px; height:26px; border-radius:50%; object-fit:cover; }
.rm-char.on { border-color:#9a8cff; background:rgba(154,140,255,.20); }
.rm-char.static { cursor:default; }

.rm-card { background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:12px; margin-bottom:10px; }
.rm-card.paused { opacity:.72; }
.rm-card.clickable { cursor:pointer; }
.rm-card.clickable:hover { border-color:#7fe3c8; }
.rm-card-top { display:flex; justify-content:space-between; gap:8px; align-items:flex-start; }
.rm-card-topic { font-weight:600; color:#e8e8f0; }
.rm-card-desc { color:var(--dim); font-size:.85rem; margin-top:3px; }
.rm-card-meta { color:#7fe3c8; font-size:.8rem; margin:8px 0; display:flex; gap:12px; flex-wrap:wrap; }
.rm-badge { font-size:.7rem; border:1px solid var(--border); border-radius:999px; padding:1px 8px; color:var(--dim); }
.rm-empty { color:var(--dim); text-align:center; padding:28px 8px; }

/* ── the room itself ── */
/* table: [stage] [ top row / message square / bottom row ] [stage] */
.rm-table { flex:1; min-height:0; display:flex; gap:8px; padding:8px 8px 0; }
.rm-mid { flex:1; min-width:0; display:flex; flex-direction:column; gap:6px; }
.rm-trow { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; flex-shrink:0; }
.rm-seat {
  position:relative; background:linear-gradient(#262350,#1b1a3a); border:1px solid #3d3a78; border-radius:12px; padding:6px 4px; text-align:center;
  font-size:.8rem; min-height:62px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; overflow:hidden;
}
.rm-seat.free { border-style:dashed; color:var(--dim); cursor:pointer; }
.rm-seat.ghost { background:none; border-color:transparent; }
/* people: indigo cards; characters: a card tinted with their own colour; both clearly apart from the teal buttons */
.rm-seat.char { background:linear-gradient(rgba(var(--cc-rgb,150,120,255),.26), rgba(var(--cc-rgb,150,120,255),.10)), #0a0a14;
  border-color:rgba(var(--cc-rgb,150,120,255),.6); }
.rm-seat .hand { position:absolute; top:2px; right:4px; font-size:.95rem; line-height:1; display:flex; align-items:flex-end; }
.rm-seat .hand .bars { display:inline-flex; align-items:flex-end; gap:1px; margin-left:3px; padding-bottom:1px; }
.rm-seat .hand .bars i { display:block; width:3px; border-radius:1px; background:rgba(255,255,255,.22); }
.rm-seat.pulse { animation:rmPulse 1.6s ease-in-out infinite; }
@keyframes rmPulse { 0%,100% { box-shadow:0 0 0 rgba(27,253,197,0); } 50% { box-shadow:0 0 10px rgba(27,253,197,.55); } }
.rm-seat.holder { border-color:#1bfdc5; box-shadow:0 0 10px rgba(27,253,197,.35); }
.rm-seat .nm { max-width:100%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
/* writing: three dots that light up one after the other */
.rm-seat .pen { position:absolute; top:6px; left:7px; display:flex; gap:3px; align-items:center; height:8px; color:#1bfdc5; pointer-events:none; }
.rm-seat .pen i { display:block; width:4px; height:4px; border-radius:50%; background:currentColor; opacity:.25; animation:rmDot 1.2s ease-in-out infinite; }
.rm-seat .pen i:nth-child(2) { animation-delay:.2s; }
.rm-seat .pen i:nth-child(3) { animation-delay:.4s; }
@keyframes rmDot { 0%,60%,100% { opacity:.25; transform:translateY(0); } 30% { opacity:1; transform:translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .rm-seat .pen i { animation:none; opacity:.8; } }
.rm-link { color:#1bfdc5; text-decoration:underline; cursor:pointer; }
.rm-seat .tag { position:absolute; top:3px; right:5px; font-size:.7rem; color:#7fe3c8; }
.rm-ico { display:inline-flex; align-items:center; justify-content:center; width:22px; height:22px; border-radius:50%; flex-shrink:0;
  color:#fff; font-size:.72rem; font-weight:600; object-fit:cover; vertical-align:middle; margin-right:6px; }
.rm-seat .rm-ico { width:34px; height:34px; font-size:1rem; margin:0; }
.rm-ico.free { background:#23233f; }
.rm-ico.sm { margin:0; width:100%; height:100%; font-size:.62rem; }
/* reaction rings on the latest message: white = agrees, orange = disagrees */
.rm-seat.agree, .rm-dot.agree { box-shadow:0 0 0 2px #fff; }
.rm-seat.disagree, .rm-dot.disagree { box-shadow:0 0 0 2px #ff9f43; }
.rm-seat.agree.holder { box-shadow:0 0 0 2px #fff, 0 0 10px rgba(27,253,197,.35); }
/* the two stages: listeners as small user icons, the active ones bigger */
.rm-stage { width:56px; box-sizing:border-box; flex-shrink:0; align-self:stretch; margin:6px 0; overflow:hidden;
  background:linear-gradient(180deg,#242452,#171735); border:1px solid #4a4a8a; border-radius:24px; padding:12px 0;
  box-shadow:inset 0 0 18px rgba(120,120,255,.18), 0 0 10px rgba(80,80,200,.18);
  display:flex; flex-direction:column; align-items:center; gap:9px; min-height:140px; }
.rm-stage:empty { border-style:dashed; border-color:#5a5aa0; justify-content:center; }
.rm-stage:empty::before { content:''; width:32px; height:32px; opacity:.85; filter:drop-shadow(0 0 4px rgba(27,253,197,.7));
  background:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231bfdc5' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='7.5' r='2.7'/><path d='M7.3 19.5v-1.6a4.7 4.7 0 0 1 9.4 0v1.6'/><circle cx='5.6' cy='10' r='2'/><path d='M2 18v-1a3.6 3.6 0 0 1 3.6-3.6'/><circle cx='18.4' cy='10' r='2'/><path d='M22 18v-1a3.6 3.6 0 0 0-3.6-3.6'/></svg>") center/contain no-repeat; }
.rm-dot { display:inline-block; border-radius:50%; flex-shrink:0; transition:box-shadow .3s, width .3s, height .3s; }
.rm-dot.me { outline:1px dashed #7fe3c8; outline-offset:2px; }
.rm-meta-line { display:flex; justify-content:space-between; align-items:center; gap:8px; font-size:.78rem; color:var(--dim); }
.rm-react { display:flex; gap:8px; }
.rm-react:empty { display:none; }
.rm-react-btn.on.agree { background:#fff; color:#000; border-color:#fff; }
.rm-react-btn.on.disagree { background:#ff9f43; color:#000; border-color:#ff9f43; }

.rm-square { flex:1; min-height:120px; overflow-y:auto; padding:8px 12px; display:flex; flex-direction:column; gap:8px; border-radius:12px;
  background:url('/static/chat_bg.png') center/cover; }
.rm-square .rm-msg.system { color:#3d5566; }
/* People: like the user bubble of the chat (clear white, semi-transparent, dark-blue text), each in the colour of their icon;
   mine on the right, the others on the left. Characters (the AI) keep the tinted fill with the coloured bar on the left. */
.rm-msg { max-width:88%; align-self:flex-start; background:rgba(255,255,255,.30); border:1px solid var(--uc, var(--user-bg)); color:var(--user-bg);
  border-radius:16px; border-bottom-left-radius:4px; padding:7px 12px; backdrop-filter:blur(6px); }
.rm-msg.mine { align-self:flex-end; --uc:var(--user-bg); border-radius:16px; border-bottom-right-radius:4px; }
.rm-msg:not(.char):not(.system) .who { color:var(--uc, var(--user-bg)); font-weight:700; }
.rm-msg.char { border-radius:6px 16px 16px 6px; background:linear-gradient(rgba(255,255,255,.20), rgba(255,255,255,.20)), rgba(var(--cc-rgb),.16);
  border:1px solid rgba(var(--cc-rgb),.55); border-left:3px solid var(--cc); color:#131313; }
.rm-msg.char .who { color:#131313; font-weight:700; }
.rm-msg .who { font-size:.74rem; color:#7fe3c8; margin-bottom:2px; }
.rm-rx { display:flex; justify-content:flex-end; gap:6px; margin-top:3px; }
.rm-rx-btn { background:none; border:0; padding:0 4px; font:inherit; font-size:.72rem; line-height:1.5; color:inherit; opacity:.55; cursor:pointer; border-radius:8px; }
.rm-rx-btn:disabled { cursor:default; }
.rm-rx-btn:not(:disabled):hover { opacity:.95; }
.rm-rx-btn.on { opacity:1; font-weight:700; background:rgba(0,0,0,.12); }
.rm-msg .tx { white-space:pre-wrap; word-break:break-word; font-size:.94rem; }
.rm-msg.system { align-self:center; background:none; border:none; color:var(--dim); font-size:.8rem; }

.rm-bottom { flex-shrink:0; border-top:1px solid var(--border); background:var(--surface); padding:8px 12px calc(10px + env(safe-area-inset-bottom)); display:flex; flex-direction:column; gap:8px; }
.rm-status { font-size:.88rem; color:#a9d6ff; min-height:1.3em; }
.rm-status.mine { color:#1bfdc5; font-weight:600; }
.rm-acts { display:flex; gap:8px; flex-wrap:wrap; }
.rm-compose { display:flex; gap:8px; align-items:flex-end; }
.rm-compose textarea { flex:1; min-height:42px; max-height:110px; resize:none; background:#0d0d1a; color:var(--text); border:1px solid var(--border); border-radius:12px; padding:9px 11px; font:inherit; font-size:.95rem; box-sizing:border-box; }
.rm-compose textarea:disabled { opacity:.5; }
.rm-toast { position:fixed; left:50%; bottom:90px; transform:translateX(-50%); background:#000; color:#fff; border:1px solid #23234a; padding:8px 14px; border-radius:999px; font-size:.85rem; z-index:50; display:none; max-width:90%; }

/* confirm step before entering a room */
.rm-modal { position:fixed; inset:0; background:rgba(0,0,0,.65); z-index:60; display:flex; align-items:center; justify-content:center; padding:16px; }
.rm-modal-box { background:var(--surface); border:1px solid var(--border); border-radius:16px; padding:16px; width:100%; max-width:420px; display:flex; flex-direction:column; gap:12px; }
.rm-modal-box h3 { margin:0; font-size:1rem; color:#a9d6ff; }
.rm-ico.lg { width:48px; height:48px; font-size:1.3rem; margin:0; background:#3a3a66; overflow:hidden; }
.rm-ico.lg img { width:100%; height:100%; object-fit:cover; }
.rm-check { display:flex; gap:8px; align-items:center; font-size:.9rem; }
.rm-hint { font-size:.8rem; color:var(--dim); line-height:1.35; }

/* booking the floor: the own icon flashes until touched, then stays lit */
.rm-seat.flash { animation:rmFlash .9s ease-in-out infinite; cursor:pointer; }
.rm-seat.booked { border-color:#1bfdc5; box-shadow:0 0 12px rgba(27,253,197,.6); }
@keyframes rmFlash { 0%,100% { box-shadow:0 0 0 rgba(255,255,255,0); border-color:#1d1d34; } 50% { box-shadow:0 0 12px rgba(255,255,255,.85); border-color:#fff; } }

.rm-seat.char.blocked { opacity: .55; }
.rm-ico-btn { padding: 0 10px; min-width: 42px; display: flex; align-items: center; justify-content: center; }
.rm-ico-btn svg { width: 20px; height: 20px; }
.rm-ico-btn:disabled { opacity: .4; }
.rm-ico-btn.recording { color: #ff3b30; border-color: #ff3b30; animation: rm-rec 1.2s ease-in-out infinite; }
.rm-ico-btn.on { background: #1bfdc5; color: #4a5a6a; }
@keyframes rm-rec { 50% { box-shadow: 0 0 0 4px rgba(255,59,48,.25); } }
.rm-btn.danger { color: #c0392b; }
.rm-card.private { border-color:#b08cff; background:linear-gradient(0deg,rgba(176,140,255,.07),rgba(176,140,255,.07)),var(--surface); }
.rm-scroll { max-height:210px; overflow-y:auto; border:1px solid var(--border); border-radius:10px; margin:6px 0; }
.rm-item { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:7px 10px; border-bottom:1px solid var(--border); }
.rm-item:last-child { border-bottom:0; }
.rm-item .who { display:flex; align-items:center; gap:8px; min-width:0; }
.rm-item .who img { width:28px; height:28px; border-radius:50%; object-fit:cover; }
.rm-link { background:none; border:0; padding:0; font:inherit; font-weight:600; color:#1bfdc5; cursor:pointer; white-space:nowrap; }
.rm-link.off { color:var(--dim); font-weight:400; }
