/* =====================================================================
   D-TOWN SOCIAL · Dark + Neon (Club)
   ===================================================================== */
:root {
  --bg:        #07070c;
  --bg-2:      #0d0d17;
  --panel:     rgba(18, 18, 30, 0.72);
  --panel-2:   #12121f;
  --border:    rgba(255, 255, 255, 0.09);
  --pink:      #ff1b8d;
  --cyan:      #00e5ff;
  --purple:    #b14bff;
  --text:      #f3f3fb;
  --muted:     #9aa0bd;
  --danger:    #ff4d6d;
  --ok:        #1edb8f;
  --radius:    16px;
  --glow-pink: 0 0 18px rgba(255, 27, 141, .55);
  --glow-cyan: 0 0 18px rgba(0, 229, 255, .45);
}

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

html, body { height: 100%; }

body {
  font-family: "Outfit", system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 600px at 70% -10%, #1a0f2e 0%, transparent 60%),
              radial-gradient(900px 500px at 10% 110%, #07223a 0%, transparent 55%),
              var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  opacity: 0;
  transition: opacity .35s ease;
}
body.ready { opacity: 1; }

.hidden { display: none !important; }
.muted  { color: var(--muted); }

code {
  font-family: ui-monospace, "SFMono-Regular", monospace;
  background: rgba(255,255,255,.08);
  padding: 1px 6px; border-radius: 6px; font-size: .9em;
}

/* ---------- Buttons & Felder ---------- */
.btn {
  font-family: "Outfit", sans-serif;
  font-weight: 700; font-size: 1rem;
  border: 0; border-radius: 12px;
  padding: 13px 18px; color: #07070c;
  cursor: pointer; width: 100%;
  transition: transform .12s ease, box-shadow .2s ease, filter .2s ease;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn.neon {
  background: linear-gradient(100deg, var(--pink), var(--purple) 55%, var(--cyan));
  background-size: 200% 100%;
  color: #fff; font-weight: 800; letter-spacing: .02em;
  box-shadow: var(--glow-pink), var(--glow-cyan);
  animation: shift 6s linear infinite;
}
.btn.neon:hover:not(:disabled) { filter: brightness(1.12); }
.btn.sm { width: auto; padding: 10px 16px; font-size: .95rem; }
@keyframes shift { to { background-position: 200% 0; } }

.btn.primary {
  background: linear-gradient(100deg, var(--cyan), var(--purple));
  color: #06121a; font-weight: 800;
}
.btn.ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--border); width: auto;
}
.btn.loading { position: relative; color: transparent !important; }
.btn.loading::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  animation: spin .7s linear infinite;
}

.field {
  width: 100%; font-family: inherit; font-size: 1rem;
  color: var(--text);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.field::placeholder { color: #6b7090; }
.field:focus {
  outline: none; background: rgba(255,255,255,.06);
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0,229,255,.15), var(--glow-cyan);
}
textarea.field { resize: vertical; min-height: 70px; }
.lbl { display: block; font-size: .8rem; color: var(--muted);
  margin: 10px 0 6px; text-transform: uppercase; letter-spacing: .08em; }

/* ---------- Avatare ---------- */
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  object-fit: cover; background: #1a1a28;
  border: 2px solid rgba(255,255,255,.12); flex: none;
}
.avatar.tiny { width: 30px; height: 30px; border-width: 1px; }
.avatar.xl   { width: 92px; height: 92px;
  box-shadow: var(--glow-pink); border-color: var(--pink); }

/* =====================================================================
   LOGIN / REGISTER
   ===================================================================== */
#auth-screen {
  min-height: 100dvh; display: grid; place-items: center;
  padding: 24px 16px; position: relative;
}
.auth-bg {
  position: fixed; inset: 0; z-index: -2;
  background: url("../assets/kingz.jpeg") center/cover no-repeat;
  filter: grayscale(1) brightness(.32) blur(7px) saturate(1.1);
  transform: scale(1.12);
}
.auth-bg::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(80% 60% at 50% 30%, rgba(177,75,255,.28), transparent 60%),
              radial-gradient(70% 60% at 80% 90%, rgba(0,229,255,.22), transparent 60%),
              linear-gradient(180deg, rgba(7,7,12,.55), rgba(7,7,12,.92));
}
.scanlines {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .4;
  background: repeating-linear-gradient(180deg,
    rgba(255,255,255,.035) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}

.auth-card {
  width: min(440px, 100%);
  background: var(--panel);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.6),
              0 0 0 1px rgba(255,27,141,.18),
              0 0 50px rgba(177,75,255,.25);
  animation: cardIn .6s cubic-bezier(.2,.9,.25,1) both;
}
@keyframes cardIn { from { opacity:0; transform: translateY(18px) scale(.97);} }

.hero { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.hero-img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) contrast(1.12) brightness(.78);
  transform: scale(1.02);
}
.hero-overlay {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 80% at 50% 120%, rgba(255,27,141,.45), transparent 55%),
    radial-gradient(90% 70% at 15% 0%, rgba(0,229,255,.35), transparent 55%),
    linear-gradient(180deg, rgba(7,7,12,.15) 0%, rgba(7,7,12,.85) 100%);
  mix-blend-mode: screen;
}
.hero-grain {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.25) 0 1px, transparent 1px 3px);
}
.hero-tag {
  position: absolute; right: 14px; top: 12px; z-index: 3;
  font-family: "Orbitron"; font-size: .62rem; letter-spacing: .35em;
  text-transform: uppercase; color: var(--cyan);
  padding: 5px 10px; border: 1px solid rgba(0,229,255,.5);
  border-radius: 999px; background: rgba(0,0,0,.35);
  text-shadow: var(--glow-cyan); box-shadow: var(--glow-cyan);
}

/* --- der "coole Effekt": Neon-Glitch auf LOGIN --- */
.glitch {
  position: absolute; left: 0; right: 0; bottom: 16px; z-index: 4;
  text-align: center;
  font-family: "Orbitron", sans-serif; font-weight: 900;
  font-size: clamp(2.7rem, 13vw, 4.6rem); line-height: .9;
  letter-spacing: .06em; color: #fff;
  text-shadow: 0 0 7px #fff, 0 0 16px var(--cyan), 0 0 34px var(--pink);
  animation: flicker 5s infinite steps(40);
}
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute; left: 0; right: 0; top: 0;
  clip-path: inset(0 0 0 0);
}
.glitch::before {
  color: var(--cyan); text-shadow: var(--glow-cyan);
  transform: translate(-2px, 0); mix-blend-mode: screen;
  animation: glitchTop 3.4s infinite linear alternate;
}
.glitch::after {
  color: var(--pink); text-shadow: var(--glow-pink);
  transform: translate(2px, 0); mix-blend-mode: screen;
  animation: glitchBot 2.8s infinite linear alternate;
}
@keyframes glitchTop {
  0%,100% { clip-path: inset(0 0 62% 0); transform: translate(-2px,-1px); }
  20% { clip-path: inset(0 0 78% 0); transform: translate(3px,1px); }
  40% { clip-path: inset(0 0 50% 0); transform: translate(-3px,0); }
  60% { clip-path: inset(0 0 70% 0); transform: translate(2px,-1px); }
}
@keyframes glitchBot {
  0%,100% { clip-path: inset(60% 0 0 0); transform: translate(2px,1px); }
  25% { clip-path: inset(48% 0 0 0); transform: translate(-3px,0); }
  55% { clip-path: inset(72% 0 0 0); transform: translate(3px,-1px); }
}
@keyframes flicker {
  0%,18%,22%,25%,53%,57%,100% { opacity: 1; }
  20%,24%,55% { opacity: .72; }
}

.auth-form { padding: 22px 22px 26px; }
.brand-line {
  font-family: "Orbitron"; font-weight: 800; letter-spacing: .42em;
  font-size: .95rem; text-align: center; color: var(--text);
  text-shadow: 0 0 14px rgba(0,229,255,.5); margin-bottom: 14px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.auth-form .btn { margin-top: 18px; }
.hint { color: var(--muted); font-size: .82rem; text-align: center; margin-top: 10px; min-height: 1em; }
.toggle {
  display: block; text-align: center; margin-top: 14px;
  color: var(--cyan); text-decoration: none; font-weight: 600; font-size: .92rem;
}
.toggle:hover { text-shadow: var(--glow-cyan); }
.confirm {
  margin-top: 16px; padding: 12px 14px; border-radius: 12px;
  background: rgba(0,229,255,.08); border: 1px solid rgba(0,229,255,.3);
  font-size: .9rem; color: #d8faff;
}

/* =====================================================================
   APP
   ===================================================================== */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 12px clamp(14px, 4vw, 28px);
  background: rgba(7,7,12,.78); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar__brand {
  font-family: "Orbitron"; font-weight: 900; letter-spacing: .28em;
  font-size: 1.1rem; color: #fff; text-shadow: 0 0 16px var(--pink);
}
.topbar__nav { display: flex; gap: 6px; margin-left: 6px; }
.navbtn {
  background: transparent; border: 0; cursor: pointer;
  color: var(--muted); font-family: inherit; font-weight: 700; font-size: .98rem;
  padding: 8px 14px; border-radius: 999px; transition: .15s;
}
.navbtn:hover { color: var(--text); }
.navbtn.active {
  color: #fff; background: rgba(255,27,141,.14);
  box-shadow: inset 0 0 0 1px rgba(255,27,141,.4);
}
.topbar__me { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.me-name { font-weight: 600; font-size: .92rem; color: var(--text); }
@media (max-width: 540px) { .me-name { display: none; } }
.iconbtn {
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer; font-size: 1.1rem;
  transition: .15s;
}
.iconbtn:hover { color: var(--danger); border-color: var(--danger); }

.container { width: min(620px, 100%); margin: 0 auto; padding: 18px clamp(12px, 4vw, 18px) 80px; }

/* ---------- Composer ---------- */
.composer {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-bottom: 22px;
  box-shadow: 0 0 0 1px rgba(0,229,255,.07);
}
.composer__row { display: flex; gap: 12px; align-items: flex-start; }
.composer__row textarea {
  flex: 1; background: transparent; border: 0; color: var(--text);
  font-family: inherit; font-size: 1.08rem; resize: none; padding-top: 8px;
}
.composer__row textarea:focus { outline: none; }
.composer__bar { display: flex; align-items: center; gap: 14px; margin-top: 10px;
  padding-top: 10px; border-top: 1px solid var(--border); }
.attach { cursor: pointer; font-size: 1.3rem; line-height: 1;
  filter: grayscale(.2); transition: transform .15s; }
.attach:hover { transform: scale(1.15); }
.counter { margin-left: auto; font-variant-numeric: tabular-nums;
  color: var(--muted); font-weight: 700; font-size: .9rem; }
.counter.warn { color: #ffd166; }
.counter.danger { color: var(--danger); }
.composer__preview:not(:empty) { margin-top: 12px; }
.composer-thumb { position: relative; display: inline-block; }
.composer-thumb img { max-height: 260px; max-width: 100%; border-radius: 12px;
  border: 1px solid var(--border); }
.thumb-x {
  position: absolute; top: 8px; right: 8px; width: 30px; height: 30px;
  border-radius: 50%; border: 0; cursor: pointer; font-size: 1.1rem;
  background: rgba(0,0,0,.7); color: #fff;
}

/* ---------- Posts ---------- */
.feed { display: flex; flex-direction: column; gap: 18px; }
.post {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  transition: border-color .2s, box-shadow .2s;
  animation: cardIn .4s ease both;
}
.post:hover { border-color: rgba(255,27,141,.3);
  box-shadow: 0 0 0 1px rgba(255,27,141,.18), 0 8px 30px rgba(0,0,0,.35); }
.post__head { display: flex; align-items: center; gap: 12px; }
.post__who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.post__who .name { font-weight: 700; }
.post__who .handle { font-size: .8rem; color: var(--muted); }
.post__del, .comment__del {
  margin-left: auto; background: transparent; border: 0; color: var(--muted);
  cursor: pointer; font-size: 1.3rem; line-height: 1; opacity: .55; transition: .15s;
}
.post__del:hover, .comment__del:hover { color: var(--danger); opacity: 1; }
.post__body { margin: 12px 2px; font-size: 1.12rem; line-height: 1.45; white-space: pre-wrap;
  word-break: break-word; }
.post__media { display: block; margin-top: 8px; }
.post__media img { width: 100%; border-radius: 12px; border: 1px solid var(--border);
  display: block; }
.post__acts { display: flex; gap: 10px; margin-top: 14px; }
.act-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  color: var(--muted); border-radius: 999px; padding: 7px 14px;
  cursor: pointer; font-family: inherit; font-size: .95rem; font-weight: 600;
  transition: .15s;
}
.act-btn:hover { color: var(--text); border-color: rgba(255,255,255,.2); }
.like-btn .heart { font-size: 1.1rem; line-height: 1; }
.like-btn.on { color: var(--pink); border-color: rgba(255,27,141,.5);
  background: rgba(255,27,141,.12); box-shadow: var(--glow-pink); }
.like-btn.on .heart { animation: pop .35s ease; }
@keyframes pop { 0%{transform:scale(1);} 45%{transform:scale(1.45);} 100%{transform:scale(1);} }

/* ---------- Kommentare ---------- */
.comments { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.comment-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.comment { display: flex; gap: 10px; align-items: flex-start; }
.comment__bubble { background: rgba(255,255,255,.05); border: 1px solid var(--border);
  border-radius: 12px; padding: 8px 12px; flex: 1; min-width: 0; }
.comment__name { font-weight: 700; font-size: .85rem; color: var(--cyan); display: block; }
.comment__text { word-break: break-word; white-space: pre-wrap; }
.comment-form { display: flex; gap: 8px; }
.comment-input { flex: 1; background: rgba(255,255,255,.05); border: 1px solid var(--border);
  border-radius: 999px; padding: 10px 16px; color: var(--text); font-family: inherit; }
.comment-input:focus { outline: none; border-color: var(--cyan); box-shadow: var(--glow-cyan); }
.comment-send { border: 0; border-radius: 50%; width: 42px; height: 42px; cursor: pointer;
  background: linear-gradient(120deg, var(--pink), var(--cyan)); color: #fff; font-size: 1.05rem; }

/* ---------- Profil ---------- */
.profile-card {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  box-shadow: 0 0 50px rgba(177,75,255,.12);
}
.profile-top { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.profile-handle { font-family: "Orbitron"; font-weight: 700; font-size: 1.05rem;
  margin-bottom: 10px; color: #fff; text-shadow: var(--glow-cyan); }
.profile-card .btn.primary { margin-top: 18px; }

/* ---------- Feed-Status / Loader ---------- */
.feed-empty { text-align: center; color: var(--muted); padding: 50px 18px;
  border: 1px dashed var(--border); border-radius: var(--radius); }
.feed-empty__big { font-family: "Orbitron"; font-size: 1.3rem; color: var(--text);
  margin-bottom: 8px; text-shadow: var(--glow-pink); }
.loader { display: flex; align-items: center; justify-content: center; gap: 10px;
  color: var(--muted); padding: 30px; }
.loader.small { padding: 12px; }
.spinner { width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.2); border-top-color: var(--cyan);
  animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px);
  z-index: 100; max-width: 90vw;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 13px 18px; font-weight: 600; opacity: 0; pointer-events: none;
  box-shadow: 0 16px 40px rgba(0,0,0,.5); transition: .25s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.toast--success { border-color: rgba(30,219,143,.5); box-shadow: 0 0 24px rgba(30,219,143,.3); }
#toast.toast--error   { border-color: rgba(255,77,109,.5); box-shadow: 0 0 24px rgba(255,77,109,.3); }

/* ---------- Config-Banner ---------- */
.config-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  background: linear-gradient(90deg, var(--pink), var(--purple));
  color: #fff; padding: 10px 16px; font-size: .9rem; text-align: center;
}
.config-banner code { background: rgba(0,0,0,.25); color: #fff; }

/* ---------- Klickbare Namen/Avatare ---------- */
[role="button"] { cursor: pointer; }
.post__who .name[role="button"]:hover,
.comment__name[role="button"]:hover,
.wall-msg__name[role="button"]:hover { color: var(--cyan); }

/* ---------- @Erwähnungen ---------- */
.mention {
  color: var(--cyan); font-weight: 600; cursor: pointer;
  text-decoration: none; border-radius: 4px; padding: 0 2px;
}
.mention:hover { text-shadow: var(--glow-cyan); background: rgba(0,229,255,.1); }

.mention-dd {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 14px 34px rgba(0,0,0,.55);
  overflow: hidden auto; max-height: 240px;
}
.mention-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px; cursor: pointer;
}
.mention-item.active, .mention-item:hover { background: rgba(255,27,141,.16); }
.mention-uname { font-weight: 600; color: var(--cyan); }
.mention-dn { color: var(--muted); font-size: .85rem; margin-left: auto;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Playas-Seite ---------- */
.players-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.players-title { font-family: "Orbitron"; font-weight: 900; letter-spacing: .1em;
  font-size: 1.6rem; color: #fff; text-shadow: var(--glow-pink); }
.players-count { color: var(--muted); }
.players-grid { display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.player-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 14px; cursor: pointer; font-family: inherit; color: var(--text); transition: .15s;
}
.player-card:hover { border-color: rgba(0,229,255,.4);
  box-shadow: 0 0 0 1px rgba(0,229,255,.2), 0 10px 26px rgba(0,0,0,.35); transform: translateY(-2px); }
.avatar.lg { width: 66px; height: 66px; }
.player-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; width: 100%; }
.player-name { font-weight: 700; }
.player-handle { color: var(--cyan); font-size: .85rem; }
.player-bio { color: var(--muted); font-size: .85rem; margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.player-since { color: var(--muted); font-size: .74rem; margin-top: 4px; }

/* ---------- Profil-Ansicht (fremd) ---------- */
.profile-name { font-weight: 800; font-size: 1.3rem; }
.profile-since { font-size: .8rem; margin-top: 4px; }
.profile-bio { margin-top: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }

/* "Anstupsen"-Button auf fremden Profilen */
.poke-btn {
  margin-top: 18px; width: 100%;
  background: linear-gradient(100deg, var(--pink), var(--danger));
  color: #fff; font-weight: 800; letter-spacing: .02em;
  box-shadow: 0 0 18px rgba(255, 77, 109, .5);
}
.poke-btn:hover:not(:disabled) { filter: brightness(1.12); }
.poke-btn:active { transform: translateY(1px) scale(.99); }

/* ---------- Pinnwand ---------- */
.wall { margin-top: 22px; }
.wall-title { font-family: "Orbitron"; font-weight: 700; letter-spacing: .04em;
  font-size: 1.05rem; margin-bottom: 12px; color: #fff; text-shadow: var(--glow-cyan); }
.wall-compose { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 18px; }
.wall-input { flex: 1; }
.wall-list { display: flex; flex-direction: column; gap: 12px; }
.wall-msg { display: flex; gap: 10px; align-items: flex-start;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; }
.wall-msg .avatar { width: 38px; height: 38px; }
.wall-msg__main { flex: 1; min-width: 0; }
.wall-msg__head { display: flex; align-items: baseline; gap: 8px; }
.wall-msg__name { font-weight: 700; }
.wall-msg__time { color: var(--muted); font-size: .8rem; }
.wall-msg__body { margin-top: 4px; white-space: pre-wrap; word-break: break-word; }
.wall-msg__del { margin-left: auto; background: transparent; border: 0; color: var(--muted);
  cursor: pointer; font-size: 1.2rem; line-height: 1; opacity: .55; }
.wall-msg__del:hover { color: var(--danger); opacity: 1; }
.wall-empty { padding: 14px 0; }

/* ---------- Bewegung reduzieren ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
