/* freakchat: freakscene's discord. Sharp edges, black + #90ee90, lowercase.
   Desktop: channels | video grid | chat. Phone (#fc[data-mobile="1"]): the
   channel list is its own screen, a room is video on top and chat under it.
   (theater and chat-first layouts were workshopped; discord was picked.)
   Switches on #fc: data-voice (in a voice channel), data-view (phone:
   channels | room), data-tiles (anyone on cam), data-dragging (a resize is under way). */

:root
{
	--g: #90ee90;
	--g2: #5fbf5f;
	--red: #ff4d4d;
	--amber: #ffc857;
	--bg: #000;
	--bg1: #0a0a0a;
	--bg2: #131313;
	--line: #1f2a1f;
	--line2: rgba(144, 238, 144, .28);
	--dim: #8a8a8a;
	--text: #e8e8e8;
	--side: 248px;
	--chatw: 360px;
	color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html, body
{
	margin: 0;
	height: 100%;
	background: var(--bg);
	color: var(--text);
	font: 15px/1.45 -apple-system, "Segoe UI", "Helvetica Neue", Roboto, Ubuntu, Arial, sans-serif;
	overflow: hidden;
}

button { font: inherit; color: inherit; background: none; border: 0; border-radius: 0; cursor: pointer; padding: 0; }
a { color: var(--g); text-decoration: none; }
.h-dim { color: var(--dim); }
.h-red { color: var(--red); }
.h-pad { padding: 16px; margin: 0; }

.h-ico { width: 18px; height: 18px; flex: 0 0 auto; display: block; }
.h-mini { width: 13px; height: 13px; display: inline-block; vertical-align: -2px; }
.h-bigico { width: 44px; height: 44px; color: var(--g2); margin: 0 auto 8px; }

.h-av
{
	flex: 0 0 auto;
	width: 34px; height: 34px;
	display: inline-flex; align-items: center; justify-content: center;
	background: #1a1a1a; color: var(--g);
	font-weight: 700; text-transform: lowercase;
	overflow: hidden;
}
.h-av img { width: 100%; height: 100%; object-fit: cover; }
.h-av--big { width: 30%; max-width: 96px; min-width: 40px; height: auto; aspect-ratio: 1; font-size: 28px; }

.h-btn { border: 1px solid var(--line2); padding: 6px 12px; color: var(--g); white-space: nowrap; display: inline-block; }
.h-btn--go { background: var(--g); color: #000; border-color: var(--g); font-weight: 700; }

/* ---------------------------------------------------------------- frame */

#fc
{
	display: grid;
	height: 100dvh;
	grid-template-columns: var(--side) minmax(0, 1fr);
	grid-template-rows: 52px minmax(0, 1fr) auto;
	grid-template-areas: "top top" "side main" "side dock";
}

.h-top
{
	grid-area: top;
	display: flex; align-items: center; gap: 12px;
	padding: 0 12px;
	border-bottom: 1px solid var(--g);
	background: var(--bg);
	min-width: 0;
}

.h-logo img { height: 30px; display: block; }
.h-where { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.h-where .h-mini { margin-right: 4px; color: var(--g); }
.h-topr { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.h-iconbtn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; color: var(--g); border: 1px solid transparent; }
.h-iconbtn:hover { border-color: var(--line2); }
.h-menu { display: inline-flex; }   /* desktop: collapses the channel list; phone: opens it */
.h-pill { border: 1px dashed var(--amber); color: var(--amber); padding: 4px 10px; font-size: 12px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.h-hash { color: var(--dim); margin-right: 3px; font-weight: 400; }

/* ---------------------------------------------------------------- sidebar */

.h-side
{
	grid-area: side;
	background: var(--bg1);
	border-right: 1px solid var(--line);
	overflow-y: auto;
	padding: 10px 8px 0;
	display: flex; flex-direction: column;
	min-height: 0;
}

.h-sec { font-size: 11px; letter-spacing: .12em; color: var(--dim); padding: 12px 8px 6px; text-transform: lowercase; }
.h-ch
{
	display: flex; align-items: center; gap: 8px;
	width: 100%; padding: 7px 8px;
	color: #b9c4b9; text-align: left;
	border-left: 2px solid transparent;
}
.h-ch:hover { background: var(--bg2); color: var(--text); }
.h-ch.is-on { background: var(--bg2); color: var(--g); border-left-color: var(--g); }
.h-vch .h-ico { width: 16px; height: 16px; color: var(--g2); }
.h-tag { font-style: normal; font-size: 10px; letter-spacing: .08em; border: 1px solid var(--amber); color: var(--amber); padding: 0 4px; }
.h-ch .h-lock { width: 13px; height: 13px; margin-left: 6px; color: var(--amber); }
.h-n { margin-left: auto; font-style: normal; font-size: 12px; color: var(--g); }

.h-occ { padding: 2px 0 6px 30px; }
.h-occp { display: flex; align-items: center; gap: 6px; padding: 2px 0; font-size: 13px; color: #b9c4b9; }
.h-occp .h-av { width: 22px; height: 22px; font-size: 11px; }
.h-occp.is-speaking .h-av { box-shadow: 0 0 0 2px var(--g); }

.h-rule { flex: 1; }
.h-me
{
	display: flex; align-items: center; gap: 8px;
	margin: 10px -8px 0; padding: 10px 12px;
	background: #050505; border-top: 1px solid var(--line);
	position: sticky; bottom: 0;
}
.h-mename { display: flex; flex-direction: column; min-width: 0; font-weight: 700; font-size: 14px; }
.h-mename i { font-style: normal; font-weight: 400; font-size: 11px; color: var(--dim); }
.h-sfxbtn { margin-left: auto; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; color: var(--dim); border: 1px solid var(--line); }
.h-sfxbtn.is-on { color: var(--g); border-color: var(--line2); }

/* ---------------------------------------------------------------- main */

.h-main { grid-area: main; display: flex; min-height: 0; min-width: 0; }

.h-stage { position: relative; display: none; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
#fc[data-voice="1"] .h-stage { display: flex; }

.h-grid
{
	/* tiles are placed by layout() in app.js: each at its video's real shape,
	   sized as big as the room allows, never cropped */
	flex: 1;
	position: relative;
	min-height: 0;
	overflow: hidden;
}

.h-empty { display: none; text-align: center; margin: auto; padding: 24px; }
.h-empty p { margin: 4px 0; }
#fc[data-voice="1"][data-tiles="0"] .h-empty { display: block; }
#fc[data-tiles="0"] .h-grid { display: none; }

.h-tile
{
	position: absolute;
	background: #000;
	border: 1px solid var(--line);
	overflow: hidden;
	cursor: pointer;
	transition: left .18s, top .18s, width .18s, height .18s;
}
#fc[data-dragging] .h-tile { transition: none; }
.h-tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.h-tile.is-spot { border-color: var(--line2); }
.h-tile:fullscreen { border: 0; }
/* focus (big, everyone else stays) + full screen, top-left of every tile.
   Hover on desktop; always there on phones, where you can't hover */
.h-tbtns { position: absolute; top: 6px; left: 6px; z-index: 2; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.h-tile:hover .h-tbtns { opacity: 1; }
@media (hover: none) { .h-tbtns { opacity: .9; } }
.h-tbtns button { height: 30px; min-width: 30px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 0 7px; background: rgba(0, 0, 0, .72); color: var(--g); border: 1px solid transparent; border-radius: 0; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.h-tbtns button:hover { border-color: var(--g); }
.h-tbtns .h-ico { width: 16px; height: 16px; }
.h-tile.is-spot .h-tfocus { background: var(--g); color: #000; }
.h-tile.is-spot .h-tfocus span::before { content: "un"; }
/* small tiles (the strip under a focused one): icons only */
.h-tile.is-small .h-tbtns span { display: none; }
.h-tile.is-tiny .h-tbtns { display: none; }
.h-tile.is-me video { transform: scaleX(-1); }
.h-tile.is-off video { display: none; }
.h-tile--radio { background: #000; }
.h-tile--radio canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.h-tile--radio .h-tname { color: var(--g); }
.h-ph { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; }
.h-tile.is-off .h-ph { display: flex; }
.h-tile.is-speaking { border-color: var(--g); box-shadow: inset 0 0 0 2px var(--g); }
.h-tl
{
	position: absolute; left: 6px; bottom: 6px; max-width: calc(100% - 12px);
	display: flex; align-items: center; gap: 4px;
	background: rgba(0, 0, 0, .72); padding: 2px 7px; font-size: 13px;
}
.h-tname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-tmic .h-ico { width: 14px; height: 14px; }
.h-tacts { position: absolute; top: 6px; right: 6px; display: flex; gap: 3px; opacity: 0; transition: opacity .15s; }
.h-tile:hover .h-tacts { opacity: 1; }
@media (hover: none) { .h-tacts { opacity: 1; } }
.h-tacts button { background: rgba(0, 0, 0, .8); color: var(--g); padding: 2px 7px; font-size: 12px; }
.h-tacts button.h-red { color: var(--red); }

/* listen-only bar across the top of the video, with ask to talk right in it */
.h-listen:empty { display: none; }
.h-listen
{
	/* in the flow above the grid, not over it: the video shrinks, nothing is covered */
	order: -1;
	flex: 0 0 auto;
	display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
	padding: 8px 12px;
	background: rgba(0, 0, 0, .82); border-bottom: 1px solid var(--g);
}
.h-listen span { flex: 1; min-width: 160px; }
.h-listen b { color: var(--g); }
.h-listen .h-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; }
.h-listen .h-ico { width: 16px; height: 16px; }

/* sound gate: big and obvious while the browser holds room audio back */
.h-soundgate
{
	display: none;
	position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 6;
	flex-direction: column; align-items: center; gap: 4px;
	padding: 18px 26px;
	background: var(--g); color: #000;
	box-shadow: 0 0 0 6px rgba(0, 0, 0, .55), 0 10px 40px rgba(0, 0, 0, .8);
	animation: fcGate 1.6s ease-in-out infinite;
}
.h-soundgate .h-ico { width: 34px; height: 34px; }
.h-soundgate b { font-size: 19px; }
.h-soundgate span { font-size: 12px; opacity: .75; }
@keyframes fcGate { 50% { box-shadow: 0 0 0 6px rgba(0, 0, 0, .55), 0 0 30px rgba(144, 238, 144, .8); } }
#fc[data-voice="1"][data-soundblocked="1"] .h-soundgate { display: flex; }

/* resize handles: video | chat split on desktop, video height on a phone */
.h-split { display: none; flex: 0 0 7px; cursor: col-resize; background: var(--bg1); border-left: 1px solid var(--line); border-right: 1px solid var(--line); touch-action: none; }
.h-split:hover, #fc[data-dragging] .h-split { background: var(--line2); }
#fc[data-voice="1"]:not([data-mobile="1"]) .h-split { display: block; }
.h-vgrip { display: none; height: 16px; flex: 0 0 auto; align-items: center; justify-content: center; cursor: row-resize; touch-action: none; }
.h-vgrip span { width: 44px; height: 4px; background: var(--line2); }
#fc[data-mobile="1"][data-voice="1"] .h-vgrip { display: flex; }
#fc[data-dragging] { user-select: none; }

.h-asks:empty { display: none; }
.h-asks { border-top: 1px solid var(--amber); background: rgba(255, 200, 87, .06); padding: 6px 10px; }
.h-ask { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.h-ask > span:not(.h-av) { flex: 1; min-width: 0; }
.h-ask .h-av { width: 26px; height: 26px; }

/* ---------------------------------------------------------------- chat */

.h-chat { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.h-chathead { padding: 10px 14px; border-bottom: 1px solid var(--line); font-weight: 700; display: none; }
.h-msgs { flex: 1; overflow-y: auto; padding: 8px 0; overscroll-behavior: contain; }
/* pins: a channel's pinned note + pinned messages, set by admins */
.h-topic { border-bottom: 1px solid var(--line); color: var(--dim); font-size: 13px; }
.h-topic:empty { display: none; }
.h-note { display: flex; gap: 8px; align-items: flex-start; padding: 8px 14px; }
.h-note > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.h-note .h-mini { flex: none; margin-top: 3px; color: var(--g); }
.h-note--add { padding: 4px 14px; }
.h-note--edit { display: block; }
.h-notebtn { flex: none; background: none; border: 0; padding: 0; color: var(--dim); font: inherit; font-size: 12px; cursor: pointer; text-decoration: underline dotted; }
.h-notebtn:hover { color: var(--g); }
.h-note--add .h-notebtn { text-decoration: none; opacity: .6; }
.h-note--add .h-notebtn:hover { opacity: 1; }
.h-note + .h-pinsbar { border-top: 1px solid var(--line); }
.h-pinsbar { display: block; width: 100%; text-align: left; padding: 6px 14px; background: none; border: 0; color: var(--g); font: inherit; font-size: 12px; cursor: pointer; }
.h-pinlist { max-height: 40vh; overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--line); }
.h-pinitem { padding: 6px 14px 8px; box-shadow: inset 3px 0 0 var(--g); cursor: pointer; }
.h-pinitem + .h-pinitem { border-top: 1px solid var(--line); }
.h-pinitem:hover { background: #070707; }
.h-pinhead { display: flex; gap: 8px; align-items: baseline; }
.h-pinhead b { color: var(--g); }
.h-pinhead time { font-size: 11px; }
.h-pinhead .h-notebtn { margin-left: auto; }
.h-pinbody { color: #e8e8e8; }
.h-pinbody img.bbImage, .h-pinbody img[data-url] { max-height: 140px; }
.h-msg.is-pinned { box-shadow: inset 3px 0 0 var(--g); }
.h-tools .h-pinbtn.is-on { color: #000; background: var(--g); border-color: var(--g); }

.h-msg { display: flex; gap: 10px; padding: 6px 14px 2px; }
.h-msg:hover { background: #070707; }
.h-mb { min-width: 0; flex: 1; }
.h-mh b { color: var(--g); margin-right: 8px; }
.h-mh time, .h-msg--bot time { font-size: 11px; color: var(--dim); }
.h-body { word-wrap: break-word; overflow-wrap: anywhere; }
.h-body img, .h-body iframe { max-width: 100%; }
/* bandcamp / soundcloud players (api.php fc_music_embeds) */
.h-body .bbMediaWrapper { margin: 6px 0 2px; max-width: 480px; }
.h-body .bbMediaWrapper iframe { display: block; }
.h-msg--cont { padding: 0 14px 2px 58px; }
.h-msg--bot { display: block; padding: 3px 14px 3px 58px; font-size: 12px; color: var(--dim); }
.h-msg--bot b { color: #5c7a5c; font-weight: 600; }
.h-msg--bot a { color: #7fb87f; }
.h-msg--bot time { margin-left: 6px; }
.h-msg--bot.is-folded { display: none; }
.h-botfold { display: block; margin: 2px 14px 2px 58px; padding: 2px 0; font-size: 12px; color: #5c7a5c; text-align: left; }
.h-botfold:hover { color: var(--g); }

/* mentions: a highlighted message when it's about you, names as chips */
.h-msg { position: relative; }
.h-msg.is-mentioned { background: rgba(144, 238, 144, .07); box-shadow: inset 3px 0 0 var(--g); }
.h-msg.is-flash { animation: fcFlash 2.4s ease-out; }
@keyframes fcFlash { 0%, 30% { background: rgba(144, 238, 144, .28); } 100% { background: transparent; } }
.h-body a[data-user-id] { color: var(--g); background: rgba(144, 238, 144, .12); padding: 0 3px; font-weight: 600; }

/* reactions: chips under the text, a react button on hover / tap */
.h-rxrow:empty { display: none; }
.h-rxrow { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.h-rx { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border: 1px solid var(--line2); background: #0b0b0b; font-size: 14px; line-height: 1.5; }
.h-rx b { font-size: 12px; color: #cfcfcf; font-weight: 600; }
.h-rx.is-mine { border-color: var(--g); background: rgba(144, 238, 144, .14); }
.h-rx.is-mine b { color: var(--g); }
.h-rxadd { display: inline-flex; visibility: hidden; vertical-align: middle; margin-left: 8px; width: 28px; height: 22px; align-items: center; justify-content: center; color: var(--dim); background: #000; border: 1px solid var(--line); }
.h-rxadd:hover { color: var(--g); border-color: var(--g); }
.h-rxadd .h-ico { width: 15px; height: 15px; }
.h-rxadd--gutter { position: absolute; left: 18px; top: 1px; margin: 0; }
@media (hover: hover) { .h-msg:hover .h-rxadd { visibility: visible; } }
.h-msg.is-tapped .h-rxadd { visibility: visible; }
.h-rxmore { padding: 1px 8px; border: 1px dashed var(--line2); color: var(--dim); font-size: 14px; line-height: 1.5; }
.h-rxmore:hover { color: var(--g); border-color: var(--g); }
.h-rxpick { position: fixed; z-index: 60; display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; max-width: calc(100vw - 12px); background: #000; border: 1px solid var(--g); box-shadow: 0 8px 30px rgba(0, 0, 0, .8); }
.h-rxpick button { width: 40px; height: 40px; font-size: 23px; line-height: 1; }
.h-rxpick button:hover { background: rgba(144, 238, 144, .15); }
.h-rxpick .h-rxall { color: var(--dim); border-left: 1px solid var(--line); }
.h-rxpick .h-rxall .h-ico { width: 20px; height: 20px; margin: auto; }

/* every emoji: emoji-picker-element, themed black + green */
.h-emojis { position: fixed; z-index: 61; border: 1px solid var(--g); box-shadow: 0 8px 30px rgba(0, 0, 0, .85); }
.h-emojis emoji-picker
{
	--background: #050505; --border-color: #1f2a1f; --border-radius: 0;
	--indicator-color: #90ee90; --input-border-color: #2b3a2b; --input-font-color: #e8e8e8;
	--input-placeholder-color: #8a8a8a; --input-border-radius: 0; --outline-color: #90ee90;
	--button-hover-background: rgba(144, 238, 144, .15); --button-active-background: rgba(144, 238, 144, .25);
	--category-font-color: #8a8a8a; --emoji-size: 1.45rem;
	width: min(340px, calc(100vw - 12px)); height: 360px;
}
.h-emojibtn { flex: 0 0 auto; width: 40px; display: flex; align-items: center; justify-content: center; color: var(--dim); border: 1px solid var(--line); }
.h-emojibtn:hover { color: var(--g); border-color: var(--g); }
.h-emojibtn .h-ico { width: 20px; height: 20px; }

/* names and faces are buttons that open the profile card */
.h-who { cursor: pointer; padding: 0; align-self: flex-start; }
b.h-who:hover { text-decoration: underline; }
.h-occp[data-act="profile"], .h-tname[data-act="profile"][data-id]:not([data-id=""]) { cursor: pointer; }
.h-card { position: fixed; z-index: 70; width: 280px; max-width: calc(100vw - 16px); background: #050505; border: 1px solid var(--g); box-shadow: 0 10px 34px rgba(0, 0, 0, .85); padding: 14px; }
.h-cardtop { display: flex; gap: 12px; align-items: center; }
.h-cardtop b { display: block; font-size: 17px; color: var(--g); }
.h-cardtop .h-tag { margin-left: 6px; vertical-align: 2px; }
.h-cardtop .h-dim { display: block; font-size: 12px; }
.h-av--card { width: 56px; height: 56px; font-size: 24px; }
.h-cardinfo { margin: 10px 0; font-size: 13px; color: #cfcfcf; }
.h-cardinfo p { margin: 2px 0; }
.h-cardacts { display: flex; gap: 6px; flex-wrap: wrap; }
.h-cardacts .h-btn { font-size: 13px; padding: 5px 10px; }

/* @ autocomplete, right above the box */
.h-mpop:empty { display: none; }
.h-mpop { border-top: 1px solid var(--g); background: #050505; max-height: 260px; overflow-y: auto; }
.h-mopt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 12px; text-align: left; }
.h-mopt .h-av { width: 26px; height: 26px; font-size: 12px; }
.h-mopt.is-on, .h-mopt:hover { background: rgba(144, 238, 144, .12); color: var(--g); }

.h-compose { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--bg); }
.h-compose textarea
{
	/* min-width 0: Firefox won't shrink a textarea below its default 20
	   columns (~240px) otherwise, which pushed send off a narrow chat */
	flex: 1 1 0; min-width: 0; width: 0; resize: none; min-height: 40px; max-height: 140px;
	background: var(--bg2); color: var(--text);
	border: 1px solid var(--line); border-radius: 0;
	padding: 9px 11px; font: inherit;
}
.h-compose textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-compose textarea:focus { outline: none; border-color: var(--g2); }
.h-compose > button { flex: 0 0 auto; }
.h-send { background: var(--g); color: #000; font-weight: 700; padding: 0 16px; }

/* ---------------------------------------------------------------- dock */

.h-dock { grid-area: dock; min-width: 0; background: #050505; border-top: 1px solid var(--line); }
.h-dock:empty { display: none; }
.h-dock { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 12px; }
.h-dockinfo { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; }
.h-live { width: 8px; height: 8px; background: var(--g); box-shadow: 0 0 8px var(--g); }
.h-ctls { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.h-ctl
{
	display: inline-flex; align-items: center; gap: 7px;
	padding: 8px 12px; min-height: 40px;
	border: 1px solid var(--line2); color: var(--text);
}
.h-ctl:hover { border-color: var(--g); }
.h-ctl.is-on { color: var(--g); border-color: var(--g); }
.h-ctl.is-off { color: var(--red); border-color: rgba(255, 77, 77, .6); background: rgba(255, 77, 77, .07); }
.h-ctl.is-go { background: var(--g); color: #000; border-color: var(--g); font-weight: 700; }
.h-ctl.is-wait { color: var(--amber); border-color: var(--amber); }
.h-ctl.is-leave { color: var(--red); border-color: var(--red); }
.h-devs { display: none; width: 100%; gap: 8px; flex-wrap: wrap; }
.h-dock.is-settings .h-devs { display: flex; }
.h-dev { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--dim); }
.h-dev select { background: #000; color: var(--text); border: 1px solid var(--line2); border-radius: 0; padding: 6px; max-width: 260px; font: inherit; }
.h-setpick.is-on { color: var(--g); }
.h-setpick.is-on select { border-color: var(--g); }
.h-marquee { position: relative; flex: 0 0 24px; height: 24px; min-width: 0; overflow: hidden; white-space: nowrap; border-bottom: 1px solid var(--g); background: #000; color: var(--g); font-size: 12.5px; font-weight: 700; letter-spacing: .06em; line-height: 24px; text-transform: lowercase; }
.h-marquee[hidden] { display: none; }
.h-marquee-run { position: absolute; left: 0; top: 0; display: inline-block; animation: h-marquee 30s linear infinite; }
.h-marquee-run span { padding: 0 14px; }
.h-marquee-run i { font-style: normal; color: var(--dim); }
@keyframes h-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .h-marquee-run { animation: none; } }
.h-radio-vol { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; color: var(--g); font-size: 12.5px; }
.h-radio-vol input { width: 90px; min-width: 0; accent-color: var(--g); }
/* phone: its own full-width line under the room row */
.h-radiorow { width: 100%; }
.h-djbtn { margin-left: 8px; padding: 3px 8px; background: none; border: 1px solid var(--line2); border-radius: 0; color: var(--dim); font: inherit; font-size: 12px; cursor: pointer; }
.h-djbtn:hover { border-color: var(--g); color: var(--g); }
.h-djbtn.is-armed { border-color: var(--red); color: var(--red); }
.h-pwa { display: flex; align-items: center; width: 100%; padding-top: 2px; font-size: 13px; }
.h-pwa a { flex: 1; color: var(--g); font-weight: 600; text-decoration: none; }
.h-pwa button { background: none; border: 0; color: var(--dim); font-size: 18px; line-height: 1; padding: 0 4px 0 12px; cursor: pointer; }
.h-radiorow .h-radio-vol { display: flex; margin: 0; gap: 8px; }
.h-radiorow .h-radio-vol input { flex: 1; width: auto; }
.h-music { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; background: #000; color: var(--text); border: 1px solid var(--line2); border-radius: 0; font: inherit; font-size: 13px; cursor: pointer; }
.h-music small { color: var(--dim); font-size: 11.5px; }
.h-music-box { width: 12px; height: 12px; border: 1px solid var(--dim); flex: 0 0 auto; }
.h-music.is-on { border-color: var(--g); color: var(--g); }
.h-music.is-on .h-music-box { background: var(--g); border-color: var(--g); }
.h-music:hover { border-color: var(--g); }

.h-toast
{
	position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
	background: #000; border: 1px solid var(--g); color: var(--g);
	padding: 8px 14px; max-width: 90vw; z-index: 50;
	opacity: 0; pointer-events: none; transition: opacity .2s;
}
.h-toast.is-on { opacity: 1; }

.h-gate { height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; }
.h-gate img { height: 60px; }
.h-gate p { max-width: 340px; color: var(--dim); }

/* ==================================================================== in a voice channel: video | chat */

#fc[data-voice="1"] .h-stage { flex: 1; }
#fc[data-voice="1"] .h-chat { flex: 0 0 var(--fc-chat-w, var(--chatw)); }
#fc[data-voice="1"] .h-chathead { display: block; }

/* ==================================================================== phone: one column, channel list is its own screen */

#fc[data-mobile="1"]
{
	--side: 100vw;
	grid-template-columns: 1fr;
	grid-template-rows: 52px minmax(0, 1fr) auto;
	grid-template-areas: "top" "main" "dock";
}

#fc[data-mobile="1"] .h-menu { display: inline-flex; }
#fc[data-mobile="1"] .h-logo img { height: 24px; }
#fc[data-mobile="1"] .h-pill { padding: 3px 7px; font-size: 11px; }
#fc[data-mobile="1"] .h-side { grid-area: main; display: none; }
#fc[data-mobile="1"][data-view="channels"] .h-side { display: flex; }
#fc[data-mobile="1"][data-view="channels"] .h-main { display: none; }
#fc[data-mobile="1"][data-view="channels"] .h-menu { visibility: hidden; }
#fc[data-mobile="1"] .h-ch { padding: 11px 10px; font-size: 16px; }
#fc[data-mobile="1"] .h-chathead { display: none !important; }
#fc[data-mobile="1"] .h-tacts button { padding: 6px 9px; }
#fc[data-mobile="1"] .h-asks { padding: 4px 8px; }
#fc[data-mobile="1"] .h-ask { font-size: 13px; gap: 6px; }
#fc[data-mobile="1"] .h-ask > span:not(.h-av) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#fc[data-mobile="1"] .h-ask .h-btn { padding: 5px 8px; }

/* dock: icon buttons in one row, thumb height */
#fc[data-mobile="1"] .h-dock { padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); gap: 6px; }
#fc[data-mobile="1"] .h-dockinfo { width: 100%; }
#fc[data-mobile="1"] .h-ctls { margin: 0; width: 100%; flex-wrap: nowrap; }
#fc[data-mobile="1"] .h-ctl { flex: 1; justify-content: center; min-height: 48px; padding: 8px 4px; }
#fc[data-mobile="1"] .h-ctl[data-act="mic"] span,
#fc[data-mobile="1"] .h-ctl[data-act="cam"] span,
#fc[data-mobile="1"] .h-ctl[data-act="sound"] span { display: none; }
/* leave lives in the info row on a phone, labelled, away from the thumb row */
#fc[data-mobile="1"] .h-dockinfo .h-ctl[data-act="leave"] { flex: 0 0 auto; margin-left: auto; min-height: 34px; padding: 4px 10px; font-size: 13px; }
#fc[data-mobile="1"] .h-dockinfo .h-ctl[data-act="leave"] .h-ico { width: 16px; height: 16px; }
#fc[data-mobile="1"] .h-ctl .h-ico { width: 22px; height: 22px; }
#fc[data-mobile="1"] .h-compose { padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
#fc[data-mobile="1"][data-voice="1"] .h-compose { padding-bottom: 8px; }
#fc[data-mobile="1"] .h-compose textarea { font-size: 16px; }   /* no ios zoom */

/* phone discord: video on top, chat under it */
#fc[data-mobile="1"] .h-main { flex-direction: column; }
#fc[data-mobile="1"][data-voice="1"] .h-stage { flex: 0 0 auto; height: var(--fc-stage-h, 46dvh); border-bottom: 1px solid var(--g); }
#fc[data-mobile="1"][data-voice="1"] .h-chat { flex: 1; min-height: 120px; }

/* admins: logged-out visitors watching from the front page (entry.js guest preview) */
.h-guests { margin-left: 10px; padding: 1px 6px; border: 1px solid var(--g, #90ee90); color: var(--g, #90ee90); font-size: 11px; white-space: nowrap; }

/* pasted / dropped images: thumbnails wait above the box until Enter */
.h-pending { display: flex; gap: 8px; padding: 8px 12px 0; background: var(--bg); border-top: 1px solid var(--line); flex-wrap: wrap; }
.h-pending:empty { display: none; }
.h-pimg { position: relative; width: 72px; height: 72px; border: 1px solid var(--line); background: #000; }
.h-pimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.h-pimg.is-up img { opacity: .4; }
.h-pimg.is-up::after { content: "uploading"; position: absolute; inset: auto 0 4px; text-align: center; font-size: 10px; color: var(--g); }
.h-pimg button { position: absolute; top: -1px; right: -1px; width: 22px; height: 22px; border: 0; border-radius: 0; background: #000; color: var(--g); font-size: 16px; line-height: 1; cursor: pointer; }
.h-pending:not(:empty) + .h-compose { border-top: 0; }
.h-chat.is-drop { outline: 2px dashed var(--g); outline-offset: -6px; }
.h-body img.bbImage, .h-body img[data-url] { max-width: min(100%, 360px); max-height: 320px; width: auto; height: auto; display: block; margin: 4px 0; cursor: zoom-in; border: 1px solid var(--line); }

/* scrolled up while new messages came in: a way back down */
.h-chat { position: relative; }
.h-newmsgs { display: none; position: absolute; left: 50%; transform: translateX(-50%); bottom: 72px; z-index: 5; padding: 6px 14px; background: var(--g); color: #000; border: 0; border-radius: 0; font: inherit; font-weight: 800; font-size: 13px; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.6); }
.h-newmsgs.is-on { display: block; }

/* who reacted (hover a chip, or press and hold on a phone) */
.h-rxwho { position: fixed; z-index: 60; max-width: 280px; display: flex; gap: 8px; align-items: flex-start; padding: 7px 10px; background: #000; border: 1px solid var(--g); color: #ddd; font-size: 13px; line-height: 1.35; pointer-events: none; box-shadow: 0 4px 16px rgba(0,0,0,.7); }
.h-rxwho-e { font-size: 20px; line-height: 1; }
/* links people post: freakchat doesn't load XF's css, so give them the site green */
.h-body a:not([data-user-id]) { color: var(--g); text-decoration: underline; text-underline-offset: 2px; word-break: break-word; }

/* edit + delete (yours; admins can delete any): same boxes as the react
   button, right after it; on follow-up lines (react sits in the gutter) they
   go at the end of the line, inside the message, never over the one above */
.h-tools { display: inline-flex; visibility: hidden; gap: 4px; margin-left: 4px; vertical-align: middle; }
.h-acts { display: inline-flex; gap: 0; margin-left: 2px; vertical-align: middle; white-space: nowrap; }
.h-acts .h-rxadd { margin-left: 6px; }
@media (hover: hover) { .h-msg:hover .h-tools { visibility: visible; } }
.h-msg.is-tapped .h-tools { visibility: visible; }
.h-tools button { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 22px; padding: 0; color: var(--dim); background: #000; border: 1px solid var(--line); border-radius: 0; cursor: pointer; font: inherit; font-size: 11px; }
.h-tools button:hover { color: var(--g); border-color: var(--g); }
.h-tools .h-ico { width: 14px; height: 14px; }
.h-tools button.is-armed { width: auto; padding: 0 7px; color: #000; background: #ff6b6b; border-color: #ff6b6b; font-weight: 800; }
.h-edited { font-size: 11px; color: var(--dim); margin-top: 1px; }
.h-editbox { width: 100%; box-sizing: border-box; resize: none; padding: 7px 9px; background: #0b0b0b; color: #eee; border: 1px solid var(--g); border-radius: 0; font: inherit; line-height: 1.4; }
.h-editbox:focus { outline: none; }
.h-edithint { font-size: 11.5px; color: var(--dim); margin-top: 3px; }
.h-edithint button { background: none; border: 0; padding: 0; color: var(--g); font: inherit; cursor: pointer; text-decoration: underline; }

/* who's typing: a thin line above the box, always there so nothing jumps */
.h-typing { height: 20px; padding: 0 14px; font-size: 12px; line-height: 20px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--bg); }
.h-typing b { color: #cfcfcf; font-weight: 700; }
.h-dots { display: inline-flex; gap: 3px; margin-right: 7px; vertical-align: middle; }
.h-dots i { width: 4px; height: 4px; background: var(--g); animation: hDot 1.2s infinite ease-in-out; }
.h-dots i:nth-child(2) { animation-delay: .15s; }
.h-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes hDot { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* emoji in messages: XF swaps them for 64px pictures (joypixels) and its own
   css that shrinks them isn't loaded here, so they came out huge. Text height. */
.h-body img.smilie, .h-msg--bot img.smilie { display: inline; width: auto; height: 1.3em; max-width: none; margin: 0 1px; vertical-align: -0.28em; border: 0; cursor: auto; }

/* "browse with chat" (opens dock.php) */
.h-popout { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; background: none; color: var(--g); border: 1px solid var(--line2); border-radius: 0; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.h-popout:hover { border-color: var(--g); }
.h-popout .h-ico { width: 15px; height: 15px; }
#fc[data-mobile="1"] .h-popout span { display: none; }
/* docked beside the site (dock.php has its own bar): no logo, no "browse"
   button. Full screen inside the shell looks like plain freakchat */
html:not([data-shell="full"]) #fc[data-docked="1"] .h-logo,
html:not([data-shell="full"]) #fc[data-docked="1"] .h-popout { display: none; }
.h-tile.is-tiny .h-tl { font-size: 11px; padding: 1px 5px; left: 3px; bottom: 3px; }

/* per-person volume + hide, just for you (the sliders button on a tile) */
.h-tmenu { display: none !important; }
.h-tile.has-menu .h-tmenu { display: inline-flex !important; }
.h-tile.is-hidden .h-ph::after { content: "hidden for you"; position: absolute; top: 8px; right: 8px; padding: 1px 6px; background: rgba(0, 0, 0, .75); color: var(--dim); font-size: 11px; }
.h-pmenu { position: fixed; z-index: 70; width: 250px; max-width: calc(100vw - 16px); background: #050505; border: 1px solid var(--g); box-shadow: 0 10px 34px rgba(0, 0, 0, .85); padding: 12px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.h-pmhead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.h-pmhead b { color: var(--g); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-pmhead .h-dim { font-size: 11px; }
.h-pslide { display: flex; flex-direction: column; gap: 4px; }
.h-pslide span { display: flex; justify-content: space-between; color: #cfcfcf; }
.h-pslide b { color: var(--g); font-weight: 700; }
.h-pslide input { width: 100%; accent-color: var(--g); height: 22px; }
.h-phides { display: flex; gap: 6px; flex-wrap: wrap; }
.h-phide { flex: 1; padding: 6px 8px; background: none; color: var(--g); border: 1px solid var(--line2); border-radius: 0; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.h-phide.is-on { background: var(--g); color: #000; }
.h-preset { align-self: flex-start; padding: 0; background: none; border: 0; color: var(--dim); font: inherit; font-size: 11.5px; text-decoration: underline; cursor: pointer; }

/* ---- per-person ⋯ (volume, hide, admin): top right, on hover; always on phones */
.h-tmenu { display: none; position: absolute; top: 6px; right: 6px; z-index: 2; width: 32px; height: 30px; align-items: center; justify-content: center; background: rgba(0, 0, 0, .72); color: var(--g); border: 1px solid transparent; opacity: 0; transition: opacity .15s; }
.h-tile.has-menu .h-tmenu { display: inline-flex !important; }
.h-tile:hover .h-tmenu { opacity: 1; }
@media (hover: none) { .h-tmenu { opacity: .9; } }
.h-tmenu:hover { border-color: var(--g); }
.h-tmenu .h-ico { width: 18px; height: 18px; }
.h-tile.is-tiny .h-tmenu { display: none !important; }
.h-padmin { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.h-padmin .h-dim { font-size: 11px; }
.h-padmin button { text-align: left; padding: 6px 8px; border: 1px solid var(--line2); color: var(--g); font-size: 12.5px; font-weight: 700; }
.h-padmin button.h-red { color: var(--red); border-color: rgba(255, 107, 107, .4); }
.h-padmin button.is-armed { background: var(--red); color: #000; }

/* ---- collapse: channel list (desktop) */
#fc[data-sidehide="1"]:not([data-mobile="1"]) { grid-template-columns: 0 minmax(0, 1fr); }
#fc[data-sidehide="1"]:not([data-mobile="1"]) .h-side { display: none; }

/* ---- collapse: chat next to the video (desktop, in a room) */
.h-chathead { position: relative; }
.h-chathide { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 28px; height: 26px; display: inline-flex; align-items: center; justify-content: center; color: var(--dim); border: 1px solid var(--line); }
.h-chathide:hover { color: var(--g); border-color: var(--g); }
.h-chathide .h-ico { width: 15px; height: 15px; }
.h-chatopen { display: none; position: absolute; top: 8px; right: 8px; z-index: 6; align-items: center; gap: 6px; height: 30px; padding: 0 10px; background: #000; color: var(--g); border: 1px solid var(--line2); font-size: 12.5px; font-weight: 700; }
.h-chatopen:hover { border-color: var(--g); }
.h-chatopen .h-ico { width: 16px; height: 16px; }
.h-chatopen b { background: var(--g); color: #000; padding: 0 5px; font-size: 11px; }
#fc[data-chathide="1"][data-voice="1"]:not([data-mobile="1"]) .h-chat,
#fc[data-chathide="1"][data-voice="1"]:not([data-mobile="1"]) .h-split { display: none; }
#fc[data-chathide="1"][data-voice="1"]:not([data-mobile="1"]) .h-chatopen { display: inline-flex; }
#fc[data-mobile="1"] .h-chathide { display: none; }

/* ---- phone: video / both / chat, and a slimmer dock */
.h-mview { display: inline-flex; margin-left: auto; border: 1px solid var(--line2); }
.h-mview button { position: relative; width: 38px; height: 30px; display: inline-flex; align-items: center; justify-content: center; color: var(--dim); }
.h-mview button + button { border-left: 1px solid var(--line2); }
.h-mview button.is-on { background: var(--g); color: #000; }
.h-mview .h-ico { width: 17px; height: 17px; }
.h-mview b { position: absolute; top: -6px; right: -6px; background: var(--g); color: #000; font-size: 10px; padding: 0 4px; border: 1px solid #000; }
#fc[data-mobile="1"] .h-dockinfo .h-mview + .h-ctl[data-act="leave"] { margin-left: 8px; }
#fc[data-mobile="1"] .h-dock { padding-top: 6px; gap: 5px; }
#fc[data-mobile="1"] .h-ctl { min-height: 42px; }
#fc[data-mobile="1"][data-voice="1"][data-mview="video"] .h-chat { display: none; }
#fc[data-mobile="1"][data-voice="1"][data-mview="video"] .h-stage { flex: 1; height: auto; border-bottom: 0; }
#fc[data-mobile="1"][data-voice="1"][data-mview="chat"] .h-stage { display: none; }
#fc[data-mobile="1"][data-voice="1"][data-mview="video"] .h-vgrip,
#fc[data-mobile="1"][data-voice="1"][data-mview="chat"] .h-vgrip { display: none; }
