/* ============================================================
   KnightDrum Community — design system
   ============================================================ */
:root{
  --bg:#070708;
  --bg-2:#0c0c0e;
  --panel:#121214;
  --panel-2:#1a1a1e;
  --line:#2a2730;
  --line-soft:#201d26;
  --txt:#f3eef2;
  --mut:#9a8f98;
  --mut-2:#6b626d;
  --acc:#ff2e88;
  --acc-2:#ec1e79;
  --acc-grad:linear-gradient(135deg,#ff63ad 0%,#ec1e79 100%);
  --ok:#3ddc97;
  --warn:#ffb84d;
  --radius:14px;
  --radius-sm:10px;
  --shadow:0 18px 50px -20px rgba(0,0,0,.85);
  --glow:0 0 0 1px rgba(255,46,136,.30), 0 14px 40px -12px rgba(236,30,121,.45);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:
    radial-gradient(1100px 600px at 80% -10%, rgba(255,46,136,.12), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(236,30,121,.08), transparent 55%),
    var(--bg);
  color:var(--txt);
  font-family:"Inter",-apple-system,Segoe UI,Roboto,sans-serif;
  font-size:15px; line-height:1.55;
  -webkit-font-smoothing:antialiased;
  min-height:100vh;
}
a{color:inherit;text-decoration:none}
h1,h2,h3{font-family:"Space Grotesk","Inter",sans-serif;letter-spacing:-.01em;margin:0}
.muted{color:var(--mut)}
.mono{font-family:"Space Grotesk",monospace}

/* ---------- top nav ---------- */
.nav{
  position:sticky;top:0;z-index:50;
  display:flex;align-items:center;gap:26px;
  padding:14px 28px;
  background:rgba(11,12,17,.72);
  backdrop-filter:saturate(150%) blur(14px);
  border-bottom:1px solid var(--line-soft);
}
.brand{display:flex;align-items:center;gap:12px;font-family:"Space Grotesk";font-weight:700;font-size:18px;letter-spacing:.04em}
.brand .mark{
  width:30px;height:30px;border-radius:8px;background:var(--acc-grad);
  display:grid;place-items:center;box-shadow:var(--glow);
}
.brand .mark::before{content:"";width:12px;height:12px;border-radius:3px;background:#0b0c11}
.brand b{color:var(--acc)}
.nav .links{display:flex;gap:6px;margin-left:8px}
.nav .links a{
  padding:8px 14px;border-radius:999px;color:var(--mut);font-weight:500;font-size:14px;
  transition:.15s;
}
.nav .links a:hover{color:var(--txt);background:var(--panel)}
.nav .links a.active{color:#0a0a0c;background:#A5E247;font-weight:600}
.nav .spacer{flex:1}
.avatar{
  width:34px;height:34px;border-radius:50%;background:var(--acc-grad);
  display:grid;place-items:center;font-weight:700;font-size:14px;color:#0b0c11;cursor:pointer;
  border:none;
}
.avatar.lg{width:64px;height:64px;font-size:24px}

/* ---------- buttons / inputs ---------- */
.btn{
  display:inline-flex;align-items:center;gap:8px;justify-content:center;
  border:none;border-radius:999px;cursor:pointer;
  font:600 14px/1 "Inter";padding:11px 18px;color:#0b0c11;
  background:var(--acc-grad);box-shadow:0 8px 24px -10px rgba(255,46,110,.6);
  transition:.15s;
}
.btn:hover{transform:translateY(-1px);filter:brightness(1.06)}
.btn:active{transform:translateY(0)}
.btn:disabled{opacity:.45;cursor:default;transform:none;filter:none}
.btn.ghost{background:transparent;color:var(--txt);border:1px solid var(--line);box-shadow:none}
.btn.ghost:hover{border-color:var(--mut-2);background:var(--panel)}
.btn.sm{padding:8px 14px;font-size:13px}
.input,textarea.input{
  width:100%;background:#0a0b10;border:1px solid var(--line);color:var(--txt);
  border-radius:var(--radius-sm);padding:11px 13px;font:inherit;outline:none;transition:.15s;
}
.input:focus{border-color:var(--acc);box-shadow:0 0 0 3px rgba(255,90,60,.15)}
label.field{display:block;margin-bottom:12px}
label.field span{display:block;font-size:12px;color:var(--mut);margin-bottom:5px;letter-spacing:.02em}

/* ---------- layout ---------- */
.wrap{max-width:1120px;margin:0 auto;padding:34px 28px 80px}
.section-head{display:flex;align-items:end;justify-content:space-between;margin:0 0 20px}
.section-head h2{font-size:24px}
.section-head p{margin:4px 0 0;color:var(--mut);font-size:14px}

/* ---------- hero ---------- */
.hero{
  position:relative;overflow:hidden;
  border:1px solid var(--line-soft);border-radius:24px;
  padding:48px;margin-bottom:36px;
  background:linear-gradient(180deg,var(--panel) 0%,var(--bg-2) 100%);
}
.hero h1{font-size:46px;line-height:1.04;max-width:14ch}
.hero h1 .grad{background:var(--acc-grad);-webkit-background-clip:text;background-clip:text;color:transparent}
.hero p{max-width:48ch;color:var(--mut);font-size:17px;margin:18px 0 26px}
.hero .cta{display:flex;gap:12px;flex-wrap:wrap}
.pads{position:absolute;right:-20px;bottom:-20px;display:grid;grid-template-columns:repeat(4,46px);gap:10px;opacity:.5}
.pads i{width:46px;height:46px;border-radius:10px;background:var(--panel-2);border:1px solid var(--line)}
.pads i:nth-child(3n){background:linear-gradient(135deg,rgba(255,99,173,.55),rgba(236,30,121,.55));border:none}
.stats{display:flex;gap:30px;margin-top:30px}
.stats div b{font-family:"Space Grotesk";font-size:26px;display:block}
.stats div span{color:var(--mut);font-size:13px}

/* ---------- card grids ---------- */
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:18px}
.card{
  background:var(--panel);border:1px solid var(--line-soft);border-radius:var(--radius);
  overflow:hidden;transition:.18s;display:flex;flex-direction:column;
}
.card:hover{transform:translateY(-3px);border-color:var(--line);box-shadow:var(--shadow)}
.card .cover{height:140px;background:var(--panel-2);position:relative;overflow:hidden}
.card .cover img{width:100%;height:100%;object-fit:cover}
.card .cover.placeholder{background:
  radial-gradient(120px 80px at 30% 30%, rgba(255,99,173,.38), transparent),
  radial-gradient(140px 90px at 80% 70%, rgba(236,30,121,.32), transparent),
  var(--panel-2);display:grid;place-items:center}
.card .cover.placeholder span{font-family:"Space Grotesk";font-weight:700;font-size:30px;color:rgba(255,255,255,.25)}
.card .body{padding:15px 16px 16px}
.card .body h3{font-size:16px}
.card .by{color:var(--mut);font-size:13px;margin:3px 0 9px}
.card .by a{color:var(--acc)}
.card .desc{color:var(--mut);font-size:13px;min-height:34px}
.card .foot{display:flex;align-items:center;justify-content:space-between;margin-top:12px;padding-top:12px;border-top:1px solid var(--line-soft)}
.tag{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--mut);background:var(--panel-2);padding:5px 10px;border-radius:999px}

/* ---------- pattern row ---------- */
.plist{display:flex;flex-direction:column;gap:10px}
.prow{display:flex;align-items:center;gap:16px;background:var(--panel);border:1px solid var(--line-soft);border-radius:var(--radius-sm);padding:13px 16px}
.prow .seq{display:flex;gap:4px}
.prow .seq i{width:10px;height:22px;border-radius:3px;background:var(--panel-2)}
.prow .seq i.on{background:var(--acc-grad)}
.prow .meta{flex:1}
.prow .meta b{font-size:15px}
.prow .bpm{font-family:"Space Grotesk";font-weight:700;color:var(--acc)}

/* ---------- chat ---------- */
.chat-shell{display:grid;grid-template-columns:1fr;gap:0;background:var(--panel);border:1px solid var(--line-soft);border-radius:var(--radius);overflow:hidden}
.chat-log{height:52vh;min-height:340px;overflow:auto;padding:16px;display:flex;flex-direction:column;gap:9px;font-size:13px}
.bubble{display:flex;gap:9px;align-items:flex-start}
.bubble .ava{width:26px;height:26px;border-radius:50%;background:var(--acc-grad);background-size:cover;background-position:center;display:grid;place-items:center;color:#0b0c11;font-weight:700;font-size:11px;flex:none}
.bubble .c{min-width:0}
.bubble .c b{font-size:12px}
.bubble .c b a{color:var(--txt);cursor:pointer}
.bubble .c .t{font-size:10px;color:var(--mut-2);margin-left:6px}
.bubble .c .m{background:var(--panel-2);padding:6px 10px;border-radius:4px 11px 11px 11px;margin-top:2px;display:inline-block;font-size:13px;line-height:1.4;word-break:break-word}
.bubble .chat-img{display:block;margin-top:5px;max-width:220px;max-height:180px;border-radius:8px;border:1px solid var(--line)}
.bubble .chat-file{display:inline-block;margin-top:5px;font-size:12px;color:var(--acc);background:var(--panel-2);padding:6px 10px;border-radius:8px}
.chat-input{display:flex;gap:8px;align-items:center;padding:12px;border-top:1px solid var(--line-soft);background:var(--bg-2)}
.chat-filetag{padding:8px 14px 0;font-size:12px;color:var(--mut);display:flex;align-items:center;gap:8px}
.chat-filetag a{color:var(--acc);cursor:pointer}

/* ---------- modal ---------- */
.scrim{position:fixed;inset:0;background:rgba(5,5,9,.66);backdrop-filter:blur(4px);display:none;place-items:center;z-index:100;padding:20px}
.scrim.open{display:grid}
.modal{width:100%;max-width:420px;background:var(--panel);border:1px solid var(--line);border-radius:18px;padding:26px;box-shadow:var(--shadow)}
.modal h3{font-size:20px;margin-bottom:4px}
.modal .sub{color:var(--mut);font-size:14px;margin-bottom:20px}
.modal .switch{margin-top:16px;text-align:center;color:var(--mut);font-size:13px}
.modal .switch a{color:var(--acc);cursor:pointer}
.tabs{display:flex;gap:6px;background:var(--bg-2);padding:5px;border-radius:999px;margin-bottom:20px}
.tabs button{flex:1;border:none;background:transparent;color:var(--mut);padding:9px;border-radius:999px;cursor:pointer;font:600 14px "Inter"}
.tabs button.active{background:var(--panel-2);color:var(--txt)}

/* ---------- toast / states ---------- */
.toast-wrap{position:fixed;bottom:22px;left:50%;transform:translateX(-50%);z-index:200;display:flex;flex-direction:column;gap:8px}
.toast{background:var(--panel-2);border:1px solid var(--line);padding:12px 18px;border-radius:999px;box-shadow:var(--shadow);font-size:14px;animation:rise .2s ease}
.toast.err{border-color:var(--acc-2);color:#ffd9e2}
.toast.ok{border-color:var(--ok)}
@keyframes rise{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.empty{text-align:center;color:var(--mut);padding:50px 20px;border:1px dashed var(--line);border-radius:var(--radius)}
.empty .big{font-size:38px;margin-bottom:8px}
.skel{background:linear-gradient(90deg,var(--panel) 25%,var(--panel-2) 50%,var(--panel) 75%);background-size:200% 100%;animation:sh 1.2s infinite;border-radius:var(--radius);height:230px}
@keyframes sh{to{background-position:-200% 0}}

/* ---------- profile ---------- */
.profile-head{display:flex;align-items:center;gap:20px;margin-bottom:26px}
.profile-head h2{font-size:26px}

/* ---------- buy button ---------- */
.btn.buy{background:var(--acc-grad);color:#0a0a0c;box-shadow:0 8px 26px -8px rgba(236,30,121,.7)}
.btn.buy:hover{filter:brightness(1.08)}

/* ---------- nav logo (left, large) ---------- */
.nav-logo{height:52px;width:auto;display:block}
.brand-link{display:flex;align-items:center;margin-right:14px}
@media(max-width:720px){.nav-logo{height:36px}}

/* ---------- toolbar / search ---------- */
.toolbar{display:flex;gap:12px;margin-bottom:18px}
.toolbar .input{flex:1}
.input.sel{width:auto;min-width:170px;cursor:pointer}

/* ---------- file upload ---------- */
.file-drop{border:1px dashed var(--line);border-radius:var(--radius-sm);padding:16px;text-align:center;color:var(--mut);cursor:pointer;transition:.15s;background:#0a0b10}
.file-drop:hover,.file-drop.has{border-color:var(--acc);color:var(--txt)}
.progress{height:6px;background:var(--panel-2);border-radius:999px;overflow:hidden;margin:6px 0 12px}
.progress i{display:block;height:100%;width:30%;background:var(--acc-grad);border-radius:999px;animation:indet 1s infinite}
@keyframes indet{0%{margin-left:-30%}100%{margin-left:100%}}

/* ---------- two-up form row ---------- */
.row2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.prof-actions{display:flex;gap:10px;margin-top:4px}
.field.check{display:flex;align-items:center;gap:9px}
.field.check span{margin:0;color:var(--txt);font-size:14px}
.field.check input{width:17px;height:17px;accent-color:var(--acc)}

/* ---------- audio preview / kind tag ---------- */
.play{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border:none;cursor:pointer;background:var(--panel-2);color:var(--txt);border-radius:50%;font-size:12px;transition:.15s;flex:none}
.play:hover{background:var(--acc-grad);color:#0b0c11}
.tag.kind{background:rgba(255,46,136,.15);color:var(--acc);text-transform:capitalize}
.card .foot.two{gap:8px}
.card .foot .left{display:flex;align-items:center;gap:8px}

/* ---------- download btn on cards ---------- */
.dl{display:inline-flex;align-items:center;gap:7px;border:none;cursor:pointer;background:var(--panel-2);color:var(--txt);border-radius:999px;padding:7px 13px;font:600 13px "Inter";transition:.15s}
.dl:hover{background:var(--acc-grad);color:#0b0c11}
.dl.disabled{opacity:.4;cursor:default}
.card .by a{cursor:pointer}
.card .del{position:absolute;top:10px;right:10px;z-index:5;background:rgba(11,12,17,.85);border:1px solid var(--line);color:var(--txt);width:28px;height:28px;border-radius:8px;cursor:pointer;display:grid;place-items:center;opacity:0;transition:.15s}
.card{position:relative}
.card:hover .del{opacity:1}
body.admin .card .del{opacity:1}  /* admins: always-visible delete (touch-friendly) */

/* ---------- profile layout ---------- */
.profile-cols{display:grid;grid-template-columns:380px 1fr;gap:32px;align-items:start}
.sub-h{font-size:15px;text-transform:uppercase;letter-spacing:1px;color:var(--mut);margin:0 0 14px}
.avatar-row{display:flex;align-items:center;gap:12px}
.ava-preview{width:54px;height:54px;border-radius:50%;object-fit:cover;background:var(--panel-2);border:1px solid var(--line)}
.grid.sm{grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:14px}
.grid.sm .cover{height:100px}
@media(max-width:820px){.profile-cols{grid-template-columns:1fr}}

/* ---------- vote button ---------- */
.vote{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--line);background:var(--panel-2);color:var(--mut);border-radius:999px;padding:6px 12px;font:600 13px "Inter";cursor:pointer;transition:.15s}
.vote:hover{border-color:var(--acc);color:var(--txt)}
.vote.on{background:var(--acc-grad);border-color:transparent;color:#0b0c11}
.vote.lg{font-size:15px;padding:9px 16px;flex:none}

/* ---------- stars ---------- */
.stars{display:inline-flex;gap:3px;font-size:20px;cursor:pointer;color:var(--mut-2)}
.stars span{transition:.1s}
.stars span.lit{color:#ffc24d}
.stars.ro{cursor:default;font-size:14px}

/* ---------- detail modal + reviews ---------- */
.modal.detail{max-width:540px}
.dt-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px}
.dt-head h3{font-size:20px}
.dt-meta{display:flex;gap:8px;flex-wrap:wrap}
.reviews{display:flex;flex-direction:column;gap:12px;max-height:38vh;overflow:auto;margin-bottom:14px}
.review{background:var(--bg-2);border:1px solid var(--line-soft);border-radius:10px;padding:10px 12px}
.review .top{display:flex;justify-content:space-between;align-items:center;margin-bottom:4px}
.review .top b{font-size:13px}.review .top b a{color:var(--acc);cursor:pointer}
.review .body{font-size:14px;color:var(--txt)}
.review-form{background:var(--bg-2);border:1px solid var(--line-soft);border-radius:10px;padding:12px;display:flex;flex-direction:column;gap:8px}

/* ---------- leaderboard ---------- */
.lb-cols{display:grid;grid-template-columns:1.3fr 1fr;gap:28px;align-items:start}
.lb-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:14px}
.lb-head .sub-h{margin:0}
.lb-list{display:flex;flex-direction:column;gap:8px}
.lb-row{display:flex;align-items:center;gap:12px;background:var(--panel);border:1px solid var(--line-soft);border-radius:10px;padding:10px 13px}
.lb-row .rank{font-family:"Space Grotesk";font-weight:700;color:var(--mut-2);width:24px;text-align:center;flex:none}
.lb-row .rank.top{color:var(--acc)}
.lb-row .ava{width:30px;height:30px;border-radius:50%;background:var(--acc-grad);background-size:cover;display:grid;place-items:center;color:#0b0c11;font-weight:700;font-size:12px;flex:none}
.lb-row .grow{flex:1;min-width:0}
.lb-row .grow b{font-size:14px;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lb-row .grow small{color:var(--mut)}
.lb-row .score{font-family:"Space Grotesk";font-weight:700;color:var(--acc);flex:none}
@media(max-width:820px){.lb-cols{grid-template-columns:1fr}}

/* ---------- drag-drop overlay ---------- */
.drop-overlay{position:fixed;inset:0;z-index:300;display:none;place-items:center;background:rgba(7,7,8,.82);backdrop-filter:blur(3px)}
.drop-overlay.show{display:grid}
.drop-overlay .drop-box{border:2px dashed var(--acc);border-radius:18px;padding:50px 70px;text-align:center;font:700 22px "Space Grotesk";color:var(--txt);background:rgba(236,30,121,.08);line-height:1.5}

.view{display:none}
.view.active{display:block;animation:fade .25s ease}
@keyframes fade{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}

/* hamburger (mobile only) */
.hamburger{display:none;background:transparent;border:1px solid var(--line);color:var(--txt);border-radius:9px;width:40px;height:40px;font-size:18px;cursor:pointer;flex:none}

@media(max-width:860px){
  .hamburger{display:grid;place-items:center}
  .nav{flex-wrap:wrap;gap:10px}
  .nav .links{
    display:none; order:5; width:100%;
    flex-direction:column; gap:4px; margin:0; padding:6px 0 4px;
    border-top:1px solid var(--line-soft);
  }
  .nav.open .links{display:flex}
  .nav .links a{width:100%;padding:12px 14px;border-radius:9px;font-size:15px}
  .nav .links a.active{background:#A5E247;color:#0a0a0c}
  .nav .links .btn.buy{width:100%;justify-content:center;margin-top:4px;padding:12px}
  .brand-link{margin-right:auto}
  .nav-logo{height:34px}
}
@media(max-width:560px){
  .wrap{padding:22px 16px 70px}
  .toolbar{flex-wrap:wrap}
  .toolbar .input{min-width:0}
  .toolbar #kitSearch,.toolbar #asSearch{flex:1 1 100%}
  .input.sel{flex:1}
  .section-head{flex-wrap:wrap;gap:10px}
  .grid{grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}
  .section-head h2{font-size:20px}
  .modal{padding:20px}
  .bubble .chat-img{max-width:160px}
}
