:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #10141f;
  color: #edf2f7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(16, 20, 31, 0.96), rgba(18, 25, 34, 0.98)),
    #10141f;
}

button,
a {
  font: inherit;
}

.shopShell {
  min-height: 100vh;
}

.shopHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(16px, 4vw, 44px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(12, 16, 24, 0.88);
}

.shopBrand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  color: #f8fafc;
  text-decoration: none;
}

.shopBrand strong {
  font-size: 18px;
}

.shopBrand span,
.shopNav a,
.shopTopline p,
.shopFocusText p {
  color: #aeb9c8;
}

.shopNav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.shopNav a,
.shopInventoryLink {
  color: #d8e1ec;
  text-decoration: none;
  border-bottom: 1px solid rgba(216, 225, 236, 0.3);
}

.shopMain {
  width: min(1240px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.shopStatus,
.shopError {
  display: grid;
  place-items: center;
  min-height: 55vh;
  text-align: center;
}

.shopError {
  gap: 10px;
}

.shopError h1 {
  margin: 0;
  font-size: 28px;
}

.shopBoard {
  display: grid;
  gap: 22px;
}

.shopTopline {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.shopTopline h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1;
}

.shopTopline p {
  margin: 8px 0 0;
}

.shopWallet {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.shopWallet span {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.06);
}

.shopGridLayout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 24px;
  align-items: start;
}

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

.shopTypeButton {
  min-width: 0;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  color: #edf2f7;
  background: rgba(255, 255, 255, 0.055);
  text-align: left;
}

.shopTypeButton[aria-current="page"] {
  border-color: rgba(247, 212, 107, 0.8);
  background: #2c2415;
  color: #fff2c7;
}

.shopTypeButton:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.shopTypeButton span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.shopTypeButton strong,
.shopTypeButton em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shopTypeButton em {
  color: #aeb9c8;
  font-size: 12px;
  font-style: normal;
}

.shopTypeButton mark {
  flex: 0 0 auto;
  min-width: 44px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(216, 225, 236, 0.1);
  color: #9fb0c3;
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.shopTypeButton[aria-current="page"] mark {
  background: rgba(247, 212, 107, 0.18);
  color: #ffe6a3;
}

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

.shopTile {
  position: relative;
  min-height: 0;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--rarity-border);
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--rarity-bg) 82%, #ffffff 18%), var(--rarity-bg));
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.22), 0 0 26px var(--rarity-glow);
}

.shopTile--chat-comparison {
  aspect-ratio: 4 / 5;
}

.shopTile[aria-selected="true"] {
  outline: 3px solid #f7d46b;
  outline-offset: 2px;
}

.shopTilePreview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: transparent;
}

.shopTileText {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: grid;
  gap: 3px;
  pointer-events: none;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.shopTileText strong {
  font-size: 14px;
  line-height: 1.12;
}

.shopTileText small {
  color: #f4e5b4;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.1;
}

.shopTile mark {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 7px;
  border-radius: 999px;
  background: #d7f7cf;
  color: #0f3f20;
  font-size: 12px;
  font-weight: 800;
}

.shopFocus {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.shopFocusPreview {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 36%, rgba(247, 212, 107, 0.18), transparent 36%),
    linear-gradient(145deg, #17202d, #101720);
}

.shopFocusText {
  display: grid;
  gap: 4px;
}

.shopFocusText h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}

.shopFocusText p {
  margin: 0;
}

.shopBuyRow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.shopBuyButton {
  display: grid;
  gap: 3px;
  min-height: 62px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #f8fafc;
  background: #245a4f;
  cursor: pointer;
}

.shopBuyButton:nth-child(2) {
  background: #344e87;
}

.shopBuyButton:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.shopBuyButton span,
.shopBuyButton em {
  font-size: 12px;
  font-style: normal;
}

.shopBuyButton strong {
  font-size: 20px;
}

.shopMessage {
  min-height: 24px;
  color: #d8e1ec;
}

.shopMessage[data-tone="success"] {
  color: #baf7c7;
}

.shopMessage[data-tone="warning"] {
  color: #ffd18a;
}

.crownItemPreview,
.kingTilePreview {
  position: absolute;
  inset: 0;
}

.shopTile .crownItemPreview {
  pointer-events: none;
}

.shopTile .crownItemPreviewStage,
.shopTile .crownItemPreviewSlot {
  position: absolute;
  inset: 0;
}

.shopTile .crownItemPreviewImage {
  position: absolute;
  inset: 4%;
  width: 92%;
  height: 92%;
  object-fit: contain;
}

.shopFocusPreview .kingTilePreview {
  width: 100%;
  height: 100%;
}

.shopTilePreview > .chatCosmeticPreview,
.shopFocusPreview > .chatCosmeticPreview {
  position: absolute;
  inset: 0;
}

.kingPfpCrownPreview {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.kingPfpCrownPreviewAvatar {
  position: absolute;
  left: 50%;
  top: 60%;
  z-index: 2;
  width: min(46%, 178px);
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 3px solid rgba(247, 212, 107, 0.92);
  border-radius: 50%;
  background: #182432;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.34);
}

.kingPfpCrownPreviewAvatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kingPfpCrownPreviewAvatar span {
  color: #ffe6a3;
  font-size: clamp(42px, 9vw, 76px);
  font-weight: 900;
  line-height: 1;
}

.kingPfpCrownPreviewCrownLayer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  overflow: visible;
}

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

  .shopTypes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shopFocus {
    order: -1;
  }
}

@media (max-width: 680px) {
  .shopHeader,
  .shopTopline {
    align-items: flex-start;
    flex-direction: column;
  }

  .shopWallet {
    justify-content: flex-start;
  }

  .shopOfferGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shopTile {
    aspect-ratio: 2 / 3;
  }

  .shopTile--chat-comparison {
    aspect-ratio: 2 / 5;
  }

  .shopTilePreview > .chatCosmeticPreview,
  .shopTile .crownItemPreview {
    bottom: 100px;
  }

  .shopTileText {
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    height: 100px;
    align-content: end;
    padding: 9px 10px 10px;
    background: linear-gradient(180deg, transparent, var(--rarity-bg) 18%);
  }

  .shopTypes {
    grid-template-columns: 1fr;
  }

  .shopBuyRow {
    grid-template-columns: 1fr;
  }
}
