/* SlashClient on the phone: the launcher's dark look (blue accent, Outfit), thumb-sized. */
@font-face { font-family: "Outfit"; font-weight: 100 900; font-display: swap; src: url(/vendor/fonts/outfit-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Outfit"; font-weight: 100 900; font-display: swap; src: url(/vendor/fonts/outfit-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #0a0d14;
  --bg-2: #111622;
  --card: #121827;
  --card-2: #182033;
  --border: rgba(255, 255, 255, .08);
  --text: #f3f4f6;
  --text-2: #9ca3af;
  --accent: #3b82f6;
  --accent-text: #60a5fa;
  --on-accent: #fff;
  --mine: #2563eb;
  --mine-text: #fff;
  --theirs: #1b2334;
  --danger: #ef4444;
  --green: #4ade80;
  --gold: #facc15;
  --amber: #f59e0b;
  --mention: rgba(250, 204, 21, .12);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  color: var(--text); background: var(--bg); font: 16px/1.45 "Outfit", system-ui, -apple-system, sans-serif;
  overscroll-behavior-y: none;
}
a { color: var(--accent-text); text-decoration: none; }
h1, h2 { margin: 0; line-height: 1.2; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 15px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; margin: 18px 16px 8px; }
.card h2 { margin: 0 0 8px; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row { display: flex; align-items: center; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
button, input, select, textarea { font: inherit; color: inherit; }

/* buttons and fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border: 0; border-radius: 12px; background: var(--accent); color: var(--on-accent); font-weight: 600; cursor: pointer;
}
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn.ghost { background: var(--card-2); color: var(--text); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .6; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%;
  background: transparent; color: var(--text); font-size: 18px; cursor: pointer;
}
.icon-btn:active { background: var(--card-2); }
input[type="text"], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--card-2); outline: none;
}
input[type="text"]:focus, textarea:focus, select:focus { border-color: var(--accent); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--text-2); }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--card-2); }
.seg button { flex: 1; min-height: 36px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; }
.seg button.on { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: var(--card-2); font-weight: 600; font-size: 14px; }
.chip.gold { color: var(--gold); }

/* the splash while the app starts: the icon breathing in a soft glow, a thin bar sliding under it */
.splash {
  position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: radial-gradient(520px 380px at 50% 42%, rgba(59, 130, 246, .22), transparent 70%), var(--bg);
}
.splash-logo { position: relative; width: 104px; height: 104px; animation: splash-in .5s cubic-bezier(.2, .8, .2, 1) both; }
.splash-logo::before {
  content: ""; position: absolute; inset: -18px; border-radius: 40px; background: radial-gradient(closest-side, rgba(59, 130, 246, .55), transparent);
  filter: blur(6px); animation: splash-glow 1.8s ease-in-out infinite;
}
.splash-logo img { position: relative; width: 100%; height: 100%; border-radius: 26px; box-shadow: 0 12px 32px rgba(0, 0, 0, .45); animation: splash-breathe 1.8s ease-in-out infinite; }
.splash-name { font-size: 22px; font-weight: 700; letter-spacing: .02em; animation: splash-in .5s .08s cubic-bezier(.2, .8, .2, 1) both; }
/* the app in a line for readers without scripts and search engines: barely there while it loads */
.splash-about { max-width: 300px; margin: 0; text-align: center; font-size: 12px; font-weight: 400; line-height: 1.5; color: rgba(255, 255, 255, .35); animation: splash-in .5s .24s ease both; }
h1.splash-about { margin-top: 18px; font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, .5); }
.splash-about a { color: inherit; }
.splash-bar { position: relative; width: 120px; height: 3px; overflow: hidden; border-radius: 3px; background: rgba(255, 255, 255, .08); animation: splash-in .5s .16s ease both; }
.splash-bar span { position: absolute; top: 0; bottom: 0; width: 40%; border-radius: inherit; background: linear-gradient(90deg, transparent, var(--accent), transparent); animation: splash-slide 1.1s ease-in-out infinite; }
@keyframes splash-in { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes splash-breathe { 50% { transform: scale(1.035); } }
@keyframes splash-glow { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes splash-slide { from { left: -40%; } to { left: 100%; } }

/* on a computer: the code to scan and the steps for Android and iPhone */
.desktop { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 32px 16px;
  background: radial-gradient(900px 520px at 20% -10%, rgba(59, 130, 246, .16), transparent 60%), radial-gradient(700px 420px at 100% 10%, rgba(168, 85, 247, .10), transparent 60%), var(--bg); }
.desk-card { width: 100%; max-width: 880px; padding: 28px; border-radius: 22px; background: var(--card); border: 1px solid var(--border); box-shadow: 0 24px 60px rgba(0, 0, 0, .35); display: flex; flex-direction: column; gap: 24px; }
.desk-head { display: flex; align-items: center; gap: 18px; }
.desk-head h1 { font-size: 28px; }
.desk-head p { margin: 6px 0 0; max-width: 560px; }
.desk-logo { width: 72px; height: 72px; flex: none; border-radius: 18px; box-shadow: 0 8px 24px rgba(59, 130, 246, .25); }
.desk-grid { display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: start; }
.desk-qr { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.qr-box { padding: 10px; border-radius: 16px; background: #fff; line-height: 0; }
.desk-address { display: flex; align-items: center; gap: 8px; max-width: 300px; }
.desk-address code { min-width: 0; overflow-wrap: anywhere; user-select: all; padding: 8px 10px; border-radius: 10px; background: var(--card-2); font-size: 13px; }
.desk-steps h2 { margin: 0 0 10px; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.desk-steps h2 + ol + h2 { margin-top: 22px; }
.desk-steps ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.desk-steps li { display: flex; align-items: flex-start; gap: 12px; }
.step-n { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; background: rgba(59, 130, 246, .16); color: var(--accent-text); font-weight: 700; font-size: 13px; }
.desk-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--border); }
.desk-foot .seg { width: 220px; }
.link-btn { border: 0; background: transparent; color: var(--text-2); cursor: pointer; font-size: 14px; padding: 8px 4px; }
.link-btn:hover { color: var(--accent-text); }
.login .link-btn { align-self: center; }
@media (max-width: 720px) {
  .desk-card { padding: 20px; }
  .desk-grid { grid-template-columns: 1fr; }
  .desk-head { flex-direction: column; text-align: center; }
}

/* the sign-in screen */
.login {
  min-height: 100%; max-width: 440px; margin: 0 auto; padding: calc(40px + env(safe-area-inset-top)) 20px 32px;
  display: flex; flex-direction: column; gap: 16px; justify-content: center; text-align: center;
}
.login .logo { width: 88px; height: 88px; margin: 0 auto; border-radius: 22px; }
.login .stack { text-align: left; }
.login form.row input { flex: 1; }
.login .seg { max-width: 240px; margin: 0 auto; }
.provider { background: var(--card-2); color: var(--text); justify-content: flex-start; }

/* the shell: the screen scrolls, the tabs stay at the bottom */
body.signed-in { display: flex; flex-direction: column; height: 100dvh; }
#view { flex: 1; overflow-y: auto; padding-bottom: 16px; -webkit-overflow-scrolling: touch; }
body.in-chat #view { overflow: hidden; padding: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(14px + env(safe-area-inset-top)) 12px 8px 16px; }
.tabs {
  display: flex; border-top: 1px solid var(--border); background: var(--bg-2);
  padding-bottom: env(safe-area-inset-bottom);
}
body.in-chat .tabs { display: none; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; color: var(--text-2); font-size: 11px; }
.tab.active { color: var(--accent-text); }
.tab-icon { position: relative; font-size: 20px; }
.tab-badge { display: none; position: absolute; top: -4px; left: 14px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.tab-badge.on { display: block; }
.offline-bar { padding: 6px 12px; padding-top: calc(6px + env(safe-area-inset-top)); background: var(--amber); color: #111; font-size: 13px; text-align: center; }
.install { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 6px 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); background: var(--card-2); border-bottom: 1px solid var(--border); font-size: 14px; }
.install + * .top, .install ~ #view .top { padding-top: 14px; }

/* lists */
.list { list-style: none; margin: 0; padding: 0 8px; }
.item { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px; border-radius: 14px; color: var(--text); }
a.item:active, label.item:active { background: var(--card-2); }
.name { font-weight: 600; display: flex; align-items: center; gap: 6px; min-width: 0; }
.tag { color: var(--accent-text); font-weight: 700; font-size: 13px; }
.tag.big { font-size: 16px; }
.badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; line-height: 22px; text-align: center; }
.badge.mention { background: var(--gold); color: #111; }
.banner { display: flex; align-items: center; gap: 10px; margin: 0 16px 8px; padding: 12px 14px; border-radius: 14px; background: var(--card-2); color: var(--text); font-weight: 600; }
.card { margin: 10px 12px; padding: 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--border); }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 24px; text-align: center; color: var(--text-2); }
.empty-state > i { font-size: 40px; opacity: .5; }

/* avatars with the status dot */
.avatar { position: relative; flex: none; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--card-2); color: var(--text-2); font-weight: 700; }
.avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; image-rendering: pixelated; }
.avatar.square { border-radius: 12px; }
.avatar.clan { color: var(--accent-text); }
.dot { position: absolute; right: -1px; bottom: -1px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--bg); background: var(--text-2); }
.dot.online { background: var(--green); }
.dot.ingame { background: var(--accent); }
.dot.away { background: var(--amber); }
.dot.busy { background: var(--danger); }
.dot.offline { background: #6b7280; }
/* on the phone app: a small phone in the status' colour instead of the dot */
.dot.mobile { display: grid; place-items: center; width: 16px; height: 18px; right: -3px; bottom: -3px; border: 0; border-radius: 5px; background: var(--bg); color: var(--green); font-size: 13px; }
.dot.mobile.away { color: var(--amber); }
.dot.mobile.busy { color: var(--danger); }

/* the clan and communities */
.clan-card .members { display: flex; gap: 12px; overflow-x: auto; margin-top: 12px; padding-bottom: 4px; }
.member { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 56px; flex: none; }
.member .small { max-width: 56px; }
.channels { list-style: none; margin: 10px 0 0; padding: 0; }
.channel { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 8px; border-radius: 10px; color: var(--text); }
.channel:active { background: var(--card-2); }
.channel > i { width: 18px; text-align: center; color: var(--text-2); }

/* the chat */
.chat { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: calc(6px + env(safe-area-inset-top)) 6px 6px; border-bottom: 1px solid var(--border); background: var(--bg-2); }
.chat-head h1 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head .avatar { width: 36px; height: 36px; }
.chat .scroll { flex: 1; overflow-y: auto; padding: 8px 10px; overscroll-behavior: contain; }
.messages { display: flex; flex-direction: column; gap: 3px; }
.msg { max-width: 82%; align-self: flex-start; padding: 7px 11px 5px; border-radius: 16px 16px 16px 6px; background: var(--theirs); overflow-wrap: anywhere; }
.msg.mine { align-self: flex-end; border-radius: 16px 16px 6px 16px; background: var(--mine); color: var(--mine-text); }
.msg.mine a { color: inherit; text-decoration: underline; }
.msg.mention { box-shadow: inset 3px 0 0 var(--gold); background: var(--mention); }
.msg .author { font-size: 12px; font-weight: 700; color: var(--accent-text); margin-bottom: 1px; }
.msg .text { white-space: pre-wrap; }
.msg .text.unreadable { font-style: italic; opacity: .75; }
.msg .meta { font-size: 11px; opacity: .65; text-align: right; margin-top: 2px; }
.msg + .msg:not(.mine), .msg.mine + .msg.mine { margin-top: 0; }
.day { align-self: center; margin: 10px 0 4px; padding: 2px 10px; border-radius: 999px; background: var(--card-2); }
.event { align-self: center; text-align: center; margin: 4px 0; }
.typing { min-height: 18px; padding: 2px 4px; }
.more-btn { display: block; margin: 4px auto 8px; padding: 6px 12px; border: 0; border-radius: 999px; background: var(--card-2); color: var(--text-2); font-size: 13px; cursor: pointer; }
.invite-card { display: flex; gap: 10px; align-items: flex-start; }
.invite-card > i { font-size: 20px; margin-top: 3px; }
.picture { border: 0; padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, .15); cursor: pointer; }
.picture-img { display: block; max-width: 100%; max-height: 360px; border-radius: 10px; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--bg-2); }
.composer textarea { min-height: 44px; max-height: 140px; resize: none; border-radius: 22px; padding: 11px 16px; line-height: 1.3; }
.composer .send { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--accent); color: #fff; font-size: 17px; cursor: pointer; }
.composer p { flex: 1; margin: 6px 0; }

/* GIFs and stickers (gif.js) */
.composer .gif-btn { flex: none; height: 44px; padding: 0 10px; border: 1px solid var(--border); border-radius: 22px; background: var(--card-2); color: var(--text); font: 800 12px/1 inherit; letter-spacing: .04em; cursor: pointer; }
.gif-btn.hidden { display: none; }
.msg.has-gif { padding: 4px 4px 3px; }
.msg.has-sticker { padding: 0; background: transparent; }
.msg.has-gif .text { white-space: normal; }
.msg.has-gif .meta { padding: 0 6px; }
.gif-card { position: relative; display: block; padding: 0; border: 0; background: transparent; cursor: pointer; line-height: 0; }
.gif-card img { display: block; max-width: 100%; height: auto; border-radius: 12px; background: rgba(0, 0, 0, .2); }
.gif-card.sticker img { background: transparent; border-radius: 0; }
.gif-tag { position: absolute; left: 6px; top: 6px; padding: 1px 5px; border-radius: 4px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 10px; font-weight: 800; line-height: 1.4; }
.gif-sheet { height: 80dvh; overflow: hidden; }
.gif-sheet .seg { flex: 1; margin-right: 8px; }
.gif-sheet .seg button { flex: 1; }
.gif-sheet input[type="search"] { width: 100%; }
.gif-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.gif-grid { columns: 2; column-gap: 6px; }
.gif-item { display: block; width: 100%; margin: 0 0 6px; padding: 0; border: 0; border-radius: 10px; overflow: hidden; break-inside: avoid; background: var(--card-2); cursor: pointer; line-height: 0; }
.gif-item.sticker { background: transparent; }
.gif-item img { width: 100%; height: auto; display: block; }
.gif-item:disabled { opacity: .5; }
.gif-attribution { font-size: 11px; font-weight: 700; letter-spacing: .03em; text-align: right; color: var(--text-2); }
.gif-big { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; background: rgba(0, 0, 0, .85); }
.gif-big img { max-width: 100%; max-height: 80dvh; min-width: min(280px, 100%); border-radius: 10px; }

/* the bottom sheet */
.sheet-back { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; background: rgba(0, 0, 0, .45); }
.sheet { width: 100%; max-height: 85dvh; overflow-y: auto; padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; background: var(--card); display: flex; flex-direction: column; gap: 12px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet h2 { margin: 0; text-transform: none; letter-spacing: 0; font-size: 18px; color: var(--text); }
.sheet .code { font-size: 32px; font-weight: 700; letter-spacing: .12em; text-align: center; }
/* the app's questions (confirmSheet in ui.js): the sheet slides up, the buttons share the width */
.confirm-back { z-index: 40; animation: confirm-fade .18s ease-out; }
.confirm-sheet { gap: 14px; padding-top: 20px; border-top: 1px solid var(--border); animation: confirm-up .24s cubic-bezier(.16, 1, .3, 1); }
.confirm-sheet h2 { overflow-wrap: anywhere; }
.confirm-text { margin: 0; color: var(--text-2); overflow-wrap: anywhere; }
.confirm-actions { display: flex; gap: 10px; }
.confirm-actions .btn { flex: 1; }
.confirm-actions .btn:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.btn.danger { background: var(--danger); color: #fff; }
@keyframes confirm-fade { from { opacity: 0; } }
@keyframes confirm-up { from { transform: translateY(100%); } }
.pick { display: flex; flex-direction: column; max-height: 45dvh; overflow-y: auto; }
.pick input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--accent); }

/* settings and achievements */
.switch-row { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.switch-row input { appearance: none; position: relative; width: 48px; height: 28px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--border); cursor: pointer; transition: background .15s; flex: none; }
.switch-row input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.switch-row input:checked { background: var(--accent); }
.switch-row input:checked::after { transform: translateX(20px); }
.achievements { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.achievement { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; background: var(--card-2); }
.achievement:not(.done) { opacity: .8; }
.ach-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--bg-2); color: var(--text-2); }
.achievement.done .ach-icon { color: var(--gold); }
.achievement progress { width: 100%; height: 6px; margin-top: 6px; accent-color: var(--accent); }
.sparks { color: var(--gold); font-weight: 700; font-size: 14px; white-space: nowrap; }

/* toasts */
.toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 30; max-width: calc(100% - 32px); transform: translate(-50%, 20px);
  padding: 10px 16px; border-radius: 12px; background: #1f2937; color: #fff; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); }

@media (min-width: 720px) {
  body.signed-in { max-width: 560px; margin: 0 auto; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
}
@media (prefers-reduced-motion: reduce) {
  .toast, .switch-row input, .switch-row input::after { transition: none; }
  .confirm-back, .confirm-sheet { animation: none; }
  .splash-logo, .splash-logo::before, .splash-logo img, .splash-name, .splash-bar, .splash-bar span { animation: none; }
  .splash-bar span { left: 30%; }
}
