:root {
  --bg: #09090b;
  --surface: rgba(17, 17, 20, 0.78);
  --surface-solid: #111114;
  --surface-hover: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.085);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;
  --accent: #e4e4e7;
  --card-blur: 20px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --online: #23a55a;
  --idle: #f0b232;
  --dnd: #f23f43;
  --offline: #80848e;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

.hidden {
  display: none !important;
}

.bg-layer, .ambient-cover, .bg-scrim {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.bg-layer {
  z-index: -3;
  background-size: cover;
  background-position: center;
}

.bg-layer video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ambient-cover {
  z-index: -2;
  background-size: cover;
  background-position: center;
  filter: blur(88px) saturate(1.15);
  transform: scale(1.22);
  opacity: 0;
  transition: opacity 0.8s var(--ease);
}

.ambient-cover.visible {
  opacity: 0.22;
}

.bg-scrim {
  z-index: -1;
  background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.03), transparent 55%),
              linear-gradient(180deg, rgba(9, 9, 11, 0.58) 0%, rgba(9, 9, 11, 0.92) 100%);
}

.topbar {
  max-width: 920px;
  margin: 0 auto;
  padding: 18px 20px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: 'Outfit', 'Inter', sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--text-dim);
  transition: background 0.3s var(--ease);
}

.brand-dot.live {
  background: var(--online);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.22s var(--ease);
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.08);
}

.shell {
  max-width: 920px;
  margin: 0 auto;
  padding: 14px 20px 72px;
}

.surface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  backdrop-filter: blur(var(--card-blur));
  -webkit-backdrop-filter: blur(var(--card-blur));
}

.gate-card {
  max-width: 420px;
  margin: 90px auto;
  padding: 36px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
}

.hero-card {
  overflow: hidden;
  margin-bottom: 18px;
}

.hero-banner {
  width: 100%;
  height: 152px;
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--border);
}

.hero-main {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-head {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.avatar-wrap {
  position: relative;
  width: 84px;
  height: 84px;
  flex-shrink: 0;
}

.avatar-img {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-strong);
  background: #18181b;
}

.avatar-deco {
  position: absolute;
  inset: -9px;
  width: 102px;
  height: 102px;
  pointer-events: none;
}

.status-dot {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid #111114;
  background: var(--offline);
}

.status-dot.status-online { background: var(--online); }
.status-dot.status-idle { background: var(--idle); }
.status-dot.status-dnd { background: var(--dnd); }
.status-dot.status-offline { background: var(--offline); }

.identity {
  flex: 1;
  min-width: 0;
}

.name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

h1 {
  margin: 0;
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

h2 {
  margin: 0;
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.badges-row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.badge-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.handle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.handle-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-muted);
}

.meta-pill {
  font-size: 12px;
  color: var(--text-dim);
}

.custom-status {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

.custom-status img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.bio-text {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: #d4d4d8;
  white-space: pre-wrap;
}

.links-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.link-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.link-pill:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-strong);
}

.now-playing-card {
  display: flex;
  gap: 16px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  align-items: center;
}

.np-cover-wrap {
  position: relative;
  width: 84px;
  height: 84px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #18181b;
}

.np-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.eq-bars {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: 4px 5px;
  border-radius: 6px;
  background: rgba(9, 9, 11, 0.78);
  height: 18px;
}

.eq-bars span {
  width: 2.5px;
  background: var(--accent);
  border-radius: 2px;
  animation: eqPulse 0.9s ease-in-out infinite;
}

.eq-bars span:nth-child(2) { animation-delay: 0.2s; }
.eq-bars span:nth-child(3) { animation-delay: 0.4s; }

@keyframes eqPulse {
  0%, 100% { height: 3px; }
  50% { height: 10px; }
}

.np-info {
  flex: 1;
  min-width: 0;
}

.np-kicker-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
}

.np-state {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.np-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.np-title {
  display: block;
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-title:hover {
  text-decoration: underline;
}

.np-artist {
  font-size: 13.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.np-album {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.np-progress-wrap {
  margin-top: 10px;
}

.np-progress-track {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.np-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.1s linear;
}

.np-times {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
}

.rp-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.rp-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.rp-art-wrap {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.rp-large {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  background: #18181b;
}

.rp-small {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #111114;
  object-fit: cover;
}

.rp-body {
  min-width: 0;
  flex: 1;
}

.rp-name {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rp-detail, .rp-time {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rp-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

.tabs-nav {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tab-btn {
  padding: 9px 15px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s var(--ease);
}

.tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  color: #09090b;
  background: var(--accent);
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.tab-panel.active {
  display: flex;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.kpi-card {
  padding: 16px 18px;
}

.kpi-val {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.kpi-lbl {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.panel-card {
  padding: 18px 20px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-tag {
  font-size: 11.5px;
  color: var(--text-dim);
}

.panel-foot {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

.rank-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rank-num {
  width: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
  text-align: right;
  flex-shrink: 0;
}

.rank-img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  background: #18181b;
  flex-shrink: 0;
}

.rank-img.round {
  border-radius: 50%;
}

.rank-meta {
  flex: 1;
  min-width: 0;
}

.rank-title {
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-sub {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-bar-bg {
  margin-top: 5px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.rank-bar-fill {
  height: 100%;
  background: var(--accent);
  opacity: 0.7;
}

.rank-plays {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.track-table {
  display: flex;
  flex-direction: column;
}

.track-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.track-row:last-child {
  border-bottom: none;
}

.track-row:hover {
  background: var(--surface-hover);
  border-radius: 10px;
}

.track-meta {
  flex: 1;
  min-width: 0;
}

.track-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.track-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--text-dim);
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 14px;
}

.album-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.album-cover {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: #18181b;
}

.period-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.seg-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}

.seg-btn.active {
  background: var(--accent);
  color: #09090b;
}

.svg-chart-wrap {
  width: 100%;
  overflow-x: auto;
}

.recap-actions {
  display: flex;
  gap: 8px;
}

.recap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.recap-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recap-hero-img {
  width: 68px;
  height: 68px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.recap-hero-img.round {
  border-radius: 50%;
}

.recap-big {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.collection-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.btn-primary, .btn-secondary, .ghost-btn, .icon-only-btn {
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  font-size: 13px;
  transition: all 0.2s var(--ease);
}

.btn-primary {
  padding: 9px 16px;
  background: var(--accent);
  color: #09090b;
  border: none;
}

.btn-secondary {
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text);
}

.ghost-btn {
  padding: 5px 10px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
}

.icon-only-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
}

.input-field {
  width: 100%;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(9, 9, 11, 0.6);
  border: 1px solid var(--border);
  font-size: 13px;
  outline: none;
}

.input-field:focus {
  border-color: var(--border-strong);
}

.search-box {
  width: 220px;
}

/* Story Modal */
.story-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.86);
  backdrop-filter: blur(16px);
  display: grid;
  place-items: center;
  padding: 16px;
}

.story-frame {
  width: 100%;
  max-width: 440px;
  min-height: 580px;
  background: #111114;
  border: 1px solid var(--border-strong);
  border-radius: 26px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.story-bars {
  display: grid;
  grid-auto-flow: column;
  gap: 5px;
}

.story-bar {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.story-bar.done, .story-bar.active {
  background: var(--accent);
}

.story-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.story-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.story-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 12px 6px;
}

.story-cover {
  width: 190px;
  height: 190px;
  border-radius: 18px;
  object-fit: cover;
  border: 1px solid var(--border-strong);
}

.story-cover.round {
  border-radius: 50%;
}

.story-num {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 46px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.story-title {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 600;
}

.story-sub {
  font-size: 14px;
  color: var(--text-muted);
}

.story-nav {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

/* Studio Drawer */
.studio-drawer {
  position: fixed;
  inset: 0;
  z-index: 70;
}

.studio-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
}

.studio-sheet {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(500px, 100vw);
  background: #101013;
  border-left: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
}

.studio-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.studio-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.studio-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}

.st-tab {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}

.st-tab.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border);
  color: var(--text);
}

.studio-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13px;
}

.code-copy-box {
  display: flex;
  gap: 8px;
  align-items: center;
}

.empty-state {
  padding: 24px 12px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  padding: 10px 16px;
  border-radius: 999px;
  background: #18181b;
  border: 1px solid var(--border-strong);
  font-size: 13px;
}

@media (max-width: 720px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .split-grid {
    grid-template-columns: 1fr;
  }
  .profile-head {
    flex-direction: column;
  }
  .search-box {
    width: 100%;
  }
}
