:root {
  --bg: #000;
  --panel: #050505;
  --raise: #0d0d0d;
  --line: #1a1a1a;
  --line2: #2c2c2c;
  --fg: #f2f2f2;
  --dim: #7c7c7c;
  --faint: #4a4a4a;
  --ok: #5dffb0;
  --red: #ff4d5e;
  --glow: 0 0 24px rgba(255, 255, 255, .35);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --snap: cubic-bezier(.7, 0, .2, 1);
  --top: 60px;
}

*, *::before, *::after { box-sizing: border-box; border-radius: 0 !important; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--fg); }
body {
  font: 14px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
.hidden { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; }
.glare { display: none; }
::selection { background: #fff; color: #000; }
* { scrollbar-width: thin; scrollbar-color: #262626 transparent; }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: #262626; }

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
input, textarea {
  background: transparent; border: 0; border-bottom: 1px solid var(--line2);
  padding: 10px 2px; outline: none; width: 100%; min-width: 0;
  transition: border-color .3s, box-shadow .3s;
}
input:focus, textarea:focus { border-color: #fff; box-shadow: 0 10px 18px -12px rgba(255, 255, 255, .55); }
input::placeholder, textarea::placeholder { color: var(--faint); }
:focus-visible { outline: 1px solid #fff; outline-offset: 3px; }
h2, .label, .field span, .eyebrow, .kicker {
  font: 500 10px/1.4 var(--mono); letter-spacing: .22em; text-transform: uppercase; color: var(--dim);
}
h2 { margin: 0 0 16px; }
.ic { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: square; stroke-linejoin: miter; }
.muted { color: var(--dim); }
.fine, .modal-box .fine { color: var(--faint); font: 10px var(--mono); letter-spacing: .08em; margin: 16px 0 0; }

/* ---------- background: a grid you only see where the light is ---------- */
#bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
#bg .grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(#1f1f1f 1px, transparent 1px), linear-gradient(90deg, #1f1f1f 1px, transparent 1px);
  background-size: 44px 44px; background-position: center;
  -webkit-mask-image: radial-gradient(340px circle at var(--sx, 50%) var(--sy, 40%), #000, transparent 72%);
  mask-image: radial-gradient(340px circle at var(--sx, 50%) var(--sy, 40%), #000, transparent 72%);
}
#spot {
  position: absolute; left: 0; top: 0; width: 760px; height: 760px; margin: -380px 0 0 -380px;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .075), rgba(255, 255, 255, .02) 45%, transparent 70%);
  transform: translate3d(var(--sx, 50vw), var(--sy, 40vh), 0); will-change: transform;
}
body.calm #spot { opacity: .55; }

/* ---------- cursor ---------- */
#cur-dot, #cur-ring { display: none; }
.has-cursor, .has-cursor * { cursor: none !important; }
.has-cursor #cur-dot, .has-cursor #cur-ring {
  display: block; position: fixed; left: 0; top: 0; z-index: 9999; pointer-events: none;
  mix-blend-mode: difference; will-change: transform; transition: opacity .25s;
}
#cur-dot { width: 4px; height: 4px; margin: -2px 0 0 -2px; background: #fff; }
#cur-ring { width: 0; height: 0; }
#cur-ring i {
  position: absolute; left: -15px; top: -15px; width: 30px; height: 30px; border: 1px solid #fff;
  transition: transform .4s var(--ease), background-color .3s, width .3s var(--ease), height .3s var(--ease), left .3s var(--ease), top .3s var(--ease);
}
#cur-ring.hover i { transform: rotate(45deg) scale(1.3); background: rgba(255, 255, 255, .14); }
#cur-ring.text i { width: 2px; left: -1px; height: 22px; top: -11px; background: #fff; }
#cur-ring.down i { transform: scale(.55); }
#cur-ring.hover.down i { transform: rotate(45deg) scale(.85); }
#cur-dot.gone, #cur-ring.gone { opacity: 0; }
.pulse {
  position: fixed; z-index: 9998; width: 56px; height: 56px; margin: -28px 0 0 -28px; border: 1px solid #fff;
  pointer-events: none; mix-blend-mode: difference; animation: pulse .6s var(--ease) forwards;
}
.spark { position: fixed; z-index: 9997; width: 3px; height: 3px; margin: -1px; background: #fff; pointer-events: none; box-shadow: 0 0 10px 2px rgba(255, 255, 255, .7); animation: spark .7s linear forwards; }

/* ---------- panels: edges light up near the mouse ---------- */
.glass, .modal-box, .cloak-opt { position: relative; background: var(--panel); }
.glass::before, .modal-box::before, .cloak-opt::before {
  content: ""; position: absolute; inset: 0; padding: 1px; pointer-events: none; z-index: 3;
  background: radial-gradient(280px circle at var(--gx, -999px) var(--gy, -999px), #fff, rgba(255, 255, 255, .25) 40%, transparent 75%), var(--line);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.glass::after, .modal-box::after, .cloak-opt::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(360px circle at var(--gx, -999px) var(--gy, -999px), rgba(255, 255, 255, .055), transparent 65%);
}
.tilt-wrap { perspective: 1100px; display: flex; min-width: 0; }
.tilt-wrap > * { flex: 1; min-width: 0; }
[data-tilt] { transform-style: preserve-3d; will-change: transform; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: box-shadow .5s; }
[data-tilt].tilting { box-shadow: 0 0 70px -22px rgba(255, 255, 255, .28); }
.z1 { transform: translateZ(14px); }
.z2 { transform: translateZ(28px); }
/* a pressed button must stay lifted, or the tilted card behind it swallows the click */
.btn.z2:active { transform: translateZ(28px) scale(.96); }

/* ---------- buttons ---------- */
.btn {
  position: relative; isolation: isolate; overflow: hidden; flex: none; white-space: nowrap;
  background: transparent; border: 1px solid var(--line2); color: var(--fg);
  padding: 12px 20px; font: 500 10px var(--mono); letter-spacing: .2em; text-transform: uppercase;
  transition: color .35s var(--snap), border-color .35s, box-shadow .35s, transform .15s;
}
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: #fff; transform: scaleX(0); transform-origin: right; transition: transform .4s var(--snap); }
.btn:hover, .btn:focus-visible { color: #000; border-color: #fff; box-shadow: var(--glow); }
.btn:hover::before, .btn:focus-visible::before { transform: scaleX(1); transform-origin: left; }
.btn:active { transform: scale(.96); }
.btn.small { padding: 9px 13px; }
.btn.wide { width: 100%; padding: 15px; }
.btn.solid { background: #fff; color: #000; border-color: #fff; }
.btn.solid::before { background: #000; }
.btn.solid:hover, .btn.solid:focus-visible { color: #fff; }
.btn:disabled { opacity: .35; pointer-events: none; }
.icon-btn {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  background: transparent; border: 1px solid transparent; color: var(--dim);
  transition: color .25s, border-color .25s, box-shadow .3s, background-color .25s, transform .15s;
}
.icon-btn:hover { color: #fff; border-color: var(--line2); box-shadow: 0 0 18px -4px rgba(255, 255, 255, .45); }
.icon-btn:active { transform: scale(.9); }
.icon-btn.on { background: #fff; color: #000; box-shadow: var(--glow); }
.icon-btn.call { color: var(--ok); border-color: rgba(93, 255, 176, .3); }
.icon-btn.call:hover { color: #000; background: var(--ok); border-color: var(--ok); box-shadow: 0 0 22px rgba(93, 255, 176, .55); }
.toggle { width: 40px; height: 20px; border: 1px solid var(--line2); background: transparent; position: relative; font-size: 0; transition: border-color .3s, box-shadow .3s; }
.toggle::after { content: ""; position: absolute; left: 3px; top: 3px; width: 12px; height: 12px; background: var(--faint); transition: transform .35s var(--snap), background-color .3s, box-shadow .3s; }
.toggle.on { border-color: #fff; box-shadow: 0 0 14px -2px rgba(255, 255, 255, .5); }
.toggle.on::after { transform: translateX(20px); background: #fff; box-shadow: 0 0 10px #fff; }
.badge {
  min-width: 17px; height: 17px; padding: 0 4px; background: #fff; color: #000; box-shadow: 0 0 14px rgba(255, 255, 255, .6);
  font: 700 10px var(--mono); display: inline-grid; place-items: center; animation: pop .3s var(--ease);
}

/* ---------- brand ---------- */
.brand { margin: 0; font-size: 34px; font-weight: 600; letter-spacing: -.05em; }
.brand span { animation: blink 1.4s steps(2) infinite; text-shadow: 0 0 14px #fff; }
.brand.big { font-size: 44px; }
.brand.mini { font-size: 18px; background: none; border: 0; padding: 4px 2px; transition: text-shadow .3s; }
.brand.mini:hover { text-shadow: 0 0 18px rgba(255, 255, 255, .8); }

/* ---------- auth ---------- */
#auth { position: relative; z-index: 1; height: 100%; display: grid; place-items: center; padding: 24px; overflow: auto; }
#auth .tilt-wrap { width: 100%; max-width: 360px; }
#auth-form { display: flex; flex-direction: column; gap: 22px; padding: 38px 32px; background: #000; }
#auth-form > * { animation: rise .7s var(--ease) both; }
#auth-form > :nth-child(3) { animation-delay: .06s; }
#auth-form > :nth-child(4) { animation-delay: .12s; }
#auth-form > :nth-child(5) { animation-delay: .18s; }
#auth-form > :nth-child(6) { animation-delay: .24s; }
#auth-form > :nth-child(8) { animation-delay: .3s; }
.lead { margin: -16px 0 0; color: var(--dim); font: 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tab { flex: 1; background: none; border: 0; padding: 12px 0; color: var(--faint); font: 500 10px var(--mono); letter-spacing: .2em; text-transform: uppercase; position: relative; transition: color .3s, text-shadow .3s; }
.tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: #fff; box-shadow: 0 0 12px #fff; transform: scaleX(0); transition: transform .45s var(--snap); }
.tab:hover { color: var(--fg); }
.tab.active { color: #fff; text-shadow: 0 0 12px rgba(255, 255, 255, .6); }
.tab.active::after { transform: scaleX(1); }
.field { display: block; }
.field span, .label { display: block; margin-bottom: 2px; }
.error { margin: -10px 0; min-height: 18px; color: var(--red); font-size: 12px; }
.shake { animation: shake .35s; }

/* ---------- shell ---------- */
#shell { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; animation: fade .6s; }
#top { height: var(--top); flex: none; display: flex; align-items: center; gap: 16px; padding: 0 20px; border-bottom: 1px solid var(--line); background: rgba(0, 0, 0, .6); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.seg { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 auto; border: 1px solid var(--line); }
.seg .pill { position: absolute; left: 0; top: 0; bottom: 0; width: calc(100% / 3); background: #fff; box-shadow: var(--glow); transition: transform .55s var(--snap); }
.seg[data-view="chat"] .pill { transform: translateX(100%); }
.seg[data-view="games"] .pill { transform: translateX(200%); }
.seg button {
  position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: none; border: 0; padding: 9px 20px; color: var(--dim); font: 500 10px var(--mono); letter-spacing: .2em; text-transform: uppercase; transition: color .35s;
}
.seg button:hover { color: #fff; }
.seg[data-view="home"] button[data-go="home"], .seg[data-view="chat"] button[data-go="chat"], .seg[data-view="games"] button[data-go="games"] { color: #000; }
.seg .badge { position: absolute; right: -6px; top: -6px; }
.top-right { display: flex; align-items: center; gap: 10px; }
.chip { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: none; border: 1px solid var(--line); color: var(--dim); font: 500 10px var(--mono); letter-spacing: .16em; text-transform: uppercase; transition: color .3s, border-color .3s, box-shadow .3s; }
.chip:hover { color: #fff; border-color: var(--line2); box-shadow: 0 0 18px -4px rgba(255, 255, 255, .4); }
.chip.on { color: #fff; border-color: #fff; box-shadow: 0 0 16px -2px rgba(255, 255, 255, .5); }
.me-btn { display: flex; align-items: center; gap: 10px; padding: 3px 12px 3px 3px; background: none; border: 1px solid var(--line); transition: border-color .3s, box-shadow .3s; }
.me-btn:hover { border-color: #fff; box-shadow: 0 0 18px -4px rgba(255, 255, 255, .5); }
.me-btn .avatar { width: 26px; height: 26px; font-size: 11px; }
.me-btn .name { max-width: 110px; font-size: 12px; }

.view { flex: 1; min-height: 0; display: none; padding: 16px 20px 20px; }
.view.on { display: flex; animation: view .6s var(--ease) both; }

/* ---------- home ---------- */
#view-home { overflow-y: auto; }
.home-inner { width: 100%; max-width: 1040px; margin: auto; padding: 10px 0 24px; }
.eyebrow { margin: 0 0 18px; animation: rise .7s var(--ease) both; }
.hero { margin: 0 0 40px; font-size: clamp(40px, 7vw, 84px); line-height: .98; letter-spacing: -.055em; font-weight: 500; animation: rise .8s .05s var(--ease) both; }
.hero i { font-style: normal; animation: blink 1.4s steps(2) infinite; text-shadow: 0 0 22px #fff; }
.hero em { font-style: normal; color: transparent; -webkit-text-stroke: 1px #3a3a3a; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cards .tilt-wrap { animation: rise .9s var(--ease) both; }
.cards .tilt-wrap:nth-child(1) { animation-delay: .12s; }
.cards .tilt-wrap:nth-child(2) { animation-delay: .2s; }
.card { height: 290px; padding: 26px; text-align: left; display: flex; flex-direction: column; justify-content: flex-end; color: var(--fg); border: 0; background: #030303; }
.card .num {
  position: absolute; right: 22px; top: 8px; font-size: 150px; line-height: 1; font-weight: 600; letter-spacing: -.06em;
  color: transparent; -webkit-text-stroke: 1px #262626; transform: translateZ(50px); pointer-events: none;
  transition: -webkit-text-stroke-color .5s, text-shadow .5s;
}
.card.tilting .num { -webkit-text-stroke-color: #fff; text-shadow: 0 0 40px rgba(255, 255, 255, .35); }
.card .scan { position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, transparent, #fff, transparent); opacity: 0; pointer-events: none; }
.card.tilting .scan { animation: scan 2.4s linear infinite; }
.card-text { display: flex; flex-direction: column; gap: 6px; transform: translateZ(34px); }
.card-title { font-size: 30px; font-weight: 500; letter-spacing: -.04em; transition: text-shadow .4s, letter-spacing .6s var(--ease); }
.card.tilting .card-title { text-shadow: 0 0 22px rgba(255, 255, 255, .55); letter-spacing: -.02em; }
.card-sub { color: var(--dim); font-size: 13px; }
.go { position: absolute; right: 24px; bottom: 26px; width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line2); color: #fff; transform: translateZ(48px); transition: background-color .35s, color .35s, box-shadow .35s, transform .5s var(--ease); }
.card.tilting .go { background: #fff; color: #000; box-shadow: var(--glow); transform: translateZ(64px) translateX(4px); }
.big-badge { position: absolute; left: 26px; top: 26px; height: 22px; min-width: 22px; font-size: 11px; transform: translateZ(50px); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.tiles .tilt-wrap { animation: rise .9s .3s var(--ease) both; }
.tile { display: flex; align-items: center; gap: 14px; padding: 16px 18px; text-align: left; color: var(--fg); border: 0; background: #030303; }
.tile .ic { width: 18px; height: 18px; color: var(--dim); transform: translateZ(22px); transition: color .3s, filter .3s; }
.tile.tilting .ic { color: #fff; filter: drop-shadow(0 0 6px #fff); }
.tile span { display: flex; flex-direction: column; gap: 3px; min-width: 0; transform: translateZ(12px); }
.tile b { font: 500 10px var(--mono); letter-spacing: .2em; text-transform: uppercase; }
.tile small { color: var(--dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- chat layout ---------- */
#view-chat { gap: 16px; }
#side { width: 310px; flex: none; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
#chat { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
#side > *, #chat > * { position: relative; z-index: 1; }
.convo-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); min-height: 62px; }
#peer-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 0; background: none; border: 0; text-align: left; }
#peer-btn:hover .name { text-shadow: 0 0 14px rgba(255, 255, 255, .8); }
#peer-avatar { display: block; }
.peer-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub { font-size: 11px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub.online { color: #fff; text-shadow: 0 0 10px rgba(255, 255, 255, .7); }
.avatar { width: 38px; height: 38px; flex: none; position: relative; background: #0a0a0a; border: 1px solid var(--line2); display: grid; place-items: center; font: 600 13px var(--mono); text-transform: uppercase; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.online { border-color: #fff; box-shadow: 0 0 14px -2px rgba(255, 255, 255, .6); }
.avatar.online::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 7px; height: 7px; background: #fff; box-shadow: 0 0 8px #fff; outline: 2px solid #000; }

#add-form { display: flex; gap: 10px; align-items: flex-end; padding: 14px 16px 6px; }
.note { margin: 0; padding: 0 16px; min-height: 18px; font-size: 12px; color: var(--dim); }
.note.bad { color: var(--red); }
#lists { flex: 1; overflow-y: auto; }
#lists .label { padding: 14px 16px 8px; margin: 0; }
.friend { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 16px; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); position: relative; transition: background-color .3s, padding-left .4s var(--ease); }
.friend::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: #fff; box-shadow: 0 0 14px 1px #fff; transform: scaleY(0); transition: transform .4s var(--snap); }
.friend:hover { background: var(--raise); padding-left: 22px; }
.friend.active { background: var(--raise); }
.friend.active::before { transform: scaleY(1); }
.friend .text { flex: 1; min-width: 0; }
.friend.unread .sub { color: #fff; }
.friend .side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.friend .when { font: 10px var(--mono); color: var(--faint); }
.req { display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-top: 1px solid var(--line); animation: rise .4s var(--ease) both; }
.req .text { flex: 1; min-width: 0; }
.req .avatar { width: 32px; height: 32px; }
.req .icon-btn { width: 28px; height: 28px; border-color: var(--line2); }
.req .yes:hover { background: #fff; color: #000; box-shadow: var(--glow); }
.req .no:hover { background: var(--red); color: #000; border-color: var(--red); box-shadow: 0 0 18px rgba(255, 77, 94, .6); }
.none { padding: 20px 16px; color: var(--dim); font-size: 13px; }

#empty { flex: 1; display: grid; place-content: center; text-align: center; color: var(--dim); gap: 8px; padding: 20px; }
#empty .brand { color: var(--fg); }
#empty p { margin: 0; font: 10px var(--mono); letter-spacing: .16em; text-transform: uppercase; }
#convo { flex: 1; display: flex; flex-direction: column; min-height: 0; animation: fade .35s; }
#back { display: none; }
.msgs-wrap { flex: 1; min-height: 0; position: relative; display: flex; }
#jump { position: absolute; right: 20px; bottom: 12px; animation: rise .25s var(--ease); }
#drop { position: absolute; inset: 12px; display: none; place-items: center; border: 1px dashed #fff; background: rgba(0, 0, 0, .9); font: 10px var(--mono); letter-spacing: .2em; text-transform: uppercase; pointer-events: none; box-shadow: inset 0 0 60px -20px rgba(255, 255, 255, .4); }
.drag #drop { display: grid; }

/* ---------- messages ---------- */
#msgs { flex: 1; overflow-y: auto; padding: 44px 20px 8px; display: flex; flex-direction: column; }
.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: min(68%, 560px); margin-top: 12px; }
.msg.grp { margin-top: 2px; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg.new { animation: msgin .4s var(--ease) both; }
.msg.out { animation: out .2s var(--ease) forwards; }
.msg.flash .bubble { animation: flash 1.1s var(--ease); }
.row { position: relative; max-width: 100%; }
.bubble { background: var(--raise); border: 1px solid var(--line); padding: 9px 13px; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; transition: border-color .3s, box-shadow .3s; }
.msg:hover .bubble { border-color: var(--line2); }
.mine .bubble { background: var(--mine, #fff); color: var(--mine-fg, #000); border-color: var(--mine, #fff); box-shadow: 0 0 26px -10px var(--mine, #fff); }
.mine .bubble ::selection, .mine .bubble::selection { background: #000; color: #fff; }
.msg.mine:hover .bubble { border-color: var(--mine, #fff); box-shadow: 0 0 30px -6px var(--mine, #fff); }
.bubble a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.bubble.image, .bubble.gif { padding: 0; background: #000; border-color: var(--line2); line-height: 0; overflow: hidden; }
.bubble.image img, .bubble.gif img { display: block; max-width: 100%; max-height: 320px; min-width: 60px; min-height: 60px; }
.bubble.image img { transition: opacity .25s; }
.bubble.image img:hover { opacity: .8; }

.acts { position: absolute; top: -30px; left: 0; z-index: 2; display: flex; background: #000; border: 1px solid var(--line2); box-shadow: 0 0 22px -8px rgba(255, 255, 255, .5); opacity: 0; pointer-events: none; transform: translateY(5px); transition: opacity .2s, transform .3s var(--ease); }
.mine .acts { left: auto; right: 0; }
.msg:hover .acts, .msg.show .acts, .acts:focus-within { opacity: 1; pointer-events: auto; transform: none; }
.acts button { background: none; border: 0; border-right: 1px solid var(--line); height: 28px; padding: 0 9px; font: 500 9px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); white-space: nowrap; transition: background-color .2s, color .2s, transform .15s; }
.acts button:last-child { border-right: 0; }
.acts button.emo { font-size: 14px; padding: 0 6px; letter-spacing: 0; }
.acts button:hover { background: #fff; color: #000; }
.acts button.emo:hover { background: var(--raise); transform: scale(1.25); }
.acts button.danger:hover { background: var(--red); color: #000; }

.reply-ref { display: block; max-width: 100%; background: none; border: 0; border-left: 1px solid var(--line2); padding: 2px 0 2px 8px; margin-bottom: 4px; font-size: 12px; color: var(--dim); text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .2s, border-color .2s; }
.reply-ref:hover { color: var(--fg); border-color: #fff; }
.reply-ref b { color: var(--fg); font-weight: 500; }
.reacts { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.react { background: var(--raise); border: 1px solid var(--line2); padding: 1px 7px; font-size: 13px; line-height: 20px; transition: transform .15s, border-color .2s, box-shadow .2s; animation: pop .25s var(--ease); }
.react.on { border-color: #fff; box-shadow: 0 0 12px -2px rgba(255, 255, 255, .6); }
.react:hover { transform: scale(1.12); }
.react small { font: 10px var(--mono); margin-left: 4px; color: var(--dim); }
.meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; font: 9px var(--mono); letter-spacing: .08em; color: var(--faint); text-transform: uppercase; }
.msg.has-next .meta:not(.keep) { display: none; }
.status { color: var(--dim); }
.status.seen { color: #fff; text-shadow: 0 0 8px rgba(255, 255, 255, .8); }
.sep { align-self: center; font: 9px var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--faint); padding: 14px 0 2px; }

.voice { display: flex; align-items: center; gap: 12px; min-width: 210px; padding: 6px 2px; }
.voice button { width: 30px; height: 30px; flex: none; border: 1px solid currentColor; background: none; color: inherit; font-size: 10px; display: grid; place-items: center; transition: transform .15s, background-color .2s, color .2s; }
.voice button:hover { background: #fff; color: #000; }
.mine .voice button:hover { background: #000; color: #fff; }
.voice .bar { flex: 1; height: 1px; background: rgba(127, 127, 127, .5); position: relative; }
.voice .bar i { position: absolute; left: 0; top: -1px; bottom: -1px; width: 0; background: currentColor; }
.voice .dur { font: 10px var(--mono); opacity: .7; }
#typing { height: 20px; padding: 0 20px; font: 10px var(--mono); letter-spacing: .08em; color: var(--dim); }

/* ---------- composer ---------- */
#ctx { display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-top: 1px solid var(--line); animation: rise .2s var(--ease); }
.ctx-text { flex: 1; min-width: 0; border-left: 1px solid #fff; padding-left: 10px; font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-text b { color: var(--fg); margin-right: 8px; font-weight: 500; }
#composer { display: flex; align-items: flex-end; gap: 4px; padding: 12px 14px; border-top: 1px solid var(--line); }
#composer #text { border: 1px solid var(--line2); padding: 7px 12px; flex: 1; resize: none; max-height: 140px; line-height: 1.4; display: block; margin: 0 6px; }
#composer #text:focus { border-color: #fff; box-shadow: 0 0 22px -8px rgba(255, 255, 255, .7); }
#composer #send, #composer #rec-cancel { height: 34px; padding-top: 0; padding-bottom: 0; }
#rec, #rec-cancel { display: none; }
#composer.recording #text, #composer.recording #btn-img, #composer.recording #btn-gif, #composer.recording #btn-emo { display: none; }
#composer.recording #rec { display: flex; flex: 1; align-items: center; gap: 10px; border: 1px solid var(--line2); padding: 6px 12px; margin: 0 6px; }
#composer.recording #rec-cancel { display: block; }
.rec-dot { width: 8px; height: 8px; background: var(--red); box-shadow: 0 0 12px var(--red); animation: blink 1s steps(2) infinite; }
#rec-time { font: 12px var(--mono); }
.rec-label { font: 10px var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--dim); }

.panel { border-top: 1px solid var(--line); padding: 12px 16px; animation: rise .25s var(--ease); }
.gif-top { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 12px; }
#gif-grid { height: 240px; overflow-y: auto; columns: 4 130px; column-gap: 6px; }
#gif-grid button { display: block; width: 100%; padding: 0; margin: 0 0 6px; border: 1px solid transparent; background: var(--raise); line-height: 0; transition: border-color .2s, box-shadow .3s; }
#gif-grid button:hover { border-color: #fff; box-shadow: var(--glow); }
#gif-grid img { width: 100%; display: block; }
#gif-grid .none { column-span: all; }
.gif-credit { font: 9px var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--faint); margin-top: 8px; }
#emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); max-height: 190px; overflow-y: auto; }
#emoji-grid button { background: none; border: 1px solid transparent; height: 38px; font-size: 20px; transition: transform .15s, border-color .2s; }
#emoji-grid button:hover { transform: scale(1.2); border-color: var(--line2); }

/* ---------- games ---------- */
#view-games { flex-direction: column; gap: 12px; }
.games-bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 16px; flex: none; }
.games-bar > * { position: relative; z-index: 1; }
.games-title { display: flex; align-items: center; gap: 10px; font: 500 10px var(--mono); letter-spacing: .2em; text-transform: uppercase; }
.games-note { color: var(--faint); font: 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; flex: 1; }
#games-frame { flex: 1; min-height: 0; overflow: hidden; background: #000; }
#games-frame iframe { position: absolute; inset: 1px; width: calc(100% - 2px); height: calc(100% - 2px); border: 0; background: #000; }
#games-loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 16px; color: var(--dim); font: 10px var(--mono); letter-spacing: .2em; text-transform: uppercase; }
.spin { width: 26px; height: 26px; border: 1px solid #fff; box-shadow: var(--glow); animation: spin 1.6s var(--snap) infinite; }
#games-frame:fullscreen iframe { inset: 0; width: 100%; height: 100%; }

/* ---------- voice call ---------- */
#call {
  position: fixed; z-index: 90; top: calc(var(--top) + 10px); left: 50%; margin-left: -165px; width: 330px; padding: 10px 12px;
  display: flex; align-items: center; gap: 12px; background: #000; box-shadow: 0 0 50px -12px rgba(255, 255, 255, .35); animation: callin .5s var(--ease) both;
}
#call > * { position: relative; z-index: 1; }
.call-who { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.call-info { min-width: 0; }
.call-avatar { position: relative; flex: none; }
.call-avatar .avatar { position: relative; z-index: 1; }
.ring { position: absolute; inset: 0; border: 1px solid #fff; opacity: 0; }
#call.ringing .ring { animation: ring 1.8s ease-out infinite; }
#call.ringing .r2 { animation-delay: .9s; }
#call.live .call-avatar .avatar { border-color: var(--ok); box-shadow: 0 0 18px -2px var(--ok); }
#call .sub { font: 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.call-btns { display: flex; gap: 8px; flex: none; }
.round { width: 36px; height: 36px; border: 1px solid var(--line2); display: grid; place-items: center; background: none; color: var(--fg); transition: transform .2s var(--ease), background-color .25s, color .25s, box-shadow .3s, border-color .25s; }
.round:hover { border-color: #fff; box-shadow: 0 0 18px -2px rgba(255, 255, 255, .6); }
.round:active { transform: scale(.9); }
.round.ok { border-color: var(--ok); color: var(--ok); box-shadow: 0 0 18px -4px var(--ok); }
.round.ok:hover { background: var(--ok); color: #000; box-shadow: 0 0 26px var(--ok); }
.round.bad { border-color: var(--red); color: var(--red); }
.round.bad:hover { background: var(--red); color: #000; box-shadow: 0 0 26px var(--red); }
.round.muted { background: #fff; color: #000; border-color: #fff; box-shadow: var(--glow); }
#call-audio { display: none; }

.icon-btn.call.live { background: var(--ok); color: #000; border-color: var(--ok); animation: livecall 1.4s ease-in-out infinite; }
.btn.kick { color: var(--red); border-color: rgba(255, 77, 94, .45); }
.btn.kick::before { background: var(--red); }
.btn.kick:hover { color: #000; border-color: var(--red); box-shadow: 0 0 22px rgba(255, 77, 94, .6); }
.rows .req { flex-wrap: wrap; }
@keyframes livecall { 50% { box-shadow: 0 0 26px 2px rgba(93, 255, 176, .75); } }

/* ---------- overlays ---------- */
.overlay > * { margin: auto; }
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .86); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: flex; padding: 20px; overflow-y: auto; animation: fade .25s; perspective: 1200px; }
#lightbox img { max-width: 100%; max-height: calc(100vh - 48px); border: 1px solid var(--line2); box-shadow: 0 0 80px -20px rgba(255, 255, 255, .4); animation: zoom .3s var(--ease); }
.modal-box { width: 100%; max-width: 380px; background: #000; padding: 26px; animation: modal .5s var(--ease) both; box-shadow: 0 0 90px -30px rgba(255, 255, 255, .35); }
.modal-box > * { position: relative; z-index: 1; }
.modal-box.wide-box { max-width: 450px; }
.modal-box p { margin: 0 0 20px; }
.modal-box h2:not(:first-child) { margin-top: 28px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.modal-actions.spread { justify-content: space-between; margin-top: 26px; }
.set-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.profile-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; }
.inline-form .field { flex: 1; }
.modal-box .note { padding: 0; margin: 6px 0 0; }
#pw-form { display: flex; flex-direction: column; gap: 8px; margin-top: 24px; align-items: flex-start; }
#pw-form .label { margin: 0; }

#cloak-title { font: 500 24px/1.2 ui-sans-serif, system-ui, sans-serif; letter-spacing: -.03em; text-transform: none; color: var(--fg); margin-bottom: 10px; }
#cloak-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; perspective: 800px; }
.cloak-opt { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px 8px 14px; border: 0; color: var(--fg); background: #030303; font: 500 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; text-align: center; }
.cloak-opt > * { position: relative; z-index: 1; }
.cloak-opt.sel { box-shadow: inset 0 0 0 1px #fff, 0 0 26px -6px rgba(255, 255, 255, .6); }
.cloak-opt .pic { width: 38px; height: 38px; display: grid; place-items: center; background: #fff; color: #000; font: 700 16px var(--mono); transform: translateZ(26px); transition: box-shadow .3s; }
.cloak-opt.tilting .pic { box-shadow: var(--glow); }
.cloak-opt .pic.plain { background: none; border: 1px solid var(--line2); color: var(--dim); }
.cloak-opt .pic img { width: 22px; height: 22px; display: block; }
.cloak-opt small { font: 10px ui-sans-serif, system-ui, sans-serif; letter-spacing: 0; text-transform: none; color: var(--dim); }

#toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 200; transform: translate(-50%, 30px);
  background: #fff; color: #000; padding: 10px 16px; font: 500 10px var(--mono); letter-spacing: .14em; text-transform: uppercase;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .45s var(--ease); max-width: 90vw; box-shadow: 0 0 40px -6px rgba(255, 255, 255, .7);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#net { position: fixed; left: 0; right: 0; top: 0; z-index: 150; text-align: center; padding: 3px; background: var(--red); color: #000; font: 700 9px var(--mono); letter-spacing: .2em; text-transform: uppercase; }

/* ---------- avatars beside messages ---------- */
.msg.theirs { position: relative; padding-left: 40px; }
.msg-av { position: absolute; left: 0; top: 0; padding: 0; border: 0; background: none; transition: transform .25s var(--ease), filter .25s; }
.msg-av .avatar { width: 30px; height: 30px; font-size: 11px; }
.msg-av:hover { transform: scale(1.1); filter: drop-shadow(0 0 8px rgba(255, 255, 255, .7)); }
.msg-av.static { position: static; }
.msg-av.static .avatar { width: 32px; height: 32px; }
.msg.grp .msg-av, .msg.grp .who { display: none; }
.who { background: none; border: 0; padding: 0; margin: 0 0 4px; font: 500 9px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); transition: color .2s, text-shadow .2s; }
.who:hover { color: #fff; text-shadow: 0 0 10px rgba(255, 255, 255, .7); }
/* in groups the name sits above the bubble, so the hover buttons go beside it instead */
@media (min-width: 761px) {
  .who ~ .row .acts { top: 0; left: 100%; margin-left: -1px; transform: translateX(-5px); }
}
.sep.sys { max-width: 80%; text-align: center; line-height: 1.6; letter-spacing: .12em; }
.sep.sys.new { animation: rise .4s var(--ease) both; }
.vanish { color: var(--dim); }
.avatar.group { border-style: double; border-width: 3px; }
.label-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px 8px; }
#lists .label-row .label { padding: 0; }
.label-row .btn.small { padding: 6px 9px; }

/* ---------- chat backgrounds (only you see yours) ---------- */
.msgs-wrap { background-position: center; background-size: cover; }
.bg-grid { background-image: linear-gradient(#141414 1px, transparent 1px), linear-gradient(90deg, #141414 1px, transparent 1px); background-size: 32px 32px; }
.bg-dots { background-image: radial-gradient(#2a2a2a 1px, transparent 1.5px); background-size: 18px 18px; }
.bg-lines { background-image: repeating-linear-gradient(135deg, #121212 0 1px, transparent 1px 14px); background-size: auto; }
.bg-glow { background-image: radial-gradient(70% 55% at 50% 0%, color-mix(in srgb, var(--mine, #fff) 16%, transparent), transparent 70%); }

.bg-img .sep, .bg-img .meta, .bg-img .who { color: #d0d0d0; text-shadow: 0 0 6px #000, 0 0 2px #000; }

/* ---------- pick lists, options, swatches ---------- */
.label.gap, .inline-form.gap { margin-top: 24px; }
.label.gap { margin-bottom: 10px; }
.hint { color: var(--faint); font-size: 12px; margin: 10px 0 0 !important; }
.cs-title { font-size: 22px; font-weight: 500; letter-spacing: -.03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picks { max-height: 210px; overflow-y: auto; border: 1px solid var(--line); margin-bottom: 12px; }
.pick { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; transition: background-color .25s; }
.pick:last-child { border-bottom: 0; }
.pick:hover { background: var(--raise); }
.pick .avatar { width: 30px; height: 30px; font-size: 11px; }
.pick .name { flex: 1; }
.tick { width: 14px; height: 14px; border: 1px solid var(--line2); transition: background-color .25s, box-shadow .25s, border-color .25s; }
.pick.on .tick { background: #fff; border-color: #fff; box-shadow: 0 0 12px #fff; }
.pick.on { background: var(--raise); }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opt { background: none; border: 1px solid var(--line2); padding: 8px 12px; font: 500 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); transition: color .25s, border-color .25s, box-shadow .3s, background-color .25s; }
.opt:hover { color: #fff; border-color: #fff; }
.opt.on { background: #fff; color: #000; border-color: #fff; box-shadow: var(--glow); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 28px; height: 28px; padding: 0; border: 0; position: relative; display: block; overflow: hidden; transition: transform .2s var(--ease), box-shadow .3s; }
.swatch:hover { transform: scale(1.15); }
.swatch.on { outline: 1px solid #fff; outline-offset: 3px; box-shadow: 0 0 18px currentColor, 0 0 16px rgba(255, 255, 255, .5); }
.swatch.custom { background: conic-gradient(#ff4d5e, #ffe14d, #5dffb0, #4dd8ff, #b06bff, #ff4d5e); }
.swatch.custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; padding: 0; border: 0; }
.bgtiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.bgtile { background: none; border: 1px solid var(--line); padding: 0; display: flex; flex-direction: column; color: var(--dim); font: 9px var(--mono); letter-spacing: .08em; text-transform: uppercase; transition: border-color .25s, box-shadow .3s, color .25s; }
.bgtile i { display: block; height: 44px; background-color: #050505; background-position: center; background-size: cover; }
.bgtile i.bg-grid { background-size: 12px 12px; }
.bgtile i.bg-dots { background-size: 8px 8px; }
.bgtile span { padding: 6px 2px; border-top: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bgtile:hover { color: #fff; border-color: var(--line2); }
.bgtile.on { color: #fff; border-color: #fff; box-shadow: 0 0 18px -4px rgba(255, 255, 255, .6); }
.rows .req:first-child { border-top: 0; }
.rows .req { padding-left: 0; padding-right: 0; }

/* ---------- banners + profile cards ---------- */
.pf-card { border: 1px solid var(--line); margin-bottom: 18px; }
.banner { height: 84px; background-color: #080808; background-size: cover; background-position: center; }
.banner.tall { height: 150px; }
.banner.empty { background-image: repeating-linear-gradient(135deg, #131313 0 1px, transparent 1px 12px); }
.pf-body { display: flex; align-items: flex-end; gap: 16px; padding: 0 16px 16px; margin-top: -30px; }
.pf-avatar .avatar { width: 76px; height: 76px; font-size: 24px; background: #000; outline: 4px solid #000; }
.pf-who { min-width: 0; padding-bottom: 2px; }
.pf-body .profile-btns { padding-top: 44px; }
.pf-name { font-size: 24px; font-weight: 500; letter-spacing: -.03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 0 20px rgba(255, 255, 255, .35); }
.modal-box.flush { padding: 0 0 22px; }
.modal-box.flush .pf-card { border: 0; border-bottom: 1px solid var(--line); margin: 1px 1px 0; }
.pf-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); margin: 0 1px 20px; }
.pf-facts > div { background: #000; padding: 14px 20px; display: flex; flex-direction: column; gap: 5px; }
.pf-facts b { font-weight: 500; font-size: 13px; }
.modal-box.flush .modal-actions { padding: 0 22px; }

/* ---------- admin stats ---------- */
.stat-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 14px; }
.stat-card { background: #000; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.stat-card b { font-size: 30px; font-weight: 500; letter-spacing: -.03em; text-shadow: 0 0 18px rgba(255, 255, 255, .35); }
.stat-card span { font: 9px var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--dim); }
#stat-last { font-size: 12px; margin: 0 0 4px; }
.stat-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.stat-list { max-height: 300px; overflow-y: auto; border: 1px solid var(--line); }
.stat-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.stat-row:last-child { border-bottom: 0; }
.stat-row .avatar { width: 30px; height: 30px; font-size: 11px; }
.stat-row .text { flex: 1; min-width: 0; }
.dot-state { font: 9px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); display: flex; align-items: center; gap: 6px; }
.dot-state::before { content: ""; width: 7px; height: 7px; background: var(--faint); }
.dot-state.on { color: var(--ok); }
.dot-state.on::before { background: var(--ok); box-shadow: 0 0 8px var(--ok); }

/* ---------- news channel ---------- */
.avatar.news { border-color: #fff; box-shadow: 0 0 14px -3px rgba(255, 255, 255, .5); }
.avatar.news .ic { width: 18px; height: 18px; color: #fff; }
.friend.newsrow { border-top: 0; margin-bottom: 4px; }
.friend.newsrow::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -2px; height: 1px; background: var(--line); }
.friend.newsrow .name::after { content: "NEWS"; margin-left: 8px; font: 8px var(--mono); letter-spacing: .18em; color: #000; background: #fff; padding: 1px 5px; vertical-align: middle; }
.readonly { display: flex; align-items: center; gap: 10px; padding: 16px; border-top: 1px solid var(--line); color: var(--dim); font-size: 13px; }
.readonly .ic { color: #fff; flex: none; }

/* ---------- profile owner badge ---------- */
.pf-badge { display: inline-block; margin-top: 4px; font: 8px var(--mono); letter-spacing: .18em; text-transform: uppercase; color: #000; background: #fff; padding: 2px 7px; box-shadow: 0 0 12px rgba(255, 255, 255, .5); }

/* ---------- motion ---------- */
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } }
@keyframes view { from { opacity: 0; transform: translateY(10px); filter: blur(8px); } }
@keyframes modal { from { opacity: 0; transform: translateY(20px) rotateX(-10deg) scale(.96); filter: blur(6px); } }
@keyframes callin { from { opacity: 0; transform: translateY(-20px); } }
@keyframes msgin { from { opacity: 0; transform: translateY(8px); filter: blur(4px); } }
@keyframes out { to { opacity: 0; transform: scale(.94); } }
@keyframes pop { from { transform: scale(0); } }
@keyframes zoom { from { opacity: 0; transform: scale(.94); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes spin { 50% { transform: rotate(180deg) scale(.6); } to { transform: rotate(360deg); } }
@keyframes shake { 25% { translate: -6px 0; } 75% { translate: 6px 0; } }
@keyframes flash { 30% { box-shadow: 0 0 0 1px #fff, 0 0 30px rgba(255, 255, 255, .7); } }
@keyframes ring { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(1.9); } }
@keyframes pulse { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.3) rotate(45deg); opacity: 0; } }
@keyframes spark { to { opacity: 0; transform: scale(0); } }
@keyframes scan { 0% { top: 0; opacity: 0; } 10%, 90% { opacity: .7; } 100% { top: 100%; opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .games-note, #cloak-state, .me-btn .name { display: none; }
  .me-btn { padding: 3px; }
  .chip { padding: 8px; }
}
@media (max-width: 760px) {
  :root { --top: 54px; }
  #top { padding: 0 10px; gap: 8px; }
  .brand.mini { display: none; }
  .seg { margin: 0 auto 0 0; }
  .seg button { padding: 9px 14px; }
  .seg button span { display: none; }
  .view { padding: 10px; }
  .cards, .tiles { grid-template-columns: 1fr; }
  .card { height: 210px; }
  .card .num { font-size: 110px; }
  #side { width: 100%; }
  #chat { display: none; }
  body.chat-open #side { display: none; }
  body.chat-open #chat { display: flex; }
  #back { display: grid; }
  #btn-emo { display: none; }
  .msg { max-width: 86%; }
  .convo-head { gap: 6px; padding: 10px; }
  #msgs { padding: 44px 12px 8px; }
  #composer { padding: 10px 8px; gap: 2px; }
  #composer #text { margin: 0 4px; }
  input, textarea { font-size: 16px; }
  #call { left: 10px; right: 10px; top: auto; bottom: 76px; margin: 0; width: auto; }
  #cloak-grid { grid-template-columns: repeat(2, 1fr); }
  .bgtiles { grid-template-columns: repeat(3, 1fr); }
  .pf-body { flex-wrap: wrap; }
}
