/* App pages: chat list (/), games (/games/, /games/<slug>/) and Me (/me/). The chat screens use style.css. */
:root {
  --bg: #1b1d23;
  --text: #e4e7ed;
  --muted: #8a92a1;
  --accent: #a47fd0; /* the game's character sets this */
  --panel: #262932;
  --page-w: 520px; /* every page is this wide at most: chat, list, games, me, privacy */
  --comic: "Comic Sans MS", "Comic Neue", "Chalkboard SE", "Marker Felt", "Segoe Print", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
}
.app { max-width: var(--page-w); margin: 0 auto; padding: 0 12px calc(84px + env(safe-area-inset-bottom)); min-height: 100vh; min-height: 100dvh; }
.app.no-tabs { padding-bottom: 32px; }
.app-bar { display: flex; align-items: center; gap: 10px; padding: 14px 0 8px; }
.app-bar h1 { flex: 1 1 0; min-width: 0; font-family: var(--comic); font-size: 1.6rem; margin: 0; }
.back-btn { display: grid; place-items: center; width: 36px; height: 40px; border-radius: 12px; color: var(--text); text-decoration: none; flex: none; }
.back-btn:hover { background: rgba(255, 255, 255, 0.08); }
.back-btn .icon { width: 1.6em; height: 1.6em; }
.wallet { margin: 0; font-size: 0.92rem; color: var(--text); white-space: nowrap; }
.icon { width: 1.5em; height: 1.5em; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.intro { color: #cfd4de; margin: 0 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* chat list (WhatsApp style) */
.contacts { list-style: none; margin: 0; padding: 0; }
.row { position: relative; display: flex; align-items: center; border-bottom: 1px solid #2a2d36; }
.row:hover, .row:focus-within { background: #20232b; }
.contact { flex: 1 1 0; min-width: 0; display: flex; gap: 12px; align-items: center; padding: 10px 4px; color: inherit; text-decoration: none; }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: #eef1f8; object-fit: contain; flex: none; border: 2px solid var(--c, var(--accent)); }
.contact-main { flex: 1 1 0; min-width: 0; display: grid; gap: 2px; }
.contact-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.c-title { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-name { font-size: 1.02rem; }
.c-status { font-size: 0.85rem; color: var(--muted); }
.c-status::before { content: " \00b7  "; }
.c-time { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.c-preview { font-size: 0.9rem; color: #b6bcc9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.35em; }
.more { flex: none; display: grid; place-items: center; width: 36px; height: 36px; margin-left: 2px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.more:hover, .more[aria-expanded="true"] { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.menu { position: absolute; right: 6px; top: calc(50% + 20px); z-index: 20; min-width: 160px; padding: 4px; background: #2b2f39; border: 1px solid #3d4250; border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; font: inherit; color: var(--text); background: transparent; border: 0; border-radius: 8px; padding: 9px 12px; cursor: pointer; }
.menu button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); }
.menu button .icon { width: 1.1em; height: 1.1em; }
.menu button:disabled { color: var(--muted); cursor: default; }

/* small legal link under the chat list (Google wants the home page to link to the privacy policy) */
.legal { margin: 18px 0 0; text-align: center; font-size: 0.75rem; }
.legal a { color: var(--muted); text-decoration: none; }
.legal a:hover { text-decoration: underline; }

/* bottom tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: #20232b; border-top: 1px solid #2f333d; padding-bottom: env(safe-area-inset-bottom); }
.tabbar-in { max-width: var(--page-w); margin: 0 auto; display: flex; }
.tab { flex: 1 1 0; display: grid; justify-items: center; gap: 2px; padding: 8px 4px 9px; color: var(--muted); text-decoration: none; font-size: 0.72rem; }
.tab { -webkit-tap-highlight-color: transparent; } /* no blue flash over the tab while it is pressed (the browser's own tap highlight) */
.tab:hover { color: var(--text); }
.tab[aria-current="page"] { color: var(--text); }
.tab[aria-current="page"] .icon { stroke: var(--accent); }

/* Me */
.profile { display: flex; gap: 14px; align-items: center; background: var(--panel); border-radius: 14px; padding: 14px; margin: 6px 0 14px; }
.profile .ph { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: #3a3e4a; color: #cfd4de; flex: none; }
.profile .ph .icon { width: 1.9em; height: 1.9em; }
.profile strong { font-size: 1.1rem; }
.profile p { margin: 2px 0 0; font-size: 0.85rem; color: var(--muted); }
.who-am-i { min-width: 0; }
/* Google's button is a light iframe; on a dark page the browser would paint a white box behind it unless the
   iframe's colour scheme matches its own */
#gsi, #gsi iframe { margin-top: 10px; color-scheme: light; }
#gsi iframe { margin-top: 0; }
.err { margin: 8px 0 0; font-size: 0.85rem; color: #ff8a80; }
.acct { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.acct button { font: inherit; font-size: 0.85rem; color: var(--text); background: transparent; border: 1px solid #4a4f5c; border-radius: 10px; padding: 6px 12px; cursor: pointer; }
.acct button:hover { background: rgba(255, 255, 255, 0.08); }
.acct .danger { color: #ff8a80; border-color: #6b3a3a; }
.signin { margin-top: 8px; font: inherit; font-size: 0.85rem; color: var(--muted); background: transparent; border: 1px dashed #4a4f5c; border-radius: 10px; padding: 6px 10px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 18px; }
.stat { background: var(--panel); border-radius: 12px; padding: 10px 12px; }
.stat b { display: block; font-size: 1.4rem; }
.stat span { font-size: 0.8rem; color: var(--muted); }
.me h2 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 18px 0 8px; }
.bonds { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bonds li { display: flex; align-items: center; gap: 10px; }
.bonds img { width: 36px; height: 36px; border-radius: 50%; background: #eef1f8; object-fit: contain; flex: none; }
.bonds .who { flex: 1 1 0; min-width: 0; }
.bonds .bar { display: block; height: 4px; border-radius: 2px; margin-top: 4px; background: linear-gradient(90deg, var(--c, var(--accent)) var(--pct, 0%), #3a3e4a var(--pct, 0%)); }
.links { list-style: none; margin: 0; padding: 0; }
.links a { display: block; padding: 12px 4px; color: var(--text); text-decoration: none; border-bottom: 1px solid #2a2d36; }
.links a:hover { background: #20232b; }

/* hub */
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.card { background: var(--panel); border: 2px solid #14151a; border-radius: 14px; box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5); overflow: hidden; }
.card a, .card-body { display: flex; gap: 12px; align-items: center; padding: 12px; color: inherit; text-decoration: none; }
.card a:hover { background: #2c303a; }
.card img { width: 64px; height: 64px; border-radius: 50%; background: #eef1f8; object-fit: contain; flex: none; }
.card-text { display: grid; gap: 2px; }
.card h2 { font-family: var(--comic); font-size: 1.15rem; margin: 0; }
.tagline { color: var(--muted); font-size: 0.85rem; }
.desc { font-size: 0.9rem; color: #cfd4de; }
.meta { display: flex; justify-content: space-between; gap: 10px; padding: 0 12px 10px 88px; font-size: 0.8rem; color: var(--muted); }
.bond { position: relative; padding-bottom: 6px; }
.bond::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent) var(--pct, 0%), #3a3e4a var(--pct, 0%)); }
.card.soon { opacity: 0.6; }
.soon-tag { font-style: italic; }

/* a game */
.play { position: relative; border: 3px solid #14151a; border-radius: 14px; overflow: hidden; box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.55); background: #1a1838; }
canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; touch-action: manipulation; cursor: pointer; outline: none; }
canvas:focus-visible { box-shadow: inset 0 0 0 3px var(--accent); }
.how { color: var(--muted); font-size: 0.9rem; text-align: center; margin: 10px 0 0; }
.result { position: absolute; inset: 0; display: grid; place-content: center; gap: 4px; text-align: center; padding: 16px;
  background: rgba(20, 21, 26, 0.86); }
.result h2 { font-family: var(--comic); font-size: 1.5rem; margin: 0; }
.result p { margin: 0; }
.say { font-family: var(--comic); color: #fff; margin-top: 6px !important; }
.actions { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.actions button, .actions a { font: inherit; font-weight: 700; color: #14151a; background: var(--accent); border: 2px solid #14151a;
  border-radius: 12px; padding: 8px 16px; box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.55); cursor: pointer; text-decoration: none; }
.actions a { background: #eef1f8; }
.actions button:active, .actions a:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.55); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* daily quests (games hub) */
.quests { background: var(--panel); border-radius: 14px; padding: 12px 14px; margin: 0 0 14px; }
.quests-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.quests h2 { margin: 0; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.streak, .streak-me { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 0.85rem; color: #ffb454; }
.streak .icon, .streak-me .icon { width: 1.1em; height: 1.1em; }
.streak-me { margin: 0 0 6px; }
#questList { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.quest { display: flex; align-items: center; gap: 10px; font-size: 0.92rem; }
.q-label { flex: 1 1 0; min-width: 0; }
.q-count { color: var(--muted); font-size: 0.8rem; }
.q-reward { color: #ffb454; font-size: 0.8rem; min-width: 2em; text-align: right; }
.quest.done .q-label { color: var(--muted); text-decoration: line-through; }
.quest.done .q-count { color: #7bd88f; }
.quests-done { font-size: 0.82rem; color: #ffb454; }
.quests-done:empty { display: none; }

/* stories (Me) */
.story-group { margin: 0 0 12px; }
.story-group h3 { margin: 0 0 4px; font-size: 0.95rem; }
.story-group details { background: var(--panel); border-radius: 10px; padding: 8px 12px; margin-bottom: 6px; }
.story-group summary { cursor: pointer; font-family: var(--comic); }
.story-group details p { margin: 8px 0 2px; font-size: 0.92rem; color: #cfd4de; }
.story-group .locked { margin: 0 0 6px; font-size: 0.82rem; color: var(--muted); font-style: italic; }

.profile .ph { overflow: hidden; }
.profile .ph img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* Quiet Wish (memory game) */
.play.memory { display: grid; justify-items: center; gap: 10px; padding: 18px 14px 20px; background: radial-gradient(circle at 50% 0%, #2b2547, #17152b 70%); }
.memory-ghost { width: 96px; height: auto; max-height: 120px; object-fit: contain; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.3)); }
.m-status { margin: 0; min-height: 1.5em; font-family: var(--comic); color: #fff; font-size: 1.05rem; }
.petals { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: min(300px, 100%); }
.petal { aspect-ratio: 1; border: 3px solid #14151a; border-radius: 62% 38% 60% 40% / 45% 55% 45% 55%; cursor: pointer; opacity: 0.55;
  background: radial-gradient(circle at 35% 30%, var(--c1), var(--c2)); box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5);
  transition: opacity 0.25s, transform 0.25s, box-shadow 0.25s; }
.petal.p0 { --c1: #f3dc8a; --c2: #c9983a; }
.petal.p1 { --c1: #f4b4c8; --c2: #c9607e; }
.petal.p2 { --c1: #a9d6f5; --c2: #4f8fc0; }
.petal.p3 { --c1: #b5e8c6; --c2: #4aa56b; }
.petal.p1 { border-radius: 40% 60% 38% 62% / 55% 45% 55% 45%; }
.petal.p2 { border-radius: 60% 40% 62% 38% / 45% 55% 45% 55%; }
.petal:not(:disabled):hover { opacity: 0.8; }
.petal:disabled { cursor: default; }
.petal.on { opacity: 1; transform: scale(1.07); box-shadow: 0 0 26px 8px var(--c1), 3px 3px 0 rgba(0, 0, 0, 0.5); }
.petal.wrong { opacity: 0.25; animation: shake 0.35s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.petal:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.sighs { margin: 0; font-size: 0.8rem; color: var(--muted); min-height: 1.2em; }
.m-start { font: inherit; font-weight: 700; color: #14151a; background: var(--accent); border: 2px solid #14151a; border-radius: 12px;
  padding: 9px 22px; box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.55); cursor: pointer; }
.m-start[hidden] { display: none; }

/* Night Rounds */
.play.rounds { background: radial-gradient(circle at 50% 0%, #2a2f4a, #15172a 70%); }
.rooms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: min(340px, 100%); }
.room { position: relative; aspect-ratio: 1.15; display: grid; place-items: center; border: 3px solid #14151a; border-radius: 14px; cursor: pointer;
  background: #2b3050; color: #8d96c4; box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5); transition: background 0.2s, transform 0.15s, box-shadow 0.2s; overflow: hidden; }
.room-num { font-family: var(--comic); font-size: 1.6rem; }
.room-bar { position: absolute; left: 8px; right: 8px; bottom: 7px; height: 5px; border-radius: 3px; background: rgba(0, 0, 0, 0.35); overflow: hidden; opacity: 0; }
.room-bar i { display: block; height: 100%; width: calc(var(--left, 0) * 100%); background: #fff; border-radius: 3px; }
.room:disabled { cursor: default; }
.room.lit { background: #ffd966; color: #14151a; transform: scale(1.04); box-shadow: 0 0 22px 6px rgba(255, 217, 102, 0.65), 3px 3px 0 rgba(0, 0, 0, 0.5); }
.room.lit .room-bar { opacity: 1; }
.room.lit .room-bar i { background: linear-gradient(90deg, #e0603a, #14151a); }
.room.ok { background: #7bd88f; color: #14151a; }
.room.missed { background: #c0392b; color: #fff; animation: shake 0.35s; }
.room.idle { animation: shake 0.25s; }
.room:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* Whispers */
.whispers { list-style: none; margin: 0; padding: 0; }
.whisper { padding: 14px 4px; border-bottom: 1px solid #2a2d36; }
.w-head { display: flex; align-items: center; gap: 12px; }
.w-who { display: flex; flex-direction: column; min-width: 0; }
.w-who time { font-size: 0.75rem; color: var(--muted); }
.w-link { color: inherit; text-decoration: none; }
.w-link:hover time { text-decoration: underline; }
.w-ad { padding: 10px 4px; }
.w-ad ins { min-width: 250px; }
.w-all { display: inline-block; margin: 16px 4px; font-size: 0.85rem; color: var(--muted); }
.whisper .avatar { width: 46px; height: 46px; }
.w-text { margin: 10px 0 6px; font-family: var(--comic); line-height: 1.45; color: #e8ebf2; overflow-wrap: anywhere; }
/* The card for what the ghost found online: picture, title, source */
.w-card { display: flex; flex-direction: column; margin: 6px 0 8px; overflow: hidden; border: 1px solid #2f333d; border-radius: 12px; background: #20232b; color: inherit; text-decoration: none; }
.w-card:hover { border-color: var(--c, var(--accent)); }
.w-card img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #2a2d36; }
.w-card-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 12px; }
.w-card-text strong { font-size: 0.9rem; line-height: 1.3; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.w-card-text small { font-size: 0.75rem; color: var(--muted); }
.whisper-note { color: var(--muted); text-align: center; margin: 24px 0; }
.tab { position: relative; }
.tab.dot::after { content: ""; position: absolute; top: 6px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: #ff6b81; border: 2px solid #20232b; }

/* Comments under a whisper */
.w-comment, .w-love, .w-share { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 0.8rem; background: transparent; border: 0; padding: 4px 0; cursor: pointer; }
.w-comment { color: var(--muted); }
.w-comment .icon, .w-love .icon, .w-share .icon { width: 1.3em; height: 1.3em; flex: none; }
.w-comment:hover { color: var(--text); } /* no underline: the icon just brightens */
.w-count { color: var(--muted); }
.comments { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #3a3e4a; }
.c-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.comment { position: relative; display: flex; gap: 8px; padding-right: 22px; }
.c-avatar { width: 26px; height: 26px; border-radius: 50%; background: #eef1f8; object-fit: contain; flex: none; border: 2px solid var(--c, var(--accent)); }
.c-deleted { color: var(--muted); font-style: italic; }
.comment.pending { opacity: 0.6; }
.c-initial { display: grid; place-items: center; background: #3a3e4a; color: var(--text); font-size: 0.75rem; font-weight: 700; border-color: transparent; }
.c-body { min-width: 0; flex: 1 1 0; }
.c-head { display: flex; align-items: baseline; gap: 6px; font-size: 0.8rem; }
.c-head time { margin-left: auto; font-size: 0.7rem; color: var(--muted); }
.c-badge { font-size: 0.65rem; padding: 0 6px; border-radius: 8px; background: var(--c, var(--accent)); color: #14151a; }
.c-text { margin: 2px 0 0; font-size: 0.9rem; line-height: 1.4; overflow-wrap: anywhere; }
.c-del { position: absolute; top: 0; right: 0; width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; }
.c-del:hover { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.c-none { color: var(--muted); font-size: 0.85rem; font-style: italic; }
.c-form { display: flex; gap: 6px; }
.c-form input { flex: 1 1 0; min-width: 0; font: inherit; font-size: 0.9rem; color: var(--text); background: #14151a; border: 1px solid #3a3e4a; border-radius: 18px; padding: 7px 12px; }
.c-form input:focus { outline: 2px solid var(--c, var(--accent)); outline-offset: 1px; }
.c-form button { display: grid; place-items: center; flex: none; width: 36px; height: 36px; padding: 0; color: #14151a; background: var(--c, var(--accent)); border: 0; border-radius: 50%; cursor: pointer; }
.c-form button .icon { width: 1.15rem; height: 1.15rem; margin-left: 2px; }
.c-form button:disabled, .c-form input:disabled { opacity: 0.6; cursor: default; }
.c-status { margin: 0 0 6px; min-height: 1.1em; font-size: 0.8rem; color: var(--muted); }
.c-status:empty::before { content: none; } /* no stray dot while there is nothing to say */
.c-as { margin: 6px 0 0; font-size: 0.75rem; color: var(--muted); }
.c-as a { color: var(--muted); }
.langs { display: flex; gap: 8px; margin: 0 0 4px; }
.langs button { font: inherit; font-size: 0.85rem; color: var(--text); background: transparent; border: 1px solid #4a4f5c; border-radius: 10px; padding: 8px 14px; cursor: pointer; }
.langs button:hover { background: rgba(255, 255, 255, 0.08); }
.langs button[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, transparent); }
.nick { display: flex; gap: 8px; margin: 0 0 4px; }
.nick input { flex: 1 1 0; min-width: 0; font: inherit; color: var(--text); background: var(--panel); border: 1px solid #3a3e4a; border-radius: 10px; padding: 8px 12px; }
.nick button { font: inherit; font-size: 0.85rem; color: var(--text); background: transparent; border: 1px solid #4a4f5c; border-radius: 10px; padding: 8px 12px; cursor: pointer; }
.nick button:hover { background: rgba(255, 255, 255, 0.08); }
.nick-note { margin: 0 0 4px; font-size: 0.8rem; color: var(--muted); }
.nick-note.bad { color: #ff8a80; }

/* Love (the heart) */
.w-actions { display: flex; align-items: center; gap: 16px; }
.w-love, .w-share { color: var(--muted); }
.w-share:hover { color: var(--text); }
.w-love .icon { transition: transform 0.15s; }
.w-love:hover { color: #ff6b81; }
.w-love[aria-pressed="true"] { color: #ff6b81; }
.w-love[aria-pressed="true"] .icon { fill: currentColor; }
.w-love:active .icon { transform: scale(1.25); }
.loved-count { color: var(--muted); }

/* weekly leaderboard (games hub) and badges (Me) */
.leaderboard { background: var(--panel); border-radius: 14px; padding: 12px 14px; margin: 0 0 14px; }
.leaderboard h2 { margin: 0 0 8px; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.lb-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.lb-tabs button { font: inherit; font-size: 0.82rem; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--muted); background: none; color: inherit; cursor: pointer; }
.lb-tabs button[aria-pressed="true"] { background: #ffb454; border-color: #ffb454; color: #1a1a1a; }
#lbList { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
#lbList li { display: flex; gap: 10px; font-size: 0.92rem; }
.lb-rank { width: 2.4em; color: var(--muted); }
.lb-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { font-variant-numeric: tabular-nums; }
.lb-me { margin: 8px 0 0; font-size: 0.88rem; color: #ffb454; }
.lb-me:empty { display: none; }
.lb-note { margin: 8px 0 0; font-size: 0.8rem; color: var(--muted); }
.badges { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.badge { display: grid; gap: 2px; padding: 8px 10px; border-radius: 12px; background: var(--panel); opacity: 0.45; }
.badge.got { opacity: 1; box-shadow: inset 0 0 0 1px #ffb454; }
.badge small { color: var(--muted); font-size: 0.78rem; }

/* candle shop (Me) */
.shop-balance { margin: 0 0 4px; font-size: 0.9rem; color: #ffb454; }
.shop-msg { margin: 0 0 6px; font-size: 0.85rem; color: #7bd88f; min-height: 1.2em; }
.shop-group h3 { margin: 10px 0 4px; font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.shop-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.shop-group li { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 0.92rem; }
.shop-group button { font: inherit; font-size: 0.82rem; padding: 3px 12px; border-radius: 999px; border: 1px solid var(--muted); background: none; color: inherit; cursor: pointer; }
.shop-group button:disabled { opacity: 0.55; cursor: default; }
.shop-group button.poor { opacity: 0.55; }

/* games that build their own markup (type "module") */
.play.module { min-height: min(72vh, 560px); background: radial-gradient(circle at 50% 0%, #2a2646, #15142b 70%); color: #f1f3f8; }
.module-root { width: 100%; min-height: inherit; position: relative; }

/* profile frames (shop, bond level 8): a ring around the profile photo and the chat header picture */
html[data-frame="gold"] { --frame: 0 0 0 3px #f5c542, 0 0 12px #f5c542aa; }
html[data-frame="ember"] { --frame: 0 0 0 3px #ff7a45, 0 0 12px #ff5a1faa; }
html[data-frame="moon"] { --frame: 0 0 0 3px #cfe3ff, 0 0 14px #9fc4ffcc; }
html[data-frame="rainbow"] { --frame: 0 0 0 3px #ff6b9d, 0 0 0 6px #ffd166, 0 0 0 9px #6bd6ff; }
html[data-frame="ribbon-1"] { --frame: 0 0 0 3px #a47fd0, 0 0 12px #a47fd0aa; }
html[data-frame="ribbon-2"] { --frame: 0 0 0 3px #4ec9b0, 0 0 12px #4ec9b0aa; }
html[data-frame="ribbon-3"] { --frame: 0 0 0 3px #f28fb5, 0 0 12px #f28fb5aa; }
html[data-frame="ribbon-4"] { --frame: 0 0 0 3px #8fd16b, 0 0 12px #8fd16baa; }
.ph, .head-avatar { box-shadow: var(--frame, none); }

/* weekly event banner (games hub) */
.event { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 10px 14px; border-radius: 14px; background: color-mix(in srgb, var(--accent, #a47fd0) 22%, var(--panel)); border: 1px solid var(--accent, #a47fd0); }
.event[hidden] { display: none; }
.event img { width: 44px; height: 44px; object-fit: contain; border-radius: 50%; background: #eef1f8; flex: none; }
.event div { flex: 1; min-width: 0; }
.event strong { display: block; font-size: 0.95rem; }
.event p { margin: 2px 0 0; font-size: 0.82rem; color: var(--muted); }
.event-count { font-size: 0.85rem; font-variant-numeric: tabular-nums; color: #ffb454; white-space: nowrap; }

/* Ghost Room page */
.room-page { display: grid; gap: 8px; }
.room-root { position: relative; width: 100%; height: min(62vh, 520px); border-radius: 14px; overflow: hidden; border: 3px solid #14151a; box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.55); background: #15142b; }
.room-note { margin: 0; font-size: 0.88rem; color: var(--muted); min-height: 1.2em; }
.room-share { font: inherit; font-size: 0.82rem; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--muted); background: none; color: inherit; cursor: pointer; }

/* games hub: filters, continue, NEW tag */
.hub-tools { display: grid; gap: 8px; margin: 0 0 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters button { font: inherit; font-size: 0.82rem; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--muted); background: none; color: inherit; cursor: pointer; }
.filters button[aria-pressed="true"] { background: #ffb454; border-color: #ffb454; color: #1a1a1a; }
.continue { display: inline-block; justify-self: start; padding: 6px 14px; border-radius: 999px; background: #ffb454; color: #1a1a1a; font-weight: 700; text-decoration: none; }
.continue[hidden], .card[hidden] { display: none; }
.new-tag { font-size: 0.65rem; padding: 1px 6px; border-radius: 999px; background: #7bd88f; color: #10331a; vertical-align: middle; }
