/* A separate background layer keeps the wallpaper fixed on mobile, too. */
body[data-profile-theme] {
  isolation: isolate;
  background: #071526;
}

body[data-profile-theme]::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: #071526;
  background-image: linear-gradient(rgba(4, 12, 28, .08), rgba(4, 12, 28, .2)), var(--profile-theme-image);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

body[data-profile-theme] .profile-shell {
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
}

body[data-profile-theme] .profile-hero {
  border: 1px solid rgba(147, 197, 253, .3);
  border-radius: 24px;
}

body[data-profile-theme] .profile-hero:not([data-profile-banner]) {
  background: linear-gradient(135deg, rgba(61, 53, 108, .55), rgba(24, 34, 66, .5)), rgba(10, 21, 45, .7);
}

/* Opaque backing also covers the wallpaper before a banner image has loaded. */
:is(body[data-profile-theme] .profile-hero, .theme-shop-hero)[data-profile-banner] {
  background-color: #10213b;
  opacity: 1;
}

body[data-profile-theme] .panel {
  background: rgba(11, 23, 47, .93);
  border-color: rgba(147, 197, 253, .32);
}

body[data-profile-theme] .profile-content {
  padding-right: 0;
  padding-left: 0;
}

body[data-profile-theme] .profile-shell > :is(.panel, .profile-customization-panels) {
  margin-right: 0;
  margin-left: 0;
}

.profile-customization-panels {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 275px), 1fr));
  gap: 14px;
}

.profile-customization-panels > .panel {
  padding: 16px;
  border-radius: 18px;
}

.profile-customization-panels h2 {
  margin-bottom: 10px;
  font-size: 22px;
}

.profile-customization-panels :is(.frame-profile-actions, .profile-banner-picker, .profile-theme-picker) {
  display: block;
  margin: 0 0 12px;
}

.profile-customization-panels :is(.frame-profile-actions, .profile-banner-picker, .profile-theme-picker) label {
  display: grid;
  min-width: 0;
  gap: 6px;
  font-size: 14px;
}

.profile-customization-panels :is(.frame-profile-actions, .profile-banner-picker, .profile-theme-picker) select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 7px 30px 7px 10px;
  border: 1px solid #537185;
  border-radius: 10px;
  color: #f8fafc;
  background: #16233e;
  font: inherit;
}

.profile-theme-controls {
  scroll-margin: 16px;
}

.profile-theme-controls p {
  margin: 10px 0 0;
  color: #cbd5e1;
  line-height: 1.5;
}

.profile-theme-controls p:empty {
  display: none;
}

.profile-theme-shop-link {
  color: #93c5fd;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.profile-theme-shop-link:is(:hover, :focus-visible) {
  color: #fff;
}

.profile-theme-surface[data-profile-theme] {
  background: #0b2339 var(--profile-theme-image) center / cover no-repeat;
}

.theme-shop-preview {
  padding: 22px;
  border: 1px solid #446077;
  border-radius: 22px;
}

.theme-shop-preview-label {
  display: table;
  margin: 0 0 16px;
  padding: 8px 12px;
  border-radius: 10px;
  color: #fff;
  background: rgba(8, 20, 44, .92);
  font-weight: 700;
}

.theme-shop-hero {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  padding: 22px;
  border: 1px solid rgba(147, 197, 253, .3);
  border-radius: 18px;
  background-color: rgba(17, 30, 55, .9);
}

.theme-shop-avatar {
  width: 112px;
  height: 112px;
}

.theme-shop-avatar-image {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 50%;
  color: #d2f9f4;
  background: #254357;
  font-size: 42px;
  font-weight: 800;
}

.theme-shop-avatar-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.theme-shop-kicker {
  color: #c4e2ff;
  font-size: .85rem;
}

.theme-shop-hero h2 {
  margin: 5px 0 10px;
  color: #fff;
  font-size: clamp(25px, 4vw, 40px);
  overflow-wrap: anywhere;
}

.theme-shop-hero p, .theme-shop-example-cards p {
  margin: 0;
  color: #e2efff;
  line-height: 1.5;
}

.theme-shop-example-cards {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
  margin-top: 18px;
}

.theme-shop-example-cards article {
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(147, 197, 253, .3);
  border-radius: 16px;
  background: rgba(11, 23, 47, .93);
}

.theme-shop-example-cards h3 {
  margin: 0 0 10px;
  color: #fff;
}

.theme-shop-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.theme-shop-heading h2 {
  margin: 0;
}

.theme-shop-balance {
  margin: 0;
  padding: 9px 12px;
  color: #ffe3a3;
  border: 1px solid #6e6043;
  border-radius: 10px;
  font-weight: 700;
}

.theme-shop-fieldset {
  min-width: 0;
  margin: 20px 0 0;
  padding: 0;
  border: 0;
}

.theme-shop-fieldset legend {
  margin-bottom: 10px;
}

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

.theme-shop-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid #365365;
  border-radius: 14px;
  background: #0e1b34;
  cursor: pointer;
}

.theme-shop-card img {
  grid-column: 1 / -1;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
}

.theme-shop-card input {
  margin: 3px 0 0;
  accent-color: #76e3d6;
}

.theme-shop-card strong {
  overflow-wrap: anywhere;
}

.theme-shop-card .theme-shop-price {
  grid-column: 2;
  color: #ffe3a3;
  font-size: .9rem;
}

.theme-shop-card:not(.is-owned):is(:hover, :has(input:checked)) {
  border-color: #9ceae2;
  background: #16344a;
}

.theme-shop-card.is-owned {
  border-color: #477969;
  background: #122b32;
  cursor: default;
}

.theme-shop-card.is-owned .theme-shop-price {
  color: #9ceae2;
  font-weight: 700;
}

.theme-shop-card:focus-within, .profile-theme-picker select:focus-visible {
  outline: 2px solid #9ceae2;
  outline-offset: 3px;
}

.theme-shop-actions {
  margin-top: 20px;
}

:is(.profile-theme-controls, .profile-theme-picker, .theme-shop-preview, .theme-shop-avatar-image img, .theme-shop-actions > *, .profile-customization-panels > .panel, .profile-customization-panels .frame-profile-actions, .profile-customization-panels .profile-banner-picker)[hidden] {
  display: none;
}

@media (max-width: 610px) {
  .theme-shop-preview { padding: 14px; }
  .theme-shop-hero { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; padding: 18px; gap: 14px; }
  .theme-shop-example-cards, .theme-shop-grid { grid-template-columns: minmax(0, 1fr); }
}
