:root {
  --bg: #0b1020;
  --bg-2: #111832;
  --panel: #151d3a;
  --line: #243058;
  --text: #eef1fa;
  --muted: #8f9bbf;
  --red: #e0283d;
  --red-2: #ff4a5c;
  --mine: #1d2546;
  --soft: 143, 155, 191;
  --gold: #d9b56a;
  --ok: #3ccf8e;
  --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea { font: inherit; color: var(--text); }
a { color: var(--red-2); }

.dot { display: inline-block; width: .55em; height: .55em; border-radius: 50%; background: var(--red);
  box-shadow: 0 0 0 .18em rgba(224, 40, 61, .25); margin-inline-end: .45em; vertical-align: .08em; }
.muted { color: var(--muted); }

.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: .65em 1.1em; font-weight: 600; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-2); }
.btn.ghost { background: transparent; }
.link { background: none; border: 0; color: var(--muted); padding: .3em; text-decoration: underline; }

/* Auth */
.auth { min-height: 100%; display: grid; place-items: center; padding: calc(24px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)); }
.auth-card { width: 100%; max-width: 400px; background: rgba(21, 29, 58, .85); border: 1px solid var(--line);
  border-radius: 20px; padding: 32px 28px 22px; backdrop-filter: blur(8px); box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.brand-big { display: flex; align-items: center; gap: 12px; font-size: 34px; font-weight: 800; letter-spacing: .01em; }
.brand-big .c, .brand .c, .talk { color: var(--red-2); }
.room.on .talk { color: #fff; }
.tagline { color: var(--muted); margin: 6px 0 22px; }
.tabs { display: flex; gap: 4px; background: var(--bg-2); padding: 4px; border-radius: 12px; margin-bottom: 18px; }
.tab { flex: 1; border: 0; background: none; padding: .55em; border-radius: 9px; color: var(--muted); font-weight: 600; }
.tab.active { background: var(--panel); color: var(--text); }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-note { color: var(--muted); font-size: 12px; margin-top: -6px; }
.form select { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: .7em .6em; font-size: 15px; color: var(--text); }
.form input[type=date] { color-scheme: dark; }
.form input:not([type=checkbox]) { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: .7em .8em; font-size: 15px; }
.form input:focus, textarea:focus { outline: 2px solid rgba(224, 40, 61, .55); outline-offset: 0; }
.form small { color: var(--muted); font-size: 12px; }
.form .check { display: flex; gap: 10px; align-items: flex-start; color: var(--text); font-size: 14px; }
.form .check input { margin-top: 3px; accent-color: var(--red); }
.auth-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 22px; font-size: 13px; color: var(--muted); }
.auth-foot a { color: var(--muted); }
/* Language dropdown (same look as on the landing page) */
.lang-menu { position: relative; }
.lang-menu summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px;
  border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text);
  font-size: 13px; font-weight: 700; letter-spacing: .04em; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover, .lang-menu[open] summary { background: rgba(var(--soft), .12); border-color: rgba(var(--soft), .6); }
.lang-menu .globe { color: var(--muted); }
.lang-menu[open] .chev { transform: rotate(180deg); }
.lang-list { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); min-width: 170px; padding: 6px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(0, 0, 0, .45); z-index: 35; }
.auth-foot .lang-list { top: auto; bottom: calc(100% + 6px); inset-inline-start: 0; inset-inline-end: auto; }
.lang-list button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: start; border: 0; background: none; padding: .55em .7em; border-radius: 8px; font-size: 14px; }
.lang-list button b { font-size: 11px; color: var(--muted); width: 20px; }
.lang-list button:hover { background: var(--bg-2); }
.lang-list button.on { background: rgba(var(--soft), .12); }
.lang-list button.on::after { content: "✓"; margin-inline-start: auto; color: var(--muted); font-weight: 800; }

/* Chat layout */
.chat { height: 100%; height: 100dvh; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 16px; padding: calc(10px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) 10px calc(16px + env(safe-area-inset-left)); border-bottom: 1px solid var(--line);
  background: rgba(11, 16, 32, .8); backdrop-filter: blur(8px); }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; letter-spacing: .01em; text-decoration: none; color: inherit; }
.rooms { display: flex; gap: 6px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.room { border: 1px solid var(--line); background: none; border-radius: 999px; padding: .35em .9em; white-space: nowrap; color: var(--muted); font-weight: 600; font-size: 14px; }
.room.on { background: var(--red); border-color: var(--red); color: #fff; }
.room.community { border-color: var(--line); color: var(--text); }

/* Top bar: overview button + current room */
.rooms { align-items: center; gap: 10px; }
.overview-btn { flex: none; width: 38px; height: 34px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); }
.overview-btn:hover { color: var(--text); border-color: rgba(var(--soft), .8); }
.overview-btn.on { color: #fff; background: var(--red); border-color: var(--red); }
.current-room { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.current-icon { font-size: 18px; display: inline-flex; }
.current-icon .icon-img { width: 22px; height: 22px; }
.tile .ic .icon-img { width: 30px; height: 30px; display: block; }

/* Overview (lobby) */
.lobby { flex: 1; min-height: 0; overflow-y: auto; }
.lobby-wrap { max-width: 1000px; margin: 0 auto; padding: 26px 20px calc(40px + env(safe-area-inset-bottom)); }
.lobby-hello { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.lobby-hello h1 { margin: 0; font-size: clamp(20px, 2.6vw, 24px); }
.lobby-hello p { margin: 4px 0 0; color: var(--muted); }
.lobby-live { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 14px; color: var(--muted); }
.lobby-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(60, 207, 142, .2); }
.lobby-live b { color: var(--text); }
.lobby h2 { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 24px 0 10px; display: flex; justify-content: space-between; gap: 10px; }
.lobby h2 small { text-transform: none; letter-spacing: 0; font-size: 13px; }
.lobby button { text-align: start; color: var(--text); }
.lobby-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.lobby-note { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.lobby-note .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; background: var(--bg-2); flex: none; }
.lobby-note b, .lobby-note small { display: block; }
.lobby-note small { color: var(--muted); }
.lobby-note .go { margin-inline-start: auto; color: var(--muted); font-size: 18px; }
.lobby-note.dm { border-color: rgba(224, 40, 61, .6); background: linear-gradient(135deg, rgba(224, 40, 61, .16), var(--panel)); }
.lobby-note.dm .ic { background: var(--red); }
.lobby-suggest { width: 100%; margin-top: 10px; text-align: start; border-style: dashed; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.lobby-suggest:hover { border-color: rgba(var(--soft), .8); background: var(--panel); }
.lobby-main { width: 100%; display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: 18px; border: 1px solid var(--line);
  background: linear-gradient(140deg, rgba(224, 40, 61, .14) 0%, rgba(21, 29, 58, .95) 55%), var(--panel); transition: transform .15s, border-color .15s; }
.lobby-main:hover { transform: translateY(-2px); border-color: var(--red); }
.lobby-main .row { display: flex; align-items: center; gap: 12px; }
.lobby-main .ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: var(--red); flex: none; }
.lobby-main h3 { margin: 0; font-size: 20px; }
.lobby-main .meta { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.lobby-main .last { background: rgba(11, 16, 32, .55); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-main .last b { color: var(--muted); margin-inline-end: 6px; }
.lobby-main .enter { align-self: flex-start; background: var(--red); color: #fff; font-weight: 700; border-radius: 10px; padding: 8px 14px; font-size: 14px; }
.lobby .on { color: var(--ok); font-weight: 700; }
.lobby .quiet { color: var(--muted); }
.tile { display: flex; flex-direction: column; gap: 3px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(21, 29, 58, .75); transition: border-color .15s, transform .15s; }
.tile:hover { transform: translateY(-2px); border-color: rgba(var(--soft), .8); }
.tile .ic { font-size: 24px; margin: 4px 0 2px; }
.tile b { font-size: 15px; line-height: 1.25; }
.tile small { font-size: 12px; }
/* Private messages tile + inbox */
.tile.tile-pm.has-new { border-color: rgba(60, 207, 142, .75); }
.tile .new { color: var(--ok); font-weight: 700; }
.inbox-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.inbox-head h1 { margin: 0; font-size: clamp(22px, 4vw, 30px); }
.inbox-head .back { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: .4em .8em; color: var(--muted); }
.inbox-note { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.inbox-empty { margin: 40px auto; }
.inbox-list { display: grid; gap: 8px; }
.inbox-row { display: flex; align-items: stretch; gap: 6px; border: 1px solid var(--line); border-radius: 14px; background: rgba(21, 29, 58, .75); }
.inbox-row.unread { border-color: rgba(224, 40, 61, .6); }
.inbox-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 12px; text-align: start; color: var(--text); }
.inbox-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.inbox-top { display: flex; align-items: center; gap: 6px; }
.inbox-top b { font-size: 15px; }
.dot-on { color: var(--ok); font-size: 10px; }
.inbox-preview { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-preview.expired { font-style: italic; }
.inbox-row.unread .inbox-preview { color: var(--text); }
.inbox-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; color: var(--muted); font-size: 12px; }
.inbox-del { flex: none; width: 48px; display: grid; place-items: center; padding: 0; line-height: 1; border: 0; border-inline-start: 1px solid var(--line); background: none; border-radius: 0 14px 14px 0; font-size: 16px; opacity: .7; }
.inbox-del:hover { opacity: 1; background: rgba(224, 40, 61, .12); }
[dir=rtl] .inbox-del { border-radius: 14px 0 0 14px; }.lobby-start { margin-top: 6px; }
.lobby-mainrow { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.tile.tile-main { border-color: rgba(224, 40, 61, .6); background: linear-gradient(160deg, rgba(224, 40, 61, .16), rgba(21, 29, 58, .9)); }
.tile.tile-main:hover { border-color: var(--red-2); }
.lobby-events { display: flex; gap: 10px; overflow-x: auto; padding: 6px 2px 6px; margin: -6px -2px 0; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.lobby-events .tile { flex: none; width: 190px; }
.lobby-events .when { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.lobby-events .tile.live { border-color: rgba(224, 40, 61, .6); }
.lobby-events .tile.live .when { color: var(--red-2); }
.lobby-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.lobby-langs { display: flex; gap: 10px; overflow-x: auto; padding: 6px 2px 6px; margin: -6px -2px 0; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.lobby-langs .tile { flex: none; width: 170px; }
.lobby-langs .tile b { font-size: 17px; }
.lobby-langs .tile.mine { border-color: rgba(var(--soft), .7); }
.lobby-foot { display: flex; gap: 8px; align-items: center; margin-top: 26px; color: var(--muted); font-size: 14px; cursor: pointer; }
.lobby-foot input { accent-color: var(--red); }
.room.community.on { background: var(--red); border-color: var(--red); color: #fff; }
.top-right { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.me-btn { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: .35em .9em; font-weight: 600; font-size: 14px; }
.icon-btn { display: none; position: relative; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; width: 38px; height: 34px; }

.main { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 260px; }
.pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.pane-head { padding: 12px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; font-weight: 700; }
.pane-head .sub { color: var(--muted); font-weight: 400; font-size: 13px; }
.pane-head .back { border: 1px solid var(--line); background: none; border-radius: 8px; padding: .2em .6em; color: var(--muted); }
.pane-head .clear { margin-left: auto; font-weight: 400; font-size: 13px; }
.pane-head .clear:hover { color: var(--red-2); border-color: var(--red); }
.log { flex: 1; overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 2px; }
.empty { margin: auto; color: var(--muted); text-align: center; max-width: 280px; }

.msg { display: grid; grid-template-columns: auto 1fr auto auto; gap: 0 10px; padding: 5px 8px; border-radius: 10px; align-items: baseline; }
.msg:hover { background: rgba(255, 255, 255, .03); }
.msg .nick { font-weight: 700; border: 0; background: none; padding: 0; color: var(--nick, #9fb4ff); }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg .time { color: var(--muted); font-size: 11px; }
.msg .flag { grid-column: 3; border: 0; background: none; color: var(--muted); font-size: 12px; opacity: 0; padding: 0 2px; }
.msg:hover .flag, .msg .flag:focus { opacity: 1; }
.msg.mine .nick { color: var(--red-2); }

.bubble-row { display: flex; margin: 3px 0; }
.bubble-row.mine { justify-content: flex-end; }
.bubble { max-width: 75%; background: var(--panel); border: 1px solid var(--line); border-radius: 16px 16px 16px 4px; padding: .5em .8em; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble-row.mine .bubble { background: var(--mine); border-color: rgba(224, 40, 61, .35); border-radius: 16px 16px 4px 16px; }
.bubble .time { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.bubble .flag { border: 0; background: none; color: var(--muted); font-size: 11px; padding: 0; margin-left: 8px; }

.pane { position: relative; }
.app-nudge { position: absolute; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 25; display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
.app-nudge img { width: 34px; height: 34px; border-radius: 9px; }
.app-nudge span { flex: 1; font-size: 14px; }
.app-nudge .btn { padding: .5em .9em; font-size: 14px; }
.nudge-x { border: 0; background: none; color: var(--muted); font-size: 22px; line-height: 1; padding: 0 4px; }
.composer { position: relative; display: flex; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }

/* Emoji picker */
.emoji-btn { flex: none; width: 44px; border: 1px solid var(--line); background: var(--bg-2); border-radius: 12px; font-size: 20px; line-height: 1; }
.emoji-btn:hover { border-color: rgba(var(--soft), .8); }
.emoji-panel { position: absolute; bottom: calc(100% + 6px); inset-inline-start: 16px; width: min(360px, calc(100vw - 32px)); background: var(--panel);
  border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); z-index: 30; overflow: hidden; }
.emoji-tabs { display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.emoji-tabs button { flex: 1; border: 0; background: none; border-radius: 8px; padding: 6px 0; font-size: 18px; opacity: .55; }
.emoji-tabs button.on, .emoji-tabs button:hover { opacity: 1; background: var(--panel); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 8px; max-height: 230px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.emoji-grid button { border: 0; background: none; border-radius: 8px; font-size: 24px; line-height: 1; padding: 6px 0; }
.emoji-grid button:hover { background: var(--bg-2); transform: scale(1.15); }
.msg .body.jumbo { font-size: 30px; line-height: 1.2; }
.bubble.jumbo { font-size: 34px; line-height: 1.2; background: none !important; border-color: transparent !important; padding: 0; }
.composer textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer textarea { flex: 1; resize: none; overflow-y: hidden; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: .65em .85em; max-height: 140px; }
.composer.closed { opacity: .5; pointer-events: none; }

.side { border-inline-start: 1px solid var(--line); overflow-y: auto; padding: 8px 10px; background: rgba(17, 24, 50, .5); }
.side-close { display: none; }
.side h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 14px 8px 6px; }
.count { color: var(--ok); }
.list { list-style: none; margin: 0; padding: 0; }
.list button { width: 100%; text-align: start; border: 0; background: none; border-radius: 9px; padding: .45em .6em; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.list button:hover, .list button.on { background: var(--panel); }
.list .who::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-inline-end: 8px; vertical-align: .1em; }
.list .who.off::before { background: var(--line); }
.list .none { color: var(--muted); font-size: 13px; padding: .3em .6em; }
.badge { background: var(--red); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 0 .5em; min-width: 1.6em; text-align: center; }
.icon-btn .badge { position: absolute; top: -6px; right: -6px; }

/* Menu, modal, toasts */
.menu { position: fixed; z-index: 30; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px; min-width: 190px; box-shadow: 0 16px 40px rgba(0, 0, 0, .45); }
.menu .title { padding: .4em .7em; font-weight: 700; color: var(--muted); font-size: 13px; }
.menu button { display: block; width: 100%; text-align: start; border: 0; background: none; padding: .55em .7em; border-radius: 8px; }
.menu button:hover { background: var(--bg-2); }
.menu button.danger { color: var(--red-2); }

/* Profile card (opens from a nickname) and profile editor */
.profile { width: 260px; max-width: 80vw; padding: 8px 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.profile-head { display: flex; align-items: center; gap: 10px; }
.avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #0b1020; font-size: 18px; }
.profile-name { display: flex; flex-direction: column; min-width: 0; }
.profile-name b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; }
.profile-name small { color: var(--muted); font-size: 13px; }
.profile-online { margin-inline-start: auto; font-size: 12px; color: var(--ok); }
.profile-bio { margin: 10px 0 0; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-bio.empty { color: var(--muted); font-style: italic; }
.profile-form { display: grid; gap: 14px; }
.profile-form label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.profile-form select { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: .6em; color: var(--text); font: inherit; }
.profile-form input[type=date] { color-scheme: dark; }
.profile-form small { font-size: 12px; }
.profile-form .count-chars { text-align: end; }
.profile-age { margin: 0; color: var(--text); }
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(5, 8, 18, .7); display: grid; place-items: center; padding: 16px; }
.modal-card { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.modal-card h2 { margin: 0 0 8px; font-size: 19px; }
.modal-card p { color: var(--muted); margin: 0 0 14px; }
.modal-card .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.modal-card textarea, .modal-card input { width: 100%; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: .65em .8em; }
.code { font: 700 22px/1.2 ui-monospace, Consolas, monospace; letter-spacing: .08em; text-align: center; background: var(--bg-2); border: 1px dashed var(--red); border-radius: 12px; padding: 16px; user-select: all; }
.report { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; font-size: 14px; }
.report .meta { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.report .q { background: var(--bg-2); border-radius: 8px; padding: 6px 8px; margin: 6px 0; white-space: pre-wrap; }
.report .row { display: flex; gap: 6px; flex-wrap: wrap; }
.report .btn { padding: .35em .7em; font-size: 13px; }
.reports-list { max-height: 60vh; overflow-y: auto; }
.setting { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; color: var(--text); }
.setting input { width: auto; accent-color: var(--red); margin-top: 4px; }
.toasts { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); z-index: 50; display: grid; gap: 8px; width: min(92vw, 380px); }
.toast { background: var(--panel); border: 1px solid var(--red); color: var(--text); border-radius: 12px; padding: .7em 1em; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); animation: in .2s ease-out; }
.toast.ok { background: #10291f; border-color: var(--ok); }
@keyframes in { from { opacity: 0; transform: translateY(6px); } }

/* Overview: on a computer the room layout is hidden; on a phone only the chat pane is,
   so the side menu (a fixed drawer there) still opens. */
.chat.in-lobby .main { display: none; }
.chat.in-lobby .room-only { display: none; }
.side-account { display: none; }
.acc-head { display: flex; align-items: center; gap: 10px; padding: 4px 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.acc-head b { display: block; font-size: 16px; }
.acc-head small { color: var(--muted); font-size: 12px; }
.acc-actions button { display: block; width: 100%; text-align: start; border: 0; background: none; border-radius: 9px; padding: .55em .6em; font-size: 15px; }
.acc-actions button:hover { background: var(--panel); }
.acc-actions button.danger { color: var(--red-2); }
.acc-box > summary { list-style: none; cursor: pointer; }
.acc-box > summary::-webkit-details-marker { display: none; }
.acc-box .acc-head { border-bottom: 0; margin-bottom: 0; padding: 6px 8px; border-radius: 10px; }
.acc-box[open] .acc-head { border-bottom: 1px solid var(--line); border-radius: 10px 10px 0 0; margin-bottom: 6px; }
.acc-gear { margin-inline-start: auto; font-size: 16px; opacity: .75; transition: transform .2s; }
.acc-box[open] .acc-gear { transform: rotate(60deg); opacity: 1; }
.acc-lang-menu { margin: 4px 0 2px; }
.acc-lang-menu summary { display: flex; width: 100%; padding: .55em .6em; border: 0; background: none; font-size: 15px; border-radius: 9px; }
.acc-lang-menu summary:hover, .acc-lang-menu[open] summary { background: var(--panel); border: 0; }
.acc-lang-menu .acc-lang-label { color: var(--text); font-weight: 400; }
.acc-lang-menu .globe { order: -1; }
.acc-lang-menu .lang-current { margin-inline-start: auto; color: var(--muted); font-weight: 400; }
.acc-lang-menu .lang-list { position: static; margin-top: 4px; box-shadow: none; }

@media (max-width: 760px) {
  .chat.in-lobby .main { display: block; flex: 0 0 0; min-height: 0; }
  .chat.in-lobby .pane { display: none; }
  .side { display: flex; flex-direction: column; }
  .side > h3:first-of-type { margin-top: 44px; }
  .side-account { display: block; order: 10; margin-top: auto; position: sticky; bottom: calc(-8px - env(safe-area-inset-bottom)); background: var(--bg-2); border-top: 1px solid var(--line); margin-inline: -10px; padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); }
  .top .lang-menu, .top .me-btn { display: none; }
  .top { gap: 10px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; flex-wrap: wrap; }
  .lobby-topics, .lobby-mainrow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lobby-wrap { padding-left: 14px; padding-right: 14px; }
  .lobby-events .tile, .lobby-langs .tile { width: 150px; }
  .rooms { order: 3; flex-basis: 100%; }
  .top-right { margin-left: auto; }
  .top .lang-menu summary .chev, .top .lang-menu summary .lang-current { display: none; }
  .top .lang-menu summary { padding: 7px 9px; }
  .icon-btn { display: inline-block; }
  .main { grid-template-columns: 1fr; }
  .side { position: fixed; top: 0; right: 0; bottom: 0; width: min(80vw, 300px); z-index: 20; background: var(--bg-2);
    transform: translateX(100%); transition: transform .2s ease; padding-top: 16px; }
  .side.open { transform: none; box-shadow: -20px 0 60px rgba(0, 0, 0, .5); }
  .side { padding-top: calc(16px + env(safe-area-inset-top)); }
  .side-close { display: grid; place-items: center; position: absolute; top: calc(10px + env(safe-area-inset-top)); inset-inline-end: 10px; width: 36px; height: 36px; border-radius: 10px;
    border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 22px; line-height: 1; }
  [dir=rtl] .side { right: auto; left: 0; transform: translateX(-100%); }
  [dir=rtl] .side.open { transform: none; }
  .pane-head { padding: 10px 12px; }
  .pane-head .sub { display: none; }
  .pane-head:not(:has(.back)) { display: none; }
  .log { padding: 10px 12px; }
  .msg { grid-template-columns: auto 1fr auto; }
  .msg .time { display: none; }
  .msg .flag { opacity: .6; grid-column: 2; justify-self: end; }
}

/* Green circle with the number of unread private messages on the inbox tile */
.tile.tile-pm { position: relative; }
.tile-badge { background: var(--ok); color: #06281a; position: absolute; top: 8px; right: 8px; font-size: 12px; line-height: 1.7em; min-width: 1.7em; padding: 0 .45em; box-shadow: 0 0 0 2px #0b1020; }
[dir=rtl] .tile-badge { right: auto; left: 8px; }

/* Delete account: a quiet link at the bottom of Settings */
.setting-delete { display: block; margin: 18px auto 0; border: 0; background: none; padding: 4px 8px; font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.setting-delete:hover { color: var(--red-2); }

/* Phone drawer: room navigation (shown only on the phone) */
.phone-only { display: none; }
@media (max-width: 760px) { .phone-only { display: block; } }
.nav-rooms button { display: flex; align-items: center; gap: 10px; }
.nav-rooms .nav-ic { width: 22px; text-align: center; font-size: 16px; flex: none; }
.nav-rooms .nav-ic .icon-img { width: 20px; height: 20px; vertical-align: middle; }

/* Pinned support conversation */
.inbox-support .avatar { background: var(--muted); font-size: 18px; }

/* Inside a room: no logo/wordmark, the room bar takes its place (also in the phone's first row) */
.top.in-room .brand { display: none; }
@media (max-width: 760px) { .top.in-room .rooms { order: 0; flex: 1; flex-basis: auto; min-width: 0; } .top.in-room .current-room span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }

/* Room bar under the header: notice board tabs, question of the day, "tell me when someone comes" */
.room-bar { display: grid; gap: 8px; padding: 10px 16px 0; }
.room-tabs { display: flex; gap: 6px; }
.room-tabs button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: none; color: var(--muted); border-radius: 999px; padding: .35em .9em; font-weight: 700; font-size: 14px; }
.room-tabs button.on { background: var(--red); border-color: var(--red); color: #fff; }
.room-tabs .count { background: rgba(255, 255, 255, .18); border-radius: 999px; padding: 0 .45em; font-size: 12px; }
.qotd, .watch { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.qotd .ic { font-size: 20px; }
.qotd > span:not(.ic) { flex: 1; min-width: 0; }
.qotd small { display: block; color: var(--gold); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.qotd b { font-size: 14px; }
.watch { border-style: dashed; color: var(--muted); font-size: 14px; }
.watch > span { flex: 1; }
.watch.on { border-style: solid; color: var(--text); }
.btn.small { padding: .4em .8em; font-size: 13px; white-space: nowrap; }
.watch-toast { display: flex; align-items: center; gap: 10px; justify-content: space-between; }

/* Notice board */
.board { display: grid; gap: 10px; padding: 4px 0 16px; width: 100%; max-width: 760px; margin: 0 auto; }
.board-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.post { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); padding: 12px 14px; display: grid; gap: 6px; }
.post.mine { border-color: rgba(var(--soft), .55); }
.post-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.post-kind { font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--gold); }
.post-left { color: var(--muted); }
.post h3 { margin: 0; font-size: 16px; }
.post p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); font-size: 14px; }
.post-foot { display: flex; align-items: center; gap: 10px; font-size: 13px; margin-top: 2px; }
.post-foot .nick { border: 0; background: none; padding: 0; font-weight: 700; color: var(--nick, var(--muted)); }
.post-acts { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }
.post-acts .flag { border: 0; background: none; color: var(--muted); }
.form select { width: 100%; }

/* Reactions: tools at the end of the first row, chips under the message */
.msg .tools { grid-column: -2; grid-row: 1; display: flex; gap: 2px; align-items: center; }
.msg .tools .flag { grid-column: auto; }
.msg .react-btn { border: 0; background: none; color: var(--muted); font-size: 14px; padding: 0 2px; opacity: 0; }
.msg:hover .react-btn, .msg .react-btn:focus { opacity: 1; }
.reacts { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0 1px; }
.reacts:empty { display: none; }
.react { border: 1px solid var(--line); background: var(--bg-2); color: var(--text); border-radius: 999px; padding: 1px .55em; font-size: 13px; line-height: 1.5; }
.react.mine { border-color: rgba(224, 40, 61, .6); background: rgba(224, 40, 61, .12); }
.react-pick { display: flex; gap: 2px; padding: 2px; }
.react-pick button { font-size: 22px; padding: 4px 6px; border-radius: 10px; }
.react-pick button:hover { background: var(--bg-2); transform: scale(1.15); }
@media (max-width: 760px) {
  .msg .react-btn { opacity: .55; }
  .room-bar { padding: 8px 10px 0; }
}

/* Invite friends */
.lobby-invite { width: 100%; margin-top: 26px; text-align: start; background: var(--panel); color: inherit; font: inherit; cursor: pointer; }
.lobby-invite:hover { border-color: rgba(var(--soft), .8); }
.invite-link { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); font-size: 14px; overflow-wrap: anywhere; color: var(--muted); }
.invite-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.invite-actions .btn { text-decoration: none; text-align: center; }

/* Reactions on private messages: small chips hanging under the bubble */
.bubble-row { flex-wrap: wrap; }
.bubble-row .reacts { flex-basis: 100%; display: flex; margin: -6px 10px 2px; position: relative; }
.bubble-row.mine .reacts { justify-content: flex-end; }
.bubble-row .reacts:empty { display: none; }
.bubble-row .react { font-size: 12px; padding: 0 .45em; box-shadow: 0 0 0 2px var(--bg); }
.bubble .react-btn { opacity: 1; font-size: 13px; margin-left: 8px; }

/* Room messages sit on a light, see-through card, so each one reads as its own line */
.log { gap: 5px; }
.msg { background: rgba(var(--soft), .07); border: 1px solid rgba(var(--soft), .08); padding: 7px 10px; }
.msg:hover { background: rgba(var(--soft), .11); }
.msg.mine { background: rgba(224, 40, 61, .08); border-color: rgba(224, 40, 61, .14); }
/* Name on its own line above the message ("Nick:"), time and tools at the right of that line */
.msg { grid-template-columns: 1fr auto auto; gap: 2px 8px; align-items: center; }
.msg .nick { grid-column: 1; grid-row: 1; justify-self: start; font-size: 13px; }
.msg .nick::after { content: ':'; }
.msg .time { grid-column: 2; grid-row: 1; }
.msg .tools { grid-column: 3; grid-row: 1; }
.msg .body { grid-column: 1 / -1; grid-row: 2; }
.msg .reacts { grid-column: 1 / -1; grid-row: 3; }
@media (max-width: 760px) {
  .msg { grid-template-columns: 1fr auto; }
  .msg .tools { grid-column: 2; }
}
/* Time stamp at the bottom right of the message card (also on the phone) */
.msg .body { grid-column: 1; grid-row: 2; }
.msg .time { grid-column: 2 / -1; grid-row: 2; align-self: end; justify-self: end; font-size: 11px; line-height: 1.4; }
@media (max-width: 760px) {
  .msg .time { display: block; grid-column: 2; }
}