/* The outfit gallery is always two columns. These rules do not style live battles. */
.character-shop-screen .character-shop-collection {
  padding: 12px;
  border-color: rgb(181 155 104 / 24%);
  background: linear-gradient(145deg, #24202b, #171820);
}
.character-shop-screen .character-shop-collection > .section-heading { margin-bottom: 14px; }
.character-shop-screen .character-shop-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.character-shop-screen .character-shop-product {
  position: relative;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  padding: 9px;
  overflow: hidden;
  border: 1px solid rgb(201 173 115 / 23%);
  border-radius: 4px;
  background: linear-gradient(155deg, #302934, #1b1b25 70%);
  box-shadow: inset 0 1px rgb(255 242 207 / 5%), 0 5px 16px #08090d55;
}
.character-shop-screen .character-shop-product.owned { border-color: rgb(202 171 96 / 45%); }
.character-shop-screen .character-shop-product.equipped { border-color: #cfb477; box-shadow: inset 0 0 0 1px #cfb47733, 0 5px 16px #08090d55; }
.character-shop-screen .character-shop-product:focus-within { outline: 1px solid #d5bd8a; outline-offset: 2px; }
.character-shop-screen .character-shop-product-image {
  height: auto;
  aspect-ratio: 1;
  max-height: 300px;
  overflow: visible;
  border-radius: 3px;
  background: transparent;
}
.character-shop-screen .character-shop-art-button {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 8px 4px 27px;
  overflow: hidden;
  border: 1px solid #c9ad7330;
  border-radius: 3px;
  background: radial-gradient(ellipse at 50% 70%, #a085b12b, transparent 67%), linear-gradient(160deg, #11131c, #211a29);
  box-shadow: inset 0 0 18px #06090d77;
  color: #eee5d3;
  transform: none;
}
.character-shop-screen .character-shop-art-button::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 69%;
  aspect-ratio: 1;
  border: 1px solid #c6ac7440;
  border-radius: 50%;
  box-shadow: 0 0 0 7px #c6ac7408;
}
.character-shop-screen .character-shop-art-button > img {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 260px;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 7px 5px #0008);
}
.character-shop-preview-hint {
  position: absolute;
  right: 5px;
  bottom: 5px;
  left: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  font-size: var(--ga-font-note, 12px);
  font-weight: 500;
  line-height: 1.25;
  color: #ded1b4;
  background: linear-gradient(90deg, transparent, #14121ac9 22%, #14121ac9 78%, transparent);
}
.character-shop-screen .character-shop-product-image > .tag { z-index: 2; top: 6px; right: 6px; pointer-events: none; border: 1px solid #d2b56a55; background: #302718e8; }
.character-shop-screen .character-shop-product-copy { align-content: start; gap: 6px; padding: 1px 2px; }
.character-shop-screen .character-shop-product-copy strong { overflow: visible; white-space: normal; text-overflow: clip; line-height: 1.5; color: #f3eadb; }
.character-shop-screen .character-shop-product-copy small { min-height: 0; color: #b8b0bc; line-height: 1.5; }
.character-shop-screen .character-shop-purchase-row { gap: 8px; padding-top: 8px; border-top: 1px solid #c7ab7326; }
.character-shop-screen .character-shop-purchase-row > .grimoire-price { color: #e7cc8f; }
.character-shop-screen .character-shop-purchase-row > button { min-height: 48px; border-radius: 3px; }
.character-shop-screen .character-shop-product > button { min-height: 48px; }
.character-shop-screen .character-shop-art-button:focus-visible { outline: 2px solid #f2d59a; outline-offset: -3px; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .character-shop-screen .character-shop-art-button > img { transition: transform 160ms ease; }
  .character-shop-screen .character-shop-art-button:hover > img { transform: translateY(-3px); }
}
@media (max-width: 420px) {
  .character-shop-screen .character-shop-collection { padding: 8px; }
  .character-shop-screen .character-shop-product-grid { gap: 8px; }
  .character-shop-screen .character-shop-product { gap: 8px; padding: 6px; }
  .character-shop-screen .character-shop-purchase-row > button { flex-basis: 100%; }
  .character-shop-screen .character-shop-purchase-row > .grimoire-price { justify-content: flex-start; }
}

body.character-shop-preview-open { overflow: hidden; }
.outfit-preview-dialog {
  width: min(700px, calc(100% - 24px));
  max-width: none;
  height: min(860px, calc(100vh - 24px));
  height: min(860px, calc(100dvh - 24px));
  max-height: calc(100dvh - 24px);
  margin: auto;
  overflow: hidden;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: 8px;
  overscroll-behavior: contain;
  padding: 16px;
  color: var(--text, #f4eee3);
  border: 1px solid #af9364;
  border-radius: 4px;
  background: linear-gradient(150deg, #292430, #181a23);
  box-shadow: 0 20px 80px #000a;
}
.outfit-preview-dialog[open] { display: grid; }
.outfit-preview-dialog::backdrop { background: #080a12db; backdrop-filter: blur(4px); }
.outfit-preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.outfit-preview-heading > div { min-width: 0; }
.outfit-preview-heading .eyebrow { margin: 0 0 3px; color: #c9b68f; }
.outfit-preview-heading h2 { margin: 0; font-size: var(--ga-font-page, 18px); line-height: 1.5; overflow-wrap: anywhere; }
.outfit-preview-dialog .outfit-preview-close { flex: 0 0 44px; width: 44px; min-height: 44px; padding: 0; font-size: 24px; }
.outfit-preview-description { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.outfit-preview-scenes { display: flex; gap: 6px; margin: 0; }
.outfit-preview-dialog .outfit-preview-scenes button { flex: 1; min-height: 44px; padding: 5px; font-size: var(--ga-font-control, 14px); }
.outfit-preview-dialog .outfit-preview-scenes [aria-pressed="true"] { border-color: #ddc28a; color: #f4dfb3; background: #494033; box-shadow: inset 0 -2px #cfaf68; }
.outfit-preview-stage { position: relative; isolation: isolate; min-width: 0; min-height: 0; container-type: size; overflow: hidden; border: 1px solid #ddcaa541; border-radius: 3px; background: #141d23; }
.outfit-preview-background { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.outfit-preview-stage::before { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(#08101833, #07101a15 45%, #06101d8c); }
.outfit-preview-stage-caption { position: absolute; top: 10px; right: 10px; left: 10px; display: flex; justify-content: space-between; gap: 8px; color: #eae8dc; font-size: var(--ga-font-note, 12px); text-shadow: 0 1px 3px #000; }
.outfit-preview-stage-caption span { padding: 4px 8px; border: 1px solid #e8dcba40; border-radius: 2px; background: #09101c99; }
.outfit-preview-actor { position: absolute; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; justify-items: center; gap: 5px; width: min(36cqw, calc(70cqh - 44px), 185px); }
.outfit-preview-player { left: 6%; bottom: 22%; }
.outfit-preview-enemy { right: 5%; bottom: 28%; width: min(32cqw, calc(60cqh - 40px), 185px); }
.outfit-preview-actor-name { justify-self: end; white-space: nowrap; padding: 3px 7px; color: #fff5df; border-radius: 2px; background: #10101d9e; font-size: var(--ga-font-note, 12px); line-height: 1.3; text-align: center; text-shadow: 0 1px 2px #000; }
.outfit-preview-portrait { position: relative; width: 100%; aspect-ratio: 1; }
.outfit-preview-portrait::before { content: ""; position: absolute; bottom: 0; left: 15%; width: 70%; height: 10%; border-radius: 50%; background: #03090b55; filter: blur(3px); }
.outfit-preview-portrait img { position: relative; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 5px 3px #0005); }
.outfit-preview-hp { display: block; width: 76%; height: 5px; border: 1px solid #dad7d555; background: #1119; }
.outfit-preview-hp i { display: block; height: 100%; background: #66b99e; }
.outfit-preview-enemy .outfit-preview-hp i { background: #bd5c66; }
.outfit-preview-commands { position: absolute; right: 10px; bottom: 10px; left: 10px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.outfit-preview-commands span { padding: 8px 3px; border: 1px solid #aa956b7a; border-radius: 3px; background: linear-gradient(#394250dd, #19212ddd); color: #e9e2d0; text-align: center; font-size: var(--ga-font-note, 12px); }
.outfit-preview-pager { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; margin: 0; }
.outfit-preview-dialog .outfit-preview-pager button { min-width: 0; min-height: 44px; padding: 6px 4px; font-size: var(--ga-font-control, 14px); }
.outfit-preview-pager > span { color: #cfc4b2; font-size: var(--ga-font-note, 12px); white-space: nowrap; }
.outfit-preview-footer { display: flex; align-items: center; gap: 8px; }
.outfit-preview-note { flex: 1; min-width: 0; margin: 0; color: var(--muted, #b9b6c2); font-size: var(--ga-font-note, 12px); line-height: 1.5; }
.outfit-preview-dialog .outfit-preview-return { flex: 0 0 auto; min-height: 48px; padding: 8px; }
@media (max-width: 600px) {
  .outfit-preview-dialog { padding: 12px; }
}
@media (max-height: 480px) and (min-width: 480px) {
  .outfit-preview-dialog { width: min(960px, calc(100% - 24px)); padding: 10px; grid-template-columns: minmax(0, 1fr) minmax(220px, .85fr); grid-template-rows: auto auto minmax(0, 1fr) auto; }
  .outfit-preview-heading { grid-column: 1 / -1; }
  .outfit-preview-stage { grid-column: 1; grid-row: 2 / 5; }
  .outfit-preview-scenes { grid-column: 2; grid-row: 2; }
  .outfit-preview-pager { grid-column: 2; grid-row: 3; }
  .outfit-preview-footer { grid-column: 2; grid-row: 4; flex-wrap: wrap; }
  .outfit-preview-note { flex-basis: 100%; }
  .outfit-preview-dialog .outfit-preview-return { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .character-shop-art-button, .character-shop-art-button > img, .outfit-preview-dialog * { animation: none !important; transition: none !important; }
}

/* Scoped shop view switches; purchased items retain the existing two-column cards. */
.character-shop-screen .character-shop-view-tabs { display:flex; gap:8px; margin-block:12px; }
.character-shop-screen .character-shop-view-tabs > button { flex:1; min-height:44px; padding:8px; font-size:var(--ga-font-control, .875rem); }
.character-shop-screen .character-shop-view-tabs > button[aria-pressed="true"] { border-color:var(--selected-border); background:linear-gradient(145deg, color-mix(in srgb, var(--selected-start), var(--surface) 45%), var(--surface)); color:var(--selected-text); }
.character-shop-screen .character-shop-view-tabs span { margin-inline-start:4px; font-size:var(--ga-font-note, .75rem); }
