*{box-sizing:border-box}body{margin:0;min-height:100vh;font-family:Tahoma,Arial;color:#f7f8fa;background:radial-gradient(circle at 50% -20%,#505a64,#22272c 35%,#0e1012 72%)}a{color:inherit;text-decoration:none}button,input{font:inherit}header{min-height:70px;padding:12px 4%;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #46515b;background:#0e1012ed}header a{padding:9px 13px;border:1px solid #46515b;border-radius:10px;background:#272e35}main{width:min(900px,94%);margin:auto;padding:30px 0}.panel,.profile-main,.gift-card,.ranking-head{padding:22px;border:1px solid #46515b;border-radius:18px;background:#1d2227;text-align:center}.big-avatar{width:90px;height:90px;margin:auto;display:grid;place-items:center;border:2px solid #77633c;border-radius:50%;color:#efd495;background:#352e20;font-size:38px;font-weight:900}.profile-main input{width:min(400px,90%);margin:14px 0 7px;padding:12px;border:1px solid #596570;border-radius:10px;color:#fff;background:#14181c;text-align:center;font-weight:900}.profile-main button,.gift-card button{padding:11px 18px;border:1px solid #806a3e;border-radius:10px;color:#211b10;background:#d9b45e;font-weight:900}.profile-main>span{display:block;margin:12px;color:#d9b45e}.level{width:min(500px,90%);margin:auto}.level>div{height:8px;margin:8px 0;overflow:hidden;border-radius:99px;background:#303840}.level i{display:block;height:100%;background:linear-gradient(90deg,#80632f,#dfbd68)}.level small{color:#aab3bc}.coins{margin-top:13px;color:#f0d597}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:13px 0}.stats article{padding:16px;border:1px solid #46515b;border-radius:13px;background:#1d2227;text-align:center}.stats span{display:block;color:#aab3bc;font-size:12px}.stats b{display:block;margin-top:7px;color:#d9b45e;font-size:25px}.panel{margin-top:13px;text-align:right}.chips{display:flex;flex-wrap:wrap;gap:8px}.chips button{padding:9px 13px;border:1px solid #46515b;border-radius:99px;color:#fff;background:#2a3138}.chips button.active{border-color:#806a3e;color:#f1d798;background:#3d3423}.achievement-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}.achievement-grid article{padding:15px;border:1px solid #46515b;border-radius:12px;background:#292f35;text-align:center}.achievement-grid strong{display:block;margin-top:7px}.gift-card>div{font-size:80px}.gift-card p,.ranking-head p{color:#aab3bc}.gift-card>strong{display:block;margin-top:14px;color:#d9b45e}.reward-list{display:grid;gap:8px}.reward-list article{padding:14px;display:flex;justify-content:space-between;border:1px solid #46515b;border-radius:11px;background:#292f35}.reward-list span{color:#aab3bc}.ranking{display:grid;gap:9px;margin-top:13px}.ranking article{padding:13px;display:grid;grid-template-columns:45px auto 1fr auto;gap:12px;align-items:center;border:1px solid #46515b;border-radius:13px;background:#1d2227}.ranking article.me{border-color:#806a3e;background:#342d20}.rank-avatar{width:43px;height:43px;display:grid;place-items:center;border-radius:50%;background:#343c44;color:#d9b45e;font-weight:900}.ranking small{display:block;color:#aab3bc}.ranking em{color:#d9b45e;font-style:normal}@media(max-width:650px){.stats{grid-template-columns:1fr 1fr}.achievement-grid{grid-template-columns:1fr}.ranking article{grid-template-columns:35px auto 1fr}.ranking em{grid-column:1/-1}}

/* VIP profile and title vault */
.profile-page {
  background:
    radial-gradient(circle at 15% 5%, rgba(81, 118, 145, .2), transparent 24%),
    radial-gradient(circle at 85% 12%, rgba(184, 135, 48, .19), transparent 27%),
    linear-gradient(145deg, #15191e, #090b0d 72%);
}

/* Top 100 ranking */
.ranking-kicker {
  display: inline-flex;
  padding: 6px 11px;
  border: 1px solid #8b7445;
  border-radius: 999px;
  color: #f0d48c;
  background: #3b321f;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.4px;
}
.ranking-vip-count {
  display: inline-flex;
  margin-top: 9px;
  padding: 7px 12px;
  border-radius: 9px;
  color: #f5df9a;
  background: linear-gradient(135deg, #5b451c, #30230e);
  box-shadow: inset 0 0 0 1px #9f7935;
  font-size: 12px;
}
.ranking-meta {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.ranking-meta .ranking-vip-count {
  margin-top: 0;
}
.ranking-my-rank,
.ranking-meta > span {
  display: inline-flex;
  padding: 7px 11px;
  border: 1px solid #4b5863;
  border-radius: 9px;
  color: #dce4eb;
  background: #252c32;
  font-size: 11px;
}
.ranking-meta > span {
  color: #aeb8c1;
  font-weight: 400;
}
.ranking-loading {
  padding: 28px;
  border: 1px solid #46515b;
  border-radius: 13px;
  color: #aab3bc;
  background: #1d2227;
  text-align: center;
}
.ranking-error {
  padding: 28px;
  display: grid;
  justify-items: center;
  gap: 12px;
  border: 1px solid #754d4d;
  border-radius: 13px;
  color: #f4c0c0;
  background: #2c2020;
}
.ranking-error button {
  padding: 9px 14px;
  border: 1px solid #9e7440;
  border-radius: 9px;
  color: #1f190f;
  background: #d9b45e;
  font-weight: 900;
  cursor: pointer;
}
.ranking article.vip {
  border-color: #84672e;
  background:
    radial-gradient(circle at 8% 0%, #6c522d33, transparent 42%),
    linear-gradient(135deg, #25241f, #1d2227);
}
.ranking article.vip .rank-avatar {
  border: 1px solid #cfaa57;
  box-shadow: 0 0 0 3px #6e54294d, 0 0 18px #d5ae4c2e;
}
.rank-vip {
  display: inline-flex;
  margin-inline-start: 7px;
  padding: 3px 7px;
  border: 1px solid #a78139;
  border-radius: 999px;
  color: #f6dc8c;
  background: #473618;
  font-size: 9px;
  font-weight: 900;
  vertical-align: middle;
}
.rank-training {
  display: inline-flex;
  margin-inline-start: 6px;
  padding: 3px 7px;
  border: 1px solid #526477;
  border-radius: 999px;
  color: #c9d7e4;
  background: #25313c;
  font-size: 9px;
  font-weight: 900;
  vertical-align: middle;
}
.ranking article:nth-child(1) {
  border-color: #d7b35e;
  box-shadow: 0 8px 26px #d7b35e1c;
}
.ranking article:nth-child(2) { border-color: #8996a3; }
.ranking article:nth-child(3) { border-color: #9e7047; }

@media (max-width: 650px) {
  .ranking article { gap: 9px; }
  .rank-vip { margin-inline-start: 4px; }
}

.ranking-tabs {
  margin-top: 16px;
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  border: 1px solid #46515b;
  border-radius: 14px;
  background: #11161a;
}
.ranking-tabs button {
  min-height: 44px;
  padding: 8px;
  border: 0;
  border-radius: 10px;
  color: #aab3bc;
  background: transparent;
  font-weight: 900;
  cursor: pointer;
}
.ranking-tabs button.active {
  color: #211b10;
  background: #d9b45e;
  box-shadow: 0 8px 22px #0006;
}

.profile-page main {
  width: min(1160px, 94%);
}

.profile-page .profile-main {
  position: relative;
  overflow: hidden;
  border-color: rgba(223, 190, 108, .38);
  background:
    radial-gradient(circle at 50% -20%, rgba(218,180,94,.18), transparent 42%),
    linear-gradient(145deg, #252c33, #171b20);
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
}

.profile-page .big-avatar {
  box-shadow: 0 0 0 7px rgba(217,180,94,.07), 0 0 35px rgba(217,180,94,.22);
  animation: avatarPulse 4s ease-in-out infinite;
}

.profile-page .level {
  width: min(600px, 94%);
  padding: 14px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 14px;
  background: rgba(0,0,0,.16);
}

.profile-page .level-line {
  height: auto;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: visible;
  background: transparent;
}

.profile-page .level-line small {
  color: #d7bd7d;
}

.profile-page .level > div:not(.level-line) {
  height: 10px;
}

.profile-page .stats {
  grid-template-columns: repeat(4, 1fr);
}

.profile-page .stats article {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #252c33, #171b20);
  box-shadow: 0 12px 28px rgba(0,0,0,.2);
}

.profile-page .stats article::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #d9b45e, transparent);
  opacity: .55;
}

.section-head {
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.section-head h2 {
  margin: 3px 0 5px;
  font-size: 28px;
}

.section-head p {
  margin: 0;
  color: #aab3bc;
  font-size: 13px;
}

.section-head small {
  color: #d9b45e;
  letter-spacing: 2px;
}

.section-head > strong {
  min-width: 86px;
  padding: 12px 15px;
  border: 1px solid #756139;
  border-radius: 14px;
  color: #f2d795;
  background: #312a1e;
  text-align: center;
  font-size: 20px;
}

.section-head.compact {
  margin-bottom: 14px;
}

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

.title-card {
  --tier: #9b6a49;
  min-height: 245px;
  padding: 16px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid color-mix(in srgb, var(--tier) 55%, #414a53);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0, color-mix(in srgb, var(--tier) 16%, transparent), transparent 38%),
    linear-gradient(155deg, #293039, #171b20 70%);
  box-shadow: 0 16px 32px rgba(0,0,0,.24);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.title-card::before {
  content: "";
  position: absolute;
  inset: -80% -35%;
  z-index: -1;
  background: conic-gradient(from 90deg, transparent, color-mix(in srgb, var(--tier) 18%, transparent), transparent 25%);
  opacity: 0;
}

.title-card.unlocked::before {
  opacity: 1;
  animation: titleAura 9s linear infinite;
}

.title-card.unlocked:hover {
  transform: translateY(-6px);
  border-color: var(--tier);
  box-shadow: 0 22px 45px rgba(0,0,0,.34), 0 0 25px color-mix(in srgb, var(--tier) 18%, transparent);
}

.title-card.locked {
  filter: saturate(.68);
  opacity: .78;
}

.title-card.selected {
  box-shadow: 0 0 0 2px var(--tier), 0 0 35px color-mix(in srgb, var(--tier) 28%, transparent);
}

.tier-bronze { --tier: #bd8159; }
.tier-silver { --tier: #b9cad8; }
.tier-gold { --tier: #e3bc58; }
.tier-royal { --tier: #b58cff; }
.tier-mythic { --tier: #57d8cf; }
.tier-crimson { --tier: #f06f73; }
.tier-steel { --tier: #8fa8bb; }
.tier-sapphire { --tier: #6e9fff; }
.tier-emerald { --tier: #57d59a; }
.tier-electric { --tier: #69e8ff; }
.tier-cosmic { --tier: #9e8cff; }
.tier-imperial { --tier: #ff9b63; }
.tier-obsidian { --tier: #a7a2b2; }
.tier-legendary { --tier: #ffe174; }

.title-card.tier-cosmic {
  background:radial-gradient(circle at 22% 12%,#785dd53d,transparent 30%),radial-gradient(circle at 80% 0,#4ccde52c,transparent 35%),linear-gradient(155deg,#28273a,#151820 72%);
}
.title-card.tier-imperial {
  background:radial-gradient(circle at 50% 0,#cf6b3d35,transparent 38%),linear-gradient(155deg,#352824,#191b20 72%);
}
.title-card.tier-obsidian {
  background:linear-gradient(145deg,#34313b,#15171b 68%);
}
.title-card.tier-legendary {
  background:radial-gradient(circle at 50% -10%,#ffe0784a,transparent 40%),linear-gradient(150deg,#39301e,#191b20 68%);
  box-shadow:0 0 0 1px #ffe17455,0 18px 42px #0007,0 0 34px #dcae3d33;
}
.title-card.tier-legendary .title-rune {
  animation:avatarPulse 2s ease-in-out infinite;
}

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

.title-card-top small {
  color: #8f99a3;
  letter-spacing: 1px;
}

.title-rune {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--tier) 65%, transparent);
  border-radius: 15px;
  color: var(--tier);
  background: color-mix(in srgb, var(--tier) 10%, #15191d);
  box-shadow: inset 0 1px rgba(255,255,255,.1), 0 0 20px color-mix(in srgb, var(--tier) 16%, transparent);
  font-size: 24px;
}

.title-card h3 {
  margin: 18px 0 7px;
  color: color-mix(in srgb, var(--tier) 82%, white);
  font-size: 18px;
}

.title-card p {
  min-height: 40px;
  margin: 0;
  color: #aeb7c0;
  font-size: 12px;
  line-height: 1.7;
}

.title-progress {
  height: 7px;
  margin: auto 0 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #101419;
}

.title-progress i {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--tier) 60%, #313942), var(--tier));
  box-shadow: 0 0 10px var(--tier);
}

.title-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #9fa9b2;
  font-size: 11px;
}

.title-card-foot button {
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, var(--tier) 55%, #46515b);
  border-radius: 9px;
  color: color-mix(in srgb, var(--tier) 80%, white);
  background: color-mix(in srgb, var(--tier) 10%, #20262c);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.title-card-foot button:disabled {
  color: #818991;
  cursor: not-allowed;
}

.title-card.selected .title-card-foot button {
  color: #121518;
  background: var(--tier);
}

@keyframes avatarPulse {
  0%, 100% { box-shadow: 0 0 0 7px rgba(217,180,94,.07), 0 0 25px rgba(217,180,94,.18); }
  50% { box-shadow: 0 0 0 10px rgba(217,180,94,.04), 0 0 45px rgba(217,180,94,.33); }
}

@keyframes titleAura {
  to { transform: rotate(360deg); }
}

@media (max-width: 980px) {
  .title-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .title-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-page .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 470px) {
  .title-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: flex-start;
  }

  .profile-page .level-line {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Profile wallet and rewards */
.profile-header-tools {
  display: flex;
  align-items: center;
  gap: 7px;
}

/* Premium avatar identity vault */
.hidden { display: none!important; }

.avatar-stage {
  width: max-content;
  margin: auto;
  position: relative;
}

.profile-page .big-avatar {
  overflow: hidden;
  background-color: #352e20;
  box-shadow: 0 0 0 7px rgba(217,180,94,.07),0 18px 48px rgba(0,0,0,.32);
}

.avatar-stage > span {
  width: max-content;
  max-width: 170px;
  margin: -7px auto 7px;
  padding: 5px 10px;
  position: relative;
  z-index: 2;
  overflow: hidden;
  display: block;
  border: 1px solid rgba(217,180,94,.42);
  border-radius: 999px;
  color: #f2d99c;
  background: rgba(25,21,15,.92);
  font-size: 10px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-upload-actions {
  width: min(620px,94%);
  margin: 17px auto 0;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 8px;
}

.upload-avatar,
.avatar-upload-actions > a,
.profile-main .remove-avatar-photo {
  min-height: 49px;
  padding: 9px 13px;
  display: grid;
  place-content: center;
  border: 1px solid #596570;
  border-radius: 11px;
  color: #f5f7f8;
  background: #293038;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.upload-avatar {
  border-color: rgba(94,219,211,.4);
  background: linear-gradient(135deg,rgba(41,121,114,.5),rgba(28,64,62,.55));
}

.upload-avatar input { display: none; }
.upload-avatar small { margin-top: 2px; color: #8ee5de; font-size: 9px; }
.upload-avatar.locked {
  cursor: not-allowed;
  opacity: .58;
  filter: grayscale(.35);
}

.profile-main .remove-avatar-photo {
  border-color: #795158;
  color: #f2c5cb;
  background: #412b30;
}

.avatar-upload-status {
  width: min(650px,94%);
  margin: 9px auto 0;
  color: #9eabb5;
  font-size: 11px;
  line-height: 1.7;
}

.avatars-panel {
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0,rgba(94,219,211,.1),transparent 34%),
    linear-gradient(155deg,#222a31,#171c21);
}

.avatar-skins-grid {
  display: grid;
  grid-template-columns: repeat(5,minmax(0,1fr));
  gap: 10px;
}

.avatar-skin-card {
  --skin-accent: #70808d;
  position: relative;
  overflow: hidden;
  border: 1px solid color-mix(in srgb,var(--skin-accent) 45%,#46515b);
  border-radius: 16px;
  background: #20272d;
  box-shadow: 0 14px 30px rgba(0,0,0,.2);
  transition: transform .2s ease,border-color .2s ease,box-shadow .2s ease;
}

.avatar-skin-card:hover {
  z-index: 2;
  border-color: var(--skin-accent);
  transform: translateY(-4px);
}

.avatar-skin-card.tier-bronze { --skin-accent:#b57a49; }
.avatar-skin-card.tier-silver { --skin-accent:#93a8bb; }
.avatar-skin-card.tier-gold { --skin-accent:#ddb756; }
.avatar-skin-card.tier-royal { --skin-accent:#9a70d0; }
.avatar-skin-card.tier-mythic { --skin-accent:#56c9bd; }
.avatar-skin-card.tier-vip { --skin-accent:#efc45e; }

.avatar-skin-card.selected {
  border-color: var(--skin-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb,var(--skin-accent) 25%,transparent),0 20px 40px rgba(0,0,0,.3);
}

.avatar-skin-card.locked .avatar-skin-image {
  filter: grayscale(.78) brightness(.48);
}

.avatar-skin-image {
  width: 100%;
  aspect-ratio: 1;
  border-bottom: 1px solid color-mix(in srgb,var(--skin-accent) 35%,#39434c);
  background-image: url("../assets/avatar-skins.webp");
  background-size: 500% 600%;
  background-position: var(--skin-position);
  background-repeat: no-repeat;
}

.avatar-skin-info {
  min-height: 99px;
  padding: 10px;
  display: grid;
  align-content: start;
}

.avatar-skin-info small {
  color: var(--skin-accent);
  font-size: 9px;
  font-weight: 900;
}

.avatar-skin-info strong {
  min-height: 37px;
  margin: 5px 0;
  line-height: 1.45;
  font-size: 13px;
}

.avatar-skin-info button,
.avatar-skin-info a {
  min-height: 44px;
  padding: 6px 8px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb,var(--skin-accent) 45%,#46515b);
  border-radius: 8px;
  color: #fff;
  background: color-mix(in srgb,var(--skin-accent) 18%,#252c32);
  font-size: 10px;
  font-weight: 900;
  text-align: center;
}

.avatar-skin-card.selected button {
  color: #17201f;
  background: var(--skin-accent);
}

.cosmetics-panel {
  overflow: hidden;
  background:
    radial-gradient(circle at 0 0,rgba(181,140,255,.12),transparent 34%),
    linear-gradient(155deg,#222831,#171b21);
}

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

.cosmetic-card {
  --effect:#9aa7b2;
  min-height: 174px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border: 1px solid color-mix(in srgb,var(--effect) 45%,#46515b);
  border-radius: 17px;
  background: radial-gradient(circle at 50% 0,color-mix(in srgb,var(--effect) 14%,transparent),#1b2127 55%);
  text-align: center;
}

.cosmetic-card.tone-obsidian { --effect:#d8bb68; }
.cosmetic-card.tone-neon { --effect:#59e7ed; }
.cosmetic-card.tone-royal { --effect:#b78cff; }
.cosmetic-card.tone-vip { --effect:#f1c85f; }
.cosmetic-card.tone-aura { --effect:#58e0cf; }
.cosmetic-card.tone-prism { --effect:#b994ff; }
.cosmetic-card.tone-ember { --effect:#ff8764; }
.cosmetic-card.locked { opacity:.58;filter:saturate(.55); }
.cosmetic-card.selected { border-color:var(--effect);box-shadow:0 0 0 2px color-mix(in srgb,var(--effect) 23%,transparent),0 0 26px color-mix(in srgb,var(--effect) 19%,transparent); }
.cosmetic-preview {
  width:54px;height:54px;margin:0 auto 9px;display:grid;place-items:center;
  border:1px solid color-mix(in srgb,var(--effect) 65%,transparent);border-radius:17px;
  color:var(--effect);background:color-mix(in srgb,var(--effect) 10%,#12171c);
  box-shadow:inset 0 1px #fff1,0 0 20px color-mix(in srgb,var(--effect) 18%,transparent);
  font-size:25px;
}
.cosmetic-card small { color:var(--effect);font-size:9px;font-weight:900; }
.cosmetic-card strong { min-height:37px;margin:6px 0 10px;line-height:1.45;font-size:13px; }
.cosmetic-card button,.cosmetic-card a {
  min-height:34px;margin-top:auto;padding:7px;border:1px solid color-mix(in srgb,var(--effect) 48%,#46515b);
  border-radius:9px;color:#fff;background:color-mix(in srgb,var(--effect) 15%,#222930);
  font-size:10px;font-weight:900;text-decoration:none;
}
.cosmetic-card.selected button { color:#111719;background:var(--effect); }
.cosmetic-card.passive em { margin-top:auto;color:#aeb8c1;font-size:10px;font-style:normal;line-height:1.5; }
.cosmetic-card.passive.active .cosmetic-preview { animation:avatarPulse 2.5s ease-in-out infinite; }

@media(max-width:850px) {
  .avatar-skins-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .cosmetics-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}

@media(max-width:650px) {
  body { padding-bottom:env(safe-area-inset-bottom); }
  header {
    min-height:calc(60px + env(safe-area-inset-top));
    padding-top:max(10px,env(safe-area-inset-top));
    padding-inline:max(10px,env(safe-area-inset-left)) max(10px,env(safe-area-inset-right));
    position:sticky;top:0;z-index:50;backdrop-filter:blur(14px);
  }
  .profile-page main { width:100%;padding:12px; }
  .profile-page .profile-main,.profile-page .panel { border-radius:20px;padding:17px; }
  .avatar-upload-actions { grid-template-columns: 1fr; }
  .avatar-skins-grid {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(165px,48vw);
    overflow-x: auto;
    padding-bottom: 12px;
    scroll-snap-type: x mandatory;
  }
  .avatar-skin-card { scroll-snap-align: center; }
  .cosmetics-grid {
    grid-template-columns:none;
    grid-auto-flow:column;
    grid-auto-columns:minmax(152px,45vw);
    overflow-x:auto;
    padding-bottom:12px;
    scroll-snap-type:x mandatory;
  }
  .cosmetic-card { min-height:168px;scroll-snap-align:center; }
  .section-head h2 { font-size:22px; }
  .section-head p { max-width:31ch;line-height:1.55; }
}

.header-wallet {
  padding: 5px !important;
  display: flex;
  gap: 5px;
  background: linear-gradient(145deg, #252d34, #171c20) !important;
}

.header-wallet span {
  min-width: 62px;
  padding: 5px 8px;
  display: flex;
  justify-content: center;
  gap: 6px;
  border-radius: 7px;
  background: rgba(0,0,0,.18);
  font-size: 12px;
}

.header-wallet i {
  color: #ddb75c;
  font-style: normal;
}

.header-wallet span + span i {
  color: #5edbd3;
  text-shadow: 0 0 10px #5edbd3;
}

.header-wallet.offline span + span {
  opacity: .55;
}

.rewards-store-cta {
  margin-top: 13px;
  padding: 19px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(94,219,211,.28);
  border-radius: 17px;
  background:
    radial-gradient(circle at 15% 50%, rgba(94,219,211,.12), transparent 25%),
    linear-gradient(145deg, #252d34, #171c20);
}

.rewards-store-cta > span {
  color: #5edbd3;
  font-size: 38px;
  text-shadow: 0 0 18px #5edbd3;
}

.rewards-store-cta small {
  display: block;
  margin-top: 4px;
  color: #aab3bc;
}

.rewards-store-cta > b {
  color: #7ce8df;
}

@media (max-width: 650px) {
  .profile-header-tools > a:last-child { display: none; }
  .header-wallet span { min-width: 52px; padding-inline: 5px; }
  .rewards-store-cta { grid-template-columns: auto 1fr; }
  .rewards-store-cta > b { grid-column: 1 / -1; text-align: left; }
}

/* Apple account */
.apple-account-panel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  text-align: right;
  border-color: rgba(255,255,255,.14);
  background: radial-gradient(circle at 5% 0%,rgba(255,255,255,.09),transparent 35%),linear-gradient(145deg,#242a30,#14181c);
}
.apple-account-icon {
  width: 58px;height: 58px;display: grid;place-items: center;
  border: 1px solid rgba(255,255,255,.18);border-radius: 17px;
  color: #fff;background: #050505;box-shadow: 0 12px 28px rgba(0,0,0,.35);font-size: 29px;
}
.apple-account-copy small { color: #9faab3;font-size: 10px;font-weight: 900;letter-spacing: .5px; }
.apple-account-copy h2 { margin: 5px 0 7px; }
.apple-account-copy p { margin: 0;color: #b8c1c9;font-size: 12px; }
.apple-account-copy p.connected { color: #8fe2bd; }
.apple-account-actions { display: grid;justify-items: stretch;gap: 7px; }
.apple-account-actions button { min-height: 40px;padding: 9px 13px;border-radius: 10px;cursor: pointer;font-weight: 900; }
.apple-signin-button { border: 1px solid #fff;color: #fff;background: #000; }
.apple-signin-button span { margin-inline-end: 6px;font-size: 18px; }
.apple-signin-button:disabled { cursor: not-allowed;opacity: .48; }
.apple-logout-button { border: 1px solid #56616a;color: #e8edf1;background: #2a3137; }
.apple-delete-button { border: 1px solid #754545;color: #efb0b0;background: #2c1d1d; }
.apple-delete-modal {
  position: fixed;inset: 0;z-index: 10020;padding: 18px;display: grid;place-items: center;
  background: rgba(3,5,7,.82);backdrop-filter: blur(12px);
}
.apple-delete-card {
  width: min(460px,100%);padding: 25px;border: 1px solid #7d4949;border-radius: 20px;
  color: #f5f7f9;background: linear-gradient(145deg,#2b2424,#171a1e);
  box-shadow: 0 25px 80px rgba(0,0,0,.65);text-align: center;
}
.apple-delete-warning {
  width: 48px;height: 48px;margin: auto;display: grid;place-items: center;
  border: 1px solid #c56a6a;border-radius: 50%;color: #ffd1d1;background: #5c2d2d;font-size: 25px;font-weight: 900;
}
.apple-delete-card p { color: #c7cdd2;line-height: 1.7; }
.apple-delete-card label { display: block;margin: 13px 0 7px;color: #d9dee2;font-size: 12px; }
.apple-delete-card input {
  width: 100%;padding: 12px;border: 1px solid #6f5656;border-radius: 10px;
  color: #fff;background: #101316;text-align: center;
}
.apple-delete-card > div { margin-top: 14px;display: grid;grid-template-columns: 1fr 1fr;gap: 8px; }
.apple-delete-card button { padding: 11px;border-radius: 10px;cursor: pointer;font-weight: 900; }
#cancelDeleteAccount { border: 1px solid #59636b;color: #fff;background: #30373d; }
#confirmDeleteAccount { border: 1px solid #b95b5b;color: #fff;background: #8b3535; }
#confirmDeleteAccount:disabled { cursor: not-allowed;opacity: .4; }
.apple-delete-status { min-height: 20px;margin: 7px 0 0!important;color: #f2a6a6!important; }
.apple-complete-card { max-width: 560px;margin: 10vh auto 0;text-align: center; }
.apple-complete-card .apple-account-icon { margin: 0 auto 15px; }
.apple-complete-card h1 { margin: 0 0 10px; }
.apple-complete-card p { color: #b7c0c8;line-height: 1.7; }
.apple-complete-card a {
  display: inline-flex;margin-top: 10px;padding: 10px 15px;border: 1px solid #59646d;
  border-radius: 10px;background: #293036;font-weight: 900;
}

.settings-panel {
  position: relative;
  overflow: hidden;
  text-align: right;
  background:
    radial-gradient(circle at 8% 0, rgba(95, 198, 209, .11), transparent 31%),
    linear-gradient(145deg, #20272d, #171c20);
}

.settings-panel::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  inset-inline-end: -130px;
  bottom: -150px;
  border: 1px solid rgba(219, 181, 92, .13);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(219, 181, 92, .025), 0 0 0 68px rgba(219, 181, 92, .018);
  pointer-events: none;
}

.settings-heading {
  position: relative;
  display: flex;
  align-items: center;
  gap: 15px;
  padding-bottom: 19px;
  border-bottom: 1px solid #3e4850;
}

.settings-gear {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  display: grid;
  place-items: center;
  border: 1px solid #92763e;
  border-radius: 18px;
  color: #f0cf7d;
  background: linear-gradient(145deg, #574521, #25251e);
  box-shadow: inset 0 1px rgba(255,255,255,.1), 0 12px 30px rgba(0,0,0,.26);
  font-size: 31px;
}

.settings-heading small {
  color: #68c7d1;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.2px;
}

.settings-heading h2 { margin: 5px 0; }
.settings-heading p { margin: 0; color: #aeb8c0; font-size: 12px; line-height: 1.7; }

.settings-groups {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
  margin-top: 16px;
}

.settings-group {
  overflow: hidden;
  border: 1px solid #424d56;
  border-radius: 17px;
  background: rgba(11,15,18,.48);
}

.settings-group-title {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid #354048;
  background: rgba(255,255,255,.025);
}

.settings-group-title > span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #79653d;
  border-radius: 11px;
  color: #efd17f;
  background: #30291c;
  font-size: 18px;
}

.settings-group-title strong { display: block; }
.settings-group-title small { display: block; margin-top: 4px; color: #8f9ba4; font-size: 10px; }

.setting-row {
  min-height: 69px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #303940;
  cursor: pointer;
}

.setting-row:last-child { border-bottom: 0; }
.setting-row > span { min-width: 0; }
.setting-row b { display: block; color: #eef2f4; font-size: 13px; }
.setting-row small { display: block; margin-top: 4px; color: #89969f; font-size: 9px; line-height: 1.5; }

.setting-row select {
  width: min(145px, 45%);
  min-height: 39px;
  padding: 7px 10px;
  border: 1px solid #53606a;
  border-radius: 10px;
  outline: 0;
  color: #edf1f3;
  background: #20272d;
  font-size: 11px;
  font-weight: 800;
}

.setting-row select:focus-visible,
.setting-row input:focus-visible,
.settings-footer button:focus-visible {
  outline: 3px solid rgba(239, 205, 119, .38);
  outline-offset: 3px;
}

.settings-switch {
  width: 48px;
  height: 27px;
  flex: 0 0 48px;
  position: relative;
  appearance: none;
  border: 1px solid #59646d;
  border-radius: 999px;
  background: #293138;
  cursor: pointer;
  transition: .22s ease;
}

.settings-switch::after {
  content: "";
  position: absolute;
  width: 21px;
  height: 21px;
  top: 2px;
  inset-inline-start: 3px;
  border-radius: 50%;
  background: #a8b1b8;
  box-shadow: 0 3px 8px rgba(0,0,0,.35);
  transition: .22s ease;
}

.settings-switch:checked {
  border-color: #d7b45e;
  background: linear-gradient(135deg, #9b7732, #d9b45e);
}

.settings-switch:checked::after {
  inset-inline-start: 23px;
  background: #fff8e6;
}

.settings-range-row { display: grid; }
.settings-range-row input[type="range"] {
  width: 100%;
  height: 5px;
  accent-color: #d9b45e;
  cursor: pointer;
}

.settings-footer {
  position: relative;
  margin-top: 14px;
  padding-top: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #3b454d;
}

.settings-footer p { margin: 0; color: #8fbea9; font-size: 10px; }
.settings-footer button {
  padding: 10px 13px;
  border: 1px solid #53606a;
  border-radius: 10px;
  color: #dce2e6;
  background: #252c32;
  cursor: pointer;
  font-weight: 900;
}

@media (max-width: 760px) {
  .settings-groups { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .settings-heading { align-items: flex-start; }
  .settings-heading p { font-size: 10px; }
  .setting-row { min-height: 65px; padding-inline: 12px; }
  .setting-row select { width: 46%; font-size: 10px; }
  .settings-footer { align-items: stretch; flex-direction: column; }
  .settings-footer button { width: 100%; }
}

@media (max-width: 760px) {
  .apple-account-panel { grid-template-columns: auto 1fr; }
  .apple-account-actions { grid-column: 1 / -1;width: 100%; }
}
header a,.header-wallet,.profile-main button,.apple-account-actions button,
.cosmetic-card button,.cosmetic-card a,.title-card-foot button{min-height:44px;display:inline-flex;align-items:center;justify-content:center}
.setting-row select,#settingsReset{min-height:44px}
