:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #10141f;
  color: #edf2f7;
}

.shopFreeze { min-width: 0; }
.shopFreezeTop, .shopFreezeDialog header, .shopFreezeSlotHeading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.shopFreezeTop { margin-bottom: 10px; }
.shopFreeze button, .shopFreezeDialog button, .shopFreezeConfirm button, .shopFreezeItemButton {
  min-height: 44px; padding: 10px 12px; border: 1px solid #536a85; border-radius: 6px;
  background: #223246; color: #edf5ff; cursor: pointer; white-space: normal;
}
.shopFreeze button:disabled, .shopFreezeDialog button:disabled, .shopFreezeItemButton:disabled { opacity: .5; cursor: default; }
.shopFreeze button:focus-visible, .shopFreezeDialog button:focus-visible, .shopFreezeConfirm button:focus-visible, .shopFreezeItemButton:focus-visible { outline: 2px solid #b9e3ff; outline-offset: 3px; }
.shopFreezeManage { display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.shopFreezeManage span, .shopFreezeHint, .shopFreezeSlotHeading span { color: #b8c9dd; font-size: 13px; }
.shopFreezeDesktopSlots, .shopFreezeSlots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.shopFreezeSlot { min-width: 0; border: 1px solid #3d5067; border-radius: 8px; background: #172230; padding: 12px; display: flex; flex-direction: column; gap: 10px; overflow-wrap: anywhere; }
.shopFreezeSlot--locked { background: #141e2c; }
.shopFreezeSlot > button { margin-top: auto; }
.shopFreezeCompactItem { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 10px; align-items: center; text-align: left; width: 100%; }
.shopFreezeCompactItem small { display: block; margin-top: 4px; color: #b8c9dd; }
.shopFreezeCompactItem .shopFreezePreview, .shopFreezeCompactItem .shopFocusPreview, .shopFreezeCompactItem .kingWreathPreviewHost { height: 70px; }
.shopFreezeCompactItem canvas, .shopFreezeCompactItem svg { max-height: 70px; }
.shopFreezePreview { height: 126px; position: relative; overflow: hidden; border-radius: 6px; background: #101923; }
.shopFreezePreview .shopFocusPreview { width: 100%; height: 126px; min-height: 0; aspect-ratio: auto; }
.shopFreezePreview .kingWreathPreviewHost { height: 126px; aspect-ratio: auto; }
.shopFreezePreview canvas, .shopFreezePreview svg { max-width: 100%; max-height: 126px; }
.shopFreezeSlot--compact .shopFreezePreview, .shopFreezeSlot--compact .shopFreezePreview .shopFocusPreview, .shopFreezeSlot--compact .kingWreathPreviewHost { height: 70px; }
.shopFreezeSlot--compact .shopFreezePreview canvas, .shopFreezeSlot--compact .shopFreezePreview svg { max-height: 70px; }
.shopFreezeActions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.shopFreezeActions button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.shopFreezeActions .shopFreezeUnfreeze { grid-column: 1 / -1; background: transparent; }
.shopFreezeStatus { margin: 8px 0 0; color: #c8def5; overflow-wrap: anywhere; }
.shopFreezeStatus:empty { display: none; }
.shopFreezeItemButton { grid-column: 1 / -1; }
.shopFrozenBadge { color: #b9e3ff !important; }
.shopFreezeDialog, .shopFreezeConfirm { color: #edf2f7; background: #111c2b; border: 1px solid #4a607a; border-radius: 12px; padding: 20px; width: min(980px, calc(100% - 28px)); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }
.shopFreezeDialog::backdrop, .shopFreezeConfirm::backdrop { background: #0009; }
.shopFreezeDialog h2, .shopFreezeConfirm h2 { margin: 0; font-size: 21px; }
.shopFreezeDialog header { margin-bottom: 8px; }
.shopFreezeDialog > .shopFreezeHint { margin: 0 0 16px; }
.shopFreezePending { color: #c9e7ff; }
.shopFreezeConfirm { width: min(440px, calc(100% - 28px)); }
.shopFreezeConfirm p { line-height: 1.5; }
body:has(.shopFreezeDialog[open]), body:has(.shopFreezeConfirm[open]) { overflow: hidden !important; }
@media (max-width: 680px) {
  .shopFreeze { position: sticky; top: 0; z-index: 20; background: #10141f; padding: 6px 0; }
  .shopFreezeTop { margin: 0; }
  .shopFreezeTop > .shopFreezeHint, .shopFreezeDesktopSlots { display: none; }
  .shopFreezeManage { width: 100%; }
  .shopFreezeDialog { margin: auto 0 0; width: 100%; max-width: none; max-height: calc(100dvh - 24px); border-radius: 16px 16px 0 0; padding: 16px 14px max(16px, env(safe-area-inset-bottom)); }
  .shopFreezeSlots { grid-template-columns: 1fr; }
  .shopFreezePreview, .shopFreezePreview .shopFocusPreview, .shopFreezePreview .kingWreathPreviewHost { height: 110px; }
  .shopFreezePreview canvas, .shopFreezePreview svg { max-height: 110px; }
}

* {
  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;
}

/* Connected staging gives existing renderers real layout without replacing the Shop. */
.shopNavigationStage {
  position: fixed;
  top: 0;
  left: 0;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.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);
}

.shopFocusPreview:has(.marbleBorderPreviewNotice) > svg { width: 100%; height: 100%; aspect-ratio: auto; }
.shopFocusPreview:has([data-border]) > p[role="status"] { position: absolute; right: 0; bottom: 0; left: 0; margin: 0; padding: 8px 10px; background: rgba(17, 24, 34, 0.92); }
.shopBorderCompanion { display: flex; align-items: center; gap: 8px; font-size: 0.87rem; color: #d9e4f8; }
.shopBorderCompanion input { accent-color: #e7c66b; }
.shopTile--marbles .marbleBorderPreviewNotice { display: none; }

.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;
}

@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;
  }
}

/* Offer component details stay in normal flow, below a separate preview area. */
.shopTile.shopTile--chat,
.shopTile.shopTile--marbles,
.shopTile.shopTile--crowns {
  display: flex;
  flex-direction: column;
  aspect-ratio: auto;
  min-width: 0;
}
.shopTile--chat .shopTilePreview {
  position: relative;
  inset: auto;
  height: 180px;
  flex: 0 0 180px;
}
.shopTile--chat.shopTile--chat-comparison .shopTilePreview {
  height: 300px;
  flex-basis: 300px;
}
.shopTile--chat .shopTilePreview > .chatCosmeticPreview { bottom: 0; }
.shopTile--chat .shopTileText,
.shopTile--marbles .shopTileText,
.shopTile--crowns .shopTileText {
  position: static;
  height: auto;
  flex: 1;
  align-content: start;
  padding: 12px;
  background: color-mix(in srgb, var(--rarity-bg) 90%, #000000 10%);
}
.shopTile--chat .shopTileText strong,
.shopTile--marbles .shopTileText strong,
.shopTile--crowns .shopTileText strong { line-height: 1.3; overflow-wrap: anywhere; }
.shopTile--chat .shopTileText small,
.shopTile--marbles .shopTileText small,
.shopTile--crowns .shopTileText small { align-self: end; padding-top: 4px; }
@media (max-width: 420px) {
  .shopTile--chat .shopTilePreview { height: 155px; flex-basis: 155px; }
  .shopTile--chat.shopTile--chat-comparison .shopTilePreview { height: 290px; flex-basis: 290px; }
  .shopTile--chat .shopTileText { padding: 10px; }
}

.shopTile--marbles .shopTilePreview { position: relative; inset: auto; height: auto; aspect-ratio: 1; flex: 0 0 auto; }
.shopTile--crowns .shopTilePreview { position: relative; inset: auto; height: auto; aspect-ratio: 1; flex: 0 0 auto; }
.shopTile--crowns .crownItemPreview { bottom: 0; }
.shopTile--marbles .shopTilePreview:has([data-border]) { display: flex; align-items: center; justify-content: center; }
.shopFocusPreview:has([data-border]) > svg { margin: 0 auto; }
.shopFocusPreview[data-cosmetic-item-type="bidding_indicator_style"],
.shopTile--marbles .shopTilePreview[data-cosmetic-item-type="bidding_indicator_style"] { aspect-ratio: 450 / 116; }

.kingWreathPreviewHost { width:100%; min-width:0; aspect-ratio:640/1080; overflow:hidden; }
.kingWreathPreviewHost .kingTilePreview { width:100%; height:100%; min-height:0; }

.kingWreathPreviewHost .crownOverlayProofWarning { display:none; }

.kingWreathPreviewHost { position:relative; }
.kingWreathPreviewHost .kingTilePreview { position:absolute; inset:0; }
.kingWreathPfpPreviewHost { aspect-ratio:1; }

/* Aura products use the same square card and focus layout as Marble cosmetics. */
.shopTile--marbles .shopTilePreview[data-cosmetic-item-type="rebellion_aura_style"],
.shopFocusPreview[data-cosmetic-item-type="rebellion_aura_style"] { display:block;aspect-ratio:1;min-height:0; }
.shopTilePreview[data-cosmetic-item-type="rebellion_aura_style"] > svg,
.shopFocusPreview[data-cosmetic-item-type="rebellion_aura_style"] > svg { width:100%;height:100%; }
.shopTilePreview[data-cosmetic-item-type="rebellion_aura_style"] .auraPreviewNotice,
.shopFocusPreview[data-cosmetic-item-type="rebellion_aura_style"] .auraPreviewNotice { position:absolute;right:0;bottom:0;left:0;margin:0;padding:8px;background:rgba(17,24,34,.92);font-size:11px; }
