/* Colors sampled 1:1 from the AlarmTalk chat screen (same as Palette.kt). */
:root {
  --mint-left: #17E0BD;
  --mint-right: #1FE4A7;
  --bubble-border: #979797;
  --name-gray: #6D6D6D;
  --time-gray: #9B9B9B;
  --send-gray: #818181;
  --bubble-text: #111111;
  --bg: #FFFFFF;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: #1A1F24; overflow: hidden; overscroll-behavior: none; }
body {
  font-family: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--bubble-text);
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; cursor: pointer; }

.app {
  max-width: 480px;
  /* the visible screen above the keyboard, kept in sync by app.js */
  height: var(--app-h, 100dvh);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  box-shadow: 0 0 40px rgba(0,0,0,.45);
}

/* app bar */
.appbar {
  height: calc(40px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 4px 0 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(90deg, var(--mint-left), var(--mint-right));
  color: #fff;
  flex-shrink: 0;
}
.back { flex-shrink: 0; width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.gear { width: 32px; height: 32px; padding: 6px; border: 0; background: none; flex-shrink: 0; }
.gear svg { width: 20px; height: 20px; fill: #fff; }
/* the pumpkin in the gear's place: a little bigger than the gear was */
.gear.pumpkin { width: 36px; height: 36px; padding: 0; }
.gear.pumpkin svg { display: none; }
.gear-pumpkin { display: block; width: 100%; height: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* room tabs, inside the green bar */
.pills {
  flex: 1; min-width: 0; height: 100%;
  display: flex; align-items: center; gap: 6px; padding: 0 4px;
  overflow-x: auto; scrollbar-width: none;
  /* soft edges hint that the row scrolls */
  mask-image: linear-gradient(90deg, transparent 0, #000 6px, #000 calc(100% - 14px), transparent);
}
.pills::-webkit-scrollbar { display: none; }
.pill {
  position: relative; flex-shrink: 0;
  display: flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 10px; border-radius: 13px;
  border: 1px solid rgba(255,255,255,.4); background: rgba(255,255,255,.18); color: #fff;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; max-width: 170px;
}
/* margin 0: the Settings .label rule's spacing would push the text off centre */
.pill .label { margin: 0; overflow: hidden; text-overflow: ellipsis; }
.pill.on { background: #fff; border-color: #fff; color: #0d9e74; font-weight: 700; }
.pill.invite { border: 1.5px dashed #fff; animation: pulse 1.6s ease-in-out infinite; }
/* watch view: a room its host deleted, kept to read back */
.pill.deleted:not(.on) { opacity: .6; border-style: dashed; }
.pill.deleted.on { color: #b4532a; }
.pill.add { width: 26px; padding: 0; justify-content: center; font-size: 18px; font-weight: 500; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(255,255,255,.28); } }
@media (prefers-reduced-motion: reduce) { .pill.invite { animation: none; } }
.badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #FF4D4F; color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
}
.badge.ask { background: #FFB020; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; }
.pill.on .dot { background: var(--mint-right); }
/* Visitors tab: people online now, behind a green dot */
.pill .live-count {
  display: inline-flex; align-items: center; gap: 4px; height: 18px; padding: 0 7px; border-radius: 9px;
  background: rgba(0, 0, 0, .16); font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.pill .live-count::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 2px rgba(34, 197, 94, .25); }
.pill.on .live-count { background: rgba(13, 158, 116, .12); }

/* private room bar */
.roombar {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 10px; background: #F6FBF9; border-bottom: 1px solid #E5F2ED; flex-shrink: 0;
}
/* compact, so the chat gets the room */
.roombar .small-btn { height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12px; }
.stack { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0; min-width: 0; flex: 1; text-align: left; }
.faces { display: flex; }
.faces img, .faces .face { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #F6FBF9; margin-left: -6px; background: #E3F6E4; object-fit: cover; }
.faces > :first-child { margin-left: 0; }
.face { display: grid; place-items: center; font-size: 13px; }
.stack .count { font-size: 11.5px; color: var(--name-gray); white-space: nowrap; }
.small-btn {
  height: 28px; padding: 0 12px; border-radius: 14px; border: 0;
  background: var(--mint-right); color: #fff; font-size: 12.5px; font-weight: 700; white-space: nowrap;
}
.small-btn.ghost { background: #fff; color: #0d9e74; border: 1px solid var(--mint-right); }
.small-btn.warn { background: #FFB020; }
.small-btn.gray { background: #EEF0F1; color: #555; }
.small-btn:disabled { opacity: .55; }

.banner { padding: 9px 12px; font-size: 12.5px; background: #FFF6E0; color: #7a5a00; flex-shrink: 0; }
.banner.closed { background: #FDECEC; color: #a12a2a; }

/* messages */
.list-wrap { position: relative; flex: 1; min-height: 0; }
.messages {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.msg { position: relative; display: flex; align-items: flex-start; touch-action: pan-y; transition: transform .18s ease-out; }
.msg.swiping { transition: none; }
/* the ↩ that shows behind a message dragged right to reply */
.msg.swiping::before {
  content: ""; position: absolute; left: -38px; top: 50%; width: 28px; height: 28px; margin-top: -14px;
  border-radius: 50%; opacity: .45; transition: opacity .12s, transform .12s;
  background: rgba(31, 228, 167, .18) center / 16px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230d9e74' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 8 5 12.5l5 4.5M5.5 12.5H14a5 5 0 0 1 5 5V19'/%3E%3C/svg%3E");
}
.msg.swipe-ready::before { opacity: 1; transform: scale(1.12); }
.msg.pending { opacity: .55; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  margin: 14px 7px 0 0; flex-shrink: 0; object-fit: cover;
  background: #E3F6E4;
}
.avatar.fallback { display: grid; place-items: center; font-size: 20px; }
.body { flex: 1; min-width: 0; }
.name { color: var(--name-gray); font-size: 11px; font-weight: 700; margin: 0 0 2px 3px; }
.line { display: flex; align-items: flex-end; gap: 6px; }
.bubble {
  max-width: calc(100% - 60px);
  border: 1px solid var(--bubble-border);
  border-radius: 16px;
  padding: 7px 12px;
  font-size: 14.5px;
  line-height: 18px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bubble a { color: #0d9e74; text-decoration: underline; }
.bubble.emoji { font-size: 21px; line-height: 23px; padding: 5px 12px; }
.time { color: var(--time-gray); font-size: 10px; white-space: nowrap; margin-bottom: 2px; }

.sys { align-self: center; font-size: 11.5px; color: var(--time-gray); background: #F3F5F6; border-radius: 10px; padding: 3px 10px; }
.empty-room { margin: auto; text-align: center; color: var(--name-gray); font-size: 13px; line-height: 1.5; padding: 20px; }

/* toasts */
.toasts { position: absolute; top: 8px; left: 10px; right: 10px; display: flex; flex-direction: column; gap: 6px; pointer-events: none; z-index: 4; }
/* on the island the toasts sit just under the top bar, over the island */
.app.island-open > #toasts { display: flex !important; position: fixed; left: 50%; right: auto; width: min(460px, calc(100vw - 20px)); transform: translateX(-50%); z-index: 50; }
.toast {
  pointer-events: auto; background: #22292F; color: #fff; border-radius: 12px;
  padding: 9px 13px; font-size: 13px; line-height: 1.35; box-shadow: 0 6px 18px rgba(0,0,0,.25);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  animation: drop .22s ease-out;
}
.toast.tap { cursor: pointer; }
@keyframes drop { from { transform: translateY(-8px); opacity: 0; } }

/* composer */
.composer {
  display: flex; align-items: center; gap: 8px;
  height: calc(52px + env(safe-area-inset-bottom));
  padding: 0 10px env(safe-area-inset-bottom);
  /* no bar of its own: the chat's background runs on under the text box */
  background: transparent;
  flex-shrink: 0;
}
/* the rounded box; the text field and the photo button sit inside it */
.field-box {
  flex: 1; min-width: 0; height: 38px; display: flex; align-items: center;
  border: 1px solid #D7D7D7; border-radius: 19px; background: #fff;
}
.composer #input {
  flex: 1; min-width: 0; height: 100%; border: 0; background: none; color: inherit;
  padding: 0 14px; font-size: 16px; /* 16px stops iOS zooming on focus */
  outline: none;
}
.send {
  width: 38px; height: 38px; border-radius: 50%; border: 0;
  background: var(--send-gray); display: grid; place-items: center;
}
.send svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.attach {
  width: 38px; height: 36px; border: 0; background: none; padding: 0 4px 0 0; margin-left: -6px;
  display: grid; place-items: center; flex-shrink: 0;
}
.attach svg { width: 22px; height: 22px; fill: none; stroke: var(--name-gray); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-night .attach svg { stroke: rgba(255, 255, 255, .75); }
.sticker-btn { margin-left: 0; padding: 0; width: 32px; }
.sticker-btn.on svg { stroke: #0d9e74; }

/* KLIPY stickers: the picker above the text box, and a sent sticker (no bubble) */
.sticker-panel {
  display: flex; flex-direction: column; height: min(320px, 42vh); flex-shrink: 0;
  background: #fff; border-top: 1px solid #EEF0F1; animation: reply-in .16s ease-out;
}
.sticker-panel[hidden] { display: none; }
.sticker-top { display: flex; align-items: center; gap: 8px; padding: 8px 8px 6px 10px; }
#stickerSearch {
  flex: 1; min-width: 0; height: 34px; padding: 0 14px; border: 1px solid #D7D7D7; border-radius: 17px;
  background: #F7F8F9; color: inherit; font-size: 16px; outline: none;
}
.sticker-grid {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 2px 8px 6px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 4px; align-content: start;
}
.sticker-tile {
  aspect-ratio: 1; padding: 4px; border: 0; border-radius: 10px; background: none;
  display: grid; place-items: center; cursor: pointer;
}
.sticker-tile:hover, .sticker-tile:focus-visible { background: #F0F2F3; }
.sticker-tile img { width: 100%; height: 100%; object-fit: contain; }
.sticker-empty { grid-column: 1 / -1; padding: 28px 8px; text-align: center; font-size: 14px; color: var(--name-gray); }
.sticker-foot { padding: 0 12px 6px; text-align: right; font-size: 11px; color: var(--name-gray); }
.sticker-box { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.msg.mine .sticker-box { align-items: flex-end; }
.sticker-box .quote { width: auto; max-width: 240px; margin: 0 0 4px; }
.sticker-img { display: block; max-width: 32vw; height: auto; object-fit: contain; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.q-thumb.sticker { object-fit: contain; background: none; }
.theme-night .sticker-panel { background: var(--glass); border-top-color: var(--line); }
.theme-night #stickerSearch { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .16); }
.theme-night .sticker-tile:hover, .theme-night .sticker-tile:focus-visible { background: rgba(255, 255, 255, .08); }
@media (prefers-reduced-motion: reduce) { .sticker-panel { animation: none; } }

/* a photo in the chat: its own shape, rounded, tap to open */
.photo {
  display: block; flex-shrink: 0; padding: 0; border: 0; cursor: zoom-in;
  max-height: 300px; border-radius: 14px; overflow: hidden; background: #E9EDEF;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
}
.photo img { width: 100%; height: 100%; display: block; object-fit: cover; pointer-events: none; }
.theme-night .photo { background: rgba(255, 255, 255, .08); }
.viewer {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: rgba(0, 0, 0, .92); cursor: zoom-out; animation: fade-in .15s ease-out;
}
.viewer img {
  max-width: 100vw; max-height: 100dvh; object-fit: contain;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; pointer-events: none;
}
@keyframes fade-in { from { opacity: 0; } }
/* the preview before sending */
.photo-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 4px 0 14px; }
.photo-pick img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: #E9EDEF; }
.photo-pick.one { grid-template-columns: 1fr; }
.photo-pick.one img { aspect-ratio: auto; max-height: 50dvh; object-fit: contain; }
.photo-send { width: 100%; height: 42px; border-radius: 21px; font-size: 15px; }

/* settings */
dialog {
  width: min(92vw, 400px); max-height: 86dvh;
  border: 0; border-radius: 24px; padding: 0;
}
dialog::backdrop { background: rgba(0,0,0,.35); }
.sheet { padding: 22px 22px 12px; overflow-y: auto; max-height: 86dvh; }
.sheet h2 { margin: 0 0 16px; font-size: 18px; }
.label { display: block; font-size: 12px; font-weight: 700; color: var(--name-gray); margin: 14px 0 6px; }
.label:first-of-type { margin-top: 0; }
.field {
  width: 100%; height: 44px; border: 1px solid #B9B9B9; border-radius: 4px;
  padding: 0 12px; font-size: 16px; outline: none;
}
.field:focus { border: 2px solid var(--mint-right); padding: 0 11px; }
.gap { height: 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, 36px); gap: 6px; }
/* avatars on the left, the small theme tiles in a column on the right */
.pick { display: flex; gap: 14px; margin-top: 14px; }
.pick .label { margin-top: 0; }
.pick-avatar { flex: 1; min-width: 0; }
.pick-bg { flex-shrink: 0; padding-left: 14px; border-left: 1px solid #EEF0F1; }
.watching .pick-bg { padding-left: 0; border-left: 0; }
.grid img {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  border: 2.5px solid transparent; cursor: pointer;
}
.grid img.sel { border-color: var(--mint-right); }
.row { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-top: 10px; font-size: 15px; }
.hint { font-size: 12px; color: var(--time-gray); }
.text-btn { border: 0; background: none; color: var(--mint-right); font-weight: 700; padding: 10px 8px; }
.text-btn.gray { color: var(--name-gray); font-weight: 400; }
.actions { display: flex; justify-content: flex-end; gap: 4px; margin-top: 12px; }
.field-box:has(#input:disabled) { background: #F3F5F6; }

/* bottom sheets: room, invite, requests */
#sheet {
  width: 100%; max-width: 480px; max-height: 85dvh;
  margin: auto auto 0; border-radius: 20px 20px 0 0;
}
dialog:focus { outline: none; }
#sheet .sheet { padding: 8px 20px calc(18px + env(safe-area-inset-bottom)); max-height: 85dvh; }
@media (prefers-reduced-motion: no-preference) {
  #sheet[open] { animation: rise .22s cubic-bezier(.2, .8, .2, 1); }
  @keyframes rise { from { transform: translateY(40px); opacity: .4; } }
}
.grab { width: 36px; height: 4px; border-radius: 2px; background: #DADDE0; margin: 0 auto 14px; }
.sheet-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.sheet-head > :first-child { flex: 1; min-width: 0; }
.sheet-head h2 { margin: 0; font-size: 19px; line-height: 26px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-head .sub { font-size: 12.5px; color: var(--time-gray); margin-top: 2px; }
.x {
  width: 30px; height: 30px; border-radius: 50%; border: 0; flex-shrink: 0;
  background: #F1F3F4; color: #6B7278; font-size: 19px; line-height: 1; display: grid; place-items: center;
}
.name-btn { display: flex; align-items: center; gap: 6px; max-width: 100%; border: 0; background: none; padding: 0; text-align: left; color: inherit; }
.name-btn .pencil { color: var(--time-gray); font-size: 15px; flex-shrink: 0; }
.name-edit {
  width: 100%; height: 30px; border: 0; border-bottom: 2px solid var(--mint-right);
  padding: 0; font: inherit; font-size: 19px; font-weight: 700; outline: none; background: none;
}
.sheet h3 { margin: 18px 0 2px; font-size: 11.5px; font-weight: 700; color: var(--time-gray); text-transform: uppercase; letter-spacing: .05em; }
.sheet .lead { margin: 0 0 4px; font-size: 13px; color: var(--name-gray); line-height: 1.4; }

.action-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 8px 0; border: 0; background: none; text-align: left; color: var(--bubble-text); font-size: 15px;
}
.action-row .ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #E8FCF5; color: #0d9e74; font-size: 19px; flex-shrink: 0; }
.action-row.ask .ic { background: #FFF4DC; }
.action-row .lbl { flex: 1; font-weight: 500; }
.action-row .chev { color: #B8BEC3; font-size: 20px; }

.person { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.av { position: relative; flex-shrink: 0; }
.av img, .av .face { width: 38px; height: 38px; border-radius: 50%; background: #E3F6E4; object-fit: cover; display: block; }
.av .face { display: grid; place-items: center; font-size: 20px; }
.presence { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: #2BC66A; border: 2px solid #fff; }
.person .who { flex: 1; min-width: 0; }
.person .nm { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .sub { font-size: 12.5px; color: var(--time-gray); margin-top: 1px; }
.person .btns { display: flex; gap: 6px; }
.link-btn { border: 0; background: none; padding: 8px 4px; color: var(--name-gray); font-size: 13.5px; font-weight: 500; }
.link-btn:hover { color: #c0392b; }
.none { font-size: 13px; color: var(--time-gray); padding: 6px 0; }
.note { font-size: 12px; color: var(--time-gray); line-height: 1.45; margin-top: 14px; }
.sep { height: 1px; background: #EEF0F1; margin: 14px 0 4px; }
.danger-link { border: 0; background: none; padding: 10px 0; color: #D64545; font-size: 15px; font-weight: 600; }
.small-btn.red { background: #D64545; }
.confirm-row { display: flex; align-items: center; gap: 6px; padding: 6px 0; font-size: 14.5px; }
.confirm-row > span { flex: 1; color: var(--bubble-text); font-weight: 500; }

/* chat backgrounds */
.app { background-size: cover; background-position: center; }
.bubble { background: #fff; }

/* Night theme (dark photo backgrounds): the photo fills the whole app, the bars
   become dark frosted glass over it, bubbles go dark and translucent, and mint
   stays as the accent. Blur only on the bars; blurring every bubble is slow on phones. */
.theme-night {
  --glass: rgba(10, 14, 32, .58);
  --line: rgba(255, 255, 255, .13);
  --bubble-night: rgba(16, 20, 42, .74);
  --text-night: #EEF1FA;
  color-scheme: dark;
}
.theme-night .appbar,
.theme-night .roombar {
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
}
.theme-night .appbar { border-bottom: 1px solid var(--line); }
.theme-night .roombar { border-bottom: 1px solid var(--line); }

.theme-night .pill { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .16); color: rgba(255, 255, 255, .86); }
.theme-night .pill.on { background: var(--mint-right); border-color: var(--mint-right); color: #062A1F; }
.theme-night .pill.on .dot { background: #062A1F; }
.theme-night .pill.on .live-count { background: rgba(6, 42, 31, .16); }
.theme-night .pill.on .live-count::before { background: #0B7A3E; box-shadow: 0 0 0 2px rgba(6, 42, 31, .2); }
.theme-night .pill.invite { border-color: rgba(31, 228, 167, .9); color: #9FF5D9; }

.theme-night .stack .count { color: rgba(255, 255, 255, .7); }
.theme-night .faces img, .theme-night .faces .face { border-color: #141A33; }
.theme-night .small-btn.ghost { background: transparent; color: #9FF5D9; }

.theme-night .bubble { background: var(--bubble-night); border-color: var(--line); color: var(--text-night); }
.theme-night .bubble a { color: #7FF0CB; }
.theme-night .name { color: #9FF5D9; }
.theme-night .time { color: rgba(255, 255, 255, .5); }
.theme-night .sys { background: rgba(10, 14, 32, .62); color: rgba(255, 255, 255, .72); }
.theme-night .empty-room { color: rgba(255, 255, 255, .8); }

.theme-night .field-box { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .16); color: #fff; }
.theme-night .field-box:has(#input:disabled) { background: rgba(255, 255, 255, .03); }
.theme-night .send { background: var(--mint-right); }
.theme-night .send svg { stroke: #062A1F; }

.bg-grid { display: flex; flex-direction: column; gap: 8px; }
.watching .bg-grid { flex-direction: row; flex-wrap: wrap; }
.bg-tile { width: 48px; border: 0; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.bg-tile .swatch {
  width: 40px; height: 58px; border-radius: 8px; display: block;
  border: 2.5px solid #E3E6E8; background: #fff center / cover no-repeat;
}
.bg-tile.sel .swatch { border-color: var(--mint-right); }
.bg-tile .bg-name { font-size: 10.5px; color: var(--name-gray); white-space: nowrap; }
.bg-tile.sel .bg-name { color: #0d9e74; font-weight: 700; }

/* listen together: player card at the top right of a private room */
.music-card {
  position: absolute; top: 8px; right: 8px; z-index: 3; width: 200px;
  border-radius: 12px; overflow: hidden; color: #fff;
  background: rgba(12, 16, 34, .94); box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.mc-player { width: 200px; height: 200px; background: #000; }
.mc-player iframe { display: block; }
.mc-title { flex: 1; min-width: 0; padding: 0 2px; font-size: 11.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-tap {
  display: block; width: calc(100% - 12px); margin: 5px 6px 0; height: 26px; border: 0; border-radius: 13px;
  background: var(--mint-right); color: #062A1F; font-weight: 700; font-size: 12.5px;
}
.mc-controls { display: flex; align-items: center; gap: 1px; padding: 2px 3px; }
.mc-controls button {
  flex-shrink: 0; height: 28px; min-width: 28px; padding: 0 4px; border: 0; border-radius: 14px; background: none; color: #fff;
  display: flex; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 700;
}
.mc-controls button:active { background: rgba(255, 255, 255, .12); }
.mc-controls svg { width: 16px; height: 16px; fill: #fff; stroke: #fff; stroke-width: 0; }
#mcQueue svg, #mcClose svg { fill: none; stroke-width: 2.2; stroke-linecap: round; }
#mcPlay { background: rgba(255, 255, 255, .14); }

.roombar .music-btn { padding: 0 8px; }
.add-song { display: flex; gap: 8px; margin-bottom: 4px; }
.add-song .field { flex: 1; min-width: 0; }
.add-song .small-btn { height: 44px; border-radius: 8px; padding: 0 16px; }
.song-art { width: 48px; height: 36px; border-radius: 6px; object-fit: cover; flex-shrink: 0; background: #E3E6E8; }
.song .nm { white-space: nowrap; }

/* avatars on the night theme: the pastel drawings wash out on a dark sky, so
   deepen their colour a little and set each in a thin mint ring with a shadow */
.theme-night .avatar,
.theme-night .faces img,
.theme-night .faces .face {
  filter: saturate(1.35) contrast(1.12);
  box-shadow: 0 0 0 2px rgba(159, 245, 217, .75), 0 3px 10px rgba(0, 0, 0, .55);
}
.theme-night .avatar.fallback { background: #2A3150; }

/* test copy of the server: a small tag so it's never mistaken for the live one */
.env-tag {
  flex-shrink: 0; padding: 2px 6px; border-radius: 6px;
  background: #FFB020; color: #3A2600; font-size: 10.5px; font-weight: 800; letter-spacing: .06em;
}

/* ---- voice and video notes ---- */
.composer { position: relative; }
.rec {
  width: 38px; height: 38px; border-radius: 50%; border: 0; flex-shrink: 0;
  background: var(--mint-right); display: grid; place-items: center;
  /* the finger stays on it while recording: no scrolling, selecting or callout */
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: transform .15s ease-out, background-color .15s;
}
.rec svg { width: 21px; height: 21px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.rec .ic-cam, .rec.video .ic-mic { display: none; }
.rec.video .ic-cam { display: block; }
.rec.live { transform: scale(1.3); background: #FF4D4F; }

.rec-bar { flex: 1; min-width: 0; height: 38px; display: flex; align-items: center; gap: 8px; padding-left: 8px; overflow: hidden; }
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: #FF4D4F; flex-shrink: 0; animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .2; } }
.rec-time { min-width: 36px; font-size: 15px; font-variant-numeric: tabular-nums; }
.rec-wave { flex: 1; min-width: 0; height: 26px; color: var(--mint-right); }
.rec-hint { flex-shrink: 0; font-size: 13px; color: var(--time-gray); white-space: nowrap; }
.rec-trash { width: 34px; height: 34px; border: 0; background: none; padding: 0; display: grid; place-items: center; flex-shrink: 0; }
.rec-trash svg { width: 21px; height: 21px; fill: none; stroke: #D64545; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rec-lock {
  position: absolute; right: 10px; bottom: calc(100% + 12px);
  width: 38px; padding: 8px 0 4px; border-radius: 19px;
  display: flex; flex-direction: column; align-items: center;
  background: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.18); pointer-events: none;
}
.rec-lock svg { width: 18px; height: 18px; fill: none; stroke: var(--name-gray); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rec-lock .up { animation: nudge 1.2s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(-4px); } }

/* the round preview while a video note records */
.vid-rec {
  position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; pointer-events: none;
  background: rgba(8, 12, 24, .5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.vid-circle { position: relative; width: min(72vw, 300px); aspect-ratio: 1; }
.vid-circle video { width: 100%; height: 100%; display: block; border-radius: 50%; object-fit: cover; transform: scaleX(-1); background: #000; }
.ring { position: absolute; inset: -7px; width: calc(100% + 14px); height: calc(100% + 14px); transform: rotate(-90deg); pointer-events: none; }
.ring circle { fill: none; stroke: var(--mint-right); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; }
.vid-time {
  position: absolute; left: 50%; bottom: -34px; transform: translateX(-50%);
  color: #fff; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums;
}

/* a voice message */
.bubble.voice {
  display: flex; align-items: center; gap: 8px;
  width: 250px; padding: 6px 10px 6px 6px; white-space: normal;
}
.vplay { width: 34px; height: 34px; border-radius: 50%; border: 0; padding: 0; flex-shrink: 0; background: var(--mint-right); display: grid; place-items: center; }
.vplay svg { width: 15px; height: 15px; fill: #fff; }
.vwave { flex: 1; min-width: 0; height: 28px; display: flex; align-items: center; gap: 2px; cursor: pointer; }
.vwave span { flex: 1; min-width: 2px; border-radius: 2px; background: #C6D1CD; }
.vwave span.on { background: #0d9e74; }
.vdur { min-width: 30px; font-size: 11px; color: var(--time-gray); font-variant-numeric: tabular-nums; }
.unplayed .vdur::before {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 4px;
  border-radius: 50%; background: var(--mint-right); vertical-align: 1px;
}
.vspeed { display: none; border: 0; border-radius: 9px; padding: 2px 6px; background: #EEF0F1; color: var(--name-gray); font-size: 11px; font-weight: 700; }
.playing .vspeed { display: block; }

/* a round video note */
.vnote {
  position: relative; flex-shrink: 0; cursor: pointer;
  width: min(180px, 48vw); aspect-ratio: 1;
  transition: width .2s ease-out;
}
.vnote.active { width: min(240px, 62vw); }
.vnote video { width: 100%; height: 100%; display: block; border-radius: 50%; object-fit: cover; background: #1A1F24; }
/* no long-press "Save video" menu on phones */
.vnote { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.vnote .ring { opacity: 0; transition: opacity .2s; }
.vnote.active .ring { opacity: 1; }
.vnote.unplayed::after {
  content: ""; position: absolute; top: 8%; right: 8%; width: 10px; height: 10px;
  border-radius: 50%; background: var(--mint-right); border: 2px solid #fff;
}
.vbadge {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
  padding: 2px 8px; border-radius: 10px; background: rgba(0,0,0,.55); color: #fff;
  font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
  .rec-dot, .rec-lock .up { animation: none; }
  .vnote, .rec { transition: none; }
}

.theme-night .rec-time { color: var(--text-night); }
.theme-night .rec-wave { color: #7FF0CB; }
.theme-night .rec-hint { color: rgba(255,255,255,.55); }
.theme-night .rec-lock { background: rgba(16,20,42,.92); box-shadow: 0 4px 16px rgba(0,0,0,.5); }
.theme-night .rec-lock svg { stroke: rgba(255,255,255,.75); }
.theme-night .rec svg, .theme-night .vplay svg { stroke: #062A1F; fill: none; }
.theme-night .vplay svg { fill: #062A1F; }
.theme-night .rec.live svg { stroke: #fff; }
.theme-night .vwave span { background: rgba(255,255,255,.24); }
.theme-night .vwave span.on { background: #7FF0CB; }
.theme-night .vdur { color: rgba(255,255,255,.6); }
.theme-night .vspeed { background: rgba(255,255,255,.12); color: #EEF1FA; }
.theme-night .vnote.unplayed::after { border-color: #141A33; }
.theme-night .vnote video { box-shadow: 0 0 0 2px rgba(159,245,217,.5), 0 6px 18px rgba(0,0,0,.5); }

/* "typing…" / "recording…": three dots that take turns */
.typing-dots { display: inline-flex; gap: 2px; margin-left: 3px; vertical-align: middle; }
.typing-dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; animation: hop 1.2s ease-in-out infinite; }
.typing-dots i:nth-child(2) { animation-delay: .15s; }
.typing-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes hop { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: 1; transform: translateY(-2px); } }
.stack .count.activity { display: flex; align-items: center; min-width: 0; color: #0d9e74; font-weight: 600; }
.stack .count.activity .what { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.stack .count.activity .typing-dots { flex-shrink: 0; }
.theme-night .stack .count.activity { color: #7FF0CB; }
.pill .typing-dots { margin-left: 0; }
@media (prefers-reduced-motion: reduce) { .typing-dots i { animation: none; opacity: .8; } }

/* watch mode (admin port): a quiet bar where the composer would be */
.watch-bar {
  flex-shrink: 0; height: calc(44px + env(safe-area-inset-bottom)); padding: 0 12px env(safe-area-inset-bottom);
  display: flex; align-items: center; justify-content: center;
  background: #F3F5F6; color: var(--name-gray); font-size: 12.5px; font-weight: 600;
}
.theme-night .watch-bar { background: var(--glass); color: rgba(255,255,255,.7); }
.watching .profile-only { display: none; }

/* watch mode: the visitors tab */
.vis-tools {
  position: sticky; top: -6px; z-index: 1; margin: -6px -10px 0; padding: 8px 10px 6px;
  background: var(--bg); display: flex; flex-direction: column; gap: 8px;
}
.vis-search {
  height: 38px; border: 1px solid #D7D7D7; border-radius: 19px; padding: 0 14px;
  font-size: 15px; outline: none; background: #fff; color: inherit;
}
.vis-search:focus { border-color: var(--mint-right); }
.vis-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.vis-chips::-webkit-scrollbar { display: none; }
.vis-chip {
  flex-shrink: 0; height: 28px; padding: 0 11px; border-radius: 14px; white-space: nowrap;
  border: 1px solid #E3E6E8; background: #fff; color: var(--bubble-text); font-size: 12.5px;
}
.vis-chip.on { border-color: var(--mint-right); background: #E8FCF5; color: #0d9e74; font-weight: 700; }
.vis-chip .swatch {
  display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 6px; vertical-align: -2px;
  border: 1px solid #D5DADD; background: #fff center / cover no-repeat;
}
/* their theme, a small copy of the Settings tile */
.vis-bg { flex-shrink: 0; width: 58px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.vis-bg .swatch {
  width: 26px; height: 38px; border-radius: 6px; display: block;
  border: 1.5px solid #E3E6E8; background: #fff center / cover no-repeat;
}
.vis-bg .bg-name { font-size: 10.5px; color: var(--time-gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.theme-night .vis-bg .swatch, .theme-night .vis-chip .swatch { border-color: rgba(255,255,255,.25); }
.theme-night .vis-bg .bg-name { color: rgba(255,255,255,.6); }
.vis-row { border-bottom: 1px solid #F0F2F3; }
.vis-row .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.theme-night .vis-tools { background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.theme-night .vis-search { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.16); }
.theme-night .vis-chip { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.16); color: var(--text-night); }
.theme-night .vis-chip.on { background: rgba(31,228,167,.2); border-color: var(--mint-right); color: #9FF5D9; }
.theme-night .vis-row { border-color: rgba(255,255,255,.08); }
.theme-night .vis-row .nm { color: var(--text-night); }
.theme-night .vis-row .sub { color: rgba(255,255,255,.6); }
/* on a photo, the visitor list sits on a dark glass panel so it stays readable */
.theme-night .vis-rows { background: var(--bubble-night); border: 1px solid var(--line); border-radius: 16px; padding: 0 12px; }
.theme-night .vis-row:last-child { border-bottom: 0; }

/* watch mode: the clean-up tab */
.name.mod-link { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 2px; }
.mod-search { display: flex; gap: 8px; }
.mod-search .vis-search { flex: 1; min-width: 0; }
.mod-search .small-btn { height: 38px; border-radius: 19px; padding: 0 18px; }
.mod-body { display: flex; flex-direction: column; }
.mod-names { flex-wrap: wrap; padding: 6px 0; }
.mod-bar {
  position: sticky; top: 92px; z-index: 1; display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; margin: 4px 0; border-radius: 12px; background: #F6FBF9; border: 1px solid #E5F2ED;
}
.mod-bar.confirm { background: #FDECEC; border-color: #F5C9C9; }
.mod-all { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.mod-ask { flex: 1; font-size: 13px; line-height: 1.35; color: #8A1F1F; font-weight: 600; }
.mod-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border-bottom: 1px solid #F0F2F3; cursor: pointer; }
.mod-row input, .mod-all input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: #D64545; flex-shrink: 0; }
.mod-av { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: #E3F6E4; }
.mod-av.face { display: grid; place-items: center; font-size: 15px; }
.mod-text { min-width: 0; flex: 1; }
.mod-meta { font-size: 11px; color: var(--time-gray); }
.mod-msg { font-size: 14px; overflow-wrap: anywhere; white-space: pre-wrap; }
.theme-night .mod-bar { background: var(--glass); border-color: var(--line); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.theme-night .mod-bar.confirm { background: rgba(120, 20, 20, .55); border-color: rgba(255, 120, 120, .35); }
.theme-night .mod-ask { color: #FFD6D6; }
.theme-night .mod-all { color: var(--text-night); }
.theme-night .mod-body { background: var(--bubble-night); border: 1px solid var(--line); border-radius: 16px; padding: 0 8px 4px; margin-top: 6px; }
.theme-night .mod-row { border-color: rgba(255,255,255,.08); }
.theme-night .mod-msg { color: var(--text-night); }
.theme-night .mod-meta { color: rgba(255,255,255,.55); }
.mod-block { height: 38px; width: 42px; padding: 0; border-radius: 19px; font-size: 16px; }
.mod-head { font-size: 11.5px; font-weight: 700; color: var(--time-gray); text-transform: uppercase; letter-spacing: .05em; margin-top: 8px; }
.mod-blocked { display: inline-flex; align-items: center; gap: 4px; border-color: #F5C9C9; background: #FDF1F1; color: #8A1F1F; padding-right: 4px; }
.mod-x { border: 0; background: none; width: 22px; height: 22px; border-radius: 11px; font-size: 16px; line-height: 1; color: inherit; padding: 0; }
.mod-x:hover { background: rgba(0,0,0,.08); }
.mod-toggle {
  margin: 0 0 6px; padding: 9px 12px; border-radius: 12px; text-align: left;
  border: 1px dashed #E0A3A3; background: none; color: #A12A2A; font-size: 13px; font-weight: 600;
}
.mod-toggle.on { border-style: solid; background: #FDECEC; }
.theme-night .mod-head { color: rgba(255,255,255,.55); }
.theme-night .mod-blocked { background: rgba(120,20,20,.45); border-color: rgba(255,120,120,.4); color: #FFD6D6; }
.theme-night .mod-toggle { border-color: rgba(255,140,140,.5); color: #FFC2C2; }
.theme-night .mod-toggle.on { background: rgba(120,20,20,.45); }

/* watch mode: the media tab, every photo / video / voice message as a card */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; padding: 8px 0 14px; }
.media-grid > .none { grid-column: 1 / -1; text-align: center; }
.media-card { display: flex; flex-direction: column; min-width: 0; background: #fff; border: 1px solid #E9ECEE; border-radius: 16px; overflow: hidden; }
.media-head { display: flex; align-items: center; gap: 8px; padding: 9px 10px 8px; }
.media-name { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-head .mod-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-stage { height: 210px; display: grid; place-items: center; background: #F3F5F6; overflow: hidden; }
.media-card .photo { width: 100% !important; height: 100%; max-height: none; aspect-ratio: auto !important; border-radius: 0; }
.media-card .vnote { width: 170px; }
.media-card .vnote.active { width: 196px; }
.media-card .bubble.voice { width: min(250px, calc(100% - 20px)); max-width: none; background: #fff; }
.media-go {
  border: 0; border-top: 1px solid #F0F2F3; background: none; padding: 10px 12px;
  font-size: 13px; font-weight: 700; color: #0d9e74; text-align: left; cursor: pointer;
}
.media-go:hover { background: #F6FBF9; }
.theme-night .media-card { background: var(--bubble-night); border-color: var(--line); }
.theme-night .media-name { color: var(--text-night); }
.theme-night .media-stage { background: rgba(0, 0, 0, .25); }
.theme-night .media-card .bubble.voice { background: rgba(255, 255, 255, .07); }
.theme-night .media-go { border-color: rgba(255, 255, 255, .08); color: #9FF5D9; }
.theme-night .media-go:hover { background: rgba(255, 255, 255, .05); }

/* the message "Open in chat" landed on */
.msg.flash, .sys.flash { border-radius: 14px; animation: flash 2.6s ease-out; }
@keyframes flash { 0%, 45% { background: rgba(31, 228, 167, .3); box-shadow: 0 0 0 6px rgba(31, 228, 167, .3); } 100% { background: transparent; box-shadow: 0 0 0 6px transparent; } }

/* replies (private rooms): the quote in a bubble, the bar above the text box, the hover ↩ */
.quote {
  display: flex; align-items: center; gap: 8px;
  width: calc(100% + 10px); min-width: 150px; margin: -2px -5px 6px; padding: 5px 8px 6px 9px;
  border: 0; border-left: 3px solid var(--mint-right); border-radius: 10px; background: rgba(31, 228, 167, .1);
  font: inherit; text-align: left; color: inherit; cursor: pointer; white-space: normal;
  transition: background .12s;
}
.quote:hover, .quote:active { background: rgba(31, 228, 167, .18); }
/* quoting yourself: a deeper green, like the "You" it says */
.quote.mine { border-left-color: #0d9e74; background: rgba(13, 158, 116, .08); }
.q-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.q-name { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 12px; font-weight: 700; color: #0d9e74; }
.q-name > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-av { width: 16px; height: 16px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: #E3F6E4; font-size: 9px; }
.q-text {
  font-size: 13px; line-height: 17px; color: #555; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.q-thumb { width: 38px; height: 38px; flex-shrink: 0; border-radius: 7px; object-fit: cover; background: #E9EDEF; }
.q-thumb.video { border-radius: 50%; }

.reply-bar {
  display: flex; align-items: center; gap: 8px; padding: 8px 6px 2px 12px; flex-shrink: 0;
  background: #fff; border-top: 1px solid #EEF0F1; animation: reply-in .16s ease-out;
}
@keyframes reply-in { from { transform: translateY(8px); opacity: 0; } }
.reply-icon { display: grid; place-items: center; flex-shrink: 0; }
.reply-icon svg { width: 20px; height: 20px; fill: none; stroke: #0d9e74; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.reply-bar .quote { flex: 1; width: auto; min-width: 0; margin: 0; }
.reply-bar .q-text { -webkit-line-clamp: 1; }
.reply-x {
  width: 30px; height: 30px; flex-shrink: 0; padding: 0; border: 0; border-radius: 50%;
  background: #F0F2F3; display: grid; place-items: center;
}
.reply-x svg { width: 14px; height: 14px; fill: none; stroke: var(--name-gray); stroke-width: 2.4; stroke-linecap: round; }
.reply-x:hover { background: #E4E7E9; }
/* the ↩ next to a message's time, shown on hover (computers only) */
.msg-act {
  display: none; width: 26px; height: 26px; padding: 0; margin-bottom: -2px; flex-shrink: 0;
  border: 0; border-radius: 50%; background: none; place-items: center; opacity: 0; transition: opacity .12s;
}
.msg-act svg { width: 16px; height: 16px; fill: none; stroke: var(--name-gray); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.msg-act:hover { background: #EEF0F1; }
@media (hover: hover) {
  .msg-act { display: grid; }
  .msg:hover .msg-act, .msg-act:focus-visible { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .reply-bar { animation: none; } }
.theme-night .quote { background: rgba(31, 228, 167, .13); }
.theme-night .quote:hover, .theme-night .quote:active { background: rgba(31, 228, 167, .2); }
.theme-night .quote.mine { border-left-color: #9FF5D9; background: rgba(159, 245, 217, .1); }
.theme-night .q-name { color: #9FF5D9; }
.theme-night .q-text { color: rgba(255, 255, 255, .72); }
.theme-night .q-thumb { background: rgba(255, 255, 255, .08); }
.theme-night .reply-bar {
  background: var(--glass); border-top-color: var(--line);
  -webkit-backdrop-filter: blur(16px) saturate(150%); backdrop-filter: blur(16px) saturate(150%);
}
.theme-night .reply-icon svg { stroke: #9FF5D9; }
.theme-night .reply-x { background: rgba(255, 255, 255, .1); }
.theme-night .reply-x svg { stroke: rgba(255, 255, 255, .8); }
.theme-night .reply-x:hover, .theme-night .msg-act:hover { background: rgba(255, 255, 255, .16); }
.theme-night .msg-act svg { stroke: rgba(255, 255, 255, .7); }

/* night themes: the pop-ups (Settings and the bottom sheets) go dark too */
body.night dialog { background: #161B26; color: #EEF1FA; color-scheme: dark; }
body.night dialog::backdrop { background: rgba(0, 0, 0, .55); }
body.night .label, body.night .sheet .lead { color: rgba(255, 255, 255, .7); }
body.night .field, body.night .name-edit { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .18); color: #fff; }
body.night .field:focus { border-color: var(--mint-right); }
body.night .pick-bg { border-left-color: rgba(255, 255, 255, .1); }
body.night .bg-tile .swatch { border-color: rgba(255, 255, 255, .18); }
body.night .bg-tile.sel .swatch { border-color: var(--mint-right); }
body.night .bg-tile .bg-name { color: rgba(255, 255, 255, .6); }
body.night .bg-tile.sel .bg-name { color: #9FF5D9; }
body.night .text-btn.gray, body.night .link-btn { color: rgba(255, 255, 255, .65); }
body.night .grab { background: rgba(255, 255, 255, .2); }
body.night .x { background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .8); }
body.night .action-row { color: #EEF1FA; }
body.night .action-row .ic { background: rgba(31, 228, 167, .15); color: #9FF5D9; }
body.night .action-row.ask .ic { background: rgba(255, 176, 32, .18); }
body.night .action-row .chev { color: rgba(255, 255, 255, .35); }
body.night dialog .presence { border-color: #161B26; }
body.night .sep { background: rgba(255, 255, 255, .1); }
body.night dialog .small-btn.gray { background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .85); }
body.night dialog .small-btn.ghost { background: transparent; color: #9FF5D9; }
body.night .song-art { background: rgba(255, 255, 255, .08); }

/* the secret avatar: its password box, and a soft violet ring once it's yours */
#unlock { width: min(86vw, 320px); }
#unlock .field { margin-top: 6px; letter-spacing: .3em; }
#unlock .field[type="text"] { letter-spacing: normal; } /* the secret avatar's typed answer */
.unlock-err { margin-top: 8px; font-size: 13px; color: #D64545; }
.grid img.secret { box-shadow: 0 0 0 2px rgba(185, 162, 247, .75); }
.grid img.unlocked { animation: unlocked .7s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes unlocked { from { transform: scale(.3) rotate(-25deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .grid img.unlocked { animation: none; } }
body.night .unlock-err { color: #FF9C9C; }

/* my own messages: the same as everyone else's, mirrored to the right */
.msg.mine { flex-direction: row-reverse; }
.msg.mine .avatar { margin: 14px 0 0 7px; }
.msg.mine .name { text-align: right; margin: 0 3px 2px 0; }
.msg.mine .line { flex-direction: row-reverse; }

/* "Leave AlarmTalk?" after the back button */
#leave { width: min(86vw, 320px); }
#leave .lead { margin-bottom: 2px; }
#leave .text-btn:focus-visible { outline: 2px solid rgba(31, 228, 167, .55); outline-offset: 2px; border-radius: 8px; }

/* ---- Diwali theme ----
   Warm cream instead of mint: a peach top bar, orange buttons, and a hanging
   lantern, fireworks, a palace in the haze and two diyas drawn behind the
   chat (.diwali-deco, built by app.js). Mint accents turn orange by
   redefining the two mint colours for the whole page. */
body.diwali {
  --mint-left: #F7B23B;
  --mint-right: #F39A1E;
  --dw-ink: #4A2E1A;
  --dw-muted: #8C6A4F;
  --dw-line: #F0DCC3;
  --dw-cream: #FFF7EC;
  --dw-deep: #C9620F;
}

/* the top bar: peach, with dark text */
.theme-diwali .appbar { background: linear-gradient(90deg, #FCE7CD, #F9D9B3); color: var(--dw-ink); border-bottom: 1px solid #F3D3AE; }
.theme-diwali .back { stroke: var(--dw-ink); }
.theme-diwali .pill { background: rgba(255, 255, 255, .38); border-color: #E9C394; color: var(--dw-ink); }
.theme-diwali .pill.on { background: #FFFDF8; border-color: #FFFDF8; color: #3B2414; box-shadow: 0 1px 4px rgba(170, 100, 40, .18); }
.theme-diwali .pill .dot, .theme-diwali .pill.on .dot { background: #22C55E; }
.theme-diwali .pill .live-count { background: rgba(120, 70, 20, .1); }
.theme-diwali .pill.invite { border-color: var(--mint-right); color: var(--dw-deep); }
.theme-diwali .pill.deleted.on { color: #b4532a; }
.theme-diwali .env-tag { background: #4A2E1A; color: #FFE2B8; }

/* a diya in the gear's place (and in place of the Halloween pumpkin) */
/* hidden outside the Diwali theme; .gear makes it outrank the .dw-lamp display rule further down */
.gear .gear-diya { display: none; }
.theme-diwali .gear { width: 40px; height: 36px; padding: 0; }
.theme-diwali .gear > svg, .theme-diwali .gear-pumpkin { display: none !important; }
/* .gear.pumpkin hides every svg in the button; this one comes back */
.theme-diwali .gear .gear-diya { display: block; width: 34px; height: 34px; margin: 1px auto 0; object-fit: contain; }

/* the room bar */
.theme-diwali .roombar { background: rgba(255, 249, 241, .92); border-bottom-color: var(--dw-line); }
.theme-diwali .stack .count { color: var(--dw-muted); }
.theme-diwali .stack .count.activity { color: var(--dw-deep); }
.theme-diwali .faces img, .theme-diwali .faces .face { border-color: #FFF9F1; background: #FCE8CF; }
body.diwali .small-btn { background: linear-gradient(180deg, #F8AE2E, #F0901C); }
body.diwali .small-btn.ghost { background: #fff; color: var(--dw-ink); border-color: var(--dw-line); }
body.diwali .small-btn.warn { background: #E8641E; }
body.diwali .small-btn.gray { background: #F5ECE2; color: #6B5340; }
body.diwali .small-btn.red { background: #D64545; }

/* the chat: the drawings sit behind it and never catch a tap */
.diwali-deco { display: none; }
/* faded, so they set the mood without pulling the eye from the messages */
.theme-diwali .diwali-deco { display: block; position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; opacity: .45; }
.theme-diwali .messages { position: relative; z-index: 1; }
/* the hills and diyas carry on down behind the text box, which has no bar of its own */
.theme-diwali .diwali-deco { bottom: calc(-52px - env(safe-area-inset-bottom)); }
/* while a reply is quoted, or watching, the bar there has its own cream: keep the drawings above it */
.theme-diwali:has(#replyBar:not([hidden])) .diwali-deco,
.watching .theme-diwali .diwali-deco { bottom: 0; }
.diwali-deco .dw { position: absolute; display: block; height: auto; user-select: none; -webkit-user-drag: none; }
.dw-lantern { left: 18px; top: 0; width: 62px; transform-origin: 50% 0; }
.dw-fw-pink { right: 46px; top: 14px; width: 108px; }
.dw-fw-gold { right: 4px; top: 104px; width: 74px; }
.dw-spark { opacity: .9; }
/* the hills stretch to any width; the rest keep their shape */
/* like the mockup: the palace stands behind the hills, partly past the left
   edge; two small diyas sit on the hill at the right */
/* the hills from the asset sheet, stretched to the width; they hide the palace's base */
.dw-hills { left: 0; bottom: 0; width: 100%; height: 84px !important; object-fit: fill; z-index: 1; }
.dw-palace { left: -38px; bottom: 58px; width: 214px; z-index: 0; }
.dw-sparkles { right: 92px; bottom: 54px; width: 34px; z-index: 2; }
.dw-diya { z-index: 2; }
.dw-diya-1 { right: 18px; bottom: 64px; width: 30px; }
.dw-diya-2 { right: 52px; bottom: 40px; width: 29px; }
@media (prefers-reduced-motion: no-preference) {
  .dw-lantern { animation: dw-sway 5s ease-in-out infinite; }
  .dw-fw-pink { animation: dw-twinkle 3.2s ease-in-out infinite; }
  .dw-fw-gold { animation: dw-twinkle 3.2s ease-in-out 1.6s infinite; }
  @keyframes dw-sway { 50% { transform: rotate(3deg); } }
  @keyframes dw-twinkle { 50% { opacity: .55; } }
}
/* a narrow phone: the pictures shrink so they stay at the edges */
@media (max-width: 380px) {
  .dw-lantern { width: 52px; left: 10px; }
  .dw-fw-pink { width: 92px; right: 38px; }
  .dw-fw-gold { width: 62px; }
  .dw-palace { width: 190px; left: -34px; bottom: 54px; }
}

/* messages */
/* bubbles lift off the cream: pure white, a warmer edge and a soft shadow */
.theme-diwali .bubble {
  background: #fff; border-color: #E3C29C; color: #24170E;
  box-shadow: 0 1px 2px rgba(150, 90, 30, .14), 0 4px 12px rgba(190, 120, 40, .12);
}
.theme-diwali .bubble.emoji { box-shadow: 0 1px 2px rgba(150, 90, 30, .1); }
.theme-diwali .bubble a { color: var(--dw-deep); }
/* deep saffron-red: reads clearly on the cream (about 6:1) and stays festive */
.theme-diwali .name { color: #A8350C; font-size: 11.5px; letter-spacing: .01em; }
.theme-diwali .time { color: #8E705A; }
.theme-diwali .sys { background: rgba(252, 232, 207, .9); color: #8A5A2B; }
.theme-diwali .avatar, .theme-diwali .avatar.fallback { background: #FCE8CF; }
.theme-diwali .avatar { box-shadow: 0 0 0 2px #fff, 0 2px 8px rgba(160, 95, 30, .2); }
.theme-diwali .vwave span { background: #EBD6BF; }
.theme-diwali .vwave span.on, body.diwali .q-name, body.diwali .reply-icon svg { color: var(--dw-deep); stroke: var(--dw-deep); }
.theme-diwali .vwave span.on { background: var(--dw-deep); }
.theme-diwali .quote { background: rgba(243, 154, 30, .1); }
.theme-diwali .quote:hover, .theme-diwali .quote:active { background: rgba(243, 154, 30, .18); }
.theme-diwali .quote.mine { border-left-color: var(--dw-deep); background: rgba(201, 98, 15, .08); }
.theme-diwali .msg.swiping::before { background-color: rgba(243, 154, 30, .18); }
.theme-diwali .msg.flash, .theme-diwali .sys.flash { animation-name: dw-flash; }
@keyframes dw-flash { 0%, 45% { background: rgba(243, 154, 30, .25); box-shadow: 0 0 0 6px rgba(243, 154, 30, .25); } 100% { background: transparent; box-shadow: 0 0 0 6px transparent; } }

/* an empty private room: a big diya over the words */
.empty-art { display: none; }
.theme-diwali .empty-room { color: #5B4030; font-size: 15px; }
.theme-diwali .empty-art { display: block; width: 200px; margin: 0 auto 12px; }
.theme-diwali .empty-art img { display: block; width: 100%; height: auto; }
.theme-diwali .empty-room .small-btn { height: 40px; padding: 0 24px; border-radius: 20px; font-size: 15px; box-shadow: 0 4px 12px rgba(240, 144, 28, .3); }

/* the text box and the buttons beside it */
.theme-diwali .reply-bar, .theme-diwali .sticker-panel, .theme-diwali .watch-bar { background: rgba(255, 249, 241, .94); }
.theme-diwali .reply-bar { border-top-color: var(--dw-line); }
.theme-diwali .field-box { background: #fff; border-color: #E8D3BC; }
.theme-diwali .attach svg { stroke: var(--dw-muted); }
.theme-diwali .send, .theme-diwali .rec, .theme-diwali .vplay { background: linear-gradient(180deg, #F8AE2E, #F0901C); }
.theme-diwali .rec.live { background: #FF4D4F; }
.theme-diwali .watch-bar { color: var(--dw-muted); }

/* the pop-ups follow along: orange accents on cream */
body.diwali dialog { background: #FFFBF6; color: #2E2016; }
body.diwali .text-btn { color: var(--dw-deep); }
body.diwali .text-btn.gray { color: var(--dw-muted); }
body.diwali .grid img.sel, body.diwali .bg-tile.sel .swatch { border-color: var(--mint-right); }
body.diwali .bg-tile.sel .bg-name { color: var(--dw-deep); }
body.diwali .field:focus, body.diwali .name-edit { border-color: var(--mint-right); }
body.diwali .action-row .ic { background: #FDEBD3; color: var(--dw-deep); }
body.diwali .pick-bg { border-left-color: var(--dw-line); }
body.diwali .sep { background: var(--dw-line); }

/* a diya whose flame is alive: the flame is its own picture over the bowl and
   flickers from its base, with a warm halo that breathes behind it */
.dw-lamp { position: relative; display: block; }
.dw-lamp[data-lamp="diya"] { --fx: 53%; --fy: 50%; }
.dw-lamp[data-lamp="diya-flowers"] { --fx: 49.6%; --fy: 50.6%; }
.dw-lamp > img { position: relative; z-index: 1; display: block; width: 100%; height: auto; }
.dw-lamp > .lamp-flame { position: absolute; inset: 0; z-index: 2; height: 100%; transform-origin: var(--fx) var(--fy); }
.dw-lamp::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 30% 36% at var(--fx) calc(var(--fy) - 22%), rgba(255, 196, 80, .6), rgba(255, 196, 80, 0) 100%);
  transform-origin: var(--fx) calc(var(--fy) - 22%);
}
@media (prefers-reduced-motion: no-preference) {
  /* every diya burns slow and calm: a gentle sway, never a jitter */
  .dw-lamp > .lamp-flame { animation: dw-calm 4.4s ease-in-out infinite; will-change: transform; }
  .dw-lamp::before { animation: dw-halo 4.8s ease-in-out infinite; }
  /* each diya on its own rhythm, so they never flicker in step */
  /* the two diyas at the bottom: a slow, calm sway, never a jitter */
  .dw-diya-1 > .lamp-flame { animation: dw-calm 4.2s ease-in-out -1.1s infinite; }
  .dw-diya-2 > .lamp-flame { animation: dw-calm 5.1s ease-in-out -3.4s infinite; }
  .dw-diya-1::before { animation-duration: 4.6s; }
  .dw-diya-2::before { animation-duration: 5.4s; animation-delay: -2s; }
  @keyframes dw-calm {
    0%, 100% { transform: scale(1, 1) skewX(0deg); filter: brightness(1) drop-shadow(0 0 2px rgba(255, 170, 40, .65)); }
    30% { transform: scale(.985, 1.04) skewX(-1.2deg); filter: brightness(1.06) drop-shadow(0 0 4px rgba(255, 170, 40, .8)); }
    60% { transform: scale(1.01, .985) skewX(.8deg); filter: brightness(.98) drop-shadow(0 0 3px rgba(255, 170, 40, .7)); }
    80% { transform: scale(.995, 1.02) skewX(-.4deg); }
  }
  .gear-diya > .lamp-flame { animation-duration: 4.8s; animation-delay: -2.2s; }
  @keyframes dw-halo {
    0%, 100% { opacity: .75; transform: scale(1); }
    30% { opacity: 1; transform: scale(1.1); }
    65% { opacity: .6; transform: scale(.94); }
  }
}

/* watch mode: blocking from the visitors tab */
.watching .vis-row { cursor: pointer; }
.watching .vis-row:hover { background: rgba(0, 0, 0, .03); }
.vis-row .blocked-tag, .blocked-chip { color: #C62828; font-weight: 700; }
.blocked-chip { border-color: #F2B8B8; background: #FDECEC; }
.check-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; cursor: pointer; }
.check-row input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: #D64545; flex-shrink: 0; }
.check-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.check-text .nm { font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.check-text .sub { font-size: 12.5px; color: var(--time-gray); line-height: 1.35; }
.block-reason { margin: 8px 0 12px; }
.block-go { width: 100%; height: 40px; border-radius: 20px; font-size: 15px; }
.ban-row .nm { overflow-wrap: anywhere; white-space: normal; }
.theme-night .vis-row .blocked-tag { color: #FF9C9C; }
body.night .check-text .sub { color: rgba(255, 255, 255, .6); }

/* the block screen, in plain words: the technical address only small and grey */
.check-text .tech, .ban-row .tech { font: 11px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--time-gray); opacity: .8; margin-top: 2px; overflow-wrap: anywhere; }
.check-row.risky .nm { color: #B26A00; }
body.night .check-row.risky .nm { color: #FFC266; }
.block-help { margin-top: 12px; font-size: 12.5px; line-height: 1.45; color: var(--time-gray); }
.block-help p { margin: 0 0 6px; }
body.night .block-help { color: rgba(255, 255, 255, .6); }

/* ---- games: a round button next to settings, and its drop-down menu ---- */
/* above the chat, so the menu isn't covered (the night theme's blur makes the bar its own layer) */
.appbar { position: relative; z-index: 5; }
.games { position: relative; flex-shrink: 0; }
.games-btn {
  position: relative; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #8E7DFF, #5B47E0);
  box-shadow: 0 2px 6px rgba(70, 50, 190, .35), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .15s, box-shadow .15s;
}
.games-btn:active { transform: scale(.92); }
.games-btn.on { box-shadow: 0 0 0 3px rgba(255, 255, 255, .6), 0 2px 6px rgba(70, 50, 190, .35); }
.games-btn .games-pad { width: 19px; height: 19px; }
.games-pad .pad-body { fill: #fff; }
.games-pad .pad-bits { fill: #5B47E0; }

.games-menu {
  position: absolute; top: calc(100% + 6px); right: -2px; z-index: 20; min-width: 168px; padding: 4px;
  background: #fff; color: #1D1D2B; border-radius: 12px;
  box-shadow: 0 8px 24px rgba(20, 20, 50, .16), 0 1px 2px rgba(0, 0, 0, .06);
  transform-origin: top right; animation: games-pop .16s ease-out;
}
@keyframes games-pop { from { opacity: 0; transform: scale(.94) translateY(-4px); } }
.gm-head {
  display: flex; align-items: center; gap: 7px; padding: 6px 8px; border-radius: 8px;
  background: #F1EDFF; font-size: 13px; font-weight: 700;
}
.gm-head .games-pad { width: 18px; height: 18px; }
.gm-head .pad-body { fill: #5B47E0; }
.gm-head .pad-bits { fill: #fff; }
.games-menu hr { border: 0; border-top: 1px solid #EFEFF4; margin: 4px 2px; }
.games-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px;
  border: 0; border-radius: 8px; background: none; color: inherit; font-size: 13.5px; text-align: left; white-space: nowrap;
}
.games-menu button:hover, .games-menu button:focus-visible { background: #F4F2FF; outline: none; }
.gm-ico { flex-shrink: 0; width: 18px; height: 18px; font-size: 15px; line-height: 18px; text-align: center; }
svg.gm-ico { fill: none; stroke-width: 2.2; stroke-linecap: round; }
.gm-ico .ttt-grid { stroke: #B9B4D6; stroke-width: 1.4; }
.gm-ico .ttt-x { stroke: #F0533F; }
.gm-ico .ttt-o { stroke: #5B47E0; }

/* the watch view can't play */
.watching .games { display: none; }

.theme-night .games-menu { background: rgba(16, 20, 42, .96); color: var(--text-night); border: 1px solid var(--line); }
.theme-night .gm-head { background: rgba(142, 125, 255, .22); }
.theme-night .games-menu hr { border-top-color: var(--line); }
.theme-night .games-menu button:hover, .theme-night .games-menu button:focus-visible { background: rgba(255, 255, 255, .07); }
.theme-night .gm-ico .ttt-grid { stroke: rgba(255, 255, 255, .25); }

.theme-diwali .games-menu { background: #FFFDF8; color: var(--dw-ink); border: 1px solid var(--dw-line); }
.theme-diwali .games-menu hr { border-top-color: var(--dw-line); }

/* ---- tic-tac-toe: a compact card floating over the chat, moved by dragging its header ---- */
.ttt {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  width: fit-content; max-width: calc(100% - 16px);
  background: #F6F3FF; color: #1D1D2B;
  border: 1px solid #D9CFFF; border-radius: 14px;
  box-shadow: 0 8px 24px rgba(60, 40, 160, .16);
  animation: games-pop .18s ease-out;
  touch-action: none;
}
.ttt.dragging { box-shadow: 0 14px 34px rgba(60, 40, 160, .26); cursor: grabbing; }

/* the header: avatar ✕ vs avatar ◯ | ● 2/2, then fold and close */
.ttt-head {
  display: flex; align-items: center; gap: 5px; padding: 5px 4px 5px 5px;
  cursor: grab; user-select: none; -webkit-user-select: none;
}
.ttt-vs { display: flex; align-items: center; gap: 4px; min-width: 0; }
.ttt-vs .vs { font-size: 11px; font-weight: 700; color: #8A84A8; }
.ttt-chip {
  display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px 2px 2px; border-radius: 999px;
  background: #fff; transition: box-shadow .2s;
}
.ttt-chip.turn { box-shadow: 0 0 0 1.5px #7C68F5; }
.ttt-chip img, .ttt-chip .face { width: 22px; height: 22px; border-radius: 50%; background: #E3F6E4; object-fit: cover; flex-shrink: 0; }
.ttt-chip .face { font-size: 12px; }
.ttt-chip .mk { width: 12px; height: 12px; fill: none; stroke-width: 3.4; stroke-linecap: round; }
.ttt-head #tttClose { margin-left: auto; }
.ttt-icon { width: 24px; height: 24px; padding: 4px; border: 0; border-radius: 7px; background: none; color: #55526B; flex-shrink: 0; }
.ttt-icon:hover { background: rgba(91, 71, 224, .1); }
.ttt-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }

/* the board, with whose turn it is under it */
.ttt-body { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0 8px 8px; }
.ttt-board {
  --cell: 44px;
  display: grid; grid-template-columns: repeat(3, var(--cell)); grid-auto-rows: var(--cell);
  gap: 1px; background: #E2DCF8; border-radius: 10px; overflow: hidden;
}
.ttt-board button { display: grid; place-items: center; padding: 0; border: 0; background: #fff; transition: background .15s; }
.ttt-board button:not(:disabled):hover { background: #F4F1FF; }
.ttt-board button:disabled { cursor: default; }
.ttt-board button.win { background: #EAFBF1; }
.ttt-board .mk { width: 58%; height: 58%; fill: none; stroke-width: 2.8; stroke-linecap: round; animation: ttt-mark .2s ease-out; }
.mk.mx { stroke: #22A3E6; }
.mk.mo { stroke: #E5336B; }
@keyframes ttt-mark { from { transform: scale(.4); opacity: 0; } }
.ttt-turn {
  display: flex; align-items: center; justify-content: center; gap: 4px; padding: 4px 10px;
  border: 0; border-radius: 999px; background: #E9E3FF; color: #4B37D1; font-size: 12px; font-weight: 700;
}
.ttt-turn:disabled { cursor: default; opacity: 1; }
.ttt-turn svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; flex-shrink: 0; }
.ttt-turn.done { background: #5B47E0; color: #fff; }
/* sits in the corner, level with the turn pill */
.ttt-grow {
  position: absolute; right: 6px; bottom: 7px; width: 22px; height: 22px; padding: 4px;
  border: 0; border-radius: 6px; background: none; color: #8A84A8;
}
.ttt-grow:hover { background: rgba(91, 71, 224, .1); color: #55526B; }
.ttt-grow svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
/* the bigger board */
.ttt.big .ttt-board { --cell: min(72px, calc((100vw - 52px) / 3)); }

/* night themes: the game card is a solid, lighter panel with a purple edge and glow, so it stands off the dark chat */
.theme-night .ttt {
  background: linear-gradient(180deg, #2E2A63, #252352); color: var(--text-night);
  border: 1.5px solid rgba(160, 145, 255, .75);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 18px 44px rgba(0, 0, 0, .65), 0 0 28px rgba(124, 104, 245, .45);
}
.theme-night .ttt.dragging { box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 24px 56px rgba(0, 0, 0, .7), 0 0 36px rgba(124, 104, 245, .6); }
.theme-night .ttt-head { border-bottom: 1px solid rgba(160, 145, 255, .18); margin-bottom: 6px; }
.theme-night .ttt-icon, .theme-night .ttt-grow { color: var(--text-night); }
.theme-night .ttt-vs .vs { color: rgba(238, 241, 250, .6); }
.theme-night .ttt-chip { background: rgba(255, 255, 255, .1); }
.theme-night .ttt-board { background: rgba(142, 125, 255, .3); }
.theme-night .ttt-board button { background: #1C1F3D; }
.theme-night .ttt-board button:not(:disabled):hover { background: #262A50; }
.theme-night .ttt-board button.win { background: #1D3B34; }
.theme-night .ttt-turn { background: rgba(142, 125, 255, .25); color: #CFC6FF; }
.theme-night .ttt-turn.done { background: #6E5CF0; color: #fff; }
.theme-night .ttt-grow { color: rgba(238, 241, 250, .6); }

/* ---- a game invite in the chat: who started it, which game, and Join ---- */
.game-invite {
  /* in the chat's flex column a clipped card may shrink: keep it whole however long the chat gets */
  flex-shrink: 0;
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: center; gap: 12px; margin: 10px 2px; padding: 10px 10px 10px 12px;
  background: linear-gradient(100deg, #FCFBFF, #F5F2FF);
  border: 1px solid #E3DCFF; border-radius: 18px;
  box-shadow: 0 4px 16px rgba(91, 71, 224, .09);
}
/* behind the button: a band that rises from the bottom in an S-curve and runs to the right edge */
.game-invite::after {
  content: ""; position: absolute; z-index: -1; top: 0; right: 0; bottom: 0; width: 48%;
  background: #EEE9FF;
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 100' preserveAspectRatio='none'%3E%3Cpath d='M0 100C48 100 52 0 100 0H200V100Z'/%3E%3C/svg%3E");
  -webkit-mask: var(--wave) no-repeat 0 0 / 100% 100%;
  mask: var(--wave) no-repeat 0 0 / 100% 100%;
}
.gi-face { position: relative; flex-shrink: 0; width: 40px; height: 40px; }
.gi-face img, .gi-face .face { width: 40px; height: 40px; border-radius: 50%; background: #FCEFC4; object-fit: cover; }
.gi-face .face { font-size: 20px; }
.gi-badge {
  position: absolute; right: -5px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; background: #5B47E0; border: 2px solid #FCFBFF;
}
.gi-badge .games-pad { width: 12px; height: 12px; }
.gi-line { flex-shrink: 0; align-self: stretch; width: 1px; margin: 4px 0; background: #E3DCFF; }
.gi-text { flex: 1; min-width: 0; }
.gi-title { font-size: 14.5px; font-weight: 700; color: #1D1B33; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gi-title b { font-weight: 800; }
.gi-sub { margin-top: 2px; font-size: 12.5px; color: #7A7694; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gi-join {
  flex-shrink: 0; padding: 8px 18px; border: 0; border-radius: 999px;
  background: #5B47E0; color: #fff; font-size: 14px; font-weight: 700;
  box-shadow: 0 3px 10px rgba(91, 71, 224, .3); transition: transform .12s, background .15s;
}
.gi-join:hover { background: #4E3BD4; }
.gi-join:active { transform: scale(.96); }
.gi-join:disabled { background: #DCD7F0; color: #7C7896; box-shadow: none; cursor: default; }

.ttt-chip .face.empty { background: none; border: 1.5px dashed #B9B4D6; }

.theme-night .game-invite { background: linear-gradient(100deg, rgba(26, 28, 56, .92), rgba(34, 32, 72, .92)); border-color: rgba(142, 125, 255, .3); box-shadow: none; }
.theme-night .game-invite::after { background: rgba(142, 125, 255, .14); }
.theme-night .gi-badge { border-color: #1C1D3C; }
.theme-night .gi-line { background: rgba(142, 125, 255, .3); }
.theme-night .gi-title { color: var(--text-night); }
.theme-night .gi-sub { color: rgba(238, 241, 250, .6); }
.theme-night .gi-join:disabled { background: rgba(255, 255, 255, .1); color: rgba(238, 241, 250, .5); }
/* an old game its starter replaced with a new one */
.game-invite.ended { opacity: .7; }

/* ---- Mini Ludo ---- */
.game-foot { display: flex; align-items: center; justify-content: center; gap: 8px; max-width: 100%; }
.game-foot .ttt-turn { min-width: 0; text-align: center; line-height: 1.3; }
.lchip { --lcol: #D6D1EA; padding: 2px !important; box-shadow: inset 0 0 0 2px var(--lcol); }
.lchip.turn { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--lcol); }
/* the four colours */
.l-red { --lcol: #E5484D; --ltint: #FDE4E5; }
.l-green { --lcol: #2FA36B; --ltint: #DDF4E8; }
.l-yellow { --lcol: #F2B705; --ltint: #FEF3CC; }
.l-blue { --lcol: #3B82F6; --ltint: #E0ECFE; }

/* picking a colour before it begins */
.ludo-pick { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 4px 6px 2px; }
.lp-hint { font-size: 12px; font-weight: 600; color: #6C6888; }
.lp-row { display: flex; gap: 9px; }
.lp {
  width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center;
  background: var(--lcol); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12); transition: transform .12s;
}
.lp:not(:disabled):hover { transform: scale(1.08); }
.lp:disabled { cursor: default; }
.lp:disabled:not(.mine) { opacity: .5; }
.lp.mine { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--lcol); }
.lp img, .lp .face { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; background: #fff; object-fit: cover; font-size: 12px; }

/* the board: an 11×11 cross */
.ludo-board {
  --lc: 19px;
  display: grid; grid-template-columns: repeat(11, var(--lc)); grid-template-rows: repeat(11, var(--lc)); gap: 1px;
  padding: 3px; background: #fff; border-radius: 10px; box-shadow: inset 0 0 0 1px #E2DCF8;
}
.ttt.big .ludo-board { --lc: min(28px, calc((100vw - 60px) / 11)); }
.lc {
  display: grid; place-items: center; border-radius: 3px; background: #fff; border: 1px solid #E6E1F5;
  font-size: calc(var(--lc) * .55); line-height: 1; color: var(--lcol);
}
.lc.start { background: var(--ltint); border-color: var(--ltint); }
.lc.lane { background: var(--lcol); border-color: transparent; opacity: .82; }
.lb-yard { display: grid; place-items: center; margin: 1px; border-radius: 9px; background: var(--lcol); }
.ly-inner {
  width: 74%; height: 74%; display: flex; align-items: center; justify-content: center; gap: 10%;
  background: #fff; border-radius: 8px;
}
.ly-slot { width: calc(var(--lc) * 1.05); height: calc(var(--lc) * 1.05); border-radius: 50%; display: grid; place-items: center; background: var(--ltint); }
/* home, in the middle: each colour's side faces its lane */
.lb-home { border-radius: 3px; background: conic-gradient(from 45deg, #F2B705 0 25%, #3B82F6 0 50%, #E5484D 0 75%, #2FA36B 0); }

/* tokens: stacked on a square when more than one is there */
.lt-stack { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.lt-stack .lt + .lt { margin-left: calc(var(--lc) * -.42); }
.lt {
  pointer-events: auto; flex-shrink: 0; width: calc(var(--lc) * .78); height: calc(var(--lc) * .78); padding: 0;
  border: 2px solid #fff; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .6), transparent 46%), var(--lcol);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.lt:disabled { cursor: default; }
.lt.can { position: relative; z-index: 2; box-shadow: 0 0 0 2px var(--lcol), 0 1px 4px rgba(0, 0, 0, .35); animation: lt-pulse 0.9s ease-in-out infinite; }
@keyframes lt-pulse { 50% { transform: scale(1.18); } }

/* the die: the face it last landed on */
.ludo-die {
  flex-shrink: 0; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 10px; background: none;
  display: grid; place-items: center;
}
.ludo-die img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .18)); transition: opacity .15s; }
.ludo-die.blank img { opacity: .45; }
.ludo-die.rolling img { opacity: 0; }
.ludo-die:disabled { cursor: default; }
.ludo-die.go { animation: die-nudge 1.1s ease-in-out infinite; }
.ludo-die.go img { filter: drop-shadow(0 0 4px var(--lcol)) drop-shadow(0 2px 3px rgba(0, 0, 0, .18)); }
@keyframes die-nudge { 50% { transform: translateY(-2px) rotate(-8deg); } }
/* a roll: the die tumbles to its face over the board, then fades */
.ludo-roll { position: absolute; z-index: 5; inset: 0 0 46px; display: grid; place-items: center; pointer-events: none; }
.ludo-roll img { width: 120px; height: 120px; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .28)); animation: dice-in .18s ease-out; }
.ludo-roll.out img { opacity: 0; transform: scale(.85); transition: opacity .2s, transform .2s; }
@keyframes dice-in { from { transform: scale(.6); opacity: 0; } }

.theme-night .lp-hint { color: rgba(238, 241, 250, .65); }
.theme-night .ludo-board { background: #1C1F3D; box-shadow: inset 0 0 0 1px rgba(142, 125, 255, .3); }
.theme-night .lc { background: #23264A; border-color: rgba(255, 255, 255, .08); }
.theme-night .lc.start { background: color-mix(in srgb, var(--lcol) 35%, #23264A); border-color: transparent; }
.theme-night .lc.lane { background: var(--lcol); border-color: transparent; opacity: .9; }
.theme-night .ly-inner { background: #1C1F3D; }
.theme-night .ly-slot { background: color-mix(in srgb, var(--lcol) 25%, #1C1F3D); }

/* the turn timer: a ring round the player's avatar that drains over 15 seconds */
.lchip { position: relative; }
.lchip.turn { box-shadow: inset 0 0 0 2px var(--lcol); }
.lchip-timer { position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px); transform: rotate(-90deg); pointer-events: none; overflow: visible; }
.lchip-timer circle {
  fill: none; stroke: var(--lcol); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 0;
  animation-name: lchip-drain; animation-timing-function: linear; animation-fill-mode: forwards;
}
@keyframes lchip-drain { 75% { stroke: var(--lcol); } to { stroke-dashoffset: 100; stroke: #E5484D; } }

/* swap squares */
.lc.swap { background: #F1EDFF; border-color: #D9CFFF; color: #5B47E0; font-weight: 800; font-size: calc(var(--lc) * .6); }
.theme-night .lc.swap { background: rgba(142, 125, 255, .22); border-color: transparent; color: #CFC6FF; }

/* a token hopping square by square */
.lt.hop { position: relative; z-index: 3; animation: lt-hop .115s ease-out; }
@keyframes lt-hop { 50% { transform: translateY(-35%) scale(1.12); } }
/* a capture: a burst where it happened */
.lt-burst {
  z-index: 4; pointer-events: none; place-self: center; width: calc(var(--lc) * 2.2); height: calc(var(--lc) * 2.2); border-radius: 50%;
  background: radial-gradient(circle, transparent 30%, var(--lcol) 32%, transparent 62%);
  animation: lt-burst .6s ease-out forwards;
}
@keyframes lt-burst { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
/* swapping: pick a target; the two that swapped spin */
.lt.swap-target { position: relative; z-index: 2; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #7C68F5; animation: lt-pulse .9s ease-in-out infinite; cursor: pointer; }
.lt.swapper { position: relative; z-index: 2; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #7C68F5; }
.lt.swapped { animation: lt-swapped .7s ease-out; }
@keyframes lt-swapped { from { transform: rotate(-360deg) scale(.4); } }
/* Ludo: the card keeps the board's width; long news wraps instead of widening it */
.ttt.is-ludo .game-foot, .ttt.is-dots .game-foot { contain: inline-size; width: 100%; }
/* and clear of the enlarge button in the corner */
.ttt.is-dots .game-foot { padding: 0 22px; }

/* ---- Ludo effects: a cut and a swap (drawn over the page) ---- */
.lt.fx-hidden { visibility: hidden; }
.fx-piece, .fx-ghost, .fx-text { position: fixed; z-index: 60; pointer-events: none; }
.fx-ghost { z-index: 61; margin: 0; box-shadow: 0 6px 14px rgba(0, 0, 0, .35); }
.fx-shock { border-radius: 50%; border: 3px solid var(--lcol); box-shadow: 0 0 12px var(--lcol); }
.fx-shard { border-radius: 2px; background: var(--lcol); box-shadow: 0 0 4px var(--lcol); }
.fx-spark { border-radius: 50%; }
.fx-spark-a { background: radial-gradient(circle, #fff 0 25%, #8E7DFF 45%, transparent 70%); }
.fx-spark-b { background: radial-gradient(circle, #fff 0 25%, #FF7AB8 45%, transparent 70%); }
.fx-swirl {
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 10%, #8E7DFF 25%, transparent 40%, #FF7AB8 60%, transparent 75%, #8E7DFF 90%, transparent);
  -webkit-mask: radial-gradient(circle, transparent 52%, #000 54% 68%, transparent 70%);
  mask: radial-gradient(circle, transparent 52%, #000 54% 68%, transparent 70%);
}
.fx-text {
  font-size: 19px; font-weight: 900; white-space: nowrap; letter-spacing: .02em;
  -webkit-text-stroke: 3px #fff; paint-order: stroke fill; text-shadow: 0 3px 8px rgba(0, 0, 0, .25);
}
.fx-cut { color: #E5484D; }
.fx-swap { color: #5B47E0; }

/* ---- Dots and Boxes ---- */
.d-A { --dcol: #5B47E0; --dtint: #E6E0FF; }
.d-B { --dcol: #E5336B; --dtint: #FFE0EA; }
.dots-ico { fill: #B9B4D6; stroke: none; }
.dots-ico rect { fill: #E6E0FF; }
.dots-ico path { fill: none; stroke: #5B47E0; stroke-width: 2.2; stroke-linecap: round; }
.dots-ico circle { fill: #3A3650; }
.dchip { padding: 2px 9px 2px 2px !important; }
.dchip.turn { box-shadow: 0 0 0 1.5px var(--dcol); }
.dscore { min-width: 10px; font-size: 14px; font-weight: 800; color: var(--dcol); text-align: center; }
.dots-board { padding: 4px; background: #fff; border-radius: 12px; box-shadow: inset 0 0 0 1px #E2DCF8; }
.dots-board svg { display: block; width: 184px; height: 184px; }
.ttt.big .dots-board svg { width: min(270px, calc(100vw - 70px)); height: min(270px, calc(100vw - 70px)); }
.dl { stroke: #ECE9F7; stroke-width: 5; stroke-linecap: round; }
.dl.on { stroke: var(--dcol); }
.dl.last { stroke-dasharray: 40; animation: dl-draw .3s ease-out; }
@keyframes dl-draw { from { stroke-dashoffset: 40; } }
.dots-board.my-turn svg { cursor: pointer; }
.dprev { stroke: transparent; stroke-width: 7; stroke-linecap: round; pointer-events: none; }
.dprev.on { stroke: rgba(91, 71, 224, .32); }
.me-B .dprev.on { stroke: rgba(229, 51, 107, .32); }
.dbox { fill: var(--dtint); stroke: none; }
.dbox.new { transform-box: fill-box; transform-origin: center; animation: dbox-in .35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes dbox-in { from { transform: scale(.2); opacity: 0; } }
.dd { fill: #2A2540; }
.ttt-turn .pdot { width: 9px; height: 9px; border-radius: 50%; background: var(--dcol); flex-shrink: 0; }
.theme-night .dots-board { background: #1C1F3D; box-shadow: inset 0 0 0 1px rgba(142, 125, 255, .3); }
.theme-night .dl:not(.on) { stroke: #2C3058; }
.theme-night .dd { fill: #EEF1FA; }
.theme-night .d-A { --dtint: rgba(91, 71, 224, .35); }
.theme-night .d-B { --dtint: rgba(229, 51, 107, .3); }

/* dark themes: the menu's game icons in lighter colours, so they read on the dark menu */
.theme-night .gm-ico .ttt-grid { stroke: rgba(255, 255, 255, .32); }
.theme-night .gm-ico .ttt-x { stroke: #FF7B6E; }
.theme-night .gm-ico .ttt-o { stroke: #A99CFF; }
.theme-night .dots-ico circle { fill: #E4E1F2; }
.theme-night .dots-ico rect { fill: rgba(169, 156, 255, .35); }
.theme-night .dots-ico path { stroke: #A99CFF; }

/* watching a game you're not in */
.ttt-watch { margin-left: auto; font-size: 15px; line-height: 1; padding: 0 2px; }
.ttt-watch:not([hidden]) + #tttClose { margin-left: 0; }
.gi-join.watch { background: #fff; color: #4B37D1; box-shadow: inset 0 0 0 1.5px #7C68F5, 0 2px 6px rgba(91, 71, 224, .15); }
.gi-join.watch:hover { background: #F4F1FF; }
.theme-night .gi-join.watch { background: rgba(255, 255, 255, .08); color: #CFC6FF; box-shadow: inset 0 0 0 1.5px rgba(160, 145, 255, .7); }
.lc.swap svg { width: 74%; height: 74%; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

/* confetti when you win: inside the game card, over everything in it */
.confetti { position: absolute; inset: 0; z-index: 8; overflow: hidden; border-radius: inherit; pointer-events: none; }
.confetti i { position: absolute; border-radius: 1.5px; }
.confetti i.round { border-radius: 50%; }

/* the games menu: Continue (my games still going in this room) */
.gm-resume { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.games-menu .gm-go { gap: 7px; font-size: 13px; }
.gm-go-play { width: 18px; font-size: 10px; color: #5B47E0; text-align: center; flex-shrink: 0; }
.gm-go-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.gm-go small { font-size: 11px; color: #8A84A8; flex-shrink: 0; }
.gm-go small.gm-go-turn { color: #fff; background: #5B47E0; padding: 1px 7px; border-radius: 999px; font-weight: 700; }
.theme-night .gm-go-play { color: #A99CFF; }
.theme-night .gm-go small { color: rgba(238, 241, 250, .55); }
.theme-night .gm-go small.gm-go-turn { color: #fff; background: #6E5CF0; }
/* a Ludo player who left */
.lchip.gone { opacity: .35; filter: grayscale(1); }

/* the pill while it still shows a result: not a button yet */
.ttt-turn.early { cursor: default; }

/* Ludo: a token that's home sits small in its own colour's triangle of the centre square */
.lb-home { position: relative; }
.lt.at-home { position: absolute; width: 30%; height: 30%; border-width: 1px; box-shadow: 0 0 1px rgba(0, 0, 0, .4); transform: translate(-50%, -50%); }
.lt.at-home.l-red.home-0 { left: 18%; top: 36%; }
.lt.at-home.l-red.home-1 { left: 18%; top: 64%; }
.lt.at-home.l-green.home-0 { left: 36%; top: 18%; }
.lt.at-home.l-green.home-1 { left: 64%; top: 18%; }
.lt.at-home.l-yellow.home-0 { left: 82%; top: 36%; }
.lt.at-home.l-yellow.home-1 { left: 82%; top: 64%; }
.lt.at-home.l-blue.home-0 { left: 36%; top: 82%; }
.lt.at-home.l-blue.home-1 { left: 64%; top: 82%; }

/* toasts go under the game card, so they never cover its header */
.ttt { z-index: 5; }
/* the result first, as a plain status line; it becomes the purple Play again button after 2 s */
.ttt-turn.done.early { background: #E9E3FF; color: #4B37D1; }
.theme-night .ttt-turn.done.early { background: rgba(142, 125, 255, .25); color: #CFC6FF; }

/* ---- feedback (games menu) ---- */
.fb-ico { fill: none; stroke: #5B47E0; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.theme-night .fb-ico { stroke: #A99CFF; }
.fb .lead { margin-bottom: 12px; }
.fb-text { height: auto; min-height: 112px; padding: 10px 12px; resize: vertical; font: inherit; font-size: 15px; line-height: 1.4; }
.fb-text:focus { padding: 9px 11px; }
.fb-shots { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.fb-shots:empty { display: none; }
.fb-shot { position: relative; width: 72px; height: 72px; border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.fb-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fb-x {
  position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .6); color: #fff; font-size: 15px; line-height: 22px;
}
.fb-add {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; padding: 8px 12px; border-radius: 10px;
  border: 1.5px dashed #CFC4FF; color: #4B37D1; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.fb-add:hover { background: #F4F1FF; }
.fb-add svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fb-max { font-weight: 400; color: #8A84A8; }

/* ---- the watch view's Feedback tab ---- */
.fbk-list { display: flex; flex-direction: column; gap: 10px; padding: 10px 2px 16px; }
.fbk { padding: 12px 14px; border-radius: 14px; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .08); border: 1px solid #ECEAF3; }
.fbk-head { display: flex; align-items: baseline; gap: 8px; font-size: 14px; }
.fbk-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fbk-when { flex-shrink: 0; font-size: 12px; color: var(--time-gray); }
.fbk-where { margin-top: 2px; font-size: 12px; color: var(--name-gray); }
.fbk-text { margin: 8px 0 0; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.fbk-shots { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.fbk-shots img { display: block; width: 96px; height: 96px; object-fit: cover; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.theme-night .fbk { background: rgba(22, 24, 50, .9); border-color: rgba(255, 255, 255, .1); color: var(--text-night); }
.theme-night .fbk-where { color: rgba(238, 241, 250, .6); }

/* ---- the watch view's Games tab ---- */
.gms-list { display: flex; flex-direction: column; gap: 8px; padding: 10px 2px 16px; }
.gms { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; border-radius: 14px; background: #fff; border: 1px solid #ECEAF3; box-shadow: 0 1px 4px rgba(0, 0, 0, .06); }
.gms.live { border-color: #D9CFFF; }
.gms-faces { display: flex; flex-shrink: 0; }
.gms-faces img, .gms-faces .face { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; margin-left: -8px; background: #E3F6E4; object-fit: cover; font-size: 14px; }
.gms-faces > :first-child { margin-left: 0; }
.gms-faces .gms-ring { border-color: var(--lcol); }
.gms-text { flex: 1; min-width: 0; }
.gms-title { font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gms-sub { margin-top: 1px; font-size: 12px; color: var(--name-gray); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gms .gi-join { padding: 6px 14px; font-size: 13px; }
.theme-night .gms { background: rgba(22, 24, 50, .9); border-color: rgba(255, 255, 255, .1); color: var(--text-night); }
.theme-night .gms-sub { color: rgba(238, 241, 250, .6); }

/* the island: a doorway to the shared 3D island (the icon is Noto Emoji's desert island, Apache 2.0) */
.island-btn { position: relative; width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; transition: transform .15s; }
/* how many are on the island, top left of the icon */
.island-count {
  position: absolute; top: -2px; left: -3px; min-width: 12px; height: 12px; padding: 0 3px; border-radius: 6px;
  background: #16A085; color: #fff; font-size: 8px; font-weight: 700; line-height: 12px; text-align: center;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .9); pointer-events: none; font-variant-numeric: tabular-nums;
}
.island-count[hidden] { display: none; }
.island-btn img { width: 27px; height: 27px; display: block; }
.island-btn:active { transform: scale(.92); }
.watching .island-btn { display: none; }

/* the island open inside the chat: everything below the top bar gives way to it */
.island-pane { flex: 1; min-height: 0; background: #a6d8d3; }
.island-pane[hidden] { display: none; }
.island-pane iframe { display: block; width: 100%; height: 100%; border: 0; }
.app.island-open > :not(.appbar):not(.island-pane) { display: none !important; }
.island-btn[aria-pressed="true"] { background: rgba(255, 255, 255, .85); box-shadow: 0 0 0 2px rgba(255, 255, 255, .85), 0 2px 6px rgba(20, 130, 150, .35); }
/* no room is showing while the island is open */
.app.island-open .pill.on { opacity: .75; }

/* the watch view's Island tab */
.isl { padding: 10px 10px 24px; display: flex; flex-direction: column; gap: 10px; }
.isl-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.isl-stat { background: rgba(255, 255, 255, .86); border-radius: 12px; padding: 9px 11px; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.isl-stat b { font-size: 17px; }
.isl-stat span { font-size: 11px; color: var(--name-gray); }
.isl-bar { height: 5px; border-radius: 3px; background: rgba(0, 0, 0, .1); overflow: hidden; margin-top: 4px; }
.isl-bar i { display: block; height: 100%; background: var(--mint-right); }
.isl-bar i.high { background: #D9534F; }
.isl-live { width: 100%; height: min(62dvh, 560px); border: 0; border-radius: 14px; background: #a6d8d3; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
.isl-head { font-size: 12px; font-weight: 700; color: var(--name-gray); margin: 6px 2px 4px; }
.isl-row { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 10px; background: rgba(255, 255, 255, .8); margin-bottom: 5px; }
.isl-row.live { box-shadow: inset 3px 0 0 #22C55E; }
.isl-row img, .isl-row .face { width: 30px; height: 30px; border-radius: 50%; flex: none; }
.isl-name { font-size: 14px; font-weight: 700; }
.isl-sub { font-size: 12px; color: var(--name-gray); }
body.night .isl-stat, body.night .isl-row { background: rgba(255, 255, 255, .08); }

/* #world / #en: someone else's message opens "Block?" when tapped */
.msg.blockable .avatar, .msg.blockable .name, .msg.blockable .bubble { cursor: pointer; }
.msg[hidden] { display: none; }
.block-go { width: 100%; height: 42px; margin-top: 12px; border-radius: 10px; font-size: 15px; }
.blocked-btn { display: block; margin-top: 10px; padding-left: 0; }

/* ---- Christmas themes (Dec 2026) ----
   Three themes share one way of drawing: a gradient fill (backgrounds.js) and a
   scene of transparent pieces behind the chat (.xmas-deco, built by app.js from
   public/christmas/<scene>/). Christmas (cream) and Winter (icy blue) are light
   themes of their own; Snowy Night is the night theme with gold for mint. */

/* the scene layer: it never catches a tap, and it ends at the top of the text box so
   nothing at the bottom (village, cabin, snowman) is hidden behind it */
.xmas-deco { display: none; }
.theme-xmas .xmas-deco { display: block; position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
/* the text box's strip carries the snowy ground on: it starts on the exact colour the
   ground ends on (the piece over the fill, at the scene's opacity) and deepens a little */
.app[data-deco="cream"] .composer { background: linear-gradient(180deg, #F4E3DC 0%, #F1DDD5 100%); }
.app[data-deco="night"] .composer { background: linear-gradient(180deg, #7687B2 0%, #5B6B96 100%); }
.app[data-deco="winter"] .composer { background: linear-gradient(180deg, #D6E6FA 0%, #CCDFF6 100%); }
.theme-xmas .messages { position: relative; z-index: 1; }
.xm-scene { display: none; position: absolute; inset: 0; }
.app[data-deco="cream"] .xm-scene[data-scene="cream"],
.app[data-deco="night"] .xm-scene[data-scene="night"],
.app[data-deco="winter"] .xm-scene[data-scene="winter"] { display: block; }
/* faded so the messages stay easy to read; the night sky can be a little stronger */
.xm-scene[data-scene="cream"] { opacity: .5; }
.xm-scene[data-scene="night"] { opacity: .72; }
.xm-scene[data-scene="winter"] { opacity: .55; }
.xm-scene .xm { position: absolute; display: block; height: auto; user-select: none; -webkit-user-drag: none; }

/* Christmas (cream): fairy lights across the top, baubles and holly, a village and a tree at the bottom */
.xm-lights { left: -8px; top: -4px; width: calc(100% + 16px); }
.xm-baubles { left: 10px; top: 6px; width: 62px; transform-origin: 50% 0; }
.xm-holly { right: -6px; top: 22px; width: 52px; }
.xm-village { left: 0; bottom: 0; width: 100%; }
.xm-tree { right: 4px; bottom: 14px; width: 104px; }

/* Snowy Night: a starry sky, the moon with Santa's sleigh, mountains, pines and a cabin */
.xm-scene[data-scene="night"] {
  background-image:
    radial-gradient(1.4px 1.4px at 8% 12%, #fff, transparent), radial-gradient(1px 1px at 22% 28%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 37% 9%, #fff, transparent), radial-gradient(1px 1px at 61% 17%, #fff, transparent),
    radial-gradient(1.4px 1.4px at 74% 34%, #fff, transparent), radial-gradient(1px 1px at 91% 22%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 15% 46%, #fff, transparent), radial-gradient(1px 1px at 33% 58%, #fff, transparent),
    radial-gradient(1.4px 1.4px at 56% 44%, #fff, transparent), radial-gradient(1px 1px at 82% 52%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 6% 70%, #fff, transparent), radial-gradient(1px 1px at 47% 69%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 69% 74%, #fff, transparent), radial-gradient(1px 1px at 94% 66%, #fff, transparent),
    radial-gradient(1px 1px at 28% 82%, #fff, transparent), radial-gradient(1.2px 1.2px at 88% 9%, #fff, transparent);
}
.xm-moon { right: 18px; top: 14px; width: 86px; filter: drop-shadow(0 0 16px rgba(255, 236, 190, .5)); }
.xm-mountains { left: 0; bottom: 52px; width: 100%; }
/* the pines at the right edge and the cabin just left of them, in front: tall things keep to
   the right, since names run down the left and must stay easy to read */
.xm-pines-r { right: 2px; bottom: 6px; width: 112px; }
.xm-cabin { right: 84px; bottom: 10px; width: 112px; }
.xm-ground { left: -8px; bottom: -4px; width: calc(100% + 16px); }

/* Winter: northern lights, big snowflakes, a robin, pines, a snowman on the hills */
/* painted northern lights (the sky colour taken out, so only the light is left) */
/* faint and high: it should only just be there, never pull the eye from the messages */
/* (the private-room bar's height comes off its top, so it sits at the same spot on screen
   in #world and in a private room; app.js measures the bar) */
.xm-aurora { left: -4%; top: calc(-44px - var(--roombar-h, 0px)); width: 108%; opacity: .55; }
.xm-flake-1 { left: 6px; top: 10px; width: 54px; }
.xm-flake-2 { right: 8px; top: 18px; width: 48px; }
.xm-robin { right: 0; top: 42%; width: 108px; }
/* fully on screen, standing in the snow near the bottom edge */
.xm-tree-l { right: 126px; bottom: 6px; width: 66px; }
.xm-tree-r { right: 2px; bottom: 6px; width: 58px; }
.xm-hills { left: -8px; bottom: 0; width: calc(100% + 16px); }
/* between the two pines, in front of them */
.xm-snowman { right: 56px; bottom: 8px; width: 78px; }
.xm-bit { opacity: .9; }

@media (prefers-reduced-motion: no-preference) {
  .xm-baubles { animation: dw-sway 5s ease-in-out infinite; }
  .xm-scene .xm-bit:nth-child(odd) { animation: dw-twinkle 3.4s ease-in-out infinite; }
  .xm-scene .xm-bit:nth-child(even) { animation: dw-twinkle 3.4s ease-in-out 1.7s infinite; }
}
/* a narrow phone: the corner pictures shrink so they stay at the edges */
@media (max-width: 380px) {
  .xm-tree { width: 92px; }
  .xm-pines-r { width: 100px; }
  .xm-cabin { width: 100px; right: 76px; }
  .xm-snowman { width: 70px; right: 50px; }
  .xm-tree-l { width: 60px; right: 114px; }
  .xm-tree-r { width: 52px; }
  .xm-robin { width: 96px; }
}

/* the theme's picture in the gear's place (and in place of the Halloween pumpkin) */
.gear .gear-xmas { display: none; }
.theme-xmas .gear { width: 40px; height: 36px; padding: 0; }
.theme-xmas .gear > svg, .theme-xmas .gear-pumpkin { display: none !important; }
.theme-xmas .gear .gear-xmas:not([hidden]) { display: block; width: 32px; height: 32px; margin: 2px auto 0; object-fit: contain; }

/* an empty private room: the theme's tree, cabin or snowman over the words */
.empty-art .xm-empty { display: none; }
.theme-xmas .empty-art { display: block; width: 170px; margin: 0 auto 12px; }
.theme-xmas .empty-art .dw-lamp { display: none; }
.app[data-deco="cream"] .xm-empty[data-scene="cream"],
.app[data-deco="night"] .xm-empty[data-scene="night"],
.app[data-deco="winter"] .xm-empty[data-scene="winter"] { display: block; width: 100%; height: auto; }

/* ---- Christmas (cream): cranberry red and pine green on warm cream ---- */
body.xmas-cream {
  --mint-left: #E05A62;
  --mint-right: #C8323C;
  --xc-ink: #4A1E1E;
  --xc-muted: #8A5A55;
  --xc-line: #F0D6CF;
  --xc-deep: #B0262F;
}
.theme-xmas-cream .appbar { background: linear-gradient(90deg, #F9DED7, #F3C9C0); color: var(--xc-ink); border-bottom: 1px solid #ECBFB5; }
.theme-xmas-cream .back { stroke: var(--xc-ink); }
.theme-xmas-cream .pill { background: rgba(255, 255, 255, .4); border-color: #E3AFA5; color: var(--xc-ink); }
.theme-xmas-cream .pill.on { background: #FFFDFB; border-color: #FFFDFB; color: #3A1414; box-shadow: 0 1px 4px rgba(170, 60, 50, .18); }
.theme-xmas-cream .pill .dot, .theme-xmas-cream .pill.on .dot { background: #22C55E; }
.theme-xmas-cream .pill .live-count { background: rgba(120, 30, 30, .1); }
.theme-xmas-cream .pill.invite { border-color: var(--mint-right); color: var(--xc-deep); }
.theme-xmas-cream .env-tag { background: #4A1E1E; color: #FFE0DA; }
.theme-xmas-cream .roombar { background: rgba(255, 248, 240, .92); border-bottom-color: var(--xc-line); }
.theme-xmas-cream .stack .count { color: var(--xc-muted); }
.theme-xmas-cream .stack .count.activity { color: var(--xc-deep); }
.theme-xmas-cream .faces img, .theme-xmas-cream .faces .face { border-color: #FFF8F0; background: #FBE3DE; }
.theme-xmas-cream .bubble {
  background: #fff; border-color: #EBCBC2; color: #2A1414;
  box-shadow: 0 1px 2px rgba(150, 50, 40, .12), 0 4px 12px rgba(190, 80, 60, .1);
}
.theme-xmas-cream .bubble.emoji { box-shadow: 0 1px 2px rgba(150, 50, 40, .1); }
.theme-xmas-cream .bubble a { color: var(--xc-deep); }
.theme-xmas-cream .name { color: var(--xc-deep); font-size: 11.5px; letter-spacing: .01em; }
.theme-xmas-cream .time { color: #8E6A62; }
.theme-xmas-cream .sys { background: rgba(249, 222, 215, .9); color: #8A3A35; }
.theme-xmas-cream .avatar, .theme-xmas-cream .avatar.fallback { background: #FBE3DE; }
.theme-xmas-cream .avatar { box-shadow: 0 0 0 2px #fff, 0 2px 8px rgba(160, 60, 50, .18); }
.theme-xmas-cream .vwave span { background: #EBD0C9; }
.theme-xmas-cream .vwave span.on { background: var(--xc-deep); }
.theme-xmas-cream .quote { background: rgba(200, 50, 60, .07); }
.theme-xmas-cream .quote.mine { border-left-color: var(--xc-deep); }
.theme-xmas-cream .msg.swiping::before { background-color: rgba(200, 50, 60, .14); }
.theme-xmas-cream .empty-room { color: #5B2C28; font-size: 15px; }
.theme-xmas-cream .reply-bar, .theme-xmas-cream .sticker-panel, .theme-xmas-cream .watch-bar { background: rgba(255, 248, 240, .94); }
.theme-xmas-cream .reply-bar { border-top-color: var(--xc-line); }
.theme-xmas-cream .field-box { background: #fff; border-color: #EBD3CB; }
.theme-xmas-cream .attach svg { stroke: var(--xc-muted); }
.theme-xmas-cream .send, .theme-xmas-cream .rec, .theme-xmas-cream .vplay { background: linear-gradient(180deg, #DC4C55, #B92A34); }
.theme-xmas-cream .rec.live { background: #FF4D4F; }
.theme-xmas-cream .watch-bar { color: var(--xc-muted); }
body.xmas-cream .small-btn { background: linear-gradient(180deg, #DC4C55, #B92A34); }
body.xmas-cream .small-btn.ghost { background: #fff; color: var(--xc-ink); border-color: var(--xc-line); }
body.xmas-cream .small-btn.gray { background: #F6E9E5; color: #6B4540; }
body.xmas-cream .small-btn.red { background: #D64545; }
body.xmas-cream dialog { background: #FFFBF8; color: #2E1A18; }
body.xmas-cream .text-btn { color: var(--xc-deep); }
body.xmas-cream .text-btn.gray { color: var(--xc-muted); }
body.xmas-cream .bg-tile.sel .bg-name { color: var(--xc-deep); }
body.xmas-cream .action-row .ic { background: #FBE3DE; color: var(--xc-deep); }
body.xmas-cream .pick-bg { border-left-color: var(--xc-line); }
body.xmas-cream .sep { background: var(--xc-line); }

/* ---- Winter: pine green and berry red on icy blue ---- */
body.xmas-winter {
  --mint-left: #2E8B62;
  --mint-right: #1F6B4A;
  --xw-ink: #1B3550;
  --xw-muted: #5A7590;
  --xw-line: #CFE0F1;
  --xw-deep: #1F6B4A;
  --xw-red: #C8323C;
}
.theme-xmas-winter .appbar { background: linear-gradient(90deg, #E6F1FB, #D2E5F6); color: var(--xw-ink); border-bottom: 1px solid #C3D9EE; }
.theme-xmas-winter .back { stroke: var(--xw-ink); }
.theme-xmas-winter .pill { background: rgba(255, 255, 255, .5); border-color: #B7D0EA; color: var(--xw-ink); }
.theme-xmas-winter .pill.on { background: #fff; border-color: #fff; color: #102338; box-shadow: 0 1px 4px rgba(40, 80, 130, .18); }
.theme-xmas-winter .pill .dot, .theme-xmas-winter .pill.on .dot { background: #22C55E; }
.theme-xmas-winter .pill .live-count { background: rgba(20, 50, 90, .08); }
.theme-xmas-winter .pill.invite { border-color: var(--mint-right); color: var(--xw-deep); }
.theme-xmas-winter .env-tag { background: #1B3550; color: #DCEBF8; }
.theme-xmas-winter .roombar { background: rgba(243, 248, 253, .92); border-bottom-color: var(--xw-line); }
.theme-xmas-winter .stack .count { color: var(--xw-muted); }
.theme-xmas-winter .stack .count.activity { color: var(--xw-deep); }
.theme-xmas-winter .faces img, .theme-xmas-winter .faces .face { border-color: #F3F8FD; background: #E3EEF9; }
.theme-xmas-winter .bubble {
  background: #fff; border-color: #C9DCEE; color: #132235;
  box-shadow: 0 1px 2px rgba(40, 80, 130, .12), 0 4px 12px rgba(60, 110, 170, .1);
}
.theme-xmas-winter .bubble.emoji { box-shadow: 0 1px 2px rgba(40, 80, 130, .1); }
.theme-xmas-winter .bubble a { color: var(--xw-deep); }
.theme-xmas-winter .name { color: var(--xw-deep); font-size: 11.5px; letter-spacing: .01em; }
.theme-xmas-winter .time { color: #6A8299; }
.theme-xmas-winter .sys { background: rgba(220, 235, 248, .92); color: #3A5878; }
.theme-xmas-winter .avatar, .theme-xmas-winter .avatar.fallback { background: #E3EEF9; }
.theme-xmas-winter .avatar { box-shadow: 0 0 0 2px #fff, 0 2px 8px rgba(40, 80, 130, .18); }
.theme-xmas-winter .vwave span { background: #CBDDEF; }
.theme-xmas-winter .vwave span.on { background: var(--xw-deep); }
.theme-xmas-winter .quote { background: rgba(31, 107, 74, .07); }
.theme-xmas-winter .quote.mine { border-left-color: var(--xw-deep); }
.theme-xmas-winter .msg.swiping::before { background-color: rgba(31, 107, 74, .14); }
.theme-xmas-winter .empty-room { color: #23405E; font-size: 15px; }
.theme-xmas-winter .reply-bar, .theme-xmas-winter .sticker-panel, .theme-xmas-winter .watch-bar { background: rgba(243, 248, 253, .94); }
.theme-xmas-winter .reply-bar { border-top-color: var(--xw-line); }
.theme-xmas-winter .field-box { background: #fff; border-color: #C9DCEE; }
.theme-xmas-winter .attach svg { stroke: var(--xw-muted); }
.theme-xmas-winter .send, .theme-xmas-winter .rec, .theme-xmas-winter .vplay { background: linear-gradient(180deg, #E0545D, #C8323C); }
.theme-xmas-winter .rec.live { background: #FF4D4F; }
.theme-xmas-winter .watch-bar { color: var(--xw-muted); }
body.xmas-winter .small-btn { background: linear-gradient(180deg, #2E8B62, #1F6B4A); }
body.xmas-winter .small-btn.ghost { background: #fff; color: var(--xw-ink); border-color: var(--xw-line); }
body.xmas-winter .small-btn.gray { background: #E6EEF6; color: #3E5670; }
body.xmas-winter .small-btn.red { background: #D64545; }
body.xmas-winter dialog { background: #F8FBFE; color: #132235; }
body.xmas-winter .text-btn { color: var(--xw-deep); }
body.xmas-winter .text-btn.gray { color: var(--xw-muted); }
body.xmas-winter .bg-tile.sel .bg-name { color: var(--xw-deep); }
body.xmas-winter .action-row .ic { background: #E1F0E8; color: var(--xw-deep); }
body.xmas-winter .pick-bg { border-left-color: var(--xw-line); }
body.xmas-winter .sep { background: var(--xw-line); }

/* ---- Snowy Night: the night theme, with gold in place of mint ---- */
body[data-deco="night"] { --mint-left: #F7D27A; --mint-right: #E8B54A; }
.theme-xmas.theme-night { --bubble-night: rgba(28, 40, 70, .8); --glass: rgba(12, 20, 42, .62); }
.theme-xmas.theme-night .pill.on { color: #2A1D05; }
.theme-xmas.theme-night .pill.on .dot { background: #2A1D05; }
.theme-xmas.theme-night .pill.on .live-count { background: rgba(42, 29, 5, .16); }
.theme-xmas.theme-night .pill.on .live-count::before { background: #7A5A10; box-shadow: 0 0 0 2px rgba(42, 29, 5, .2); }
.theme-xmas.theme-night .pill.invite { border-color: rgba(245, 201, 106, .9); color: #F7D27A; }
.theme-xmas.theme-night .small-btn.ghost { color: #F7D27A; }
.theme-xmas.theme-night .bubble a { color: #F7D27A; }
.theme-xmas.theme-night .name { color: #F5C96A; }
.theme-xmas.theme-night .stack .count.activity { color: #F5C96A; }
.theme-xmas.theme-night .send { background: linear-gradient(180deg, #F7D27A, #E8B54A); }
.theme-xmas.theme-night .send svg, .theme-xmas.theme-night .rec svg { stroke: #2A1D05; }
.theme-xmas.theme-night .vplay svg { stroke: #2A1D05; fill: #2A1D05; }
.theme-xmas.theme-night .vwave span.on { background: #F5C96A; }
.theme-xmas.theme-night .rec-wave { color: #F5C96A; }
.theme-xmas.theme-night .avatar,
.theme-xmas.theme-night .faces img,
.theme-xmas.theme-night .faces .face { box-shadow: 0 0 0 2px rgba(245, 201, 106, .75), 0 3px 10px rgba(0, 0, 0, .55); }
/* the text box sits over the snowy ground: solid dark glass, so it never vanishes into the snow */
.theme-xmas.theme-night .field-box { background: rgba(14, 22, 46, .86); border-color: rgba(255, 255, 255, .22); }
/* Settings: the chosen theme's name in gold too, not the night theme's mint */
body[data-deco="night"] .bg-tile.sel .bg-name { color: #F5C96A; }

/* names and times sit straight on the scene: a soft glow in the theme's own background colour
   keeps them easy to read over the art (like labels on a map), without a visible box */
.theme-xmas-cream .msg .name, .theme-xmas-cream .msg .time {
  text-shadow: 0 0 2px #FFF8F0, 0 0 4px #FFF8F0, 0 0 8px rgba(255, 248, 240, .95), 0 0 14px rgba(255, 248, 240, .8);
}
.theme-xmas-winter .msg .name, .theme-xmas-winter .msg .time {
  text-shadow: 0 0 2px #F0F6FC, 0 0 4px #F0F6FC, 0 0 8px rgba(240, 246, 252, .95), 0 0 14px rgba(240, 246, 252, .8);
}
.theme-xmas.theme-night .msg .name, .theme-xmas.theme-night .msg .time {
  text-shadow: 0 0 2px #13203D, 0 0 4px #13203D, 0 0 8px rgba(19, 32, 61, .95), 0 0 14px rgba(19, 32, 61, .85);
}
