/* Change these to re-color the whole site. */
:root {
  --bg: #0a0b0e;
  --card: #13151a;
  --card-top: #181b21;
  --raised: #22252c;
  --raised-hover: #2e323b;
  --text: #eceef2;
  --muted: #a4a9b3;
  --line: rgba(255, 255, 255, .1);
  /* The highlight color. People choose their own, which arrives from /accent/<color>.css. */
  --accent: #4d84ff;
  --accent-text: rgb(77, 132, 255);
  --on-accent: #0a0b0e;
  --accent-soft: rgba(77, 132, 255, .16);
  --accent-line: rgba(77, 132, 255, .55);
  --accent-glow: rgba(77, 132, 255, .4);
  --love: #f3425f;
  --online: #3ad35f;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: calc(15px * var(--ts, 1))/1.4 "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
img, video { max-width: 100%; }
.hidden { display: none !important; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.muted { color: var(--muted); font-size: calc(13px * var(--ts, 1)); }
.muted-strong { color: var(--muted); font-weight: 600; }
.online { color: var(--online); }
.icon { flex: none; width: 1.3em; height: 1.3em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon .node { fill: var(--card); }

/* Top bar and navigation */
.topbar { position: sticky; top: 0; z-index: 10; background: #0d0e12; border-bottom: 1px solid var(--line); }
/* The bar that runs under the logo while something is being sent. */
.send-bar { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; overflow: hidden; background: rgba(255, 255, 255, .08); }
.send-bar[hidden] { display: none; }
.send-bar::before { position: absolute; top: 0; bottom: 0; left: 0; width: 40%; border-radius: 3px; background: linear-gradient(90deg, #e0102a, #f2500f, #ffb81c); animation: send-bar 1.1s ease-in-out infinite; content: ''; }
@keyframes send-bar { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { .send-bar::before { width: 100%; animation: none; opacity: .8; } }
.topbar-inner { display: flex; align-items: center; gap: 12px; max-width: 1000px; height: 54px; margin: 0 auto; padding: 0 16px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-family: "Arial Black", "Segoe UI Black", "Roboto Black", Roboto, system-ui, sans-serif; font-size: calc(38px * var(--ts, 1)); font-weight: 900; letter-spacing: .12em; white-space: nowrap; }
.logo-mark { width: auto; height: 30px; flex: none; }
.top-actions { display: flex; gap: 4px; margin-left: auto; }
.top-action { display: flex; padding: 7px; border-radius: 50%; color: var(--text); font-size: calc(18px * var(--ts, 1)); }
.top-action:hover { background: var(--raised); }
.nav a.nav-plus, .nav a.nav-plus:hover { background: none; }
.plus-ring { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 2px solid var(--accent); border-radius: 50%; color: var(--accent-text); box-shadow: 0 0 12px var(--accent-glow); }
.nav a.nav-plus:hover .plus-ring { background: var(--accent-soft); }
.nav .plus-ring .icon { width: 26px; height: 26px; stroke-width: 2.2; }
.create-sheet { width: min(480px, 100vw); max-width: none; margin: auto auto 0; padding: 0; border: 1px solid var(--line); border-radius: 18px 18px 0 0; background: var(--card-top); color: var(--text); }
.create-sheet::backdrop { background: rgba(0, 0, 0, .65); }
.create-inner { display: flex; flex-direction: column; gap: 8px; padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); }
.create-option { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 12px; color: var(--text); }
.create-option:hover { background: var(--raised); text-decoration: none; }
.create-option .icon { width: 28px; height: 28px; color: var(--accent-text); }
.create-option b, .create-option small { display: block; }
.create-option b { font-size: calc(16px * var(--ts, 1)); }
.create-option small { color: var(--muted); font-size: calc(13px * var(--ts, 1)); }
.page-title { font-size: calc(20px * var(--ts, 1)); font-weight: 700; }
.logo:hover { text-decoration: none; }
.nav { display: flex; flex: 1; justify-content: center; gap: 4px; }
.nav a { position: relative; display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: calc(14px * var(--ts, 1)); }
.nav a:hover { background: var(--raised); color: var(--text); text-decoration: none; }
.nav a.active { color: var(--accent-text); }
.nav .icon { width: 24px; height: 24px; }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--love); color: #fff; font-size: calc(11px * var(--ts, 1)); font-weight: 700; line-height: 18px; text-align: center; }
.linkbutton { padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: calc(13px * var(--ts, 1)); cursor: pointer; }
.linkbutton:hover { color: var(--text); text-decoration: underline; }

/* Page */
.page { width: 100%; max-width: 680px; margin: 0 auto; padding: 16px; }
.footer { padding: 16px; color: var(--muted); font-size: calc(12px * var(--ts, 1)); text-align: center; }
.page > * + * { margin-top: 14px; }
.card, .box { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, var(--card-top), var(--card)); }
.section { padding: 14px 16px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.section-head h2, .posts-title { font-size: calc(19px * var(--ts, 1)); font-weight: 700; }
.section-head h2 { display: inline-flex; align-items: center; gap: 10px; }
.section-head h2 .icon { color: var(--accent-text); }
.empty { padding: 28px 16px; color: var(--muted); text-align: center; }
.box > h2 { padding: 14px 16px 0; font-size: calc(19px * var(--ts, 1)); font-weight: 700; }
.box > .body { padding: 8px 16px 16px; }
.form-section { margin-top: 20px; font-size: calc(16px * var(--ts, 1)); scroll-margin-top: 64px; }
.notice, .error { padding: 10px 14px; border-radius: var(--radius); }
.notice { background: #173a22; color: #bfeccb; }
.error { background: #4a1c20; color: #ffc9ce; }

/* Buttons and forms */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--raised); color: var(--text);
  font-family: inherit; font-size: calc(14px * var(--ts, 1)); font-weight: 600; line-height: 1.4; text-align: center; cursor: pointer;
}
.button:hover { background: var(--raised-hover); text-decoration: none; }
.button.primary { border-color: transparent; background: linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(0, 0, 0, .1)), var(--accent); color: var(--on-accent); }
.button.primary:hover { background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(0, 0, 0, .04)), var(--accent); }
.button:disabled { opacity: .55; cursor: default; }
.button.wide { display: flex; }
.box form .button, form.box .button { margin-top: 14px; }

label { display: block; margin-top: 12px; font-weight: 600; font-size: calc(14px * var(--ts, 1)); }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.hint { display: block; color: var(--muted); font-weight: 400; font-size: calc(12px * var(--ts, 1)); }
input[type=text], input[type=search], input[type=email], input[type=password], input[type=date], textarea, select {
  width: 100%; margin-top: 4px; padding: 9px 12px; border: 1px solid transparent; border-radius: 8px;
  background: var(--raised); color: var(--text); font: inherit; font-size: calc(16px * var(--ts, 1));
}
@media (min-width: 701px) {
  input[type=text], input[type=email], input[type=password], input[type=date], textarea, select { font-size: calc(15px * var(--ts, 1)); }
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); outline: none; }
textarea { resize: vertical; }
input[type=file] { display: block; width: 100%; margin-top: 4px; color: var(--muted); font: inherit; font-size: calc(14px * var(--ts, 1)); }
::placeholder { color: var(--muted); }
.picks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.inline { display: inline; margin: 0; }
.gate { max-width: 420px; margin: 24px auto 0; }

/* Lit and Profile tabs */
.page-tabs { display: flex; margin: -16px -16px 0; background: var(--card); border-bottom: 1px solid var(--line); }
.page-tabs > a, .page-tabs > form { flex: 1; min-width: 0; }
.page-tabs > a, .tab-button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 6px 8px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--text); font: inherit; font-size: calc(13px * var(--ts, 1)); font-weight: 600; cursor: pointer; }
.tab-button { width: 100%; }
.page-tabs .icon { width: 24px; height: 24px; }
.page-tabs > a:hover, .tab-button:hover { background: var(--raised); text-decoration: none; }
.page-tabs > a.active { border-bottom-color: var(--accent); color: var(--accent-text); }
.confirm-box { width: min(340px, calc(100vw - 32px)); padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card-top); color: var(--text); text-align: center; }
.confirm-box::backdrop { background: rgba(0, 0, 0, .65); }
.confirm-box p { font-size: calc(17px * var(--ts, 1)); font-weight: 600; }
.confirm-buttons { display: flex; gap: 8px; margin-top: 16px; }
.confirm-buttons .button { flex: 1; }
.back-link { display: inline-block; font-weight: 600; }
.page > * + .profile-card { margin-top: 14px; }
.page > .page-tabs + .profile-card { margin-top: 0; }

/* Profile */
.profile-card { margin: -16px -16px 0; padding-bottom: 0; border-bottom: 1px solid var(--line); background: var(--card); }
.cover { position: relative; height: 210px; overflow: hidden; background: linear-gradient(135deg, #1c2029, #0f1115); }
.cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.profile-intro { display: flex; align-items: flex-end; gap: 14px; margin-top: -56px; padding: 0 16px; }
.profile-picture { position: relative; flex: none; }
.picture-frame { display: block; width: 132px; height: 132px; padding: 0; border-radius: 50%; background: none; }
.picture-frame.has-story { padding: 3px; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 0 18px var(--accent-glow); }
button.picture-frame { border: 0; cursor: zoom-in; }
.profile-name a.story-link { color: var(--accent-text); }
.photo-viewer { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; overflow: hidden; border: 0; background: #000; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.photo-viewer[open] { display: flex; align-items: center; justify-content: center; }
.photo-viewer img { display: block; max-width: 100%; max-height: 100%; transform-origin: 0 0; cursor: zoom-in; }
.photo-viewer img.settling { transition: transform .18s ease-out; }
.photo-viewer-close { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 12px; z-index: 1; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(60, 60, 60, .8); color: #fff; font-size: calc(28px * var(--ts, 1)); line-height: 1; cursor: pointer; }
.picture-frame img { display: block; width: 100%; height: 100%; border: 0; border-radius: 50%; object-fit: cover; }
.vibe {
  position: absolute; bottom: 100%; left: 50%; z-index: 1; width: max-content; max-width: 170px; margin-bottom: 2px; padding: 5px 12px;
  border-radius: 16px; background: rgba(19, 21, 26, .94); color: var(--text); font-size: calc(13px * var(--ts, 1)); overflow-wrap: anywhere;
}
.profile-name { flex: 1; align-self: stretch; display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; padding: 62px 0 12px; overflow-wrap: anywhere; }
.profile-name h1 { font-size: calc(26px * var(--ts, 1)); font-weight: 700; line-height: 1.2; }
.profile-name a { color: var(--muted); }
.description { padding: 10px 16px 0; }
.profile-buttons { display: flex; gap: 8px; padding: 14px 16px 0; }
.profile-buttons > * { flex: 1; }
.profile-buttons form .button { width: 100%; }
/* On someone else's page: the Friends button (or the three dots) opens Unfriend, Report and Block. */
.profile-buttons .friend-actions { flex-wrap: nowrap; }
.profile-buttons .friend-actions form { flex: 1; }
.profile-menu { margin-left: 0; }
.profile-menu.small { flex: none; }
.profile-menu .menu-btn { width: 100%; margin-top: 0; }
.profile-menu.small .menu-btn { width: auto; }
.profile-menu .post-menu-list { right: 0; }
.profile-menu .post-menu-list form { margin: 0; }
.menu-caret { display: inline-flex; margin-left: 2px; transform: rotate(90deg); opacity: .7; }
.menu-caret .icon { width: 1em; height: 1em; }
.menu-btn[aria-expanded="true"] { background: var(--raised-hover); }
.tabs { display: flex; gap: 2px; margin-top: 14px; padding: 0 12px 12px; overflow-x: auto; }
.tabs { scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: inline-flex; flex: none; align-items: center; gap: 6px; padding: 7px 11px; border: 1px solid transparent; border-radius: 20px; color: var(--muted); font-size: calc(14px * var(--ts, 1)); font-weight: 600; }
.tabs a:hover { background: var(--raised); text-decoration: none; }
.tabs a.active { border-color: var(--accent-line); background: var(--accent-soft); color: var(--text); }
.tabs a.active .icon { color: var(--accent-text); }

.details { margin: 0; }
.details > div { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.details > div:last-child { padding-bottom: 2px; border-bottom: 0; }
.details dt { display: inline-flex; flex: 0 0 138px; align-items: center; gap: 10px; color: var(--muted); }
.details dt .icon { color: var(--text); }
.details-card { overflow: hidden; }
.details-head { position: relative; min-height: 66px; margin: -14px -16px 2px; padding: 14px 16px; border-bottom: 1px solid var(--line); overflow: hidden; }
.details-head > :not(.details-art) { position: relative; z-index: 1; }
.details-art { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; opacity: .6; -webkit-mask-image: linear-gradient(90deg, transparent 12%, #000 72%); mask-image: linear-gradient(90deg, transparent 12%, #000 72%); }
.details-preview { position: relative; display: flex; align-items: center; min-height: 66px; margin-top: 8px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; font-weight: 700; overflow: hidden; }
.details-preview span { position: relative; z-index: 1; }
input[type=range] { display: block; width: 100%; margin-top: 8px; accent-color: var(--accent); }

/* Choosing a color */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 10px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 5px; margin: 0; padding: 8px 4px; border-radius: 10px; font-size: calc(13px * var(--ts, 1)); font-weight: 400; cursor: pointer; }
.swatch:hover { background: var(--raised); }
.swatch > input[type=radio] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.swatch-dot { display: block; width: 34px; height: 34px; border-radius: 50%; }
.swatch > input:checked + .swatch-dot, .swatch > input:checked ~ input[type=color] { outline: 3px solid var(--text); outline-offset: 2px; }
.swatch > input:focus-visible + .swatch-dot { outline: 3px dashed var(--text); outline-offset: 2px; }
.swatch input[type=color] { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; overflow: hidden; }
.swatch input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.swatch input[type=color]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.swatch input[type=color]::-moz-color-swatch { border: 0; border-radius: 50%; }
.brand-logo { display: block; width: 150px; height: 150px; margin: 12px auto 0; }
.details dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.person-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.person { min-width: 0; color: var(--text); font-size: calc(13px * var(--ts, 1)); font-weight: 600; text-align: center; overflow-wrap: anywhere; }
.person img { display: block; width: 100%; aspect-ratio: 1; margin-bottom: 5px; border-radius: 50%; object-fit: cover; }

/* Stories */
.stories-row { display: flex; gap: 12px; padding-bottom: 4px; overflow-x: auto; }
.story-tile { flex: none; width: 76px; color: var(--text); font-size: calc(12px * var(--ts, 1)); text-align: center; overflow-wrap: anywhere; }
.story-tile:hover { text-decoration: none; }
.story-ring { position: relative; display: block; width: 68px; height: 68px; margin: 0 auto 4px; padding: 3px; border-radius: 50%; background: var(--accent); }
.story-ring.add { background: var(--raised); }
.story-ring img { display: block; width: 100%; height: 100%; border: 2px solid var(--bg); border-radius: 50%; object-fit: cover; }
.story-ring b { position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; border: 2px solid var(--bg); border-radius: 50%; background: var(--accent); color: var(--on-accent); line-height: 17px; }
.story-view > * + * { margin-top: 10px; }
.story-bars { display: flex; gap: 4px; }
.story-bars span { flex: 1; height: 3px; border-radius: 2px; background: var(--raised); }
.story-bars span.seen { background: var(--text); }
.story-frame { display: flex; justify-content: center; border-radius: var(--radius); background: #000; overflow: hidden; }
.story-frame img, .story-frame video { display: block; max-height: 70vh; }
.story-caption { text-align: center; }
.story-nav { display: flex; justify-content: space-between; }

/* Posts */
.avatar-sm, .avatar-xs { display: block; flex: none; border-radius: 50%; object-fit: cover; }
.avatar-sm { width: 40px; height: 40px; }
.avatar-xs { width: 32px; height: 32px; }
.composer { padding: 12px 16px; }
.composer-top { display: flex; gap: 10px; }
.composer-top textarea { margin-top: 0; border-radius: 18px; }
.composer-bottom { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.composer-bottom .button { margin-left: auto; }
.file-note { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-file { display: inline-flex; flex: none; align-items: center; gap: 6px; margin: 0; padding: 7px 10px; border-radius: 8px; color: var(--muted); cursor: pointer; }
.pick-file:hover, .pick-file:focus-within { background: var(--raised); }
.pick-file svg { width: 22px; height: 22px; fill: none; stroke: var(--accent-text); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pick-file input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-preview { position: relative; min-height: 52px; margin-top: 10px; border-radius: 10px; background: #000; overflow: hidden; }
.file-preview img, .file-preview video { display: block; width: 100%; max-height: 360px; object-fit: contain; }
.file-preview-remove { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(10, 11, 14, .8); color: #fff; font-size: calc(24px * var(--ts, 1)); line-height: 1; cursor: pointer; }
.post-head { display: flex; align-items: center; gap: 10px; }
.post { padding-bottom: 6px; scroll-margin-top: 64px; }
.post .post-head { padding: 12px 16px 0; }
.post-who { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.name { color: var(--text); font-weight: 600; }
.post-body { padding: 10px 16px 0; }
.post-media { display: block; width: 100%; max-height: 640px; margin-top: 10px; background: #000; object-fit: contain; }
.post-actions { display: flex; align-items: center; gap: 6px; margin: 6px 8px 0; }
.post-action { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; font-weight: 600; font-size: calc(15px * var(--ts, 1)); cursor: pointer; }
.post-action:hover { background: var(--raised); text-decoration: none; }
.post-action .icon { width: 26px; height: 26px; }
.post-action.liked { color: var(--accent-text); }
.post-action.liked .icon { fill: currentColor; }
.share-note { margin-left: 4px; }
/* Comments stay tucked away until asked for, or until the address points at them after commenting. */
.post-comments { display: none; margin-top: 6px; padding: 10px 16px 4px; border-top: 1px solid var(--line); scroll-margin-top: 120px; }
.post-comments.open, .post-comments:target { display: block; }
.post-comments.closed { display: none; }
.comment { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.comment-bubble { min-width: 0; padding: 6px 12px; border-radius: 16px; background: var(--raised); font-size: calc(14px * var(--ts, 1)); }
.comment form { align-self: center; flex: none; }
.comment-form { display: flex; align-items: center; gap: 8px; }
.comment-form .comment-text { flex: 1; min-width: 0; max-height: 120px; overflow-y: auto; margin: 0; padding: 8px 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--raised); color: var(--text); font: inherit; line-height: 1.35; overflow-wrap: anywhere; -webkit-user-select: text; user-select: text; outline: none; }
.comment-form .comment-text:focus { border-color: var(--accent); }
.comment-form .comment-text:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.comment-thumb { flex: none; width: 36px; height: 36px; padding: 0; overflow: hidden; border: 2px solid var(--accent); border-radius: 8px; background: none; cursor: pointer; }
.comment-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Filtered views */
.page > * + .tabs-card { margin-top: 14px; }
.tabs-card { margin-top: 0; padding: 8px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.photo-feed { display: flex; flex-direction: column; gap: 8px; margin-right: -16px; margin-left: -16px; }
.photo-feed a { display: block; background: #000; }
.photo-feed img { display: block; width: 100%; max-height: 88vh; max-height: 88dvh; margin: 0 auto; object-fit: contain; }
.post-media.flush { margin-top: 0; border-radius: var(--radius) var(--radius) 0 0; }
.tucked summary { padding: 10px 16px 0; color: var(--muted); font-size: calc(14px * var(--ts, 1)); font-weight: 600; cursor: pointer; }
.media-link { display: inline-block; margin: 8px 16px 0; font-size: calc(14px * var(--ts, 1)); font-weight: 600; }
.people-search { display: flex; gap: 8px; margin-bottom: 14px; }
.people-search input { flex: 1; min-width: 0; margin: 0; }

/* Get the app, and the page shown when the site can't be reached */
.get-app { display: inline-block; margin-bottom: 6px; font-weight: 600; font-size: calc(14px * var(--ts, 1)); }
.already-installed { display: none; margin-top: 10px; }
.install h1 { font-size: calc(22px * var(--ts, 1)); }
.install h2 { margin-top: 18px; font-size: calc(17px * var(--ts, 1)); }
.install ol { margin: 8px 0 0; padding-left: 22px; }
.install li { margin-bottom: 6px; overflow-wrap: anywhere; }
.install .button { margin-top: 10px; }
.offline { margin-top: 12vh; padding: 28px 20px; text-align: center; }
.offline img { display: block; margin: 0 auto 14px; border-radius: 22px; }
.offline h1 { margin-bottom: 8px; font-size: calc(22px * var(--ts, 1)); }
.offline .button { margin-top: 16px; }
/* The pages people see before they are logged in wear the logo's own colors on the main button. */
.brand-logo ~ * .button.primary, .welcome .button.primary, .offline .button.primary { background: linear-gradient(135deg, #e0102a, #f2500f); color: #fff; }
.brand-logo ~ * .button.primary:hover, .welcome .button.primary:hover, .offline .button.primary:hover { background: linear-gradient(135deg, #ea1c34, #f96218); }
.brand-logo { border-radius: 22.5%; box-shadow: 0 10px 34px rgba(242, 80, 15, .28); }
@media (display-mode: standalone) {
  .get-app { display: none; }
  .already-installed { display: block; }
}

/* Invites page */
.invite-link { font-family: Consolas, monospace; }
.admin-table { width: 100%; border-collapse: collapse; font-size: calc(14px * var(--ts, 1)); }
.admin-table th, .admin-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; text-align: left; vertical-align: middle; }
.admin-table th { color: var(--muted); font-size: calc(13px * var(--ts, 1)); }
.admin-table .actions { white-space: nowrap; }
.admin-table .actions form + form { margin-left: 8px; }
.table-scroll { overflow-x: auto; }

/* Messenger */
.page:has(.messenger) { max-width: 1000px; }
.messenger { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 12px; height: calc(100vh - 150px); min-height: 420px; }
.im-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.im-side .box { display: flex; flex: 1 1 0; flex-direction: column; min-height: 0; }
.im-side .box > h2 { padding-bottom: 8px; font-size: calc(16px * var(--ts, 1)); }
.im-list { flex: 1; min-height: 0; margin: 0; padding: 0 6px 6px; overflow-y: auto; list-style: none; }
.im-item { display: flex; width: 100%; align-items: center; gap: 8px; padding: 7px 8px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: calc(14px * var(--ts, 1)); text-align: left; cursor: pointer; }
.im-item:hover { background: var(--raised); }
.im-item.active { background: var(--accent-soft); }
.im-item img { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.im-item .text { flex: 1; min-width: 0; }
.im-item .name, .im-item .preview { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.im-item .preview { color: var(--muted); font-size: calc(12px * var(--ts, 1)); }
.dot { flex: 0 0 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--raised-hover); }
.dot.on { background: var(--online); }
.im-window { display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.im-titlebar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 700; }
.im-status { color: var(--muted); font-size: calc(12px * var(--ts, 1)); font-weight: 400; }
.im-log { flex: 1; min-height: 0; padding: 12px 16px; overflow-y: auto; }
.im-empty { margin-top: 40px; color: var(--muted); text-align: center; }
.im-msg { width: fit-content; max-width: 85%; margin-bottom: 6px; padding: 7px 12px; border-radius: 16px; background: var(--raised); overflow-wrap: anywhere; white-space: pre-wrap; }
.im-msg.mine { margin-left: auto; background: var(--accent); color: var(--on-accent); }
.im-msg.failed { background: #4a1c20; color: #ffc9ce; }
.im-msg .sender { display: block; color: var(--muted); font-size: calc(12px * var(--ts, 1)); font-weight: 600; }
.im-msg .time { display: block; color: var(--muted); font-size: calc(11px * var(--ts, 1)); }
.im-msg.mine .time { color: inherit; opacity: .8; }
.im-media { display: block; max-width: 100%; max-height: 320px; border-radius: 10px; }
.im-save { display: block; margin-top: 4px; color: inherit; font-size: calc(12px * var(--ts, 1)); text-decoration: underline; }
.im-file { display: block; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.08); color: inherit; text-decoration: none; max-width: 100%; }
.im-file-name { display: block; font-weight: 600; overflow-wrap: anywhere; }
.im-file-size { display: block; margin-top: 2px; font-size: calc(12px * var(--ts, 1)); opacity: .75; }
.im-notice { margin: 8px 0; color: var(--muted); font-size: calc(12px * var(--ts, 1)); text-align: center; }
.im-side-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 8px 16px; }
.im-side-head h2 { font-size: calc(16px * var(--ts, 1)); font-weight: 700; }
.im-side-head .button { padding: 4px 10px; font-size: calc(13px * var(--ts, 1)); }
.im-side > .linkbutton { padding: 2px 4px; text-align: left; }
.im-title { display: inline-flex; min-width: 0; align-items: center; }
.im-title-button { padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.im-title-button:hover { text-decoration: underline; }
.im-panel { flex: 1; min-height: 0; padding: 12px 16px; overflow-y: auto; }
.im-panel > * + * { margin-top: 10px; }
.member-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; overflow-wrap: anywhere; }
.pick-people label { margin-top: 6px; }
.safety-code { font-family: Consolas, monospace; font-size: calc(17px * var(--ts, 1)); letter-spacing: 1px; }
.im-attach { padding: 7px; }
.im-lock { margin: 0; padding: 0 12px 8px; color: var(--muted); font-size: calc(11px * var(--ts, 1)); text-align: center; }
.push-prompt { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.im-more { display: block; margin: 0 auto 10px; }
.im-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.im-form input { flex: 1; min-width: 0; margin: 0; border-radius: 18px; }
.im-back { display: none; }
.im-error { padding: 6px 16px; background: #4a1c20; color: #ffc9ce; font-size: calc(13px * var(--ts, 1)); }

/* Messenger list, styled like a phone messenger: big title, a row of family, then chats */
.messenger { grid-template-columns: 360px minmax(0, 1fr); }
.im-side { gap: 0; }
.im-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 10px; }
.im-head h1 { margin: 0; font-size: calc(30px * var(--ts, 1)); font-weight: 800; letter-spacing: -.5px; }
.im-head-actions { display: flex; gap: 8px; }
.im-icon { display: grid; width: 40px; height: 40px; place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--raised); color: var(--text); cursor: pointer; }
.im-icon:hover { background: var(--raised-hover); }
.im-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.im-search { margin: 0 0 8px; border-radius: 22px; }
.im-strip { display: flex; flex: 0 0 auto; gap: 14px; margin: 0; padding: 6px 2px 14px; overflow-x: auto; list-style: none; scrollbar-width: none; }
.im-strip::-webkit-scrollbar { display: none; }
.im-strip .im-empty { margin: 0; font-size: calc(13px * var(--ts, 1)); text-align: left; }
.im-person { display: flex; width: 68px; flex-direction: column; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: calc(13px * var(--ts, 1)); cursor: pointer; }
.im-person .avatar img { width: 62px; height: 62px; }
.im-person .name { max-width: 68px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { position: relative; display: inline-block; flex: 0 0 auto; }
.avatar img { display: block; width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.avatar .dot { position: absolute; right: 0; bottom: 0; width: 16px; height: 16px; box-sizing: border-box; border: 3px solid var(--bg); }
.im-list { padding: 0; }
.im-item { gap: 12px; padding: 9px 4px; border-radius: 12px; }
.im-item .avatar img { flex: none; width: 56px; height: 56px; }
.im-item .name { font-size: calc(17px * var(--ts, 1)); font-weight: 500; }
.im-item .preview { margin-top: 2px; font-size: calc(15px * var(--ts, 1)); }
.im-item.unread .name, .im-item.unread .preview { color: var(--text); font-weight: 700; }
.im-item .meta { display: flex; flex: 0 0 auto; flex-direction: column; align-items: flex-end; align-self: stretch; gap: 10px; padding-top: 4px; }
.im-item .when { color: var(--muted); font-size: calc(13px * var(--ts, 1)); }
.im-item.unread .when { color: var(--text); }
.unread-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.im-todo { display: inline-block; align-self: flex-start; margin-top: 4px; padding: 2px 9px; border-radius: 999px; background: #f0bf2e; color: #17120c; font-size: calc(12px * var(--ts, 1)); font-weight: 800; }
.im-item.todo { box-shadow: inset 3px 0 0 #f0bf2e; }
/* Open mic: drop-in rooms at the top of Messenger, above the chats. */
.mic-row { display: flex; flex: 0 0 auto; flex-direction: column; gap: 6px; margin: 0 0 10px; }
.mic-card { display: flex; width: 100%; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--accent-line); border-radius: 14px; background: var(--accent-soft); color: var(--text); font: inherit; font-size: calc(14px * var(--ts, 1)); text-align: left; cursor: pointer; }
.mic-card:hover { background: var(--raised-hover); }
.mic-card.mic-start { border-style: dashed; border-color: var(--line); background: none; }
.mic-card .avatar img, .mic-card .mic-icon { display: block; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.mic-card .mic-icon { display: grid; flex: 0 0 44px; place-items: center; background: var(--raised); font-size: 22px; }
.mic-card .text { flex: 1; min-width: 0; }
.mic-card .name, .mic-card .preview { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mic-card .name { font-weight: 700; }
.mic-card .preview { color: var(--muted); font-size: calc(12px * var(--ts, 1)); }
.mic-card .mic-go { flex: none; padding: 6px 14px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: calc(13px * var(--ts, 1)); }
.mic-card.joined .mic-go { background: none; color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent-line); }
.im-device { margin-top: 6px; padding: 8px 4px; color: var(--muted); font-size: calc(13px * var(--ts, 1)); text-align: left; }

/* Chat screen, styled like a phone messenger: round picture and name on top, big bubbles, pill message box */
.im-window { border-radius: 16px; }
.im-titlebar { justify-content: flex-start; gap: 10px; padding: 8px 10px; border-bottom: 0; background: var(--raised); font-weight: 400; }
.im-titlebar .im-icon { width: 40px; height: 40px; background: none; }
.im-titlebar .im-icon:hover { background: var(--raised-hover); }
.im-titlebar .im-back { display: none; }
.im-head-avatar { flex: none; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.im-head-avatar img { display: block; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.im-title-text { display: flex; flex: 1; min-width: 0; flex-direction: column; }
.im-title-button { max-width: 100%; overflow: hidden; font-size: calc(18px * var(--ts, 1)); font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.im-title-button:hover { text-decoration: none; }
.im-status { font-size: calc(13px * var(--ts, 1)); }
.im-status.on { color: var(--online); }
.im-log { padding: 8px 14px 12px; }
.im-day { margin: 16px 0 10px; color: var(--muted); font-size: calc(14px * var(--ts, 1)); text-align: center; }
.im-msg { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: flex-end; column-gap: 12px; max-width: 82%; margin-bottom: 4px; padding: 9px 14px 7px; border-radius: 20px; }
.im-msg .sender { flex-basis: 100%; }
.im-msg .im-text { text-align: left; }
.im-msg .time { display: block; margin-left: auto; font-size: calc(12px * var(--ts, 1)); opacity: .75; }
.im-msg.has-media { display: block; width: min(320px, 82%); padding: 0; overflow: hidden; }
.im-msg.has-media .sender { display: block; padding: 8px 14px 0; }
.im-msg.has-media .im-media { width: 100%; max-height: 420px; max-width: none; border-radius: 0; object-fit: cover; }
.im-foot { display: flex; align-items: center; justify-content: space-between; padding: 6px 14px 8px; }
.im-foot .im-save { display: inline; margin: 0; font-size: calc(13px * var(--ts, 1)); text-decoration: none; opacity: .85; }
.im-foot .time { margin-left: 0; }
.im-form { align-items: center; gap: 10px; padding: 10px 12px; border-top: 0; }
.im-field { display: flex; flex: 1; align-items: center; min-width: 0; padding: 0 6px 0 18px; border-radius: 26px; background: var(--raised); }
.im-field input[type="text"] { flex: 1; min-width: 0; margin: 0; padding: 13px 0; border: 0; border-radius: 0; background: none; box-shadow: none; outline: none; color: inherit; font-size: calc(16px * var(--ts, 1)); }
.im-field .chat-input { flex: 1; min-width: 0; max-height: 120px; overflow-y: auto; margin: 0; padding: 13px 0; color: inherit; font-size: calc(16px * var(--ts, 1)); line-height: 1.3; overflow-wrap: anywhere; outline: none; -webkit-user-select: text; user-select: text; }
.im-field .chat-input:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.im-field .chat-input[aria-disabled="true"] { opacity: .5; }
.im-attach { position: relative; display: grid; flex: none; width: 40px; height: 40px; margin: 0; padding: 0; place-items: center; border-radius: 50%; color: var(--muted); cursor: pointer; }
.im-attach:not(:disabled):hover, .im-attach:focus-visible { background: var(--raised-hover); color: var(--text); }
.im-attach svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.im-attach input { position: absolute; flex: none; width: 1px; height: 1px; opacity: 0; }
.im-send { display: grid; flex: none; width: 50px; height: 50px; padding: 0; place-items: center; border: 0; border-radius: 50%; background: var(--accent); color: var(--on-accent); cursor: pointer; }
.im-send:disabled { opacity: .45; cursor: default; }
.im-send svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* Chat screen, version 3: black screen, bubbles with a small round picture, "+" and a pill message box */
.im-window { background: #000; }
.im-titlebar { background: #000; }
.im-titlebar .im-title-button { font-size: calc(21px * var(--ts, 1)); font-weight: 400; }
.im-status[hidden] { display: none; }
.im-status { color: var(--muted); }
.im-log { padding: 8px 12px 10px; }
.im-day { margin: 14px 0 8px; font-size: calc(13px * var(--ts, 1)); }
.im-row { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 6px; }
.im-row.mine { justify-content: flex-end; }
.im-pic { flex: none; width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.im-row .im-msg { display: block; width: fit-content; max-width: min(78%, 520px); margin: 0; padding: 12px 18px; border-radius: 26px; background: #1c1c1e; font-size: calc(18px * var(--ts, 1)); line-height: 1.3; white-space: pre-wrap; }
.im-row .im-msg.mine { background: var(--accent); }
.im-row .im-msg .sender { display: block; margin-bottom: 2px; color: #aeb2ba; font-size: calc(14px * var(--ts, 1)); font-weight: 400; }
.im-row .im-msg.has-media { width: min(320px, 78%); padding: 0; }
.im-row .im-msg.has-media .sender { padding: 10px 16px 0; }
.im-row .im-msg.failed { background: #4a1c20; }
.im-link { color: inherit; text-decoration: underline; overflow-wrap: anywhere; }
.im-card { display: flex; flex-direction: column; flex-basis: 100%; gap: 6px; width: min(300px, 68vw); margin-top: 8px; border-radius: 14px; color: inherit; text-decoration: none; white-space: normal; text-align: left; min-width: 0; }
.im-card-img { display: block; width: 100%; height: auto; max-height: 460px; border-radius: 12px; object-fit: contain; background: rgba(0, 0, 0, .25); }
.im-card-text { display: flex; flex-direction: column; min-width: 0; gap: 1px; padding: 0 2px 2px; }
.im-card-title { font-size: calc(13px * var(--ts, 1)); line-height: 1.25; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.im-card-site { font-size: calc(11px * var(--ts, 1)); opacity: .65; }
.im-foot { justify-content: flex-start; padding: 8px 16px 10px; }
.im-form { align-items: center; gap: 10px; padding: 8px 12px 12px; background: #000; }
.im-attach { width: 44px; height: 44px; color: var(--accent-text); }
.im-attach svg { width: 28px; height: 28px; stroke-width: 2.2; }
.im-field { padding: 0 8px 0 20px; border: 1px solid #5a5e66; background: transparent; }
.im-field input[type="text"] { padding: 14px 0; font-size: calc(18px * var(--ts, 1)); }
  .im-field .chat-input { padding: 14px 0; font-size: calc(18px * var(--ts, 1)); }
.im-send { width: 52px; height: 52px; background: #232326; color: #8c9098; }
.im-send.ready:not(:disabled) { background: var(--accent); color: var(--on-accent); }
.im-send:disabled { opacity: 1; }
.im-send svg { width: 24px; height: 24px; stroke-width: 2; }

/* A photo waiting to be sent */
.im-tray { padding: 10px 14px 0; background: #000; }
.im-tray.hidden { display: none; }
.im-tray.multi { display: flex; gap: 12px; overflow-x: auto; padding-top: 12px; scrollbar-width: none; }
.im-tray.multi::-webkit-scrollbar { display: none; }
.im-tray.multi .im-tray-item { flex: none; }
.im-tray.multi .im-tray-thumb { height: 96px; max-width: 96px; }
.im-tray-item { position: relative; display: inline-block; max-width: 100%; }
.im-tray-thumb { display: block; width: auto; max-width: 140px; height: 140px; border-radius: 16px; background: #1c1c1e; object-fit: cover; }
.im-tray-item.as-file { padding: 12px 40px 12px 14px; border-radius: 14px; background: #1c1c1e; }
.im-tray-name { display: block; font-weight: 600; overflow-wrap: anywhere; }
.im-tray-size { display: block; margin-top: 2px; color: var(--muted); font-size: calc(13px * var(--ts, 1)); }
.im-tray-remove { position: absolute; top: -8px; right: -8px; display: grid; width: 28px; height: 28px; padding: 0; place-items: center; border: 2px solid #000; border-radius: 50%; background: #3a3b3f; color: #fff; font-size: calc(18px * var(--ts, 1)); line-height: 1; cursor: pointer; }
.im-tray-remove:hover { background: #55575d; }
.im-caption { display: block; padding: 8px 16px 0; }
.im-row .im-msg:not(.has-media) .im-caption { padding: 8px 0 0; }

/* Phones: navigation moves to the bottom of the screen */
@media (max-width: 700px) {
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .topbar-inner { height: 48px; }
  .logo { font-size: calc(36px * var(--ts, 1)); letter-spacing: .1em; }
  .tabs { justify-content: space-between; }
  .tabs a { gap: 5px; padding: 7px 8px; font-size: calc(13px * var(--ts, 1)); }
  .nav {
    position: fixed; right: 0; bottom: 0; left: 0; z-index: 20; justify-content: space-around; gap: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; background: #111318;
  }
  .nav a { flex: 1; flex-direction: column; gap: 1px; padding: 5px 2px; font-size: calc(11px * var(--ts, 1)); }
  .nav .badge { position: absolute; top: 1px; left: calc(50% + 4px); }
  .cover { height: 170px; }
  .picture-frame { width: 116px; height: 116px; }
  .profile-intro { margin-top: -46px; }
  .profile-name { padding-top: 52px; }
  .profile-name h1 { font-size: calc(23px * var(--ts, 1)); }
  .picks { grid-template-columns: minmax(0, 1fr); }
  .admin-table .col-username { display: none; }
  .admin-table .actions { white-space: normal; }
  .admin-table .actions form { display: block; margin: 0 0 6px; }
  .admin-table .actions form + form { margin-left: 0; }

  .messenger { display: block; height: auto; }
  .messenger .im-side { height: calc(100vh - 150px); }
  .messenger .im-window { display: none; height: calc(100vh - 150px); }
  .messenger.chatting .im-side { display: none; }
  .messenger.chatting .im-window { display: flex; }
  .im-titlebar .im-back { display: grid; color: var(--text); }
}

/* Where the Personal Details picture sits */
.focus-0 { object-position: 50% 0%; }
.focus-5 { object-position: 50% 5%; }
.focus-10 { object-position: 50% 10%; }
.focus-15 { object-position: 50% 15%; }
.focus-20 { object-position: 50% 20%; }
.focus-25 { object-position: 50% 25%; }
.focus-30 { object-position: 50% 30%; }
.focus-35 { object-position: 50% 35%; }
.focus-40 { object-position: 50% 40%; }
.focus-45 { object-position: 50% 45%; }
.focus-50 { object-position: 50% 50%; }
.focus-55 { object-position: 50% 55%; }
.focus-60 { object-position: 50% 60%; }
.focus-65 { object-position: 50% 65%; }
.focus-70 { object-position: 50% 70%; }
.focus-75 { object-position: 50% 75%; }
.focus-80 { object-position: 50% 80%; }
.focus-85 { object-position: 50% 85%; }
.focus-90 { object-position: 50% 90%; }
.focus-95 { object-position: 50% 95%; }
.focus-100 { object-position: 50% 100%; }

/* The preset colors */
.swatch-4d84ff { background: #4d84ff; }
.swatch-ff6a2b { background: #ff6a2b; }
.swatch-2d88ff { background: #2d88ff; }
.swatch-14c8c8 { background: #14c8c8; }
.swatch-37c871 { background: #37c871; }
.swatch-e0a93b { background: #e0a93b; }
.swatch-ff8a3d { background: #ff8a3d; }
.swatch-f2545b { background: #f2545b; }
.swatch-f062b4 { background: #f062b4; }
.swatch-9b6bff { background: #9b6bff; }
.swatch-c9ced6 { background: #c9ced6; }

@media (max-width: 700px) {
  body:has(.messenger.chatting) { padding-bottom: 0; }
  body:has(.messenger.chatting) .nav,
  body:has(.messenger.chatting) .footer { display: none; }
  body:has(.messenger.chatting) .page { max-width: none; padding: 0; }
  /* Pinned to the screen: the message box stays at the bottom and the page itself never scrolls. */
  html:has(.messenger.chatting), body:has(.messenger.chatting) { overflow: hidden; overscroll-behavior: none; }
  body:has(.messenger.chatting) .messenger .im-window { position: fixed; top: 49px; left: 0; right: 0; bottom: 0; height: auto; border: 0; border-radius: 0; }
}

/* Seen: a small round picture under your last message once someone has read it */
.im-seen { display: flex; justify-content: flex-end; gap: 2px; margin: -2px 6px 6px 0; }
.im-seen-pic { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; }
.im-seen-more { align-self: center; color: var(--muted); font-size: calc(11px * var(--ts, 1)); }
.im-ticks { display: flex; justify-content: flex-end; margin: -2px 8px 6px 0; color: var(--muted); }
.im-ticks svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.im-ticks.arrived { color: var(--accent-text); }

.im-zoomable { cursor: zoom-in; }

/* Chat header: the green online dot on the picture, and on phones the header lives in the top bar */
.im-head-avatar { position: relative; }
.im-head-avatar .dot { position: absolute; right: 0; bottom: 0; width: 15px; height: 15px; box-sizing: border-box; border: 3px solid #000; }
.im-head-avatar .dot[hidden] { display: none; }
.topbar .im-titlebar { flex: 1; min-width: 0; padding: 0; background: none; }
.topbar .im-titlebar .im-head-avatar img { width: 36px; height: 36px; }
.topbar .im-titlebar .im-head-avatar .dot { border-color: #0d0e12; }
.topbar .im-titlebar .im-title-button { font-size: calc(19px * var(--ts, 1)); }
.topbar .im-titlebar .im-icon { width: 36px; height: 36px; }
.topbar .im-titlebar #chat-info { display: none; }
.topbar:has(.im-titlebar) .logo { display: none; }

/* Pictures and GIFs in comments */
.comment-media { display: block; max-width: 100%; max-height: 260px; margin-top: 4px; border-radius: 10px; cursor: zoom-in; }
.comment-attach { position: relative; display: inline-flex; flex: none; align-items: center; padding: 6px; border-radius: 50%; color: var(--muted); cursor: pointer; }
.comment-attach:hover, .comment-attach:focus-within { background: var(--raised); color: var(--text); }
.comment-attach svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.comment-attach.has-file { color: var(--accent-text); }
.comment-attach input { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* Settings: a menu like Signal's, with one page per topic */
.settings-title { margin: 4px 0 14px; font-size: calc(28px * var(--ts, 1)); font-weight: 800; letter-spacing: -.3px; }
.settings-head { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; }
.settings-head h1 { margin: 0; font-size: calc(22px * var(--ts, 1)); font-weight: 700; }
.settings-back { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 50%; color: var(--text); }
.settings-back:hover { background: var(--raised); text-decoration: none; }
.settings-back .icon { width: 24px; height: 24px; transform: rotate(180deg); }
.settings-intro { margin: 0 4px 12px; }
.set-me { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--text); }
.set-me:hover { background: var(--raised); text-decoration: none; }
.avatar-md { width: 56px; height: 56px; flex: none; border-radius: 50%; object-fit: cover; }
.set-group { display: block; margin: 0 0 14px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.set-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 13px 16px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.set-group > .set-row:last-child { border-bottom: 0; }
.set-row:hover { background: var(--raised); text-decoration: none; }
.set-icon { display: grid; width: 28px; flex: none; place-items: center; color: var(--text); }
.set-icon .icon { width: 24px; height: 24px; }
.set-text { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 1px; }
.set-text b { font-size: calc(17px * var(--ts, 1)); font-weight: 500; }
.set-text small { color: var(--muted); font-size: calc(13px * var(--ts, 1)); font-weight: 400; }
.set-chev { flex: none; color: var(--muted); }
.set-chev .icon { width: 18px; height: 18px; }
.set-row.danger, .set-row.danger .set-icon { color: #ff7a7a; }
.prose p { margin: 0 0 10px; line-height: 1.45; }
.prose p:last-child { margin-bottom: 0; }
.button.danger { border-color: rgba(255, 122, 122, .5); color: #ff9d9d; }
.button.danger:hover { background: rgba(255, 122, 122, .12); }
.member-row small.hint { display: block; }

/* Friends */
.top-action { position: relative; }
.req-badge { position: absolute; top: -2px; right: -4px; }
.friend-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.friend-actions form { margin: 0; }
.friend-actions .button { margin-top: 0; }
.person-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.person-row:first-of-type { border-top: 0; }
.person-id { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--text); font-weight: 600; }
.person-id img { width: 48px; height: 48px; flex: none; border-radius: 50%; object-fit: cover; }
.person-id:hover { text-decoration: none; }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--love); color: #fff; font-size: calc(12px * var(--ts, 1)); line-height: 20px; text-align: center; vertical-align: middle; }
.private-note { text-align: center; }
.private-note h2 { display: flex; align-items: center; justify-content: center; gap: 8px; }

/* Reactions */
.im-col { display: flex; flex-direction: column; align-items: flex-start; max-width: min(78%, 520px); min-width: 0; }
.im-row.mine .im-col { align-items: flex-end; }
.im-col .im-msg { max-width: 100%; }
.im-col:has(.has-media) { width: min(320px, 78%); }
.im-col .im-msg.has-media { width: 100%; }
.im-row .im-col .im-msg.has-media { width: 100%; }
.im-msg[data-mid] { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.im-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin: -6px 10px 0; position: relative; z-index: 1; }
.im-react { display: inline-flex; align-items: center; gap: 3px; margin: 0; padding: 2px 8px; border: 2px solid var(--bg, #000); border-radius: 14px; background: #2a2b30; color: inherit; font: inherit; font-size: calc(14px * var(--ts, 1)); line-height: 1.3; cursor: pointer; touch-action: manipulation; }
.im-react.mine { background: #1f3a5f; }
.im-react-count { font-size: calc(12px * var(--ts, 1)); opacity: .85; }
.im-row { margin-bottom: 8px; }
.im-reactbar { position: fixed; inset: 0; z-index: 60; }
.im-reactbar-box { position: fixed; display: flex; align-items: center; gap: 2px; padding: 6px 8px; border-radius: 30px; background: #2a2b30; box-shadow: 0 6px 24px rgba(0, 0, 0, .5); }
.im-reactbar-btn { margin: 0; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%; background: none; font-size: calc(26px * var(--ts, 1)); line-height: 1; cursor: pointer; }
.im-reactbar-btn.on { background: #1f3a5f; }
.im-reactbar-copy { margin: 0 4px 0 6px; padding: 8px 12px; border: 0; border-radius: 18px; background: #3a3b41; color: inherit; font: inherit; font-size: calc(14px * var(--ts, 1)); cursor: pointer; }
.im-sheet-back { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, .5); }
.im-sheet { width: min(480px, 100%); max-height: 70vh; overflow: auto; overscroll-behavior: contain; padding: 12px 8px calc(16px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; background: #1c1c1e; }
.im-sheet h3 { margin: 4px 12px 8px; font-size: calc(16px * var(--ts, 1)); }
.im-sheet-row { display: flex; align-items: center; gap: 12px; width: 100%; margin: 0; padding: 8px 12px; border: 0; border-radius: 12px; background: none; color: inherit; font: inherit; text-align: left; }
.im-sheet-row:not(:disabled) { cursor: pointer; }
.im-sheet-pic { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.im-sheet-name { flex: 1; font-weight: 600; }
.im-sheet-hint { color: #aeb2ba; }
.im-sheet-emoji { font-size: calc(26px * var(--ts, 1)); }
.im-attach-sheet { padding: 10px 12px calc(20px + env(safe-area-inset-bottom)); animation: im-sheet-up .2s ease-out; }
.im-sheet-grip { width: 40px; height: 4px; margin: 2px auto 18px; border-radius: 2px; background: #8e8e93; }
.im-attach-sheet h3 { margin: 0 12px 14px; font-size: calc(18px * var(--ts, 1)); font-weight: 600; }
.im-attach-row { gap: 22px; padding: 14px 12px; }
.im-attach-row:hover, .im-attach-row:focus-visible { background: rgba(255, 255, 255, .06); outline: none; }
.im-attach-row svg { flex: none; width: 28px; height: 28px; fill: #c7c9ce; }
.im-attach-words { display: flex; flex-direction: column; gap: 3px; }
.im-attach-words strong { font-size: calc(17px * var(--ts, 1)); font-weight: 600; }
.im-attach-words small { color: #9a9ea6; font-size: calc(15px * var(--ts, 1)); line-height: 1.35; }
button.im-attach { border: 0; background: none; font: inherit; }
/* The pickers behind the Attach sheet are never shown; the general file-input rule would otherwise display them. */
input.im-pick { display: none; }
button.im-attach:disabled { opacity: .45; cursor: default; }
@keyframes im-sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .im-attach-sheet { animation: none; } }

/* Comments on a page */
.wall { scroll-margin-top: 120px; }
.wall-form { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.wall .comment:first-child { margin-top: 0; }


/* Editing a sent message */
.im-edited { margin-left: 4px; font-size: calc(12px * var(--ts, 1)); opacity: .7; white-space: nowrap; }
.im-edit-box { display: block; width: 100%; box-sizing: border-box; margin: 4px 0 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--raised); color: inherit; font: inherit; font-size: calc(16px * var(--ts, 1)); resize: vertical; }
.im-edit-row { display: flex; justify-content: flex-end; gap: 8px; padding: 0 4px; }
.im-edit-row .button { margin: 0; }

/* A file on its way out */
.im-msg.pending { min-width: 160px; }
.im-pending-thumb { display: block; max-width: 220px; max-height: 220px; margin-bottom: 6px; border-radius: 14px; object-fit: cover; opacity: .75; }
.im-pending-name { display: block; margin-bottom: 4px; font-weight: 600; overflow-wrap: anywhere; }
.im-sending-line { margin-top: 4px; font-size: calc(13px * var(--ts, 1)); opacity: .9; }
.im-progress { height: 4px; margin-top: 6px; border-radius: 2px; background: rgba(255, 255, 255, .3); overflow: hidden; }
.im-progress > span { display: block; width: 0; height: 100%; background: #fff; transition: width .15s linear; }

.im-unsent { font-size: calc(12px * var(--ts, 1)); opacity: .8; }

/* Text size picker in Settings */
.size-choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 12px; }
.size-choices button { min-width: 64px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--raised); color: var(--text); font: inherit; cursor: pointer; }
.size-choices button[aria-pressed="true"] { outline: 3px solid var(--text); outline-offset: 1px; }
.size-sample { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--raised); }

/* Chat bubbles floating on the Home page */
.bubble-layer { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.bubble { position: fixed; display: block; width: 56px; height: 56px; border-radius: 50%; box-shadow: 0 4px 14px rgba(0, 0, 0, .55); background: #1c1c1e; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; pointer-events: auto; transition: left .18s ease-out, top .18s ease-out, transform .12s; }
.bubble.dragging { transition: none; transform: scale(1.12); }
.bubble img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; pointer-events: none; }
.bubble-count { position: absolute; top: -4px; right: -4px; min-width: 20px; padding: 0 5px; border-radius: 10px; background: var(--love, #f2545b); color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; box-sizing: border-box; }
.bubble-count[hidden] { display: none; }
.bubble-remove { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); width: 56px; height: 56px; margin-left: -28px; border-radius: 50%; background: rgba(40, 40, 44, .92); color: #fff; font-size: 24px; line-height: 56px; text-align: center; pointer-events: none; transition: transform .12s, background .12s; }
.bubble-remove[hidden] { display: none; }
.bubble-remove.active { transform: scale(1.25); background: #f2545b; }

/* The Hello wordmark is a picture of the logo's own letters. */
.logo-word { display: block; height: 30px; width: auto; flex: none; }


/* The hand in the menu: a plain outline like the other menu icons when there is nothing new, filled in when there is */
.nav a.nav-flame .icon { stroke-linejoin: round; overflow: visible; }
.nav a.nav-flame .icon path { transform: scale(.9); transform-origin: 12px 12px; }
.nav a.nav-flame.lit { color: var(--text); }
.nav a.nav-flame.lit .icon { fill: var(--flame, #ff7a1a); stroke: var(--flame-edge, #ffb347); filter: drop-shadow(0 0 6px var(--flame-glow, rgba(255, 122, 26, .75))); }
html[data-flicker="on"] .nav a.nav-flame.lit .icon { animation: flame-flicker 1.4s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes flame-flicker { 0%, 50%, 100% { transform: rotate(0); } 10% { transform: rotate(-16deg); } 20% { transform: rotate(12deg); } 30% { transform: rotate(-12deg); } 40% { transform: rotate(8deg); } }
@media (prefers-reduced-motion: reduce) { html[data-flicker="on"] .nav a.nav-flame.lit .icon { animation: none; } }

/* Notifications page */
.notif { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--text); }
.notif:hover { text-decoration: none; background: var(--raised); }
.notif.new { border-color: var(--flame, #ff7a1a); }
.notif-flame { display: flex; flex: none; }
.notif-flame .icon { width: 26px; height: 26px; fill: #000; stroke: #fff; stroke-width: 1.8; stroke-linejoin: round; }
.notif.new .notif-flame .icon { fill: var(--flame, #ff7a1a); stroke: var(--flame-edge, #ffb347); }
.notif-text { display: flex; flex-direction: column; min-width: 0; }
.notif-text small { color: var(--muted); font-size: calc(12px * var(--ts, 1)); }
.notif-empty { padding: 8px 2px; }

/* Flame alert choices in Settings */
.flame-opts { display: grid; gap: 16px; margin-top: 12px; }
.flame-opts h3 { margin: 0 0 6px; font-size: calc(15px * var(--ts, 1)); }
.flame-row { display: flex; flex-wrap: wrap; gap: 8px; }
.flame-row button { min-width: 64px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--raised); color: var(--text); font: inherit; cursor: pointer; }
.flame-row button[aria-pressed="true"] { outline: 3px solid var(--text); outline-offset: 1px; }
.flame-row .dot { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border-radius: 50%; vertical-align: -1px; }
.dot-orange { background: #ff7a1a; } .dot-red { background: #ff3b30; } .dot-gold { background: #ffc21a; } .dot-blue { background: #2d9bff; } .dot-green { background: #2ecc71; } .dot-purple { background: #9b6bff; } .dot-white { background: #fff; }
.flame-preview { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.flame-preview .icon { width: 44px; height: 44px; fill: var(--flame, #ff7a1a); stroke: var(--flame-edge, #ffb347); stroke-width: 1.6; stroke-linejoin: round; filter: drop-shadow(0 0 8px var(--flame-glow, rgba(255, 122, 26, .75))); overflow: visible; transform-origin: 50% 90%; }
html[data-flicker="on"] .flame-preview .icon { animation: flame-flicker 1.4s ease-in-out infinite; }

.im-toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 60; max-width: calc(100vw - 40px); padding: 12px 18px; border-radius: 22px; background: #26282e; color: #fff; font-size: calc(14px * var(--ts, 1)); text-align: center; transform: translateX(-50%); box-shadow: 0 4px 16px rgba(0, 0, 0, .5); }

.flame-pic { display: block; width: 72px; height: 72px; object-fit: contain; }
html[data-flicker="on"] .flame-pic { animation: flame-flicker 1.6s ease-in-out infinite; transform-origin: 50% 90%; }
/* A chat bubble on the Home page with something waiting: the flame picture sits over the photo */
.bubble-flame { position: absolute; left: 50%; top: 50%; width: 92px; height: 92px; margin: -54px 0 0 -46px; object-fit: contain; pointer-events: none; }
.bubble-flame[hidden] { display: none; }

/* Join form: a box people never see, for catching robots */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.report-row { padding: 10px 0; border-top: 1px solid var(--line); }
.report-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.report-actions .button, .report-actions form { margin: 0; }

.gate .body > p + .button.wide { margin-top: 12px; }
.gate .body > .button.wide + .button.wide { margin-top: 8px; }

/* Settings > Notifications: notification symbol picker (Android app only) */
#note-icon-box [hidden] { display: none !important; }
.ni-sub { margin: 18px 0 4px; font-size: calc(15px * var(--ts, 1)); }
.ni-grid { display: grid; grid-template-columns: repeat(auto-fill, 38px); gap: 6px; margin: 10px 0 4px; }
.ni-choice { display: grid; place-items: center; width: 38px; height: 38px; padding: 8px; border: 1px solid var(--line, rgba(255,255,255,.12)); border-radius: 10px; background: var(--raised, #1a1f2e); cursor: pointer; }
.ni-choice canvas { width: 20px; height: 20px; }
.ni-choice:hover { border-color: var(--accent); }
.ni-choice.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); background: var(--accent-soft, rgba(77,132,255,.15)); }
.ni-file { position: relative; overflow: hidden; display: inline-flex; margin-top: 6px; }
.ni-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ni-custom { margin-top: 12px; }
.ni-previews { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ni-big { width: 48px; height: 48px; padding: 10px; border-radius: 50%; background: #2a2f3d; box-sizing: content-box; }
.ni-bar { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: #000; color: #fff; font-size: 13px; }
.ni-bar canvas { width: 18px; height: 18px; }
.ni-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ni-colors { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.ni-color { width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 2px solid rgba(255,255,255,.18); cursor: pointer; }
.ni-color-none { background: conic-gradient(#4d84ff, #9b5cff, #ff5c8a, #ff8a00, #2ecc71, #00bcd4, #4d84ff); }
.ni-color.on { outline: 3px solid var(--text); outline-offset: 2px; }
.ni-emoji { display: grid; grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); gap: 2px; max-height: 180px; overflow-y: auto; margin-top: 10px; padding: 8px; border: 1px solid var(--line, rgba(255,255,255,.12)); border-radius: 14px; background: var(--raised, #1a1f2e); overscroll-behavior: contain; }
.ni-emoji-head { grid-column: 1 / -1; margin: 8px 2px 2px; font-size: calc(12px * var(--ts, 1)); color: var(--muted, #9aa3b5); text-transform: uppercase; letter-spacing: .04em; }
.ni-emoji-head:first-child { margin-top: 0; }
.ni-emoji-pick { aspect-ratio: 1; padding: 0; border: 0; border-radius: 8px; background: none; font-size: 18px; line-height: 1; cursor: pointer; }
.ni-emoji-pick:hover { background: rgba(255,255,255,.06); }
.ni-emoji-pick.on { background: var(--accent-soft, rgba(77,132,255,.15)); box-shadow: 0 0 0 2px var(--accent); }
.ni-emoji-preview { margin-top: 12px; }

/* Games in a chat: the board pinned above the message box (see games.js) */
.im-attach-row { padding-top: 12px; padding-bottom: 12px; }
.im-attach-sheet { max-height: 82vh; }
.game-ico { flex: none; display: grid; place-items: center; width: 28px; height: 28px; color: #c7c9ce; font-size: 26px; line-height: 1; font-variant-emoji: text; }
.im-dock { flex: 0 1 auto; display: flex; flex-direction: column; min-height: 0; overflow: hidden; border-top: 1px solid #26292f; background: #0b0c10; }
.im-dock.hidden, .im-panel:not(.hidden) ~ .im-dock { display: none; }
.dock-bar { position: relative; display: flex; flex: none; align-items: center; gap: 10px; width: 100%; margin: 0; padding: 16px 14px 10px; border: 0; border-radius: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.dock-grip { position: absolute; top: 6px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 2px; background: #5b5f69; }
.dock-ico { flex: none; display: grid; place-items: center; width: 28px; height: 28px; font-size: 22px; line-height: 1; font-variant-emoji: text; }
.dock-title { flex: 1; min-width: 0; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.dock-chip { flex: none; max-width: 46%; overflow: hidden; padding: 4px 11px; border-radius: 999px; background: #232326; color: #c9ccd3; font-size: calc(13px * var(--ts, 1)); text-overflow: ellipsis; white-space: nowrap; }
.dock-chip.me { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.dock-chev { flex: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.im-dock.min .dock-chev { transform: rotate(180deg); }
.dock-body { display: flex; flex: 0 1 auto; flex-direction: column; align-items: center; gap: 8px; min-height: 0; overflow-y: auto; padding: 0 12px 12px; }
.im-dock.min .dock-body { display: none; }
.dock-status { margin: 0; text-align: center; font-weight: 600; line-height: 1.3; }
.dock-status.me { color: var(--accent-text); }
.dock-sub { margin: 0; color: var(--muted); font-size: calc(13px * var(--ts, 1)); text-align: center; }
.dock-actions, .dock-promo { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.dock-actions:empty { display: none; }
.dock-actions .button, .dock-promo .button { margin: 0; padding: 8px 16px; }

.gb { display: grid; flex: none; width: min(100%, 360px, 40vh); aspect-ratio: 1; overflow: hidden; border-radius: 8px; container-type: inline-size; touch-action: manipulation; }
.gb8 { grid-template: repeat(8, minmax(0, 1fr)) / repeat(8, minmax(0, 1fr)); }
.gb10 { grid-template: repeat(10, minmax(0, 1fr)) / repeat(10, minmax(0, 1fr)); }
.gc { position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.gc:disabled { cursor: default; opacity: 1; }
.gc:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; z-index: 1; }
.gc.sel { box-shadow: inset 0 0 0 .7cqw var(--accent); }
.gc.last::before { position: absolute; inset: 0; background: rgba(255, 221, 51, .38); content: ''; pointer-events: none; }
.gc.go::after { width: 30%; height: 30%; border-radius: 50%; background: rgba(0, 0, 0, .32); content: ''; pointer-events: none; }
.gc.cap::after { position: absolute; inset: 6%; border: .8cqw solid rgba(0, 0, 0, .38); border-radius: 50%; content: ''; pointer-events: none; }
.gc.check { background-image: radial-gradient(circle, rgba(235, 50, 50, .95), rgba(235, 50, 50, 0) 72%); }

/* Chess */
.gb-chess .light { background-color: #dcc9a0; }
.gb-chess .dark { background-color: #a67c52; }
.pc { position: relative; z-index: 1; font-family: 'Noto Sans Symbols 2', 'Segoe UI Symbol', 'DejaVu Sans', 'Arial Unicode MS', sans-serif; font-size: 10.4cqw; font-variant-emoji: text; line-height: 1; pointer-events: none; }
.pw { color: #fffdf6; -webkit-text-stroke: .35cqw #3a2a18; paint-order: stroke fill; }
.pb { color: #1c1a19; -webkit-text-stroke: .18cqw #d8ccb6; paint-order: stroke fill; }
.gc-pick { display: grid; width: 46px; height: 46px; margin: 0; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: #a67c52; cursor: pointer; container-type: inline-size; }
.gc-pick .pc { font-size: 62cqw; }

/* Checkers */
.gb-chk .light { background-color: #e3d2ae; }
.gb-chk .dark { background-color: #6a4228; }
.ck { position: relative; z-index: 1; display: grid; place-items: center; width: 78%; height: 78%; border-radius: 50%; box-shadow: inset 0 -.7cqw 0 rgba(0, 0, 0, .28), 0 .4cqw .8cqw rgba(0, 0, 0, .55); pointer-events: none; }
.ck-a { background: radial-gradient(circle at 36% 30%, #ff8a7a, #cc2f21 68%); }
.ck-b { background: radial-gradient(circle at 36% 30%, #6a6a6a, #151515 68%); }
.ck .crown { color: #ffd84a; font-family: 'Noto Sans Symbols 2', 'Segoe UI Symbol', 'DejaVu Sans', sans-serif; font-size: 6.4cqw; font-variant-emoji: text; line-height: 1; text-shadow: 0 0 .5cqw rgba(0, 0, 0, .8); }
.gb-chk .gc.can::after { position: absolute; inset: 4%; border: .6cqw solid rgba(255, 221, 51, .85); border-radius: 50%; background: none; content: ''; width: auto; height: auto; }
.gb-chk .gc.go::after { background: rgba(255, 221, 51, .75); }

/* Othello */
.oth { display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(100%, 380px, 44vh); }
.gb-oth { width: 100%; padding: 4.84% 5.51% 5.62% 5.07%; border-radius: 0; background: url(/othello/board.webp?v=1) center / 100% 100% no-repeat; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .6)); }
.gb-oth .gc { border-radius: 1cqw; }
.disc { position: relative; z-index: 1; width: 80%; height: 80%; border-radius: 50%; box-shadow: 0 .3cqw .7cqw rgba(0, 0, 0, .55); pointer-events: none; }
.d1 { background: radial-gradient(circle at 35% 30%, #5a5a5a, #0e0e0e 70%); }
.d2 { background: radial-gradient(circle at 35% 30%, #ffffff, #cfcfcf 70%); }
.gb-oth .disc { width: 86%; height: 86%; box-shadow: none; filter: drop-shadow(0 .5cqw .6cqw rgba(0, 0, 0, .6)); }
.gb-oth .disc.d1, .oth-disc.d1 { background: url(/othello/black.webp?v=1) center / contain no-repeat; }
.gb-oth .disc.d2, .oth-disc.d2 { background: url(/othello/white.webp?v=1) center / contain no-repeat; }
.gb-oth .gc.go::after { width: 28%; height: 28%; background: rgba(255, 255, 255, .28); box-shadow: 0 0 0 .3cqw rgba(0, 0, 0, .25); }
.gb-oth .gc.last::before { inset: 4%; border-radius: 1cqw; background: none; box-shadow: inset 0 0 0 .7cqw rgba(255, 214, 90, .75); }
.oth-bar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr); gap: 6px; width: 100%; padding: 6px; border: 1px solid #6b3e1f; border-radius: 12px; background: linear-gradient(#4a2814, #2c170b); box-shadow: inset 0 1px 0 rgba(255, 200, 140, .25), 0 3px 8px rgba(0, 0, 0, .5); }
.oth-side { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 8px; border: 1px solid rgba(0, 0, 0, .6); border-radius: 9px; background: linear-gradient(#1d1d1f, #111113); }
.oth-side.oth-b { flex-direction: row-reverse; }
.oth-side.now { border-color: #c9a24a; box-shadow: 0 0 0 1px rgba(201, 162, 74, .5); }
.oth-disc { flex: none; width: 30px; height: 30px; border-radius: 50%; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .7)); }
.oth-txt { display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 0; line-height: 1.1; }
.oth-name { max-width: 100%; overflow: hidden; color: #e9e3d6; font-size: calc(12px * var(--ts, 1)); text-overflow: ellipsis; white-space: nowrap; }
.oth-num { color: #fff; font-size: calc(20px * var(--ts, 1)); font-weight: 700; }
.oth-turn { display: flex; align-items: center; justify-content: center; gap: 7px; min-width: 0; padding: 6px 8px; border: 1px solid #2f6b3a; border-radius: 9px; background: linear-gradient(#173a20, #0d2414); color: #e6f2e6; font-weight: 600; }
.oth-turn.me { border-color: #4fd36a; box-shadow: 0 0 8px rgba(79, 211, 106, .45), inset 0 0 8px rgba(79, 211, 106, .2); }
.oth-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: #5d6a60; }
.oth-turn.me .oth-dot { background: #4fe36e; box-shadow: 0 0 6px #4fe36e; }
.oth-turn-txt { overflow: hidden; font-size: calc(14px * var(--ts, 1)); text-overflow: ellipsis; white-space: nowrap; }

/* Battleship */
.bs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 34%); gap: 10px; align-items: start; width: min(100%, 440px); }
.bs.bs-one { grid-template-columns: minmax(0, 1fr); width: min(100%, 360px, 40vh); }
.bs .gb { width: 100%; }
.bs-side { display: flex; flex-direction: column; gap: 6px; }
.gb-sea { background: #0f3053; }
.gb-sea .gc { border: .15cqw solid rgba(255, 255, 255, .14); background: #14406b; }
.gb-sea .gc.ship { background: #8996a8; }
.gb-sea .gc.m::after { width: 26%; height: 26%; border-radius: 50%; background: #f2f6ff; content: ''; }
.gb-sea .gc.h { background-image: radial-gradient(circle, #ff6a5c 0 36%, rgba(255, 106, 92, 0) 40%); }
.gb-sea .gc.ship.h { background-color: #6c4a4a; }
.gb-sea .gc.s { background: #7b1f24; background-image: radial-gradient(circle, #ff9a8f 0 24%, rgba(255, 154, 143, 0) 28%); }
.gb-sea .gc.sel { box-shadow: inset 0 0 0 .8cqw #ffd84a; }
.gb-sea .gc.last::before { background: rgba(255, 221, 51, .3); }
.gb-sea.mini .gc { pointer-events: none; }
.gb-sea.mini { width: 100%; border-radius: 4px; }
.ico-disc::before { width: .78em; height: .78em; border-radius: 50%; background: radial-gradient(circle at 36% 30%, #ff8a7a, #cc2f21 68%); box-shadow: inset 0 -.08em 0 rgba(0, 0, 0, .28); content: ''; }
.im-window:has(.im-dock:not(.hidden)) .im-log { min-height: 96px; }
.dock-confirm { display: flex; flex-direction: column; align-items: center; gap: 6px; width: min(100%, 360px); padding: 12px; border: 1px solid rgba(255, 122, 122, .45); border-radius: 12px; background: rgba(255, 122, 122, .08); text-align: center; }

/* Sending something shared from another app */
.im-share-text { margin: 0 12px 10px; padding: 8px 10px; max-height: 4.5em; overflow: hidden; border-radius: 10px; background: rgba(255, 255, 255, .07); color: #aeb2ba; font-size: calc(13px * var(--ts, 1)); word-break: break-all; }
.im-share-thumb { display: block; max-width: 100%; max-height: 180px; margin: 0 auto 10px; border-radius: 12px; object-fit: contain; }
.im-share-cancel { justify-content: center; color: #aeb2ba; }

.friend-key-for { max-width: 340px; margin: 0 auto 10px; text-align: left; }
.friend-key-for label { display: block; margin-bottom: 4px; font-weight: 600; }
.friend-key-for input { width: 100%; }
.key-urgent { margin: 4px auto 14px; max-width: 420px; padding: 8px 12px; border-radius: 10px; border: 1px solid #f0bf2e; background: rgba(240, 191, 46, .12); color: inherit; font-weight: 600; }
.friend-key-head { margin: 16px 0 6px; font-size: calc(16px * var(--ts, 1)); }
.open-key small { font-variant-numeric: tabular-nums; }

/* The gold key beside your name line on your own profile: the way to your Hello key */
.gold-key { display: inline-block; margin-left: 8px; font-size: 1.5em; line-height: 1; vertical-align: middle; text-decoration: none; filter: drop-shadow(0 0 5px rgba(255, 196, 0, .55)); }

/* Island Settlers */
/* Island Settlers takes as much of the screen as it needs (the chat above shrinks to a sliver); only when even
   the whole screen is not enough does the board area scroll. */
.cat-body { max-height: none; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.im-window:has(.im-dock:not(.hidden):not(.min) .cat-body) .im-log { min-height: 44px; }
.cat { display: flex; flex-direction: column; gap: 8px; }
.cat-svg { width: 100%; max-height: 42vh; height: auto; touch-action: manipulation; }
.cat-svg { border-radius: 14px; border: 2px solid #6b5630; box-shadow: 0 4px 14px rgba(0, 0, 0, .45); }
.cat-serif { font-family: Georgia, 'Times New Roman', serif; }
/* the players: a wooden board with a gold edge */
.cat .cat-players li { padding: 7px 10px; border: 1px solid #8a6a32; border-radius: 10px; background: #2a1c12 url('/catan/wood.webp') center / cover; color: #fff; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .5); }
.cat .cat-players li.on { border-color: #f0c860; box-shadow: 0 0 0 2px rgba(240, 200, 96, .45), inset 0 0 0 1px rgba(0, 0, 0, .5); }
.cat .cat-players li.cat-neutral { border: 0; background: none; box-shadow: none; color: inherit; }
.cat .cat-players { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; width: 100%; }
.cat .cat-players li { min-width: 0; flex-wrap: nowrap; }
.cat .cat-players li.cat-neutral { grid-column: 1 / -1; }
.cat .cat-players .cat-info { flex: 1; }
.cat .cat-players strong, .cat .cat-players .cat-info small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat .cat-players .cat-badge { margin-left: 4px; flex: none; font-size: 10px; padding: 1px 5px; }
.cat .cat-players strong { font-family: Georgia, 'Times New Roman', serif; font-size: calc(15px * var(--ts, 1)); }
.cat .cat-players .cat-info small { color: #e6dcc6; }
.cat .cat-dot { width: 18px; height: 18px; border: 2px solid #f0c860; box-shadow: 0 0 6px rgba(0, 0, 0, .6); }
.cat .cat-badge { background: #1a130b; border: 1px solid #b8923f; color: #f5d56a; }
/* your five resource cards */
.cat .cat-hand { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.cat-card { --c: #888; position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 2px solid var(--c); border-radius: 10px; background: #14110e; box-shadow: 0 2px 6px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .08); }
.cat-card-brick { --c: #d0603a; } .cat-card-lumber { --c: #3f9a4a; } .cat-card-wool { --c: #8ccf4a; } .cat-card-grain { --c: #e2b53a; } .cat-card-ore { --c: #9aa1ad; }
.cat-card-pic { display: block; width: 100%; height: 38px; object-fit: cover; }
.cat-card-foot { display: block; padding: 2px 2px 4px; color: #fff; font-family: Georgia, 'Times New Roman', serif; font-size: calc(12px * var(--ts, 1)); text-align: center; }
.cat-card-foot b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
/* how many you hold: a badge on the corner of the picture, so the name below has the whole width */
.cat-card-foot i { position: absolute; top: 3px; right: 3px; min-width: 22px; padding: 1px 5px; border-radius: 999px; border: 1px solid rgba(0, 0, 0, .55); background: var(--c); color: #111; font-style: normal; font-weight: 800; font-size: calc(13px * var(--ts, 1)); text-align: center; font-family: system-ui, sans-serif; box-shadow: 0 1px 4px rgba(0, 0, 0, .6); }
.cat-card.none { opacity: .6; }
.cat-card.none .cat-card-foot i { background: #3a3d44; color: #cfd3da; }
/* Dustlands: the same layout as above in rusted metal, with drawn supplies in place of painted cards */
.wl .wl-svg { border-color: #8a5a22; background: #14110e; }
.wl.cat .cat-players li { border-color: #8a5a22; background: #1d1915 url('/waste/bar.webp') center / cover; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .08); }
.wl.cat .cat-players li.on { border-color: #f0bf2e; box-shadow: 0 0 0 2px rgba(240, 191, 46, .4), inset 0 0 0 1px rgba(0, 0, 0, .6); }
.wl.cat .cat-players strong, .wl .cat-card-foot { font-family: inherit; }
.wl.cat .cat-dot { border-color: #f0bf2e; }
.wl.cat .cat-badge { font-size: 13px; padding: 0 5px; }
.wl-card { background: linear-gradient(180deg, #2c2520, #14110e); }
.wl-pic { display: block; height: 38px; line-height: 38px; text-align: center; font-size: 24px; background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--c) 38%, transparent), transparent 72%); }
.wl .wl-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.wl-storm { animation: wl-storm 2.4s ease-in-out infinite alternate; }
@keyframes wl-storm { from { opacity: .82; } to { opacity: 1; } }
.wl-salvage { display: flex; flex-wrap: wrap; gap: 8px; }
.wl-sal { display: flex; flex-direction: column; align-items: center; width: 62px; text-align: center; font-size: calc(11px * var(--ts, 1)); line-height: 1.2; }
.wl-sal small { color: #aeb2ba; }
.wl-sal-pic { display: block; width: 44px; height: 62px; border-radius: 6px; object-fit: cover; box-shadow: 0 2px 5px rgba(0, 0, 0, .55); }
.wl-mark-pic { flex: none; width: 34px; height: 38px; object-fit: cover; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.wl.cat .wl-badge { display: inline-flex; gap: 2px; padding: 1px 3px; }
/* Hello Town: the six-sided board in the chat, and the words and buttons over the street in first person */
.tw .tw-svg { max-height: 48vh; border-color: #3a4a5c; }
.tw.cat .cat-players li { border-color: #3a4a5c; background: linear-gradient(180deg, #25303a, #171d24); flex-wrap: wrap; row-gap: 3px; }
.tw.cat .cat-players li.on { border-color: #f0bf2e; }
.tw.cat .cat-players strong { font-family: inherit; }
.tw.cat .cat-players .cat-info { flex: 1 1 60%; }
.tw.cat .cat-players .cat-badge { margin-left: 0; font-size: 10.5px; }
.tw-stop { cursor: pointer; }
.tw-views { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tw-views .button { padding: 9px 8px; }
.tw-boardwrap { position: relative; }
.tw-boardwrap .tw-svg { display: block; user-select: none; -webkit-user-select: none; }
.tw-zoom { position: absolute; right: 8px; bottom: 8px; display: flex; flex-direction: column; gap: 5px; }
.tw-zoom-btn { width: 36px; height: 36px; border: 1px solid #48515c; border-radius: 10px; background: rgba(14, 17, 20, .82); color: #fff; font: 700 19px system-ui, sans-serif; line-height: 1; cursor: pointer; }
.tw-mine { display: flex; flex-wrap: wrap; gap: 6px; }
.tw-chip { padding: 4px 9px; border-left: 5px solid var(--c); border-radius: 8px; background: rgba(255, 255, 255, .07); font-size: calc(12px * var(--ts, 1)); }
.tw .cat-actions .button { padding: 9px 12px; }
.tw-walk .wl-walk-btn { z-index: 2; }
.tw-stats { position: absolute; top: calc(54px + env(safe-area-inset-top, 0px)); left: 8px; right: 8px; display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; pointer-events: none; }
.tw-stat { padding: 4px 9px; border-radius: 999px; background: rgba(14, 17, 20, .78); color: #fff; font: 700 12.5px system-ui, sans-serif; }
.tw-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 46%; overflow-y: auto; padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(180deg, rgba(14, 17, 20, 0), rgba(14, 17, 20, .86) 22%); color: #fff; font: 14px system-ui, sans-serif; }
.tw-status { margin: 14px 0 4px; font-weight: 800; font-size: 15px; text-shadow: 0 1px 3px #000; }
.tw-lines { list-style: none; margin: 0 0 8px; padding: 0; color: #d6dae0; font-size: 12.5px; text-shadow: 0 1px 2px #000; }
.tw-buttons { display: flex; flex-wrap: wrap; gap: 7px; }
.tw-buttons .button { padding: 10px 13px; font-size: 14px; }

/* Dustlands on foot: the 3D walk-around view, over the whole screen */
.wl-walk-open { align-self: center; padding: 7px 14px; }
.wl-walk { position: fixed; inset: 0; z-index: 4000; background: #0d0a08; touch-action: none; user-select: none; -webkit-user-select: none; }
.wl-walk-canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.wl-walk-btn { position: absolute; top: calc(10px + env(safe-area-inset-top, 0px)); padding: 9px 13px; border: 1px solid #c98a2b; border-radius: 999px; background: rgba(20, 16, 12, .82); color: #f3dfae; font: inherit; font-weight: 700; font-size: 14px; }
.wl-walk-close { left: 10px; }
.wl-walk-up { right: 10px; }
.wl-walk-hint { position: absolute; left: 0; right: 0; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); margin: 0; padding: 0 16px; color: #f3dfae; text-align: center; font-size: 14px; text-shadow: 0 1px 3px #000; pointer-events: none; transition: opacity .6s; }
.wl-walk-hint.gone { opacity: 0; }
.wl-walk-stick { position: absolute; width: 100px; height: 100px; border-radius: 50%; border: 2px solid rgba(243, 223, 174, .45); background: rgba(20, 16, 12, .3); pointer-events: none; opacity: 0; }
.wl-walk-stick.on { opacity: 1; }
.wl-walk-knob { position: absolute; left: 30px; top: 30px; width: 40px; height: 40px; border-radius: 50%; background: rgba(243, 223, 174, .7); }
.wl-mask-pic { display: block; width: 18px; height: 18px; }
.wl.cat .cat-players li { flex-wrap: wrap; row-gap: 3px; }
.wl.cat .cat-players .cat-info { flex: 1 1 60%; }
.wl.cat .cat-players .cat-badge { margin-left: 0; }
.wl-got { flex-direction: row; align-items: center; gap: 10px; }
.wl-got .wl-sal-pic { flex: none; }
.wl-badge .wl-mark-pic { width: 18px; height: 20px; }
.wl-mark .wl-sal-pic { flex: none; width: 32px; height: 45px; }
.wl-mark .wl-mark-text { flex: 1; }
.wl-mark { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wl-mark-text { display: flex; flex-direction: column; min-width: 0; }
.wl-mark-text small { color: #aeb2ba; font-size: calc(12px * var(--ts, 1)); }
.wl-mark .button { flex: none; padding: 6px 12px; }
.wl-cost { font-size: 15px; letter-spacing: 1px; }
.wl .cat-actions .button { padding: 8px 10px; }
.cat-hot { cursor: pointer; animation: cat-glow 1.2s ease-in-out infinite alternate; }
@keyframes cat-glow { from { opacity: .55; } to { opacity: 1; } }
.cat-players { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.cat-players li { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 10px; background: rgba(255, 255, 255, .06); flex-wrap: wrap; }
.cat-players li.on { background: rgba(120, 160, 255, .22); }
.cat-players li.cat-neutral { background: none; padding: 0 4px; }
.cat-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .8); flex: none; }
.cat-info { display: flex; flex-direction: column; min-width: 0; }
.cat-info small, .cat-hint, .cat-dice, .cat-dev { color: #aeb2ba; font-size: calc(12px * var(--ts, 1)); margin: 0; }
.cat-badge { margin-left: auto; padding: 2px 7px; border-radius: 999px; background: #3a3320; color: #f5d56a; font-size: 11px; }
.cat-log { list-style: none; margin: 0; padding: 0; color: #c7cad1; font-size: calc(12px * var(--ts, 1)); }
.cat-hand { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border: 2px solid var(--c); border-radius: 10px; background: rgba(255, 255, 255, .06); color: inherit; font: inherit; font-size: calc(13px * var(--ts, 1)); }
.cat-chip b { font-weight: 600; }
.cat-chip i { font-style: normal; padding: 0 6px; border-radius: 8px; background: var(--c); color: #111; font-weight: 700; }
button.cat-chip { cursor: pointer; }
.cat-chip.on { background: var(--c); color: #111; }
.cat-chip.on i { background: #111; color: #fff; }
.cat-area { display: flex; flex-direction: column; gap: 8px; }
.cat-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-actions .button { padding: 8px 12px; }
.cat-box, .cat-offer { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, .06); }
.cat-offer { background: rgba(120, 160, 255, .2); }
.cat-sub { margin-top: 6px; }
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cat-step { display: flex; align-items: center; gap: 6px; margin: 3px 0; }
.cat-step .button { padding: 2px 10px; min-width: 32px; }
.cat-n { min-width: 18px; text-align: center; font-weight: 700; }
.ico-hex { font-size: 24px; }
.game-ico.sel { outline: 2px solid #7aa2ff; border-radius: 8px; }
.cat-body { overflow-x: hidden; }
.cat-grid > div { min-width: 0; }
.cat-step { gap: 4px; }
.cat-step .cat-chip { padding: 3px 6px; font-size: calc(12px * var(--ts, 1)); }
.cat-step .button { padding: 2px 6px; min-width: 26px; }

/* Several photos sent together: a fanned stack of cards to swipe through */
.im-row .im-msg.im-album-msg, .im-msg.im-album-msg { display: block; width: min(330px, 80vw); max-width: min(330px, 80vw); padding: 0; border: 0; background: none; box-shadow: none; }
.im-album-wrap { position: relative; }
.im-album { display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; padding: 10px 34% 16px 4px; scrollbar-width: none; overscroll-behavior-x: contain; }
.im-album::-webkit-scrollbar { display: none; }
.im-album-card { position: relative; flex: none; width: 66%; aspect-ratio: 4 / 5; margin-right: -24%; scroll-snap-align: start; overflow: hidden; border: 2px solid rgba(255, 255, 255, .8); border-radius: 18px; background: #1c1c1e; box-shadow: 0 8px 22px rgba(0, 0, 0, .5); transform-origin: left center; }
.im-album-img { display: block; width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.im-album-gone { display: grid; height: 100%; place-items: center; padding: 10px; color: var(--muted); font-size: calc(13px * var(--ts, 1)); text-align: center; }
.im-album-badge { position: absolute; z-index: 200; left: 14px; bottom: 28px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; font-size: calc(13px * var(--ts, 1)); font-weight: 600; pointer-events: none; backdrop-filter: blur(6px); }
.im-album-badge svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.im-row .im-msg.im-album-msg .im-caption, .im-msg.im-album-msg .im-caption { display: block; width: fit-content; max-width: 100%; margin: 0 4px; padding: 8px 14px; border-radius: 18px; background: var(--raised, #26272b); }
.im-row .im-msg.im-album-msg.mine .im-caption { margin-left: auto; background: var(--accent); color: var(--on-accent); }

/* ---- The extra games (games-pack-ui.js) ---- */
.pk-col { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.pk-grid { gap: .4cqw; padding: .4cqw; background: #2a2c33; }
.pk-grid .gc { background: #3a3d46; border-radius: .8cqw; }
.pk-grid .gc.win { background: #5b5320; }
.disc.d1 { background: radial-gradient(circle at 35% 30%, #ff6b6b, #c81e1e); }
.disc.d2 { background: radial-gradient(circle at 35% 30%, #ffe27a, #e0a800); }
.disc.ghost { opacity: .45; }
.pk-c4 { width: min(100%, 380px, 46vh); background: #1f4fbf; }
.pk-c4 .gc { background: #0d1530; border-radius: 50%; }
.pk-c4 .gc.win { background: #3b3a12; }
.pk-ttt { width: min(100%, 260px); }
.pk-xo { font-size: 60cqw; font-weight: 800; line-height: 1; }
.pk-ttt .gc:nth-child(odd) .pk-xo { color: inherit; }
.pk-xo { color: #ff7a7a; }
.pk-ttt .pk-xo:not(.ghost) { text-shadow: 0 1px 0 rgba(0, 0, 0, .4); }
.pk-gomoku { width: min(100%, 400px, 48vh); gap: 0; padding: 0; background: #d9b26a; }
.pk-gomoku .gc { border-radius: 0; background: linear-gradient(#7a5a28, #7a5a28) center / 1px 100% no-repeat, linear-gradient(#7a5a28, #7a5a28) center / 100% 1px no-repeat; }
.pk-gomoku .disc.d1 { background: radial-gradient(circle at 35% 30%, #555, #0b0b0b); }
.pk-gomoku .disc.d2 { background: radial-gradient(circle at 35% 30%, #fff, #c9c9c9); }
.pk-gomoku .gc.win { background-color: rgba(255, 221, 51, .45); }
.pk-twist { width: min(100%, 340px, 44vh); background: #6b1d1d; gap: .5cqw; }
.pk-twist .gc { background: #8f2a2a; border-radius: 50%; }
.pk-twist .gc.q1, .pk-twist .gc.q2 { background: #7c2222; }
.pk-twist .disc.d1 { background: radial-gradient(circle at 35% 30%, #555, #0b0b0b); }
.pk-twist .disc.d2 { background: radial-gradient(circle at 35% 30%, #fff, #c9c9c9); }
.pk-twist .gc.win { background: #b8901e; }
.pk-turns { display: grid; grid-template-columns: repeat(2, auto); gap: 8px 14px; }
.pk-turn { display: flex; align-items: center; gap: 6px; }
.pk-turn small { min-width: 78px; color: var(--muted); }
.pk-turn .button { margin: 0; padding: 6px 14px; font-size: 18px; }
/* Mancala */
.pk-man { display: flex; align-items: stretch; gap: 6px; width: min(100%, 420px); padding: 8px; border-radius: 18px; background: #6b4423; }
.pk-man-mid { display: flex; flex: 1; flex-direction: column; gap: 6px; }
.pk-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.pk-pit { aspect-ratio: 1; border-radius: 50%; background: #3e2512; box-shadow: inset 0 3px 6px rgba(0, 0, 0, .5); color: #f3e2c4; }
.pk-pit.go { box-shadow: inset 0 3px 6px rgba(0, 0, 0, .5), 0 0 0 2px #ffd84a; }
.pk-pit.last::before { border-radius: 50%; }
.pk-seeds { font-size: calc(17px * var(--ts, 1)); font-weight: 700; }
.pk-store { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 15%; border-radius: 40px; background: #3e2512; box-shadow: inset 0 3px 6px rgba(0, 0, 0, .5); color: #f3e2c4; }
.pk-store b { font-size: calc(22px * var(--ts, 1)); }
.pk-store small { font-size: 11px; opacity: .8; }
/* Nine Men's Morris */
.pk-morris { position: relative; width: min(100%, 340px, 44vh); aspect-ratio: 1; border-radius: 10px; background: #d9b26a; }
.pk-morris svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: #5b3d16; stroke-width: .06; }
.pk-pt { position: absolute; width: 11%; height: 11%; transform: translate(-50%, -50%); border-radius: 50%; }
.pk-pt::after { width: 34%; height: 34%; border-radius: 50%; background: #5b3d16; content: ''; }
.pk-pt.has::after { width: 86%; height: 86%; box-shadow: 0 2px 4px rgba(0, 0, 0, .5); }
.pk-pt.p1::after { background: radial-gradient(circle at 35% 30%, #fff, #cfcfcf); }
.pk-pt.p2::after { background: radial-gradient(circle at 35% 30%, #555, #0b0b0b); }
.pk-pt.go:not(.has)::after { background: #2f8f4e; width: 44%; height: 44%; }
.pk-pt.take::after { outline: 3px solid #ff5a4f; outline-offset: 1px; }
.pk-pt.sel::after { outline: 3px solid #ffd84a; outline-offset: 1px; }
.pk-pt.last::before { border-radius: 50%; }
/* Dots and Boxes */
.pk-dots { display: grid; width: min(100%, 340px, 44vh); aspect-ratio: 1; padding: 6px; border-radius: 10px; background: #f4f0e6; }
.pk-dot { border-radius: 50%; background: #222; }
.pk-box { border-radius: 2px; }
.pk-line { border-radius: 0; background: transparent; }
.pk-line.h::after, .pk-line.v::after { position: absolute; background: rgba(0, 0, 0, .08); content: ''; }
.pk-line.h::after { left: 0; right: 0; top: 30%; bottom: 30%; }
.pk-line.v::after { top: 0; bottom: 0; left: 30%; right: 30%; }
.pk-line.on::after { background: var(--lc, #333); }
.pk-line.last.on::after { box-shadow: 0 0 0 2px rgba(255, 216, 74, .9); }
.pk-line:not(.on):hover::after { background: rgba(0, 0, 0, .25); }
/* Scores, dice and cards */
.pk-scores { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pk-score { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-left: 4px solid var(--pc, var(--accent)); border-radius: 999px; font-size: calc(13px * var(--ts, 1)); }
.pk-score.now { background: var(--accent-soft); border-color: var(--accent-line); border-left-color: var(--pc, var(--accent)); }
.pk-score.out { opacity: .45; }
.pk-dice { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pk-die { display: inline-grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); width: 40px; height: 40px; padding: 5px; border-radius: 9px; background: #f7f7f7; box-shadow: 0 2px 4px rgba(0, 0, 0, .4); }
.pk-die i { place-self: center; width: 7px; height: 7px; border-radius: 50%; }
.pk-die i.on { background: #222; }
.pk-dice.small .pk-die { width: 28px; height: 28px; padding: 3px; }
.pk-dice.small .pk-die i { width: 5px; height: 5px; }
.pk-die.kept { opacity: .7; }
.pk-face { margin: 0; padding: 3px; border: 2px solid transparent; border-radius: 12px; background: none; cursor: pointer; }
.pk-face.on { border-color: #ffd84a; background: rgba(255, 216, 74, .15); }
.pk-faces .pk-die { width: 30px; height: 30px; padding: 3px; }
.pk-faces .pk-die i { width: 5px; height: 5px; }
.pk-bid { margin: 0; font-weight: 700; }
.pk-bidrow { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pk-step { display: flex; align-items: center; gap: 12px; }
.pk-step .button { margin: 0; padding: 4px 14px; font-size: 18px; }
.pk-step b { min-width: 28px; font-size: 20px; text-align: center; }
.pk-faces { display: flex; gap: 4px; }
.pk-sheet { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; width: min(100%, 420px); }
.pk-cat { display: flex; justify-content: space-between; margin: 0; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--raised); color: var(--text); font: inherit; font-size: calc(13px * var(--ts, 1)); text-align: left; }
.pk-cat.used { opacity: .6; }
.pk-cat.go { border-color: var(--accent-line); cursor: pointer; }
.pk-cat.go b { color: var(--accent-text); }
.pk-cat:disabled { cursor: default; }

/* ---- Board games pack 2 ---- */
.pk-peg { display: grid; width: 78%; height: 78%; place-items: center; border-radius: 50%; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--pc) 70%, #fff), var(--pc)); box-shadow: 0 1px 3px rgba(0, 0, 0, .5); color: #fff; font-size: 11px; font-weight: 800; text-shadow: 0 1px 1px rgba(0, 0, 0, .6); pointer-events: none; }
/* Backgammon */
.pk-bg { display: flex; flex-direction: column; justify-content: space-between; width: min(100%, 420px); aspect-ratio: 1.15; padding: 6px; gap: 10%; border: 6px solid #5a3a1c; border-radius: 10px; background: #2f6b46; }
.pk-bg-row { display: flex; flex: 1; gap: 1px; }
.pk-bg-bar { flex: none; width: 6%; background: #5a3a1c; }
.pk-pt-bg { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 1px; padding: 2px 0; border-radius: 0; background: none; }
.pk-pt-bg::before { position: absolute; inset: 0; clip-path: polygon(0 0, 100% 0, 50% 100%); background: #e7d3a7; content: ""; }
.pk-pt-bg.odd::before { background: #9b4a2c; }
.pk-pt-bg.up { justify-content: flex-end; }
.pk-pt-bg.up::before { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.pk-pt-bg.can::before { filter: brightness(1.25); }
.pk-pt-bg.sel::before { background: #ffd84a; }
.pk-pt-bg.go::after { position: absolute; left: 30%; right: 30%; bottom: 40%; aspect-ratio: 1; border-radius: 50%; background: rgba(255, 216, 74, .9); content: ""; }
.pk-pt-bg.up.go::after { top: 40%; bottom: auto; }
.pk-ck { position: relative; display: grid; width: 82%; aspect-ratio: 1; place-items: center; border-radius: 50%; font-size: 10px; font-weight: 800; }
.pk-ck.c0 { background: radial-gradient(circle at 35% 30%, #fff, #d8d2c2); color: #333; }
.pk-ck.c1 { background: radial-gradient(circle at 35% 30%, #7a5a3a, #2d1c0e); color: #fff; }
/* Go */
.pk-go { width: min(100%, 360px, 44vh); }
/* Hex boards */
.pk-hexboard { position: relative; max-width: 100%; }
.pk-hexboard > .gc { position: absolute; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; }
.pk-cc { border-radius: 12px; background: #c99a5b; }
.pk-hole { background: var(--tip, transparent); }
.pk-hole::before { position: absolute; inset: 22%; border-radius: 50%; background: rgba(0, 0, 0, .35); content: ""; }
.pk-hole.has::before { display: none; }
.pk-hole .pk-peg { width: 90%; height: 90%; font-size: 0; }
.pk-hole.go::after { width: 46%; height: 46%; border-radius: 50%; background: rgba(255, 255, 255, .85); content: ""; }
.pk-hole.sel { box-shadow: 0 0 0 2px #ffd84a; }
.pk-hole.last { box-shadow: 0 0 0 2px rgba(255, 216, 74, .6); }
.pk-ab { border-radius: 18px; background: #3b4252; }
.pk-hole.ab::before { inset: 8%; background: #262b36; }
.pk-marble { position: relative; z-index: 1; width: 88%; height: 88%; border-radius: 50%; box-shadow: 0 2px 4px rgba(0, 0, 0, .6); pointer-events: none; }
.pk-marble.m1 { background: radial-gradient(circle at 35% 30%, #666, #0a0a0a); }
.pk-marble.m2 { background: radial-gradient(circle at 35% 30%, #fff, #cfcfcf); }
.pk-arrows { display: grid; grid-template-columns: repeat(6, auto); gap: 6px; }
.pk-arrows .button { margin: 0; padding: 6px 12px; font-size: 18px; }
/* Hive */
.pk-hive { min-height: 160px; }
.pk-hex { clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); border-radius: 0 !important; background: rgba(255, 255, 255, .06); container-type: inline-size; }
.pk-hex.o0 { background: #f1ead8; }
.pk-hex.o1 { background: #2b2b2b; }
.pk-hex.go { background: rgba(80, 200, 120, .55); }
.pk-hex.sel { background: #ffd84a; }
.pk-hex.last.o0, .pk-hex.last.o1 { filter: drop-shadow(0 0 3px #ffd84a); }
.pk-bug { font-size: 20px; line-height: 1; pointer-events: none; }
.pk-hex .pk-bug { font-size: 56cqw; }
.pk-stack { position: absolute; right: 18%; bottom: 14%; color: #d33; font-size: 9px; font-weight: 800; }
.pk-hand { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pk-bugbtn { display: flex; align-items: center; gap: 4px; margin: 0; padding: 4px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--raised); color: var(--text); cursor: pointer; }
.pk-bugbtn .pk-bug { font-size: 20px; }
.pk-bugbtn.on { border-color: #ffd84a; background: rgba(255, 216, 74, .15); }
.pk-bugbtn:disabled { opacity: .4; cursor: default; }
/* Race games */
.pk-race { position: relative; width: min(100%, 340px, 44vh); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, #24262e 0 55%, #1b1d23 56%); }
.pk-sq { position: absolute; display: grid; width: 7.4%; aspect-ratio: 1; place-items: center; transform: translate(-50%, -50%); border: 2px solid rgba(255, 255, 255, .25); border-radius: 50%; background: #2e3139; }
.pk-sq.safe { background: #3c4a3a; }
.pk-sq.lane { width: 6.4%; background: transparent; }
.pk-sq .pk-peg { width: 115%; height: 115%; font-size: 9px; }
.pk-race-mid { position: absolute; inset: 34%; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; }
.pk-card-big { display: grid; width: 56px; height: 76px; place-items: center; border-radius: 8px; background: #f7f3ea; color: #b11d1d; font-size: 22px; font-weight: 800; }
.pk-opts .button { font-size: calc(13px * var(--ts, 1)); }
/* Quoridor */
.pk-quor { position: relative; width: min(100%, 340px, 44vh); gap: 3px; padding: 3px; overflow: visible; background: #4a2f1a; }
.pk-quor .gc { border-radius: 3px; background: #c48b55; }
.pk-quor .gc.goal0 { box-shadow: inset 0 -3px 0 #e5484d; }
.pk-quor .gc.goal1 { box-shadow: inset 0 3px 0 #3e8bff; }
.pk-wall { position: absolute; z-index: 2; background: #f5e6c4; border-radius: 3px; pointer-events: none; box-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.pk-wall.h { width: calc(200% / 9); height: 5px; transform: translateY(-50%); }
.pk-wall.v { width: 5px; height: calc(200% / 9); transform: translateX(-50%); }
.pk-wall.ghost { background: #ffd84a; opacity: .85; }
.pk-wall.bad { background: #ff5a4f; opacity: .7; }
/* Santorini */
.pk-santo { width: min(100%, 320px, 42vh); gap: 4px; padding: 4px; background: #3d7d4a; }
.pk-santo .gc { border-radius: 6px; background: #8ccf8f; }
.pk-santo .gc.lv1 { background: #e9e4d4; box-shadow: inset 0 0 0 4px #cfc8b2; }
.pk-santo .gc.lv2 { background: #f4f0e4; box-shadow: inset 0 0 0 4px #cfc8b2, inset 0 0 0 9px #e2dcc8; }
.pk-santo .gc.lv3 { background: #fff; box-shadow: inset 0 0 0 4px #cfc8b2, inset 0 0 0 9px #e2dcc8, inset 0 0 0 14px #ece7d6; }
.pk-santo .gc.lv4 { background: #2f5fb3; }
.pk-lv { position: absolute; top: 3px; left: 5px; color: #555; font-size: 11px; font-weight: 800; }
.pk-santo .gc.lv4 .pk-lv { color: #fff; }
/* Corner Blocks */
.pk-blocks { width: min(100%, 380px, 46vh); gap: 1px; padding: 1px; background: #c9ccd3; }
.pk-blocks .gc { border-radius: 1px; background: #eef0f4; }
.pk-blocks .gc.ghost { background: rgba(48, 164, 108, .65) !important; }
.pk-blocks .gc.bad { background: rgba(229, 72, 77, .55) !important; }
.pk-tray { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; width: min(100%, 420px); }
.pk-piece { margin: 0; padding: 4px; border: 2px solid transparent; border-radius: 8px; background: var(--raised); cursor: pointer; }
.pk-piece.on { border-color: #ffd84a; }
.pk-piece-grid { display: grid; gap: 1px; }
.pk-piece-grid i.on { border-radius: 1px; }
/* Code Breaker */
.pk-coderow { display: flex; align-items: center; justify-content: center; gap: 6px; }
.pk-code { display: inline-block; width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 -2px 3px rgba(0, 0, 0, .35); }
.pk-code.empty { border: 2px dashed var(--line); box-shadow: none; }
.pk-slot { margin: 0; padding: 3px; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.pk-slot .pk-code { width: 30px; height: 30px; }
.pk-keys { display: grid; grid-template: repeat(2, 7px) / repeat(2, 7px); gap: 2px; margin-left: 6px; }
.pk-keys i { border-radius: 50%; background: rgba(255, 255, 255, .12); }
.pk-keys i.b { background: #111; box-shadow: 0 0 0 1px #888; }
.pk-keys i.w { background: #fff; }
.pk-codeboards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: min(100%, 420px); }
.pk-codeboards .pk-col { gap: 4px; }
.pk-codeboards .pk-code { width: 16px; height: 16px; }
.pk-code { box-sizing: border-box; flex: none; aspect-ratio: 1; } .pk-slot { display: grid; place-items: center; line-height: 0; }

/* ---- Card games pack ---- */
.pk-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: 100%; }
.pk-cards.hand { gap: 3px; padding-top: 8px; }
.pk-pc { position: relative; display: inline-flex; flex: none; flex-direction: column; align-items: center; justify-content: center; width: 38px; height: 54px; margin: 0; padding: 0; border: 1px solid #c8c3b8; border-radius: 6px; background: #fbf9f4; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); color: #1d1d1f; font: inherit; line-height: 1; cursor: default; transition: transform .1s; }
button.pk-pc { cursor: pointer; }
.pk-pc b { font-size: 15px; font-weight: 800; }
.pk-pc i { font-size: 17px; font-style: normal; }
.pk-pc.red { color: #c81e1e; }
.pk-pc.back { background: repeating-linear-gradient(45deg, #3e5fb3 0 4px, #2e4a94 4px 8px); border-color: #24397a; }
.pk-pc.ghost { background: rgba(255, 255, 255, .06); border: 1px dashed rgba(255, 255, 255, .25); box-shadow: none; }
.pk-pc.up, .pk-uc.up, .pk-sc.up, .pk-tc.up { transform: translateY(-8px); box-shadow: 0 0 0 2px #ffd84a, 0 4px 8px rgba(0, 0, 0, .4); }
.pk-pc.dim, .pk-uc.dim, .pk-tc.dim { opacity: .45; }
.pk-cards.small .pk-pc { width: 28px; height: 40px; }
.pk-cards.small .pk-pc b { font-size: 11px; }
.pk-cards.small .pk-pc i { font-size: 12px; }
.pk-trick { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; min-height: 70px; padding: 6px 10px; border-radius: 14px; background: #1f5a3a; }
.pk-trick-card { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pk-trick-card small { color: #e6f2ea; font-size: 11px; }
.pk-pile { display: flex; align-items: center; justify-content: center; gap: 8px; }
.pk-pile small { color: var(--muted); }
.pk-melds { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; width: 100%; }
.pk-meld { display: flex; flex-wrap: wrap; gap: 2px; margin: 0; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--raised); cursor: pointer; }
/* Color Clash */
.pk-uc { position: relative; display: inline-grid; flex: none; width: 40px; height: 58px; margin: 0; padding: 0; place-items: center; border: 3px solid #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); color: #fff; font: inherit; cursor: pointer; transition: transform .1s; }
.pk-uc b { font-size: 18px; font-weight: 900; text-shadow: 0 1px 2px rgba(0, 0, 0, .55); }
.pk-uc.big { width: 54px; height: 78px; }
.pk-uc.big b { font-size: 24px; }
.pk-uc.back { background: #1d1d1f; border-color: #e5484d; }
.pk-colordot { width: 16px; height: 16px; border-radius: 50%; box-shadow: 0 0 0 2px #fff; }
/* Stack Up */
.pk-scrow { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pk-sc { position: relative; display: inline-flex; flex: none; flex-direction: column; align-items: center; justify-content: center; width: 44px; height: 60px; margin: 0; padding: 0; border: 1px solid #c8c3b8; border-radius: 8px; background: #fbf9f4; color: #1a4fbf; font: inherit; font-size: 20px; font-weight: 900; cursor: pointer; transition: transform .1s; }
.pk-sc.wild { background: linear-gradient(135deg, #ffd84a, #ff7a59); color: #fff; }
.pk-sc small { position: absolute; bottom: 2px; color: #777; font-size: 9px; font-weight: 600; }
.pk-sc.build { background: #2b3550; color: #fff; border-color: #3e4a6a; }
.pk-sc.build small { color: #c7cfe6; }
.pk-sc.stock { box-shadow: 0 0 0 2px #30a46c; }
.pk-sc.tiny { width: 26px; height: 34px; font-size: 13px; }
.pk-others { display: flex; flex-direction: column; gap: 4px; width: min(100%, 420px); }
.pk-other { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 10px; font-size: calc(13px * var(--ts, 1)); }
.pk-other.now { border-color: var(--accent-line); background: var(--accent-soft); }
.pk-other b { min-width: 60px; }
/* Ten Phases and Crew cards */
.pk-tc { position: relative; display: inline-grid; flex: none; width: 36px; height: 52px; margin: 0; padding: 0; place-items: center; border: 2px solid #fff; border-radius: 7px; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); color: #fff; font: inherit; font-size: 16px; font-weight: 900; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); cursor: pointer; transition: transform .1s; }
.pk-tc.tiny { width: 24px; height: 34px; font-size: 11px; }
.pk-tc.back { background: #444 !important; }
/* Solitaire */
.pk-sol { max-width: 420px; }
.pk-sol-top, .pk-sol-tab { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; width: min(100%, 400px); }
.pk-sol-gap { display: block; }
.pk-sol .pk-pc { width: 100%; height: auto; aspect-ratio: 5 / 7; }
.pk-sol-col { display: flex; flex-direction: column; }
.pk-sol-col .pk-pc.stacked:not(:first-child) { margin-top: -78%; }
.pk-sol-col .pk-pc.stacked { align-items: flex-start; justify-content: flex-start; padding: 2px 3px; flex-direction: row; gap: 1px; }
.pk-sol-col .pk-pc.stacked b { font-size: 12px; }
.pk-sol-col .pk-pc.stacked i { font-size: 12px; }
.pk-pc.slot { cursor: pointer; }
/* Court Intrigue */
.pk-coins { color: #f5c542; font-weight: 700; }
.pk-role { padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.pk-role.mine { background: var(--accent-soft); border: 1px solid var(--accent-line); }
.pk-role.hidden { background: #3a3d46; }
.pk-role.dead { background: #2a2c33; color: var(--muted); text-decoration: line-through; }

/* ---- Big games pack ---- */
.pk-scroll { max-width: 100%; max-height: 46vh; overflow: auto; border-radius: 10px; }
/* Word Tiles */
.pk-wt { width: min(100%, 420px, 52vh); gap: 1px; padding: 1px; background: #a89f86; }
.pk-wt .gc { border-radius: 1px; background: #e9e1c8; color: #2a241a; container-type: inline-size; }
.pk-wt .gc.b-W3 { background: #e0675a; }
.pk-wt .gc.b-W2 { background: #f0a8a0; }
.pk-wt .gc.b-L3 { background: #4f8fd6; }
.pk-wt .gc.b-L2 { background: #a9cdef; }
.pk-wt .gc small.bonus { color: rgba(0, 0, 0, .55); font-size: 30cqw; font-weight: 700; }
.pk-wt .gc.has, .pk-wt .gc.new { background: #f6d58e; box-shadow: inset 0 -2px 0 #c9a24d; }
.pk-wt .gc.new { background: #ffe9a8; outline: 2px solid #ffd84a; outline-offset: -2px; }
.pk-wt .gc b { font-size: 60cqw; line-height: 1; }
.pk-wt .gc small { position: absolute; right: 6%; bottom: 2%; font-size: 26cqw; }
.pk-rack { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.pk-wtile { position: relative; display: grid; width: 38px; height: 40px; margin: 0; padding: 0; place-items: center; border: 0; border-radius: 6px; background: #f6d58e; box-shadow: inset 0 -3px 0 #c9a24d; color: #2a241a; font: inherit; cursor: pointer; transition: transform .1s; }
.pk-wtile b { font-size: 20px; }
.pk-wtile small { position: absolute; right: 3px; bottom: 2px; font-size: 9px; }
.pk-wtile.up, .pk-sm.up, .pk-mz.up { transform: translateY(-6px); box-shadow: 0 0 0 2px #ffd84a; }
.pk-wtile.used, .pk-sm.used { opacity: .3; }
.pk-letters { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.pk-letters .button { margin: 0; padding: 4px; }
/* Shape Match */
.pk-sm { display: inline-grid; width: 34px; height: 34px; margin: 0; padding: 0; place-items: center; border: 0; border-radius: 6px; background: #15161b; font: inherit; font-size: 20px; line-height: 1; cursor: pointer; transition: transform .1s; }
.pk-smboard { display: grid; gap: 1px; width: max-content; padding: 4px; background: #2a2c33; }
.pk-smcell { border-radius: 4px; background: #33363f; }
.pk-smcell .pk-sm { width: 100%; height: 100%; font-size: 16px; }
.pk-smcell.new { outline: 2px solid #ffd84a; }
/* Tile Mosaic */
.pk-mz { display: inline-block; flex: none; width: 22px; height: 22px; margin: 0; padding: 0; border: 1px solid rgba(255, 255, 255, .25); border-radius: 4px; background: transparent; cursor: pointer; transition: transform .1s; }
.pk-mz.slot { width: 18px; height: 18px; background: rgba(255, 255, 255, .08); }
.pk-mz.wall { width: 20px; height: 20px; cursor: default; }
.pk-mz.first { display: inline-grid; place-items: center; background: #fff; color: #222; font-size: 12px; font-weight: 800; }
.pk-factories { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pk-factory { display: grid; grid-template-columns: repeat(2, 22px); gap: 3px; padding: 7px; border-radius: 50%; background: #2a2f3d; }
.pk-factory.center { display: flex; flex-wrap: wrap; max-width: 200px; border-radius: 12px; }
.pk-mzboard { display: flex; flex-direction: column; gap: 3px; }
.pk-mzrow { display: flex; align-items: center; gap: 3px; }
.pk-mzline { display: flex; flex-direction: row-reverse; justify-content: flex-start; gap: 2px; width: 110px; margin: 0; padding: 2px; border: 1px solid transparent; border-radius: 4px; background: none; cursor: pointer; }
.pk-mzline.go { border-color: #30a46c; }
.pk-mzline.no { opacity: .5; }
.pk-mzline.floor { flex-direction: row; flex-wrap: wrap; align-items: center; width: auto; border-color: var(--line); }
.pk-arrow { color: var(--muted); font-size: 12px; }
/* Climb */
.pk-climb { display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.pk-climbcol { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pk-climbcol b { font-size: 12px; }
.pk-climbsq { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; width: 24px; height: 15px; border-radius: 3px; background: #2e3139; gap: 1px; }
.pk-climbsq i { width: 6px; height: 6px; border-radius: 50%; }
.pk-climbsq i.runner { width: 9px; height: 9px; background: #fff; box-shadow: 0 0 0 1px #000; }
/* Property Tycoon, Sasquatch Edition: gold-framed board, parchment places, dark gold-icon squares, Brad's footprint art in the middle. */
.pk-ty { display: grid; grid-template: 1.45fr repeat(9, minmax(0, 1fr)) 1.45fr / 1.45fr repeat(9, minmax(0, 1fr)) 1.45fr; gap: 2px; width: min(100%, 440px); aspect-ratio: 1; padding: 3px; border: 2px solid #d6a23a; border-radius: 10px; background: #0b0d0a; box-shadow: 0 0 0 1px #3a2a0c, 0 0 14px rgba(255, 170, 50, .45), inset 0 0 8px rgba(255, 170, 50, .3); container-type: inline-size; }
.pk-tysq { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 0; min-width: 0; padding: 0; overflow: hidden; border: 1px solid #8a661f !important; border-radius: 3px !important; background: linear-gradient(180deg, #f6eed8, #d8caa6) !important; color: #2a2115; font: inherit; cursor: pointer; }
.pk-tysq i.bar { display: block; flex: none; width: 100%; height: 20%; border-bottom: 1px solid rgba(0, 0, 0, .35); }
.pk-tysq small.nm { display: flex; flex: 1; align-items: center; justify-content: center; padding: 0 1px; font-size: 1.85cqw; font-weight: 800; line-height: 1.02; letter-spacing: -.02em; text-align: center; }
/* Top and bottom squares are narrow: squeeze the letters a little so whole words fit. */
.pk-tysq.tb small.nm { flex: 1 0 auto; width: 122%; transform: scaleX(.82); }
.pk-tysq.k-go, .pk-tysq.k-jail, .pk-tysq.k-gojail, .pk-tysq.k-park, .pk-tysq.k-chance, .pk-tysq.k-chest, .pk-tysq.k-tax, .pk-tysq.k-rail, .pk-tysq.k-util { justify-content: center; background: linear-gradient(180deg, #2c261c, #12100b) !important; color: #f2bd3d; }
.pk-tysq .ic { font-size: 4.6cqw; font-weight: 800; line-height: 1; text-shadow: 0 0 4px rgba(255, 180, 60, .6); }
.pk-tysq.k-park .ic { font-size: 5cqw; }
.pk-tysq.k-park small.nm, .pk-tysq.k-jail small.nm { flex: none; font-size: 2.1cqw; color: #f4ecd6; }
.pk-tysq small.nm.big { font-size: 2.9cqw; color: #f4ecd6; }
.pk-tysq b.go { font-size: 5.6cqw; line-height: 1; color: #fff; text-shadow: 0 0 5px rgba(255, 190, 70, .8); }
.pk-tysq small.arrows { font-size: 4.4cqw; font-weight: 900; line-height: .8; color: #ff3b30; }
.pk-tysq .bars { width: 56%; height: 44%; margin-bottom: 2%; border: 1px solid #b9b9b9; border-radius: 2px; background: repeating-linear-gradient(90deg, #cfcfcf 0 8%, #17140f 8% 25%); }
.pk-tysq em { position: absolute; top: 0; right: 0; left: 0; font-size: 1.7cqw; font-style: normal; line-height: 1.5; text-align: center; }
.pk-tysq.sel { outline: 2px solid #ffd84a; z-index: 2; }
.pk-tysq.mort { opacity: .5; }
.pk-tytok { position: absolute; bottom: 1px; left: 1px; display: flex; flex-wrap: wrap; gap: 1px; }
.pk-tytok i { width: 2.5cqw; height: 2.5cqw; border-radius: 50%; box-shadow: 0 0 0 1px #fff, 0 0 4px 1px rgba(0, 0, 0, .7); }
.pk-tymid { grid-area: 2 / 2 / 11 / 11; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 2%; overflow: hidden; border-radius: 4px; background: #0d120e url('/tycoon/center.webp?v=1') center / cover no-repeat; color: #f4ecd6; text-align: center; }
.pk-tyfeed { display: flex; flex-direction: column; align-items: center; gap: 3px; max-width: 96%; padding: 5px 8px; border: 1px solid rgba(214, 162, 58, .6); border-radius: 8px; background: rgba(8, 10, 8, .78); }
.pk-tyfeed small { font-size: 2.7cqw; }
.pk-tycard { margin: 0; padding: 5px 8px; border-radius: 6px; background: #fff7d6; color: #3b2f00; font-size: 2.9cqw; }
/* Life Path */
.pk-life { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; width: min(100%, 420px); }
.pk-lifesq { position: relative; display: grid; width: 30px; height: 30px; place-items: center; border-radius: 6px; background: #2e3139; font-size: 15px; }
.pk-lifesq i { position: absolute; bottom: -2px; width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 1px #fff; }
.pk-lifesq i:nth-of-type(2) { left: 0; }
.pk-lifesq i:nth-of-type(3) { right: 0; }
/* Mystery Manor */
.pk-notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; width: min(100%, 440px); }
.pk-notes .pk-col { gap: 3px; align-items: stretch; }
.pk-note { margin: 0; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--raised); color: var(--text); font: inherit; font-size: 11.5px; text-align: left; cursor: pointer; }
.pk-note.known { opacity: .55; text-decoration: line-through; }
.pk-note.on { border-color: #ffd84a; background: rgba(255, 216, 74, .15); opacity: 1; text-decoration: none; }
/* Maps */
.pk-map { width: min(100%, 440px); height: auto; border-radius: 12px; background: #16304a; touch-action: manipulation; }
.pk-map line { stroke: rgba(255, 255, 255, .35); stroke-width: .5; }
.pk-map line.sea { stroke-dasharray: 1.2 1; }
.pk-map .land { cursor: pointer; }
.pk-map text.num { fill: #fff; font-size: 3.4px; font-weight: 800; pointer-events: none; }
.pk-map text.name { fill: rgba(255, 255, 255, .8); font-size: 2.3px; pointer-events: none; }
.pk-map line.order { stroke: #ffd84a; stroke-width: .9; }
.pk-map line.order.s { stroke-dasharray: 1 .8; }
.pk-rails { background: #e8e2cf; }
.pk-rails line { stroke-width: 1.6; }
.pk-rails line.route { cursor: pointer; }
.pk-rails line.route.sel { stroke-width: 3; }
.pk-rails text.len { fill: #333; font-size: 2.2px; font-weight: 800; pointer-events: none; }
.pk-rails text.name { fill: #222; font-size: 2.3px; }
.pk-railcard { display: inline-grid; min-width: 26px; height: 36px; margin: 0; padding: 0 4px; place-items: center; border: 2px solid #fff; border-radius: 5px; box-shadow: 0 1px 2px rgba(0, 0, 0, .4); color: #fff; font: inherit; font-weight: 800; text-shadow: 0 1px 2px #000; }
.pk-railcard.big { width: 40px; height: 56px; cursor: pointer; }
.pk-railcard.deck { background: repeating-linear-gradient(45deg, #3e5fb3 0 4px, #2e4a94 4px 8px); font-size: 11px; }
/* Battlefield Ranks */
.pk-ranks { width: min(100%, 380px, 46vh); gap: 1px; padding: 1px; background: #3d6b3a; }
.pk-ranks .gc { border-radius: 2px; background: #6e9b5a; container-type: inline-size; }
.pk-ranks .gc.lake { background: #3a7bbf; }
.pk-ranks .gc.mine, .pk-ranks .gc.theirs { background: var(--pc); }
.pk-ranks .gc b { color: #fff; font-size: 48cqw; text-shadow: 0 1px 2px #000; }
.pk-ranks .gc.go::after { background: rgba(255, 216, 74, .85); }
/* Tile Kingdoms */
.pk-kgrid { display: grid; gap: 1px; width: max-content; padding: 4px; background: #2a2f22; }
.pk-kcell { border-radius: 2px; background: #1d2118; }
.pk-kcell.go { background: rgba(80, 200, 120, .35); }
.pk-ktile { display: block; width: 100%; height: 100%; }
.pk-kpreview { display: flex; align-items: center; gap: 10px; }
.pk-kpreview .pk-ktile { width: 64px; height: 64px; }

/* A group chat's picture, tap to change */
.im-group-pic { position: relative; display: block; width: 104px; height: 104px; margin: 6px auto 14px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.im-group-pic-status { min-height: 1em; margin: 0 0 10px; text-align: center; }
.im-group-pic img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--raised); }
.im-group-pic-hint { position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); padding: 3px 10px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 600; white-space: nowrap; }
.im-group-pic.busy { opacity: .5; }
.im-group-pic input[type=file] { display: none !important; }

/* Crop screen: move and zoom a picture into a circle */
.crop-back { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .8); }
.crop-box { display: flex; flex-direction: column; align-items: center; gap: 12px; width: min(100%, 380px); padding: 16px; border-radius: 18px; background: #1c1c1e; }
.crop-tip { margin: 0; color: var(--muted); font-size: 13px; }
.crop-stage { position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: 12px; background: #000; touch-action: none; cursor: grab; }
.crop-img { position: absolute; top: 50%; left: 50%; max-width: none; user-select: none; pointer-events: none; }
.crop-ring { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(0, 0, 0, .55); outline: 2px solid rgba(255, 255, 255, .8); outline-offset: -2px; pointer-events: none; }
.crop-zoom { width: 100%; }
.crop-actions { display: flex; gap: 10px; }
.crop-actions .button { margin: 0; }

/* ================================================================= Light mode
   The page is dark unless textsize.js marks it light (from Settings → Appearance, or the phone's setting).
   Photos, videos, stories and the game boards keep their own colors. */
:root[data-mode="light"] {
  --bg: #f3f4f7;
  --card: #ffffff;
  --card-top: #ffffff;
  --raised: #eceef2;
  --raised-hover: #e1e4ea;
  --text: #16181d;
  --muted: #5d6470;
  --line: rgba(0, 0, 0, .12);
  --accent-text: rgb(37, 92, 214);
  --accent-soft: rgba(77, 132, 255, .14);
  --love: #e0284a;
  --online: #1f9e43;
  color-scheme: light;
}
.mode-choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.mode-choice { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--raised); cursor: pointer; }
.mode-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.mode-choice input { margin: 0; }
.mode-icon { font-size: 18px; }

[data-mode="light"] .topbar { background: #ffffff; }
[data-mode="light"] .topbar .im-titlebar .im-head-avatar .dot { border-color: #ffffff; }
@media (max-width: 700px) { [data-mode="light"] .nav { background: #ffffff; box-shadow: 0 -2px 12px rgba(0, 0, 0, .06); } }
[data-mode="light"] .logo-word[src*="hello-word.png"] { filter: invert(1) brightness(.12); }
[data-mode="light"] .notice { background: #dcf5e3; color: #14532d; }
[data-mode="light"] .error, [data-mode="light"] .im-error, [data-mode="light"] .im-msg.failed, [data-mode="light"] .im-row .im-msg.failed { background: #fde2e4; color: #8a1c25; }
[data-mode="light"] .button.danger { border-color: rgba(200, 40, 40, .45); color: #c62828; }
[data-mode="light"] .set-row.danger, [data-mode="light"] .set-row.danger .set-icon { color: #c62828; }
[data-mode="light"] .notif-flame .icon { fill: #ffffff; stroke: #16181d; }
[data-mode="light"] .nav a.nav-flame.lit .icon, [data-mode="light"] .notif-flame.lit .icon { fill: var(--flame); stroke: var(--flame-edge); }

/* Messenger */
[data-mode="light"] .im-window, [data-mode="light"] .im-titlebar, [data-mode="light"] .im-form, [data-mode="light"] .im-tray { background: #ffffff; }
[data-mode="light"] .im-row .im-msg { background: #eceef2; }
[data-mode="light"] .im-row .im-msg.mine { background: var(--accent); }
[data-mode="light"] .im-row .im-msg .sender, [data-mode="light"] .im-sheet-hint, [data-mode="light"] .im-share-cancel { color: #5d6470; }
[data-mode="light"] .im-send { background: #eceef2; color: #5d6470; }
[data-mode="light"] .im-tray-thumb, [data-mode="light"] .im-tray-item.as-file { background: #eceef2; }
[data-mode="light"] .im-tray-remove { border-color: #ffffff; background: #5d6470; }
[data-mode="light"] .im-head-avatar .dot { border-color: #ffffff; }
[data-mode="light"] .im-file { background: rgba(0, 0, 0, .06); }
[data-mode="light"] .im-react { border-color: #ffffff; background: #eceef2; }
[data-mode="light"] .im-react.mine, [data-mode="light"] .im-reactbar-btn.on { background: #d6e4ff; }
[data-mode="light"] .im-reactbar-box { background: #ffffff; box-shadow: 0 4px 18px rgba(0, 0, 0, .18); }
[data-mode="light"] .im-reactbar-copy { background: #eceef2; }
[data-mode="light"] .im-sheet, [data-mode="light"] .im-attach-sheet { background: #ffffff; }
[data-mode="light"] .im-attach-row:hover, [data-mode="light"] .im-attach-row:focus-visible { background: rgba(0, 0, 0, .05); }
[data-mode="light"] .im-attach-words small { color: #5d6470; }
[data-mode="light"] .im-share-text { background: rgba(0, 0, 0, .05); color: #5d6470; }
[data-mode="light"] .im-progress { background: rgba(0, 0, 0, .15); }
[data-mode="light"] .bubble { background: #ffffff; }
[data-mode="light"] .ni-bar { background: #ffffff; color: #16181d; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
[data-mode="light"] .ni-big { background: #e1e4ea; }
[data-mode="light"] .ni-emoji-pick:hover { background: rgba(0, 0, 0, .05); }
.game-head { margin: 14px 4px 0; font-size: calc(13px * var(--ts, 1)); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #ffb347; }
.game-head-note { margin: 2px 4px 6px; font-size: calc(13px * var(--ts, 1)); opacity: .7; }
.game-live-on { outline: 2px solid #ffb347; outline-offset: -2px; border-radius: 12px; }
.kart-join { position: fixed; left: 50%; top: calc(64px + env(safe-area-inset-top)); z-index: 60; display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100vw - 24px); padding: 8px 8px 8px 16px; border: 2px solid #ffb347; border-radius: 999px; background: #1b1d23; color: #fff; font-size: calc(14px * var(--ts, 1)); font-weight: 600; transform: translateX(-50%); box-shadow: 0 4px 16px rgba(0, 0, 0, .5); }
.kart-join-go { display: flex; align-items: center; gap: 12px; min-width: 0; color: inherit; text-decoration: none; }
.kart-join-no { flex: none; padding: 7px 12px; border: 1px solid #5a5d66; border-radius: 999px; background: none; color: #d6d8de; font: inherit; font-weight: 600; cursor: pointer; }
.kart-join-words { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kart-join-btn { flex: none; padding: 7px 16px; border-radius: 999px; background: #ffb347; color: #1a1205; font-weight: 800; }
[data-mode="light"] .im-toast { background: #16181d; color: #ffffff; }
[data-mode="light"] .im-album-msg .im-caption { background: #eceef2; }
[data-mode="light"] .im-row .im-msg.im-album-msg.mine .im-caption { background: var(--accent); }
[data-mode="light"] .group-pic-hint, [data-mode="light"] .im-group-pic-hint { color: var(--on-accent); }

/* The game dock (the boards themselves keep their colors) */
[data-mode="light"] .im-dock { border-top-color: #e1e4ea; background: #f6f7f9; }
[data-mode="light"] .dock-chip { background: #e1e4ea; color: #3a3f48; }
[data-mode="light"] .dock-grip { background: #c4c8d0; }
[data-mode="light"] .game-ico { color: #3a3f48; }
[data-mode="light"] .cat-players li, [data-mode="light"] .cat-box, [data-mode="light"] .cat-offer, [data-mode="light"] .cat-chip { background: rgba(0, 0, 0, .05); }
[data-mode="light"] .cat-dot { border-color: rgba(0, 0, 0, .35); }
[data-mode="light"] .pk-trick { background: #2f7a4f; }
[data-mode="light"] .pk-tymid { color: #eaf5ec; }
[data-mode="light"] .pk-map text.name { fill: rgba(255, 255, 255, .85); }
[data-mode="light"] .pk-wtile, [data-mode="light"] .pk-sm { box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
[data-mode="light"] .pk-factory { background: #2a2f3d; }
[data-mode="light"] .pk-climbsq, [data-mode="light"] .pk-lifesq { background: #dfe2e8; }
[data-mode="light"] .pk-smcell { background: #dfe2e8; }
[data-mode="light"] .pk-smboard { background: #c9ccd3; }

/* Profiles: the edit bar and panels */
[data-mode="light"] .pe-panel { background: #ffffff; }
[data-mode="light"] .pe-error { color: #c62828; }
[data-mode="light"] .crop-box { background: #ffffff; }
[data-mode="light"] .sv-panel { background: #ffffff; color: #16181d; }
[data-mode="light"] .sv-viewer { color: #16181d; }

/* ================================================================= Style choices (Settings → Appearance → Style) */
.look-group { margin: 0 0 12px; padding: 0; border: 0; }
.look-group legend { padding: 0; font-weight: 600; }
.look-group .mode-choices { margin: 6px 0 0; }

/* Box shadows */
[data-shadow="soft"] :is(.card, .box, .profile-card, .story-card) { box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 4px 16px rgba(0, 0, 0, .07); }
[data-shadow="strong"] :is(.card, .box, .profile-card, .story-card) { box-shadow: 0 2px 4px rgba(0, 0, 0, .08), 0 10px 30px rgba(0, 0, 0, .14); }
[data-mode="dark"][data-shadow="soft"] :is(.card, .box, .profile-card, .story-card) { box-shadow: 0 4px 16px rgba(0, 0, 0, .35); }
[data-mode="dark"][data-shadow="strong"] :is(.card, .box, .profile-card, .story-card) { box-shadow: 0 10px 30px rgba(0, 0, 0, .55); }
[data-mode="light"][data-shadow]:not([data-shadow="none"]) :is(.card, .box) { border-color: rgba(0, 0, 0, .06); }

/* Background (profiles with their own colors keep theirs) */
[data-bg="tint"] body:not(.profile-themed) { background: color-mix(in srgb, var(--accent) 7%, var(--bg)); }
[data-bg="gradient"] body:not(.profile-themed) { background: linear-gradient(165deg, color-mix(in srgb, var(--accent) 16%, var(--bg)) 0%, var(--bg) 45%, color-mix(in srgb, var(--accent) 9%, var(--bg)) 100%) fixed; }

/* Frosted glass bars */
/* The blur sits on a layer behind the bar: putting it on the bar itself would pull the bottom menu
   (which lives inside the top bar) up to the top of the screen. */
[data-bars="frost"] .topbar { background: transparent; }
[data-bars="frost"] .topbar::before { position: absolute; inset: 0; z-index: -1; background: color-mix(in srgb, var(--card) 72%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px); content: ''; }
[data-bars="frost"][data-mode="light"] .topbar { box-shadow: 0 1px 10px rgba(0, 0, 0, .06); }
@media (max-width: 700px) {
  [data-bars="frost"] .nav { background: color-mix(in srgb, var(--card) 74%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px); }
}

/* Color touches */
[data-touch="on"] .nav a.active { color: var(--accent-text); }
[data-touch="on"] .nav a.active .icon { stroke: var(--accent-text); }
@media (max-width: 700px) {
  [data-touch="on"] .nav a.active::before { position: absolute; top: 2px; left: 50%; width: 44px; height: 30px; transform: translateX(-50%); border-radius: 999px; background: var(--accent-soft); content: ''; z-index: -1; }
}
[data-touch="on"] .post-actions :is(button, a) .icon { color: var(--accent-text); }
[data-touch="on"] .tabs a .icon { color: var(--accent-text); }
[data-touch="on"] .composer-photo .icon, [data-touch="on"] .set-icon { color: var(--accent-text); }
[data-touch="on"] .box > h2, [data-touch="on"] .section-head h2 { color: color-mix(in srgb, var(--accent-text) 35%, var(--text)); }

/* The waving hand (was a flame): outline under the fill so only the outer edge shows */
.nav a.nav-flame.lit .icon path, .notif-flame .icon path { paint-order: stroke; stroke-width: 2.4px; }
html[data-flicker="on"] .nav a.nav-flame.lit .icon { animation-duration: 2.2s; transform-origin: 45% 92%; }

/* The hand's picture follows the chosen color (the picture itself is orange); white is the default. */
html[data-flame-color="white"] :is(.flame-pic, .bubble-flame) { filter: grayscale(1) brightness(1.9); }
html[data-flame-color="red"] :is(.flame-pic, .bubble-flame) { filter: hue-rotate(-20deg) saturate(1.2); }
html[data-flame-color="gold"] :is(.flame-pic, .bubble-flame) { filter: hue-rotate(18deg); }
html[data-flame-color="green"] :is(.flame-pic, .bubble-flame) { filter: hue-rotate(95deg); }
html[data-flame-color="blue"] :is(.flame-pic, .bubble-flame) { filter: hue-rotate(185deg); }
html[data-flame-color="purple"] :is(.flame-pic, .bubble-flame) { filter: hue-rotate(245deg); }
/* A white hand on a light page needs a dark edge to be seen. */
[data-mode="light"][data-flame-color="white"] .nav a.nav-flame.lit .icon { stroke: #16181d; filter: drop-shadow(0 0 4px rgba(0, 0, 0, .25)); }
[data-mode="light"][data-flame-color="white"] .flame-preview { background: #2a2c33; border-radius: 14px; padding: 6px; }

/* ================================================================= Posts with several photos */
.post-gallery { display: grid; gap: 3px; margin: 10px 10px 0; overflow: hidden; border: 1.5px solid color-mix(in srgb, var(--accent-text) 55%, transparent); border-radius: 18px; background: var(--line); box-shadow: 0 0 18px color-mix(in srgb, var(--accent-text) 18%, transparent); }
.pg-tile { position: relative; display: block; min-width: 0; min-height: 0; margin: 0; padding: 0; overflow: hidden; border: 0; border-radius: 0; background: #111; cursor: zoom-in; }
.pg-tile img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.pg-tile:hover img { transform: scale(1.03); }
.pg-more { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .5); color: #fff; font-size: calc(34px * var(--ts, 1)); font-weight: 600; text-shadow: 0 2px 8px rgba(0, 0, 0, .6); }
/* 2: side by side */
.post-gallery.g2 { grid-template-columns: 1fr 1fr; aspect-ratio: 2 / 1.2; }
/* 3: a big one with two stacked beside it */
.post-gallery.g3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 3 / 2; }
.post-gallery.g3 .pg-tile:first-child { grid-row: 1 / 3; }
/* 4: two by two */
.post-gallery.g4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 5 / 4; }
/* 5 and 6 or more: a big one, two beside it, and a row underneath */
.post-gallery.g5, .post-gallery.g6 { grid-template-columns: repeat(6, 1fr); grid-template-rows: 1fr 1fr .95fr; aspect-ratio: 1 / .92; }
.post-gallery.g5 .pg-tile:nth-child(1), .post-gallery.g6 .pg-tile:nth-child(1) { grid-column: 1 / 5; grid-row: 1 / 3; }
.post-gallery.g5 .pg-tile:nth-child(2), .post-gallery.g6 .pg-tile:nth-child(2) { grid-column: 5 / 7; grid-row: 1; }
.post-gallery.g5 .pg-tile:nth-child(3), .post-gallery.g6 .pg-tile:nth-child(3) { grid-column: 5 / 7; grid-row: 2; }
.post-gallery.g5 .pg-tile:nth-child(n+4) { grid-column: span 3; }
.post-gallery.g6 .pg-tile:nth-child(n+4) { grid-column: span 2; }
[data-mode="light"] .post-gallery { background: #e1e4ea; }

/* Photos tab: how many photos a post has */
.photo-feed a { position: relative; }
.pf-count { position: absolute; top: 10px; right: 10px; display: flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; background: rgba(0, 0, 0, .6); color: #fff; font-weight: 600; }
.pf-count .icon { width: 18px; height: 18px; }

/* The post box: several picked photos */
.file-preview.multi { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; padding: 0; background: transparent; }
.file-preview.multi .fp-item { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 10px; background: #000; }
.file-preview.multi .fp-item img, .file-preview.multi .fp-item video { width: 100%; height: 100%; max-height: none; object-fit: cover; }
.file-preview.multi .file-preview-remove { top: 4px; right: 4px; width: 28px; height: 28px; font-size: calc(19px * var(--ts, 1)); }
.file-preview.one .fp-item { position: relative; }

/* Full-screen photo: moving between a post's photos */
.photo-viewer-nav { position: absolute; top: 50%; z-index: 1; width: 46px; height: 46px; margin-top: -23px; border: 0; border-radius: 50%; background: rgba(60, 60, 60, .7); color: #fff; font-size: calc(28px * var(--ts, 1)); line-height: 1; cursor: pointer; }
.photo-viewer-nav.prev { left: 10px; }
.photo-viewer-nav.next { right: 10px; }
.photo-viewer-count { position: absolute; top: calc(18px + env(safe-area-inset-top)); left: 50%; z-index: 1; padding: 5px 12px; border-radius: 999px; background: rgba(60, 60, 60, .7); color: #fff; font-weight: 600; transform: translateX(-50%); }
@media (hover: none) { .photo-viewer-nav { display: none; } }

/* ================================================================= The ⋯ menu on a post */
.post-head .post-who { flex: 1; min-width: 0; }
.post-menu { position: relative; margin-left: auto; }
.post-menu-btn { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin: -6px -8px -6px 0; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.post-menu-btn:hover, .post-menu-btn[aria-expanded="true"] { background: var(--raised); color: var(--text); }
.post-menu-btn .icon { width: 24px; height: 24px; }
.post-menu-list { position: absolute; top: calc(100% + 6px); right: -6px; z-index: 30; min-width: 210px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.post-menu-list[hidden] { display: none; }
.post-menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.post-menu-item:hover, .post-menu-item:focus-visible { background: var(--raised); text-decoration: none; }
.post-menu-item .icon { width: 20px; height: 20px; flex: none; }
.post-menu-item.danger { color: #ff6b6b; }
.post-menu-confirm { padding: 8px 8px 4px; }
.post-menu-confirm[hidden], .post-menu-items[hidden] { display: none; }
.post-menu-confirm p { margin: 0 0 12px; line-height: 1.4; }
.post-menu-confirm-buttons { display: flex; gap: 8px; justify-content: flex-end; }
.button.danger-fill { border-color: #d93a3a; background: #d93a3a; color: #fff; }
.button.danger-fill:hover { background: #c22f2f; }
[data-mode="light"] .post-menu-list { box-shadow: 0 10px 30px rgba(0, 0, 0, .15); }
[data-mode="light"] .post-menu-item.danger { color: #c62828; }

/* The edit page */
.edit-hint { margin: 10px 0 6px; }
.edit-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.edit-tile { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 10px; background: #000; cursor: pointer; }
.edit-tile input { position: absolute; opacity: 0; pointer-events: none; }
.edit-tile img, .edit-tile video { display: block; width: 100%; height: 100%; object-fit: cover; transition: opacity .15s, filter .15s; }
.edit-tile-x { position: absolute; top: 4px; right: 4px; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(10, 11, 14, .8); color: #fff; font-size: calc(19px * var(--ts, 1)); line-height: 1; }
.edit-tile-gone { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; padding: 6px; color: #fff; font-size: calc(12px * var(--ts, 1)); font-weight: 600; text-align: center; }
.edit-tile:has(input:checked) img, .edit-tile:has(input:checked) video { opacity: .25; filter: grayscale(1); }
.edit-tile:has(input:checked) .edit-tile-x { display: none; }
.edit-tile:has(input:checked) .edit-tile-gone { display: flex; }
.edit-tile:has(input:focus-visible) { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.edit-buttons { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }

/* ================================================================= Tagging people (@) */
.mention { color: var(--accent-text); font-weight: 600; }
a.mention { text-decoration: none; }
a.mention:hover { text-decoration: underline; }
.im-msg.mine .mention { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.mention-pop { position: fixed; z-index: 2000; min-width: 220px; max-width: min(320px, calc(100vw - 16px)); padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.mention-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.mention-opt.on, .mention-opt:hover { background: var(--raised); }
.mention-opt img { width: 32px; height: 32px; flex: none; border-radius: 50%; object-fit: cover; }
.mention-words { display: flex; flex-direction: column; min-width: 0; }
.mention-name { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.mention-user { color: var(--muted); font-size: calc(12px * var(--ts, 1)); }
[data-mode="light"] .mention-pop { box-shadow: 0 10px 30px rgba(0, 0, 0, .15); }

/* ================================================================= Replying in Messenger */
.im-replybar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-left: 3px solid var(--accent-text); background: #000; }
.im-replybar.hidden { display: none; }
.im-replybar-words { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.im-replybar-who { color: var(--accent-text); font-size: calc(13px * var(--ts, 1)); font-weight: 600; }
.im-replybar-text { overflow: hidden; color: var(--muted); font-size: calc(13px * var(--ts, 1)); text-overflow: ellipsis; white-space: nowrap; }
.im-replybar-x { width: 32px; height: 32px; flex: none; border: 0; border-radius: 50%; background: var(--raised); color: var(--text); font-size: calc(20px * var(--ts, 1)); line-height: 1; cursor: pointer; }
.im-quote { display: flex; flex-direction: column; max-width: 100%; margin: 0 0 6px; padding: 6px 10px; border: 0; border-left: 3px solid var(--accent-text); border-radius: 8px; background: rgba(0, 0, 0, .22); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.im-msg.mine .im-quote { border-left-color: rgba(255, 255, 255, .8); background: rgba(0, 0, 0, .18); }
.im-msg.has-media .im-quote { margin: 8px 8px 6px; }
.im-quote-who { font-size: calc(12px * var(--ts, 1)); font-weight: 700; opacity: .9; }
.im-quote-text { display: -webkit-box; overflow: hidden; font-size: calc(13px * var(--ts, 1)); opacity: .8; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
@keyframes im-flash { 0%, 100% { box-shadow: none; } 30% { box-shadow: 0 0 0 3px var(--accent-text); } }
.im-flash { animation: im-flash 1.2s ease 2; }
[data-mode="light"] .im-replybar { background: #ffffff; }
[data-mode="light"] .im-quote { background: rgba(0, 0, 0, .06); }
[data-mode="light"] .im-msg.mine .im-quote { background: rgba(255, 255, 255, .2); }

/* ================================================================= Holding a message (Signal-like) */
.im-log, .im-log .im-msg, .im-reactbar, .im-reactbar *, .post-actions, .post-action { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.im-reactbar { background: rgba(0, 0, 0, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: im-hold-fade .15s ease-out; }
@keyframes im-hold-fade { from { opacity: 0; } }
.im-hold { position: fixed; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.im-hold.mine { align-items: flex-end; }
.im-hold .im-reactbar-box { position: static; gap: 4px; padding: 8px 10px; border-radius: 34px; background: #24262c; box-shadow: 0 8px 28px rgba(0, 0, 0, .5); animation: im-hold-pop .18s ease-out; }
@keyframes im-hold-pop { from { opacity: 0; transform: scale(.9) translateY(6px); } }
.im-hold .im-reactbar-btn { width: 46px; height: 46px; font-size: calc(30px * var(--ts, 1)); transition: transform .1s; }
.im-hold .im-reactbar-btn:active { transform: scale(1.25); }
.im-reactbar-more { display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; margin: 0 0 0 2px; padding: 0; border: 0; border-radius: 50%; background: #3a3d45; color: #fff; cursor: pointer; }
.im-reactbar-more .im-hold-ico svg { width: 24px; height: 24px; }
.im-hold-msg { max-width: none; margin: 0; pointer-events: none; box-shadow: 0 6px 24px rgba(0, 0, 0, .45); }
.im-hold-menu { min-width: 230px; padding: 6px 0; border-radius: 18px; background: #24262c; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); animation: im-hold-pop .18s ease-out; }
.im-hold-item { display: flex; align-items: center; gap: 16px; width: 100%; padding: 13px 22px; border: 0; background: none; color: #f2f3f5; font: inherit; font-size: calc(17px * var(--ts, 1)); text-align: left; text-decoration: none; cursor: pointer; }
.im-hold-item:hover, .im-hold-item:active { background: rgba(255, 255, 255, .07); text-decoration: none; }
.im-hold-item.danger { color: #ff7b7b; }
.im-hold-ico { display: flex; flex: none; }
.im-hold-ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.im-deleted { font-style: italic; opacity: .7; }
.im-del-btn { display: block; width: 100%; margin: 6px 0 0; padding: 13px; border: 0; border-radius: 12px; background: var(--raised); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.im-del-btn.danger { color: #ff6b6b; }
.im-fwd-list { display: flex; flex-direction: column; max-height: 55vh; overflow-y: auto; }
.im-fwd-row { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border: 0; border-radius: 12px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.im-fwd-row:hover { background: var(--raised); }
.im-fwd-pic { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.im-fwd-name { font-weight: 600; }
/* The full emoji picker */
.im-emoji-sheet { max-height: 70vh; display: flex; flex-direction: column; padding-top: 8px; }
.im-emoji-grip { width: 40px; height: 4px; margin: 0 auto 8px; border-radius: 2px; background: var(--line); }
.im-emoji-scroll { overflow-y: auto; }
.im-emoji-title { margin: 10px 4px 4px; color: var(--muted); font-size: calc(13px * var(--ts, 1)); font-weight: 600; }
.im-emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
.im-emoji-btn { height: 46px; padding: 0; border: 0; border-radius: 10px; background: none; font-size: calc(28px * var(--ts, 1)); line-height: 1; cursor: pointer; }
.im-emoji-btn:hover, .im-emoji-btn.on { background: var(--raised); }
[data-mode="light"] .im-reactbar { background: rgba(0, 0, 0, .35); }
[data-mode="light"] .im-hold .im-reactbar-box, [data-mode="light"] .im-hold-menu { background: #ffffff; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
[data-mode="light"] .im-hold-item { color: #16181d; }
[data-mode="light"] .im-hold-item:hover { background: rgba(0, 0, 0, .05); }
[data-mode="light"] .im-hold-item.danger { color: #c62828; }
[data-mode="light"] .im-reactbar-more { background: #eceef2; color: #16181d; }

/* ================================================================= The color of the word "hello" */
.logo-tint { display: block; flex: none; width: 83px; height: 30px; -webkit-mask: url(/hello-word.png?v=4) center / contain no-repeat; mask: url(/hello-word.png?v=4) center / contain no-repeat; }
.logo-tint[hidden], .logo-word.tinted { display: none; }
.pe-logo-colors { margin-top: 14px; }
.pe-logo-color-title { margin: 0 0 8px; font-weight: 600; }
.pe-swatches { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pe-swatches[hidden] { display: none; }
.pe-swatch { width: 36px; height: 36px; padding: 0; border: 2px solid rgba(255, 255, 255, .25); border-radius: 50%; background: var(--sw); cursor: pointer; }
.pe-swatch[aria-pressed="true"], .pe-swatch-custom.on { outline: 3px solid var(--accent-text); outline-offset: 2px; }
.pe-swatch-custom { width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); cursor: pointer; }
.pe-logo-file { display: none !important; }

/* ================================================================= Chess: marble board, carved pieces */
.chess-frame { display: grid; grid-template-columns: 6% minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; width: min(100%, 380px, 46vh); padding: 8% 3% 1% 1.5%; border-radius: 10px; background: linear-gradient(160deg, #24221f, #0f0e0d 60%, #1a1816); box-shadow: inset 0 0 0 1px rgba(214, 178, 110, .28), 0 8px 24px rgba(0, 0, 0, .5); container-type: inline-size; flex: none; }
.chess-frame .gb { grid-column: 2; grid-row: 1; width: 100%; overflow: visible; border-radius: 1px; box-shadow: 0 0 0 .6cqw #0b0a09, 0 0 0 1cqw rgba(214, 178, 110, .55); }
.chess-ranks { grid-column: 1; grid-row: 1; display: grid; grid-template-rows: repeat(8, minmax(0, 1fr)); }
.chess-files { grid-column: 2; grid-row: 2; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); }
.chess-ranks span, .chess-files span { display: flex; align-items: center; justify-content: center; color: #e9dcc0; font-family: Georgia, "Times New Roman", serif; font-size: 3.8cqw; line-height: 1; }
.chess-files span { padding: 2cqw 0 1.4cqw; }
.gb-chess .gc { background: var(--tile) center / cover; }
.gb-chess .gc.check { background-image: var(--tile); }
.gb-chess .gc.check::after { position: absolute; inset: 0; width: auto; height: auto; border: 0; border-radius: 0; background: radial-gradient(circle, rgba(235, 50, 50, .9), rgba(235, 50, 50, 0) 72%); content: ''; pointer-events: none; }
.gb-chess .gc.sel { box-shadow: inset 0 0 0 .7cqw #e2b860; }
.gb-chess .gc.last::before { background: rgba(226, 184, 96, .32); }
.gb-chess .gc.go::after { background: rgba(226, 184, 96, .75); box-shadow: 0 0 0 .3cqw rgba(0, 0, 0, .35); z-index: 2; }
.gb-chess .gc.cap::after { border-color: rgba(226, 184, 96, .9); z-index: 2; }
.pc-img { position: absolute; left: 4.35%; bottom: 21%; z-index: 1; width: 91.3%; height: auto; pointer-events: none; -webkit-user-drag: none; filter: drop-shadow(0 .5cqw .45cqw rgba(0, 0, 0, .55)); }
.chess-pick { position: relative; overflow: hidden; background: url(/chess/dark0.webp) center / cover; }
.chess-pick .pc-img { left: 10%; width: 80%; bottom: 2%; }

/* ================================================================= Battleship: metal frame, open water, ships, pegs */
.sea-frame { position: relative; display: grid; grid-template-columns: 9% minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); column-gap: 1.4%; width: min(100%, 380px, 46vh); padding: 1% 2.2% 2.6% 1.6%; border-radius: 12px; background: linear-gradient(160deg, #3b4048, #1c2026 45%, #2b3037); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), inset 0 2px 0 rgba(255, 255, 255, .08), 0 8px 24px rgba(0, 0, 0, .5); container-type: inline-size; flex: none; }
.sea-cols { grid-column: 2; grid-row: 1; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); padding: 2cqw 0 2.2cqw; }
.sea-cols span, .sea-rows span { display: flex; align-items: center; justify-content: center; color: #e6eaf0; font: 800 4.8cqw/1 "Arial Black", "Segoe UI", system-ui, sans-serif; text-shadow: 0 .3cqw 0 #000; }
.sea-rows { grid-column: 1; grid-row: 2; display: grid; grid-template-rows: repeat(10, minmax(0, 1fr)); gap: .8cqw; }
.sea-rows span { border-radius: 1.2cqw; background: linear-gradient(#2c3139, #15181d); box-shadow: inset 0 0 0 .35cqw #4a515b, 0 .3cqw .6cqw rgba(0, 0, 0, .5); }
.sea-frame .gb-sea { grid-column: 2; grid-row: 2; width: 100%; }
.sea-screw { position: absolute; z-index: 1; width: 2.4cqw; height: 2.4cqw; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #a6aeb8, #3b4148 70%); box-shadow: 0 0 0 .35cqw #13161a; }
.sea-screw::after { position: absolute; left: 20%; right: 20%; top: 45%; height: 12%; background: #22262b; content: ''; transform: rotate(-35deg); }
.sea-screw.tl { top: 1.8cqw; left: 1.8cqw; }
.sea-screw.tr { top: 1.8cqw; right: 1.8cqw; }
.sea-screw.bl { bottom: 1.2cqw; left: 1.8cqw; }
.sea-screw.br { bottom: 1.2cqw; right: 1.8cqw; }
.bs .sea-frame { width: 100%; }
.gb-sea { position: relative; overflow: hidden; border-radius: 1.4cqw; background-color: #0e3a66; background-image: linear-gradient(rgba(150, 205, 255, .4) 1px, transparent 1px), linear-gradient(90deg, rgba(150, 205, 255, .4) 1px, transparent 1px), url(/sea/water.webp?v=2); background-size: 10% 10%, 10% 10%, 100% 100%; box-shadow: inset 0 0 0 .6cqw #0a0c0f, inset 0 0 4cqw rgba(0, 0, 0, .45); }
.gb-sea .gc, .gb-sea .gc.ship, .gb-sea .gc.ship.h, .gb-sea .gc.s, .gb-sea .gc.h { z-index: 2; border: 0; background: transparent; }
.gb-sea .gc.m::after { display: none; }
.gb-sea .gc.sel { box-shadow: inset 0 0 0 .8cqw #ffd84a; background: rgba(255, 216, 74, .15); }
.gb-sea .gc.last::before { background: rgba(255, 221, 51, .2); }
.sea-ship { position: absolute; z-index: 1; pointer-events: none; }
.sea-ship-pic { position: absolute; left: 0; top: 14%; width: 100%; height: 72%; max-width: none; max-height: none; object-fit: fill; filter: drop-shadow(0 0 .8cqw rgba(220, 240, 255, .35)); }
.sea-ship.sunk .sea-ship-pic { filter: brightness(.55) sepia(.5) saturate(1.6) hue-rotate(-25deg); opacity: .9; }
.peg { position: absolute; left: 50%; top: 50%; width: 46%; height: 46%; border-radius: 50%; background: center / contain no-repeat; transform: translate(-50%, -50%); pointer-events: none; }
.peg.red { background-image: url(/sea/peg-red.webp?v=1); box-shadow: 0 0 1.6cqw rgba(255, 40, 40, .55); }
.peg.white { width: 38%; height: 38%; background-image: url(/sea/peg-white.webp?v=1); }
.peg::before, .peg::after { position: absolute; inset: -32%; border-radius: 50%; box-shadow: 0 0 0 1px rgba(210, 235, 255, .32); content: ''; }
.peg::after { inset: -62%; box-shadow: 0 0 0 1px rgba(210, 235, 255, .16); }

/* Battleship v2: Brad's empty board picture as the board, ships with wakes, explosion for hits */
.sea-frame { display: block; aspect-ratio: 1; padding: 0; border-radius: 3%; background: url(/sea/board.webp?v=1) center / 100% 100% no-repeat; }
.sea-frame .gb-sea { position: absolute; left: 8.29%; top: 8.37%; width: 89.07%; height: 86.2%; aspect-ratio: auto; overflow: visible; border-radius: 0; background: none; box-shadow: none; }
.sea-ship .sea-ship-pic { left: 0; top: 0; width: 100%; height: 100%; filter: none; }
.sea-ship.sunk .sea-ship-pic { filter: brightness(.6) sepia(.45) saturate(1.5) hue-rotate(-20deg); }
.sea-hit { position: absolute; left: 50%; top: 50%; z-index: 3; width: 165%; height: 165%; background: url(/sea/hit.webp?v=1) center / contain no-repeat; transform: translate(-50%, -50%); pointer-events: none; }
.gb-sea.mini .sea-hit { width: 140%; height: 140%; }

/* Placing ships before a Battleship game */
.sea-ship.picked { z-index: 4; animation: ship-bob 1.4s ease-in-out infinite; }
.sea-ship.picked .sea-ship-pic { filter: drop-shadow(0 0 1.2cqw rgba(255, 216, 74, .95)) drop-shadow(0 0 .4cqw rgba(255, 216, 74, .9)); }
@keyframes ship-bob { 50% { transform: translateY(-1.5%); } }
.bs-hint { margin: 6px 0 0; text-align: center; }
.bs-hint.warn { color: #ffb36b; }
.gb-sea.mine .gc { cursor: pointer; }

/* ================================================================= Beer Pong */
.pk-pong { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.pk-pong-cv { display: block; max-width: 100%; border-radius: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.pk-pong-score { display: flex; gap: 8px; justify-content: center; }
.pk-pong-chip { display: flex; flex-direction: column; align-items: center; padding: 4px 12px; border-radius: 12px; background: var(--raised); font-size: calc(13px * var(--ts, 1)); }
.pk-pong-chip.now { box-shadow: inset 0 0 0 2px var(--accent-text); }
.pk-pong-chip span { color: var(--muted); }
.pk-pong-tip { margin: 0; text-align: center; }

.pk-pong-scenes { display: flex; gap: 6px; justify-content: center; }
.pk-pong-scene { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--raised); color: var(--text); font: inherit; font-size: calc(13px * var(--ts, 1)); cursor: pointer; }
.pk-pong-scene.on { border-color: var(--accent-text); background: var(--accent-soft); font-weight: 700; }

/* ================================================================= The game dock's top bar, gear menu and rules */
.dock-fold .dock-bar { padding: 10px 6px 10px 14px; }
.dock-fold .dock-chev { transform: rotate(180deg); }
.dock-fold .dock-chev-btn { margin: 0; }
.dock-fold + .dock-head, .dock-head + .dock-fold, .dock-body + .dock-fold { border-top: 1px solid var(--line, #2a2f3a); }
.im-dock.min .dock-fold { display: flex; }
.dock-head { position: relative; display: flex; align-items: center; padding-right: 6px; }
.dock-head .dock-bar { flex: 1; min-width: 0; padding-right: 4px; }
.dock-gear, .dock-chev-btn { display: grid; flex: none; place-items: center; width: 38px; height: 38px; margin: 8px 0 0; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--text); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.dock-gear svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dock-gear:hover, .dock-chev-btn:hover, .dock-gear.on { background: var(--raised); }
.dock-menu { display: flex; flex-direction: column; gap: 6px; width: min(100%, 360px); margin: 0 auto 8px; }
.dock-menu-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--raised); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.dock-menu-item span { color: var(--muted); font-size: calc(13px * var(--ts, 1)); }
.dock-menu-item.danger b { color: #ff7b7b; }
.dock-menu-item.quiet { align-items: center; background: none; }
.dock-rules { width: min(100%, 420px); margin: 0 auto 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--raised); text-align: left; }
.dock-rules h4 { margin: 0 0 6px; }
.dock-rules ul { margin: 0 0 10px; padding-left: 18px; }
.dock-rules li { margin: 0 0 6px; line-height: 1.4; }
.cost-sheet { margin: 4px 0 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.cost-sheet h5 { margin: 0 0 6px; font-size: calc(14px * var(--ts, 1)); }
.cost-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.cost-head { min-width: 0; }
.cost-head b { display: block; }
.cost-head small { display: block; opacity: .75; line-height: 1.3; }
.cost-cards { display: flex; flex: none; justify-content: flex-end; flex-wrap: wrap; max-width: 52%; gap: 3px; }
.cost-card { width: 30px; height: 42px; border-radius: 4px; object-fit: cover; box-shadow: 0 1px 3px rgba(0, 0, 0, .45); }
.cost-bank { margin: 8px 0 0; font-size: calc(13px * var(--ts, 1)); opacity: .8; line-height: 1.35; }
[data-mode="light"] .dock-menu-item.danger b { color: #c62828; }

/* ================================================================= Battleship: HIT! / MISS / SUNK! call-outs and their fleet list */
.bs-flash { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8%; text-align: center; pointer-events: auto; cursor: pointer; animation: bs-flash 2.6s ease-out both; }
.bs-flash b { font: 900 clamp(44px, 22cqi, 96px)/1 Impact, "Arial Black", system-ui, sans-serif; letter-spacing: .04em; color: #fff; -webkit-text-stroke: 2px rgba(0, 0, 0, .55); text-shadow: 0 4px 0 rgba(0, 0, 0, .45), 0 0 28px currentColor; transform: rotate(-8deg); animation: bs-stamp .45s cubic-bezier(.2, 1.6, .4, 1) both; animation-delay: inherit; }
.bs-flash span { max-width: 92%; padding: 6px 12px; border-radius: 999px; background: rgba(0, 0, 0, .66); color: #fff; font-weight: 700; font-size: clamp(13px, 5cqi, 17px); }
.bs-flash.hit b, .bs-flash.ouch b { color: #ff3b30; }
.bs-flash.sunk b { color: #ff7a00; }
.bs-flash.win b { color: #ffd23f; }
.bs-flash.miss b, .bs-flash.safe b { color: #cfe8ff; font-size: clamp(36px, 16cqi, 72px); }
.bs-flash.lose b { color: #9aa3ad; }
.bs-flash.hit, .bs-flash.sunk, .bs-flash.ouch, .bs-flash.win { background: radial-gradient(circle, rgba(255, 60, 30, .28), transparent 70%); }
.bs-flash.ouch { animation-name: bs-flash, bs-shake; animation-duration: 2.6s, .5s; }
@keyframes bs-flash { 0% { opacity: 0; } 6% { opacity: 1; } 78% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
@keyframes bs-stamp { 0% { transform: rotate(-8deg) scale(2.6); opacity: 0; } 100% { transform: rotate(-8deg) scale(1); opacity: 1; } }
@keyframes bs-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.bs-roster { display: flex; flex-direction: column; gap: 3px; margin: 0; padding: 0; list-style: none; font-size: calc(12px * var(--ts, 1)); }
.bs-roster li { display: flex; justify-content: space-between; gap: 6px; padding: 3px 8px; border-radius: 8px; background: var(--raised); }
.bs-r-len { color: #6fb6ff; letter-spacing: -1px; font-size: 10px; }
.bs-roster li.gone { opacity: .6; }
.bs-roster li.gone .bs-r-name { text-decoration: line-through; text-decoration-color: #ff3b30; text-decoration-thickness: 2px; }
.bs-roster li.gone .bs-r-len { color: #ff3b30; }
@media (prefers-reduced-motion: reduce) { .bs-flash, .bs-flash b { animation-duration: 2.6s, 0s; } }

/* ================================================================= Four-Player Chess: Brad's marble cross board */
.c4 { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; }
.c4-board { position: relative; width: min(100%, 560px, 64vh); aspect-ratio: 1; container-type: inline-size; border-radius: 10px; overflow: hidden; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.c4-stage { position: absolute; inset: 0; transform-origin: 0 0; will-change: transform; }
.c4-board { touch-action: none; -webkit-user-select: none; user-select: none; }
.c4-fit { position: absolute; top: 8px; right: 8px; z-index: 60; display: none; padding: 6px 12px; border: 1px solid rgba(242, 200, 106, .6); border-radius: 999px; background: rgba(0, 0, 0, .7); color: #f3dfa6; font: 700 13px/1 system-ui, sans-serif; cursor: pointer; }
.c4-board.zoomed .c4-fit { display: block; }
.c4-img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; pointer-events: none; -webkit-user-drag: none; }
.c4-sq { position: absolute; width: 5.9011%; height: 5.9011%; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.c4-sq.last::before { position: absolute; inset: 0; background: rgba(226, 184, 96, .34); content: ''; }
.c4-sq.sel { box-shadow: inset 0 0 0 .5cqw #f2c86a; }
.c4-sq.go::after { position: absolute; left: 34%; top: 34%; z-index: 30; width: 32%; height: 32%; border-radius: 50%; background: rgba(242, 200, 106, .85); box-shadow: 0 0 0 .2cqw rgba(0, 0, 0, .35); content: ''; }
.c4-sq.cap::after { position: absolute; inset: 6%; z-index: 30; border: .55cqw solid rgba(242, 200, 106, .95); border-radius: 50%; content: ''; }
.c4-sq.check::before { position: absolute; inset: 0; background: radial-gradient(circle, rgba(235, 50, 50, .95), rgba(235, 50, 50, 0) 72%); content: ''; }
.c4-pc { position: absolute; left: 4.35%; bottom: 21%; z-index: 1; width: 91.3%; height: auto; max-width: none; pointer-events: none; -webkit-user-drag: none; filter: drop-shadow(0 .3cqw .3cqw rgba(0, 0, 0, .6)); }
.c4-plate { position: absolute; z-index: 40; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.c4-plate span { overflow: hidden; max-width: 78cqw; color: #f3dfa6; font: 700 2.5cqw/1 Georgia, "Times New Roman", serif; letter-spacing: .08em; text-transform: uppercase; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 .15cqw .2cqw rgba(0, 0, 0, .8); }
.c4-plate.v span { flex: none; max-width: none; width: 28cqw; text-align: center; }
.c4-plate.v.up span { transform: rotate(-90deg); }
.c4-plate.v.down span { transform: rotate(90deg); }
.c4-plate.now span { color: #fff; text-shadow: 0 0 1.2cqw #ffd76a, 0 .15cqw .2cqw rgba(0, 0, 0, .8); }
.c4-plate.out span { color: rgba(243, 223, 166, .45); text-decoration: line-through; }
/* Chess (4-Player) setup sheet: a row per person or empty side, with chips to pick from. */
.c4set-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 7px 12px; }
.c4set-row > span { flex: 1 1 84px; min-width: 0; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.c4set-chips { display: flex; flex: none; gap: 5px; }
.c4set-chip { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--raised); color: var(--text); font: inherit; font-size: calc(13px * var(--ts, 1)); cursor: pointer; }
.c4set-chip.on { border-color: transparent; background: var(--accent); color: var(--on-accent); font-weight: 700; }
.c4set-chip.side-r.on { background: #c73434; color: #fff; }
.c4set-chip.side-b.on { background: #2f6fd6; color: #fff; }
.c4set-chip.side-y.on { background: #d2a92b; color: #1d1600; }
.c4set-chip.side-g.on { background: #2c9a4b; color: #fff; }
.c4-news { margin: 0; color: var(--muted); font-size: calc(13px * var(--ts, 1)); text-align: center; }

/* Reactions on a post: the hold-to-pick row and the list of who reacted (see client.js) */
.react-emoji { font-size: calc(20px * var(--ts, 1)); line-height: 1; letter-spacing: -2px; }
.react-back { position: fixed; inset: 0; z-index: 70; }
.react-back.dim { display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, .5); }
.react-pop { position: fixed; display: flex; align-items: center; gap: 2px; padding: 6px 8px; border-radius: 30px; background: #24262c; box-shadow: 0 8px 28px rgba(0, 0, 0, .5); animation: react-pop .16s ease-out; -webkit-user-select: none; user-select: none; }
.react-btn { width: 42px; height: 42px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: none; font-size: calc(27px * var(--ts, 1)); line-height: 1; cursor: pointer; transition: transform .1s; }
.react-btn:active { transform: scale(1.25); }
.react-btn.on { background: #1f3a5f; }
@keyframes react-pop { from { opacity: 0; transform: translateY(8px) scale(.9); } }
.react-sheet { display: flex; flex-direction: column; gap: 4px; width: min(100%, 460px); max-height: 70vh; overflow-y: auto; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; background: var(--card, #17191f); color: var(--text); }
.react-sheet-title { margin: 0 0 6px; font-size: calc(17px * var(--ts, 1)); }
.react-row { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 10px; color: inherit; text-decoration: none; }
.react-row:hover { background: var(--raised); text-decoration: none; }
.react-row-name { flex: 1; min-width: 0; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.react-row-emoji { font-size: calc(22px * var(--ts, 1)); }
.react-sheet .button.wide { margin-top: 10px; }
[data-mode="light"] .react-pop { background: #fff; box-shadow: 0 4px 18px rgba(0, 0, 0, .18); }
[data-mode="light"] .react-btn.on { background: #d6e4ff; }

/* ---- Mexican Train dominoes ---- */
.mt { gap: 6px; }
.mt-tile { display: inline-flex; align-items: stretch; flex: none; padding: 0; margin: 0; border: 1px solid #b9b2a3; border-radius: 6px; background: linear-gradient(#fffdf6, #efe9da); box-shadow: 0 1px 2px rgba(0, 0, 0, .35); font: inherit; line-height: 1; }
.mt-tile.dbl { border-color: #c79a2b; box-shadow: 0 0 0 1px #e6c463, 0 1px 2px rgba(0, 0, 0, .35); }
.mt-half { display: flex; align-items: center; justify-content: center; width: var(--mt, 30px); height: var(--mt, 30px); font-weight: 800; font-size: calc(var(--mt, 30px) * .6); }
.mt-half svg { display: block; width: 100%; height: 100%; }
.mt-bar { width: 1px; margin: 3px 0; background: #b9b2a3; }
.mt-trains { display: flex; flex-direction: column; gap: 5px; width: 100%; max-height: 38vh; overflow-y: auto; }
.mt-train { flex: none; }
.mt-train { display: flex; flex-direction: column; gap: 3px; width: 100%; margin: 0; padding: 5px 8px; border: 1px solid var(--line); border-left: 4px solid var(--pc, var(--accent)); border-radius: 10px; background: var(--raised); color: var(--text); font: inherit; text-align: left; }
button.mt-train { cursor: default; }
.mt-train.usable { border-color: var(--accent-line); border-left-color: var(--pc, var(--accent)); }
.mt-train.goes { cursor: pointer; border-color: #ffd84a; border-left-color: var(--pc, var(--accent)); background: rgba(255, 216, 74, .14); box-shadow: 0 0 0 2px rgba(255, 216, 74, .45); }
.mt-who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: calc(13px * var(--ts, 1)); }
.mt-flag { padding: 1px 7px; border-radius: 999px; background: rgba(245, 165, 36, .2); color: var(--text); font-size: calc(12px * var(--ts, 1)); }
.mt-need { margin-left: auto; color: var(--muted); font-size: calc(12px * var(--ts, 1)); }
.mt-strip { --mt: 22px; display: flex; align-items: center; gap: 3px; padding: 2px 1px 4px; overflow-x: auto; scrollbar-width: thin; }
.mt-tile.hub { opacity: .75; }
.mt-tile.new { outline: 2px solid #ffd84a; outline-offset: 1px; }
.mt-hand { --mt: 30px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; width: 100%; padding-top: 2px; }
.mt-hand.mine .mt-tile { opacity: .5; }
.mt-hand.mine .mt-tile.ok { opacity: 1; cursor: pointer; }
.mt-hand .mt-tile.sel { transform: translateY(-5px); outline: 3px solid #ffd84a; outline-offset: 1px; }
.mt-news { color: var(--text); }
.mt-warn { color: var(--text); font-weight: 700; }
.mt-train.cover { border-color: #ff9f43; border-left-color: var(--pc, var(--accent)); box-shadow: 0 0 0 1px rgba(255, 159, 67, .5); }
.mt-flag.mt-cover { background: rgba(255, 159, 67, .2); color: #ffb870; font-weight: 700; }
.dock-actions .button.mt-mode { padding: 6px 12px; font-size: calc(12px * var(--ts, 1)); }

/* Messenger people row: "3m" on someone who went offline that many minutes ago */
.avatar .ago { position: absolute; right: -4px; bottom: -2px; min-width: 24px; padding: 2px 5px; border: 2px solid var(--bg, #0b0d12); border-radius: 999px; background: var(--raised-hover); color: var(--text); font-size: 11px; font-weight: 700; line-height: 1.1; text-align: center; }

/* ---- Forum, Interests and ads ---- */
.forum-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.forum-head .settings-title { margin: 0; }
.forum-cats { margin: 10px 0; }
.forum-star { color: #ffb81c; }
.forum-about { margin: 0 4px 10px; }
.forum-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; padding: 12px 14px; color: var(--text); }
.forum-row:hover { border-color: var(--accent-line); text-decoration: none; }
.forum-main { display: flex; flex: 1; flex-direction: column; min-width: 0; gap: 2px; }
.forum-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(16px * var(--ts, 1)); }
.forum-tags { display: flex; flex: none; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.forum-tag { padding: 2px 8px; border: 1px solid var(--line); border-radius: 20px; color: var(--muted); font-size: calc(12px * var(--ts, 1)); font-weight: 600; }
.forum-tag.friends { border-color: var(--accent-line); color: var(--accent-text); }
.forum-count { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: calc(13px * var(--ts, 1)); }
.forum-count .icon { width: 16px; height: 16px; }
.forum-back { margin: 0 0 8px; }
.forum-form { display: block; margin-top: 12px; }
.forum-form select, .forum-form input[type=text], .forum-form textarea { width: 100%; }
.forum-vis { margin: 14px 0 0; padding: 0; border: 0; }
.forum-vis legend { padding: 0; font-weight: 600; font-size: calc(14px * var(--ts, 1)); }
.forum-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.forum-thread { display: flex; flex-direction: column; gap: 10px; }
.forum-h1 { font-size: calc(24px * var(--ts, 1)); font-weight: 800; letter-spacing: -.2px; }
.forum-h2 { margin: 16px 4px 8px; font-size: calc(16px * var(--ts, 1)); font-weight: 700; }
.forum-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.forum-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.forum-tools form { display: inline; margin: 0; }
.forum-reply { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; padding: 12px 14px; }
.interest-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px; }
.interest-chip { display: inline-block; margin: 0; cursor: pointer; }
.interest-chip input { position: absolute; opacity: 0; pointer-events: none; }
.interest-chip span { display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 20px; color: var(--muted); font-weight: 600; font-size: calc(14px * var(--ts, 1)); }
.interest-chip input:checked + span { border-color: var(--accent-line); background: var(--accent-soft); color: var(--text); }
.interest-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.ad-card { display: flex; flex-direction: column; margin-top: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--raised); }
.ad-image { display: block; width: 100%; max-height: 220px; object-fit: cover; }
.ad-body { padding: 12px 14px 14px; }
.ad-label { margin: 0 0 6px; color: var(--muted); font-size: calc(12px * var(--ts, 1)); }
.ad-title { margin: 0 0 6px; font-size: calc(18px * var(--ts, 1)); font-weight: 700; }
.ad-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 10px; }
.ad-actions form { margin: 0; }
.ad-hidden { margin-top: 16px; }
.ad-hidden form { margin: 4px 0; }
.admin-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 2px; }
.admin-row input[type=text], .admin-row select { flex: 1 1 160px; width: auto; min-width: 0; }
.admin-row input[type=number] { width: 70px; }
.ad-admin { margin: 10px 0; padding: 8px 0; border-top: 1px solid var(--line); }
.ad-admin summary { cursor: pointer; }

/* ---- The Forum / Business / Interests bar at the top of Home, and the Business page ---- */
.hub-tabs { justify-content: space-around; margin: 0 0 12px; }
.hub-tabs a { flex: 1 1 0; justify-content: center; }
.biz-card { display: flex; flex-direction: column; margin-bottom: 10px; overflow: hidden; }
.biz-image { display: block; width: 100%; max-height: 240px; object-fit: cover; }
.biz-body { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; }
.biz-name { font-size: calc(20px * var(--ts, 1)); font-weight: 800; }
.biz-contact { margin: 0; }

/* ---- Pages ---- */
.pg-head { display: flex; flex-direction: column; margin-bottom: 12px; overflow: hidden; }
.pg-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; padding: 12px 14px; }
.pg-logo { flex: none; width: 52px; height: 52px; border-radius: 12px; object-fit: cover; background: var(--raised); }
.pg-logo.blank { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.pg-main { display: flex; flex: 1; flex-direction: column; min-width: 0; gap: 2px; color: var(--text); }
.pg-main:hover { text-decoration: none; }
.pg-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(16px * var(--ts, 1)); }
.pg-row form { flex: none; margin: 0; }
.pg-post { display: flex; flex-direction: column; margin-bottom: 10px; overflow: hidden; }
.pg-post-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 0; color: var(--text); }
.pg-post-head .pg-logo { width: 36px; height: 36px; border-radius: 9px; }
.pg-post .forum-body { padding: 10px 14px; }
.pg-post .forum-tools { padding: 0 14px 12px; }
.pg-search { display: flex; gap: 8px; margin-bottom: 10px; }
.pg-search input { flex: 1; margin: 0; }
.pg-suggest { color: #ffb81c; font-weight: 600; }

.pg-like { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 20px; background: none; color: var(--muted); font: inherit; font-size: calc(13px * var(--ts, 1)); font-weight: 600; cursor: pointer; }
.pg-like .icon { width: 16px; height: 16px; }
.pg-like:hover { border-color: var(--accent-line); color: var(--text); }
.pg-like.on { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-text); }
.pg-feed-tools { padding-top: 10px; }
.pg-comments { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); }
.pg-comment { display: flex; gap: 10px; }
.pg-comment-body { flex: 1; min-width: 0; }
.pg-comment .forum-body { padding: 2px 0 4px; }
.pg-comment .forum-tools { padding: 0; }
.pg-comment-form { display: flex; gap: 8px; }
.pg-comment-form input { flex: 1; min-width: 0; margin: 0; }
.pg-alert-note { margin: 0; font-size: calc(13px * var(--ts, 1)); }

/* ---- Calls ---- */
.im-icon.im-call[hidden] { display: none; }
.call-screen { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #0b0d12; color: #fff; }
.call-remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #0b0d12; opacity: 0; pointer-events: none; }
.call-screen.with-video .call-remote { opacity: 1; }
.call-who { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 0 24px; text-align: center; }
.call-photo { width: 124px; height: 124px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 4px rgba(255, 255, 255, .12); }
.call-name { font-size: 26px; font-weight: 800; }
.call-status { min-height: 1.4em; color: rgba(255, 255, 255, .8); font-size: 16px; }
.call-screen.with-video .call-who { position: absolute; top: calc(18px + env(safe-area-inset-top)); left: 0; right: 0; flex-direction: row; justify-content: center; gap: 10px; text-shadow: 0 1px 6px rgba(0, 0, 0, .8); }
.call-screen.with-video .call-photo { display: none; }
.call-screen.with-video .call-name { font-size: 18px; }
.call-local { position: absolute; right: 14px; bottom: calc(118px + env(safe-area-inset-bottom)); width: 28vw; max-width: 150px; aspect-ratio: 3 / 4; border-radius: 14px; object-fit: cover; background: #1a1d26; box-shadow: 0 4px 18px rgba(0, 0, 0, .5); }
.call-local.mirror { transform: scaleX(-1); }
.call-local[hidden] { display: none; }
.call-buttons { position: absolute; left: 0; right: 0; bottom: calc(28px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: center; gap: 18px; }
.call-btn { display: grid; width: 62px; height: 62px; place-items: center; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; cursor: pointer; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.call-btn svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.call-btn.off { background: #fff; color: #0b0d12; }
.call-btn.red { background: #e0102a; }
.call-btn.green { background: #1faa55; }
.call-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* Voice messages: the microphone in the message bar, the recording strip, and the player in a bubble. */
.im-mic { display: grid; flex: none; width: 40px; height: 40px; margin: 0; padding: 0; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; transition: transform .15s, background .15s, color .15s; }
.im-mic svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.im-mic:disabled { opacity: .45; cursor: default; }
.im-mic:not(:disabled):hover { color: var(--text); }
.im-mic.live { background: var(--accent); color: var(--on-accent); transform: scale(1.35); }
.im-field.recording .chat-input { display: none; }
.im-rec { display: flex; flex: 1; align-items: center; gap: 10px; min-width: 0; padding: 14px 0; font-size: calc(16px * var(--ts, 1)); }
.im-rec[hidden] { display: none; }
.im-rec-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #e5484d; animation: im-rec-blink 1s ease-in-out infinite; }
.im-rec-time { flex: none; font-variant-numeric: tabular-nums; font-weight: 600; }
.im-rec-hint { min-width: 0; overflow: hidden; color: var(--muted); font-size: calc(13px * var(--ts, 1)); text-overflow: ellipsis; white-space: nowrap; }
.im-rec.cancel .im-rec-hint { color: #e5484d; font-weight: 600; }
@keyframes im-rec-blink { 50% { opacity: .25; } }
.im-voice { display: flex; align-items: center; gap: 10px; width: min(250px, 62vw); padding: 2px 0; }
.im-voice-play { display: grid; flex: none; width: 42px; height: 42px; margin: 0; padding: 0; place-items: center; border: 0; border-radius: 50%; background: rgba(127,127,127,.3); color: inherit; cursor: pointer; }
.im-voice-play svg { width: 22px; height: 22px; fill: currentColor; }
.im-voice-bars { display: flex; flex: 1; align-items: center; gap: 2px; min-width: 0; height: 34px; }
.im-voice-bars span { flex: 1; min-width: 1px; min-height: 3px; border-radius: 2px; background: currentColor; opacity: .38; transition: opacity .2s; }
.im-voice-bars span.played { opacity: 1; }
.im-voice-time { flex: none; font-size: calc(12px * var(--ts, 1)); font-variant-numeric: tabular-nums; opacity: .8; }
.im-audio { display: block; width: min(260px, 64vw); margin-top: 6px; }
@media (prefers-reduced-motion: reduce) { .im-rec-dot { animation: none; } .im-mic { transition: none; } }

/* The banner at the top of Hello when something happens in another chat. Tap to open, swipe to put away. */
.hello-nudge { position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 50%; z-index: 80; display: flex; align-items: center; gap: 10px; width: min(440px, calc(100vw - 20px)); margin-left: calc(min(440px, calc(100vw - 20px)) / -2); padding: 12px 8px 12px 16px; border: 1px solid rgba(255,255,255,.12); border-radius: 18px; background: #26282e; color: #fff; box-shadow: 0 8px 28px rgba(0,0,0,.45); cursor: pointer; touch-action: none; -webkit-user-select: none; user-select: none; animation: hello-nudge-in .22s ease-out; transition: transform .2s ease-out, opacity .2s ease-out; }
.hello-nudge-words { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.hello-nudge-title { overflow: hidden; font-size: calc(15px * var(--ts, 1)); text-overflow: ellipsis; white-space: nowrap; }
.hello-nudge-body { overflow: hidden; font-size: calc(14px * var(--ts, 1)); opacity: .85; text-overflow: ellipsis; white-space: nowrap; }
.hello-nudge-close { flex: none; width: 36px; height: 36px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: none; color: inherit; font-size: 22px; line-height: 1; opacity: .7; cursor: pointer; }
.hello-nudge-close:hover { background: rgba(255,255,255,.12); opacity: 1; }
.hello-nudge.leaving { opacity: 0 !important; transform: translateY(-120%) !important; }
.hello-nudge.leaving.left { transform: translateX(-120%) !important; }
.hello-nudge.leaving.right { transform: translateX(120%) !important; }
@keyframes hello-nudge-in { from { opacity: 0; transform: translateY(-120%); } }
[data-mode="light"] .hello-nudge { border-color: rgba(0,0,0,.08); background: #16181d; }
@media (prefers-reduced-motion: reduce) { .hello-nudge { animation: none; transition: none; } }

/* Hello keys: how friends are added. */
.friend-key { margin: 6px 0 12px; font: 700 1.5rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .08em; text-align: center; user-select: all; overflow-wrap: anywhere; }
.friend-key-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 10px; }
.key-mode { display: grid; gap: 6px; margin: 10px 0; }

/* Admin mode: a slim reminder under the top bar while it is on. */
.admin-bar { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0; padding: 6px 12px; background: #7a4b00; color: #fff; font-size: calc(13px * var(--ts, 1)); }
.admin-bar button { margin: 0; padding: 3px 10px; border: 1px solid rgba(255,255,255,.6); border-radius: 999px; background: none; color: inherit; font: inherit; cursor: pointer; }
.set-group form { margin: 0; }
button.set-row { width: 100%; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }

/* The admin area. */
.admin-note { margin: 12px 4px; }
.admin-numbers { margin: 0; display: grid; gap: 0; }
.admin-numbers div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.admin-numbers div:last-child { border-bottom: 0; }
.admin-numbers dt { color: var(--muted); }
.admin-numbers dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.button.danger { color: #ff7a7a; border-color: rgba(255, 122, 122, .5); }
[data-mode="light"] .button.danger { color: #c62828; border-color: rgba(198, 40, 40, .5); }
.trend-table progress { width: 34px; height: 8px; vertical-align: middle; accent-color: var(--accent); }
.trend-table td { white-space: nowrap; }
.log-row { padding: 9px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.log-row small { display: block; margin-top: 2px; }

/* Analytics. One blue for every chart (each shows a single series); text stays in the page's own text colors. */
:root { --ax-series: #3987e5; }
[data-mode="light"] { --ax-series: #2a78d6; }
.ax-range { display: inline-flex; gap: 4px; margin: 0 0 14px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--raised); }
.ax-range-pick { padding: 6px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: calc(14px * var(--ts, 1)); }
.ax-range-pick:hover { text-decoration: none; color: var(--text); }
.ax-range-pick.on { background: var(--ax-series); color: #fff; }
.ax-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.ax-tile { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--card-top, var(--raised)); min-width: 0; }
.ax-tile-label { color: var(--muted); font-size: calc(13px * var(--ts, 1)); }
.ax-tile-value { font-size: calc(30px * var(--ts, 1)); line-height: 1.1; font-variant-numeric: tabular-nums; }
.ax-tile-note { color: var(--muted); font-size: calc(12.5px * var(--ts, 1)); }
.ax-arrow { color: var(--text); }
.ax-grid-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.ax-card .body { padding-top: 6px; }
.ax-sub { margin: 0 0 6px; font-size: calc(13px * var(--ts, 1)); }
.ax-chart { display: block; width: 100%; height: auto; overflow: visible; }
.ax-grid { stroke: var(--line); stroke-width: 1; }
.ax-base { stroke: var(--muted); stroke-opacity: .6; }
.ax-label, .ax-name, .ax-value { fill: var(--muted); font-size: 11.5px; font-family: inherit; }
.ax-name { fill: var(--text); font-size: 12.5px; }
.ax-value { fill: var(--text); font-size: 12.5px; font-weight: 700; }
.ax-bar { fill: var(--ax-series); }
.ax-line { fill: none; stroke: var(--ax-series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ax-area { fill: var(--ax-series); fill-opacity: .12; }
.ax-hit { fill: transparent; }
.ax-dot { fill: var(--ax-series); stroke: var(--card-top, #13151a); stroke-width: 2; opacity: 0; }
.ax-pt { outline: none; cursor: default; }
.ax-pt.on .ax-dot, .ax-pt:focus-visible .ax-dot { opacity: 1; }
.ax-pt.on .ax-hit, .ax-pt:focus-visible .ax-hit { fill: var(--text); fill-opacity: .06; }
.ax-tip { position: fixed; z-index: 90; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card-top, #13151a); color: var(--text); font-size: calc(13px * var(--ts, 1)); font-weight: 600; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); pointer-events: none; white-space: nowrap; }
.ax-table-box > summary { padding: 14px 16px; cursor: pointer; font-weight: 600; }
.ax-section { margin: 18px 4px 10px; font-size: calc(18px * var(--ts, 1)); }
@media (min-width: 760px) {
  .ax-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Account: two-step login. */
.backup-codes { list-style: none; margin: 8px 0; padding: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; border: 1px dashed var(--line); border-radius: 12px; font: 600 1rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; user-select: all; }
.two-step-steps { display: grid; gap: 8px; padding-left: 1.2rem; }
.setup-key { display: inline-block; margin-top: 4px; font: 700 1.05rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .04em; user-select: all; overflow-wrap: anywhere; }

/* Terms, rules, privacy and the removal form. */
.legal h3 { margin: 18px 0 4px; }
.legal-links { margin-top: 20px; }
.footer-links { margin: 8px 0 0; font-size: calc(13px * var(--ts, 1)); }
.footer-links a { color: var(--muted); }
.guide-steps { display: grid; gap: 12px; padding-left: 1.3rem; }
.guide h3 { margin: 18px 0 6px; }
.guide ul { display: grid; gap: 6px; padding-left: 1.2rem; }

/* A solo game docked above the message box. */
.solo-dock .solo-body { padding: 0; overflow: hidden; align-items: stretch; }
.solo-frame { display: block; width: 100%; height: min(66dvh, 620px); border: 0; background: #05050a; }
.solo-close { font-size: 24px; line-height: 1; }
.im-window:has(.solo-dock:not(.hidden):not(.min)) .im-log { min-height: 44px; }

/* The Games menu's three tabs. */
.game-tabs { display: flex; gap: 4px; margin: 10px 4px 6px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--raised); }
.game-tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; margin: 0; padding: 8px 6px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: inherit; font-weight: 700; font-size: calc(15px * var(--ts, 1)); cursor: pointer; }
.game-tab small { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: rgba(127, 127, 127, .22); font-size: calc(11.5px * var(--ts, 1)); font-weight: 700; }
.game-tab.on { background: var(--accent); color: var(--on-accent, #fff); }
.game-tab.on small { background: rgba(0, 0, 0, .22); color: inherit; }
.game-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.game-tab-list { min-height: 180px; }
/* A phone on its side (as it is after Star Clash or Kart Clash) is very short. The sheet takes the whole height and the
   games sit two to a row, so the list never looks like it holds only one game. */
@media (max-height: 560px) {
  .im-attach-sheet { max-height: calc(100vh - 6px); max-height: calc(100dvh - 6px); padding-top: 4px; }
  .im-attach-sheet .im-sheet-grip { margin: 2px auto 6px; }
  .im-attach-sheet h3 { margin-bottom: 4px; }
  .im-attach-sheet:has(.game-tabs) { width: min(820px, 100%); }
  .im-attach-sheet .game-tabs { margin: 4px 4px 2px; padding: 2px; }
  .im-attach-sheet .game-tab { padding: 5px 6px; }
  .im-attach-sheet .game-head-note { margin: 2px 4px; }
  .game-tab-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; column-gap: 8px; min-height: 0; }
  .game-tab-list > .game-head-note { grid-column: 1 / -1; }
  .game-tab-list .im-attach-row { align-items: flex-start; gap: 10px; padding: 7px 8px; }
  .game-tab-list .im-attach-words small { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; font-size: calc(13px * var(--ts, 1)); }
}

/* The Poke button on a game board. */
.dock-poke { display: block; margin: 6px auto 2px; padding: 7px 16px; border-radius: 999px; font-size: calc(14px * var(--ts, 1)); }
.dock-poke:disabled { opacity: .6; }
/* The daily question: the strip in the chat, and its sheets. */
.daily-bar { padding: 4px 8px 0; }
.dq-bar { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 8px 8px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--raised); color: inherit; font: inherit; font-size: calc(14px * var(--ts, 1)); text-align: left; cursor: pointer; }
.dq-bar.due { border-color: var(--accent); }
.dq-bar-ico { flex: none; }
.dq-bar-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dq-bar-go { flex: none; padding: 5px 14px; border-radius: 999px; background: rgba(127, 127, 127, .22); font-weight: 700; }
.dq-bar.due .dq-bar-go { background: var(--accent); color: var(--on-accent, #fff); }
.dq-sheet { padding-left: 14px; padding-right: 14px; }
/* Conflict resolution: the three-line form, the feeling words, and each side shown as a quote */
.cr-sheet { max-height: 88vh; overflow-y: auto; }
.cr-sheet .button.wide { width: 100%; margin-top: 8px; }
.cr-field { display: flex; flex-direction: column; gap: 5px; margin: 12px 0; }
.cr-field strong { font-size: calc(16px * var(--ts, 1)); }
.cr-input, .cr-own { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 12px; background: var(--raised); color: inherit; font: inherit; }
.cr-input { resize: vertical; min-height: 58px; }
.cr-own { max-width: 220px; }
.cr-hint { color: #aeb2ba; font-size: calc(12.5px * var(--ts, 1)); }
.cr-tip { padding: 6px 9px; border-radius: 9px; background: rgba(240, 191, 46, .14); border: 1px solid rgba(240, 191, 46, .5); font-size: calc(12.5px * var(--ts, 1)); }
.cr-drop { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--raised); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.cr-drop-text { font-weight: 600; }
.cr-drop-text.empty { color: #aeb2ba; font-weight: 400; }
.cr-drop-arrow { flex: none; color: #aeb2ba; }
.cr-panel { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.cr-panel.hidden { display: none; }
.cr-panel-done { align-self: flex-end; padding: 6px 16px; }
.cr-chip:disabled { opacity: .4; cursor: default; }
.cr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cr-chip { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: none; color: inherit; font: inherit; font-size: calc(14px * var(--ts, 1)); cursor: pointer; }
.cr-chip.on { border-color: var(--accent); background: var(--accent); color: var(--on-accent, #fff); font-weight: 700; }
.cr-preview, .cr-quote { margin: 10px 0; padding: 10px 12px; border-radius: 14px; background: var(--raised); border-left: 4px solid #8f949c; }
.cr-quote.me, .cr-preview { border-left-color: var(--accent); }
.cr-preview small, .cr-quote small { color: #aeb2ba; font-size: calc(12px * var(--ts, 1)); font-weight: 700; }
.cr-preview p, .cr-quote p { margin: 3px 0 0; font-size: calc(15.5px * var(--ts, 1)); line-height: 1.4; }
.cr-note { margin: 10px 0; color: #c7cad1; font-size: calc(14px * var(--ts, 1)); }
.cr-done { margin: 12px 0 4px; font-size: calc(17px * var(--ts, 1)); font-weight: 800; }
.cr-head { margin: 16px 0 4px; font-size: calc(14px * var(--ts, 1)); color: #aeb2ba; }
.cr-row-ico { flex: none; width: 28px; text-align: center; font-size: 20px; }
.cr-safety { margin: 16px 0 4px; padding-top: 10px; border-top: 1px solid var(--line); color: #aeb2ba; font-size: calc(12px * var(--ts, 1)); }
.dq-sheet h3 { margin-left: 0; }
.dq-intro { margin: 4px 0 12px; color: var(--muted); line-height: 1.45; }
.dq-card { padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--raised); }
.dq-day { display: block; color: var(--muted); font-size: calc(12.5px * var(--ts, 1)); }
.dq-q { margin: 6px 0 12px; font-size: calc(19px * var(--ts, 1)); font-weight: 700; line-height: 1.3; }
.dq-form, .dq-answers, .dq-notes { display: flex; flex-direction: column; gap: 8px; }
.dq-area, .dq-search { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--field, rgba(127, 127, 127, .12)); color: inherit; font: inherit; }
.dq-area { resize: vertical; min-height: 76px; }
.dq-search { margin: 10px 0 4px; }
.dq-hint { margin: 0; color: var(--muted); font-size: calc(13px * var(--ts, 1)); }
.dq-send { align-self: flex-end; }
.dq-answer { padding: 8px 12px; border-radius: 12px; background: rgba(127, 127, 127, .12); }
.dq-answer.me { background: rgba(127, 127, 127, .06); }
.dq-answer strong { font-size: calc(13px * var(--ts, 1)); color: var(--accent-text, var(--accent)); }
.dq-answer p, .dq-entry p { margin: 2px 0 0; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.dq-link { align-self: flex-start; padding: 6px 0; border: 0; background: none; color: var(--accent-text, var(--accent)); font: inherit; font-size: calc(14px * var(--ts, 1)); cursor: pointer; }
.dq-back { display: block; margin-bottom: 6px; }
.dq-off { display: block; margin: 10px 0 0; color: #e5484d; }
.dq-more { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.dq-more .button { flex: 1 1 auto; }
.dq-deck.on { outline: 2px solid var(--accent); }
.dq-notes { margin: 4px 0 6px; }
.dq-notes > span { font-weight: 700; }
.dq-book { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.dq-entry { padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; }
.dq-entry strong { display: block; margin: 2px 0; }
.dq-swap { margin-top: -6px; }
.dq-review { flex-basis: 100% !important; }
.dq-auto { display: flex; align-items: flex-start; gap: 12px; margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.dq-auto input { flex: none; width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--accent); }
.dq-auto span { display: flex; flex-direction: column; gap: 2px; }
.dq-auto small { color: var(--muted); }

/* "Add friends" beside the friend count on your own profile */
.add-friends-link { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; vertical-align: middle; }
.add-friends-link svg { width: 18px; height: 18px; }

/* Settings > Phone permissions */
.perm-state { font-weight: 600; }
.perm-state[data-kind="on"]::before { content: "\2713  "; color: #1e9e55; }
.perm-state[data-kind="blocked"] { color: #d6453d; }
.perm-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
#perm-help details { border-top: 1px solid var(--line); padding: 4px 0; }
#perm-help summary { cursor: pointer; font-weight: 600; padding: 10px 0; }

/* Open Sea Battleship. One big sea as wide as the screen; numbers across the top, letters down the side. */
.osea { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.osea-frame { position: relative; display: grid; grid-template-columns: 5.5% minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); column-gap: 1%; width: min(100%, 72vh); margin: 0 auto; padding: 1.2% 1.8% 1.8% 1.2%; border-radius: 12px; background: linear-gradient(160deg, #3b4048, #1c2026 45%, #2b3037); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 8px 24px rgba(0, 0, 0, .5); container-type: inline-size; }
.osea-cols { grid-column: 2; grid-row: 1; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); padding: 1cqw 0; }
.osea-rows { grid-column: 1; grid-row: 2; display: grid; grid-template-rows: repeat(var(--n), minmax(0, 1fr)); }
.osea-cols span, .osea-rows span { display: flex; align-items: center; justify-content: center; color: #e6eaf0; font: 800 clamp(7px, calc(40cqw / var(--n)), 15px)/1 "Arial Black", "Segoe UI", system-ui, sans-serif; text-shadow: 0 1px 0 #000; }
.osea-water { position: relative; grid-column: 2; grid-row: 2; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); grid-template-rows: repeat(var(--n), minmax(0, 1fr)); aspect-ratio: 1; overflow: hidden; border-radius: 1cqw; background-color: #0e3a66; background-image: linear-gradient(rgba(150, 205, 255, .38) 1px, transparent 1px), linear-gradient(90deg, rgba(150, 205, 255, .38) 1px, transparent 1px), url(/sea/water.webp?v=2); background-size: calc(100% / var(--n)) calc(100% / var(--n)), calc(100% / var(--n)) calc(100% / var(--n)), 100% 100%; box-shadow: inset 0 0 0 .5cqw #0a0c0f, inset 0 0 4cqw rgba(0, 0, 0, .45); }
.osea-c { position: relative; z-index: 2; min-width: 0; min-height: 0; padding: 0; border: 0; background: transparent; cursor: default; }
.osea-c.open { cursor: crosshair; }
.osea-c.sel { box-shadow: inset 0 0 0 2px #ffd84a; background: rgba(255, 216, 74, .25); }
.osea-c.last { background: rgba(255, 221, 51, .22); }
.osea-c .peg { width: 62%; height: 62%; }
.osea-c .peg.white { width: 50%; height: 50%; }
.osea-ship { position: absolute; z-index: 1; pointer-events: none; }
.osea-ship-pic { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: fill; }
.osea-ship.own { opacity: .5; }
.osea-ship.own::after, .osea-ship.sunk::after, .osea-ship.reveal::after { position: absolute; inset: 4%; border: 2px solid var(--pc, #fff); border-radius: 30%; content: ''; }
.osea-ship.picked { opacity: 1; filter: drop-shadow(0 0 4px #ffd84a); }
.osea-ship.sunk .osea-ship-pic { filter: brightness(.6) sepia(.45) saturate(1.5) hue-rotate(-20deg); }
.osea-ship.reveal { opacity: .8; }
.osea-frame .bs-flash { grid-column: 1 / -1; grid-row: 1 / -1; }
.osea-news { margin: 0; text-align: center; font-weight: 600; }
.osea-hint { margin: 0; text-align: center; color: var(--muted); }
.osea-hint.warn { color: #ffb36b; }
.osea-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.osea-fire { min-width: 60%; }
.osea-log { display: flex; flex-direction: column; gap: 6px; }
.osea-log-row { padding: 8px 10px; border-radius: 12px; background: var(--raised); box-shadow: inset 4px 0 0 var(--pc); }
.osea-log-row.now { box-shadow: inset 4px 0 0 var(--pc), 0 0 0 2px var(--pc); }
.osea-log-row.out { opacity: .55; }
.osea-log-who { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.osea-log-who small { color: var(--muted); }
.osea-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--pc); }
.osea-log-ships { display: flex; flex-wrap: wrap; gap: 4px; }
.osea-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--bg, rgba(0, 0, 0, .2)); font-size: calc(12px * var(--ts, 1)); }
.osea-chip-len { color: #6fb6ff; font-size: 9px; letter-spacing: -1px; }
.osea-chip.hurt .osea-chip-len { color: #ffb36b; }
.osea-chip.sunk { opacity: .7; }
.osea-chip.sunk .osea-chip-name { text-decoration: line-through; text-decoration-color: #ff3b30; text-decoration-thickness: 2px; }
.osea-chip.sunk .osea-chip-len { color: #ff3b30; }

/* Voice buttons: the 🎙 in a chat's header and on a game's bar (public/voice.js) */
.im-icon.im-voice.live { background: #2fbf71; color: #fff; animation: hv-glow 1.6s ease-in-out infinite; }
.im-icon.im-voice.mine { background: #2fbf71; color: #fff; animation: none; }
.dock-voice { display: grid; flex: none; place-items: center; width: 38px; height: 38px; margin: 8px 0 0; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--text); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.dock-voice svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dock-voice:hover { background: var(--raised); }
.dock-voice.live { background: #2fbf71; color: #fff; }
.dock-voice.on { background: #2fbf71; color: #fff; box-shadow: 0 0 0 3px rgba(47, 191, 113, .35); }
/* On a phone the chat header holds the name and up to six buttons (back, voice, call, video, search, details):
   the buttons shrink a little so the name still has room. */
@media (max-width: 430px) {
  .im-titlebar { gap: 4px; padding-left: 6px; padding-right: 6px; }
  .im-titlebar .im-icon { width: 34px; height: 34px; }
  .im-titlebar .im-icon svg { width: 19px; height: 19px; }
  .topbar .im-titlebar .im-head-avatar img { width: 32px; height: 32px; }
}

/* Getting set up on a phone (public/onboard.js): the iPhone Home Screen steps, the banner, and turning on alerts. */
.ob-screen { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: flex-end; justify-content: center; padding: 12px; background: rgba(0, 0, 0, .62); overflow-y: auto; }
@media (min-width: 640px) { .ob-screen { align-items: center; } }
.ob-card { width: min(100%, 460px); max-height: 100%; overflow-y: auto; padding: 22px 20px calc(18px + env(safe-area-inset-bottom, 0px)); border-radius: 22px; background: var(--card, #16181d); box-shadow: 0 20px 60px rgba(0, 0, 0, .5); color: var(--text); }
.ob-card h2 { margin: 2px 0 8px; font-size: calc(23px * var(--ts, 1)); }
.ob-kicker { margin: 0; color: #2d88ff; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: 12px; }
.ob-lead { margin: 0 0 12px; color: var(--muted); }
.ob-steps { margin: 0 0 14px; padding-left: 22px; }
.ob-steps li { margin: 0 0 10px; line-height: 1.45; }
.ob-ico { display: inline-grid; place-items: center; width: 28px; height: 28px; margin: 0 2px; vertical-align: middle; border-radius: 8px; background: var(--raised, #22252c); color: #2d88ff; }
.ob-ico svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ob-warn { margin: 0 0 14px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 179, 107, .14); color: var(--text); }
.ob-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ob-actions .button { flex: 1; min-width: 140px; }
.ob-bell { font-size: 44px; line-height: 1; }
.ob-note { min-height: 1em; margin: 0 0 12px; font-weight: 600; }
.ob-banner { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 6px; margin: 0 0 10px; padding: 8px 10px; border-radius: 12px; background: #2d88ff; color: #fff; }
.ob-banner-text { flex: 1; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ob-banner-x { flex: none; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .2); color: #fff; font-size: 16px; cursor: pointer; }
.alerts-on { color: #1e9e55; font-weight: 700; white-space: nowrap; }
.alerts-off { color: #d6453d; font-weight: 700; white-space: nowrap; }

/* Mexican Train: arranging your hand. Hold and slide to move a tile; with Arrange on, tap to flip it. */
.mt-hand .mt-tile { touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.mt-hand.arranging .mt-tile { opacity: 1; cursor: pointer; animation: mt-jiggle .9s ease-in-out infinite; }
.mt-hand.arranging .mt-tile:nth-child(2n) { animation-delay: -.45s; }
.mt-hand .mt-tile.drag { z-index: 2; opacity: 1; transform: scale(1.14); outline: 3px dashed #6ff0ff; outline-offset: 2px; animation: none; }
.mt-hand.dragging { touch-action: none; }
.mt-arrange-note { color: #6ff0ff; font-weight: 600; }
@keyframes mt-jiggle { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg); } }
@media (prefers-reduced-motion: reduce) { .mt-hand.arranging .mt-tile { animation: none; } }
/* Admin, Members: each member's email under their name, and a box to find someone */
.member-find { width: 100%; margin: 0 0 10px; }
.member-email { overflow-wrap: anywhere; color: var(--text); }

/* Comments: emoji reactions and replies (threads) */
.comment-main { display: flex; flex-direction: column; min-width: 0; }
.comment-main .comment-bubble { position: relative; align-self: flex-start; max-width: 100%; }
.comment-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; padding: 2px 10px 0; font-size: calc(12.5px * var(--ts, 1)); }
.comment-acts form { display: inline; margin: 0; }
.comment-act { padding: 2px 0; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.comment-act:hover { color: var(--text); }
.comment-act.on { color: var(--accent-text); font-size: 1.15em; }
.comment-when { font-size: .95em; }
.comment-reacts { position: absolute; right: -6px; bottom: -10px; display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px; border: 0; border-radius: 999px; background: var(--card, #1b1e24); box-shadow: 0 1px 4px rgba(0, 0, 0, .4); color: var(--text); font-size: 13px; line-height: 1.4; cursor: pointer; }
.comment-reacts b { color: var(--muted); font-size: 12px; }
.comment-main .comment-bubble:has(.comment-reacts) { margin-bottom: 8px; }
.thread { margin-bottom: 6px; }
.replies { margin-left: 40px; }
.comment.reply .avatar-xs { width: 26px; height: 26px; }
.reply-form { margin: 2px 0 10px 40px; }
.comment-form[hidden] { display: none; }
.react-more { font-weight: 800; color: var(--muted); }
.react-any { width: 170px; margin: 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--raised); color: var(--text); font-size: 18px; }
.react-who { font-size: calc(13px * var(--ts, 1)); color: var(--muted); }
/* Coming back to one comment (#comment-12) keeps its post's comments open. */
.post-comments:has(:target) { display: block; }

/* Battleship, pirate look (picked in the game's ⚙ menu, both styles). Brad's pirate board and ships. The ship
   pictures are 1.5 squares wide so masts and flags can reach past their squares. */
.sea-frame.pirate { border-radius: 2%; background-image: url(/sea/pirate/board.webp?v=1); }
.sea-frame.pirate .gb-sea { left: 10.128%; top: 12.759%; width: 85.486%; height: 78.15%; }
.gb-sea.pirate.mini, .osea-frame.pirate .osea-water { background-color: #0b2134; background-image: linear-gradient(rgba(120, 225, 255, .5) 1px, transparent 1px), linear-gradient(90deg, rgba(120, 225, 255, .5) 1px, transparent 1px), url(/sea/pirate/water.webp?v=1); }
.sea-ship.pirate .sea-ship-pic, .osea-ship.pirate .osea-ship-pic { object-fit: contain; filter: drop-shadow(0 .4cqw .6cqw rgba(0, 0, 0, .6)); }
.sea-ship.pirate.across .sea-ship-pic, .osea-ship.pirate.across .osea-ship-pic { left: 0; top: -25%; width: 100%; height: 150%; }
.sea-ship.pirate.down .sea-ship-pic, .osea-ship.pirate.down .osea-ship-pic { left: -25%; top: 0; width: 150%; height: 100%; }
.sea-ship.pirate.sunk .sea-ship-pic, .osea-ship.pirate.sunk .osea-ship-pic { filter: brightness(.5) sepia(.6) saturate(1.4) hue-rotate(-15deg) drop-shadow(0 .4cqw .6cqw rgba(0, 0, 0, .6)); }
.osea-frame.pirate { border: 3px solid #b8862e; background: linear-gradient(90deg, rgba(0, 0, 0, .18) 0 2px, transparent 2px 24px) 0 0 / 24px 100%, linear-gradient(160deg, #5a3a1c, #3a2410 45%, #4e3218); box-shadow: inset 0 0 0 2px #3a2410, inset 0 0 0 4px #d9a441, 0 8px 24px rgba(0, 0, 0, .55); }
.osea-frame.pirate .osea-cols span, .osea-frame.pirate .osea-rows span { color: #f1c66b; font-family: Georgia, "Times New Roman", serif; text-shadow: 0 1px 0 #2a1808, 0 0 4px rgba(0, 0, 0, .6); }
.osea-frame.pirate .osea-water { box-shadow: inset 0 0 0 .5cqw #2a1808, inset 0 0 4cqw rgba(0, 0, 0, .5); }
.osea-c .sea-hit { width: 150%; height: 150%; }
/* Pirate look: each ship from the side beside its name in the ship lists. */
.osea-chip-pic { flex: none; width: auto; margin-right: 4px; vertical-align: middle; }
/* In Classic the list is narrow: picture on the left, name above the length marks. */
.bs-roster li:has(.bs-r-pic) { display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 6px; align-items: center; padding: 3px 6px; }
.bs-r-pic { grid-row: span 2; width: 36px; height: auto; }
.bs-roster li:has(.bs-r-pic) .bs-r-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.osea-chip-pic { height: 18px; margin-right: 4px; }
.bs-roster li.gone .bs-r-pic, .osea-chip.sunk .osea-chip-pic { filter: grayscale(1) brightness(.6); opacity: .7; }

/* Sky Deep, flat view: a military hologram. Dark glass, cyan grid, glowing units (Brad's pictures). Each level has
   its own tint: the Sky paler, the Deep darker. */
.deep { --holo: #33d6ff; --holo-dim: rgba(51, 214, 255, .28); --holo-bg: #02101a; display: flex; flex-direction: column; gap: 8px; width: 100%; }
.deep-levels { display: flex; gap: 4px; padding: 3px; border: 1px solid var(--holo-dim); border-radius: 12px; background: #04141f; }
.deep-level { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; padding: 6px 4px; border: 0; border-radius: 9px; background: none; color: #8fb8c8; font: inherit; cursor: pointer; }
.deep-level b { font-size: calc(13px * var(--ts, 1)); letter-spacing: .04em; text-transform: uppercase; }
.deep-level small { max-width: 100%; overflow: hidden; font-size: calc(10.5px * var(--ts, 1)); opacity: .8; text-overflow: ellipsis; white-space: nowrap; }
.deep-level.on { background: rgba(51, 214, 255, .16); color: #e6fbff; box-shadow: inset 0 0 0 1px var(--holo), 0 0 12px rgba(51, 214, 255, .35); }
.deep-frame { position: relative; display: grid; grid-template-columns: 6% minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); column-gap: 1%; width: min(100%, 72vh); margin: 0 auto; padding: 1.2% 1.8% 1.8% 1.2%; border: 1px solid var(--holo-dim); border-radius: 12px; background: radial-gradient(circle at 50% 40%, #082536, var(--holo-bg) 75%); box-shadow: 0 0 24px rgba(51, 214, 255, .15), inset 0 0 30px rgba(0, 0, 0, .6); container-type: inline-size; }
.deep-frame.lvl0 { background: radial-gradient(circle at 50% 40%, #0d2f45, #041722 75%); }
.deep-frame.lvl2 { background: radial-gradient(circle at 50% 40%, #04182c, #010812 75%); }
.deep-corner { grid-column: 1; grid-row: 1; display: flex; align-items: center; justify-content: center; color: var(--holo); font: 800 clamp(8px, 3cqw, 14px)/1 ui-monospace, Consolas, monospace; }
.deep-cols { grid-column: 2; grid-row: 1; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); padding: 1cqw 0; }
.deep-rows { grid-column: 1; grid-row: 2; display: grid; grid-template-rows: repeat(var(--n), minmax(0, 1fr)); }
.deep-cols span, .deep-rows span { display: flex; align-items: center; justify-content: center; color: #7fdcf5; font: 700 clamp(7px, calc(38cqw / var(--n)), 13px)/1 ui-monospace, Consolas, monospace; text-shadow: 0 0 6px rgba(51, 214, 255, .6); }
.deep-water { position: relative; grid-column: 2; grid-row: 2; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); grid-template-rows: repeat(var(--n), minmax(0, 1fr)); aspect-ratio: 1; overflow: hidden; border: 1px solid rgba(51, 214, 255, .5); border-radius: 4px; background-image: linear-gradient(rgba(51, 214, 255, .3) 1px, transparent 1px), linear-gradient(90deg, rgba(51, 214, 255, .3) 1px, transparent 1px); background-size: calc(100% / var(--n)) calc(100% / var(--n)); box-shadow: inset 0 0 18px rgba(51, 214, 255, .18); }
.deep-c { position: relative; z-index: 2; min-width: 0; min-height: 0; padding: 0; border: 0; background: transparent; cursor: default; }
.deep-c.open { cursor: crosshair; }
.deep-c.aim { background: rgba(255, 216, 74, .22); box-shadow: inset 0 0 0 1px #ffd84a; }
.deep-c.last { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55); }
.deep-c.slick { background: radial-gradient(circle, rgba(170, 120, 255, .55), rgba(60, 20, 120, .25) 70%); }
.deep-c.found::before { position: absolute; inset: 22%; border: 2px solid #ffb347; border-radius: 50%; box-shadow: 0 0 8px #ffb347; content: ''; animation: deep-ping 1.6s ease-out infinite; }
.deep-c.clear::before { position: absolute; inset: 40%; border-radius: 50%; background: rgba(51, 214, 255, .35); content: ''; }
@keyframes deep-ping { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(1.3); opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .deep-c.found::before { animation: none; } }
.deep-boom { position: absolute; left: 50%; top: 50%; width: 120%; height: 120%; border-radius: 50%; background: radial-gradient(circle, #fff 0 12%, #ffcf4a 22%, #ff5a2a 45%, rgba(255, 60, 30, 0) 70%); transform: translate(-50%, -50%); pointer-events: none; }
.deep-dot { position: absolute; left: 50%; top: 50%; width: 28%; height: 28%; border-radius: 50%; background: #bfefff; box-shadow: 0 0 6px var(--holo); opacity: .75; transform: translate(-50%, -50%); pointer-events: none; }
.deep-unit { position: absolute; z-index: 1; pointer-events: none; }
.deep-unit-pic { position: absolute; max-width: none; object-fit: contain; filter: drop-shadow(0 0 3px rgba(51, 214, 255, .8)); }
.deep-unit.across .deep-unit-pic { left: 0; top: -25%; width: 100%; height: 150%; }
.deep-unit.down .deep-unit-pic { left: -25%; top: 0; width: 150%; height: 100%; }
.deep-unit.own { opacity: .6; }
.deep-unit.own::after, .deep-unit.sunk::after, .deep-unit.reveal::after { position: absolute; inset: 6%; border: 2px solid var(--pc, #fff); border-radius: 30%; content: ''; }
.deep-unit.picked { opacity: 1; }
.deep-unit.picked .deep-unit-pic { filter: drop-shadow(0 0 5px #ffd84a); }
.deep-unit.sunk .deep-unit-pic { filter: grayscale(1) brightness(.6) drop-shadow(0 0 3px var(--pc, #f55)); }
.deep-frame .bs-flash { grid-column: 1 / -1; grid-row: 1 / -1; }
.deep-news { margin: 0; color: var(--text); font-weight: 600; text-align: center; }
.deep-hint { margin: 0; color: var(--muted); text-align: center; }
.deep-hint.warn { color: #ffb36b; }
.deep-step { margin: 0; color: var(--holo); font: 700 calc(12px * var(--ts, 1))/1.2 ui-monospace, Consolas, monospace; letter-spacing: .06em; text-align: center; text-transform: uppercase; }
.deep-controls { display: flex; flex-direction: column; gap: 8px; padding: 8px; border: 1px solid var(--holo-dim); border-radius: 12px; background: #04141f; }
.deep-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 5px; }
.deep-tool { padding: 7px 6px; border: 1px solid var(--holo-dim); border-radius: 9px; background: rgba(51, 214, 255, .06); color: #cdefff; font: 600 calc(12.5px * var(--ts, 1))/1.15 system-ui, sans-serif; cursor: pointer; }
.deep-tool.on { border-color: var(--holo); background: rgba(51, 214, 255, .22); color: #fff; box-shadow: 0 0 10px rgba(51, 214, 255, .4); }
.deep-tool.off { opacity: .35; text-decoration: line-through; }
.deep-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.deep-arrow { min-width: 48px; font-size: 18px; }
.deep-arrow.on { box-shadow: 0 0 0 2px var(--holo); }
.deep-go { min-width: 52%; }
.deep-log { display: flex; flex-direction: column; gap: 6px; }
.deep-log-row { padding: 6px 8px; border: 1px solid var(--line); border-left: 4px solid var(--pc); border-radius: 10px; background: var(--raised); }
.deep-log-row.now { box-shadow: 0 0 0 1px var(--pc); }
.deep-log-row.out { opacity: .55; }
.deep-log-who { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.deep-log-who small { color: var(--muted); }
.deep-dot-c { width: 10px; height: 10px; border-radius: 50%; background: var(--pc); }
.deep-log-units { display: flex; flex-wrap: wrap; gap: 4px; }
.deep-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px 2px 4px; border-radius: 999px; background: #04141f; color: #cdefff; font-size: calc(11.5px * var(--ts, 1)); }
.deep-chip small { color: #7fb3c4; }
.deep-chip-pic { width: auto; max-width: 44px; height: 16px; object-fit: contain; }
.deep-chip.hurt { box-shadow: inset 0 0 0 1px #ffb347; }
.deep-chip.sunk { opacity: .5; text-decoration: line-through; text-decoration-color: #ff3b30; }
.deep-chip.sunk .deep-chip-pic { filter: grayscale(1); }

/* Sky Deep, the 3D hologram board (deep-holo.js). Drag to spin, pinch to zoom, two fingers up or down to spread. */
.deep-stage { display: flex; flex-direction: column; gap: 6px; }
.deep-holo { position: relative; width: 100%; height: min(54vh, 480px); min-height: 280px; overflow: hidden; border: 1px solid var(--holo-dim); border-radius: 14px; background: #010a12; box-shadow: 0 0 26px rgba(51, 214, 255, .18), inset 0 0 40px rgba(0, 0, 0, .7); }
.deep-holo-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.deep-holo-canvas:active { cursor: grabbing; }
.deep-holo .bs-flash { position: absolute; inset: 0; }
.deep-holo-bar { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.deep-holo-btn { padding: 6px 10px; border: 1px solid var(--holo-dim); border-radius: 999px; background: rgba(51, 214, 255, .08); color: #cdefff; font: 600 calc(12px * var(--ts, 1))/1.1 system-ui, sans-serif; cursor: pointer; }
.deep-holo-btn.on { border-color: var(--holo); background: rgba(51, 214, 255, .25); color: #fff; }
.deep-look { display: flex; justify-content: center; gap: 4px; margin: 0 auto; padding: 3px; border-radius: 999px; background: #04141f; }
.deep-look-btn { padding: 5px 12px; border: 0; border-radius: 999px; background: none; color: #8fb8c8; font: 600 calc(12px * var(--ts, 1))/1.1 system-ui, sans-serif; cursor: pointer; }
.deep-look-btn.on { background: rgba(51, 214, 255, .2); color: #fff; }
/* Full screen: the board on top, the tabs and controls in a panel underneath that scrolls. */
.deep-full { --holo: #33d6ff; --holo-dim: rgba(51, 214, 255, .28); position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; gap: 6px; padding: calc(6px + env(safe-area-inset-top)) 8px calc(6px + env(safe-area-inset-bottom)); background: #010a12; color: var(--text); }
.deep-full .deep-stage { flex: 1 1 auto; min-height: 0; }
.deep-full .deep-holo { flex: 1 1 auto; height: auto; min-height: 200px; }
.deep-full-panel { --holo: #33d6ff; --holo-dim: rgba(51, 214, 255, .28); display: flex; flex: 0 1 auto; flex-direction: column; gap: 8px; max-height: 44vh; overflow-y: auto; overscroll-behavior: contain; }
.deep-full-panel .deep-log { display: none; }
@media (orientation: landscape) and (max-height: 560px) {
  .deep-full { flex-direction: row; }
  .deep-full .deep-stage { flex: 1 1 60%; }
  .deep-full-panel { flex: 0 0 40%; max-height: none; }
}
