/* Themen-Chats (/chats/) – Optik wie die App (chat_rooms_screen.dart, match_chat_tab.dart).
 * Eckig: Karten, Kacheln, Knöpfe; rund nur Blasen, Pillen, Avatare. Akzent #e6197a. */

.fi-chats {
	--ch-bg: #f5f5f5; --ch-card: #fff; --ch-line: #e3e6e8; --ch-text: #121212; --ch-muted: #666b78; --ch-other: #f0f1f4; --ch-acc: #e6197a;
	max-width: 760px; margin: 0 auto; color: var(--ch-text); font-family: var(--fi-font, 'Archivo', system-ui, sans-serif);
}
body.fi-chatpage { background: #fff; }
body.fi-chatpage .fi-footer { display: none; }
body.fi-ch-inroom .fi-appnav { display: none !important; }
.fi-ch-loading, .fi-ch-empty { margin: 0; padding: 40px 20px; color: var(--ch-muted); font-size: 15px; text-align: center; }

/* Kopf */
.fi-ch-top { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 16px; }
.fi-ch-back { display: grid; place-items: center; flex: none; width: 40px; height: 40px; margin-left: -8px; color: var(--ch-text); }
.fi-ch-top h1 { margin: 0; font-size: 34px; font-weight: 900; letter-spacing: -.02em; }
.fi-ch-ov > div:first-child:empty + div .fi-ch-h { margin-top: 6px; }

/* Anmelden */
.fi-ch-gate { padding: 20px 20px 40px; text-align: center; }
.fi-ch-gate-emoji { margin: 10px 0 0; font-size: 46px; }
.fi-ch-gate h2 { margin: 8px 0 8px; font-size: 22px; font-weight: 900; }
.fi-ch-gate p { max-width: 440px; margin: 0 auto 20px; color: var(--ch-muted); font-size: 15px; line-height: 1.45; }
.fi-ch-login { max-width: 420px; margin: 0 auto; text-align: left; }
.fi-ch-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border: 0; background: var(--ch-acc); color: #fff; font: inherit; font-size: 15px; font-weight: 800; text-decoration: none; cursor: pointer; }
.fi-ch-btn:disabled { opacity: .45; cursor: default; }

/* Übersicht */
.fi-ch-ov { padding: 0 16px 40px; }
.fi-ch-h { margin: 22px 0 12px; color: #3b3f4a; font-size: 14px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.fi-ch-list { margin: 0; padding: 0; list-style: none; }
.fi-ch-list li + li { border-top: 1px solid var(--ch-line); }
.fi-ch-list a { display: flex; align-items: center; gap: 14px; padding: 12px 0; color: inherit; text-decoration: none; }
.fi-ch-sq { display: grid; place-items: center; flex: none; width: 52px; height: 52px; background: linear-gradient(135deg, var(--c1, #555a6b), var(--c2, #22252f)); font-size: 26px; line-height: 1; }
.fi-ch-sq--s { width: 38px; height: 38px; font-size: 19px; }
.fi-ch-row { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.fi-ch-row-t { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.fi-ch-row-t b { font-size: 18px; font-weight: 900; }
.fi-ch-row-t time { flex: none; color: var(--ch-muted); font-size: 13px; font-weight: 600; }
.fi-ch-row-s { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--ch-muted); font-size: 15px; }
.fi-ch-row-s > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fi-ch-row-s b { color: var(--ch-text); font-weight: 600; }
.fi-ch-row-s em { flex: none; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--ch-acc); color: #fff; font-size: 12px; font-style: normal; font-weight: 800; line-height: 22px; text-align: center; box-sizing: border-box; }
.fi-ch-list a.has-new .fi-ch-row-s > span { color: var(--ch-text); }
.fi-ch-list a:hover .fi-ch-row-t b { color: var(--ch-acc); }

.fi-ch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; padding: 0; list-style: none; }
.fi-ch-grid a { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; min-height: 160px; padding: 16px; box-sizing: border-box; background: linear-gradient(135deg, var(--c1, #555a6b), var(--c2, #22252f)); color: #fff; text-decoration: none; transition: filter .15s; }
.fi-ch-grid a:hover { filter: brightness(1.08); }
.fi-ch-grid b { font-size: 19px; font-weight: 900; line-height: 1.15; }
.fi-ch-grid a > span:last-child { color: rgba(255, 255, 255, .78); font-size: 14px; }
.fi-ch-tile-e { position: absolute; top: 14px; right: 14px; font-size: 38px; line-height: 1; }
.fi-ch-chip { position: absolute; top: 14px; left: 14px; padding: 3px 7px; background: rgba(255, 255, 255, .18); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

.fi-ch-livecard { display: block; margin: 4px 0 6px; padding: 14px 16px; background: linear-gradient(135deg, #e00030, #9a1450); color: #fff; text-decoration: none; }
.fi-ch-livecard-k { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: .1em; }
.fi-ch-livecard-k i { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: fi-ch-blink 1.2s infinite; }
.fi-ch-livecard-m { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.fi-ch-livecard-m > span { display: flex; flex: 1; align-items: center; gap: 8px; font-size: 15px; }
.fi-ch-livecard-m > span:last-child { justify-content: flex-end; }
.fi-ch-livecard-m strong { font-size: 30px; font-weight: 900; font-variant-numeric: tabular-nums; }
@keyframes fi-ch-blink { 50% { opacity: .25; } }

/* Raum */
.fi-cr { display: flex; flex-direction: column; min-height: 320px; background: var(--ch-bg); }
.fi-cr .fi-ch-top { flex: none; gap: 10px; min-height: 58px; border-bottom: 1px solid var(--ch-line); background: var(--ch-card); }
.fi-cr-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fi-cr-title b { overflow: hidden; font-size: 17px; font-weight: 900; white-space: nowrap; text-overflow: ellipsis; }
.fi-cr-title small { color: var(--ch-muted); font-size: 12.5px; }
.fi-cr-more { flex: none; padding: 6px 10px; border: 1px solid var(--ch-line); background: none; color: var(--ch-muted); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.fi-cr-games { flex: none; display: flex; gap: 8px; padding: 8px 12px; overflow-x: auto; border-bottom: 1px solid var(--ch-line); background: var(--ch-card); scrollbar-width: none; }
.fi-cr-games[hidden] { display: none; }
.fi-cr-game { display: flex; flex: none; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--ch-line); color: inherit; font-size: 13px; text-decoration: none; }
.fi-cr-game strong { font-weight: 900; font-variant-numeric: tabular-nums; }
.fi-cr-game-c { display: flex; align-items: center; gap: 4px; color: var(--ch-acc); font-size: 11.5px; font-weight: 800; }
.fi-cr-game-c i { width: 6px; height: 6px; border-radius: 50%; background: var(--ch-acc); animation: fi-ch-blink 1.2s infinite; }

.fi-cr-list { flex: 1; min-height: 0; padding: 12px 12px 8px; overflow-y: auto; overscroll-behavior: contain; }
.fi-cm-day { margin: 10px 0; text-align: center; }
.fi-cm-day span { padding: 3px 10px; border-radius: 10px; background: rgba(0, 0, 0, .06); color: var(--ch-muted); font-size: 11.5px; font-weight: 700; }
.fi-cm { display: flex; align-items: flex-end; gap: 8px; margin-top: 10px; }
.fi-cm.is-compact { margin-top: 2px; padding-left: 40px; }
.fi-cm.is-mine { justify-content: flex-end; padding-left: 0; }
.fi-cm-av { display: grid; place-items: center; flex: none; width: 32px; height: 32px; overflow: hidden; border-radius: 50%; background: rgba(230, 25, 122, .1); color: var(--ch-acc); font-size: 14px; font-weight: 800; text-decoration: none; }
.fi-cm-av img { width: 100%; height: 100%; object-fit: cover; }
.fi-cm-col { display: flex; flex-direction: column; max-width: 74%; }
.fi-cm.is-mine .fi-cm-col { align-items: flex-end; }
.fi-cm-bub { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 8px 12px 7px 10px; border-radius: 4px 16px 16px 16px; background: var(--ch-other); cursor: pointer; outline: none; }
.fi-cm.is-compact .fi-cm-bub { border-radius: 16px; }
.fi-cm.is-mine .fi-cm-bub { border-radius: 16px 4px 16px 16px; background: var(--ch-acc); color: #fff; }
.fi-cm.is-mine.is-compact .fi-cm-bub { border-radius: 16px; }
.fi-cm-bub:focus-visible { box-shadow: 0 0 0 2px var(--ch-acc); }
.fi-cm-name { color: var(--ch-acc); font-size: 13px; font-weight: 800; }
.fi-cm-text { font-size: 15px; line-height: 1.32; white-space: pre-wrap; overflow-wrap: anywhere; }
.fi-cm-bub time { display: flex; align-items: center; gap: 3px; align-self: flex-end; margin-top: -2px; color: var(--ch-muted); font-size: 10.5px; }
.fi-cm.is-mine .fi-cm-bub time { color: rgba(255, 255, 255, .75); }
.fi-cm-gif { display: block; max-width: 220px; max-height: 170px; border-radius: 10px; }
.fi-cm-quote { display: flex; flex-direction: column; padding: 5px 8px; border-left: 2.5px solid var(--ch-acc); border-radius: 8px; background: rgba(0, 0, 0, .05); font-size: 12px; }
.fi-cm-quote b { font-weight: 800; }
.fi-cm-quote span { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.fi-cm.is-mine .fi-cm-quote { border-left-color: #fff; background: rgba(255, 255, 255, .18); }
.fi-cm-rxs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.fi-cm-rx { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border: 1px solid var(--ch-line); border-radius: 12px; background: var(--ch-card); font-size: 13px; cursor: pointer; }
.fi-cm-rx b { font-size: 11.5px; font-weight: 800; }
.fi-cm-rx.is-mine { border-color: var(--ch-acc); background: rgba(230, 25, 122, .14); }

/* Fuß */
.fi-cr-foot { flex: none; border-top: 1px solid var(--ch-line); background: var(--ch-card); padding-bottom: env(safe-area-inset-bottom); }
.fi-cr-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; }
.fi-cr-gifbtn, .fi-cr-send { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; }
.fi-cr-gifbtn { background: var(--ch-other); color: var(--ch-text); font: inherit; font-size: 12px; font-weight: 900; }
.fi-cr-send { background: var(--ch-acc); color: #fff; }
.fi-cr-send:disabled { background: #d6d8de; cursor: default; }
.fi-cr-form textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 104px; padding: 11px 16px; border: 1px solid var(--ch-line); border-radius: 22px; background: var(--ch-bg); color: var(--ch-text); font: inherit; font-size: 15px; line-height: 1.3; resize: none; box-sizing: border-box; outline: none; }
.fi-cr-form textarea:focus { border-color: var(--ch-acc); }
.fi-cr-reply { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px 0; color: var(--ch-muted); font-size: 13px; }
.fi-cr-reply[hidden] { display: none; }
.fi-cr-reply b { color: var(--ch-acc); }
.fi-cr-reply button { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; background: none; color: var(--ch-muted); cursor: pointer; }
.fi-cr-gifs { padding: 10px 12px 0; }
.fi-cr-gifs[hidden] { display: none; }
.fi-cr-gifs input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--ch-line); background: var(--ch-bg); color: var(--ch-text); font: inherit; font-size: 15px; box-sizing: border-box; }
.fi-cr-gifgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; max-height: 210px; margin-top: 8px; overflow-y: auto; }
.fi-cr-gifgrid button { padding: 0; border: 0; background: var(--ch-other); cursor: pointer; aspect-ratio: 4 / 3; }
.fi-cr-gifgrid img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fi-cr-gifs small { display: block; padding: 6px 0 0; color: var(--ch-muted); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-align: right; }
.fi-cr-join { padding: 16px 16px 18px; text-align: center; }
.fi-cr-join h2 { margin: 0 0 10px; font-size: 18px; font-weight: 900; }
.fi-cr-join p { margin: 0 0 12px; color: var(--ch-muted); font-size: 14px; }
.fi-cr-join ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin: 0 0 12px; padding: 0; color: var(--ch-muted); font-size: 14px; list-style: none; }
.fi-cr-join label { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 12px; font-size: 14px; font-weight: 600; cursor: pointer; }
.fi-cr-join input { width: 18px; height: 18px; accent-color: var(--ch-acc); }
.fi-cr-join .fi-ch-btn { width: 100%; max-width: 360px; }

/* Aktionen */
.fi-ch-sheet { position: fixed; inset: 0; z-index: 100050; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, .45); }
.fi-ch-sheet[hidden] { display: none; }
.fi-ch-sheet-box { width: 100%; max-width: 480px; padding: 16px 16px calc(12px + env(safe-area-inset-bottom)); background: #fff; color: #121212; box-sizing: border-box; }
.fi-ch-sheet-h { margin: 0 0 8px; font-size: 17px; font-weight: 900; }
.fi-ch-rxrow { display: flex; justify-content: space-between; gap: 4px; }
.fi-ch-rxrow:empty { display: none; }
.fi-ch-rxbtn { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid #e3e6e8; border-radius: 50%; background: #fff; font-size: 22px; cursor: pointer; }
.fi-ch-rxbtn.is-on { border-color: #e6197a; background: rgba(230, 25, 122, .14); }
.fi-ch-acts { margin: 10px 0 0; padding: 0; list-style: none; }
.fi-ch-acts button { width: 100%; padding: 14px 4px; border: 0; border-top: 1px solid #eceef0; background: none; color: inherit; font: inherit; font-size: 16px; font-weight: 600; text-align: left; cursor: pointer; }
.fi-ch-acts button.is-red { color: #d52b1e; }
.fi-ch-rxrow:empty + .fi-ch-acts { margin-top: 0; }
.fi-ch-rxrow:empty + .fi-ch-acts li:first-child button { border-top: 0; }
.fi-ch-sheet-cancel { width: 100%; margin-top: 8px; padding: 13px; border: 0; background: #f0f1f4; color: #121212; font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; }
.fi-ch-toast { position: fixed; left: 50%; bottom: 96px; z-index: 100060; max-width: calc(100% - 32px); margin: 0; padding: 12px 16px; background: #121212; color: #fff; font-size: 14px; font-weight: 600; transform: translateX(-50%); box-sizing: border-box; }
.fi-ch-toast[hidden] { display: none; }

@media (min-width: 1024px) {
	.fi-chats { padding-top: 12px; }
	.fi-ch-grid { grid-template-columns: repeat(3, 1fr); }
	.fi-cr { border: 1px solid var(--ch-line); }
	.fi-ch-sheet { align-items: center; }
	.fi-cm-col { max-width: 62%; }
}
