:root {
  color-scheme: dark;
  --bg: #08060b;
  --panel: #110d16;
  --panel-soft: #17111d;
  --line: rgba(255, 255, 255, .09);
  --text: #fff;
  --muted: rgba(255, 255, 255, .64);
  --pink: #ff4fa3;
  --purple: #9b5cff;
  --gold: #ffd166;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(
      circle at 12% 0%,
      rgba(155, 92, 255, .13),
      transparent 32rem
    ),
    radial-gradient(
      circle at 90% 18%,
      rgba(255, 79, 163, .10),
      transparent 34rem
    ),
    var(--bg);
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.fld-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 72px;
  padding:
    max(12px, env(safe-area-inset-top))
    clamp(15px, 3vw, 34px)
    12px;
  display: flex;
  align-items: center;
  gap: 24px;
  background: rgba(8, 6, 11, .88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.fld-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 900;
  white-space: nowrap;
}

.fld-brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background:
    linear-gradient(
      135deg,
      #6e36d9,
      #cc287e
    );
  font-size: .78rem;
  box-shadow:
    0 8px 28px rgba(155, 92, 255, .28);
}

.fld-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fld-nav a {
  padding: 10px 14px;
  border-radius: 12px;
  color: rgba(255, 255, 255, .76);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 750;
}

.fld-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, .07);
}

.fld-icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .055);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
}

.profile-shell {
  width: min(1050px, 100%);
  margin: 0 auto;
  padding: 22px clamp(12px, 3vw, 25px) 80px;
}

.profile-hero {
  position: relative;
  min-height: 390px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background:
    radial-gradient(
      circle at 22% 25%,
      rgba(155, 92, 255, .52),
      transparent 36%
    ),
    radial-gradient(
      circle at 80% 35%,
      rgba(255, 79, 163, .37),
      transparent 35%
    ),
    linear-gradient(
      145deg,
      #211229,
      #0b0910 70%
    );
  background-position: center;
  background-size: cover;
  box-shadow:
    0 24px 70px rgba(0, 0, 0, .38);
}

.profile-cover-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      to bottom,
      rgba(7, 5, 10, .08) 20%,
      rgba(7, 5, 10, .70) 67%,
      rgba(7, 5, 10, .98)
    );
}

.profile-identity {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 35px;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
}

.profile-avatar-wrap {
  width: 132px;
  height: 132px;
  overflow: hidden;
  border: 4px solid rgba(255, 255, 255, .88);
  border-radius: 50%;
  background:
    linear-gradient(
      135deg,
      #813bdb,
      #d53388
    );
  box-shadow:
    0 14px 40px rgba(0, 0, 0, .42);
}

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

.profile-avatar-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 3rem;
  font-weight: 950;
}

.profile-copy {
  min-width: 0;
}

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

.profile-name-row h1 {
  margin: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size:
    clamp(1.75rem, 5vw, 2.7rem);
  line-height: 1.06;
  letter-spacing: -.035em;
}

.creator-badge {
  padding: 6px 10px;
  border: 1px solid rgba(255, 209, 102, .42);
  border-radius: 999px;
  background: rgba(255, 209, 102, .12);
  color: var(--gold);
  font-size: .73rem;
  font-weight: 900;
  white-space: nowrap;
}

.profile-handle {
  margin-top: 7px;
  color: rgba(255, 255, 255, .65);
  font-weight: 700;
}

.profile-bio {
  max-width: 620px;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, .84);
  line-height: 1.55;
  white-space: pre-wrap;
}

.profile-interests {
  margin-top: 15px;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.interest-chip {
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  color: rgba(255, 255, 255, .84);
  font-size: .76rem;
  font-weight: 750;
}

.profile-actions {
  display: flex;
  gap: 9px;
  align-items: center;
}

.primary-action,
.secondary-action {
  min-height: 45px;
  padding: 0 19px;
  border-radius: 14px;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.primary-action {
  border: 0;
  background:
    linear-gradient(
      135deg,
      var(--purple),
      var(--pink)
    );
  box-shadow:
    0 10px 28px rgba(255, 79, 163, .22);
}

.primary-action[data-following="1"] {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .08);
  box-shadow: none;
}

.secondary-action {
  border: 1px solid var(--line);
  background: rgba(10, 8, 13, .67);
}

.profile-stats {
  margin: 14px 0 0;
  padding: 17px 22px;
  display: flex;
  align-items: center;
  gap: clamp(28px, 8vw, 75px);
  border: 1px solid var(--line);
  border-radius: 19px;
  background: rgba(17, 13, 22, .88);
}

.profile-stats div {
  display: grid;
  gap: 3px;
}

.profile-stats strong {
  font-size: 1.12rem;
}

.profile-stats span {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
}

.profile-tabs {
  position: sticky;
  top: 71px;
  z-index: 50;
  margin-top: 17px;
  padding: 7px;
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(12, 9, 15, .92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.profile-tabs::-webkit-scrollbar {
  display: none;
}

.profile-tab {
  min-height: 42px;
  padding: 0 17px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, .61);
  font-weight: 850;
  white-space: nowrap;
  cursor: pointer;
}

.profile-tab.active {
  color: #fff;
  background:
    linear-gradient(
      135deg,
      rgba(155, 92, 255, .29),
      rgba(255, 79, 163, .20)
    );
  box-shadow:
    inset 0 0 0 1px
    rgba(255, 255, 255, .09);
}

.profile-content {
  padding-top: 18px;
}

.profile-status {
  padding: 42px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  color: var(--muted);
  text-align: center;
}

.profile-status[hidden] {
  display: none;
}

.profile-grid {
  display: grid;
  gap: 17px;
}

.post-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(
      145deg,
      rgba(23, 17, 29, .98),
      rgba(13, 10, 17, .98)
    );
  box-shadow:
    0 15px 45px rgba(0, 0, 0, .18);
}

.post-head {
  padding: 16px 18px 13px;
  display: flex;
  align-items: center;
  gap: 11px;
}

.post-avatar {
  width: 43px;
  height: 43px;
  border: 2px solid rgba(255, 79, 163, .42);
  border-radius: 50%;
  object-fit: cover;
  background: #24162b;
}

.post-author {
  min-width: 0;
}

.post-author strong,
.post-author span {
  display: block;
}

.post-author strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-author span {
  margin-top: 2px;
  color: var(--muted);
  font-size: .75rem;
}

.post-access {
  margin-left: auto;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: rgba(255, 255, 255, .72);
  font-size: .68rem;
  font-weight: 900;
}

.post-caption {
  padding: 0 18px 16px;
  color: rgba(255, 255, 255, .88);
  line-height: 1.52;
  white-space: pre-wrap;
}

.post-media {
  position: relative;
  min-height: 220px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #030205;
  cursor: pointer;
}

.post-media img {
  display: block;
  width: 100%;
  max-height: 720px;
  object-fit: contain;
}

.post-media-placeholder {
  min-height: 260px;
  width: 100%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(
      circle at center,
      rgba(155, 92, 255, .22),
      transparent 50%
    ),
    #08060b;
  color: var(--muted);
  font-weight: 800;
}

.play-button {
  position: absolute;
  width: 65px;
  height: 65px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .27);
  border-radius: 50%;
  background: rgba(8, 5, 11, .76);
  color: #fff;
  font-size: 1.45rem;
  backdrop-filter: blur(9px);
}

.locked-cover::after {
  content: "🔒";
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(7, 5, 10, .83);
}

.post-footer {
  padding: 14px 18px;
  display: flex;
  gap: 20px;
  color: rgba(255, 255, 255, .65);
  font-size: .83rem;
  font-weight: 750;
}

.product-price {
  margin-left: auto;
  color: #ff9dcc;
  font-weight: 950;
}

.about-card {
  padding: clamp(20px, 4vw, 30px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
}

.about-card + .about-card {
  margin-top: 16px;
}

.about-card h2 {
  margin: 0 0 13px;
  font-size: 1.12rem;
}

.about-card p {
  margin: 0;
  color: rgba(255, 255, 255, .76);
  line-height: 1.62;
  white-space: pre-wrap;
}

.profile-links {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.profile-link {
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .055);
  color: #fff;
  text-decoration: none;
  font-size: .82rem;
  font-weight: 800;
}

.empty-panel {
  padding: 58px 20px;
  border: 1px dashed rgba(255, 255, 255, .13);
  border-radius: 22px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 760px) {
  .fld-topbar {
    min-height: 64px;
    gap: 10px;
  }

  .fld-nav {
    display: none;
  }

  .fld-icon-button {
    margin-left: auto;
  }

  .profile-shell {
    padding-top: 12px;
  }

  .profile-hero {
    min-height: 460px;
    border-radius: 21px;
  }

  .profile-identity {
    padding: 24px 20px;
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: end;
    gap: 15px;
  }

  .profile-avatar-wrap {
    width: 88px;
    height: 88px;
    border-width: 3px;
  }

  .profile-avatar-fallback {
    font-size: 2rem;
  }

  .profile-copy {
    align-self: center;
  }

  .profile-name-row h1 {
    font-size: 1.55rem;
  }

  .profile-bio,
  .profile-interests {
    grid-column: 1 / -1;
  }

  .profile-actions {
    grid-column: 1 / -1;
    width: 100%;
  }

  .profile-actions button {
    flex: 1;
  }

  .profile-stats {
    justify-content: space-around;
    gap: 12px;
  }

  .profile-tabs {
    top: 63px;
    border-radius: 15px;
  }

  .profile-tab {
    padding: 0 14px;
  }

  .post-card {
    border-radius: 19px;
  }
}


/* =========================================================
   UNIVERSAL PROFILE ACTIONS
   ========================================================= */

[hidden] {
  display: none !important;
}

.profile-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
}

.profile-actions button {
  min-height: 42px;
  white-space: nowrap;
}

#followProfile.is-following {
  color: #f2ddff;
  background: rgba(159, 83, 255, .13);
  border-color: rgba(198, 142, 255, .48);
}

#subscribeProfile {
  color: #fff;
  background:
    linear-gradient(
      135deg,
      #eb329b,
      #9f42ed
    );
  border-color: rgba(255, 130, 220, .58);
}

#editProfile {
  color: #fff;
  background:
    linear-gradient(
      135deg,
      #7c43e8,
      #b52ddb
    );
}

@media (max-width: 720px) {
  .profile-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .profile-actions button {
    flex: 1 1 auto;
  }
}


/* ===== UNIVERSAL PROFILE ENGAGEMENT ===== */

.post-footer button{
  appearance:none;
  border:0;
  color:inherit;
  font:inherit;
}

.profile-like-button,
.profile-comment-button{
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:38px;
  padding:7px 11px;
  border-radius:999px !important;
  background:rgba(255,255,255,.055);
  cursor:pointer;
  transition:
    transform .16s ease,
    background .16s ease,
    color .16s ease;
}

.profile-like-button:hover,
.profile-comment-button:hover{
  transform:translateY(-1px);
  background:rgba(255,255,255,.1);
}

.profile-like-button.is-liked{
  color:#ff4f8f;
  background:rgba(255,79,143,.12);
}

.profile-like-button:disabled,
.profile-comment-button:disabled{
  cursor:wait;
  opacity:.58;
}

.profile-comments-open{
  overflow:hidden;
}

.profile-comments-modal{
  position:fixed;
  inset:0;
  z-index:10050;
  display:none;
}

.profile-comments-modal.open{
  display:block;
}

.profile-comments-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.72);
  backdrop-filter:blur(10px);
}

.profile-comments-sheet{
  position:absolute;
  top:50%;
  left:50%;
  width:min(620px,calc(100% - 28px));
  max-height:min(760px,86vh);
  transform:translate(-50%,-50%);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.13);
  border-radius:24px;
  background:#17101d;
  color:#fff;
  box-shadow:0 32px 100px rgba(0,0,0,.62);
}

.profile-comments-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  padding:19px 20px 16px;
  border-bottom:1px solid rgba(255,255,255,.09);
}

.profile-comments-header h2{
  margin:3px 0 0;
  font-size:1.3rem;
}

.profile-comments-kicker{
  color:#d6b5ff;
  font-size:.68rem;
  font-weight:900;
  letter-spacing:.15em;
}

.profile-comments-close{
  width:42px;
  height:42px;
  border:0;
  border-radius:50%;
  background:rgba(255,255,255,.08);
  color:#fff;
  font-size:25px;
  cursor:pointer;
}

.profile-comments-list{
  flex:1;
  min-height:180px;
  overflow:auto;
  padding:8px 20px 18px;
}

.profile-comments-empty{
  padding:50px 15px;
  text-align:center;
  color:rgba(255,255,255,.6);
}

.profile-comment{
  display:grid;
  grid-template-columns:40px minmax(0,1fr);
  gap:11px;
  padding:15px 0;
  border-bottom:1px solid rgba(255,255,255,.07);
}

.profile-comment.is-reply{
  grid-template-columns:32px minmax(0,1fr);
  padding:12px 0 0;
  border-bottom:0;
}

.profile-comment-avatar{
  width:40px;
  height:40px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:linear-gradient(135deg,#ff4fa3,#7b2cff);
  font-size:.75rem;
  font-weight:900;
}

.profile-comment.is-reply .profile-comment-avatar{
  width:32px;
  height:32px;
  font-size:.65rem;
}

.profile-comment-body{
  min-width:0;
}

.profile-comment-head{
  display:flex;
  align-items:baseline;
  gap:7px;
  flex-wrap:wrap;
}

.profile-comment-head span{
  color:rgba(255,255,255,.53);
  font-size:.8rem;
}

.profile-comment-text{
  margin-top:6px;
  line-height:1.48;
  overflow-wrap:anywhere;
}

.profile-comment-gif{
  display:block;
  width:min(280px,100%);
  max-height:260px;
  margin-top:10px;
  border-radius:13px;
  object-fit:contain;
  background:#09060c;
}

.profile-comment-meta{
  display:flex;
  align-items:center;
  gap:12px;
  min-height:24px;
  margin-top:7px;
  color:rgba(255,255,255,.48);
  font-size:.73rem;
}

.profile-comment-meta button{
  border:0;
  background:none;
  color:#d6b5ff;
  font:inherit;
  font-weight:800;
  cursor:pointer;
}

.profile-comment-replies{
  margin-top:4px;
  padding-left:5px;
}

.profile-reply-banner{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:9px 18px;
  background:rgba(123,44,255,.13);
  color:#dcc8ff;
  font-size:.8rem;
}

.profile-reply-banner[hidden]{
  display:none;
}

.profile-reply-banner button{
  border:0;
  background:none;
  color:#fff;
  font-weight:800;
  cursor:pointer;
}

.profile-comment-form{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:end;
  gap:10px;
  padding:14px 16px max(14px,env(safe-area-inset-bottom));
  border-top:1px solid rgba(255,255,255,.09);
  background:#130d18;
}

.profile-comment-form textarea{
  width:100%;
  min-height:46px;
  max-height:130px;
  resize:none;
  box-sizing:border-box;
  padding:12px 14px;
  border:1px solid rgba(255,255,255,.13);
  border-radius:15px;
  outline:none;
  background:rgba(255,255,255,.06);
  color:#fff;
  font:inherit;
}

.profile-comment-form textarea:focus{
  border-color:#9f67ff;
  box-shadow:0 0 0 3px rgba(123,44,255,.14);
}

.profile-comment-form button{
  min-height:46px;
  padding:0 18px;
  border:0;
  border-radius:14px;
  background:linear-gradient(135deg,#ff4fa3,#7b2cff);
  color:#fff;
  font-weight:900;
  cursor:pointer;
}

.profile-comment-form button:disabled{
  opacity:.55;
  cursor:wait;
}

@media(max-width:650px){
  .profile-comments-sheet{
    top:auto;
    bottom:0;
    left:0;
    width:100%;
    max-height:88vh;
    transform:none;
    border-radius:24px 24px 0 0;
  }

  .profile-comments-list{
    padding-left:15px;
    padding-right:15px;
  }
}

/* Universal profile playlists */
#profileGrid.profile-playlists-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr));
  gap:18px;
}
.profile-playlists-heading {
  grid-column:1/-1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
  padding:10px 0;
}
.profile-playlists-heading h2 {
  margin:0 0 6px;
  font-size:1.35rem;
}
.profile-playlists-heading p {
  margin:0;
  color:#bdb0c8;
  line-height:1.5;
}
.profile-playlists-heading .secondary-action {
  text-decoration:none;
}
.profile-playlist-card {
  overflow:hidden;
  border:1px solid #ffffff20;
  border-radius:20px;
  background:#150d1b;
  box-shadow:0 12px 32px #0003;
}
.profile-playlist-open {
  display:block;
  color:inherit;
  text-decoration:none;
}
.profile-playlist-art {
  min-height:155px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:14px;
  background:
    radial-gradient(ellipse at 15% 15%,#ff43bb55,transparent 65%),
    linear-gradient(135deg,#44205b,#261145 70%,#3e1c70);
}
.profile-playlist-art>span {
  font-size:38px;
  color:#fff;
}
.profile-playlist-art small {
  font-size:11px;
  font-weight:800;
  letter-spacing:.12em;
  color:#ead8ff;
}
.profile-playlist-info {
  padding:18px;
}
.profile-playlist-info h3 {
  margin:0 0 8px;
  overflow-wrap:anywhere;
  font-size:1.12rem;
}
.profile-playlist-info p {
  margin:0 0 14px;
  color:#c5b8cf;
  font-size:.85rem;
}
.profile-playlist-info>span {
  font-size:.85rem;
  color:#edb2ff;
  font-weight:750;
}
.profile-playlist-controls {
  padding:0 18px 18px;
}
.profile-playlist-controls button {
  width:100%;
  min-height:42px;
  cursor:pointer;
}
.profile-playlist-open:focus-visible {
  outline:3px solid #d887ff;
  outline-offset:-3px;
}
