/* Base layout + default look. Each world re-skins this via variables in skins.css
   (scoped by body[data-theme]). Keep structure here, flavour there. */
:root {
  --bg: #f4f4f6;
  --card: #ffffff;
  --text: #1c1c22;
  --muted: #6b6b76;
  --accent: #6d4aff;
  --accent-text: #ffffff;
  --border: #e2e2e8;
  --up: #ff5a1f;
  --down: #3b82f6;
  --warn: #9a6700;
  --error: #d1242f;
  --input-bg: var(--bg);
  --topbar-bg: var(--card);
  --font-body: system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: var(--font-body);
  --font-ui: var(--font-body);
  --radius: 10px;
  --btn-radius: 999px;
  --tip-bg: #1c1c22;
  --tip-text: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121216; --card: #1c1c22; --text: #ececf1; --muted: #9a9aa6;
    --border: #2e2e38; --accent: #9d86ff; --warn: #e3b341; --tip-bg: #ececf1; --tip-text: #1c1c22;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); background: var(--bg); color: var(--text); line-height: 1.5; min-height: 100vh; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Fixed full-screen backdrop layer (themes paint it). A real element, not background-attachment:fixed,
   so it also works on iOS Safari. */
.backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--topbar-bg); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar { color: var(--topbar-text, var(--text)); }
.topbar a, .topbar button.link { color: var(--topbar-link, var(--accent)); }
.topbar .btn { color: var(--accent-text); }
.brand { font-family: var(--font-head); font-weight: 800; font-size: 1.25rem; color: var(--topbar-text, var(--text)) !important; }
.brand:hover { text-decoration: none; }
.theme-badge { font-family: var(--font-ui); font-weight: 500; font-size: .8rem; color: var(--topbar-muted, var(--muted)); margin-left: 4px; white-space: nowrap; }
nav { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; font-family: var(--font-ui); }
.container { max-width: 760px; margin: 16px auto; padding: 0 16px 48px; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.narrow { max-width: 460px; margin: 24px auto; }
.banner { background: var(--card); border: 1px dashed var(--border); border-radius: var(--radius); padding: 8px 12px; font-size: .9rem; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; }
.card h1 { margin: 0 0 8px; font-size: 1.5rem; }

.btn { display: inline-block; background: var(--accent); color: var(--accent-text); border: 0; border-radius: var(--btn-radius);
  padding: 6px 14px; font-family: var(--font-ui); font-size: 1rem; font-weight: 600; cursor: pointer; }
.btn:hover { text-decoration: none; filter: brightness(1.1); }
.btn:disabled { opacity: .6; cursor: wait; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
form.inline { display: inline; }

.stack { display: flex; flex-direction: column; gap: 10px; }
.stack label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-family: var(--font-ui); }
input, textarea { font-family: var(--font-body); font-size: 1rem; padding: 8px 10px; border-radius: calc(var(--radius) * .8);
  border: 1px solid var(--border); background: var(--input-bg); color: var(--text); width: 100%; }
.stack .btn { align-self: flex-start; }

.theme-picker { border: 1px solid var(--border); border-radius: var(--radius); display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; padding: 10px; margin: 0; }
.theme-picker legend { font-weight: 600; padding: 0 4px; font-family: var(--font-ui); }
.theme-option { display: flex !important; align-items: center; gap: 6px; flex-direction: row !important; cursor: pointer;
  padding: 8px 10px; border-radius: 8px; border: 2px solid transparent; font-weight: 500 !important; }
.theme-option:has(input:checked) { outline: 3px solid var(--accent); outline-offset: 1px; }
.theme-option input { width: auto; margin: 0; }
/* Each picker option previews its own world */
.theme-option[data-preview="scifi"] { background: #020a02; color: #33ff66; font-family: "VT323", monospace; font-size: 1.25rem; }
.theme-option[data-preview="pirate"] { background: #e9d3a3; color: #4a2a10; font-family: "Pirata One", cursive; font-size: 1.2rem; }
.theme-option[data-preview="victorian"] { background: #f3ead6; color: #3b2316; font-family: "IM Fell English SC", serif; font-size: 1.1rem; }
.theme-option[data-preview="fantasy"] { background: #e8d9b0; color: #3d2a12; font-family: "Cinzel", serif; font-weight: 700 !important; }
.theme-option[data-preview="caveman"] { background: #8a8580; color: #f2ece2; font-family: "Rubik Dirt", sans-serif; font-size: 1.15rem; }
.theme-option[data-preview="romcom"] { background: linear-gradient(135deg, #ffe0ea, #ff9ab5); color: #7a0f2e; font-family: "Pacifico", cursive; font-weight: 400 !important; font-size: 1.1rem; }

.sortbar { display: flex; width: fit-content; max-width: 100%; gap: 6px 18px; margin-bottom: 12px; flex-wrap: wrap; font-family: var(--font-ui);
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 14px; }
.sortbar a { color: var(--muted); font-weight: 600; }
.sortbar a.active { color: var(--text); border-bottom: 2px solid var(--accent); }

.feed { list-style: none; padding: 0; margin: 0; }
.post-row, .comment-row { display: flex; gap: 12px; align-items: flex-start; }
.post-main, .comment-main { flex: 1; min-width: 0; }
.post-title { font-family: var(--font-head); font-size: 1.1rem; font-weight: 600; color: var(--text); overflow-wrap: break-word; }
.post-full h1 { margin: 0 0 4px; font-size: 1.5rem; overflow-wrap: break-word; }
.meta { color: var(--muted); font-size: .85rem; font-family: var(--font-ui); }
.text { white-space: pre-wrap; overflow-wrap: break-word; hyphens: auto; margin-top: 6px; }

.votebox { display: flex; flex-direction: column; align-items: center; min-width: 34px; font-family: var(--font-ui); }
.vote { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 1rem; line-height: 1; padding: 3px; }
.vote:disabled { cursor: default; opacity: .5; }
.vote.up.active { color: var(--up); }
.vote.down.active { color: var(--down); }
.score { font-weight: 700; font-size: .95rem; }

.comments { list-style: none; padding-left: 16px; margin: 8px 0 0; border-left: 2px solid var(--border); }
.comments.root { padding-left: 0; border-left: 0; margin-top: 16px; }
.comment { margin: 12px 0; }
details summary { cursor: pointer; color: var(--muted); font-size: .85rem; font-family: var(--font-ui); }
details.reply form, details.original { margin-top: 6px; }
.original h3 { margin: 6px 0 0; font-size: 1rem; }

.error { color: var(--error); font-weight: 600; }
.warn { color: var(--warn); font-size: .85rem; }
.empty { color: var(--muted); }

/* ---- Links ---- */
.post-domain { font-family: var(--font-ui); font-size: .8rem; color: var(--muted); margin-left: 6px; white-space: nowrap; }
.ext-link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.link-box { display: flex; flex-direction: column; gap: 2px; margin: 10px 0 4px; padding: 10px 12px; border: 1px solid var(--border);
  border-left: 4px solid var(--accent); border-radius: calc(var(--radius) * .6); background: var(--input-bg); color: var(--text); text-decoration: none; }
.link-box:hover { text-decoration: none; filter: brightness(1.04); }
.link-box-label { font-family: var(--font-ui); font-weight: 700; color: var(--accent); }
.link-box-domain { font-weight: 600; }
.link-box-url { font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; font-family: ui-monospace, monospace; }
.form-hint { margin: -6px 0 0; }

/* ---- Profiles ---- */
.user-link { color: inherit; font-weight: 600; }
.profile-kicker { font-family: var(--font-ui); font-size: .8rem; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.card h1.profile-name { font-size: 2rem; margin: 2px 0 4px; overflow-wrap: anywhere; }
.profile-bio { margin: 14px 0; padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.profile-bio .text { margin-top: 0; font-size: 1.05rem; }
.profile-stats { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 8px 24px; font-family: var(--font-ui); }
.profile-stats strong { font-size: 1.35rem; font-family: var(--font-head); margin-right: 4px; }
.section-heading { font-size: 1.15rem; margin: 22px 0 10px; color: var(--topbar-text, var(--text)); text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.bio-meta { display: flex; justify-content: space-between; gap: 12px; }
.near-limit { color: var(--warn); font-weight: 700; }
.lost { text-align: center; }
.lost .btn { margin-top: 6px; }

/* ---- Inbox icon + unread badge (top bar) ---- */
.inbox-link { position: relative; display: inline-flex; align-items: center; font-size: 1.35rem; line-height: 1; padding: 2px 4px; text-decoration: none !important; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: #e5322d; color: #fff; font: 700 .7rem/1 system-ui, sans-serif; text-shadow: none; letter-spacing: 0; }
.inbox-link .badge { position: absolute; top: -6px; right: -8px; box-shadow: 0 0 0 2px var(--topbar-bg); }
.badge[hidden] { display: none; }

/* ---- Inbox ---- */
.inbox-list { list-style: none; margin: 0; padding: 0; }
.inbox-row a { display: block; padding: 12px 4px; border-top: 1px solid var(--border); color: var(--text); text-decoration: none; }
.inbox-row:first-child a { border-top: 0; }
.inbox-row a:hover { background: rgba(127, 127, 127, .08); }
.inbox-top, .inbox-bottom { display: flex; align-items: center; gap: 8px; min-width: 0; }
.inbox-name { font-family: var(--font-head); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-time { margin-left: auto; white-space: nowrap; }
.inbox-preview { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.inbox-row.unread .inbox-name, .inbox-row.unread .inbox-preview { font-weight: 700; color: var(--text); }

/* ---- Chat thread: full-height messenger layout ---- */
body.chat-page { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
body.chat-page .container { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; margin-top: 12px; padding-bottom: 12px; }
.chat { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0; margin: 0; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.chat-back { font-size: 1.3rem; text-decoration: none !important; padding: 0 4px; }
.chat-who { display: flex; flex-direction: column; min-width: 0; }
.chat-name { font-family: var(--font-head); font-weight: 700; font-size: 1.3rem; line-height: 1.1; color: var(--text); }
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 14px; overscroll-behavior: contain; }
.chat-list { list-style: none; margin: 0; padding: 0; }
.chat-empty { text-align: center; padding: 30px 0; }
.load-older { display: block; margin: 4px auto 10px; font-size: .9rem; }
.day-sep { text-align: center; margin: 14px 0 8px; }
.day-sep span { display: inline-block; font: 600 .75rem/1 var(--font-ui); color: var(--muted); padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; }
.msg { display: flex; margin-top: 10px; }
.msg.grouped { margin-top: 3px; }
.msg.mine { justify-content: flex-end; }
.bubble { max-width: min(78%, 520px); padding: 7px 12px 5px; border-radius: 16px; overflow-wrap: break-word; }
.bubble-text { white-space: pre-wrap; }
.msg.mine .bubble { background: var(--accent); color: var(--accent-text); border-bottom-right-radius: 5px; }
.msg.theirs .bubble { background: var(--input-bg); color: var(--text); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.msg.mine .bubble a, .msg.mine .bubble button.link, .msg.mine .bubble summary { color: inherit; }
.msg.pending .bubble { opacity: .65; }
.bubble-time { display: block; text-align: right; font: .68rem/1.2 system-ui, sans-serif; opacity: .7; margin-top: 2px; }
.bubble-note { font-size: .75rem; opacity: .85; font-style: italic; margin-top: 2px; }
.bubble-original { font-size: .8rem; margin-top: 3px; }
.bubble-original summary { font-size: .72rem; opacity: .8; }
.bubble-original div { opacity: .9; white-space: pre-wrap; }
.seen { text-align: right; margin: 4px 2px 0; font-size: .75rem; }
.new-pill { position: absolute; left: 50%; bottom: 76px; transform: translateX(-50%); z-index: 5; border: 0; border-radius: 999px;
  padding: 6px 14px; background: var(--accent); color: var(--accent-text); font: 600 .85rem/1 var(--font-ui); box-shadow: 0 4px 12px rgba(0,0,0,.35); cursor: pointer; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border);
  padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.composer textarea { flex: 1; resize: none; min-height: 42px; max-height: 160px; line-height: 1.35; border-radius: 20px; padding: 10px 14px; }
.composer .send-btn { flex: none; height: 42px; }
.composer-count { position: absolute; right: 18px; bottom: 60px; font-size: .7rem; }
.chat-error { margin: 0; padding: 0 14px 10px; font-size: .85rem; }

/* ---- Layout: Activities panel (left column on wide screens, chip row otherwise) ---- */
.activities { display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px 0; scrollbar-width: none; font-family: var(--font-ui); }
.activities::-webkit-scrollbar { display: none; }
.act-heading { display: none; }
.act { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 6px 12px; border-radius: 999px; background: var(--card);
  border: 1px solid var(--border); color: var(--text); font-weight: 600; font-size: .9rem; text-decoration: none !important; white-space: nowrap; }
.act.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.act .badge { margin-left: 2px; }
@media (min-width: 1100px) {
  .layout { display: grid; grid-template-columns: 300px minmax(0, 1fr) 300px; }  /* symmetric: feed dead centre */
  .layout > .container { width: 100%; }  /* grid items with margin:auto shrink-to-fit; keep the column full width (max 760px) */
  .activities { position: sticky; top: 76px; align-self: start; flex-direction: column; gap: 6px; overflow: visible;
    margin: 16px 0 0 16px; padding: 14px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
  .act-heading { display: block; margin: 0 4px 6px; font-family: var(--font-head); font-size: 1.05rem; color: var(--muted); }
  .act { border-radius: calc(var(--radius) * .7); background: transparent; border-color: transparent; font-size: .98rem; white-space: normal; }
  .act:hover { background: rgba(127, 127, 127, .12); }
  .act.on { background: var(--accent); color: var(--accent-text); }
  .act .act-icon { width: 1.5em; text-align: center; }
}

/* full-height pages (chat, reels): the page itself doesn't scroll */
body.reels-page { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
body.chat-page .layout, body.reels-page .layout { flex: 1; min-height: 0; display: flex; flex-direction: column; }
@media (min-width: 1100px) {
  body.chat-page .layout, body.reels-page .layout { display: grid; grid-template-rows: minmax(0, 1fr); }
}
@media (max-width: 1099px) {
  body.chat-page .activities, body.reels-page .activities { display: none; }
}
body.reels-page .container { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; margin-top: 12px; padding-bottom: 12px; }

/* ---- Reels ---- */
.reels-wrap { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.reel-feed { flex: 1; min-height: 0; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none;
  border-radius: var(--radius); background: #0b0b0f; outline: none; }
.reel-feed::-webkit-scrollbar { display: none; }
.reel { height: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px; padding: 12px; }
.reel-frame { position: relative; height: calc(100% - 96px); max-height: 760px; aspect-ratio: 9 / 16; max-width: 100%; border-radius: 16px;
  overflow: hidden; background: #000; box-shadow: 0 0 0 3px var(--accent), 0 10px 30px rgba(0,0,0,.5); }
.reel-frame img, .reel-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.reel-info { width: min(100%, 440px); color: #f3f3f3; font-family: var(--font-body); text-shadow: none; }
.reel-caption { margin: 0 0 2px; font-family: var(--font-ui); font-weight: 700; font-size: 1.02rem; color: #fff; }
.reel-title { margin: 0; font-size: .82rem; opacity: .75; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.reel-meta { margin: 2px 0 0; font-size: .78rem; opacity: .75; }
.reel-meta a, .reel-meta .link { color: #fff; }
.reel-status, .reel-gone { color: #f3f3f3; text-align: center; padding: 40vh 20px 0; font-family: var(--font-ui); }
.reel-gone { padding: 40% 16px 0; }
.reel-sound { position: absolute; right: 18px; top: 14px; z-index: 5; box-shadow: 0 4px 14px rgba(0,0,0,.45); }
.reel-off { text-align: center; }

/* ---- Word game ---- */
:root { --w-hit: #3a9d5d; --w-near: #c9a227; --w-miss: #6b6b76; --w-tile-text: #ffffff; --w-empty: transparent; }
.words { max-width: 520px; margin: 0 auto 14px; text-align: center; }
.words h1 { margin-bottom: 2px; }
.words-hint { margin: 0 0 12px; }
.words-grid { display: flex; flex-direction: column; gap: 6px; align-items: center; margin: 0 auto 10px; }
.words-row { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 6px; width: min(100%, calc(var(--cols) * 60px)); }
.tile { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border: 2px solid var(--border);
  border-radius: calc(var(--radius) * .4); background: var(--w-empty); color: var(--text);
  font: 700 clamp(1.1rem, 5.5vw, 1.8rem)/1 var(--font-ui); text-transform: uppercase; user-select: none; }
.tile.typed { border-color: var(--muted); animation: words-pop .1s ease-out; }
.tile.filled { color: var(--w-tile-text); border-color: transparent; }
.tile.hit { background: var(--w-hit); }
.tile.near { background: var(--w-near); }
.tile.miss { background: var(--w-miss); }
.tile.flip { animation: words-flip .36s ease-in-out; }
.words-row.shake { animation: words-shake .4s; }
@keyframes words-flip { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
@keyframes words-shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes words-pop { 50% { transform: scale(1.08); } }
.words-toast { min-height: 1.6em; margin: 4px 0; font-weight: 700; font-family: var(--font-ui); opacity: 0; transition: opacity .2s; }
.words-toast.show { opacity: 1; }
.words-end { margin: 6px 0 12px; }
.words-end-msg { font: 700 1.15rem/1.3 var(--font-head); margin: 0 0 8px; }
.words-end-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.words-end-actions form { margin: 0; }
.words-kb { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; user-select: none; }
.words-kb.done { opacity: .5; }
.kb-row { display: flex; gap: 5px; justify-content: center; }
.kb-key { flex: 1; max-width: 44px; height: 52px; padding: 0; border: 0; border-radius: 6px; background: var(--input-bg);
  color: var(--text); font: 700 1rem/1 var(--font-ui); cursor: pointer; box-shadow: inset 0 -2px 0 rgba(0,0,0,.15); touch-action: manipulation; }
.kb-key.kb-wide { flex: 1.6; max-width: 70px; font-size: .78rem; }
.kb-key.hit { background: var(--w-hit); color: var(--w-tile-text); }
.kb-key.near { background: var(--w-near); color: var(--w-tile-text); }
.kb-key.miss { background: var(--w-miss); color: var(--w-tile-text); opacity: .75; }
@media (prefers-reduced-motion: reduce) { .tile.flip, .words-row.shake, .tile.typed { animation: none; } }
@media (max-width: 560px) {
  .words { padding: 12px 8px; }
  .kb-row { gap: 4px; }
  .kb-key { height: 50px; font-size: .95rem; }
}

/* ---- Profile tabs + stats ---- */
.profile-tabs { display: flex; gap: 6px; margin-top: 14px; border-bottom: 2px solid var(--border); font-family: var(--font-ui); }
.profile-tab { padding: 6px 14px; margin-bottom: -2px; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 700; text-decoration: none !important; }
.profile-tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.stats-card h2 { margin: 0 0 10px; font-size: 1.2rem; }
.stat-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.stat-tiles li { display: flex; flex-direction: column; align-items: center; padding: 10px 6px; border: 1px solid var(--border);
  border-radius: calc(var(--radius) * .7); background: var(--input-bg); text-align: center; }
.stat-tiles strong { font: 700 1.6rem/1.1 var(--font-head); color: var(--accent); }
.stat-tiles span { font-size: .8rem; color: var(--muted); font-family: var(--font-ui); }
.dist-heading { font-size: .95rem; margin: 16px 0 6px; font-family: var(--font-ui); }
.dist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.dist li { display: flex; align-items: center; gap: 8px; }
.dist-n { width: 1em; font-weight: 700; font-family: var(--font-ui); }
.dist-bar { display: inline-block; min-width: 2.2em; padding: 2px 8px; text-align: right; border-radius: 4px;
  background: var(--w-hit); color: var(--w-tile-text); font: 700 .85rem/1.4 var(--font-ui); box-sizing: border-box; }
.dist-bar.zero { background: var(--w-miss); }
.words-streak { margin: 0 0 8px; font-weight: 700; font-family: var(--font-ui); }

/* ---- $LARPIV coins ---- */
.coin-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25); font: 700 .9rem/1.2 var(--font-ui);
  color: var(--topbar-link, var(--accent)); text-decoration: none !important; white-space: nowrap; }
.words-coins { margin: 0 0 8px; font: 700 1.05rem/1.3 var(--font-ui); color: var(--accent); }
.coin-ticker { margin: 6px 0 0; letter-spacing: 2px; font-size: .75rem; }
.wallet-line code { font-size: .85rem; }
.bridge-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; }
.bridge-ok { color: var(--up); font-weight: 700; }
.tx-list { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.tx-list li { display: flex; align-items: baseline; gap: 10px; padding: 4px 0; border-top: 1px solid var(--border); }
.tx-list li:first-child { border-top: 0; }
.tx-amt { min-width: 3.2em; font-weight: 800; font-family: var(--font-ui); }
.tx-amt.pos { color: var(--up); } .tx-amt.neg { color: var(--down); }
.tx-list time { margin-left: auto; white-space: nowrap; }
@media (max-width: 560px) { .coin-chip { padding: 2px 8px; font-size: .82rem; } }

/* ---- Friends (right panel on desktop; /friends page + chip on smaller screens) ---- */
.friends-panel { display: none; }
@media (min-width: 1100px) {
  .friends-panel { display: block; position: sticky; top: 76px; align-self: start; margin: 16px 16px 0 0; padding: 14px;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); max-height: calc(100vh - 100px); overflow-y: auto; }
  .friends-panel.is-empty { visibility: hidden; }  /* logged out: keep the column (balance) but show nothing */
  .activities .act-friends { display: none; }   /* the right panel replaces it */
  body.chat-page .friends-panel, body.reels-page .friends-panel { display: none; }  /* full-height pages keep the column empty (still centred) */
}
.fp-section + .fp-section { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.fp-heading { margin: 0 0 8px; font: 700 1rem/1.2 var(--font-ui); display: flex; align-items: center; gap: 6px; }
.fp-count { font-size: .8rem; color: var(--muted); font-weight: 600; }
.fp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fp-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.fp-actions { display: flex; gap: 6px; margin-left: auto; }
.fp-why { width: 100%; padding-left: 38px; font-size: .72rem; color: var(--muted); font-family: var(--font-ui); }
.fp-dm { margin-left: auto; text-decoration: none !important; font-size: 1.05rem; }
.fp-empty { margin: 0; font-size: .85rem; color: var(--muted); }
.friend-chip { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: var(--text); text-decoration: none !important; }
.friend-avatar { flex: none; width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-text); font: 700 .9rem/1 var(--font-ui); }
.friend-name { font-weight: 700; font-family: var(--font-ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 9em; }
.friend-world { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.friend-chip:hover .friend-name { text-decoration: underline; }
.btn-sm { padding: 3px 10px; font-size: .8rem; }
.btn-ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-danger { background: #c62828; color: #fff; }
.friends-tag { font: 700 .85rem/1 var(--font-ui); color: var(--up); }
.profile-friend-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.profile .profile-friend-actions { justify-content: inherit; }
.profile-friends h2 { margin: 0 0 10px; font-size: 1.15rem; }
.friend-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.friends-page h1 { margin-bottom: 12px; }
.confirm-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.confirm .confirm-actions .btn { padding: 8px 18px; }

/* ---- Comment sort (Top / New) ---- */
.comment-sort { display: flex; align-items: center; gap: 12px; margin: 14px 0 0; font-family: var(--font-ui); font-size: .9rem; }
.comment-sort a { color: var(--muted); font-weight: 700; }
.comment-sort a.active { color: var(--accent); border-bottom: 2px solid var(--accent); }

/* ---- Themed UI words: English on hover (desktop) / long-press (touch, see app.js) ---- */
.ui { position: relative; -webkit-touch-callout: none; }
@media (hover: hover) {
  .ui[data-en]:hover::after {
    content: attr(data-en);
    position: absolute; left: 50%; top: calc(100% + 6px); transform: translateX(-50%);
    background: var(--tip-bg); color: var(--tip-text);
    font: 500 .78rem/1.3 system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: 0; text-transform: none;
    text-shadow: none; white-space: nowrap; padding: 4px 8px; border-radius: 6px; z-index: 50; pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
  }
}
.ui-tip { position: fixed; z-index: 100; background: var(--tip-bg); color: var(--tip-text);
  font: 500 .85rem/1.3 system-ui, -apple-system, "Segoe UI", sans-serif; padding: 6px 10px; border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,.35); pointer-events: none; max-width: 80vw; }
.ui-pressing { -webkit-user-select: none; user-select: none; }

.nw { white-space: nowrap; }
.mobile-only { display: none; }

/* ---- Mobile menu (☰) ---- */
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; font-size: 1.5rem; line-height: 1; padding: 4px 8px; color: var(--topbar-link, var(--accent)); font-family: system-ui, sans-serif; }
.menu summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 190px; display: flex; flex-direction: column; gap: 12px;
  padding: 14px 16px; background: var(--topbar-bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.menu-panel a, .menu-panel button.link { font-size: 1.05rem; text-align: left; }
.menu-user { opacity: .7; font-size: .85em; }

/* ---- Phones ---- */
@media (max-width: 560px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: block; }
  .topbar { position: static; padding: 8px 12px; row-gap: 6px; }
  .brand { font-size: 1.15rem; }
  .badge-name { display: none; }
  nav { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; gap: 6px 8px; }  /* wraps rather than overflowing (e.g. sci-fi's long button + coin chip) */
  nav .btn { font-size: .95rem; padding: 6px 12px; white-space: nowrap; }
  .container { padding: 0 10px 40px; margin-top: 10px; }
  .card { padding: 12px; }
  .card h1 { font-size: 1.35rem; }
  .post-row, .comment-row { gap: 6px; }
  .post-title { font-size: 1.05rem; }
  /* Hot / New / Top as three equal tabs instead of wrapping */
  .sortbar { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; gap: 4px; padding: 6px; text-align: center; align-items: center; }
  .sortbar a { padding: 4px 2px; line-height: 1.15; }
  /* bigger tap targets for votes */
  .votebox { min-width: 30px; }
  .vote { padding: 6px 8px; font-size: 1.05rem; }
  /* one world per row in the picker */
  .theme-picker { grid-template-columns: 1fr; }
  .comments { padding-left: 10px; }
  .stack .btn { align-self: stretch; text-align: center; padding: 10px 14px; }
  .banner { font-size: .85rem; }
  .card h1.profile-name { font-size: 1.6rem; }
  .profile-stats { gap: 6px 16px; }
  .bio-meta { flex-direction: column; gap: 2px; }
  .inbox-link { font-size: 1.25rem; }
  body.chat-page .container, body.reels-page .container { padding: 0; margin-top: 0; padding-bottom: 0; }
  .reel-feed { border-radius: 0; }
  .reel { padding: 8px 8px 12px; }
  .reel-frame { height: calc(100% - 92px); }
  .reel-sound { right: 10px; top: 10px; font-size: .85rem; padding: 4px 10px; }
  body.chat-page .topbar { padding: 6px 12px; }
  .chat { border-radius: 0 !important; border-left: 0; border-right: 0; }
  .bubble { max-width: 85%; }
  .composer .send-btn { padding: 0 14px; white-space: nowrap; max-width: 40%; }
  .composer textarea { min-width: 0; }
  .composer textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* ---------------------------------------------------------------- -illion rarity game */
.illion { max-width: 640px; margin: 0 auto 14px; }
.illion h1 { margin-bottom: 2px; text-align: center; }
.illion-hint { text-align: center; margin: 0 0 12px; }
.ill-stage { display: flex; gap: 14px; align-items: flex-start; }
.ill-main { flex: 1; min-width: 0; }
.ill-track { --p: 0; position: relative; flex: 0 0 64px; height: 340px; border-radius: var(--radius, 10px);
  border: 1px solid var(--border, #ccc); overflow: hidden;
  background: linear-gradient(to bottom, var(--track-a, #bfe3ff), var(--track-b, #12315c)); }
.ill-track[data-dir="up"] { background: linear-gradient(to top, var(--track-a, #bfe3ff), var(--track-b, #12315c)); }
.ill-track[data-dir="right"] { background: linear-gradient(to right, var(--track-a, #bfe3ff), var(--track-b, #12315c)); }
.ill-mascot { position: absolute; left: 50%; font-size: 2rem; line-height: 1; translate: -50% 0;
  transition: top 1.2s cubic-bezier(.3,1.4,.5,1), bottom 1.2s cubic-bezier(.3,1.4,.5,1), left 1.2s cubic-bezier(.3,1.4,.5,1);
  animation: ill-bob 2.4s ease-in-out infinite; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.ill-track[data-dir="down"] .ill-mascot { top: calc(4px + var(--p) * (100% - 42px)); }
.ill-track[data-dir="up"] .ill-mascot { bottom: calc(4px + var(--p) * (100% - 42px)); }
.ill-mark { position: absolute; left: 0; right: 0; font: 700 .62rem/1 var(--font-ui, sans-serif); color: rgba(255,255,255,.8);
  border-top: 1px dashed rgba(255,255,255,.45); padding: 2px 3px; text-shadow: 0 1px 2px #000; }
.ill-track[data-dir="down"] .ill-mark { top: calc(var(--m) * (100% - 14px)); }
.ill-track[data-dir="up"] .ill-mark { bottom: calc(var(--m) * (100% - 14px)); border-top: 0; border-bottom: 1px dashed rgba(255,255,255,.45); }
/* horizontal (the dragon flies across): track goes above the card */
.ill-stage:has(.ill-track[data-dir="right"]) { flex-direction: column; }
.ill-track[data-dir="right"] { flex: 0 0 78px; height: 78px; width: 100%; }
.ill-track[data-dir="right"] .ill-mascot { top: 50%; translate: 0 -50%; left: calc(4px + var(--p) * (100% - 48px)); }
.ill-track[data-dir="right"] .ill-mark { top: 0; bottom: 0; right: auto; left: calc(var(--m) * (100% - 24px));
  border-top: 0; border-left: 1px dashed rgba(255,255,255,.45); padding-top: 4px; }
@keyframes ill-bob { 50% { transform: translateY(-5px) rotate(-4deg); } }
.ill-track[data-dir="right"] .ill-mascot { animation-name: ill-bob-x; }
@keyframes ill-bob-x { 50% { transform: translateY(-6px) scaleX(1.06); } }
@media (prefers-reduced-motion: reduce) { .ill-mascot { animation: none; transition: none; } }

.ill-score { text-align: right; margin: 0 0 6px; font-family: var(--font-ui); }
.ill-score strong { font: 700 1.6rem/1 var(--font-head); }
.ill-step { margin: 0; }
.ill-prompt { font-size: 1.3rem; margin: 4px 0 10px; overflow-wrap: anywhere; }
.ill-timer { height: 8px; border-radius: 4px; background: rgba(127,127,127,.25); overflow: hidden; margin-bottom: 12px; }
.ill-timer span { display: block; height: 100%; width: 100%; background: var(--accent, #2a7); transition: width .1s linear; }
.ill-timer span.low { background: #d33; }
.ill-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ill-form input { flex: 1 1 180px; min-width: 0; font-size: 1.05rem; padding: 10px; }
.ill-skip { margin-left: auto; }
.ill-verdict { font: 700 1.2rem/1.3 var(--font-head); margin: 4px 0 10px; padding: 10px 12px; border-radius: 8px;
  background: rgba(127,127,127,.15); overflow-wrap: anywhere; }
.ill-verdict.tier-o { background: linear-gradient(90deg, #ffe27a, #ffb3e6, #9fd8ff); color: #222; animation: ill-pop .6s; }
.ill-verdict.tier-d { background: rgba(140, 80, 220, .25); }
.ill-verdict.tier-r { background: rgba(40, 110, 230, .22); }
.ill-verdict.tier-u { background: rgba(40, 170, 90, .22); }
.ill-verdict.tier-x { background: rgba(220, 50, 50, .18); }
@keyframes ill-pop { 0% { transform: scale(.8); } 60% { transform: scale(1.06); } }
.ill-others-h { margin: 0 0 4px; }
.ill-others { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.ill-others li { padding: 3px 9px; border-radius: 999px; background: rgba(127,127,127,.15); font-size: .9rem; }
.ill-end-msg { font: 700 1.2rem/1.3 var(--font-head); margin: 0 0 8px; }
.ill-history { padding-left: 1.4em; margin: 0 0 10px; }
.ill-history li { margin: 0 0 6px; }
.ill-history li span, .ill-history li strong { display: block; overflow-wrap: anywhere; }
.ill-history li.tier-x strong { opacity: .6; }
@media (max-width: 560px) {
  .ill-stage { gap: 8px; }
  .ill-track { flex-basis: 46px; height: 300px; }
  .ill-mascot { font-size: 1.6rem; }
  .ill-prompt { font-size: 1.12rem; }
}

.ill-form.shake { animation: ill-shake .4s; }
@keyframes ill-shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.ill-no-echo { min-height: 1.4em; margin: 6px 0 0; color: #d22; font-weight: 700; font-family: var(--font-ui); opacity: 0; }
.ill-no-echo.show { animation: ill-echo 1.8s forwards; }
@keyframes ill-echo { 0% { opacity: 0; transform: translateY(4px); } 12%, 70% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ill-form.shake { animation: none; } .ill-no-echo.show { animation: none; opacity: 1; } }

.bridge-amount { display: inline-flex; align-items: center; gap: 6px; }
.bridge-amount input { width: 6.5em; padding: 8px; font-size: 1rem; }

/* ---------------------------------------------------------------- shop + badges */
.medal { --m-a: #ffe08a; --m-b: #b8860b; --m-ring: #7a5a10; --m-ink: #3a2a05;
  display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 30%, var(--m-a), var(--m-b)); border: 3px solid var(--m-ring);
  box-shadow: 0 2px 6px rgba(0,0,0,.35), inset 0 -3px 6px rgba(0,0,0,.25); }
.medal.big { width: 96px; height: 96px; border-width: 4px; }
.medal-icon { width: 64%; height: 64%; background: var(--m-ink);
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.medal-pirate    { --m-a: #ffe9a6; --m-b: #c8961e; --m-ring: #6b4a12; --m-ink: #3b2106; }
.medal-scifi     { --m-a: #1f3a2a; --m-b: #03110a; --m-ring: #39ff88; --m-ink: #39ff88; }
.medal-victorian { --m-a: #f3e6cf; --m-b: #a88a5c; --m-ring: #5b4026; --m-ink: #3a2717; }
.medal-fantasy   { --m-a: #d8c9ff; --m-b: #5a3fa0; --m-ring: #d4af37; --m-ink: #fff6d5; }
.medal-caveman   { --m-a: #cbb89a; --m-b: #7d6a52; --m-ring: #3f3224; --m-ink: #2a1d12; }
.medal-romcom    { --m-a: #ffd1e1; --m-b: #e0245e; --m-ring: #fff; --m-ink: #fff; }
.shop h1 { margin-bottom: 2px; }
.shop-balance { font: 700 1.1rem/1.3 var(--font-ui); margin: 6px 0 12px; }
.shop-grid { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.shop-item { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
  padding: 16px 12px; border-radius: var(--radius, 10px); border: 1px solid var(--border, rgba(127,127,127,.35));
  background: rgba(127,127,127,.08); }
.shop-item h2 { font-size: 1.1rem; margin: 8px 0 0; }
.shop-item .meta { margin: 0; min-height: 2.6em; }
.shop-price { font-weight: 700; margin: 6px 0; }
.shop-owned { font-weight: 700; margin: 6px 0; color: #2a9d5c; }
.shop-item.is-owned .medal { box-shadow: 0 0 0 4px rgba(42,157,92,.45), 0 2px 6px rgba(0,0,0,.35); }
.shop-item button[disabled] { opacity: .5; cursor: not-allowed; }
.badge-grid { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 14px; }
.badge-grid li { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 76px; text-align: center; }
.medal-name { font-size: .78rem; line-height: 1.15; overflow-wrap: anywhere; }
.coin-toast { margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; font-weight: 700; font-family: var(--font-ui);
  background: linear-gradient(90deg, #ffe27a, #ffc94d); color: #3a2a05; box-shadow: 0 2px 6px rgba(0,0,0,.25);
  animation: coin-toast-in .5s ease-out; }
@keyframes coin-toast-in { from { opacity: 0; transform: translateY(-8px); } }
@media (max-width: 560px) { .shop-grid { grid-template-columns: 1fr 1fr; gap: 10px; } .medal.big { width: 76px; height: 76px; } }
@media (prefers-reduced-motion: reduce) { .coin-toast { animation: none; } }

.shop-unique { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--accent, #c80); background: rgba(127,127,127,.1); border-radius: 6px; }
.shop-progress { margin: 4px 0 10px; font-family: var(--font-ui); }
.shop-others-h { margin: 26px 0 2px; font-size: 1.15rem; }
.shop-other { margin: 12px 0; }
.shop-other-name { font-weight: 700; margin: 0 0 4px; }
.badge-grid li.not-owned .medal { filter: grayscale(.85); opacity: .55; }
.badge-world { font-size: .8rem; line-height: 1; }
.medal.ui[data-en]:hover::after { top: auto; bottom: calc(100% + 6px); }

/* ---------------------------------------------------------------- edit/delete, notifications, search */
.owner-actions { margin: 4px 0 0; font-size: .85rem; }
.owner-actions a { color: var(--muted); }
.edited { font-style: italic; }
.deleted-text { color: var(--muted); font-style: italic; }
.notif-list { list-style: none; padding: 0; margin: 0; }
.notif a { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 8px; color: inherit; text-decoration: none; }
.notif a:hover { background: rgba(127,127,127,.12); }
.notif.unread a { background: rgba(255, 200, 60, .16); box-shadow: inset 3px 0 0 var(--accent, #c80); }
.notif-head, .notif-snippet { overflow-wrap: anywhere; }
.notif-snippet { opacity: .85; font-size: .92rem; }
.search-box { flex: 0 1 260px; margin: 0 8px; min-width: 0; }
.search-box input { width: 100%; padding: 6px 10px; border-radius: 999px; font-size: .9rem; }
.search-page-form { display: flex; gap: 8px; margin-bottom: 14px; }
.search-page-form input { flex: 1; min-width: 0; padding: 10px; font-size: 1rem; }

/* Desktop (>=1000px) top bar stays on ONE row: the search box shrinks first, then the username truncates. Narrower screens wrap. */
@media (min-width: 1000px) {
  .topbar { flex-wrap: nowrap; }
  .brand { flex: none; white-space: nowrap; }
  .topbar nav { flex: none; flex-wrap: nowrap; white-space: nowrap; }
  .nav-user { display: inline-block; vertical-align: middle; max-width: 12em; overflow: hidden; text-overflow: ellipsis; }
}

.fp-search input[type=search] { width: 100%; padding: 7px 10px; border-radius: 999px; font-size: .9rem; box-sizing: border-box; }
.fp-results:not(:empty) { margin-top: 10px; }

.stats-scope { font: 600 .72rem/1 var(--font-ui); vertical-align: middle; margin-left: 6px; padding: 3px 8px; border-radius: 999px;
  background: rgba(127,127,127,.15); color: var(--muted); letter-spacing: 0; text-transform: none; white-space: nowrap; }

/* Stats: All worlds / per-world filter for the game cards */
.world-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; scroll-margin-top: 80px; }
.layout nav.world-filter { margin-left: 0; justify-content: flex-start; }  /* the phone rule for the topbar `nav` must not apply here */
.wf-chip { display: inline-flex; align-items: center; padding: 5px 11px; border-radius: 999px; font: 600 .85rem/1.2 var(--font-ui);
  background: var(--card); border: 1px solid var(--border); color: var(--text); text-decoration: none !important; white-space: nowrap; }
.wf-chip:hover { background: rgba(127,127,127,.15); }
.wf-chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
@media (max-width: 560px) { .wf-name { display: none; } .wf-chip { padding: 6px 10px; font-size: .95rem; } }

/* ---------------------------------------------------------------- profile photos (world-restyled) */
.avatar { border-radius: 50%; object-fit: cover; flex: none; background: var(--card); }
img.friend-avatar { padding: 0; }
.avatar-xs { width: 20px; height: 20px; vertical-align: -5px; margin-right: 5px; border: 1px solid var(--border); }
.avatar-lg { width: 96px; height: 96px; border: 3px solid var(--accent); }
.avatar-xl { width: 160px; height: 160px; border: 4px solid var(--accent); box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.avatar-letter { display: inline-flex; align-items: center; justify-content: center; font: 700 2.4rem/1 var(--font-head);
  background: var(--accent); color: var(--accent-text); }
.profile-avatar { display: block; margin: 4px auto 10px; }
.avatar-pending { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 2.4rem;
  background: rgba(127,127,127,.15); text-align: center; }
.avatar-pending span { font: 600 .72rem/1.2 var(--font-ui); max-width: 120px; color: var(--muted); }
.photo-row { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.photo-copy p { margin: 0 0 6px; }
@media (max-width: 560px) { .avatar-xl { width: 128px; height: 128px; } .photo-row { align-items: flex-start; } }

/* ---------------------------------------------------------------- post images (repainted per world) */
.post-image { margin: 10px 0 6px; }
.post-image img { display: block; max-width: 100%; height: auto; border-radius: calc(var(--radius, 10px) * .8);
  border: 1px solid var(--border); box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.img-pending { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; max-width: 512px;
  width: 100%; font-size: 2.2rem; border-radius: 10px; background: rgba(127,127,127,.15); border: 1px dashed var(--border); }
.img-pending span { font: 600 .85rem/1.2 var(--font-ui); color: var(--muted); }
.img-actions { margin: 0 0 8px; font-size: .82rem; }
.img-actions a, .img-actions .link { color: var(--muted); }
.img-hidden { font-style: italic; }
.post-row:has(.post-thumb) .post-main { min-width: 0; flex: 1; }
.post-thumb { flex: none; align-self: center; margin-left: 10px; }
.post-thumb img { display: block; width: 88px; height: 66px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
@media (max-width: 560px) { .post-thumb img { width: 64px; height: 48px; } }

/* ---------------------------------------------------------------- pokes */
.poke-h { font-size: 1.05rem; margin: 18px 0 8px; }
.poke-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.poke-item { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.poke-item .friend-chip { flex: 1 1 180px; min-width: 0; }
.poke-count { font: 700 .9rem/1 var(--font-ui); color: var(--muted); white-space: nowrap; }
.poke-wait { font: 600 .85rem/1 var(--font-ui); color: var(--muted); font-style: italic; white-space: nowrap; }

/* ---------------------------------------------------------------- verified (shop-bought blue tick) */
.verified-tick { display: inline-flex; vertical-align: -0.12em; margin-left: .22em; line-height: 1; }
.verified-tick svg { display: block; filter: drop-shadow(0 0 1px rgba(255,255,255,.6)); }
.profile-name .verified-tick { font-size: .7em; vertical-align: .05em; }
.shop-verified { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 12px 0 6px; padding: 14px;
  border-radius: var(--radius, 10px); border: 2px solid #1d9bf0; background: rgba(29,155,240,.1); }
.shop-verified.is-owned { border-style: dashed; }
.shop-verified-copy { flex: 1 1 220px; min-width: 0; }
.shop-verified-copy h2 { margin: 0 0 4px; font-size: 1.15rem; }
.shop-verified-copy .meta { margin: 0; }
.shop-verified .shop-price { margin: 6px 0 0; }
.verified-big { flex: none; display: inline-flex; }

/* Friend rows never spill onto a second line: a long name shortens with "…" (full name on hover)
   instead of pushing the ✉ / world label down. Rows with action buttons (requests, suggestions) may still wrap. */
.fp-list li:has(> .fp-dm) { flex-wrap: nowrap; }
.fp-list li:has(> .fp-dm) .friend-chip, .friend-grid .friend-chip { flex: 1 1 auto; min-width: 0; max-width: 100%; }
.friend-chip .friend-name { flex: 0 1 auto; min-width: 0; max-width: none; }
.friend-chip .friend-world, .friend-chip .friend-avatar { flex: none; }
.fp-dm { flex: none; }
.friend-grid li { min-width: 0; display: flex; }
