:root {
  --bg-0: #0f1012;
  --bg-1: #16171a;
  --bg-2: #1d1e22;
  --bg-3: #26282d;
  --bg-4: #31343a;
  --hover: rgba(255, 255, 255, .045);
  --active: rgba(255, 255, 255, .085);
  --line: rgba(255, 255, 255, .07);
  --text: #e8e9ec;
  --text-2: #b6b9c0;
  --muted: #7f838c;
  --accent: #ff6b3d;
  --accent-2: #ff8f66;
  --accent-soft: rgba(255, 107, 61, .14);
  --green: #2fd27c;
  --red: #f2545b;
  --yellow: #f5c84b;
  --radius: 10px;
  --shadow: 0 12px 40px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg-2);
  color: var(--text);
  font: 15px/1.4 system-ui, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: #6cb6ff; }
.hidden { display: none !important; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #34363c; border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: var(--text-2);
  transition: background .12s, color .12s, transform .08s;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.sm { width: 22px; height: 22px; border-radius: 6px; }
.icon-btn.sm .ic { width: 15px; height: 15px; }
.icon-btn.off { color: var(--red); }
.icon-btn.on { color: var(--green); background: rgba(47, 210, 124, .1); }
.icon-btn.danger:hover { color: #fff; background: var(--red); }

.btn {
  border: 0; border-radius: 8px; padding: 9px 16px; font-weight: 600;
  background: var(--bg-4); color: var(--text); transition: filter .12s, transform .08s;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.danger { background: var(--red); color: #fff; }
.btn.big { width: 100%; padding: 12px; font-size: 16px; }
.btn:disabled { opacity: .6; cursor: default; }
.chip {
  border: 0; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent-2);
}
.chip:hover { background: var(--accent); color: #fff; }

/* ------------------------------------------------------------ giriş */
.login { position: fixed; inset: 0; display: flex; background: var(--bg-0); overflow-x: hidden; overflow-y: auto; padding: 16px; }
.blob { position: fixed; border-radius: 50%; filter: blur(80px); opacity: .55; animation: drift 18s ease-in-out infinite alternate; }
.b1 { width: 420px; height: 420px; background: #ff6b3d; top: -120px; left: -80px; }
.b2 { width: 360px; height: 360px; background: #8b6cff; bottom: -120px; right: -60px; animation-delay: -6s; }
.b3 { width: 260px; height: 260px; background: #22c3d6; top: 40%; left: 55%; opacity: .3; animation-delay: -12s; }
@keyframes drift { to { transform: translate(60px, 40px) scale(1.15); } }
.login-card {
  position: relative; width: min(400px, 100%); margin: auto; padding: 32px 28px 24px;
  background: rgba(22, 23, 26, .82); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 14px; animation: pop-in .35s cubic-bezier(.2, 1.4, .4, 1);
}
.login-card.shake { animation: shake .4s; }
.logo {
  width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 2px; display: grid; place-items: center;
  font-size: 34px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--accent), #ff3d7a);
  box-shadow: 0 10px 30px rgba(255, 107, 61, .4);
}
.login h1 { margin: 0; text-align: center; font-size: 28px; letter-spacing: -.5px; }
.login .sub { margin: -10px 0 6px; text-align: center; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .4px; }
.field input, .field select, .modal input[type=text], .modal select {
  width: 100%; padding: 11px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg-0); outline: none; transition: border-color .12s, box-shadow .12s;
}
.field input:focus, .modal input:focus, .modal select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.colors { display: flex; flex-wrap: wrap; gap: 7px; }
.colors button {
  width: 26px; height: 26px; border-radius: 50%; border: 0; padding: 0;
  box-shadow: 0 0 0 2px transparent; transition: transform .12s, box-shadow .12s;
}
.colors button:hover { transform: scale(1.12); }
.colors button.sel { box-shadow: 0 0 0 2px var(--bg-1), 0 0 0 4px #fff; }
.err { min-height: 18px; color: var(--red); font-size: 13px; text-align: center; }

@keyframes pop-in { from { opacity: 0; transform: scale(.94) translateY(8px); } }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); } 40%, 60% { transform: translateX(7px); }
}

/* ------------------------------------------------------------ yerleşim */
.app { display: grid; grid-template-columns: auto minmax(0, 1fr) 240px; height: 100vh; height: 100dvh; }
.app.no-members, .app.home { grid-template-columns: auto minmax(0, 1fr) 0; }
.app.no-members .members, .app.home .members { display: none; }
.app.shake { animation: shake .5s; }
.nav { display: flex; min-height: 0; height: 100%; }
.sidebar { width: 248px; background: var(--bg-1); display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg-2); }
.members { background: var(--bg-1); overflow-y: auto; padding: 16px 8px; border-left: 1px solid var(--line); }
.scrim { display: none; }
.mobile-only { display: none; }

.server-head {
  height: 52px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); font-weight: 800; font-size: 16px;
}
.server-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan-scroll { flex: 1; overflow-y: auto; padding: 8px 8px 16px; }
.chan-group { margin-top: 12px; }
.chan-group-head {
  display: flex; align-items: center; justify-content: space-between; padding: 0 4px 4px 8px;
  font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--muted);
}
.chan {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px; margin: 1px 0; border-radius: 7px;
  color: var(--muted); cursor: pointer; user-select: none; position: relative; transition: background .1s, color .1s;
}
.chan .ic { width: 18px; height: 18px; opacity: .8; }
.chan:hover { background: var(--hover); color: var(--text-2); }
.chan.active { background: var(--active); color: var(--text); }
.chan.unread { color: var(--text); font-weight: 600; }
.chan.unread::before { content: ""; position: absolute; left: -8px; width: 4px; height: 8px; border-radius: 0 4px 4px 0; background: #fff; }
.chan .cname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan .badge { background: var(--red); color: #fff; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 1px 6px; }
.chan.voice.joined { color: var(--green); }
.chan .count { font-size: 11px; color: var(--muted); }
.vmember {
  display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 34px; margin: 1px 0;
  border-radius: 7px; color: var(--text-2); font-size: 14px; cursor: pointer;
}
.vmember:hover { background: var(--hover); }
.vmember .vname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vmember .vicons { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.vmember .vicons .ic { width: 15px; height: 15px; color: var(--red); }
.vmember.connecting .vname { opacity: .55; }
.vmember .warn { color: var(--yellow); font-weight: 900; font-size: 13px; }
.live { background: var(--red); color: #fff; font-size: 10px; font-weight: 800; padding: 1px 5px; border-radius: 4px; letter-spacing: .3px; }

.avatar {
  border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none;
  user-select: none; text-shadow: 0 1px 2px rgba(0, 0, 0, .25); position: relative;
  box-shadow: 0 0 0 0 transparent; transition: box-shadow .12s;
}
.speaking .avatar, .avatar.speaking { box-shadow: 0 0 0 2px var(--bg-1), 0 0 0 4px var(--green); }

.voice-panel {
  flex: none; display: flex; align-items: center; gap: 4px; padding: 10px 8px 8px 14px;
  border-top: 1px solid var(--line); background: var(--bg-1);
}
.vp-info { flex: 1; min-width: 0; }
.vp-status { color: var(--green); font-weight: 700; font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.vp-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.vp-status.warn { color: var(--yellow); }
.vp-status.bad { color: var(--red); }
.vp-chan { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.user-panel { flex: none; display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 10px; background: var(--bg-0); }
.user-panel .avatar { width: 34px; height: 34px; font-size: 14px; }
.me-name { flex: 1; min-width: 0; }
.me-name > div:first-child { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-sub { font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------ sohbet */
.chat-head {
  height: 52px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 16px;
  border-bottom: 1px solid var(--line); background: var(--bg-2); z-index: 2;
}
.head-hash { color: var(--muted); display: grid; }
.chan-title { font-weight: 800; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spacer { flex: 1; }
.conn-badge { background: var(--red); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; animation: pulse 1.4s infinite; white-space: nowrap; }
@keyframes pulse { 50% { opacity: .6; } }

.messages-wrap { flex: 1; position: relative; min-height: 0; display: flex; }
.messages { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 0 10px; overscroll-behavior: contain; }
.intro { padding: 28px 16px 12px; }
.intro .big-hash { width: 68px; height: 68px; border-radius: 50%; background: var(--bg-4); display: grid; place-items: center; margin-bottom: 10px; }
.intro .big-hash .ic { width: 38px; height: 38px; }
.intro h2 { margin: 0 0 4px; font-size: 28px; }
.intro p { margin: 0; color: var(--muted); }
.loader { text-align: center; color: var(--muted); padding: 12px; font-size: 13px; }
.day { display: flex; align-items: center; gap: 10px; margin: 18px 16px 4px; color: var(--muted); font-size: 12px; font-weight: 700; }
.day::before, .day::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.msg { position: relative; padding: 3px 56px 3px 72px; margin-top: 14px; min-height: 22px; }
.msg.cont { margin-top: 0; }
.msg:hover, .msg.active { background: rgba(0, 0, 0, .14); }
.msg.new { animation: msg-in .28s cubic-bezier(.2, 1.2, .4, 1); }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } }
.msg.flash { animation: flash 1.4s; }
@keyframes flash { 0%, 40% { background: var(--accent-soft); } }
.msg.mention { background: rgba(245, 200, 75, .07); }
.msg.mention::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--yellow); }
.msg > .avatar { position: absolute; left: 16px; top: 5px; width: 40px; height: 40px; font-size: 17px; cursor: pointer; }
.msg.has-reply > .avatar { top: 26px; }
.msg .head { display: flex; align-items: baseline; gap: 8px; }
.msg .name { font-weight: 700; cursor: pointer; }
.msg .name:hover { text-decoration: underline; }
.msg .time { font-size: 11.5px; color: var(--muted); }
.msg .time.side { position: absolute; left: 0; width: 72px; text-align: center; top: 6px; font-size: 10.5px; opacity: 0; }
.msg.cont:hover .time.side { opacity: 1; }
.msg .text { overflow-wrap: anywhere; color: #dfe1e5; }
.msg .text.jumbo { font-size: 44px; line-height: 1.15; }
.msg .edited { font-size: 11px; color: var(--muted); margin-left: 4px; }
.msg code { background: var(--bg-0); padding: 1px 5px; border-radius: 4px; font-family: ui-monospace, Consolas, monospace; font-size: 13.5px; }
.msg pre { background: var(--bg-0); padding: 10px 12px; border-radius: 8px; overflow-x: auto; margin: 4px 0; border: 1px solid var(--line); }
.msg pre code { background: none; padding: 0; }
.mention-tag { background: var(--accent-soft); color: var(--accent-2); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.spoiler { background: #0c0d0f; color: transparent; border-radius: 4px; cursor: pointer; transition: color .15s; }
.spoiler.open { color: inherit; background: var(--bg-4); }
.att { display: block; max-width: min(440px, 100%); max-height: 360px; border-radius: 10px; margin-top: 6px; cursor: zoom-in; background: var(--bg-3); }
.yt { position: relative; width: min(440px, 100%); aspect-ratio: 16 / 9; margin-top: 6px; border-radius: 10px; overflow: hidden; cursor: pointer; background: #000; }
.yt img { width: 100%; height: 100%; object-fit: cover; opacity: .85; transition: opacity .15s; }
.yt:hover img { opacity: 1; }
.yt .play { position: absolute; inset: 0; margin: auto; width: 64px; height: 44px; border-radius: 12px; background: rgba(255, 0, 0, .9); display: grid; place-items: center; color: #fff; font-size: 20px; }
.yt iframe { width: 100%; height: 100%; border: 0; }
.reply-ref { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 2px; cursor: pointer; overflow: hidden; white-space: nowrap; }
.reply-ref::before { content: ""; width: 28px; height: 10px; margin-left: -40px; margin-right: 4px; border-left: 2px solid var(--bg-4); border-top: 2px solid var(--bg-4); border-top-left-radius: 6px; flex: none; transform: translateY(4px); }
.reply-ref .rname { font-weight: 700; flex: none; }
.reply-ref .rtext { overflow: hidden; text-overflow: ellipsis; }
.reply-ref:hover .rtext { color: var(--text); }
.reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.react {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 8px;
  border: 1px solid transparent; background: var(--bg-3); font-size: 14px; transition: transform .1s;
}
.react b { font-size: 12.5px; color: var(--text-2); }
.react:hover { border-color: var(--bg-4); }
.react.me { background: var(--accent-soft); border-color: var(--accent); }
.react.me b { color: var(--accent-2); }
.react.bump { animation: bump .3s; }
@keyframes bump { 50% { transform: scale(1.25); } }
.actions {
  position: absolute; right: 14px; top: -16px; display: none; gap: 1px; padding: 2px;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); z-index: 3;
}
.msg:hover .actions, .msg.active .actions { display: flex; }
.actions button { width: 30px; height: 30px; border: 0; border-radius: 7px; background: none; color: var(--text-2); display: grid; place-items: center; font-size: 16px; padding: 0; }
.actions button:hover { background: var(--hover); color: var(--text); }
.actions button.danger:hover { color: var(--red); }
.actions .ic { width: 17px; height: 17px; }

.new-pill {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); border: 0; border-radius: 999px;
  padding: 6px 14px; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; box-shadow: var(--shadow);
  animation: pop-in .2s;
}

.composer { flex: none; padding: 0 16px 6px; }
.reply-bar {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px 7px 14px; font-size: 13px; color: var(--text-2);
  background: var(--bg-1); border-radius: 10px 10px 0 0; margin-bottom: -4px; padding-bottom: 11px;
}
.reply-bar span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-bar b { color: var(--text); }
.composer-row {
  position: relative; display: flex; align-items: flex-end; gap: 2px; padding: 5px 6px;
  background: var(--bg-3); border-radius: 12px; border: 1px solid transparent; transition: border-color .12s;
}
.composer-row:focus-within { border-color: rgba(255, 255, 255, .08); }
.composer textarea {
  flex: 1; min-width: 0; resize: none; border: 0; outline: none; background: none; max-height: 40vh;
  padding: 7px 4px; line-height: 1.4; overflow-y: auto;
}
.composer textarea::placeholder { color: var(--muted); }
.send { color: var(--accent); }
.typing { height: 20px; font-size: 12.5px; color: var(--text-2); padding: 2px 4px 0; display: flex; align-items: center; gap: 6px; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--text-2); animation: dot 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

/* ------------------------------------------------------------ ekran paylaşımı */
.stage {
  flex: none; display: grid; gap: 6px; padding: 6px; height: min(52vh, 560px); background: #000;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); grid-auto-rows: 1fr; resize: vertical; overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.tile { position: relative; background: #08090a; border-radius: 10px; overflow: hidden; min-height: 0; animation: pop-in .25s; }
.tile video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.tile .label { position: absolute; left: 8px; bottom: 8px; display: flex; align-items: center; gap: 6px; background: rgba(0, 0, 0, .65); padding: 3px 8px; border-radius: 6px; font-size: 13px; font-weight: 600; }
.tile .full { position: absolute; right: 6px; top: 6px; background: rgba(0, 0, 0, .55); color: #fff; opacity: 0; transition: opacity .15s; }
.tile:hover .full { opacity: 1; }

/* ------------------------------------------------------------ üyeler */
.mem-head { padding: 0 8px 6px; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.member { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.member:hover { background: var(--hover); }
.member .avatar { width: 32px; height: 32px; font-size: 14px; }
.member.offline { opacity: .45; }
.member.offline:hover { opacity: .8; }
.crown { font-size: 12px; }
.member .mtext { min-width: 0; }
.member .mname { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member .msub { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.member .msub .ic { width: 12px; height: 12px; }

/* ------------------------------------------------------------ açılır pencereler */
.pop {
  position: fixed; z-index: 50; min-width: 200px; max-width: min(340px, calc(100vw - 16px)); padding: 6px;
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  animation: pop-in .14s;
}
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 240px; overflow-y: auto; }
.emoji-grid button { border: 0; background: none; font-size: 22px; padding: 4px; border-radius: 6px; line-height: 1; }
.emoji-grid button:hover { background: var(--hover); transform: scale(1.15); }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 8px 10px; border-radius: 7px; text-align: left; font-size: 14px; }
.menu-item:hover { background: var(--accent); color: #fff; }
.menu-item.danger { color: var(--red); }
.menu-item.danger:hover { background: var(--red); color: #fff; }
.menu-item .ic { width: 17px; height: 17px; }
.pop-user { display: flex; align-items: center; gap: 12px; padding: 8px 8px 10px; }
.pop-user .avatar { width: 48px; height: 48px; font-size: 20px; }
.pop-user .pname { font-weight: 800; font-size: 16px; }
.pop-user .psub { font-size: 12.5px; color: var(--muted); }
.pop-row { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; font-size: 13px; color: var(--text-2); }
.pop-row .vval { float: right; color: var(--text); font-weight: 700; }
input[type=range] { width: 100%; accent-color: var(--accent); }

.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .6); animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal-card {
  width: min(460px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; background: var(--bg-1);
  border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); animation: pop-in .2s;
}
.modal-card h3 { margin: 0; padding: 20px 20px 4px; font-size: 19px; }
.modal-body { padding: 10px 20px 4px; display: flex; flex-direction: column; gap: 14px; color: var(--text-2); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 20px 18px; }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; padding: 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-0); display: flex; align-items: center; justify-content: center; gap: 8px; }
.seg button.sel { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-2); }
.check { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text); cursor: pointer; }
.check input { width: 40px; height: 22px; appearance: none; -webkit-appearance: none; background: var(--bg-4); border-radius: 999px; position: relative; cursor: pointer; transition: background .15s; flex: none; }
.check input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.check input:checked { background: var(--green); }
.check input:checked::after { transform: translateX(18px); }
.section-title { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-top: 6px; }
.meter { height: 8px; border-radius: 99px; background: var(--bg-0); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--yellow)); transition: width .06s; }
.hint { font-size: 12.5px; color: var(--muted); }

.toasts { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { pointer-events: auto; padding: 10px 16px; border-radius: 10px; background: var(--bg-4); box-shadow: var(--shadow); font-weight: 600; font-size: 14px; animation: toast-in .25s cubic-bezier(.2, 1.4, .4, 1); }
.toast.err { background: var(--red); color: #fff; }
.toast.ok { background: var(--green); color: #062b17; }
.toast.nudge { background: linear-gradient(135deg, var(--accent), #ff3d7a); color: #fff; font-size: 16px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-14px) scale(.95); } }

.lightbox { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .88); display: grid; place-items: center; cursor: zoom-out; animation: fade .15s; padding: 16px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; animation: pop-in .2s; }
.drop-zone { position: fixed; inset: 0; z-index: 75; background: rgba(255, 107, 61, .18); display: grid; place-items: center; pointer-events: none; }
.drop-zone div { padding: 36px 48px; border: 3px dashed var(--accent); border-radius: 20px; background: var(--bg-1); font-size: 20px; font-weight: 800; }

/* ------------------------------------------------------------ mobil */
@media (max-width: 860px) {
  .app, .app.no-members, .app.home { grid-template-columns: minmax(0, 1fr); }
  .mobile-only { display: inline-grid; }
  .nav {
    position: fixed; inset: 0 auto 0 0; z-index: 40; height: auto;
    transform: translateX(-102%); transition: transform .24s cubic-bezier(.2, .9, .3, 1); box-shadow: var(--shadow);
  }
  .sidebar { width: min(260px, calc(88vw - 72px)); }
  .members, .app.no-members .members {
    display: block; position: fixed; inset: 0 0 0 auto; width: min(270px, 80vw); z-index: 40;
    transform: translateX(102%); transition: transform .24s cubic-bezier(.2, .9, .3, 1);
  }
  .app.show-side .nav, .app.show-members .members { transform: none; }
  .friends-page { padding: 12px; }
  .fr-acts .round-btn { width: 34px; height: 34px; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, .5); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .app.show-side .scrim, .app.show-members .scrim { opacity: 1; pointer-events: auto; }
  .msg { padding-right: 12px; padding-left: 64px; }
  .msg > .avatar { left: 12px; width: 38px; height: 38px; }
  .msg .time.side { width: 64px; }
  .actions { right: 8px; }
  .composer { padding: 0 8px calc(4px + env(safe-area-inset-bottom)); }
  .stage { height: 34vh; grid-template-columns: 1fr; }
  .conn-badge { font-size: 11px; }
}
@media (hover: none) {
  .msg:hover { background: none; }
  .msg:hover .actions { display: none; }
  .msg.active { background: rgba(0, 0, 0, .14); }
  .msg.active .actions { display: flex; }
}

/* bağlantı kalitesi çubukları */
.sig { display: inline-flex; align-items: flex-end; gap: 1.5px; height: 12px; margin-left: 2px; cursor: help; }
.sig i { width: 3px; border-radius: 1px; background: var(--bg-4); }
.sig i:nth-child(1) { height: 5px; }
.sig i:nth-child(2) { height: 8px; }
.sig i:nth-child(3) { height: 12px; }
.sig.q3 i { background: var(--green); }
.sig.q2 i:nth-child(-n+2) { background: var(--yellow); }
.sig.q1 i:nth-child(1) { background: var(--red); }
.modal-body .btn { display: flex; align-items: center; justify-content: center; gap: 8px; }
.modal-body .btn .ic { width: 17px; height: 17px; }
/* hesap ekranı */
.auth-tabs { margin-bottom: 2px; }
.auth-tabs button { padding: 9px; font-weight: 700; color: var(--text-2); }
.auth-links { display: flex; justify-content: center; gap: 16px; margin-top: -4px; }
.auth-links:empty, .auth-links:not(:has(.link:not(.hidden))) { display: none; }
.link { border: 0; background: none; padding: 2px; color: var(--accent-2); font-size: 13.5px; font-weight: 600; }
.link:hover { text-decoration: underline; }
.err.ok { color: var(--green); }
.code-input { font-size: 26px !important; letter-spacing: 10px; text-align: center; font-weight: 800; font-family: ui-monospace, Consolas, monospace; }
.modal input[type=password] { width: 100%; padding: 11px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-0); outline: none; }
.pw-box { color: var(--text); }
.pw-box summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.pw-box input { margin-top: 8px; }
/* ------------------------------------------------------------ sunucu şeridi */
.rail { width: 72px; flex: none; background: var(--bg-0); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0; overflow-y: auto; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail-btn {
  width: 48px; height: 48px; flex: none; border-radius: 50%; border: 0; padding: 0; position: relative;
  background: var(--bg-3); color: var(--text); font-weight: 800; font-size: 16px;
  display: grid; place-items: center; transition: border-radius .18s, background .18s, color .18s, transform .1s;
}
.rail-btn::before {
  content: ""; position: absolute; left: -12px; top: 50%; width: 4px; height: 0; border-radius: 0 4px 4px 0;
  background: #fff; transform: translateY(-50%); transition: height .18s;
}
.rail-btn.unread::before { height: 8px; }
.rail-btn:hover::before { height: 20px; }
.rail-btn.active::before { height: 40px; }
.rail-btn:hover, .rail-btn.active { border-radius: 16px; background: var(--gc, var(--accent)); color: #fff; }
.rail-btn:active { transform: translateY(1px); }
.rail-btn .logo-mini { font-size: 22px; font-weight: 900; }
.rail-btn.home { color: var(--accent-2); }
.rail-btn.home:hover, .rail-btn.home.active { background: var(--accent); color: #fff; }
.rail-btn.add { color: var(--green); }
.rail-btn.add:hover { background: var(--green); color: #fff; }
.rail-btn.add .ic { width: 22px; height: 22px; }
.rail-sep { width: 32px; height: 2px; flex: none; background: var(--line); border-radius: 1px; }
.rail-badge {
  position: absolute; right: -4px; bottom: -4px; min-width: 20px; padding: 1px 5px; border-radius: 999px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 800; border: 3px solid var(--bg-0); line-height: 14px;
}
.rail-voice { position: absolute; right: -2px; top: -2px; width: 14px; height: 14px; border-radius: 50%; background: var(--green); border: 3px solid var(--bg-0); }
.server-head #serverName { cursor: pointer; flex: 1; }
.server-head #btnGuildMenu .ic { width: 16px; height: 16px; }

/* çevrimiçi noktası */
.avatar-wrap { position: relative; flex: none; display: inline-grid; }
.pdot { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; background: #5c6069; border: 3px solid var(--bg-1); }
.pdot.on { background: var(--green); }
.chan.big { padding: 9px 8px; font-weight: 600; }
.dm-item {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px; margin: 1px 0; border-radius: 8px;
  color: var(--muted); cursor: pointer; user-select: none; position: relative;
}
.dm-item:hover { background: var(--hover); color: var(--text-2); }
.dm-item.active { background: var(--active); color: var(--text); }
.dm-item.unread { color: var(--text); font-weight: 700; }
.dm-item .cname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-item .badge { background: var(--red); color: #fff; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 1px 6px; }
.in-call { color: var(--green); display: grid; }
.in-call .ic { width: 15px; height: 15px; }
.empty-hint { padding: 8px; color: var(--muted); font-size: 13px; }
.chat-head .icon-btn.on { color: var(--green); background: rgba(47, 210, 124, .12); animation: pulse 1.4s infinite; }

/* ------------------------------------------------------------ arkadaşlar sayfası */
.friends-page { flex: 1; overflow-y: auto; padding: 16px 24px; min-height: 0; }
.fr-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.fr-tabs button { border: 0; background: none; color: var(--text-2); padding: 6px 12px; border-radius: 7px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.fr-tabs button:hover { background: var(--hover); color: var(--text); }
.fr-tabs button.sel { background: var(--active); color: var(--text); }
.fr-tabs .badge { background: var(--red); color: #fff; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 0 6px; }
.fr-tabs .add { background: var(--green); color: #062b17; }
.fr-tabs .add:hover { background: var(--green); filter: brightness(1.1); color: #062b17; }
.fr-tabs .add.sel { background: none; color: var(--green); }
.fr-title { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 4px 8px 8px; }
.fr-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-top: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.fr-row:hover { background: var(--hover); border-top-color: transparent; }
.fr-row:hover + .fr-row { border-top-color: transparent; }
.fr-text { flex: 1; min-width: 0; }
.fr-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-sub { font-size: 12.5px; color: var(--muted); }
.fr-acts { display: flex; gap: 8px; }
.round-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; padding: 0; background: var(--bg-3); color: var(--text-2); display: grid; place-items: center; transition: color .12s, background .12s, transform .08s; }
.round-btn:hover { color: var(--text); background: var(--bg-4); }
.round-btn:active { transform: scale(.92); }
.round-btn.ok:hover { color: var(--green); }
.round-btn.no:hover { color: var(--red); }
.round-btn .ic { width: 18px; height: 18px; }
.round-btn.big { width: 60px; height: 60px; }
.round-btn.big .ic { width: 26px; height: 26px; }
.round-btn.big.ok { background: var(--green); color: #fff; }
.round-btn.big.no { background: var(--red); color: #fff; }
.round-btn.big:hover { filter: brightness(1.12); color: #fff; }
.empty-state { text-align: center; color: var(--muted); padding: 48px 16px; }
.empty-state .empty-ic { width: 72px; height: 72px; border-radius: 50%; background: var(--bg-3); display: grid; place-items: center; margin: 0 auto 14px; }
.empty-state .empty-ic .ic { width: 34px; height: 34px; }
.fr-add h3 { margin: 0 0 4px; font-size: 17px; }
.fr-add p { margin: 0 0 14px; color: var(--text-2); }
.copy-name { cursor: pointer; color: var(--accent-2); }
.fr-add-row { display: flex; gap: 8px; padding: 6px; border-radius: 12px; background: var(--bg-0); border: 1px solid var(--line); max-width: 640px; }
.fr-add-row:focus-within { border-color: var(--accent); }
.fr-add-row input { flex: 1; min-width: 0; border: 0; outline: none; background: none; padding: 8px 10px; font-size: 15px; }
.add-msg { min-height: 20px; margin: 8px 4px; font-size: 13.5px; color: var(--muted); }
.add-msg.ok { color: var(--green); }
.add-msg.err { color: var(--red); }
.fr-tip { display: flex; gap: 12px; align-items: flex-start; margin-top: 20px; padding: 14px; border-radius: 12px; background: var(--bg-1); color: var(--text-2); max-width: 640px; }
.fr-tip .ic { color: var(--accent-2); margin-top: 1px; }

/* ------------------------------------------------------------ özel mesaj girişi ve sistem mesajları */
.intro > .avatar { width: 72px; height: 72px; margin-bottom: 10px; }
.msg.sys { display: flex; align-items: baseline; gap: 10px; padding: 6px 56px 6px 72px; margin-top: 10px; color: var(--text-2); font-size: 14px; }
.msg.sys .sys-text { font-weight: 600; }
.msg.sys:hover { background: none; }

/* ------------------------------------------------------------ aramalar */
.incoming { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .55); animation: fade .2s; }
.inc-card { width: min(340px, 100%); padding: 30px 24px 26px; text-align: center; border-radius: 22px; background: var(--bg-1); border: 1px solid var(--line); box-shadow: var(--shadow); animation: pop-in .25s cubic-bezier(.2, 1.4, .4, 1); }
.inc-av .avatar { margin: 0 auto; animation: ring-pulse 1.3s infinite; }
@keyframes ring-pulse { 0% { box-shadow: 0 0 0 0 rgba(47, 210, 124, .55); } 100% { box-shadow: 0 0 0 26px rgba(47, 210, 124, 0); } }
.inc-name { margin-top: 16px; font-size: 22px; font-weight: 800; }
.inc-sub { color: var(--muted); margin-top: 2px; }
.inc-btns { display: flex; justify-content: center; gap: 18px; margin-top: 22px; }
.stage.call { background: var(--bg-0); height: min(46vh, 480px); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); padding: 12px; gap: 12px; }
.tile.avatar, .tile.ringing { display: grid; place-items: center; background: var(--bg-3); }
.tile-av { border-radius: 50%; }
.tile-av .avatar { transition: box-shadow .12s; }
.tile-av.speaking .avatar { box-shadow: 0 0 0 3px var(--bg-3), 0 0 0 6px var(--green); }
.tile.ringing .tile-av .avatar { opacity: .75; animation: ring-pulse 1.3s infinite; }
.tile.cam video.mirror { transform: scaleX(-1); }
.tile.cam video { object-fit: cover; }
.tile.speaking { box-shadow: inset 0 0 0 3px var(--green); }
.invite-box { padding: 10px 12px; border-radius: 8px; background: var(--bg-0); border: 1px solid var(--line); overflow-wrap: anywhere; font-size: 13px; }
.invite-box code { background: none; }
.toast.announce { background: linear-gradient(135deg, #8b6cff, #4f8cff); color: #fff; font-size: 15px; max-width: min(560px, calc(100vw - 32px)); white-space: pre-wrap; }
