:root {
  --bg: #fdf6ec;
  --bg-soft: #fbeede;
  --card: #ffffff;
  --primary: #e8893a;
  --primary-dark: #d2762a;
  --accent: #f6c177;
  --text: #4a3b2f;
  --text-soft: #8a7967;
  --border: #f0e0cd;
  --shadow: 0 6px 24px rgba(180, 130, 70, 0.12);
  --radius: 16px;
}

/* ---------- KARANLIK TEMA (Discord) ---------- */
body.dark {
  --bg: #313338;
  --bg-soft: #2b2d31;
  --card: #2b2d31;
  --primary: #5865f2;
  --primary-dark: #4752c4;
  --accent: #5865f2;
  --text: #dbdee1;
  --text-soft: #949ba4;
  --border: #1f2023;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Quicksand', system-ui, sans-serif;
  background: linear-gradient(160deg, #fdf6ec 0%, #fbeede 100%);
  color: var(--text);
  min-height: 100vh;
  transition: background .25s, color .25s;
}
body.dark { background: #313338; }
body.dark input[type="text"], body.dark input[type="password"] { background: #1e1f22; color: var(--text); border-color: #1e1f22; }
body.dark .msg-quote { background: rgba(255,255,255,.06); }
body.dark .msg.me .msg-quote { background: rgba(0,0,0,.18); }
body.dark .mini-btn, body.dark .load-more { background: var(--card); color: var(--text); }
body.dark .tab.active { color: #1c1714; }
body.dark .attach-btn { background: #221a13; }
body.dark .msg-file { background: rgba(255,255,255,.08); color: var(--accent); }
body.dark .reply-bar { background: var(--bg-soft); }
body.dark .msg-reply { background: rgba(255,255,255,.12); color: var(--text); }
/* Karanlık tema: okundu = parlak mavi, iletildi (tek tik) = açık krem (silik değil) */
body.dark .msg-receipt .tick.read { color: #5cc8ff; }
body.dark .msg-receipt .seen-names { color: #7fd4ff; font-weight: 600; }
body.dark .msg-receipt .tick { color: rgba(255, 248, 238, 0.85); }
body.dark .msg.me .msg-time { color: rgba(255, 248, 238, 0.7); }
body.dark .msg.them .msg-time { color: var(--text-soft); }

.theme-toggle {
  font-size: 18px; line-height: 1; background: transparent; border: none;
  cursor: pointer; padding: 6px 8px; border-radius: 10px; transition: background .15s;
}
.theme-toggle:hover { background: var(--bg-soft); }

.hidden { display: none !important; }

/* ---------- GİRİŞ ---------- */
.login-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 20px;
}
.login-card {
  background: var(--card);
  padding: 40px 34px;
  border-radius: 24px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 380px;
  text-align: center;
}
.login-emoji { font-size: 56px; }
.login-card h1 { font-size: 30px; margin: 6px 0 4px; color: var(--primary-dark); }
.login-sub { color: var(--text-soft); margin-bottom: 24px; font-size: 14px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-foot { color: var(--text-soft); font-size: 13px; max-width: 360px; text-align: center; }

input[type="text"], input[type="password"] {
  font-family: inherit;
  font-size: 15px;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #fffdf9;
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}
input:focus { border-color: var(--accent); }

.btn-primary {
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .12s, filter .12s;
}
.btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  font-family: inherit;
  font-weight: 600;
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text-soft);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s;
}
.btn-ghost:hover { background: var(--bg-soft); }

.form-error { color: #c0392b; font-size: 13px; min-height: 18px; margin-top: 4px; }

/* ---------- ÜST BAR ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: var(--card);
  box-shadow: 0 2px 12px rgba(180,130,70,.08);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-wrap: wrap;
}
.brand { font-weight: 700; font-size: 20px; color: var(--primary-dark); display: flex; align-items: center; gap: 8px; }
.brand-logo { height: 38px; width: 38px; border-radius: 50%; object-fit: cover; display: block; box-shadow: 0 2px 8px rgba(180,130,70,.25); }
.tabs { display: flex; gap: 6px; margin: 0 auto; }
.tab {
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  background: transparent;
  border: none;
  color: var(--text-soft);
  padding: 9px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: all .15s;
}
.tab:hover { background: var(--bg-soft); }
.tab.active { background: var(--accent); color: var(--text); }
.user-box { display: flex; align-items: center; gap: 8px; }
.whoami { font-weight: 600; font-size: 14px; color: var(--text); }

/* ---------- AVATAR ---------- */
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; object-fit: cover; background: var(--accent); color: #fff; font-weight: 700; flex-shrink: 0; overflow: hidden; }
.avatar-letter { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.avatar-xs { width: 26px; height: 26px; font-size: 12px; }
.avatar-sm { width: 30px; height: 30px; font-size: 13px; }
.avatar-lg { width: 96px; height: 96px; font-size: 38px; }
img.avatar { object-fit: cover; }
.ava-holder, .ava-holder-lg { display: inline-flex; }

.profile-btn { display: inline-flex; align-items: center; gap: 8px; background: transparent; border: none; cursor: pointer; padding: 2px 4px; border-radius: 10px; }
.profile-btn:hover { background: var(--bg-soft); }

/* ---------- SESLİ SOHBET ---------- */
.voice-bar { margin-bottom: 10px; }
.voice-btn {
  font-family: inherit; font-weight: 700; font-size: 14px;
  width: 100%; background: var(--card); color: var(--primary-dark);
  border: 2px solid var(--border); padding: 11px 14px; border-radius: var(--radius);
  cursor: pointer; box-shadow: var(--shadow); transition: background .15s;
}
.voice-btn:hover { background: var(--bg-soft); }
.voice-panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.voice-live { font-size: 13px; font-weight: 700; color: #c0392b; display: flex; align-items: center; gap: 6px; }
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: #c0392b; animation: recpulse 1s infinite; }
.voice-parts { display: flex; gap: 12px; flex: 1; flex-wrap: wrap; }
.voice-person { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); background: var(--bg-soft); padding: 4px 10px 4px 4px; border-radius: 999px; }
.voice-actions { display: flex; gap: 8px; margin-left: auto; }
.voice-mini { font-family: inherit; font-weight: 600; font-size: 14px; border: 2px solid var(--border); background: var(--card); color: var(--text); border-radius: 10px; padding: 8px 12px; cursor: pointer; }
.voice-mini.muted { background: #c0392b; color: #fff; border-color: #c0392b; }
.voice-mini.leave { color: #c0392b; border-color: #f3c9c2; }
.voice-mini.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.voice-mini:hover { filter: brightness(.97); }

/* Bas-Konuş tut butonu */
.ptt-hold {
  flex-basis: 100%; width: 100%;
  font-family: inherit; font-weight: 800; font-size: 16px;
  border: 2px dashed var(--primary); background: var(--bg-soft); color: var(--primary-dark);
  border-radius: 14px; padding: 16px; cursor: pointer; user-select: none; touch-action: none;
  transition: background .1s, transform .1s;
}
.ptt-hold.talking { background: #36c26b; border-style: solid; border-color: #36c26b; color: #fff; transform: scale(.99); }
/* Bağlantı durumu yazısı */
.voice-status { flex-basis: 100%; font-size: 11px; color: var(--text-soft); display: flex; gap: 12px; flex-wrap: wrap; }
.vs-peer { white-space: nowrap; }

/* Ekran paylaşımı görüntüleri */
.screen-area {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px; margin-bottom: 10px;
  max-height: 32vh; overflow-y: auto; flex-shrink: 0;
}
.screen-item { background: #000; border-radius: 12px; overflow: hidden; position: relative; box-shadow: var(--shadow); }
.screen-item video { width: 100%; display: block; max-height: 28vh; object-fit: contain; background: #000; cursor: zoom-in; }
.screen-item video.mirror { transform: scaleX(-1); }
.screen-label { position: absolute; left: 8px; bottom: 8px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 8px; }
.screen-stop-btn { position: absolute; top: 8px; right: 8px; background: rgba(220,38,38,.92); color: #fff; border: none; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 8px; cursor: pointer; z-index: 2; }
.screen-stop-btn:hover { background: #dc2626; }

/* ---------- ÇEVRİMİÇİ ÇUBUĞU ---------- */
.online-bar { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 12px; margin-bottom: 10px; }
.online-head { font-size: 13px; font-weight: 700; color: var(--primary-dark); margin-bottom: 8px; }
.online-people { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 2px; }
.online-person { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 54px; }
.online-ava { position: relative; }
.online-ava .dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #36c26b; border: 2px solid var(--card); }
.online-ava .dot.off { background: #bbb; }
.online-person { min-width: 60px; }
.online-name { font-size: 11px; font-weight: 600; color: var(--text); text-align: center; max-width: 72px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.online-seen { font-size: 9px; color: var(--text-soft); text-align: center; max-width: 72px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.online-seen.on { color: #36c26b; font-weight: 600; }

/* ---------- MESAJ AVATAR + GÖRÜLDÜ ---------- */
.msg-head { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.msg-receipt { margin-left: 8px; display: inline-flex; align-items: center; gap: 4px; }
.msg-receipt .tick { font-size: 13px; font-weight: 700; color: var(--text-soft); letter-spacing: -2px; }
.msg-receipt .tick.read { color: #34b7f1; }
.msg-receipt .seen-names { font-size: 10px; color: #34b7f1; max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- PROFİL MODAL ---------- */
.profile-pic-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 14px; }
.profile-name { text-align: center; font-weight: 700; font-size: 18px; color: var(--text); margin-bottom: 8px; }

/* ---------- İÇERİK ---------- */
.tab-content { display: none; max-width: 980px; margin: 0 auto; padding: 22px 18px 60px; }
.tab-content.active { display: block; }

/* ---------- ANILAR ---------- */
.upload-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  background: var(--card);
  padding: 14px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.file-label { cursor: pointer; white-space: nowrap; }
.upload-bar input[type="text"] { flex: 1; min-width: 200px; }
.upload-status { font-size: 13px; color: var(--text-soft); }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}
.photo-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .15s;
  display: flex;
  flex-direction: column;
}
.photo-card:hover { transform: translateY(-3px); }
.photo-imgwrap { position: relative; }
.photo-card img { width: 100%; aspect-ratio: 1/1; object-fit: cover; cursor: zoom-in; background: var(--bg-soft); display: block; }
.photo-meta { padding: 12px 14px; }
.photo-caption { font-size: 14px; color: var(--text); word-break: break-word; }
.photo-del {
  position: absolute; top: 8px; right: 8px;
  width: 34px; height: 34px; border: none; border-radius: 50%;
  background: rgba(0,0,0,.5); color: #fff; font-size: 15px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s, background .15s;
}
.photo-card:hover .photo-del { opacity: 1; }
.photo-del:hover { background: #c0392b; }
@media (max-width: 480px) { .photo-del { opacity: 1; } }

.empty-state { text-align: center; color: var(--text-soft); padding: 50px 20px; font-size: 16px; }
.load-more-wrap { display: flex; justify-content: center; margin-top: 26px; }
.load-more {
  font-family: inherit; font-weight: 600; font-size: 15px;
  background: var(--bg-soft); color: var(--primary-dark);
  border: 2px solid var(--border); padding: 12px 30px; border-radius: 12px;
  cursor: pointer; transition: background .15s, transform .12s;
}
.load-more:hover { background: var(--card); transform: translateY(-1px); }
.load-more:active { transform: translateY(0); }

/* ---------- SOHBET ---------- */
#tab-sohbet { display: none; }
#tab-sohbet { padding-top: 12px; padding-bottom: 6px; }
#tab-sohbet.active { display: flex; flex-direction: column; height: calc(100vh - var(--topbar-h, 70px)); height: calc(100dvh - var(--topbar-h, 70px)); }
#tab-sohbet .chat-input { padding-bottom: 4px; }
#chatFileStatus:empty { display: none; }
.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 4px;
}
.msg { max-width: 72%; padding: 9px 14px; border-radius: 16px; box-shadow: var(--shadow); }
.msg .msg-author { font-size: 11px; font-weight: 700; color: var(--primary-dark); margin-bottom: 2px; }
.msg .msg-text { font-size: 15px; word-break: break-word; }
.msg .msg-time { font-size: 10px; color: var(--text-soft); text-align: right; margin-top: 3px; }
.msg.them { align-self: flex-start; background: var(--card); }
.msg.me { align-self: flex-end; background: linear-gradient(135deg, var(--accent), #f3b75e); }
.msg.me .msg-author { color: var(--primary-dark); }
/* Yanıt önizleme çubuğu */
.reply-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border-left: 4px solid var(--primary);
  border-radius: 10px; padding: 8px 12px; margin: 0 4px 6px;
}
.reply-bar-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.reply-bar-author { font-size: 12px; font-weight: 700; color: var(--primary-dark); }
.reply-bar-text { font-size: 13px; color: var(--text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reply-cancel { border: none; background: transparent; font-size: 16px; cursor: pointer; color: var(--text-soft); }

/* Mesaj içindeki alıntı bloğu */
.msg { position: relative; }
.msg-quote {
  border-left: 3px solid var(--primary); background: rgba(0,0,0,.05);
  border-radius: 8px; padding: 5px 9px; margin-bottom: 5px; display: flex; flex-direction: column;
}
.msg.me .msg-quote { background: rgba(255,255,255,.4); }
.msg-quote-author { font-size: 11px; font-weight: 700; color: var(--primary-dark); }
.msg-quote-text { font-size: 12px; color: var(--text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }

/* Mesaj aksiyonları (tepki + menü) */
.msg-actions { position: absolute; top: 4px; right: 4px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.msg:hover .msg-actions { opacity: 1; }
@media (max-width: 480px) { .msg-actions { opacity: .85; } }
.msg-act {
  width: 22px; height: 22px; border: none; border-radius: 50%;
  background: rgba(255,255,255,.6); cursor: pointer; font-size: 12px;
  display: flex; align-items: center; justify-content: center; line-height: 1;
  backdrop-filter: blur(2px); color: var(--text);
}
.msg-act:hover { background: #fff; }
body.dark .msg-act { background: rgba(255,255,255,.15); }
.msg-edited { font-size: 10px; color: var(--text-soft); font-style: italic; }

/* Tepki çipleri */
.msg-reacts { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.react-chip {
  border: none; background: rgba(0,0,0,.07); border-radius: 999px;
  padding: 1px 8px; font-size: 12px; cursor: pointer; line-height: 1.6;
}
.react-chip.mine { background: var(--accent); color: var(--text); font-weight: 700; }
body.dark .react-chip { background: rgba(255,255,255,.12); color: var(--text); }
body.dark .react-chip.mine { background: var(--primary); color: #fff; }

/* Emoji ve menü popoverları */
.emoji-pop, .menu-pop { background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; }
.emoji-pop { display: flex; gap: 2px; }
.emoji-pop button { border: none; background: transparent; font-size: 22px; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.emoji-pop button:hover { background: var(--bg-soft); transform: scale(1.15); }
.menu-pop { display: flex; flex-direction: column; min-width: 140px; }
.menu-pop button { border: none; background: transparent; text-align: left; font-family: inherit; font-size: 14px; color: var(--text); padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.menu-pop button:hover { background: var(--bg-soft); }

/* Fotoğrafa tepki butonu */
.photo-react {
  position: absolute; top: 8px; left: 8px;
  width: 34px; height: 34px; border: none; border-radius: 50%;
  background: rgba(0,0,0,.5); color: #fff; font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s, background .15s;
}
.photo-card:hover .photo-react { opacity: 1; }
.photo-react:hover { background: var(--primary); }
@media (max-width: 480px) { .photo-react { opacity: 1; } }

/* Sohbette arama */
.chat-search {
  width: 100%; margin: 0 0 8px; padding: 9px 12px;
  border: 2px solid var(--border); border-radius: 12px;
  background: var(--card); color: var(--text); font-family: inherit; font-size: 14px;
}

/* Yanıtla butonu (eski - artık kullanılmıyor ama dursun) */
.msg-reply {
  position: absolute; top: 5px; right: 5px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: rgba(255,255,255,.55); color: var(--text-soft);
  width: 20px; height: 20px; border-radius: 50%; cursor: pointer;
  backdrop-filter: blur(2px);
  opacity: 0; transform: scale(.85); transition: opacity .15s, transform .15s, background .15s, color .15s;
}
.msg-reply:hover { background: rgba(255,255,255,.85); color: var(--primary); }
.msg:hover .msg-reply { opacity: 1; transform: scale(1); }
@media (max-width: 480px) { .msg-reply { opacity: .7; transform: scale(1); } }

.chat-input { display: flex; gap: 10px; padding: 12px 4px; align-items: center; }
.chat-input input[type="text"] { flex: 1; }
.attach-btn {
  font-size: 20px; cursor: pointer; user-select: none;
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 2px solid var(--border);
  border-radius: 12px; background: #fffdf9; transition: background .15s;
}
.attach-btn:hover { background: var(--bg-soft); }
.msg-img { max-width: 220px; border-radius: 12px; margin-bottom: 4px; cursor: zoom-in; display: block; }
.msg-file {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.55); padding: 8px 12px; border-radius: 10px;
  text-decoration: none; color: var(--primary-dark); font-weight: 600;
  font-size: 14px; margin-bottom: 4px; word-break: break-all;
}
.msg-file:hover { text-decoration: underline; }
/* Özel sesli mesaj oynatıcısı */
.audio-player {
  display: flex; align-items: center; gap: 9px;
  background: rgba(255,255,255,.55); padding: 7px 12px 7px 8px;
  border-radius: 999px; margin-bottom: 4px; width: 230px; max-width: 100%;
}
.msg.me .audio-player { background: rgba(255,255,255,.32); }
.audio-player audio { display: none; }
.ap-play {
  width: 32px; height: 32px; border: none; border-radius: 50%;
  background: var(--primary); color: #fff; cursor: pointer; flex-shrink: 0;
  font-size: 12px; display: flex; align-items: center; justify-content: center;
  transition: filter .12s, transform .1s;
}
.ap-play:hover { filter: brightness(1.06); }
.ap-play:active { transform: scale(.94); }
.ap-bar { flex: 1; height: 6px; background: rgba(0,0,0,.16); border-radius: 4px; cursor: pointer; position: relative; }
.ap-fill { height: 100%; width: 0; background: var(--primary); border-radius: 4px; transition: width .1s linear; }
.ap-time { font-size: 11px; font-weight: 600; color: var(--text-soft); min-width: 32px; text-align: right; }
body.dark .audio-player { background: rgba(255,255,255,.1); }
body.dark .msg.me .audio-player { background: rgba(0,0,0,.2); }
body.dark .ap-bar { background: rgba(255,255,255,.2); }
.attach-btn.recording {
  background: #c0392b; color: #fff; border-color: #c0392b;
  animation: recpulse 1s infinite;
}
@keyframes recpulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

/* ---------- ADMIN ---------- */
.admin-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.card { background: var(--card); padding: 20px; border-radius: var(--radius); box-shadow: var(--shadow); }
.card h2 { font-size: 18px; margin-bottom: 14px; color: var(--primary-dark); }
.add-user-form { display: flex; flex-direction: column; gap: 10px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-soft); cursor: pointer; }
.user-list { display: flex; flex-direction: column; gap: 10px; }
.user-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 2px solid var(--border); border-radius: 12px;
}
.user-row .uname { font-weight: 600; }
.uname-sub { font-weight: 500; font-size: 12px; color: var(--text-soft); }
.badge { font-size: 11px; background: var(--accent); color: var(--text); padding: 2px 8px; border-radius: 8px; margin-left: 6px; }
.user-actions { display: flex; gap: 6px; }
.mini-btn { font-family: inherit; font-size: 12px; font-weight: 600; border: 2px solid var(--border); background: #fff; border-radius: 9px; padding: 5px 9px; cursor: pointer; }
.mini-btn.danger { color: #c0392b; border-color: #f3c9c2; }
.mini-btn:hover { background: var(--bg-soft); }

/* ---------- MODAL & LIGHTBOX ---------- */
.modal { position: fixed; inset: 0; background: rgba(74,59,47,.45); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-card { background: var(--card); padding: 26px; border-radius: 20px; width: 90%; max-width: 340px; box-shadow: var(--shadow); }
.modal-card h3 { margin-bottom: 14px; color: var(--primary-dark); }
.modal-card input { width: 100%; margin-bottom: 12px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

.lightbox { position: fixed; inset: 0; background: rgba(40,30,20,.85); display: flex; align-items: center; justify-content: center; z-index: 100; cursor: zoom-out; padding: 30px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }

/* ---------- TABLET ---------- */
@media (max-width: 720px) {
  .admin-wrap { grid-template-columns: 1fr; }
  .topbar { gap: 10px; padding: 10px 14px; }
  .tabs { order: 3; width: 100%; justify-content: center; margin: 0; }
  .brand { font-size: 18px; }
  .user-box { margin-left: auto; }
  .tab-content { padding: 16px 12px 50px; }
}

/* ---------- TELEFON ---------- */
@media (max-width: 480px) {
  /* iOS'ta input'a tıklayınca yakınlaşmayı önlemek için 16px */
  input[type="text"], input[type="password"] { font-size: 16px; }

  /* Üst bar: 1. satır marka+kontroller, 2. satır sekmeler (tam genişlik, eşit) */
  .topbar { padding: 7px 10px; row-gap: 7px; column-gap: 6px; align-items: center; }
  .brand { font-size: 15px; order: 1; }
  .brand-logo { height: 30px; width: 30px; }
  .brand-name { display: none; }              /* telefonda sadece logo */
  .theme-toggle { order: 2; padding: 4px 6px; font-size: 16px; }
  .user-box { order: 3; margin-left: auto; gap: 4px; }
  .tabs {
    order: 4; width: 100%; margin: 0; gap: 6px;
    display: flex; flex-wrap: nowrap;
  }
  .tab {
    flex: 1 1 0; min-width: 0; text-align: center;
    padding: 10px 4px; font-size: 13px; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    background: var(--bg-soft);
  }
  .tab.active { background: var(--accent); }

  /* Profil: telefonda sadece avatar (isim gizli, yer kazanmak için) */
  .profile-btn { gap: 0; padding: 2px; }
  .profile-btn .whoami { display: none; }
  .btn-ghost { padding: 6px 8px; font-size: 13px; }
  #logoutBtn { font-size: 12px; padding: 6px 8px; }

  /* Çevrimiçi çubuğu: kompakt */
  .online-bar { padding: 8px 10px; margin-bottom: 8px; }
  .online-head { font-size: 12px; margin-bottom: 6px; }
  .online-people { gap: 10px; }
  .online-person { min-width: 50px; }
  .online-name { font-size: 10px; max-width: 56px; }
  .online-seen { font-size: 9px; max-width: 56px; }

  /* Anılar: telefonda 2 sütun */
  .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .photo-meta { padding: 9px 10px; }
  .photo-caption { font-size: 13px; }

  /* Yükleme kutusu alt alta */
  .upload-bar { padding: 12px; gap: 8px; }
  .upload-bar .file-label, .upload-bar input[type="text"] { width: 100%; min-width: 0; }

  /* Sohbet */
  .msg { max-width: 86%; }
  .msg-img { max-width: 180px; }
  .msg-receipt .seen-names { max-width: 90px; }
  .chat-input { gap: 6px; padding: 10px 2px; }
  .attach-btn { width: 40px; height: 40px; font-size: 18px; flex-shrink: 0; }
  .chat-input .btn-primary { padding: 11px 13px; }

  /* Admin formları rahat */
  .card { padding: 16px; }
  .user-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .user-actions { width: 100%; }
  .mini-btn { flex: 1; }

  /* Modal taşmasın */
  .avatar-lg { width: 84px; height: 84px; font-size: 34px; }

  /* Sesli sohbet + ekran paylaşımı telefonda */
  .voice-panel { padding: 10px; gap: 8px; }
  .voice-actions { width: 100%; margin-left: 0; }
  .voice-mini { flex: 1; padding: 9px 8px; font-size: 13px; }
  .screen-area { grid-template-columns: 1fr; gap: 8px; max-height: 30vh; }
  .screen-item video { max-height: 26vh; }
}

/* ===================================================================== */
/*  DISCORD TARZI 3 PANEL YERLEŞİM                                        */
/* ===================================================================== */
.app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }

/* SOL: kanal çubuğu */
.dc-sidebar { width: 240px; flex-shrink: 0; background: var(--bg-soft); display: flex; flex-direction: column; }
.dc-brand { display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-weight: 700; color: var(--text); border-bottom: 1px solid rgba(0,0,0,.2); }
.dc-brand .brand-logo { height: 30px; width: 30px; border-radius: 50%; box-shadow: none; }
.dc-channels { flex: 1; overflow-y: auto; padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; }
.dc-cat { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-soft); padding: 14px 8px 4px; letter-spacing: .4px; }
.channel {
  display: flex; align-items: center; gap: 6px; width: 100%; text-align: left;
  background: transparent; border: none; color: var(--text-soft); cursor: pointer;
  font-family: inherit; font-size: 15px; font-weight: 600; padding: 8px 10px; border-radius: 6px;
}
.channel:hover { background: rgba(127,127,127,.12); color: var(--text); }
.channel.active { background: rgba(127,127,127,.18); color: var(--text); }
body.dark .channel.active { color: #fff; }
.ch-hash { color: var(--text-soft); font-weight: 700; }

/* Kullanıcı paneli (sol alt) */
.dc-userpanel { display: flex; align-items: center; gap: 4px; padding: 8px 10px; background: rgba(0,0,0,.18); }
.dc-userpanel .profile-btn { flex: 1; min-width: 0; gap: 8px; }
.dc-userpanel .whoami { display: inline-block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 110px; }
.up-actions { display: flex; gap: 2px; }
.dc-iconbtn { background: transparent; border: none; color: var(--text-soft); cursor: pointer; font-size: 16px; padding: 6px 8px; border-radius: 6px; line-height: 1; }
.dc-iconbtn:hover { background: rgba(127,127,127,.15); color: var(--text); }

/* ORTA: içerik */
.dc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); overflow: hidden; }
.dc-topbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid rgba(0,0,0,.2); flex-shrink: 0; }
.dc-title { font-weight: 700; color: var(--text); font-size: 16px; flex: 1; }
.nav-toggle, .members-toggle { display: none; }

/* tab-content artık dc-main içinde */
.tab-content { display: none; max-width: none; margin: 0; padding: 18px; flex: 1; min-height: 0; overflow-y: auto; }
.tab-content.active { display: block; }
#tab-sohbet.active { display: flex; flex-direction: column; flex: 1; min-height: 0; height: auto; overflow: hidden; padding: 0; }
.chat-messages { padding: 14px 16px; }
.chat-search { margin: 10px 16px 2px; width: auto; }
.reply-bar { margin: 0 16px; }
.chat-input { padding: 12px 16px 14px; }
#chatFileStatus { padding: 0 16px 8px; }

/* SAĞ: üye paneli */
.dc-members { width: 220px; flex-shrink: 0; background: var(--bg-soft); overflow-y: auto; padding: 14px 10px; }
.dc-members .online-bar { background: transparent; box-shadow: none; padding: 0; margin: 0; }
.dc-members .online-head { text-align: left; font-size: 11px; text-transform: uppercase; margin-bottom: 8px; }
.dc-members .online-head.off { margin-top: 16px; color: var(--muted); }
.dc-members .online-people { flex-direction: column; gap: 2px; overflow: visible; margin-bottom: 4px; }
.dc-members .online-person { flex-direction: row; width: 100%; min-width: 0; align-items: center; gap: 9px; padding: 5px 8px; border-radius: 6px; }
.dc-members .online-person:hover { background: rgba(127,127,127,.12); }
.dc-members .online-info { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.dc-members .online-name { max-width: none; text-align: left; font-size: 14px; }
.dc-members .online-seen { display: block; max-width: none; text-align: left; font-size: 11px; }
.dc-members .online-none { font-size: 12px; color: var(--muted); padding: 2px 8px; }
/* çevrimdışı kişiler biraz soluk */
.dc-members .online-person:has(.dot.off) { opacity: .72; }
.dc-members .online-person:has(.dot.off):hover { opacity: 1; }

/* Sesli oda paneli (sol) */
.dc-channels .voice-bar { margin: 2px 0 0; }
.dc-channels .voice-btn { text-align: left; width: 100%; box-shadow: none; background: transparent; border: none; color: var(--text-soft); font-weight: 600; padding: 8px 10px; }
.dc-channels .voice-btn:hover { background: rgba(127,127,127,.12); color: var(--text); }
.dc-channels .voice-panel { margin-top: 4px; padding: 8px; flex-direction: column; align-items: stretch; }
.dc-channels .voice-actions { margin-left: 0; }
.dc-channels .voice-mini { flex: 1 1 40%; font-size: 12px; padding: 7px 6px; }

/* Mesaj balonları Discord renklerine */
body.dark .msg.me { background: var(--primary-dark); }
body.dark .msg.me .msg-text, body.dark .msg.me .msg-time { color: #fff; }
body.dark .msg.them { background: #383a40; }

/* Mobil: yan paneller kayar */
.dc-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 60; }
.dc-overlay.show { display: block; }
@media (max-width: 900px) {
  .nav-toggle, .members-toggle { display: inline-block; font-size: 20px; }
  .dc-sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 70; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 30px rgba(0,0,0,.4); }
  .dc-sidebar.open { transform: none; }
  .dc-members { position: fixed; right: 0; top: 0; bottom: 0; z-index: 70; transform: translateX(100%); transition: transform .2s; box-shadow: 0 0 30px rgba(0,0,0,.4); }
  .dc-members.open { transform: none; }
}

/* Kanal düğmeleri dikey listede esnemesin (eski mobil .tab kuralını ezer) */
.channel { flex: 0 0 auto !important; white-space: normal; }
.dc-sidebar .voice-btn { flex: 0 0 auto !important; }

/* ---- Discord: sağ üst küçük arama (tıklayınca büyür) ---- */
.dc-search {
  width: 150px; padding: 7px 12px; font-size: 13px;
  border-radius: 999px; border: none; background: var(--bg-soft); color: var(--text);
  transition: width .2s, background .2s; outline: none;
}
body.dark .dc-search { background: #1e1f22; }
.dc-search:focus { width: 230px; }
@media (max-width: 900px) { .dc-search { width: 110px; } .dc-search:focus { width: 160px; } }

/* ---- Discord: kompakt sesli oda paneli (sol) ---- */
.dc-channels .voice-panel { padding: 6px; gap: 6px; flex-direction: column; align-items: stretch; background: rgba(0,0,0,.15); box-shadow: none; border-radius: 8px; }
.dc-channels .voice-live { font-size: 11px; }
.dc-channels .voice-parts { flex-direction: column; gap: 2px; width: 100%; }
.dc-channels .voice-person { width: 100%; background: transparent; padding: 3px 6px; border-radius: 6px; gap: 8px; font-size: 13px; }
.dc-channels .voice-person:hover { background: rgba(127,127,127,.12); }
.dc-channels .voice-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; width: 100%; margin: 0; }
.dc-channels .voice-mini {
  flex: none !important; min-width: 0; font-size: 11px; font-weight: 600;
  padding: 8px 4px; border-radius: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; justify-content: center;
}
.dc-channels .voice-mini.leave { grid-column: span 3; }
.dc-channels .ptt-hold { font-size: 13px; padding: 10px; }
.dc-channels .voice-status { font-size: 10px; gap: 6px; }

/* Sesi aç düğmesi (otomatik oynatma engellenirse) */
.sound-unlock {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  z-index: 300; background: var(--primary); color: #fff; border: none;
  font-family: inherit; font-weight: 700; font-size: 15px;
  padding: 12px 22px; border-radius: 999px; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,.4); animation: recpulse 1.4s infinite;
}

/* Konuşan kişi: avatar etrafında yeşil halka */
.voice-person { cursor: pointer; transition: background .1s; }
.voice-person .avatar { transition: box-shadow .08s; }
.voice-person.speaking .avatar { box-shadow: 0 0 0 2px #23a55a, 0 0 8px rgba(35,165,90,.7); }

/* Ses seviyesi popover */
.vol-pop { background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 10px 12px; width: 180px; }
.vol-label { font-size: 12px; color: var(--text); margin-bottom: 8px; }
.vol-pop input[type="range"] { width: 100%; accent-color: var(--primary); }

/* Direkt Mesaj listesi (sol) */
.dm-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.dm-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: transparent; border: none; color: var(--text-soft); cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 600; padding: 6px 8px; border-radius: 6px;
}
.dm-item:hover { background: rgba(127,127,127,.12); color: var(--text); }
.dm-item.active { background: rgba(127,127,127,.18); color: var(--text); }
.dm-ava { position: relative; display: inline-flex; }
.dm-ava .dot { position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%; background: #23a55a; border: 2px solid var(--bg-soft); }
.dm-ava .dot.off { background: #80848e; }
.dm-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-empty { font-size: 12px; color: var(--text-soft); padding: 4px 8px; }

/* DM sohbeti, genel sohbetle aynı dolduran düzen */
#tab-dm.active { display: flex; flex-direction: column; flex: 1; min-height: 0; height: auto; overflow: hidden; padding: 0; }
#dmMessages { padding: 14px 16px; }
#dmFileStatus { padding: 0 16px 8px; }

/* "yazıyor…" göstergesi */
.typing-ind { font-size: 12px; font-style: italic; color: var(--text-soft); padding: 2px 16px; min-height: 18px; }

/* Okunmamış rozeti (kanal / DM) */
.ch-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: auto;
  background: #f23f43; color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 999px; flex-shrink: 0;
}
.channel, .dm-item { position: relative; }

/* @bahsetme vurgusu */
.mention { background: rgba(88,101,242,.25); color: #c9cdfb; border-radius: 4px; padding: 0 3px; font-weight: 600; }
.mention.me { background: rgba(240,178,50,.3); color: #ffd885; }
.msg-pin { font-size: 11px; }
/* Sabitlenenler popover */
.pins-pop { width: 260px; max-height: 320px; overflow-y: auto; }
.pins-head { font-weight: 700; margin-bottom: 6px; }
.pin-item { font-size: 13px; padding: 6px 4px; border-top: 1px solid var(--border); }
/* Kick butonu */
.kick-btn { margin-top: 10px; width: 100%; border: none; background: #c0392b; color: #fff; font-family: inherit; font-weight: 700; padding: 8px; border-radius: 8px; cursor: pointer; }
/* Sürükle-bırak */
.drag-over { outline: 3px dashed var(--primary); outline-offset: -10px; }

/* ===== Çoklu kanal / sesli oda ===== */
.cat-add {
  float: right; border: none; background: transparent; color: var(--muted);
  font-size: 15px; line-height: 1; cursor: pointer; padding: 0 2px; border-radius: 4px;
}
.cat-add:hover { color: var(--text); background: rgba(255,255,255,.08); }
.text-channels { display: flex; flex-direction: column; }
.ch-del, .vroom-del {
  margin-left: 6px; color: var(--muted); font-size: 12px; opacity: 0;
  transition: opacity .12s; flex-shrink: 0; cursor: pointer;
}
.channel:hover .ch-del, .vroom-head:hover .vroom-del { opacity: .85; }
.ch-del:hover, .vroom-del:hover { color: #f23f43; }

/* Sesli odalar */
.voice-rooms { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.vroom { border-radius: 8px; }
.vroom.joined { background: rgba(88,101,242,.12); }
.vroom-head {
  display: flex; align-items: center; gap: 6px; width: 100%;
  background: transparent; border: none; color: var(--text);
  font-family: inherit; font-size: 14px; padding: 7px 8px; border-radius: 8px;
  cursor: pointer; text-align: left;
}
.vroom-head:hover { background: rgba(255,255,255,.06); }
.vroom-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vroom-count {
  min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.12); color: var(--muted); border-radius: 999px;
}
.vroom.joined .vroom-count { background: var(--primary); color: #fff; }
.vroom-members { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 8px 6px 26px; }
.vroom-mem .avatar { width: 22px; height: 22px; }

/* ===== Emoji / GIF seçici ===== */
.eg-pop {
  width: 330px; max-width: 92vw; background: var(--card);
  border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.45); overflow: hidden;
  display: flex; flex-direction: column;
}
.eg-tabs { display: flex; border-bottom: 1px solid var(--border); }
.eg-tab {
  flex: 1; padding: 9px; background: transparent; border: none;
  color: var(--muted); font-family: inherit; font-weight: 600; cursor: pointer;
}
.eg-tab.active { color: var(--text); box-shadow: inset 0 -2px 0 var(--primary); }
.eg-body { padding: 8px; }
.eg-search {
  width: 100%; box-sizing: border-box; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text);
  font-family: inherit; margin-bottom: 6px; outline: none;
}
.eg-cats { display: flex; gap: 2px; margin-bottom: 6px; flex-wrap: wrap; }
.eg-cat { font-size: 16px; background: transparent; border: none; cursor: pointer; padding: 4px 5px; border-radius: 6px; opacity: .6; }
.eg-cat.active, .eg-cat:hover { opacity: 1; background: rgba(127,127,127,.18); }
.eg-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 1px; max-height: 220px; overflow-y: auto; }
.eg-cell { font-size: 20px; line-height: 1; padding: 5px 0; background: transparent; border: none; cursor: pointer; border-radius: 6px; }
.eg-cell:hover { background: rgba(127,127,127,.22); }
.eg-gifs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-height: 300px; overflow-y: auto; }
.eg-gif { width: 100%; border-radius: 8px; cursor: pointer; display: block; background: rgba(127,127,127,.12); }
.eg-gif:hover { outline: 2px solid var(--primary); }
.eg-empty, .eg-loading { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 18px; font-size: 13px; }

/* ===== Profil durum alanları ===== */
.profile-field { text-align: left; margin: 12px 0 0; }
.profile-field > label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; letter-spacing: .04em; }
.status-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.status-opt { font-family: inherit; font-size: 13px; font-weight: 600; padding: 9px 10px; border-radius: 10px; border: 2px solid var(--border); background: var(--card); color: var(--text); cursor: pointer; transition: all .12s; }
.status-opt:hover { border-color: var(--primary); }
.status-opt.active { border-color: var(--primary); background: var(--primary); color: #fff; }
#statusText, #bioText { width: 100%; box-sizing: border-box; font-family: inherit; font-size: 14px; padding: 10px 12px; border-radius: 10px; border: 2px solid var(--border); background: var(--bg-soft); color: var(--text); outline: none; resize: vertical; }
#statusText:focus, #bioText:focus { border-color: var(--primary); }

/* tıklanabilir kişiler */
.online-person { cursor: pointer; }
.msg-head { cursor: pointer; }
.msg-head:hover .msg-author { text-decoration: underline; }

/* ===== Mini profil kartı ===== */
.uc-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 300; padding: 16px; }
.uc-card { width: 320px; max-width: 92vw; background: var(--card); border-radius: 14px; overflow: hidden; box-shadow: 0 18px 60px rgba(0,0,0,.5); animation: ucpop .14s ease-out; }
@keyframes ucpop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.uc-banner { height: 64px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.uc-avawrap { position: relative; width: 96px; height: 96px; margin: -48px auto 0; }
.uc-avawrap .avatar { width: 96px; height: 96px; font-size: 38px; border: 5px solid var(--card); }
.uc-dot { position: absolute; right: 4px; bottom: 4px; width: 22px; height: 22px; border-radius: 50%; border: 4px solid var(--card); }
.uc-body { padding: 10px 18px 20px; text-align: center; }
.uc-name { font-size: 20px; font-weight: 700; color: var(--text); }
.uc-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 4px; }
.uc-sdot { width: 9px; height: 9px; border-radius: 50%; }
.uc-bio { margin-top: 12px; font-size: 14px; color: var(--text); background: var(--bg-soft); padding: 10px 12px; border-radius: 10px; text-align: left; white-space: pre-wrap; word-break: break-word; }
.uc-seen { margin-top: 10px; font-size: 12px; color: var(--muted); }
.uc-actions { margin-top: 16px; }
.uc-actions .btn-primary { width: 100%; }
.ava-dotwrap { position: relative; }
.ava-dotwrap .my-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--card); }

/* ===== Gürültü engelleme popover ===== */
.gate-pop { width: 230px; }
.gate-row { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 4px 0 8px; cursor: pointer; }
.gate-row input { width: 16px; height: 16px; }
.gate-hint { font-size: 11px; color: var(--muted); margin-top: 8px; line-height: 1.4; }

/* ===== Anket ===== */
.poll-box { background: rgba(0,0,0,.06); border-radius: 12px; padding: 10px 12px; margin: 4px 0; min-width: 220px; }
body.dark .poll-box { background: rgba(255,255,255,.06); }
.poll-q { font-weight: 700; margin-bottom: 8px; }
.poll-opt { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; border: 1px solid rgba(0,0,0,.12); background: var(--card); color: var(--text); border-radius: 9px; padding: 7px 10px; margin: 4px 0; cursor: pointer; font: inherit; font-size: 13px; overflow: hidden; text-align: left; }
body.dark .poll-opt { border-color: rgba(255,255,255,.14); }
.poll-opt:hover { border-color: var(--accent); }
.poll-opt.mine { border-color: var(--accent); font-weight: 700; }
.poll-opt-bar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); opacity: .25; transition: width .3s; }
.poll-opt-label { position: relative; z-index: 1; }
.poll-opt-count { position: relative; z-index: 1; font-weight: 700; font-size: 12px; }
.poll-total { font-size: 11px; color: var(--muted); margin-top: 6px; }
.poll-options-edit { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
#pollAddOpt { align-self: flex-start; }

/* ===== Sohbette arama paneli ===== */
.dc-main { position: relative; }
.search-pane { position: absolute; top: 52px; right: 10px; width: min(420px, calc(100% - 20px)); max-height: 60vh; overflow-y: auto; background: var(--card); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25); z-index: 150; padding: 8px; }
.search-pane-head { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 6px 8px; }
.search-close { border: none; background: transparent; cursor: pointer; color: var(--muted); font-size: 13px; }
.search-hit { display: block; width: 100%; text-align: left; border: none; background: transparent; color: var(--text); padding: 8px; border-radius: 8px; cursor: pointer; font: inherit; }
.search-hit:hover { background: rgba(0,0,0,.06); }
body.dark .search-hit:hover { background: rgba(255,255,255,.07); }
.search-hit-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.search-hit-author { font-size: 12px; font-weight: 700; }
.search-hit-date { font-size: 11px; color: var(--muted); }
.search-hit-text { display: block; font-size: 13px; line-height: 1.35; word-break: break-word; }
.search-hit-text mark { background: var(--accent); color: #fff; border-radius: 3px; padding: 0 2px; }
.msg-flash { outline: 2px solid var(--accent); outline-offset: 2px; transition: outline-color 1.5s; }

/* ===== AFİLLİ GİRİŞ EKRANI ===== */
/* Giriş her temada kendi sahnesini kurar: koyu uzay + süzülen ışık kütleleri */
.login-screen {
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 30% 20%, #1b1e3a 0%, #0d0f1e 55%, #07080f 100%);
  perspective: 1000px;
}
.login-bg { position: absolute; inset: 0; pointer-events: none; }
.lb-blob {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55;
  animation: lbFloat 16s ease-in-out infinite alternate;
}
.lb-b1 { width: 46vmax; height: 46vmax; left: -12vmax; top: -14vmax; background: #5865f2; }
.lb-b2 { width: 38vmax; height: 38vmax; right: -10vmax; top: 20vh; background: #e8893a; animation-delay: -5s; animation-duration: 20s; }
.lb-b3 { width: 34vmax; height: 34vmax; left: 22vw; bottom: -16vmax; background: #9b59ff; animation-delay: -10s; animation-duration: 24s; }
@keyframes lbFloat {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(6vw, -4vh) scale(1.12); }
  100% { transform: translate(-5vw, 5vh) scale(.94); }
}
.lb-grid {
  position: absolute; inset: -60% -20% -20%;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 56px 56px;
  transform: rotateX(62deg);
  mask-image: radial-gradient(ellipse 70% 55% at 50% 62%, #000 25%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 62%, #000 25%, transparent 72%);
  animation: lbGrid 30s linear infinite;
}
@keyframes lbGrid { from { background-position: 0 0, 0 0; } to { background-position: 0 560px, 0 0; } }
.lb-stars, .lb-stars::after {
  position: absolute; inset: 0; content: "";
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, #fff, transparent),
    radial-gradient(1px 1px at 34% 68%, #ffd9a0, transparent),
    radial-gradient(1.5px 1.5px at 58% 14%, #cfd6ff, transparent),
    radial-gradient(1px 1px at 73% 45%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 87% 76%, #ffd9a0, transparent),
    radial-gradient(1px 1px at 22% 84%, #cfd6ff, transparent),
    radial-gradient(1.5px 1.5px at 47% 39%, #fff, transparent),
    radial-gradient(1px 1px at 92% 18%, #fff, transparent);
  animation: lbTwinkle 4s ease-in-out infinite;
}
.lb-stars2 { transform: scale(-1, 1); animation-delay: -2s; opacity: .7; }
@keyframes lbTwinkle { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

/* Cam kart */
.login-screen .login-card {
  position: relative; z-index: 2;
  background: rgba(17, 19, 34, .58);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 24px 70px rgba(0,0,0,.55), 0 0 0 1px rgba(88,101,242,.15), 0 0 90px rgba(88,101,242,.18);
  animation: cardIn .8s cubic-bezier(.2, .9, .25, 1.2) both;
  transition: transform .15s ease-out;
  will-change: transform;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(46px) scale(.92); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.login-screen .login-emoji {
  display: inline-block;
  filter: drop-shadow(0 0 22px rgba(246,193,119,.85));
  animation: heartBeat 2.6s ease-in-out infinite;
}
@keyframes heartBeat {
  0%, 100% { transform: scale(1) translateY(0); }
  12% { transform: scale(1.18); }
  24% { transform: scale(1); }
  36% { transform: scale(1.12); }
  48% { transform: scale(1); }
  70% { transform: translateY(-5px); }
}
.login-screen .login-title {
  background: linear-gradient(100deg, #f6c177 15%, #ffffff 38%, #8b96ff 60%, #f6c177 85%);
  background-size: 220% auto;
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  letter-spacing: .5px;
  animation: titleShine 5s linear infinite;
}
@keyframes titleShine { to { background-position: 220% center; } }
.login-screen .login-sub { color: rgba(219,222,240,.75); }
.login-screen .login-foot { position: relative; z-index: 2; color: rgba(219,222,240,.45); }

/* Girdi alanları: koyu cam + odakta neon halka */
#loginScreen input[type="text"], #loginScreen input[type="password"] {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.14);
  color: #eef0ff;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
#loginScreen input::placeholder { color: rgba(219,222,240,.45); }
#loginScreen input[type="text"]:focus, #loginScreen input[type="password"]:focus {
  border-color: #8b96ff;
  background: rgba(255,255,255,.1);
  box-shadow: 0 0 0 3px rgba(88,101,242,.28), 0 0 24px rgba(88,101,242,.35);
  outline: none;
}

/* Giriş butonu: gradyan + üzerinden geçen parlama */
.login-btn {
  position: relative; overflow: hidden;
  background: linear-gradient(120deg, #5865f2, #9b59ff 55%, #e8893a) !important;
  background-size: 200% auto !important;
  border: none; color: #fff !important;
  font-weight: 700; letter-spacing: .4px;
  box-shadow: 0 10px 28px rgba(88,101,242,.4);
  transition: background-position .35s, transform .15s, box-shadow .2s;
}
.login-btn:hover { background-position: 95% center !important; transform: translateY(-2px); box-shadow: 0 14px 34px rgba(155,89,255,.5); }
.login-btn:active { transform: translateY(0) scale(.98); }
.login-btn::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 46px; left: -70px;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent);
  transform: skewX(-20deg);
  animation: btnSweep 3.2s ease-in-out infinite;
}
@keyframes btnSweep { 0%, 55% { left: -70px; } 85%, 100% { left: 130%; } }

@media (prefers-reduced-motion: reduce) {
  .lb-blob, .lb-grid, .lb-stars, .lb-stars::after, .login-screen .login-emoji,
  .login-screen .login-title, .login-btn::after, .login-screen .login-card { animation: none; }
}
