:root{
  --bg0:#070A12;
  --bg1:#0B1020;
  --text:#ffffff;
  --muted:rgba(255,255,255,.62);

  --theme-rgb: 0,190,255;
  --accent: rgba(var(--theme-rgb),1);

  --glass: rgba(255,255,255,.07);
  --glass2: rgba(255,255,255,.10);
  --border: rgba(255,255,255,.12);
  --shadow: 0 18px 60px rgba(0,0,0,.35);

  --r-xl: 24px;
  --r-lg: 18px;
  --r-md: 14px;

  --pad: 18px;
  --max: 1500px;
}

*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{
  font-family:'Outfit',system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background: radial-gradient(1200px 900px at 10% 10%, rgba(var(--theme-rgb),.12), transparent 60%),
              radial-gradient(900px 700px at 90% 20%, rgba(160,90,255,.10), transparent 55%),
              linear-gradient(180deg, var(--bg0), var(--bg1));
  color:var(--text);
  overflow-x:hidden;
}

a{color:inherit;text-decoration:none}
button,input{font-family:inherit}

.subtle{color:var(--muted)}
.hidden{display:none!important}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace}
.clamp{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.glass{
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.05));
  border:1px solid var(--border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
  border-radius: var(--r-xl);
}

/* Background system */
.dynamic-bg-wrapper{position:fixed;inset:0;z-index:-1;overflow:hidden}
.bg-layer{
  position:absolute;inset:-6%;
  width:112%;height:112%;
  object-fit:cover;
  opacity:0;
  filter: blur(90px) brightness(.35) saturate(1.25);
  transform: scale(1.02);
  transition: opacity 1.2s ease;
}
.bg-layer.active{opacity:1}
.vignette{position:absolute;inset:0;background:radial-gradient(circle at 50% 40%, transparent 0%, rgba(0,0,0,.78) 75%)}
.bg-mesh{
  position:absolute;inset:0;
  background:
    radial-gradient(1000px 700px at 15% 85%, rgba(var(--theme-rgb),.12), transparent 55%),
    radial-gradient(900px 700px at 85% 80%, rgba(255,255,255,.06), transparent 60%);
  mix-blend-mode: screen;
  opacity:.7;
  pointer-events:none;
}
.bg-noise{
  position:absolute;inset:0;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
  opacity:.25;
  pointer-events:none;
}

/* Top bar */
.topbar{
  position:sticky;top:14px;z-index:30;
  margin:14px auto 0 auto;
  width:min(96vw,var(--max));
  padding:12px 14px;
  border-radius: 999px;
  display:flex;align-items:center;justify-content:space-between;
  gap:14px;
}
.topbar-left{display:flex;align-items:center;gap:18px;min-width:0}
.brand{display:flex;align-items:baseline;gap:10px;padding:6px 10px;border-radius:999px}
.brand-dot{width:10px;height:10px;border-radius:999px;background:var(--accent);box-shadow:0 0 0 6px rgba(var(--theme-rgb),.14)}
.brand-name{font-weight:800;letter-spacing:-.02em}
.brand-sub{font-size:.85rem;color:var(--muted)}
.topnav{display:flex;align-items:center;gap:6px;background:rgba(255,255,255,.06);padding:5px;border-radius:999px}
.navlink{
  padding:7px 12px;border-radius:999px;
  color:var(--muted);font-weight:650;font-size:.92rem;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.navlink:hover{color:var(--text);background:rgba(255,255,255,.08)}
.navlink.active{color:#0b0d12;background:rgba(255,255,255,.92)}

.topbar-right{display:flex;align-items:center;gap:10px}
.global-search{
  display:flex;align-items:center;gap:10px;
  background:rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.12);
  padding:8px 10px;border-radius:999px;
  min-width: 280px;
}
.global-search input{
  width: 240px; max-width: 28vw;
  background:transparent;border:none;outline:none;color:var(--text);
}
.icon{opacity:.85}
.icon-btn{
  width:32px;height:32px;border-radius:999px;
  background:transparent;border:1px solid rgba(255,255,255,.12);
  color:var(--text);cursor:pointer;
  display:grid;place-items:center;
  transition: background .18s ease, transform .18s ease;
}
.icon-btn:hover{background:rgba(255,255,255,.08);transform:translateY(-1px)}

.auth{display:flex;align-items:center;gap:10px}
.user{display:flex;align-items:center;gap:10px}
.user-pill{display:flex;align-items:center;gap:10px;background:rgba(255,255,255,.06);padding:7px 10px;border-radius:999px}
.avatar{width:34px;height:34px;border-radius:999px;background:rgba(var(--theme-rgb),.18);border:1px solid rgba(var(--theme-rgb),.25);display:grid;place-items:center;font-weight:800}
.user-meta{display:flex;flex-direction:column;line-height:1.05}
.user-name{font-weight:800}

/* Buttons */
.btn{
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.07);
  color:var(--text);
  padding:10px 12px;
  border-radius: 999px;
  cursor:pointer;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease, border-color .18s ease;
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
}
.btn:hover{transform:translateY(-1px);background:rgba(255,255,255,.10);border-color:rgba(255,255,255,.18)}
.btn-primary{
  background: rgba(var(--theme-rgb), .95);
  border-color: rgba(var(--theme-rgb), .55);
  color: #061018;
  font-weight: 800;
  box-shadow: 0 18px 50px rgba(var(--theme-rgb), .18);
}
.btn-primary:hover{background: rgba(var(--theme-rgb), 1)}
.btn-ghost{background:rgba(255,255,255,.06)}
.btn.wide{width:100%}
.link-btn{background:transparent;border:none;color:rgba(255,255,255,.85);cursor:pointer;text-decoration:underline}
.link-btn:hover{color:#fff}

/* Shell layout */
.shell{
  width:min(96vw,var(--max));
  margin: 16px auto 0 auto;
  display:grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  padding-bottom: 20px;
}

/* Rail */
.rail{
  position:sticky;
  top: 92px;
  height: calc(100dvh - 120px);
  padding: 12px;
  border-radius: var(--r-xl);
  overflow:auto;
}
.rail-item{
  width:100%;
  border:none;
  background:transparent;
  color:var(--muted);
  padding: 10px 10px;
  border-radius: 14px;
  cursor:pointer;
  display:flex;align-items:center;gap:10px;
  font-weight:700;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.rail-item:hover{background:rgba(255,255,255,.07);color:var(--text);transform:translateY(-1px)}
.rail-item.active{background:rgba(var(--theme-rgb),.18);color:var(--text);border:1px solid rgba(var(--theme-rgb),.22)}
.rail-ic{width:24px;display:inline-flex;justify-content:center;opacity:.9}
.rail-divider{height:1px;background:rgba(255,255,255,.10);margin: 12px 6px}
.rail-link{
  display:block;
  padding:10px 10px;
  border-radius:14px;
  color:rgba(255,255,255,.84);
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.10);
  margin: 8px 2px;
}
.rail-link:hover{background:rgba(255,255,255,.08)}
.rail-foot{margin-top:10px;padding:10px 8px;font-size:.9rem}

/* Views */
.content{min-width:0}
.view{display:none}
.view.active{display:block}

/* Hero */
.hero{
  border-radius: var(--r-xl);
  padding: 16px;
  display:grid;
  grid-template-columns: 340px 1fr;
  gap: 18px;
  overflow:hidden;
}
.hero-art{
  position:relative;
  width:100%;
  aspect-ratio:1/1;
  border-radius: var(--r-lg);
  overflow:hidden;
  border: 1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.04);
}
.hero-art img{width:100%;height:100%;object-fit:cover}
.hero-badge{
  position:absolute;top:12px;left:12px;
  padding:6px 10px;border-radius:999px;
  background:rgba(0,0,0,.45);
  border:1px solid rgba(255,255,255,.12);
  font-weight:850;font-size:.75rem;letter-spacing:.08em
}
.hero-right{display:flex;flex-direction:column;gap:10px;min-width:0}
.hero-top{display:flex;align-items:center;justify-content:space-between;gap:12px}
.pill{
  display:inline-flex;align-items:center;gap:10px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  padding:8px 12px;border-radius:999px;
}
.pill .dot{width:8px;height:8px;border-radius:999px;background:var(--accent);box-shadow:0 0 0 5px rgba(var(--theme-rgb),.12)}
.pill .k{font-weight:800;font-size:.85rem;letter-spacing:.02em}
.pill .v{color:rgba(255,255,255,.85);font-weight:650;font-size:.85rem}
.hero-actions{display:flex;gap:8px}

#track-name{font-size:3.1rem;letter-spacing:-.03em;line-height:1.0;font-weight:900}
#artist-name{font-size:1.25rem}
#album-name{font-size:1.02rem;opacity:.85}

.hero-stats{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}
.kv{
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  padding: 12px;
  min-width:0;
}
.kv .k{font-size:.78rem;text-transform:uppercase;letter-spacing:.10em;color:rgba(255,255,255,.65);font-weight:800}
.kv .v{font-size:1.25rem;font-weight:900;margin-top:6px;min-width:0}

.cycle-loader{
  height:3px;
  border-radius:999px;
  background: rgba(255,255,255,.12);
  overflow:hidden;
  margin-top:auto;
}
.cycle-bar{height:100%;width:0%;background:var(--accent);transition:width .1s linear}

/* Dash */
.dash{margin-top:16px}
.dash-head{
  display:flex;align-items:flex-end;justify-content:space-between;
  gap: 14px;
  padding: 4px 2px 14px 2px;
}
.dash-title{font-size:1.35rem;font-weight:900;letter-spacing:-.02em}
.dash-controls{display:flex;align-items:center;gap:10px;flex-wrap:wrap}

.chip-group{
  display:flex;align-items:center;gap:6px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  padding: 6px;border-radius:999px;
}
.chip{
  border:none;
  background:transparent;
  color: rgba(255,255,255,.75);
  padding: 8px 12px;
  border-radius:999px;
  cursor:pointer;
  font-weight:900;
  transition: background .18s ease, color .18s ease;
}
.chip:hover{color:#fff;background:rgba(255,255,255,.07)}
.chip.active{background:rgba(255,255,255,.92);color:#0b0d12}

/* Grid system */
.grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.span-2{grid-column: span 2}
.span-4{grid-column: span 4}

.card{
  padding: 14px;
  border-radius: var(--r-xl);
  min-width:0;
}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.card-title{font-weight:950;letter-spacing:-.02em}
.card-ic{opacity:.9;font-size:1.1rem}
.big{font-size:2.25rem;font-weight:950;letter-spacing:-.03em}

.split{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.kvline{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.10);
  border-radius:16px;
  padding:12px;
  min-width:0;
}
.kvline .k{color:rgba(255,255,255,.68);font-weight:850;font-size:.82rem;text-transform:uppercase;letter-spacing:.08em}
.kvline .v{font-weight:950;min-width:0;text-align:right}

.mini-bars{display:flex;align-items:flex-end;gap:6px;height:64px;margin-top:12px}
.mini-bars .bar{
  flex:1;
  height:100%;
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.10);
  border-radius:10px;
  overflow:hidden;
  position:relative;
}
.mini-bars .bar i{
  display:block;width:100%;height:100%;
  background:rgba(var(--theme-rgb),.85);
  transform-origin:bottom;
  transform: scaleY(.1);
  transition: transform .35s ease;
}
.mini-bars .bar span{
  position:absolute;inset:auto 0 6px 0;
  text-align:center;
  font-size:11px;
  font-weight:900;
  color: rgba(10,12,18,.95);
  text-shadow: 0 1px 2px rgba(255,255,255,.35);
}

/* Lists */
.list{display:flex;flex-direction:column;gap:8px}
.track-row{
  display:grid;
  grid-template-columns: 24px 44px 1fr auto;
  gap:10px;
  align-items:center;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  cursor:pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.track-row:hover{transform:translateY(-1px);background:rgba(255,255,255,.06);border-color:rgba(255,255,255,.14)}
.row-rank{font-weight:950;color:rgba(255,255,255,.75)}
.row-art{width:44px;height:44px;border-radius:12px;object-fit:cover;border:1px solid rgba(255,255,255,.12)}
.row-info strong{display:block;font-weight:950}
.row-info p{color:rgba(255,255,255,.66);font-size:.9rem;margin-top:2px}
.row-stat{font-weight:950;color:rgba(var(--theme-rgb),1)}

.rank{display:flex;flex-direction:column;gap:8px}
.rank-row{
  display:flex;align-items:center;gap:10px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
}
.rank-badge{
  width:28px;height:28px;border-radius:10px;
  display:grid;place-items:center;
  background: rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.10);
  font-weight:950;
}
.rank-main{min-width:0}
.rank-main p{font-size:.9rem;color:rgba(255,255,255,.66);margin-top:2px}
.rank-stat{margin-left:auto;font-weight:950;color:rgba(var(--theme-rgb),1)}

/* Milestones */
.milestones{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.milestone-card{
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 12px;
  display:flex;gap:10px;align-items:flex-start;
}
.milestone-icon{font-size:1.1rem}
.milestone-info h4{font-weight:950}
.milestone-info p{font-size:.9rem;color:rgba(255,255,255,.66);margin-top:2px}
.milestone-info .date{display:inline-block;margin-top:6px;font-size:.82rem;color:rgba(255,255,255,.62)}

/* Panels */
.panel{
  padding: 16px;
  border-radius: var(--r-xl);
}
.panel h4{font-size:1.35rem;font-weight:950;letter-spacing:-.02em}
.panel p{margin-top:6px}
.panel-head{
  display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-bottom:12px
}
.panel-tools{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.table-wrap{overflow:auto;border-radius: var(--r-lg);border:1px solid rgba(255,255,255,.10)}
.activity-table{width:100%;border-collapse:collapse;background:rgba(255,255,255,.02)}
.activity-table th{
  text-align:left;
  padding: 12px 14px;
  font-size:.78rem;
  text-transform:uppercase;
  letter-spacing:.10em;
  color:rgba(255,255,255,.68);
  border-bottom:1px solid rgba(255,255,255,.08);
}
.activity-table td{
  padding: 12px 14px;
  border-bottom:1px solid rgba(255,255,255,.05);
}
.activity-table tr:hover td{background:rgba(255,255,255,.04);cursor:pointer}

.local-search input{
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  border-radius:999px;
  padding:10px 12px;
  color:var(--text);
  outline:none;
}
.local-search input:focus{border-color:rgba(var(--theme-rgb),.35)}

/* Insights layout */
.insights-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.dow{display:flex;gap:10px;align-items:flex-end;height:160px;margin-top:10px}
.dow .d{
  flex:1;
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.10);
  border-radius:14px;
  overflow:hidden;
  position:relative;
}
.dow .d i{
  display:block;width:100%;height:100%;
  background:rgba(var(--theme-rgb),.82);
  transform-origin:bottom;
  transform:scaleY(.12);
  transition: transform .35s ease;
}
.dow .d span{
  position:absolute;inset:auto 0 8px 0;
  text-align:center;
  font-weight:950;
  font-size:.82rem;
  color: rgba(10,12,18,.95);
  text-shadow: 0 1px 2px rgba(255,255,255,.35);
}

/* Tools row */
.actions-row{display:flex;flex-wrap:wrap;gap:10px}
.actions-col{display:flex;flex-direction:column;gap:10px}
#tool-status{margin-top:10px}

/* Social */
.codebox{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.10);
  border-radius:16px;
  padding: 12px;
  margin-top: 10px;
}

/* Footer */
.footer{
  width:min(96vw,var(--max));
  margin: 18px auto 30px auto;
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding: 10px 2px;
}
.footer-links{display:flex;gap:12px}
.footer-links a{color:rgba(255,255,255,.70)}
.footer-links a:hover{color:#fff}

/* Modal */
.modal{position:fixed;inset:0;z-index:80;display:grid;place-items:center}
.modal-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.55)}
.modal-card{
  width: min(92vw, 420px);
  padding: 14px;
  border-radius: var(--r-xl);
  position:relative;
}
.modal-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:10px}
.form{display:flex;flex-direction:column;gap:10px;margin-top:10px}
.field span{display:block;font-weight:900;margin-bottom:6px;color:rgba(255,255,255,.85)}
.field input{
  width:100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: var(--text);
  outline:none;
}
.field input:focus{border-color: rgba(var(--theme-rgb),.35)}
.error-text{color:#ff6b6b;font-weight:800}
.form-foot{display:flex;align-items:center;justify-content:center;gap:10px;margin-top:6px}

/* Responsive */
@media (max-width: 1080px){
  .shell{grid-template-columns: 1fr}
  .rail{position:relative;top:auto;height:auto}
  .hero{grid-template-columns: 1fr}
  .hero-stats{grid-template-columns: repeat(2,minmax(0,1fr))}
  .grid, .insights-grid{grid-template-columns: repeat(2, minmax(0, 1fr))}
  .span-4{grid-column: span 2}
  .global-search{display:none}
}
@media (max-width: 560px){
  #track-name{font-size:2.2rem}
  .grid,.insights-grid{grid-template-columns: 1fr}
  .span-2,.span-4{grid-column: span 1}
  .milestones{grid-template-columns: 1fr}
}
