@import url("https://fonts.googleapis.com/css2?family=Unbounded:wght@300;500;700&family=Instrument+Sans:wght@400;600;700&display=swap");

:root{
  --bg:#0a0a0b;
  --bg-2:#0f1114;
  --card:#12151b;
  --card-2:#141a22;
  --muted:#a9b0bc;
  --text:#eef1f6;
  --accent:#f2c14e;
  --accent-strong:#ffdb7a;
  --emerald:#38d996;
  --crimson:#ff6b6b;
  --line:rgba(255,255,255,0.08);
  font-family: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}
*{box-sizing:border-box}
html,body{height:100%;margin:0;background:var(--bg);color:var(--text)}
body{min-height:100dvh}

.forum-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 20px;
  border-bottom:1px solid var(--line);
  background:
    radial-gradient(1200px 200px at 20% -20%, rgba(242,193,78,0.12), transparent),
    linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
  position:sticky;top:0;z-index:10;
}
.brand{display:flex;gap:12px;align-items:center}
.brand .logo{
  width:36px;height:36px;border-radius:8px;
  background:transparent;
  border:1px solid var(--line);
  display:flex;align-items:center;justify-content:center;
  color:var(--accent);font-weight:700;
  font-family:"Unbounded", sans-serif;
  overflow:hidden;
}
.brand .logo img{
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
}
.brand h1{margin:0;font-size:18px;font-family:"Unbounded", sans-serif;letter-spacing:0.2px}
.brand p{margin:0;font-size:12px;color:var(--muted)}
.header-actions{display:flex;gap:10px;align-items:center}
.user-badge{
  font-size:12px;color:var(--muted);
  padding:6px 10px;border-radius:999px;
  border:1px solid var(--line);
}

.forum{
  display:grid;
  grid-template-columns:260px 1fr 340px;
  gap:16px;
  padding:18px;
  min-height:calc(100vh - 64px);
  background:
    radial-gradient(900px 400px at 85% 0%, rgba(56,217,150,0.08), transparent),
    radial-gradient(900px 300px at 10% 10%, rgba(242,193,78,0.08), transparent);
}

.panel{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px;
  margin-bottom:12px;
  box-shadow:0 10px 30px rgba(0,0,0,0.35);
}
.panel h3{margin:0 0 8px 0;font-size:13px;color:var(--accent);letter-spacing:0.2px}
.panel input{
  width:100%;
  padding:8px 10px;
  border-radius:8px;
  border:1px solid var(--line);
  background:#0f1319;
  color:var(--text);
}
.tag-cloud{display:flex;flex-wrap:wrap;gap:6px}
.tag{
  font-size:11px;
  padding:4px 8px;
  border-radius:999px;
  background:rgba(255,255,255,0.06);
  color:var(--muted);
  cursor:pointer;
}
.tag.active{background:rgba(242,193,78,0.2);color:var(--accent)}

.forum-content{display:flex;flex-direction:column;gap:10px}
.toolbar{display:flex;justify-content:space-between;align-items:center}
.toolbar-actions{display:flex;gap:8px;align-items:center}
.tabs{display:flex;gap:8px}
.tab{
  border:1px solid var(--line);
  background:transparent;
  color:var(--muted);
  padding:6px 12px;
  border-radius:999px;
  cursor:pointer;
  font-size:12px;
}
.tab.active{color:#0a0a0b;background:var(--accent);border:0}
.btn{
  padding:8px 12px;
  border-radius:10px;
  border:1px solid var(--line);
  background:transparent;
  color:var(--text);
  cursor:pointer;
}
.btn.primary{background:linear-gradient(90deg,var(--accent),var(--accent-strong));color:#0a0a0b;border:0}
.btn.ghost{background:rgba(255,255,255,0.02)}

.posts-list{display:flex;flex-direction:column;gap:10px}
.post-card{
  border-radius:16px;
  border:1px solid var(--line);
  background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  padding:14px;
  display:grid;
  grid-template-columns:72px 1fr;
  gap:14px;
  cursor:pointer;
  position:relative;
  overflow:hidden;
  box-shadow:0 12px 30px rgba(0,0,0,0.35);
}
.post-card::after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(120deg, rgba(242,193,78,0.08), transparent 55%);
  opacity:0;
  transition:opacity .2s ease;
  pointer-events:none;
}
.post-card:hover::after{opacity:1;}
.post-meta{
  display:flex;flex-direction:column;align-items:center;gap:6px;
  color:var(--muted);font-size:12px;
}
.vote-box{
  display:flex;flex-direction:column;align-items:center;gap:4px;
  padding:6px;
  border-radius:12px;
  background:rgba(255,255,255,0.04);
  border:1px solid var(--line);
}
.vote-btn{
  border:0;
  background:transparent;
  color:var(--muted);
  cursor:pointer;
  font-size:12px;
  line-height:1;
}
.vote-btn:hover{color:var(--accent)}
.post-content h4{margin:0 0 6px 0;font-size:15px}
.post-content p{margin:0;color:var(--muted);font-size:12px;line-height:1.4}
.post-tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}

.forum-detail{
  border-left:1px solid var(--line);
  padding-left:12px;
}
.detail-card{
  border-radius:16px;
  border:1px solid var(--line);
  background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  padding:14px;
  box-shadow:0 12px 30px rgba(0,0,0,0.35);
  max-height:0;
  opacity:0;
  overflow:hidden;
  transform:translateY(-6px);
  transition:max-height .22s ease, opacity .18s ease, transform .18s ease;
}
.detail-card h3{margin-top:0}
.detail-card.open{
  max-height:2000px;
  opacity:1;
  transform:translateY(0);
}
.reply-list{display:flex;flex-direction:column;gap:10px;margin-top:10px}
.reply{
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(255,255,255,0.02);
  padding:10px;
}
.reply-header{display:flex;justify-content:space-between;font-size:11px;color:var(--muted)}
.reply-body{margin:6px 0 0 0;font-size:12px;line-height:1.4}
.reply-action{
  margin-top:6px;
  border:0;
  background:transparent;
  color:var(--accent);
  font-size:11px;
  cursor:pointer;
}
.replying-to{
  margin-top:8px;
  font-size:11px;
  color:var(--muted);
  padding:6px 8px;
  border-radius:8px;
  background:rgba(255,255,255,0.04);
}
.reply-actions{
  display:flex;
  gap:8px;
  margin-top:8px;
}
.hidden{display:none !important;}

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

.modal-backdrop{
  position:fixed;inset:0;background:rgba(0,0,0,0.6);
  display:none;align-items:center;justify-content:center;z-index:30;
}
.modal-backdrop.active{display:flex}
.modal{
  width:100%;max-width:520px;background:var(--card);
  padding:18px;border-radius:16px;
  display:flex;flex-direction:column;gap:10px;
  box-shadow:0 16px 40px rgba(0,0,0,0.45);
}
.modal input,.modal textarea{
  padding:10px;border-radius:10px;border:1px solid var(--line);
  background:#0f1319;color:var(--text);
}
.modal .actions{display:flex;justify-content:flex-end;gap:8px}

/* Reply editor stability */
#replyInput{
  width:100%;
  max-width:100%;
  min-height:44px;
  resize:none;
  box-sizing:border-box;
  border-radius:12px;
  border:1px solid var(--line);
  background:#0f1319;
  color:var(--text);
  padding:10px 12px;
  font-size:13px;
  line-height:1.4;
}
#sendReply{
  width:100%;
}

.toast-wrap{
  position:fixed;right:16px;bottom:16px;
  display:flex;flex-direction:column;gap:10px;z-index:60
}
.toast{
  min-width:220px;max-width:320px;
  padding:12px 14px;border-radius:12px;
  background:rgba(15,15,15,0.95);
  border:1px solid rgba(255,255,255,0.08);
  color:#fff;font-size:13px;line-height:1.3;
  display:flex;gap:10px;align-items:flex-start;
}
.toast .dot{width:10px;height:10px;border-radius:50%;background:var(--accent);margin-top:3px}
.toast.success .dot{background:var(--accent-strong)}
.toast.error .dot{background:#ff6b6b}
.toast .title{font-weight:700;margin-bottom:4px}
.toast .desc{color:var(--muted)}

@media(max-width:980px){
  .forum{grid-template-columns:1fr;gap:12px}
  .forum-detail{border-left:0;padding-left:0}
}
