:root {
  --bg: #000;
  --panel: #16181c;
  --border: #2f3336;
  --text: #e7e9ea;
  --muted: #71767b;
  --accent: #1d9bf0;
  --like: #f91880;
  --repost: #00ba7c;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.4;
}

a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- layout ---------- */
.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 600px) 350px;
  justify-content: center;
  min-height: 100vh;
}

.side {
  position: sticky; top: 0; height: 100vh;
  padding: 12px 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.logo { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; padding: 8px 12px 16px; }
.logo-mark { font-size: 28px; }

.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 18px;
  padding: 12px; border-radius: 999px;
  font-size: 19px;
  width: fit-content;
}
.nav-item:hover { background: #181818; }
.nav-item.active { font-weight: 700; }
.nav-item svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.badge {
  position: absolute; left: 28px; top: 6px;
  background: var(--accent); color: #fff;
  font-size: 11px; min-width: 18px; height: 18px; line-height: 18px;
  text-align: center; border-radius: 9px; padding: 0 5px;
}
.sound-btn {
  position: fixed; left: 16px; bottom: 16px; z-index: 50;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px;
  font-size: 14px; font-weight: 600;
  padding: 10px 16px; cursor: pointer;
  opacity: .6;
}
.sound-btn:hover { opacity: 1; }

.feed-col { border-left: 1px solid var(--border); border-right: 1px solid var(--border); min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  background: rgba(0, 0, 0, .7); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
}
.topbar h1 { font-size: 20px; margin: 14px 0; }

/* ---------- profiel ---------- */
.banner {
  height: 170px;
  background: linear-gradient(120deg, #1d9bf0, #7856ff 50%, #f91880);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 800; text-align: center; padding: 0 16px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}
.profile { border-bottom: 1px solid var(--border); }
.profile-info { padding: 0 16px 16px; }
.profile-info .avatar.big { margin-top: -66px; border: 4px solid var(--bg); }
.profile-name { font-size: 20px; font-weight: 800; margin-top: 8px; }
.bio { margin: 10px 0 0; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 10px 0 0; }

/* ---------- avatars ---------- */
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; object-fit: cover; flex-shrink: 0;
}
.avatar.small { width: 36px; height: 36px; font-size: 13px; }
.avatar.big { width: 133px; height: 133px; font-size: 44px; }

/* ---------- posts ---------- */
.post {
  display: flex; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.post:hover { background: #080808; }
.post.is-new { animation: pop-in .6s ease-out, highlight 4s ease-out; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: none; } }
@keyframes highlight { from { background: rgba(29, 155, 240, .18); } to { background: transparent; } }

.post-main { min-width: 0; flex: 1; }
.post-head { display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; }
.post-head .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.post-head .handle, .post-head .dot, .post-head time { color: var(--muted); }
.verified { width: 18px; height: 18px; vertical-align: -3px; }
.verified circle { fill: var(--accent); }
.verified path { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.post-body { margin-top: 2px; overflow-wrap: anywhere; }
.link { color: var(--accent); }
.post-media img { display: block; width: 100%; margin-top: 12px; border-radius: 16px; border: 1px solid var(--border); }

.post-actions { display: flex; justify-content: space-between; max-width: 425px; margin-top: 10px; color: var(--muted); }
.act { display: flex; align-items: center; gap: 6px; font-size: 13px; min-width: 60px; }
.act svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.act b { font-weight: 400; font-variant-numeric: tabular-nums; }
.act-likes:hover { color: var(--like); }
.act-reposts:hover { color: var(--repost); }
.act-replies:hover, .act-views:hover { color: var(--accent); }

.empty { color: var(--muted); text-align: center; padding: 40px 16px; }

/* ---------- draadjes (vraag + antwoord) ---------- */
.post-avatar { display: flex; flex-direction: column; align-items: center; }
.post.has-thread { border-bottom: 0; }
.post.has-thread .post-avatar::after {
  content: ""; flex: 1; width: 2px; min-height: 12px;
  background: var(--border); margin-top: 4px; margin-bottom: -12px;
}
.reply-to { color: var(--muted); font-size: 14px; }

.typing {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  animation: pop-in .4s ease-out;
}
.dots { display: inline-flex; gap: 4px; margin-left: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* vragen en antwoorden in de tijdlijn iets nadrukkelijker */
.post.is-question .post-body { font-size: 1.12em; font-weight: 600; }
.post.is-reply { background: rgba(29, 155, 240, .07); }
.post.is-reply .post-body { font-size: 1.08em; }

/* ---------- spotlight: vraag + antwoord groot in beeld ---------- */
.spot {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, .82); backdrop-filter: blur(6px);
  animation: spot-in .5s ease-out;
}
.spot.out { animation: spot-out .5s ease-in forwards; }
@keyframes spot-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes spot-out { to { opacity: 0; } }
.spot-card {
  width: min(1200px, 100%); max-height: 100%; overflow: auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: 24px;
  padding: clamp(20px, 3vw, 44px);
  box-shadow: 0 20px 80px rgba(0, 0, 0, .7);
  animation: pop-in .6s ease-out;
}
.spot-label { color: var(--accent); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: clamp(14px, 1.4vw, 20px); margin-bottom: 18px; }
.spot-q, .spot-a { display: flex; gap: clamp(12px, 1.6vw, 24px); align-items: flex-start; }
.spot .avatar { width: clamp(48px, 5vw, 84px); height: clamp(48px, 5vw, 84px); font-size: clamp(18px, 2vw, 30px); }
.spot-who { font-size: clamp(16px, 1.7vw, 26px); margin-bottom: 6px; }
.spot-text { font-size: clamp(22px, 3vw, 46px); line-height: 1.3; font-weight: 600; overflow-wrap: anywhere; }
.spot-a { margin-top: clamp(20px, 3vw, 40px); padding-top: clamp(20px, 3vw, 40px); border-top: 2px solid var(--border); }
.spot-a.answered { animation: pop-in .6s ease-out; }
.spot-a .spot-text { font-weight: 500; color: #fff; }
.spot-a .verified { width: 1em; height: 1em; vertical-align: -0.12em; }
.spot-typing { font-size: clamp(18px, 2vw, 30px); color: var(--muted); display: flex; align-items: center; gap: 10px; }
.spot .dots i { width: 10px; height: 10px; }

/* ---------- vraag stellen ---------- */
.compose { padding: 10px 16px; border-bottom: 1px solid var(--border); }
.compose-row { display: flex; gap: 8px; align-items: center; }
.compose input {
  font: inherit; color: var(--text); background: transparent; min-width: 0;
  border: 1px solid var(--border); border-radius: 999px; padding: 8px 14px;
}
.compose #ask-body { flex: 1; }
.compose #ask-name { width: 130px; flex-shrink: 0; }
.compose input:focus { outline: none; border-color: var(--accent); }
.compose button {
  background: var(--accent); color: #fff; border: 0; border-radius: 999px; flex-shrink: 0;
  font-weight: 700; font-size: 15px; padding: 8px 16px; cursor: pointer;
}
#ask-msg { font-size: 13px; margin: 6px 4px 0; }
#ask-msg.ok { color: var(--repost); }
#ask-msg.err { color: var(--like); }
@media (max-width: 480px) {
  .compose-row { flex-wrap: wrap; }
  .compose #ask-body { flex-basis: 100%; }
  .compose #ask-name { flex: 1; width: auto; }
}
.compose button:disabled { opacity: .5; cursor: default; }
body.tv .compose { display: none; }

/* ---------- rechterkolom ---------- */
.right { padding: 12px 24px; }
.box { background: var(--panel); border-radius: 16px; padding: 12px 0; position: sticky; top: 12px; }
.box h2 { font-size: 20px; margin: 0 16px 8px; }
.box ol { list-style: none; margin: 0; padding: 0; }
.box li { padding: 10px 16px; display: flex; flex-direction: column; }
.box li:hover { background: #1d1f23; }
.box small { color: var(--muted); font-size: 13px; }

/* ---------- toasts ---------- */
#toasts {
  position: fixed; top: 16px; right: 16px; z-index: 100;
  display: flex; flex-direction: column; gap: 10px;
  width: min(380px, calc(100vw - 32px));
}
.toast {
  display: flex; gap: 12px; align-items: flex-start;
  background: #15202b; border: 1px solid #38444d; border-left: 4px solid var(--accent);
  border-radius: 12px; padding: 12px 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .6);
  animation: toast-in .35s ease-out;
}
.toast.out { animation: toast-out .4s ease-in forwards; }
.toast-content { min-width: 0; }
.toast-title { font-size: 14px; }
.toast-text { margin-top: 2px; font-size: 14px; overflow-wrap: anywhere; }
@keyframes toast-in { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(40px); } }

/* ---------- presentatie / TV-modus (index.php?tv) ---------- */
body.tv .side { display: none; }
body.tv .layout { grid-template-columns: minmax(0, 1100px) minmax(320px, 460px); gap: 0 12px; }
body.tv .right { padding: 16px 24px; }
body.tv .box { padding: 16px 0; }
body.tv .box h2 { font-size: 30px; margin: 0 24px 12px; }
body.tv .box li { padding: 14px 24px; }
body.tv .box b { font-size: 26px; }
body.tv .box small { font-size: 17px; }
body.tv { font-size: 22px; }
body.tv .avatar { width: 60px; height: 60px; font-size: 22px; }
body.tv .avatar.big { width: 160px; height: 160px; font-size: 54px; margin-top: -80px; }
body.tv .post-actions { max-width: 640px; }
body.tv .act { font-size: 19px; }
body.tv .act svg, body.tv .verified { width: 26px; height: 26px; }
body.tv #toasts { width: min(520px, calc(100vw - 32px)); }
body.tv .toast-title, body.tv .toast-text { font-size: 20px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 88px minmax(0, 600px); }
  .right { display: none; }
  .logo span:last-child, .nav-item span { display: none; }
}
@media (max-width: 640px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .feed-col { border: 0; }
  .banner { height: 120px; font-size: 22px; }
  .avatar.big { width: 90px; height: 90px; font-size: 30px; }
  .profile-info .avatar.big { margin-top: -45px; }
}
