/* Style page: a live stage on the left, categories and a grid of visual choices on the right. */

.style-studio { container-type: inline-size; --st-ink: #22302a; --st-muted: #6b7a70; --st-line: #e1e8e1; --st-card: #fff; --st-art: linear-gradient(150deg, #f5f8f4, #e7eee7); --st-accent: #2f7a50; --st-accent-soft: #e6f2ea; --st-gem: #7447ae; }
html[data-theme="dark"] .style-studio { --st-ink: #eef0f5; --st-muted: #aab2bf; --st-line: #3a404b; --st-card: #272b34; --st-art: linear-gradient(150deg, #2f3440, #23272f); --st-accent: #6fcf97; --st-accent-soft: #2b3a33; --st-gem: #b59be0; }
.style-studio-grid { display: grid; gap: 22px; }
@container (min-width: 590px) {
  .style-studio-grid { grid-template-columns: minmax(240px, 330px) minmax(0, 1fr); align-items: start; }
  .style-stage-column { position: sticky; top: 18px; }
}

/* Stage */
.style-stage-column { display: grid; gap: 12px; }
.style-stage { position: relative; }
/* Same geometry as the Profile stage, so the character stands on the pedestal the same way. */
.style-stage .profile-stage { height: 440px; margin: 0; border-radius: 22px; }
/* Stand a little further back on the pedestal than the Profile stage does. */
.style-stage .profile-stage canvas { bottom: 104px; }
.style-stage .profile-pet { bottom: 116px; }
.style-stage-ring { position: absolute; z-index: 6; top: 14px; right: 14px; display: grid; place-items: center; width: 86px; height: 86px; border-radius: 50%; background: rgba(255, 255, 255, .88); box-shadow: 0 6px 18px rgba(20, 40, 30, .16); backdrop-filter: blur(6px); animation: st-pop .35s cubic-bezier(.2, .9, .3, 1.4); }
.style-stage-ring svg { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); }
.style-stage-ring span img { width: 30px; height: 30px; }
.style-stage-splats { position: absolute; z-index: 6; top: 30%; right: 12%; display: flex; align-items: center; gap: 2px; pointer-events: none; }
.style-stage-splats .hit-splat-preview { width: 66px; height: 66px; font-size: 21px; animation: st-pop .35s cubic-bezier(.2, .9, .3, 1.5) both; }
.style-stage-splats .hit-splat-preview + .hit-splat-preview { margin-top: 44px; animation-delay: .08s; }
@keyframes st-pop { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: none; } }

.style-tryon { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border: 1px solid color-mix(in srgb, var(--st-gem) 30%, transparent); border-radius: 16px; background: color-mix(in srgb, var(--st-gem) 8%, var(--st-card)); color: var(--st-ink); }
.style-tryon > span { display: grid; flex: 1; gap: 2px; min-width: 0; }
.style-tryon strong { font-size: 14px; }
.style-tryon small { color: var(--st-muted); font-size: 12px; }
.style-buy { flex: none; min-height: 36px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--st-gem); color: #fff; font-weight: 800; }
.style-tryon-close { flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--st-muted); font-size: 20px; line-height: 1; }
.style-tryon-close:hover { background: color-mix(in srgb, var(--st-muted) 14%, transparent); }

.style-appearance { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 1px solid var(--st-line); border-radius: 16px; background: var(--st-card); color: var(--st-ink); text-align: left; }
.style-appearance:hover { border-color: color-mix(in srgb, var(--st-accent) 40%, var(--st-line)); }
.style-appearance img { width: 26px; height: 26px; }
.style-appearance span { display: grid; flex: 1; gap: 2px; }
.style-appearance strong { font-size: 14px; }
.style-appearance small { color: var(--st-muted); font-size: 12px; }
.style-appearance b { color: var(--st-muted); font-size: 20px; font-weight: 400; }

/* Categories: each shows what's on now, so the whole look reads at a glance. */
.style-tabs { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.style-tabs button { display: grid; gap: 2px; min-width: 0; padding: 10px 12px; border: 1px solid var(--st-line); border-radius: 14px; background: var(--st-card); color: var(--st-ink); text-align: left; transition: border-color .15s ease, background .15s ease; }
.style-tabs button:hover { border-color: color-mix(in srgb, var(--st-accent) 35%, var(--st-line)); }
.style-tabs button span { font-size: 13px; font-weight: 700; }
.style-tabs button small { overflow: hidden; color: var(--st-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.style-tabs button.active { border-color: var(--st-accent); background: var(--st-accent-soft); box-shadow: inset 0 0 0 1px var(--st-accent); }
.style-tabs button.active small { color: var(--st-accent); }

.style-panel { margin-top: 20px; }
.style-panel > header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.style-panel h2 { margin: 0; color: var(--st-ink); font: 700 22px var(--serif, Georgia, serif); }
.style-panel > header span { color: var(--st-muted); font-size: 12px; }
.style-note { margin: 12px 0 0; color: var(--st-muted); font-size: 12px; }

/* Choices */
.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.style-grid.kind-tag, .style-grid.kind-background { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.style-tile { position: relative; display: grid; grid-template-rows: auto 1fr; min-width: 0; padding: 0; overflow: hidden; border: 1px solid var(--st-line); border-radius: 18px; background: var(--st-card); color: var(--st-ink); text-align: left; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.style-tile:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(25, 45, 32, .1); }
.style-tile:focus-visible { outline: 2px solid var(--st-accent); outline-offset: 2px; }
.style-tile.is-equipped { border-color: var(--st-accent); box-shadow: inset 0 0 0 1px var(--st-accent); }
.style-tile.is-previewing { border-color: var(--st-gem); box-shadow: inset 0 0 0 1px var(--st-gem); }
.style-tile-art { position: relative; display: grid; place-items: center; height: 104px; overflow: hidden; background: var(--st-art); }
.style-tile.is-locked .style-tile-art > :not(i) { opacity: .78; filter: saturate(.75); }
.style-tile-art img { max-width: 88%; max-height: 84%; object-fit: contain; }
.style-tile-art img.is-cover { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; }
.style-tile-art.kind-tag img { width: 88%; height: 58px; }
.style-tile-art.kind-pedestal img { width: 86%; height: 88px; }
.style-tile-art canvas { width: 100%; height: 100%; }
.style-tile-art .style-ring { width: 78px; height: 78px; }
.style-splats { display: flex; align-items: center; }
.style-splats .hit-splat-preview { width: 54px; height: 54px; font-size: 17px; }
.style-splats .hit-splat-preview + .hit-splat-preview { margin-left: -6px; }
.style-art-plain { padding: 6px 14px; border-radius: 8px; background: color-mix(in srgb, var(--st-muted) 16%, transparent); color: var(--st-ink); font-weight: 700; }
.style-art-none { width: 38px; height: 38px; border: 2px dashed color-mix(in srgb, var(--st-muted) 55%, transparent); border-radius: 50%; }
.style-tile-copy { display: grid; align-content: start; gap: 3px; padding: 10px 12px 12px; }
.style-tile-copy strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.style-tile-copy small { display: flex; align-items: center; gap: 4px; color: var(--st-muted); font-size: 11.5px; }
.style-tile-copy small img { width: 13px; height: 13px; }
.style-tile.is-equipped .style-tile-copy small { color: var(--st-accent); font-weight: 700; }
.style-tile.is-locked .style-tile-copy small:has(img) { color: var(--st-gem); font-weight: 700; }

.style-check, .style-lock { position: absolute; top: 8px; display: block; width: 24px; height: 24px; border-radius: 50%; }
.style-check { right: 8px; background: var(--st-accent); }
.style-check::after { position: absolute; top: 5px; left: 8.5px; width: 5px; height: 10px; content: ""; border: solid #fff; border-width: 0 2.4px 2.4px 0; transform: rotate(45deg); }
.style-lock { left: 8px; background: rgba(255, 255, 255, .9); box-shadow: 0 2px 6px rgba(20, 30, 25, .15); }
.style-lock::after { position: absolute; inset: 5px; content: ""; background: #5b6a61; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M4.2 6V4.6a2.8 2.8 0 0 1 5.6 0V6' fill='none' stroke='black' stroke-width='1.8'/%3E%3Crect x='2.5' y='6' width='9' height='7' rx='1.6'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M4.2 6V4.6a2.8 2.8 0 0 1 5.6 0V6' fill='none' stroke='black' stroke-width='1.8'/%3E%3Crect x='2.5' y='6' width='9' height='7' rx='1.6'/%3E%3C/svg%3E") center / contain no-repeat; }
html[data-theme="dark"] .style-lock { background: rgba(30, 33, 40, .9); }
html[data-theme="dark"] .style-lock::after { background: #c3cad6; }
html[data-theme="dark"] .style-stage-ring { background: rgba(30, 33, 40, .88); }

@media (prefers-reduced-motion: reduce) {
  .style-tile, .style-tile:hover { transform: none; transition: none; }
  .style-stage-ring, .style-stage-splats .hit-splat-preview { animation: none; }
}
