* { box-sizing: border-box; }
body { background:#1a1208; color:#e8d8c3; font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; margin:0; text-align:center; }
.hidden { display:none !important; }
button { font-family:inherit; }

/* top bar */
.top { display:flex; justify-content:center; align-items:center; gap:16px; flex-wrap:wrap; padding:10px 6px 6px; }
.top nav { display:flex; gap:5px; }
.nav-btn { background:rgba(60,45,25,.6); color:#e8d8c3; border:1px solid #5d432c; padding:6px 12px; border-radius:20px; text-decoration:none; font-size:.72rem; cursor:pointer; }
.nav-btn.green { background:#4CAF50; color:#fff; border-color:#4CAF50; }
.nav-btn.gold { background:#d29650; color:#000; border-color:#d29650; }
.viewer-box { color:#ffcc00; font-size:.85rem; display:flex; align-items:center; gap:6px; }
.conn { width:9px; height:9px; border-radius:50%; background:#777; display:inline-block; }
.conn.ok { background:#50d296; } .conn.bad { background:#ff6b6b; animation:pulse 1s infinite; }
@keyframes pulse { 50% { opacity:.3; } }

.container { max-width:860px; margin:0 auto; padding:5px; display:flex; flex-direction:column; }
.share-row { order:60; } .foot { order:61; }
body.audio-bottom #audio-bar { order:50; margin-top:10px; }
.audio-note { background:#2e1f0f; color:#ffcc00; border:1px solid #e81e4d; border-radius:8px; padding:6px 10px; font-size:.8rem; margin:4px 0 6px; cursor:pointer; text-align:left; }

/* audio */
.audio-bar { background:#2e1f0f; border:2px solid #e81e4d; border-radius:10px; margin:6px 0 10px; padding:8px 10px; text-align:left; }
.audio-head { display:flex; justify-content:space-between; align-items:center; gap:8px; color:#ffcc00; font-size:.9rem; }
.audio-body { margin-top:8px; background:#fff; border-radius:8px; padding:6px; overflow:hidden; }
.audio-body.collapsed { height:0; padding:0; margin:0; }
.yt-box { display:flex; align-items:center; gap:12px; margin-top:8px; }
.yt-box iframe { width:200px; height:200px; border:0; border-radius:8px; background:#000; flex:none; }
.yt-box p { margin:0; font-size:.85rem; color:#e8d8c3; }
.mini-btn { background:#5d432c; color:#fff; border:none; border-radius:5px; padding:4px 10px; cursor:pointer; font-size:.75rem; white-space:nowrap; }

/* offline */
.offline-box { padding:40px 20px; border:2px dashed #5d432c; border-radius:15px; margin:20px 0; }
.offline-box h1 { color:#d29650; }
.big-btn { background:#d29650; color:#000; border:none; padding:13px 26px; border-radius:8px; font-weight:bold; font-size:1rem; cursor:pointer; }
.big-btn.grey { background:#5d432c; color:#fff; }

/* host panel */
.host-panel { background:#332211; border:1px solid #ffcc00; border-radius:8px; padding:8px; margin-bottom:8px; text-align:left; }
.host-row { display:flex; flex-wrap:wrap; align-items:center; gap:5px; margin:4px 0; }
.host-status { justify-content:flex-start; color:#ffcc00; }
.live-badge { font-weight:bold; font-size:.8rem; padding:2px 8px; border-radius:10px; }
.live-badge.on { background:#e81e4d; color:#fff; } .live-badge.off { background:#555; color:#ddd; }
.unread-row { background:#1a1208; border:1px solid #d29650; border-radius:6px; padding:6px; }
.unread-count { font-size:1rem; margin-right:6px; }
.unread-count b { font-size:1.3rem; color:#50d296; }
.unread-count.some b { color:#ffcc00; } .unread-count.lots b { color:#ff6b6b; }
.tool-btn, .award-btn { background:#d29650; color:#000; border:none; padding:5px 9px; border-radius:4px; font-weight:bold; cursor:pointer; font-size:.74rem; }
.award-btn { background:#ffcc00; }
.tool-btn.red, .award-btn.red { background:#ff6b6b; color:#000; }
.tool-btn.green, .award-btn.green { background:#2ecc71; color:#fff; }
.tool-btn.purple, .award-btn.purple { background:#9b59b6; color:#fff; }
.award-btn.blue { background:#3498db; color:#fff; } .award-btn.orange { background:#ff9800; }
.tool-btn.grey, .award-btn.grey { background:#777; color:#fff; }
.tool-btn.on { outline:2px solid #fff; background:#ff6b6b; }
.slow-label { font-size:.78rem; display:flex; align-items:center; gap:4px; }
select { background:#1a1208; color:#e8d8c3; border:1px solid #5d432c; border-radius:4px; padding:4px; font-size:.78rem; }

/* god chat */
.god-panel { background:#1a0808; border:2px solid #ff6b6b; border-radius:10px; padding:8px; margin-bottom:8px; text-align:left; }
.god-panel h4 { margin:0 0 6px; color:#ff6b6b; font-size:.85rem; text-align:center; }
.god-panel small { color:#aa7777; font-weight:normal; }
.god-box { max-height:90px; overflow-y:auto; background:#0f0404; border-radius:5px; padding:6px; margin-bottom:6px; border:1px solid #4a1a1a; }
.god-msg { border-left:3px solid #ff6b6b; padding:3px 6px; margin-bottom:3px; font-size:.82rem; overflow-wrap:anywhere; }
.god-msg b { color:#ff6b6b; }
.god-panel textarea { width:100%; background:#2a0a0a; color:#fff; border:1px solid #4a1a1a; border-radius:5px; padding:6px; resize:none; font-family:inherit; }

/* popups above chat */
.popup { border-radius:8px; padding:12px 38px 12px 12px; position:relative; margin-bottom:10px; text-align:left; }
.popup.topic { background:rgba(210,150,80,.25); border:3px solid #d29650; }
.popup.poll { background:rgba(255,107,107,.2); border:3px solid #ff6b6b; }
.popup.pinned { background:rgba(255,204,0,.2); border:3px solid #ffcc00; }
.popup small { display:block; color:#aaa; font-size:.72rem; margin-top:4px; }
.dismiss { position:absolute; top:8px; right:8px; background:#ff6b6b; color:#fff; border:none; border-radius:4px; padding:3px 8px; cursor:pointer; font-weight:bold; }
.poll-btn { background:#d29650; color:#000; border:none; padding:7px 12px; border-radius:4px; font-weight:bold; cursor:pointer; margin:6px 6px 0 0; }
.poll-btn:disabled { background:#666; color:#ccc; cursor:default; }
.banner { background:#ff6b6b; color:#000; padding:10px; font-weight:bold; border-radius:6px; margin-bottom:8px; }
.banner.info { background:#3a2a10; color:#ffcc00; border:1px solid #d29650; }

/* chat */
.chat-wrap { position:relative; }
.chat { height:52vh; min-height:260px; background:#000; border:1px solid #5d432c; border-radius:10px; overflow-y:auto; text-align:left; padding:8px; overscroll-behavior:contain; }
.msg { padding:9px 8px; border-bottom:1px solid #2a2a2a; font-size:.92rem; border-radius:4px; overflow-wrap:anywhere; line-height:1.35; }
.msg:nth-child(odd) { background:#0a0a0a; } .msg:nth-child(even) { background:#1e1e1e; }
.msg .txt { color:#f2ead9; white-space:pre-wrap; }
.msg.mod { background:rgba(210,150,80,.12) !important; border-left:4px solid #d29650; }
.msg.first { border-left:5px solid #ffcc00 !important; background:rgba(255,204,0,.08) !important; }
.msg.system { background:rgba(255,204,0,.12) !important; border-left:4px solid #ffcc00; }
.msg.system .txt { color:#ffcc00; font-weight:bold; }
.msg.mine .txt { color:#fff; }
.msg.answered { background:rgba(80,210,150,.14) !important; border-left:4px solid #50d296 !important; }
.msg.read { opacity:.45; }
.msg.first-unread { box-shadow:inset 0 3px 0 #50d296; }
.msg.flash { animation:flash 1.2s; }
@keyframes flash { 0% { background:#5d432c; } }
.name-box { font-weight:bold; color:#d29650; display:inline-flex; align-items:center; gap:5px; cursor:default; }
.mod-view .name-box { cursor:pointer; }
.thumb { width:24px; height:24px; border-radius:50%; border:1px solid #5d432c; object-fit:cover; vertical-align:middle; }
.badge { font-size:.95rem; }
.badge.numpty { color:#ff9800; font-size:.7rem; border:1px solid #ff9800; border-radius:4px; padding:1px 4px; background:rgba(255,152,0,.1); }
.reply-tag { color:#ffcc00; font-size:.8rem; font-weight:bold; margin-right:4px; }
.acts { display:inline-flex; gap:2px; margin-left:6px; vertical-align:middle; }
.acts button { background:none; border:none; color:#999; cursor:pointer; font-size:.85rem; padding:1px 3px; }
.acts button:hover { color:#ffcc00; }
.acts .liked { color:#d29650; }
.acts .lc { font-size:.75rem; color:#aaa; margin-right:3px; }
.tm { color:#666; font-size:.7rem; margin-right:4px; }
.divider { text-align:center; color:#d29650; font-size:.75rem; margin:8px 0; opacity:.8; }
.new-pill { position:absolute; bottom:12px; left:50%; transform:translateX(-50%); background:#d29650; color:#000; border:none; border-radius:20px; padding:7px 16px; font-weight:bold; cursor:pointer; box-shadow:0 2px 8px rgba(0,0,0,.6); }

/* composer */
.composer { margin-top:6px; }
.reply-ind { background:#2e1f0f; color:#ffcc00; border-radius:6px; padding:5px 8px; font-size:.8rem; text-align:left; margin-bottom:4px; }
.reply-ind button { background:none; border:none; color:#ff6b6b; cursor:pointer; float:right; font-weight:bold; }
.input-wrap { position:relative; }
#msg { width:100%; padding:10px 52px 10px 10px; border-radius:8px; border:1px solid #5d432c; background:#2e1f0f; color:#fff; resize:none; font-family:inherit; font-size:1rem; }
#msg:disabled { opacity:.6; }
.send-btn { position:absolute; right:8px; top:50%; transform:translateY(-55%); width:38px; height:38px; border-radius:50%; border:none; background:#d29650; color:#000; font-size:1.1rem; cursor:pointer; }
.send-btn:disabled { background:#444; color:#777; }
.under-input { display:flex; justify-content:space-between; align-items:center; margin-top:3px; }
.emoji-row button { background:none; border:none; font-size:1.25rem; cursor:pointer; padding:2px 4px; }
.chars { font-size:.72rem; color:#aaa; }
.compact-row { display:flex; justify-content:center; flex-wrap:wrap; gap:8px; margin-top:6px; }

.share-row { margin-top:16px; display:flex; justify-content:center; gap:8px; flex-wrap:wrap; font-size:.8rem; align-items:center; }
.share-btn { background:#2e1f0f; border:1px solid #5d432c; color:#e8d8c3; padding:6px 12px; border-radius:5px; cursor:pointer; font-size:.75rem; }
.foot { margin:18px 0 30px; font-size:.75rem; } .foot a { color:#7a6650; }

/* modals */
.modal { position:fixed; inset:0; background:rgba(0,0,0,.85); z-index:1000; display:flex; align-items:center; justify-content:center; padding:15px; }
.modal-box { background:#2e1f0f; border:3px solid #d29650; border-radius:15px; padding:22px; max-width:500px; width:100%; text-align:left; max-height:90vh; overflow-y:auto; }
.modal-box.small { max-width:380px; } .modal-box.wide { max-width:760px; }
.modal-box h2, .modal-box h3 { color:#ffcc00; text-align:center; margin-top:0; }
.modal-box li { margin-bottom:9px; line-height:1.4; }
.modal-box input { width:100%; padding:11px; margin:6px 0; border-radius:6px; border:1px solid #5d432c; background:#1a1208; color:#fff; font-size:1rem; }
.modal-actions { display:flex; gap:8px; justify-content:center; flex-wrap:wrap; margin-top:14px; }
.err { color:#ff6b6b; min-height:1.2em; font-size:.85rem; }
.check { display:flex; gap:8px; align-items:flex-start; margin:10px 0; font-size:.9rem; }
.check input { width:auto; margin-top:3px; }
.small-note { font-size:.8rem; color:#c9b89f; margin:10px 0 0; }
.archive-body { max-height:60vh; overflow-y:auto; }
.archive-item { display:flex; justify-content:space-between; padding:9px; border-bottom:1px solid #5d432c; cursor:pointer; }
.archive-item:hover { background:#3a2a14; }

.toast { position:fixed; bottom:20px; left:50%; transform:translateX(-50%); background:#ffcc00; color:#000; padding:10px 18px; border-radius:8px; font-weight:bold; z-index:2000; max-width:90vw; }

/* hearts */
.floating-heart { position:fixed; pointer-events:none; font-size:24px; animation:float-up 3s ease-out forwards; z-index:999; }
@keyframes float-up {
  0% { transform:translate(0,0) scale(.5); opacity:1; }
  50% { transform:translate(20px,-100px) scale(1); opacity:.8; }
  100% { transform:translate(-20px,-300px) scale(.8); opacity:0; }
}
.sends-love { position:fixed; top:45%; left:50%; transform:translate(-50%,-50%); background:rgba(255,204,0,.95); color:#000; padding:14px 28px; border-radius:10px; font-weight:bold; font-size:1.2rem; z-index:1001; pointer-events:none; animation:fade 3s ease-in-out forwards; }
@keyframes fade { 0%,100% { opacity:0; } 20%,80% { opacity:1; } }

@media (max-width:768px) {
  .container { padding:0; }
  .chat { height:calc(100vh - 330px); height:calc(100dvh - 330px); min-height:200px; border-radius:0; border-left:none; border-right:none; overscroll-behavior:auto; }
  .yt-box { gap:10px; }
  .yt-box iframe { width:200px; height:200px; }
  .yt-box p { font-size:.8rem; }
  .audio-bar { margin:4px 0 6px; padding:6px 8px; }
  .host-panel, .god-panel, .audio-bar { border-radius:0; }
  .composer { background:#1a1208; padding:8px; border-top:2px solid #5d432c; }
  .msg { font-size:.95rem; }
  .acts button { padding:2px 5px; }
}
