/* The community chat page. Builds on site.css (colours, buttons, header). */
.chat-page { min-height: 100vh; display: flex; flex-direction: column; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; } .grow { flex: 1; }
.msg { min-height: 1.4em; margin: 0; font-size: 14px; color: var(--gold); }
.login { padding: 56px 0 80px; }
.login h1 { font-size: clamp(30px, 5vw, 44px); margin: 0 0 12px; letter-spacing: -.02em; }
.card-form { display: grid; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 26px; margin-top: 26px; }
.card-form label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
input, textarea, select { font: inherit; color: var(--text); background: rgba(255,255,255,.05); border: 1px solid var(--line2); border-radius: 12px; padding: 11px 14px; width: 100%; }
input:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.howto { margin: 6px 0 0; padding-left: 20px; color: var(--muted); font-size: 14px; display: grid; gap: 4px; }
.block { width: 100%; }

.chat { flex: 1; min-height: 0; display: grid; grid-template-columns: 260px minmax(0, 1fr) 230px; gap: 14px; width: min(1400px, 100% - 28px); margin: 14px auto; height: calc(100vh - 68px - 28px); }
.panel { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; position: relative; }
.p-head, .p-foot { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.p-foot { border-bottom: 0; border-top: 1px solid var(--line); }
.p-sub { padding: 10px 14px 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); }
.titles { display: grid; min-width: 0; } .titles b { font-size: 16px; } .titles span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list { overflow-y: auto; flex: 1; padding: 6px; }
.item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: 0; border-radius: 10px; padding: 9px 10px; cursor: pointer; color: var(--muted); }
.item:hover { background: rgba(255,255,255,.06); color: var(--text); } .item.on { background: rgba(255,59,92,.16); color: var(--text); }
.item .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .item.joined .n { color: var(--text); font-weight: 600; }
.item .c { font-size: 12px; color: var(--dim); }
.badge { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; border-radius: 6px; padding: 2px 6px; }
.badge.owner { background: rgba(255,198,92,.2); color: var(--gold); } .badge.mod { background: rgba(34,211,238,.18); color: var(--cyan); } .badge.muted { background: rgba(255,255,255,.1); color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; } .dot.on { background: var(--green); }

.search { width: 170px; padding: 6px 12px; border-radius: 10px; font-size: 14px; }
.notice { padding: 10px 16px; background: rgba(255,198,92,.12); color: var(--gold); font-size: 14px; border-bottom: 1px solid var(--line); }
.messages { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.row-msg { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; padding: 6px 8px; border-radius: 12px; position: relative; }
.row-msg:hover { background: rgba(255,255,255,.04); }
.av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; }
.head { display: flex; align-items: baseline; gap: 8px; } .head b { font-size: 14.5px; } .head time { font-size: 12px; color: var(--dim); }
.body { white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; font-size: 15px; }
.body img { max-width: min(340px, 100%); max-height: 300px; border-radius: 12px; margin-top: 6px; display: block; cursor: zoom-in; }
.acts { position: absolute; right: 8px; top: 4px; display: none; gap: 4px; }
.row-msg:hover .acts { display: flex; } .acts button { background: var(--bg2); border: 1px solid var(--line2); border-radius: 8px; font-size: 12px; padding: 3px 8px; cursor: pointer; color: var(--muted); }
.acts button:hover { color: var(--text); }
.results { position: absolute; left: 0; right: 0; top: 56px; bottom: 0; background: var(--bg2); overflow-y: auto; padding: 14px 16px; z-index: 5; }
.composer { position: relative; display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.composer textarea { resize: none; max-height: 120px; flex: 1; }
.btn.icon { padding: 9px 12px; }
.emoji { position: absolute; bottom: 62px; left: 12px; width: min(330px, calc(100% - 24px)); display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; background: var(--bg2); border: 1px solid var(--line2); border-radius: 14px; padding: 8px; z-index: 6; }
.emoji button { background: none; border: 0; font-size: 22px; cursor: pointer; border-radius: 8px; padding: 4px; } .emoji button:hover { background: rgba(255,255,255,.1); }
.menu { position: fixed; z-index: 30; background: var(--bg2); border: 1px solid var(--line2); border-radius: 12px; padding: 6px; display: grid; min-width: 190px; box-shadow: 0 20px 50px -10px #000; }
.menu button { background: none; border: 0; text-align: left; padding: 8px 12px; border-radius: 8px; cursor: pointer; color: var(--text); } .menu button:hover { background: rgba(255,255,255,.08); }
.menu .danger { color: var(--red); }
dialog { background: var(--bg2); color: var(--text); border: 1px solid var(--line2); border-radius: 18px; padding: 22px; width: min(420px, 92vw); }
dialog::backdrop { background: rgba(0,0,0,.6); } dialog h3 { margin: 0 0 12px; } dialog .row { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
dialog label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); margin-bottom: 10px; } dialog .check { display: flex; gap: 8px; align-items: center; } dialog .check input { width: auto; }
.only-m { display: none; }
@media (max-width: 900px) {
  .chat { grid-template-columns: 1fr; height: calc(100dvh - 68px - 20px); margin: 10px auto; }
  .chat .panel { display: none; } .chat.v-rooms .rooms, .chat.v-chat .main, .chat.v-people .people { display: flex; }
  .only-m { display: inline-flex; } .search { width: 120px; } .composer { gap: 6px; padding: 10px; } .composer .btn { padding: 9px 10px; } .composer textarea { min-width: 0; }
}

/* ---------- v2: profiles, badges, voice notes, banner ---------- */
.banner { background: linear-gradient(95deg, rgba(255,59,92,.22), rgba(255,198,92,.2)); border-bottom: 1px solid var(--line2); text-align: center; padding: 9px 16px; font-size: 14.5px; }
.me-btn { display: flex; align-items: center; gap: 8px; background: none; border: 0; cursor: pointer; color: var(--text); min-width: 0; border-radius: 10px; padding: 4px 6px; }
.me-btn:hover { background: rgba(255,255,255,.06); } .me-btn .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.av { overflow: hidden; flex: none; } .av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av.sm { width: 26px; height: 26px; font-size: 12px; } .av.lg { width: 96px; height: 96px; font-size: 38px; }
button.av { border: 0; cursor: pointer; padding: 0; }
.nick { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--text); cursor: pointer; } .nick:hover { text-decoration: underline; }
.head { flex-wrap: wrap; }
.flair { display: inline-flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.item .av { margin-right: 2px; }

/* staff, owner and mods: always shown, always animated */
.badge.anim { color: #fff; background-size: 220% 100%; animation: badge-shine 2.6s linear infinite, badge-glow 2.2s ease-in-out infinite; text-shadow: 0 1px 2px rgba(0,0,0,.45); }
.badge.staff-admin { background-image: linear-gradient(100deg, #ff2d55, #ffb347, #ff2d55); --glow: 255,59,92; }
.badge.staff-mod { background-image: linear-gradient(100deg, #22d3ee, #8b5cf6, #22d3ee); --glow: 34,211,238; }
.badge.owner { background-image: linear-gradient(100deg, #f59e0b, #fff2b0, #f59e0b); color: #3b2600; text-shadow: none; --glow: 255,198,92; }
.badge.mod { background-image: linear-gradient(100deg, #14b8a6, #86efac, #14b8a6); color: #052e2b; text-shadow: none; --glow: 20,184,166; }
@keyframes badge-shine { to { background-position: -220% 0; } }
@keyframes badge-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(var(--glow), .0); } 50% { box-shadow: 0 0 10px 1px rgba(var(--glow), .55); } }
@media (prefers-reduced-motion: reduce) { .badge.anim { animation: none; } }
/* what a person chose to show or the admin gave them: quiet, not animated */
.badge.custom { background: rgba(139,92,246,.25); color: #d9c8ff; } .badge.trial { background: rgba(255,255,255,.1); color: var(--muted); }
.badge.sub { background: rgba(255,255,255,.1); color: var(--text); }
.badge.sub.bronze { background: rgba(205,127,50,.25); color: #f0b27a; } .badge.sub.silver { background: rgba(192,200,214,.22); color: #dfe6f1; }
.badge.sub.gold { background: rgba(255,198,92,.22); color: var(--gold); } .badge.sub.diamond { background: rgba(34,211,238,.2); color: #8be9f8; }

.voice { display: flex; align-items: center; gap: 10px; margin-top: 4px; flex-wrap: wrap; } .voice audio { height: 38px; width: min(300px, 100%); }
.cmp { display: flex; gap: 8px; align-items: flex-end; width: 100%; } .cmp-rec { display: none; align-items: center; }
.composer.recording .cmp-normal { display: none; } .composer.recording .cmp-rec { display: flex; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: #ff3b5c; animation: rec-pulse 1s ease-in-out infinite; } @keyframes rec-pulse { 50% { opacity: .25; } }
.profile { display: grid; justify-items: center; gap: 8px; text-align: center; } .profile .about { color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.profile .facts { color: var(--muted); font-size: 14px; }
.picker { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; } .picker .btns { display: grid; gap: 6px; }
dialog select, dialog textarea { width: 100%; } dialog textarea { resize: vertical; min-height: 64px; }
.hint { font-size: 12.5px; color: var(--dim); margin: 0 0 8px; }
.switch { text-align: center; margin: 14px 0 0; } .linkbtn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 14px; } .linkbtn:hover { color: var(--text); }
.tag-inv { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; border-radius: 6px; padding: 2px 6px; background: rgba(255,255,255,.1); color: var(--muted); }
#messages:not(.can-mod) .acts .modonly { display: none; } /* Delete on other people's messages: moderators and staff only */
