body {
  min-height: 100vh;
  background: #b4e6ff;
  color: #123b5d;
}

.profile-page {
  width: min(880px, calc(100% - 32px));
  margin: 0 auto;
  padding: 46px 0 70px;
}

.profile-back {
  display: inline-block;
  margin-bottom: 22px;
  color: #1769aa;
  font: 16px "Minecraft Ten", sans-serif;
  text-decoration: none;
}

.profile-card {
  overflow: hidden;
  background: #dff3ff;
  border: 3px solid #123b5d;
  border-radius: 18px;
  box-shadow: 0 16px 38px rgba(18, 59, 93, .2);
}

.profile-banner {
  height: 130px;
  background: linear-gradient(135deg, #1769aa, #32bfe9);
}

.profile-identity {
  display: flex;
  gap: 22px;
  align-items: end;
  padding: 0 34px 26px;
  margin-top: -52px;
}

.profile-avatar {
  width: 118px;
  height: 118px;
  flex: 0 0 auto;
  object-fit: cover;
  border: 5px solid #fffbd6;
  border-radius: 50%;
  background: #fffbd6;
  box-shadow: 0 5px 0 #123b5d;
}

.profile-form label > span {
  display: block;
  color: #0874a8;
  font: 12px "Minecraft Ten", sans-serif;
  letter-spacing: .6px;
}

.profile-display-name,
.profile-username { margin: 0; }
.profile-display-name { color: #123b5d; font: 20px "Minecraft Ten", sans-serif; }
.profile-display-name.buildnitro-name { color: var(--profile-name-color, #fff5ff); text-shadow: 0 0 5px var(--profile-name-color, #a141ff), 0 0 12px #7d16da, 0 2px 0 #2b1450; }
.profile-display-name[data-font="regular"] { font-family: Arial, sans-serif; font-weight: 800; }
.profile-display-name[data-font="blocky"] { font-family: Impact, Haettenschweiler, "Arial Black", sans-serif; letter-spacing: .7px; }
.profile-display-name[data-font="minecraft"] { font-family: "Minecraft Ten", sans-serif; }
.profile-username { margin-top: 6px; color: #55758c; font: 15px "Minecraft Ten", sans-serif; }
.profile-account-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 0; }
.profile-account-row .profile-username { margin: 0; }
.profile-buildbucks { padding: 4px 7px; color: #8a4a00; background: #ffe38b; border: 1px solid #b87b12; border-radius: 999px; font: 10px "Minecraft Ten", sans-serif; white-space: nowrap; }
.profile-name-row { display: flex; align-items: center; gap: 8px; margin: 0; }
.profile-font-edit { width: 29px; height: 29px; color: #fff; background: #1769aa; border: 2px solid #123b5d; border-radius: 6px; cursor: pointer; font: 19px Arial, sans-serif; }
.buildnitro-badge { display: inline-flex; align-items: center; gap: 6px; margin-top: 11px; padding: 5px 8px; color: #f6e6ff; background: #2b1450; border: 2px solid #9b44ff; border-radius: 999px; box-shadow: 0 0 12px rgba(155, 68, 255, .55); font: 11px "Minecraft Ten", sans-serif; cursor: pointer; user-select: none; }
.buildnitro-badge img { width: 19px; height: 19px; object-fit: contain; }

.wishlist-marketplace-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px;
  color: #275676;
  background: #c8edff;
  border: 2px solid #61c4ed;
  border-radius: 8px;
}
.wishlist-marketplace-cta > div > span { color: #0874a8; font: 12px "Minecraft Ten", sans-serif; }
.wishlist-marketplace-cta p { margin: 5px 0 0; }

.wishlist-marketplace-cta a {
  display: inline-block;
  padding: 10px 14px;
  color: #fff;
  background: #1769aa;
  border: 2px solid #123b5d;
  border-radius: 6px;
  font: 13px "Minecraft Ten", sans-serif;
  text-decoration: none;
}

.profile-form {
  display: grid;
  gap: 19px;
  padding: 30px 34px 35px;
  border-top: 2px solid #61c4ed;
}

.profile-form label { display: grid; gap: 8px; font-family: Arial, sans-serif; }

.profile-form input,
.profile-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 13px 15px;
  resize: vertical;
  color: #123b5d;
  background: #fffbd6;
  border: 2px solid #123b5d;
  border-radius: 8px;
  font: 16px Arial, sans-serif;
  outline: none;
}

.profile-form input:focus,
.profile-form textarea:focus { border-color: #0874a8; box-shadow: 0 0 0 3px rgba(8, 116, 168, .16); }

.profile-actions { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 3px; }
.profile-actions p { min-height: 20px; margin: 0; color: #1769aa; }

.profile-actions button {
  min-width: 158px;
  min-height: 48px;
  color: #fff;
  background: #1769aa;
  border: 3px solid #123b5d;
  border-radius: 8px;
  box-shadow: 0 4px 0 #123b5d;
  cursor: pointer;
  font: 15px "Minecraft Ten", sans-serif;
}

.profile-actions button:disabled { opacity: .65; cursor: wait; }

.name-appearance-popup { position: fixed; z-index: 40; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(5, 24, 40, .68); }
.name-appearance-popup[hidden] { display: none !important; }
.name-appearance-card { position: relative; width: min(450px, 100%); display: grid; gap: 16px; padding: 28px; background: #dff3ff; border: 3px solid #123b5d; border-radius: 14px; box-shadow: 0 20px 55px rgba(0, 0, 0, .42); }
.name-appearance-card > span { color: #8e2eff; font: 12px "Minecraft Ten", sans-serif; }
.name-appearance-card h2 { margin: -7px 36px 2px 0; color: #123b5d; font: 25px "Minecraft Ten", sans-serif; }
.name-appearance-card label { display: grid; gap: 7px; color: #0874a8; font: 12px "Minecraft Ten", sans-serif; }
.name-appearance-card input, .name-appearance-card select { width: 100%; box-sizing: border-box; min-height: 43px; padding: 10px 12px; color: #123b5d; background: #fffbd6; border: 2px solid #123b5d; border-radius: 7px; font: 16px Arial, sans-serif; }
.name-color-fields { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; }
.name-appearance-card input[type="color"] { padding: 3px; cursor: pointer; }
.name-appearance-card > button { min-height: 46px; color: #fff; background: #1769aa; border: 3px solid #123b5d; border-radius: 8px; box-shadow: 0 4px 0 #123b5d; cursor: pointer; font: 14px "Minecraft Ten", sans-serif; }
.name-appearance-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; color: #fff; background: #1769aa; border: 2px solid #123b5d; border-radius: 7px; cursor: pointer; font: 22px Arial, sans-serif; }

@media (max-width: 560px) {
  .profile-page { width: min(100% - 20px, 880px); padding-top: 25px; }
  .profile-banner { height: 95px; }
  .profile-identity { gap: 14px; padding: 0 18px 20px; margin-top: -42px; }
  .profile-avatar { width: 88px; height: 88px; border-width: 4px; }
  .profile-display-name { font-size: 15px; }
  .profile-form { padding: 24px 18px; }
  .profile-actions { align-items: stretch; flex-direction: column; }
  .profile-actions button { width: 100%; }
  .wishlist-marketplace-cta { align-items: stretch; flex-direction: column; text-align: center; }
  .wishlist-marketplace-cta a { text-align: center; }
  .name-color-fields { grid-template-columns: 1fr; }
}

.buildnitro-badge:focus-visible { outline: 3px solid rgba(204, 141, 255, .45); outline-offset: 3px; }
.buildnitro-perks-card { width: min(500px, 100%); }
.buildnitro-perks-art { display: block; width: 98px; height: 98px; margin: -6px auto 2px; object-fit: contain; filter: drop-shadow(0 0 14px rgba(155, 68, 255, .45)); }
.buildnitro-perks-card p { margin: -6px 0 0; color: #426b85; font: 16px Arial, sans-serif; line-height: 1.55; }
.buildnitro-perks-list { display: grid; gap: 10px; margin: 0; padding-left: 22px; color: #275676; font: 16px Arial, sans-serif; line-height: 1.5; }
.buildnitro-perks-list li::marker { color: #9b44ff; }


/* v31 owned marketplace items */
.profile-owned-marketplace{margin-top:22px;padding:18px;background:#dff3ff;border:2px solid #123b5d;border-radius:12px}
.profile-owned-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.profile-owned-heading span{color:#0874a8;font:11px "Minecraft Ten",sans-serif}
.profile-owned-heading h2{margin:5px 0 0;color:#123b5d;font:20px "Minecraft Ten",sans-serif}
.profile-owned-heading a{padding:9px 11px;border:2px solid #123b5d;border-radius:7px;background:#1769aa;color:#fff;text-decoration:none;font:11px "Minecraft Ten",sans-serif}
.profile-owned-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:12px}
.profile-owned-card{overflow:hidden;background:#eefaff;border:2px solid #8fcbe7;border-radius:10px}
.profile-owned-media img{display:block;width:100%;height:120px;object-fit:cover}
.profile-owned-body{padding:12px}
.profile-owned-body span{color:#0874a8;font:10px "Minecraft Ten",sans-serif}
.profile-owned-body h3{margin:6px 0;color:#123b5d;font:16px "Minecraft Ten",sans-serif}
.profile-owned-body p{margin:0;color:#66869a;font-size:12px}
.profile-owned-empty{grid-column:1/-1;margin:0;padding:14px;color:#648399}


/* v32 — profile header cleanup */
.profile-banner{
  min-height:150px;
  background-position:center;
  background-size:cover;
}
.profile-identity{
  margin-top:0!important;
  align-items:center!important;
  padding:22px 34px 28px!important;
  background:#dff3ff;
}
.profile-avatar{
  margin-top:-70px;
}
.profile-identity>div{
  min-width:0;
  padding-top:2px;
}
.profile-name-row{flex-wrap:wrap}
.profile-display-name{overflow-wrap:anywhere}
.equipped-nameplate{
  width:min(360px,100%);
  margin-top:12px;
  border:2px solid #7fc8ea;
  border-radius:9px;
  overflow:hidden;
}
.equipped-nameplate .profile-owned-media img{height:auto;max-height:82px}

/* v32 — Items Own */
.profile-owned-tools{display:grid;gap:10px;margin:12px 0 16px}
.profile-owned-tools input{
  width:100%;
  box-sizing:border-box;
  padding:12px 14px;
  color:#123b5d;
  background:#fffbd6;
  border:2px solid #123b5d;
  border-radius:8px;
  font:15px Arial,sans-serif;
}
.profile-owned-categories{display:flex;flex-wrap:wrap;gap:8px}
.profile-owned-categories button{
  padding:8px 10px;
  border:2px solid #123b5d;
  border-radius:7px;
  background:#fffbd6;
  color:#123b5d;
  font:10px "Minecraft Ten",sans-serif;
  cursor:pointer;
}
.profile-owned-categories button.active{background:#1769aa;color:#fff}
.profile-owned-card{cursor:pointer;transition:.15s transform,.15s box-shadow,.15s border-color}
.profile-owned-card:hover,.profile-owned-card:focus{transform:translateY(-2px);outline:none}
.profile-owned-card.equipped{
  border-color:#27b7f0;
  box-shadow:0 0 0 3px rgba(39,183,240,.23),0 7px 18px rgba(24,115,160,.15);
}
.profile-owned-card.equipped .profile-owned-body p{color:#0874a8;font-weight:700}

.owned-item-popup{
  position:fixed;z-index:1000;inset:0;
  display:grid;place-items:center;padding:18px;
  background:rgba(4,24,39,.72);
}
.owned-item-popup[hidden]{display:none!important}
.owned-item-popup-card{
  position:relative;width:min(620px,100%);
  max-height:90vh;overflow:auto;
  padding:22px;background:#dff3ff;
  border:3px solid #123b5d;border-radius:16px;
  box-shadow:0 18px 55px rgba(0,0,0,.38);
}
.owned-item-close{
  position:absolute;z-index:5;top:13px;right:13px;
  width:38px;height:38px;border:2px solid #123b5d;border-radius:8px;
  background:#1769aa;color:#fff;font-size:23px;cursor:pointer;
}
#ownedItemPopupMedia{
  overflow:hidden;margin-bottom:15px;
  border:2px solid #123b5d;border-radius:10px;
}
#ownedItemPopupMedia img{display:block;width:100%;height:auto;max-height:300px;object-fit:cover}
.owned-item-category{color:#0874a8;font:11px "Minecraft Ten",sans-serif}
.owned-item-popup-card h2{margin:7px 0 9px;color:#123b5d;font:26px "Minecraft Ten",sans-serif}
.owned-item-state{color:#57798d}
.owned-item-equip{
  width:100%;padding:14px;border:2px solid #123b5d;border-radius:8px;
  background:#1769aa;color:#fff;font:13px "Minecraft Ten",sans-serif;cursor:pointer
}
.owned-item-equip.equipped{background:#0d91bf;box-shadow:0 0 0 3px rgba(68,203,255,.23)}
.owned-item-equip:disabled{opacity:.6}

@media(max-width:560px){
  .profile-banner{min-height:120px}
  .profile-identity{
    display:grid!important;
    grid-template-columns:88px 1fr;
    gap:14px!important;
    padding:18px!important;
  }
  .profile-avatar{margin-top:-54px!important}
  .profile-identity>div{padding-top:0}
  .profile-display-name{font-size:14px!important}
  .profile-account-row{gap:6px}
  .profile-buildbucks{font-size:9px}
  .equipped-nameplate{grid-column:1/-1;width:100%}
}

.marketplace-rain-real{
  position:absolute;inset:0;overflow:hidden;pointer-events:none
}
.marketplace-rain-real i{
  position:absolute;top:-34px;
  left:calc((var(--i) * 2.27) * 1%);
  width:2px;height:28px;
  background:rgba(205,238,255,.62);
  border-radius:2px;
  animation:shore-profile-rain 1.05s linear infinite;
  animation-delay:calc(var(--i) * -0.041s);
}
@keyframes shore-profile-rain{from{transform:translateY(-34px)}to{transform:translateY(380px)}}

/* v33 — match Creator thin moving rain */
.marketplace-rain{display:none!important}
.marketplace-rain-real{position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:4}
.marketplace-rain-real i{
  position:absolute;
  top:-45px;
  left:calc((var(--i) * 1.786) * 1%);
  width:1.5px;
  height:26px;
  background:rgba(205,238,255,.62);
  border-radius:999px;
  opacity:.92;
  transform:translateY(-45px);
  animation:shore-profile-rain-v33 .88s linear infinite;
  animation-delay:calc(var(--i) * -0.057s);
}
.marketplace-rain-real i:nth-child(3n){height:19px;opacity:.76;animation-duration:1.02s}
.marketplace-rain-real i:nth-child(4n){height:31px;opacity:.88;animation-duration:.79s}
@keyframes shore-profile-rain-v33{
  from{transform:translateY(-45px)}
  to{transform:translateY(520px)}
}

/* v34 — legacy baked-rain cleanup
   Keep only the bright moving rain overlay. */
.marketplace-live-animation.anim-rain .marketplace-animation-overlay::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index:2;
  background:
    linear-gradient(rgba(25,45,50,.045),rgba(25,45,50,.045));
  mix-blend-mode:normal;
}

/* moving rain stays above cleanup layer */
.marketplace-rain-real{z-index:5!important}
.marketplace-rain-real i{
  background:rgba(220,246,255,.74)!important;
  opacity:.96!important;
  width:1.5px!important;
  box-shadow:0 0 1px rgba(255,255,255,.18);
}

.marketplace-live-animation.anim-rain::after,
.marketplace-animation-overlay.anim-rain::after,
.marketplace-animation-overlay.anim-rainfall::after{
  content:none!important;
  display:none!important;
}

/* v35 — remove v34 tint workaround; underlying legacy image is cleaned in JS */
.marketplace-live-animation.anim-rain .marketplace-animation-overlay::before{
  content:none!important;
  display:none!important;
}

.marketplace-rain-real{z-index:6!important}
.marketplace-rain-real i{
  background:rgba(228,248,255,.82)!important;
  opacity:.98!important;
}

/* v36 — do not display equipped Nameplates on My Profile */
#equippedNameplate,
.equipped-nameplate{
  display:none!important;
}
