:root {
  color-scheme: dark;
  --bg-0: #0e0f13;
  --bg-1: #14151b;
  --bg-2: #1a1b23;
  --bg-3: #22232d;
  --bg-4: #2c2e3a;
  --line: #2a2b36;
  --text: #ecebf3;
  --text-2: #b4b3c4;
  --muted: #7f7f93;
  --accent: #8b6dff;
  --accent-2: #ff5c8a;
  --accent-soft: rgba(139, 109, 255, 0.16);
  --grad: linear-gradient(135deg, #7c5cff, #ff5c8a);
  --ok: #2fcf86;
  --warn: #f2b33d;
  --danger: #f2545b;
  --live: #ff3d5a;
  --radius: 10px;
  --titlebar: 0px;
  --font: 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
}
html.desktop { --titlebar: 32px; }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg-0);
  color: var(--text);
  font: 15px/1.45 var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: #a995ff; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.ic { flex: none; display: block; }
::selection { background: rgba(139, 109, 255, 0.4); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2f3040; border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: #3d3f52; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------- başlık çubuğu (masaüstü) */
.titlebar {
  display: none;
  height: var(--titlebar);
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: var(--bg-0);
  -webkit-app-region: drag;
  user-select: none;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
}
html.desktop .titlebar { display: flex; }
.titlebar img { width: 16px; height: 16px; }
.titlebar-status { font-weight: 500; color: var(--muted); margin-left: 6px; }

/* ---------------------------------------------------------- açılış ve giriş */
.boot {
  position: fixed;
  inset: var(--titlebar) 0 0 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: var(--bg-0);
  z-index: 50;
}
.boot-logo { width: 72px; height: 72px; animation: pulse 1.6s ease-in-out infinite; }
.boot-text { color: var(--muted); }
@keyframes pulse { 50% { transform: scale(0.92); opacity: 0.7; } }

.login {
  height: calc(100% - var(--titlebar));
  display: grid;
  place-items: center;
  padding: 16px;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(124, 92, 255, 0.25), transparent 60%),
    radial-gradient(900px 600px at 110% 110%, rgba(255, 92, 138, 0.2), transparent 60%),
    var(--bg-0);
}
.login-card {
  width: min(400px, 100%);
  display: grid;
  gap: 14px;
  padding: 32px 28px;
  background: rgba(26, 27, 35, 0.86);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
}
.login-logo { width: 56px; height: 56px; justify-self: center; }
.login-card h1 { margin: 4px 0 0; text-align: center; font-size: 22px; }
.login-card p { margin: -6px 0 6px; text-align: center; }
.login-card label { display: grid; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-2); }
.download-link { text-align: center; font-size: 13px; }
.form-error { color: var(--danger); font-size: 13px; min-height: 18px; }

input[type='text'], input[type='password'], input:not([type]), textarea, select {
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
  font-size: 15px;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
select { padding: 9px 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  background: var(--bg-4);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  transition: filter 0.15s, background 0.15s;
}
.btn:hover { filter: brightness(1.15); }
.btn.primary { background: var(--grad); color: #fff; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.ghost { background: transparent; color: var(--text-2); }
.btn.big { padding: 12px 16px; font-size: 15px; }
.btn:disabled { opacity: 0.5; cursor: default; filter: none; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  flex: none;
}
.icon-btn:hover { background: var(--bg-4); color: var(--text); }
.icon-btn.on { color: var(--danger); }
.icon-btn.active { color: var(--ok); }

/* ---------------------------------------------------------- ana yerleşim */
.app {
  height: calc(100% - var(--titlebar));
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr) 236px;
}
@media (max-width: 1050px) { .app { grid-template-columns: 252px minmax(0, 1fr); } .members { display: none; } }
@media (max-width: 680px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .sidebar { max-height: 42vh; }
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-1);
  border-right: 1px solid var(--line);
}
.server-head {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  font-size: 17px;
}
.server-head img { width: 24px; height: 24px; }
.conn-dot { width: 8px; height: 8px; margin-left: auto; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(47, 207, 134, 0.15); }
.conn-dot.off { background: var(--danger); box-shadow: 0 0 0 3px rgba(242, 84, 91, 0.15); }

.channels { flex: 1; overflow-y: auto; padding: 10px 8px 16px; }
.cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 6px 4px 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.cat:first-child { margin-top: 4px; }
.cat .icon-btn { width: 22px; height: 22px; }
.ch {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-size: 15px;
}
.ch:hover { background: var(--bg-3); color: var(--text-2); }
.ch.active { background: var(--bg-4); color: var(--text); }
.ch.unread { color: var(--text); font-weight: 700; }
.ch.unread::after { content: ''; width: 8px; height: 8px; margin-left: auto; border-radius: 50%; background: var(--accent-2); }
.ch .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch .ch-actions { display: none; margin-left: auto; }
.ch:hover .ch-actions { display: flex; }
.ch .ch-actions .icon-btn { width: 24px; height: 24px; }
.ch.connected { color: var(--ok); }

.vusers { margin: 0 0 6px 28px; display: grid; gap: 1px; }
.vuser {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 6px;
  color: var(--text-2);
  font-size: 14px;
}
.vuser:hover { background: var(--bg-3); }
.vuser .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vuser .flags { display: flex; gap: 4px; color: var(--muted); }
.vuser .flags .ic { width: 15px; height: 15px; }
.badge-live { background: var(--live); color: #fff; font-size: 10px; font-weight: 800; padding: 1px 5px; border-radius: 4px; letter-spacing: 0.04em; }

.avatar {
  --size: 32px;
  position: relative;
  flex: none;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--c, var(--accent));
  color: #fff;
  font-weight: 700;
  font-size: calc(var(--size) * 0.4);
  user-select: none;
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar.sm { --size: 24px; }
.avatar.lg { --size: 40px; }
.avatar.speaking { box-shadow: 0 0 0 2px var(--bg-1), 0 0 0 4px var(--ok); }
.avatar .status {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 3px solid var(--bg-1);
  background: #5d5e6e;
}
.avatar .status.on { background: var(--ok); }

.voice-panel {
  padding: 10px 10px 8px;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}
.vp-head { display: flex; align-items: center; gap: 8px; }
.vp-title { flex: 1; min-width: 0; }
.vp-title strong { display: flex; align-items: center; gap: 6px; color: var(--ok); font-size: 14px; }
.vp-title strong.warn { color: var(--warn); }
.vp-title span { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.vp-actions .btn { padding: 7px; background: var(--bg-3); }
.vp-actions .btn.live { background: rgba(255, 61, 90, 0.18); color: #ff8ea0; }
.vp-actions .btn.active { background: rgba(47, 207, 134, 0.15); color: var(--ok); }

.user-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 10px;
  background: var(--bg-0);
  border-top: 1px solid var(--line);
}
.user-panel .who { flex: 1; min-width: 0; line-height: 1.2; }
.user-panel .who strong { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-panel .who span { font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------- içerik */
.content { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg-2); }
.content-head {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  flex: none;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}
.content-head .title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; min-width: 0; }
.content-head .title .ic { color: var(--muted); }
.content-head .sub { color: var(--muted); font-size: 13px; }
.content-head .spacer { flex: 1; }

.chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.messages { flex: 1; overflow-y: auto; padding: 16px 0 8px; overflow-anchor: none; }
.history-top { padding: 24px 20px 10px; }
.history-top h2 { margin: 8px 0 4px; font-size: 26px; }
.history-top .hash { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-4); }
.loader { text-align: center; color: var(--muted); padding: 12px; font-size: 13px; }

.day-sep { display: flex; align-items: center; gap: 10px; margin: 14px 16px 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.day-sep::before, .day-sep::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 48px 2px 16px;
  margin-top: 14px;
}
.msg.grouped { margin-top: 0; }
.msg:hover { background: rgba(255, 255, 255, 0.025); }
.msg.highlight { background: var(--accent-soft); }
.msg .avatar { grid-row: span 2; margin-top: 2px; cursor: pointer; }
.msg.grouped .avatar { display: none; }
.msg .gutter-time { display: none; font-size: 10.5px; color: var(--muted); text-align: right; padding-top: 4px; }
.msg.grouped .gutter-time { display: block; visibility: hidden; }
.msg.grouped:hover .gutter-time { visibility: visible; }
.msg-head { display: flex; align-items: baseline; gap: 8px; }
.msg-head .author { font-weight: 700; color: var(--c, var(--text)); }
.msg-head time { font-size: 12px; color: var(--muted); }
.msg.grouped .msg-head { display: none; }
.msg-body { grid-column: 2; min-width: 0; }
.msg-text { white-space: normal; overflow-wrap: anywhere; color: #dcdbe6; }
.msg-text.big { font-size: 42px; line-height: 1.2; }
.msg-text .edited { font-size: 11px; color: var(--muted); margin-left: 4px; }
.msg-text code { background: var(--bg-0); padding: 1px 5px; border-radius: 5px; font: 13.5px/1.4 Consolas, 'Cascadia Code', monospace; }
.msg-text pre { background: var(--bg-0); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; margin: 6px 0; }
.msg-text pre code { background: none; padding: 0; }
.msg-text blockquote { margin: 2px 0; padding-left: 10px; border-left: 4px solid var(--bg-4); }
.spoiler { background: #000; color: transparent; border-radius: 4px; cursor: pointer; }
.spoiler.shown { background: var(--bg-4); color: inherit; }
.msg-reply {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 2px 54px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  min-width: 0;
}
.msg-reply::before { content: ''; width: 30px; height: 10px; margin: 6px -2px 0 -36px; border: 2px solid var(--bg-4); border-right: 0; border-bottom: 0; border-top-left-radius: 8px; flex: none; }
.msg-reply .avatar { --size: 16px; font-size: 8px; }
.msg-reply strong { color: var(--c, var(--text-2)); }
.msg-reply span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.msg-tools {
  position: absolute;
  right: 16px;
  top: -14px;
  display: none;
  gap: 2px;
  padding: 2px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  z-index: 2;
}
.msg:hover .msg-tools { display: flex; }
.msg-tools .icon-btn { width: 30px; height: 30px; }
.msg-tools .quick { font-size: 17px; width: 30px; height: 30px; border: 0; background: none; border-radius: 6px; }
.msg-tools .quick:hover { background: var(--bg-4); }

.attachments { display: grid; gap: 6px; margin-top: 4px; justify-items: start; }
.att-img { max-width: min(420px, 100%); max-height: 340px; border-radius: 8px; cursor: zoom-in; display: block; background: var(--bg-3); object-fit: contain; }
.att-video { max-width: min(480px, 100%); max-height: 360px; border-radius: 8px; background: #000; }
.att-file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  min-width: 260px;
  max-width: 420px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
}
.att-file .meta { flex: 1; min-width: 0; }
.att-file .meta strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: #a995ff; }
.att-file .meta span { font-size: 12px; color: var(--muted); }
.att-voice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 8px;
  width: min(340px, 100%);
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 24px;
}
.att-voice .play { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--grad); color: #fff; display: grid; place-items: center; flex: none; }
.att-voice .bar { flex: 1; height: 6px; border-radius: 3px; background: var(--bg-4); position: relative; cursor: pointer; }
.att-voice .bar i { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--accent); width: 0; }
.att-voice time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }

.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.reaction {
  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;
}
.reaction b { font-size: 12.5px; color: var(--text-2); }
.reaction.mine { border-color: var(--accent); background: var(--accent-soft); }

.edit-box { display: grid; gap: 4px; margin-top: 2px; }
.edit-box textarea { resize: none; width: 100%; }
.edit-box small { color: var(--muted); }

.composer-wrap { padding: 0 16px 6px; flex: none; }
.composer {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 6px;
  background: var(--bg-3);
  border-radius: 12px;
}
.composer textarea {
  flex: 1;
  resize: none;
  border: 0;
  background: transparent;
  padding: 7px 4px;
  max-height: 220px;
  line-height: 1.4;
}
.reply-bar, .uploads {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-1);
  border-radius: 12px 12px 0 0;
  font-size: 13px;
  color: var(--text-2);
}
.reply-bar + .uploads { border-radius: 0; }
.reply-bar:not(.hidden) ~ .composer, .uploads:not(.hidden) ~ .composer { border-top-left-radius: 0; border-top-right-radius: 0; }
.reply-bar .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uploads { flex-wrap: wrap; }
.up-chip { position: relative; display: flex; align-items: center; gap: 8px; padding: 6px 30px 6px 8px; background: var(--bg-3); border-radius: 8px; max-width: 240px; overflow: hidden; }
.up-chip img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
.up-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-chip .prog { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--grad); }
.up-chip .icon-btn { position: absolute; right: 2px; top: 50%; translate: 0 -50%; width: 24px; height: 24px; }
.up-chip.error { outline: 1px solid var(--danger); }

.recording { display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin-top: 6px; border-radius: 12px; background: rgba(255, 61, 90, 0.12); color: #ffb3bf; }
.recording .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--live); animation: blink 1s infinite; }
.recording time { font-variant-numeric: tabular-nums; font-weight: 700; }
.recording .grow { flex: 1; }
@keyframes blink { 50% { opacity: 0.3; } }

.typing { height: 20px; padding: 2px 6px 0; font-size: 12.5px; color: var(--text-2); }
.typing b { color: var(--text); }
.typing .dots { display: inline-flex; gap: 3px; margin-right: 6px; vertical-align: middle; }
.typing .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--text-2); animation: bounce 1s infinite; }
.typing .dots i:nth-child(2) { animation-delay: 0.15s; }
.typing .dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 30% { transform: translateY(-3px); opacity: 1; } 0%, 60%, 100% { opacity: 0.5; } }

/* ---------------------------------------------------------- üyeler */
.members { background: var(--bg-1); border-left: 1px solid var(--line); overflow-y: auto; padding: 14px 10px; }
.members h3 { margin: 12px 8px 6px; font-size: 11.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.members h3:first-child { margin-top: 0; }
.member { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; }
.member:hover { background: var(--bg-3); }
.member.off { opacity: 0.45; }
.member .name { font-weight: 600; color: var(--c, var(--text)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member .sub { font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------- sahne (ses kanalı görünümü) */
.stage { flex: 1; display: flex; flex-direction: column; min-height: 0; background: #08090c; }
.tiles {
  flex: 1;
  min-height: 0;
  display: grid;
  gap: 10px;
  padding: 14px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-content: center;
  overflow: auto;
}
.tiles.focus { grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr) 132px; align-content: stretch; }
.tiles.focus .tile.focused { grid-column: 1 / -1; aspect-ratio: auto; }
.tiles.focus .tile:not(.focused) { aspect-ratio: auto; }
.tile {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  background: var(--bg-3);
  overflow: hidden;
  display: grid;
  place-items: center;
  cursor: pointer;
  outline: 3px solid transparent;
  outline-offset: -3px;
  transition: outline-color 0.12s;
}
.tile.speaking { outline-color: var(--ok); }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.tile.camera video { object-fit: cover; }
.tile.self.camera video { transform: scaleX(-1); }
.tile .avatar { --size: 84px; }
.tiles.focus .tile:not(.focused) .avatar { --size: 52px; }
.tile .label {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 20px);
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  font-size: 13px;
  font-weight: 600;
  backdrop-filter: blur(6px);
}
.tile .label .ic { width: 15px; height: 15px; color: var(--danger); }
.tile .tile-tools { position: absolute; right: 8px; top: 8px; display: flex; gap: 6px; opacity: 0; transition: opacity 0.15s; }
.tile:hover .tile-tools { opacity: 1; }
.tile .tile-tools .icon-btn { background: rgba(0, 0, 0, 0.6); color: #fff; }
.tile .tile-tools input[type='range'] { width: 90px; }
.tile .tile-tools .vol { display: flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: 8px; background: rgba(0, 0, 0, 0.6); }
.tile .live-tag { position: absolute; left: 10px; top: 10px; }
.tile .stats { position: absolute; left: 72px; top: 10px; max-width: calc(100% - 170px); padding: 3px 8px; border-radius: 6px; background: rgba(0, 0, 0, 0.6); font-size: 11.5px; color: #cfcfe0; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .stats:empty, .tile:not(.focused):not(:hover) .stats { display: none; }
.tile .waiting { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.tile:fullscreen { border-radius: 0; outline: 0; }

.stage-bar { display: flex; justify-content: center; gap: 12px; padding: 12px 16px 18px; flex: none; flex-wrap: wrap; }
.round {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  background: var(--bg-3);
  color: var(--text);
  transition: filter 0.15s, background 0.15s;
}
.round:hover { filter: brightness(1.2); }
.round.off { background: #3a2026; color: #ff8a93; }
.round.active { background: #e7e6f0; color: #111; }
.round.live { background: var(--live); color: #fff; }
.round.leave { background: var(--danger); color: #fff; width: 64px; border-radius: 26px; }
.round-group { display: flex; align-items: center; background: var(--bg-3); border-radius: 26px; }
.round-group .round { background: transparent; }
.round-group select { background: transparent; border: 0; padding: 0 12px 0 0; color: var(--text-2); font-size: 13px; }

.join-cta { display: grid; place-items: center; gap: 14px; text-align: center; color: var(--text-2); }

.pip {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 320px;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  z-index: 30;
  cursor: pointer;
}
.pip video { width: 100%; height: 100%; object-fit: contain; }
.pip .label { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 6px; background: rgba(0, 0, 0, 0.65); font-size: 12px; }

/* ---------------------------------------------------------- modallar */
.modal-back {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.66);
  z-index: 60;
  animation: fade 0.15s;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.modal.wide { width: min(880px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 10px; }
.modal-head h2 { flex: 1; margin: 0; font-size: 19px; }
.modal-body { padding: 6px 20px 18px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; background: var(--bg-1); border-top: 1px solid var(--line); }
.modal-foot .grow { flex: 1; }

.field { display: grid; gap: 6px; margin: 14px 0; }
.field > span, .field-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-2); }
.field small, .hint { color: var(--muted); font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 10px; }
.row .grow { flex: 1; }
.check { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: 0; }
.check div strong { display: block; font-weight: 600; }
.check div small { color: var(--muted); }

.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; border-radius: 12px; background: #4a4b5c; transition: background 0.15s; cursor: pointer; }
.switch i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(18px); }

input[type='range'] { accent-color: var(--accent); width: 100%; }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-1);
  color: var(--text-2);
  font-weight: 600;
  font-size: 13.5px;
}
.seg button small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.seg button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }

.meter { position: relative; height: 10px; border-radius: 5px; background: var(--bg-0); overflow: hidden; }
.meter i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--ok); border-radius: 5px; transition: width 60ms linear; }
.meter i.closed { background: var(--warn); }
.meter b { position: absolute; top: -2px; bottom: -2px; width: 2px; background: #fff; }

.settings { display: grid; grid-template-columns: 200px minmax(0, 1fr); min-height: min(620px, calc(100vh - 32px)); }
.settings nav { padding: 18px 10px; background: var(--bg-1); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.settings nav button { display: flex; align-items: center; gap: 8px; text-align: left; padding: 8px 12px; border-radius: 7px; border: 0; background: none; color: var(--text-2); font-weight: 600; }
.settings nav button:hover { background: var(--bg-3); }
.settings nav button.on { background: var(--bg-4); color: var(--text); }
.settings nav .sep { height: 1px; margin: 8px 6px; background: var(--line); }
.settings nav .danger { color: var(--danger); }
.settings .pane { padding: 20px 24px; overflow-y: auto; max-height: calc(100vh - 32px); }
.settings .pane h2 { margin: 0 0 6px; font-size: 20px; }
@media (max-width: 680px) { .settings { grid-template-columns: 1fr; } .settings nav { flex-direction: row; overflow-x: auto; } }

.profile-card { display: flex; align-items: center; gap: 16px; padding: 16px; background: var(--bg-1); border-radius: 12px; }
.profile-card .avatar { --size: 72px; }
.colors { display: flex; gap: 8px; flex-wrap: wrap; }
.colors button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; }
.colors button.on { border-color: #fff; }

.sources { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-top: 10px; max-height: 340px; overflow-y: auto; padding: 2px; }
.source { border: 2px solid transparent; border-radius: 10px; padding: 6px; background: var(--bg-1); text-align: left; color: var(--text-2); }
.source img { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #000; border-radius: 6px; display: block; }
.source span { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.source span img { width: 16px; height: 16px; aspect-ratio: auto; background: none; flex: none; }
.source.on { border-color: var(--accent); color: var(--text); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs button { padding: 8px 12px; border: 0; background: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--text); border-color: var(--accent); }

/* ---------------------------------------------------------- açılır menüler */
.popover {
  position: fixed;
  z-index: 70;
  min-width: 200px;
  padding: 6px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}
.popover .item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; background: none; color: var(--text-2); text-align: left; font-size: 14px; }
.popover .item:hover { background: var(--accent); color: #fff; }
.popover .item.danger { color: var(--danger); }
.popover .item.danger:hover { background: var(--danger); color: #fff; }
.popover .label { padding: 6px 10px 2px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.popover .slider { padding: 4px 10px 8px; }
.popover .sep { height: 1px; background: var(--line); margin: 4px 6px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 36px); gap: 2px; max-height: 260px; overflow-y: auto; }
.emoji-grid button { width: 36px; height: 36px; border: 0; border-radius: 6px; background: none; font-size: 21px; }
.emoji-grid button:hover { background: var(--bg-4); }

.toasts { position: fixed; left: 50%; bottom: 24px; translate: -50% 0; display: grid; gap: 8px; z-index: 90; pointer-events: none; }
.toast { padding: 10px 16px; border-radius: 10px; background: var(--bg-4); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); font-size: 14px; animation: rise 0.2s; max-width: min(520px, calc(100vw - 32px)); }
.toast.error { background: #4a1f25; color: #ffc9ce; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.lightbox { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(0, 0, 0, 0.88); cursor: zoom-out; padding: 24px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; }
.lightbox a { position: absolute; right: 20px; bottom: 20px; }

.drop-overlay { position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; background: rgba(124, 92, 255, 0.3); pointer-events: none; }
.drop-overlay div { padding: 28px 40px; border-radius: 18px; background: var(--grad); font-size: 20px; font-weight: 700; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
