:root {
  --bg: #1e1f26;
  --bg2: #23242c;
  --bg3: #2b2d37;
  --bg4: #343744;
  --line: #3a3d4b;
  --text: #eceef4;
  --muted: #9a9fb2;
  --red: #ee3b46;
  --red2: #ff5560;
  --blue: #4a8cff;
  --ok: #3ecf8e;
  --radius: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
#app { height: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }
a { color: #7db0ff; }
code { background: var(--bg); padding: 1px 5px; border-radius: 4px; font: 0.9em ui-monospace, Consolas, monospace; }
.muted { color: var(--muted); }
.grow { flex: 1; }

/* pokéball */
.ball, .boot .ball {
  display: inline-block;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid #14151a;
  background: linear-gradient(#ee3b46 0 46%, #14151a 46% 54%, #f4f5f8 54%);
  position: relative;
  flex: none;
}
.ball::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28%;
  height: 28%;
  transform: translate(-50%, -50%);
  background: #f4f5f8;
  border: 3px solid #14151a;
  border-radius: 50%;
}
.boot { height: 100%; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); }
.boot .ball { animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* buttons & fields */
.btn {
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--bg4);
  font-weight: 600;
  transition: background 0.12s;
}
.btn:hover:not(:disabled) { background: #3f4252; }
.btn.primary { background: var(--red); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--red2); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--bg3); }
.btn.wide { width: 100%; padding: 11px; }
.link { color: #7db0ff; text-decoration: underline; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 8px; color: var(--muted); flex: none; }
.icon-btn:hover:not(:disabled) { color: var(--text); background: var(--bg4); }
.icon-btn.sm { width: 24px; height: 24px; }
.icon-btn.send { color: var(--red2); }
.pickbar { flex: none; display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--bg3); border-top: 1px solid #00000050; }
.pickbar[hidden] { display: none; }
.pickbar b { flex: 1; font-size: 14px; }
.chat.picking .composer { display: none; }
.chat.picking .msg[data-mid] { cursor: pointer; user-select: none; position: relative; }
.chat.picking .msg[data-mid] .actions { display: none !important; }
.chat.picking .msg[data-mid]:not([data-del="1"]) { opacity: .45; cursor: not-allowed; }
.chat.picking .msg[data-del="1"]::before { content: ''; position: absolute; left: 4px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border: 2px solid var(--muted); border-radius: 4px; box-sizing: border-box; }
.msg.picked { background: #ee3b4620 !important; box-shadow: inset 3px 0 0 var(--red); }
.chat.picking .msg.picked::before { background: var(--red); border-color: var(--red); content: '✓'; color: #fff; font-size: 11px; line-height: 10px; text-align: center; }
@media (max-width: 720px) { .pickbar { padding: 8px 10px; gap: 6px; } }
.icon-btn.mic.live { color: #fff; background: var(--red); animation: micpulse 1.4s ease-in-out infinite; }
@keyframes micpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(237, 66, 69, .55); } 50% { box-shadow: 0 0 0 7px rgba(237, 66, 69, 0); } }
@media (prefers-reduced-motion: reduce) { .icon-btn.mic.live { animation: none; } }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
input[type='text'], input[type='email'], input[type='password'], input[type='search'], select, textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  width: 100%;
  min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); }
.err { color: #ff8b92; min-height: 1.2em; margin: 4px 0 10px; font-size: 14px; }
.only-mobile { display: none; }

/* toasts */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; pointer-events: none; }
.toast { background: var(--bg4); border: 1px solid var(--line); padding: 10px 16px; border-radius: 8px; box-shadow: 0 8px 24px #0006; }
.toast.err { border-color: var(--red); }

/* auth */
.auth { height: 100%; display: grid; place-items: center; padding: 20px; overflow: auto; background: radial-gradient(900px 500px at 50% -10%, #3a1d27 0, transparent 70%), var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: 0 20px 60px #0007; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 10px; }
.auth-card h1 { text-align: center; margin: 0 0 4px; font-size: 24px; }
.sub { text-align: center; color: var(--muted); margin: 0 0 20px; }
.note { background: var(--bg3); padding: 8px 12px; border-radius: 8px; text-align: center; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 18px 0 14px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.google { display: flex; justify-content: center; min-height: 44px; }
.switch { text-align: center; margin: 18px 0 0; color: var(--muted); }
.fine { text-align: center; color: var(--muted); font-size: 12px; margin: 10px 0 0; }

/* pick screen */
.pick { height: 100%; display: flex; flex-direction: column; padding: 18px 22px 0; gap: 14px; min-height: 0; }
.pick-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.pick-head h1 { margin: 0 0 2px; font-size: 24px; }
.pick-head p { margin: 0; color: var(--muted); }

/* dex */
.dex { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.dex-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-bottom: 12px; }
.dex-tools input.dex-search { flex: 1 1 220px; max-width: 320px; }
.dex-tools select { width: auto; flex: 0 1 180px; }
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); cursor: pointer; user-select: none; }
.check input { accent-color: var(--red); }
.dex-count { margin-left: auto; color: var(--muted); font-size: 13px; }
.dex-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 340px; gap: 14px; }
.dex-grid {
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
  align-content: start;
  padding: 2px 6px 18px 2px;
}
.dex-grid .empty { grid-column: 1 / -1; color: var(--muted); text-align: center; padding: 40px 0; }
.dex-card {
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 8px 4px 6px;
  background: var(--bg2);
  border: 1px solid transparent;
  border-radius: var(--radius);
  text-align: center;
  content-visibility: auto;
  contain-intrinsic-size: 120px 130px;
}
.dex-card:hover { background: var(--bg3); }
.dex-card.on { border-color: var(--red); background: #33232b; }
.dex-card.mine::after { content: '★'; position: absolute; }
.dex-card { position: relative; }
.dex-card.mine::after { top: 4px; right: 7px; color: #ffcb3d; font-size: 13px; }
.dex-card img { image-rendering: pixelated; width: 72px; height: 72px; object-fit: contain; }
.dex-card .num { font-size: 11px; color: var(--muted); }
.dex-card .nm { font-size: 12px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.dex-detail { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 16px; overflow-y: auto; margin-bottom: 14px; text-align: center; }
.dex-detail .art { width: 200px; height: 200px; object-fit: contain; filter: drop-shadow(0 8px 14px #0008); }
.dex-detail .dnum { color: var(--muted); margin: 4px 0 0; font-size: 13px; }
.dex-detail h3 { margin: 0 0 8px; font-size: 21px; }
.dex-detail h4 { margin: 18px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.dex-detail .gen { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.types { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.type, .badge { padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; color: #fff; background: #777; text-shadow: 0 1px 1px #0005; }
.badge { background: #8a6bd1; }
.t-normal { background: #8f8f78; } .t-fire { background: #e8742c; } .t-water { background: #4a85e6; }
.t-electric { background: #d9a50f; } .t-grass { background: #4fa83d; } .t-ice { background: #55b7b0; }
.t-fighting { background: #b8352c; } .t-poison { background: #9440a2; } .t-ground { background: #c0974b; }
.t-flying { background: #7d93e8; } .t-psychic { background: #e8467a; } .t-bug { background: #8da016; }
.t-rock { background: #a28d3c; } .t-ghost { background: #655091; } .t-dragon { background: #5f36e8; }
.t-dark { background: #5b4a40; } .t-steel { background: #8a8aa4; } .t-fairy { background: #de7bb0; }
.evo-tree { overflow-x: auto; padding-bottom: 4px; display: flex; justify-content: center; }
.evo-branch { display: flex; align-items: center; gap: 4px; }
.evo-kids { display: grid; gap: 4px; }
.evo-arrow { color: var(--muted); }
.evo { display: grid; justify-items: center; width: 74px; padding: 4px 2px; border-radius: 8px; font-size: 11px; line-height: 1.15; }
.evo img { image-rendering: pixelated; }
.evo:hover { background: var(--bg3); }
.evo.on { background: #33232b; outline: 1px solid var(--red); }
.forms { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.form { border-radius: 8px; padding: 2px; }
.form img { image-rendering: pixelated; }
.form:hover { background: var(--bg3); }
.form.on { background: #33232b; outline: 1px solid var(--red); }
.choose { width: 100%; margin-top: 18px; padding: 11px; }
.dexwrap { height: 100%; display: flex; flex-direction: column; padding: 16px 20px 0; min-height: 0; }
.dex-head h2 { margin: 0; }
.dex-head p { margin: 2px 0 12px; color: var(--muted); }

/* shell */
.shell { height: 100%; display: grid; grid-template-columns: 68px 244px minmax(0, 1fr) 244px; }
.rail { background: #17181d; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 0; }
.rail-btn { width: 46px; height: 46px; border-radius: 14px; background: var(--bg3); display: grid; place-items: center; color: var(--muted); transition: border-radius 0.15s, background 0.15s; }
.rail-btn:hover, .rail-btn.on { border-radius: 14px; background: var(--bg4); color: var(--text); box-shadow: inset 3px 0 0 var(--red); }
.rail-foot { display: grid; justify-items: center; gap: 2px; flex: none; }
.feat-btn { width: 28px; height: 28px; border-radius: 8px; color: #c5c9d6; display: grid; place-items: center; }
.feat-btn:hover { color: var(--text); background: var(--bg3); }
.ver { font-size: 10px; color: #5e6275; background: none; border-radius: 4px; padding: 2px 4px; }
button.ver:hover { color: var(--text); }
.notes-layer { position: fixed; z-index: 60; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px #000a; padding: 8px 10px 12px; }
.notes-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.notes-x { width: 26px; height: 26px; border-radius: 6px; color: var(--muted); display: grid; place-items: center; }
.notes-x:hover { color: var(--text); background: var(--bg3); }
.notes-layer p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.35; }
.notes-layer b { color: var(--text); }
.wizard h3 { margin: 0 0 8px; }
.wizard p { margin: 0 0 14px; color: var(--muted); line-height: 1.4; }
.wizard-count { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.wizard-dots { display: flex; gap: 6px; justify-content: center; margin: 2px 0 16px; }
.wizard-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.wizard-dots i.on { background: var(--text); }
.side { background: var(--bg2); display: flex; flex-direction: column; min-height: 0; border-right: 1px solid #00000040; }
.side-head { height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid #00000050; }
.channels { flex: 1; overflow-y: auto; padding: 10px 8px; display: grid; align-content: start; gap: 2px; }
.label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 8px 8px 4px; }
.ch { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 6px; color: var(--muted); text-align: left; }
.ch:hover { background: var(--bg3); color: var(--text); }
.ch.on { background: var(--bg4); color: var(--text); }
.ch.unread { color: var(--text); font-weight: 700; }
.ch .hash { width: 18px; text-align: center; opacity: 0.8; }
.ch .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pip { width: 8px; height: 8px; border-radius: 50%; background: var(--red2); }
.userpanel { display: flex; align-items: center; gap: 4px; padding: 8px; background: #1b1c22; }
.me { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; text-align: left; }
.me:hover { background: var(--bg3); }
.who { display: grid; min-width: 0; line-height: 1.2; }
.who b, .who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { color: var(--muted); font-size: 12px; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.members { background: var(--bg2); overflow-y: auto; padding: 10px 8px; border-left: 1px solid #00000040; align-content: start; display: grid; gap: 2px; }
.mem { display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 8px; text-align: left; min-width: 0; }
.mem:hover { background: var(--bg3); }
.mem.off { opacity: 0.5; }
.tag { margin-left: 6px; padding: 0 6px; font-size: 10px; border-radius: 4px; background: var(--red); color: #fff; vertical-align: middle; font-weight: 700; }
.tag.adm { background: var(--blue); }
.tag.bot { background: #3b3e49; color: #d5d8e2; letter-spacing: 0.04em; }
.tag.role { color: #fff; text-shadow: 0 1px 1px #0008; max-width: 9em; overflow: hidden; text-overflow: ellipsis; }
.meta { flex-wrap: wrap; }
.role-list { display: grid; gap: 6px; }
.role-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.role-colors, .role-pick, .role-worn { display: flex; flex-wrap: wrap; gap: 6px; }
.role-worn .tag.role { margin: 0; }
.role-swatch { width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 1px #0004; }
.role-swatch[aria-pressed='true'] { box-shadow: 0 0 0 2px #fff; }
.role-pick .tag.role { margin: 0; cursor: pointer; background: transparent; box-shadow: inset 0 0 0 1px currentColor; }
.role-pick .tag.role.on, .role-pick .tag.role[aria-pressed='true'] { color: #fff; box-shadow: none; }

/* avatars */
.ava { position: relative; display: inline-block; flex: none; border-radius: 50%; background: var(--bg4); overflow: visible; }
.ava img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.ava.sprite img { object-fit: contain; image-rendering: pixelated; padding: 8%; }
.ava .dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #6b6f80; border: 2px solid var(--bg2); }
.ava .dot.on { background: var(--ok); }

/* chat */
.chat { display: flex; flex-direction: column; min-height: 0; flex: 1; position: relative; }
.chat-head { height: 52px; display: flex; align-items: center; gap: 8px; padding: 0 16px; border-bottom: 1px solid #00000050; flex: none; }
.chat-head .hash { color: var(--muted); }
.chat-head .topic { color: var(--muted); font-size: 13px; margin-left: 10px; padding-left: 12px; border-left: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.banner { background: #5a3a12; color: #ffd9a0; text-align: center; padding: 4px; font-size: 13px; }
.scroll { flex: 1; overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.msgs { padding: 12px 0 8px; }
.welcome { padding: 30px 20px 10px; color: var(--muted); }
.welcome h3 { color: var(--text); margin: 10px 0 4px; font-size: 24px; }
.loadmore { display: block; margin: 8px auto; padding: 6px 14px; border-radius: 99px; background: var(--bg3); color: var(--muted); font-size: 13px; }
.loadmore:hover { color: var(--text); }
.day { display: flex; align-items: center; gap: 12px; margin: 14px 18px 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.day::before, .day::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.msg { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 14px; padding: 2px 18px 2px 18px; margin-top: 12px; }
.msg.grouped { margin-top: 0; }
.msg:hover { background: #ffffff08; }
.msg.flash { background: #ee3b4630; }
.msg .replyline { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; margin: 0 0 2px 22px; color: var(--muted); font-size: 13px; cursor: pointer; min-width: 0; }
.msg .replyline span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg .replyline b { color: #c8ccda; flex: none; }
.curve { width: 18px; height: 10px; border-left: 2px solid var(--line); border-top: 2px solid var(--line); border-radius: 6px 0 0 0; flex: none; margin-top: 6px; }
.ava-btn { height: 40px; border-radius: 50%; }
.gutter { font-size: 9px; line-height: 14px; white-space: nowrap; color: transparent; text-align: right; padding-top: 4px; }
.msg:hover .gutter { color: var(--muted); }
.meta { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.meta .name { font-weight: 700; }
.meta .name:hover { text-decoration: underline; }
.meta .pk { font-size: 11px; color: var(--muted); background: var(--bg3); padding: 0 6px; border-radius: 99px; }
.meta time { font-size: 12px; color: var(--muted); }
.content { min-width: 0; }
.body { overflow-wrap: anywhere; white-space: pre-wrap; }
.body .embed { display: block; margin-top: 6px; width: fit-content; max-width: 100%; }
.body .embed img { display: block; max-width: min(100%, 420px); max-height: 320px; border-radius: 10px; background: var(--bg3); }
.edited { color: var(--muted); font-size: 11px; margin-left: 4px; }
.editbox small { color: var(--muted); }
textarea.edit { resize: vertical; min-height: 52px; }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.react { display: inline-flex; gap: 5px; align-items: center; padding: 1px 8px; border-radius: 8px; background: var(--bg3); border: 1px solid transparent; }
.react b { font-size: 12px; color: var(--muted); }
.react.mine { border-color: var(--blue); background: #243252; }
.react:hover { background: var(--bg4); }
.actions { position: absolute; right: 18px; top: -14px; display: none; background: var(--bg3); border: 1px solid var(--line); border-radius: 8px; padding: 2px; box-shadow: 0 4px 14px #0005; }
.msg:hover .actions, .msg:focus-within .actions { display: flex; }
.actions button { width: 30px; height: 28px; display: grid; place-items: center; color: var(--muted); border-radius: 6px; }
.actions button:hover { background: var(--bg4); color: var(--text); }
.actions button.danger:hover { color: #ff8b92; }
.composer { flex: none; padding: 0 16px 6px; }
.composer .box { display: flex; align-items: flex-end; gap: 2px; background: var(--bg3); border-radius: 12px; padding: 4px 6px 4px 14px; }
.composer textarea { background: transparent; border: 0; resize: none; padding: 9px 4px; max-height: 180px; line-height: 1.4; }
.composer textarea:disabled { cursor: not-allowed; }
.replybar { display: flex; justify-content: space-between; align-items: center; padding: 6px 14px; background: var(--bg4); border-radius: 10px 10px 0 0; color: var(--muted); font-size: 13px; margin-bottom: -4px; position: relative; z-index: 1; }
.typing { height: 20px; font-size: 12px; color: var(--muted); padding: 2px 4px; }

/* emoji popover */
.emoji-pop { position: fixed; z-index: 60; width: 232px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 6px; background: var(--bg3); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px #0008; }
.emoji-pop button { font-size: 22px; padding: 4px; border-radius: 8px; line-height: 1.2; }
.emoji-pop button:hover { background: var(--bg4); }

/* modal */
.overlay { position: fixed; inset: 0; background: #000a; display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { width: 100%; max-width: 440px; max-height: 92vh; overflow: auto; background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 70px #000a; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px 20px; }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-body { padding: 10px 20px 20px; }
.settings h4 { margin: 0 0 4px; }
.set-ava { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.set-ava p { margin: 0 0 8px; font-size: 13px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row.split { justify-content: space-between; margin-top: 8px; }
.set-poke { display: flex; align-items: center; gap: 12px; padding: 10px; background: var(--bg3); border-radius: 12px; margin-bottom: 8px; }
.set-poke > div { flex: 1; display: grid; }
.set-poke small, .profile small { color: var(--muted); }
.set-poke img { image-rendering: pixelated; }
.profile-top { display: flex; gap: 16px; align-items: center; }
.profile-top h3 { margin: 0; font-size: 22px; }
.profile-top p { margin: 2px 0; }
.status { color: var(--text); }
.profile-poke { display: flex; align-items: center; gap: 16px; margin-top: 18px; padding: 12px; background: var(--bg3); border-radius: 14px; }
.profile-poke > div { display: grid; gap: 4px; justify-items: start; }
.profile-poke .types { justify-content: flex-start; }
.scrim { display: none; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--bg4) transparent; }

/* responsive */
@media (max-width: 1100px) {
  .shell { grid-template-columns: 68px 232px minmax(0, 1fr); }
  .members { position: fixed; right: 0; top: 0; bottom: 0; width: 260px; z-index: 40; transform: translateX(100%); transition: transform 0.2s; }
  .shell.show-members .members { transform: none; }
  .only-mobile { display: inline-grid; }
  .scrim { position: fixed; inset: 0; background: #0008; z-index: 30; }
  .shell.show-members .scrim, .shell.show-nav .scrim { display: block; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: fixed; left: 0; top: 0; bottom: 0; width: 60px; z-index: 40; transform: translateX(-100%); transition: transform 0.2s; }
  .side { position: fixed; left: 60px; top: 0; bottom: 0; width: 240px; z-index: 40; transform: translateX(-120%); transition: transform 0.2s; }
  .shell.show-nav .rail, .shell.show-nav .side { transform: none; }
  .dex-body { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) minmax(0, 46%); }
  .dex-detail { margin-bottom: 8px; }
  .dex-detail .art { width: 130px; height: 130px; }
  .pick { padding: 12px 12px 0; }
  .dexwrap { padding: 12px 12px 0; }
  .msg { padding-left: 12px; padding-right: 12px; column-gap: 10px; }
  .actions { right: 8px; }
  .dex-count { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
.keep { margin: 0 0 10px; }

/* handles, mentions, commands */
.composer { position: relative; }
.handle { font-size: 12px; color: var(--muted); }
.mention { color: #9cc2ff; background: #4a8cff26; border-radius: 4px; padding: 0 3px; font-weight: 600; }
.mention:hover { background: #4a8cff44; }
.mention.self { color: #ffd37a; background: #ffb30030; }
.msg.mentioned { background: #ffb30012; box-shadow: inset 3px 0 0 #ffb300; }
.pip.at { width: auto; height: auto; min-width: 16px; padding: 0 4px; font-size: 11px; font-style: normal; font-weight: 800; line-height: 16px; text-align: center; color: #fff; border-radius: 99px; background: var(--red); }
.ac { position: absolute; left: 16px; right: 16px; bottom: 100%; margin-bottom: 6px; background: var(--bg3); border: 1px solid var(--line); border-radius: 12px; padding: 4px; box-shadow: 0 10px 30px #0008; z-index: 20; display: grid; }
.ac-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 8px; text-align: left; }
.ac-row small { color: var(--muted); }
.ac-row.on, .ac-row:hover { background: var(--bg4); }
.ava .dot.inline { position: static; display: inline-block; margin-left: auto; border-color: var(--bg3); }
.btn.sm { padding: 4px 12px; font-size: 13px; border-radius: 6px; }
.help p { margin: 0 0 10px; color: var(--muted); }
.help code { color: var(--text); }
.whois { display: grid; grid-template-columns: 8.5rem 1fr; gap: 8px 14px; margin: 4px 0 0; }
.whois dt { color: var(--muted); }
.whois dd { margin: 0; overflow-wrap: anywhere; }

/* battle messages in the channel */
.msg.sys { display: block; margin-top: 8px; padding-top: 4px; padding-bottom: 4px; }
.sys-body { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; width: fit-content; max-width: 100%; }
.msg.sys:hover { background: transparent; }
.msg.sys.challenge .sys-body { border-color: #ee3b4655; background: #2a1f26; }
.chrow { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.teams { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; margin-top: 10px; align-items: stretch; }
.team { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: grid; gap: 6px; min-width: 0; align-content: start; }
.team.red { background: linear-gradient(180deg, #3a2228 0%, var(--bg) 72%); border-color: #ee6b7344; }
.team.blue { background: linear-gradient(180deg, #1b2838 0%, var(--bg) 72%); border-color: #7eb6ff44; }
.team-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.team-head b { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.team-head span { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.team.red .team-head b { color: #ee6b73; }
.team.blue .team-head b { color: #7eb6ff; }
.seats { display: grid; gap: 6px; }
.seat { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px; align-items: center; padding: 6px; border-radius: 10px; background: #0004; transition: background 0.35s ease, box-shadow 0.35s ease, opacity 0.4s ease; }
.seat-art-wrap { width: 40px; height: 40px; display: grid; place-items: center; }
.team.red .seat.active { box-shadow: inset 0 0 0 1px #ee6b73; }
.team.blue .seat.active { box-shadow: inset 0 0 0 1px #7eb6ff; }
.seat.you { background: #4a8cff22; }
.seat.fainted { opacity: 0.55; }
.seat.fainted .seat-art { filter: grayscale(1); transition: filter 0.4s ease; }
.seat.empty { color: var(--muted); }
.seat-art { width: 40px; height: 40px; object-fit: contain; display: grid; place-items: center; font-size: 18px; }
.seat-copy { min-width: 0; display: grid; gap: 1px; }
.seat-name { display: flex; align-items: center; gap: 4px; min-width: 0; color: var(--text, inherit); }
.seat-name b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat small { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.you-tag, .bot-tag { flex: none; font-style: normal; font-size: 9px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; border-radius: 99px; padding: 1px 5px; }
.you-tag { background: #4a8cff; color: #fff; }
.bot-tag { background: #0006; color: var(--muted); }
.seat-hp { margin-top: 2px; }
.seat-hp .hp-track { height: 5px; }
.team .btn { justify-self: start; }

/* battle panel */
.battle-chip { position: fixed; right: 16px; bottom: 16px; z-index: 45; background: var(--red); color: #fff; font-weight: 700; padding: 10px 16px; border-radius: 99px; box-shadow: 0 8px 24px #0008; }
.battle-chip.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); box-shadow: 0 0 0 8px #ee3b4633; } }
.battle-overlay { position: fixed; inset: 0; z-index: 55; background: #000b; display: grid; place-items: center; padding: 12px; }
.confetti { position: fixed; inset: 0; z-index: 90; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -20px; border-radius: 2px; animation-name: confetti-fall; animation-timing-function: ease-in; animation-fill-mode: forwards; }
@keyframes confetti-fall {
  0% { transform: translate3d(0, -8vh, 0) rotate(0deg); }
  100% { transform: translate3d(var(--drift), 108vh, 0) rotate(var(--spin)); }
}
.battle { width: 100%; max-width: 720px; max-height: 96vh; overflow: auto; background: var(--bg2); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 80px #000c; }
.battle-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.battle-body { padding: 16px; display: grid; gap: 14px; }
.battle-body h3 { margin: 0; font-size: 20px; }
.battle-body p { margin: 0; }
.duel { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.duel.solo { grid-template-columns: 1fr; justify-items: center; }
.vs { font-weight: 800; color: var(--muted); }
.fighter { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 10px; background: var(--bg); border-radius: 14px; width: 100%; max-width: 300px; }
.fighter.you { box-shadow: inset 0 0 0 1px #4a8cff66; }
.fighter img { object-fit: contain; filter: drop-shadow(0 6px 10px #0008); }
.fighter .who { color: var(--muted); }
.hp { width: 100%; display: grid; gap: 2px; margin-top: 4px; }
.hp small { color: var(--muted); }
.hp-track { height: 10px; border-radius: 99px; background: #0007; overflow: hidden; }
.hp-fill { height: 100%; border-radius: 99px; transition: width 0.5s ease, background 0.3s; }
.hp-fill.ok { background: var(--ok); } .hp-fill.mid { background: #f0b429; } .hp-fill.low { background: #ee3b46; }
.banner-line { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: var(--bg3); border-radius: 10px; }
.turn-log { display: grid; gap: 2px; min-height: 0; }
.turn-log:empty { display: none; }
.turn-log p { margin: 0; color: var(--muted); font-size: 13px; }
.banner-line.done { background: #33232b; }
.timer { color: var(--muted); font-variant-numeric: tabular-nums; }
.moves { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mv { display: grid; gap: 4px; text-align: left; padding: 10px 12px; background: var(--bg3); border-radius: 10px; }
.mv:hover:not(:disabled) { background: var(--bg4); }
.mv.preview, .mv:disabled { opacity: 0.6; cursor: default; }
.mv-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.mv small { color: var(--muted); }
@media (max-width: 560px) { .moves { grid-template-columns: 1fr; } .duel { grid-template-columns: 1fr; } .vs { display: none; } .fighter { max-width: none; } }

/* evolution */
.xp { display: block; height: 4px; margin-top: 3px; border-radius: 3px; background: var(--bg4); overflow: hidden; min-width: 60px; }
.xp i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #6aa8ff, #9d7bff); transition: width 0.5s ease; }
.userpanel .who { min-width: 0; }
.profile-poke .xp, .set-poke .xp { width: 140px; }
.evo-line { color: var(--muted); font-size: 12px; }
.evolve-btn { background: linear-gradient(90deg, #6aa8ff, #9d7bff); color: #fff; border: 0; font-weight: 700; animation: evo-pulse 1.6s ease-in-out infinite; }
.evo-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-top: 12px; }
.evo-choice { display: grid; justify-items: center; gap: 6px; padding: 12px 8px; background: var(--bg3); border: 1px solid var(--line); border-radius: 12px; }
.evo-choice:hover, .evo-choice:focus-visible { border-color: #9d7bff; background: var(--bg4); }
.evo-choice img { width: 96px; height: 96px; object-fit: contain; }
.evo-scene { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at center, #1d2540, #05060a); }
.evo-card { display: grid; justify-items: center; gap: 18px; text-align: center; max-width: 420px; }
.evo-card h2 { margin: 0; font-size: 20px; }
.evo-art { width: 180px; height: 180px; display: grid; place-items: center; }
.evo-art img { width: 180px; height: 180px; object-fit: contain; }
.evo-art.glow img { animation: evo-glow 0.55s ease-in-out infinite alternate; }
.evo-art.pop img { animation: evo-pop 0.7s cubic-bezier(0.2, 1.4, 0.4, 1); filter: drop-shadow(0 0 22px #9d7bffaa); }
@keyframes evo-glow { from { filter: brightness(1); transform: scale(1); } to { filter: brightness(8) saturate(0); transform: scale(1.12); } }
@keyframes evo-pop { from { transform: scale(0.4); filter: brightness(8) saturate(0); } to { transform: scale(1); } }
@keyframes evo-pulse { 50% { box-shadow: 0 0 0 5px #9d7bff44; } }
@media (prefers-reduced-motion: reduce) { .evo-art.glow img, .evo-art.pop img, .evolve-btn { animation: none; } }
/* typed commands */
.composer .field { position: relative; flex: 1; min-width: 0; display: flex; margin-bottom: 0; }
.composer .hl, .composer .field textarea { padding: 9px 4px; line-height: 1.4; font: inherit; font-size: inherit; font-weight: 400; letter-spacing: normal; white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; border: 0; }
.composer .hl { position: absolute; inset: 0; overflow: hidden; pointer-events: none; color: var(--text); }
.composer .field textarea { position: relative; color: transparent; caret-color: var(--text); background: transparent; }
.composer .field textarea::selection { color: transparent; background: #4a8cff66; }
.composer .field textarea::placeholder { color: var(--muted); }
.composer .field textarea:disabled::placeholder { color: var(--muted); }
.hl .cmd { color: #ff5560; }
.hl .at { color: #9cc2ff; }
.composer .hl span { font: inherit; letter-spacing: inherit; font-weight: inherit; }

/* servers */
.rail { overflow-y: auto; scrollbar-width: none; }
.rail-btn { position: relative; flex: none; }
.rail-btn.srv { overflow: visible; }
.srv-ico { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1; }
.rail-btn.add { background: transparent; border: 2px dashed var(--line); color: #6fcf8f; }
.rail-btn.add:hover { background: var(--bg3); color: #8fe3a9; }
.rail-sep { width: 28px; height: 2px; border-radius: 2px; background: var(--line); flex: none; }
.rail-pip { position: absolute; right: 0; top: 0; min-width: 14px; height: 14px; display: grid; place-items: center; font-size: 10px; font-style: normal; font-weight: 800; color: #fff; border: 2px solid #17181d; box-sizing: content-box; }
.server-name { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; text-align: left; padding: 6px 8px; margin: 0 -8px; border-radius: 8px; }
.server-name:hover { background: var(--bg3); }
.server-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-name .caret { color: var(--muted); font-size: 12px; }
.addserver { display: grid; gap: 10px; }
.addserver h4 { margin: 6px 0 0; }
.addserver .row { flex-wrap: nowrap; }
.addserver .row input { flex: 1; }
.addserver .row .icon-input { flex: none; width: 64px; text-align: center; font-size: 20px; }
.addserver .or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; text-transform: uppercase; }
.addserver .or::before, .addserver .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.btn.danger { background: #3a1d22; color: #ff8a93; border: 1px solid #ee3b4655; }
.btn.danger:hover { background: #4a2229; }
/* pings, mute, pins, search, mentions */
.rail-btn.srv.muted { opacity: 0.55; }
.ch.muted { opacity: 0.55; }
.ch .mute-ico { display: inline-flex; color: var(--muted); }
.mention.ping { cursor: default; }
.msg.pinned { box-shadow: inset 3px 0 0 #6aa8ff55; }
.msg.mentioned.pinned { box-shadow: inset 3px 0 0 #ffb300; }
.pin-flag { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; color: #8db8ff; font-size: 11px; }
.at-ico { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #ffb30030; color: #ffd37a; font-weight: 800; }
.set-pings { display: grid; gap: 8px; margin: 12px 0 4px; }
.set-pings h4 { margin: 0; }
.set-pings .check { color: var(--text); }
.mrows { display: grid; gap: 4px; max-height: 60vh; overflow-y: auto; }
.mrow { display: flex; align-items: flex-start; gap: 8px; border-radius: 10px; background: var(--bg3); }
.mrow:hover { background: var(--bg4); }
.mrow > .btn { margin: 8px 8px 0 0; flex: none; }
.mrow-main { flex: 1; min-width: 0; display: flex; gap: 10px; padding: 10px; text-align: left; color: inherit; }
.mrow-body { min-width: 0; flex: 1; }
.mrow-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-size: 13px; }
.mrow-meta time, .mrow-meta .where { color: var(--muted); font-size: 12px; }
.mrow-text { max-height: 140px; overflow: hidden; overflow-wrap: anywhere; font-size: 14px; }
.mrow-text img { max-height: 110px; max-width: 100%; }
.inbox-top { align-items: center; margin-bottom: 8px; }
.search .row { flex-wrap: nowrap; margin-bottom: 10px; }
.search .row input { flex: 1; min-width: 0; }
.search .row select { flex: none; width: auto; max-width: 45%; }
.search-out { min-height: 80px; }
.empty { padding: 18px 4px; text-align: center; }
/* ranks after the final evolution: EX, GX, OX, VSTAR, VMAX, VMAX ULTRA */
.tiered.tier-1, .tier.t1 { --tc: #6ab7ff; }
.tiered.tier-2, .tier.t2 { --tc: #46e0b0; }
.tiered.tier-3, .tier.t3 { --tc: #ff9f43; }
.tiered.tier-4, .tier.t4 { --tc: #ffd54a; }
.tiered.tier-5, .tier.t5 { --tc: #ff4d6d; }
.tiered.tier-6, .tier.t6 { --tc: #c77dff; }
.ava.tiered { box-shadow: 0 0 0 2px var(--tc), 0 0 8px var(--tc); }
.ava.tiered.tier-4 { box-shadow: 0 0 0 2px var(--tc), 0 0 12px var(--tc), 0 0 22px #ffd54a55; }
.ava.tiered.tier-5 { animation: tier-pulse 1.6s ease-in-out infinite; }
.ava.tiered.tier-6 { animation: tier-rainbow 3s linear infinite; }
.tier-art { display: inline-grid; place-items: center; }
.tier-art.tiered img { filter: drop-shadow(0 0 6px var(--tc)); }
.tier-art.tiered.tier-3 img { filter: drop-shadow(0 0 10px var(--tc)); }
.tier-art.tiered.tier-4 img { filter: drop-shadow(0 0 14px var(--tc)) drop-shadow(0 0 4px #fff8); }
.tier-art.tiered.tier-5 img { animation: tier-glow 1.6s ease-in-out infinite alternate; }
.tier-art.tiered.tier-6 img { animation: tier-glow-rainbow 3s linear infinite; }
.tier { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px; font-size: 10px; font-weight: 800; line-height: 15px; letter-spacing: 0.04em; vertical-align: middle; white-space: nowrap; color: #0b0d12; background: var(--tc); }
.tier.t5 { color: #fff; }
.tier.t6 { color: #fff; background: linear-gradient(90deg, #ff4d6d, #ffd54a, #46e0b0, #6ab7ff, #c77dff, #ff4d6d); background-size: 300% 100%; animation: tier-shift 3s linear infinite; text-shadow: 0 1px 2px #0008; }
.tier.big { font-size: 16px; line-height: 26px; padding: 0 14px; margin: 0; border-radius: 6px; }
.xp.rank i { background: linear-gradient(90deg, #ffd54a, #ff4d6d, #c77dff); }
@keyframes tier-pulse { 0%, 100% { box-shadow: 0 0 0 2px var(--tc), 0 0 6px var(--tc); } 50% { box-shadow: 0 0 0 2px var(--tc), 0 0 18px 3px var(--tc); } }
@keyframes tier-rainbow {
  0% { box-shadow: 0 0 0 2px #ff4d6d, 0 0 14px #ff4d6d; }
  25% { box-shadow: 0 0 0 2px #ffd54a, 0 0 14px #ffd54a; }
  50% { box-shadow: 0 0 0 2px #46e0b0, 0 0 14px #46e0b0; }
  75% { box-shadow: 0 0 0 2px #6ab7ff, 0 0 14px #6ab7ff; }
  100% { box-shadow: 0 0 0 2px #ff4d6d, 0 0 14px #ff4d6d; }
}
@keyframes tier-glow { from { filter: drop-shadow(0 0 6px var(--tc)); } to { filter: drop-shadow(0 0 20px var(--tc)); } }
@keyframes tier-glow-rainbow {
  0% { filter: drop-shadow(0 0 16px #ff4d6d); }
  25% { filter: drop-shadow(0 0 16px #ffd54a); }
  50% { filter: drop-shadow(0 0 16px #46e0b0); }
  75% { filter: drop-shadow(0 0 16px #6ab7ff); }
  100% { filter: drop-shadow(0 0 16px #ff4d6d); }
}
@keyframes tier-shift { to { background-position: 300% 0; } }
@media (prefers-reduced-motion: reduce) { .ava.tiered, .tier-art.tiered img, .tier.t6 { animation: none; } }
/* ---------- photos & videos ---------- */
.composer .box { padding-left: 6px; }
.composer .icon-btn.attach { color: var(--muted); }
.composer .icon-btn.attach:hover:not(:disabled) { color: var(--text); }
.tray { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 4px 10px; }
.tray .thumb { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; background: var(--bg3); flex: none; }
.tray .thumb img, .tray .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tray .thumb .badge { position: absolute; left: 6px; bottom: 6px; font-size: 11px; background: #000a; color: #fff; padding: 1px 6px; border-radius: 99px; }
.tray .thumb-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 99px; background: #000b; color: #fff; font-size: 11px; line-height: 1; }
.tray .thumb-x:hover { background: var(--red); }
.up-cover { position: absolute; inset: 0; background: #0009; display: flex; align-items: flex-end; padding: 8px; }
.up-bar { height: 5px; width: 100%; border-radius: 99px; background: #fff3; overflow: hidden; }
.up-bar i { display: block; height: 100%; width: 0; background: var(--red2); transition: width 0.2s linear; }
.chat.dropping::after { content: 'Drop photos or videos to add them'; position: absolute; inset: 8px; z-index: 30; display: grid; place-items: center; border: 2px dashed var(--red2); border-radius: 16px; background: #1e1f26ee; font-weight: 700; font-size: 18px; pointer-events: none; }
.chat { position: relative; }

.atts { display: grid; gap: 4px; margin-top: 4px; max-width: 420px; }
.atts.n2, .atts.n3, .atts.n4 { grid-template-columns: 1fr 1fr; max-width: 340px; }
.atts.n3 .att:first-child { grid-column: 1 / -1; }
.att { display: block; padding: 0; border-radius: 10px; overflow: hidden; background: var(--bg3); max-width: 100%; }
.atts:not(.n1) .att { aspect-ratio: 4 / 3; }
.atts.n3 .att:first-child { aspect-ratio: 16 / 9; }
.att img, .att video { width: 100%; height: 100%; display: block; object-fit: cover; background: #000; }
.atts.n1 .att img, .atts.n1 .att video { object-fit: contain; }
.att.img { cursor: zoom-in; }
.att.img:hover img { filter: brightness(1.08); }
.mrow-text em { color: var(--muted); }

.lightbox { position: fixed; inset: 0; z-index: 80; background: #000d; display: grid; place-items: center; padding: 24px; animation: fadein 0.15s ease; }
.lightbox img { max-width: 94vw; max-height: 86vh; border-radius: 8px; box-shadow: 0 20px 60px #000c; }
.lightbox .open { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); color: #fff; background: #0008; padding: 6px 14px; border-radius: 99px; font-size: 14px; }
.lightbox .close { position: absolute; top: 14px; right: 14px; background: #0008; color: #fff; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* ---------- battle: smooth updates, averages, win chance, summary ---------- */
.battle-body .stage { display: grid; gap: 14px; }
.fighter { position: relative; }
.fighter.hit img { animation: pg-shake 0.45s ease; }
.fighter.hit { animation: pg-flash 0.5s ease; }
@keyframes pg-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
@keyframes pg-flash { 0% { box-shadow: inset 0 0 0 2px var(--red); } 100% { box-shadow: inset 0 0 0 2px transparent; } }
.dmg-pop { position: absolute; top: 28%; left: 50%; font-weight: 800; font-size: 22px; color: var(--red2); text-shadow: 0 2px 6px #000; pointer-events: none; animation: pg-pop 1.1s ease-out forwards; }
@keyframes pg-pop { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, -40px); } }
.hp-fill { will-change: width; }

.winmeter { display: grid; gap: 6px; padding: 10px 12px; background: var(--bg3); border-radius: 10px; }
.wm-text { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.wm-text small { color: var(--muted); }
.wm-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: #0006; gap: 2px; }
.wm-bar i { display: block; min-width: 2%; transition: flex-basis 0.6s ease; }
.wm-you { background: var(--blue); }
.wm-them { background: var(--red); }
.winmeter.lead-you .wm-text b:first-child, .winmeter.lead-them .wm-text b:last-child { color: var(--ok); }

.mv { transition: background 0.15s, transform 0.1s, opacity 0.2s; position: relative; }
.mv:active:not(:disabled) { transform: scale(0.98); }
.mv .calc { color: var(--text); font-weight: 600; }
.mv .calc[data-eff='up'] { color: var(--ok); }
.mv .calc[data-eff='down'] { color: #f0b429; }
.mv .best { font-style: normal; font-size: 11px; font-weight: 700; color: #1b1c22; background: var(--ok); padding: 1px 6px; border-radius: 99px; margin-left: auto; margin-right: 6px; }
.mv-top b { white-space: nowrap; }
.mv.chosen { outline: 2px solid var(--blue); opacity: 1; }
.mv.chosen:disabled { opacity: 1; }

.verdict { color: var(--text); text-align: center; }
.banner-line.done b { font-size: 18px; }
/* ---------- voice channels ---------- */
.ch.voice .hash { display: inline-grid; place-items: center; }
.vch > .ch { width: 100%; }
.ch.voice.on { color: var(--ok); }
.ch .count { color: var(--muted); font-size: 12px; }
.vusers { display: grid; gap: 1px; padding: 2px 0 6px 28px; }
.vu { display: flex; align-items: center; gap: 8px; padding: 3px 8px; border-radius: 6px; color: var(--muted); font-size: 14px; min-width: 0; }
.vu .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vu .ava { flex: none; border-radius: 50%; transition: box-shadow 0.12s; }
.vu.speaking { color: var(--text); }
.vu.speaking .ava { box-shadow: 0 0 0 2px var(--ok); }
.vu .vi { display: inline-flex; color: #e46a74; }
.voicebar { display: flex; align-items: center; gap: 2px; padding: 8px 8px 6px; background: #1b1c22; border-top: 1px solid #00000050; }
.voicebar[hidden] { display: none; }
.voicebar .vinfo { flex: 1; min-width: 0; display: grid; }
.voicebar .vinfo b { color: var(--ok); font-size: 13px; }
.voicebar .vinfo small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voicebar .icon-btn.off { color: var(--red2); }
.voicebar .icon-btn.leave:hover:not(:disabled) { color: #fff; background: var(--red); }
.voicebar + .userpanel { padding-top: 4px; }
.inbox-btn { position: relative; }
.inbox-btn .rail-pip { right: -2px; top: -2px; border-color: var(--bg); }
/* Discord-style server creation */
.modal.bare .modal-head { justify-content: flex-end; padding-bottom: 0; }
.modal.bare .modal-body { padding: 0 28px 24px; }
.mk { display: grid; gap: 14px; justify-items: stretch; text-align: center; }
.mk h3 { margin: 0; font-size: 24px; }
.mk .muted { margin: 0; font-size: 14px; line-height: 1.4; }
.mk .muted.small { font-size: 12px; text-align: left; }
.icon-pick-wrap { display: grid; place-items: center; padding: 6px 0; }
.icon-pick { position: relative; width: 84px; height: 84px; border-radius: 50%; border: 2px dashed var(--muted); background: transparent; color: var(--muted); display: grid; place-items: center; align-content: center; gap: 2px; font-size: 11px; }
.icon-pick:hover { color: var(--text); border-color: var(--text); }
.icon-pick img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.icon-pick .emo { font-size: 34px; line-height: 1; }
.icon-pick .plus { position: absolute; top: -4px; right: -4px; width: 26px; height: 26px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; }
.mk-label { display: grid; gap: 6px; text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.mk-label i { color: var(--red); font-style: normal; display: inline; }
.mk-label input { text-transform: none; font-weight: 400; font-size: 15px; }
.mk-foot { display: flex; justify-content: flex-end; align-items: center; margin-top: 4px; }
.mk-foot .btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.srv-img { width: 100%; height: 100%; border-radius: 14px; object-fit: cover; display: block; }
.rail-btn.srv:has(.srv-img) { overflow: hidden; }
.icon-pick:has(img) { border-color: transparent; }
.who b.nameline { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; overflow: visible; white-space: normal; }
.who b.nameline .nm { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who b.nameline .tag, .who b.nameline .tier { flex: none; }
.who b.nameline .tag, .who b.nameline .tier { margin: 0 6px 0 0; }
.who b.nameline .nm { margin-right: 6px; }
/* moderation warning */
.mod { display: grid; gap: 12px; justify-items: stretch; text-align: center; }
.mod-icon { font-size: 44px; line-height: 1; }
.mod h3 { margin: 0; font-size: 22px; }
.mod p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.mod-dots { display: flex; justify-content: center; gap: 8px; margin: 2px 0; }
.mod-dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--bg4); border: 1px solid var(--line); }
.mod-dots i.on { background: var(--red); border-color: var(--red); }
/* audio attachments */
.attbox { display: grid; gap: 4px; }
.auds { display: grid; gap: 6px; margin-top: 4px; max-width: 420px; }
.attbox .auds { margin-top: 0; }
.aud { display: grid; gap: 6px; padding: 8px 10px; border-radius: 12px; background: var(--bg3); }
.aud-name { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aud audio { width: 100%; height: 36px; }
.tray .thumb.audio { display: grid; place-items: center; }
.audio-face { display: grid; justify-items: center; gap: 4px; padding: 6px; width: 100%; font-size: 26px; line-height: 1; }
.audio-face small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; color: var(--muted); }

/* ---------- battle screen, simpler ---------- */
.fighter .sprite { width: 112px; height: 112px; display: grid; place-items: center; }
.fighter img { width: 112px; height: 112px; }
.stage.done .fighter .sprite, .stage.done .fighter img { width: 140px; height: 140px; }
.fighter { gap: 3px; }
.mv-bot { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.mv-bot small { color: var(--muted); white-space: nowrap; }
.mv .calc { min-width: 0; }
.battle-body { gap: 12px; }

/* ---------- phones and touch ---------- */
@supports (height: 100dvh) {
  html, body { height: 100dvh; }
  .battle { max-height: 96dvh; }
  .modal { max-height: 92dvh; }
}
@media (hover: none) {
  .msg:hover { background: none; }
  .msg.sel { background: #ffffff0d; }
  .msg.sel .actions { display: flex; z-index: 3; }
  .msg:hover .gutter { color: transparent; }
  .msg.sel .gutter { color: var(--muted); }
}
@media (pointer: coarse) {
  input, textarea, select, .mk-label input { font-size: 16px; }
  .composer .hl, .composer .field textarea { font-size: 16px; }
  .icon-btn { width: 42px; height: 42px; }
  .icon-btn.sm { width: 34px; height: 34px; }
  .actions button { width: 40px; height: 38px; }
  .ch { padding: 10px 12px; }
  .mem { padding: 8px; }
  .react { padding: 4px 10px; }
  .loadmore { padding: 10px 18px; }
  .btn { min-height: 42px; }
  .ac-row { min-height: 44px; }
  .emoji-pop button { font-size: 26px; padding: 6px; }
  .emoji-pop { width: 252px; }
}
@media (max-width: 560px) {
  .chat-head { padding: 0 6px; gap: 0; }
  .chat-head .icon-btn { width: 38px; height: 38px; }
  .chat-head .topic { display: none; }
  .composer { padding: 0 8px 4px; }
  .composer .box { padding: 2px 4px 2px 8px; }
  .composer .icon-btn { width: 40px; height: 40px; }
  .welcome { padding: 20px 14px 6px; }
  .modal-body { padding: 8px 16px 16px; }
  .overlay { padding: 10px; }
  .battle-overlay { padding: 6px; }
  .battle-body { padding: 12px; gap: 12px; }
  .battle-body h3 { font-size: 18px; }
  .duel { grid-template-columns: 1fr 1fr; gap: 6px; }
  .fighter { padding: 8px 6px; gap: 3px; min-width: 0; }
  .fighter .sprite, .fighter img, .stage.done .fighter .sprite, .stage.done .fighter img { width: 96px; height: 96px; }
  .seat-art-wrap { width: 32px; height: 32px; }
  .stage.done .duel { grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: start; }
  .stage.done .vs { display: block; font-size: 12px; padding-top: 36px; }
  .stage.done .fighter { padding: 8px 4px; }
  .stage.done .fighter .sprite, .stage.done .fighter img { width: 72px; height: 72px; }
  .stage.done .fighter b { font-size: 13px; }
  .stage.done .fighter .who, .stage.done .hp small { font-size: 11px; }
  .stage.done .types { gap: 3px; }
  .banner-line.done { justify-content: center; text-align: center; }
  .stage.done .row .btn { flex: 1; }
  .teams { grid-template-columns: 1fr; gap: 8px; }
  .teams .vs { display: none; }
  .seat { grid-template-columns: 32px minmax(0, 1fr); padding: 4px; }
  .seat-art { width: 32px; height: 32px; }
  .fighter b, .fighter .who { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fighter .types { flex-wrap: wrap; justify-content: center; }
  .mv { padding: 10px 12px; }
  .battle-chip { right: 10px; bottom: 74px; }
}

