@font-face {
    font-family: "Sim Dialogue";
    src: url("simdialogue-uni-game.ttf") format("truetype");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

:root {
    color-scheme: light;
    --green: #00ff00;
    --yellow: #ffff00;
    --cyan: #00ffff;
    --blue: #3333ff;
    --deep-blue: #0000ff;
    --violet: #9933ff;
    --pink: #ff33cc;
    --paper: #e8ffff;
    --white: #fffaff;
    --ink: #27003f;
    --muted: #49325f;
    --line: #513aaf;
    --focus: #27003f;
    font: 700 16px/1.55 "Sim Dialogue", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: radial-gradient(ellipse at top, var(--yellow), var(--green) 65%); min-height: 100vh; }
body:has(.login-layout) { background: #b8f007; }
body:has(.dashboard-layout) {
    background: radial-gradient(ellipse 76vw 95vh at 49% 3rem, #ffff00, #dfff00 29%, #8bff00 62%, #41f900) #41f900;
}
a { color: var(--deep-blue); }
button, input, select, textarea, option { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { line-height: 1.16; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip { position: fixed; top: .6rem; left: .6rem; transform: translateY(-160%); background: var(--cyan); z-index: 1; padding: .5rem .8rem; }
.skip:focus { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

.masthead { --focus: var(--yellow); border-bottom: 1px solid var(--deep-blue); background: var(--violet); }
.masthead-inner { display: flex; align-items: center; gap: 1rem; margin: auto; padding: .72rem clamp(1rem, 3.6vw, 3rem); max-width: 96rem; min-height: 4.2rem; }
.wordmark { flex: none; display: block; width: clamp(3.15rem, 6vw, 4.25rem); }
.wordmark img { display: block; width: 100%; height: auto; }
.masthead-logo { display: block; flex: 0 1 auto; width: clamp(5.5rem, 11vw, 9.5rem); min-width: 0; height: auto; }
.masthead-tso { flex: none; display: block; width: clamp(3.5rem, 6vw, 5.25rem); }
.masthead-tso img { display: block; width: 100%; height: auto; }
.masthead-clock { display: grid; gap: .15rem; color: white; font-size: .75rem; line-height: 1.15; white-space: nowrap; }
.masthead-clock strong { color: var(--yellow); font-size: .95rem; }
.sign-out { margin-left: auto; }
.sign-out .quiet-button {
    border-color: #bcd2ff;
    border-radius: 2rem;
    background:
        radial-gradient(ellipse at 20% 0%, #d4f5ffb3, transparent 43%),
        radial-gradient(ellipse at 80% 100%, #25d5ffcf, transparent 43%),
        linear-gradient(135deg, #3956bb, #2a165f 53%, #5c2d9e);
    box-shadow: inset 0 1px 3px #fff9, inset 0 -2px 4px #34c9ff7a, 0 3px 7px #1b034975;
    text-shadow: 0 1px 2px #220b50;
}
.shell { margin: 0 auto; max-width: 96rem; padding: 0 clamp(1rem, 3.6vw, 3rem); }
/* Match the original 800-by-980 Flash stage below the masthead. */
.shell:has(> .login-layout) {
    max-width: none;
    padding: 0 0 clamp(1.25rem, 3vw, 2rem);
    background: url(tso-2006-background.webp) center top / 800px 980px no-repeat;
}
@media (prefers-reduced-motion: no-preference) {
    .shell:has(> .login-layout) { background-image: url(tso-2006-breathing.gif); }
}
.panel { background: var(--cyan); border: 1px solid var(--deep-blue); border-radius: 1rem; padding: clamp(1rem, 2vw, 1.4rem); }
.quiet-button, .primary-button { min-height: 2.5rem; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--deep-blue); border-radius: .6rem; padding: .4rem .9rem; text-decoration: none; white-space: nowrap; }
.quiet-button { color: var(--white); background: var(--blue); }
.quiet-button:hover { color: var(--yellow); background: #2424b7; }
.primary-button { color: var(--ink); background: var(--pink); }
.primary-button:hover { background: var(--yellow); }
input:not([type=hidden]), select { width: 100%; min-height: 2.75rem; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: .6rem; padding: .52rem .75rem; }
input::placeholder { color: var(--muted); }

.login-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    width: min(calc(100% - 2rem), 50rem);
    margin: 0 auto;
    padding: clamp(1.25rem, 2.5vw, 2rem) 0 1rem;
}
/* Frame the visible crown while trimming the original PNG's transparent padding. */
.dashboard-realm-divider {
    width: clamp(8rem, 22vw, 12rem);
    aspect-ratio: 250 / 162;
    margin: 0 auto;
    overflow: hidden;
}
.dashboard-realm-divider img {
    display: block;
    width: 100%;
    height: auto;
    transform: translateY(-16.4%);
}
.dashboard-realm {
    display: block;
    width: min(calc(100% - 2rem), 50rem);
    margin-inline: auto;
    border: 0;
    border-radius: 1.35rem;
    box-shadow: 0 0 0 4px var(--violet);
}
.login-hero { position: relative; aspect-ratio: 16/9; isolation: isolate; display: flex; align-items: end; border: 1px solid var(--deep-blue); border-radius: 1.35rem; padding: clamp(1rem, 3vw, 2rem); background: #102646 url(realm-sunset-still.webp) center top / cover no-repeat; box-shadow: 0 0 0 4px var(--violet); overflow: hidden; }
.login-backdrop { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: center top; visibility: hidden; }
.login-backdrop.is-visible { visibility: visible; }
.login-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, #17002ea6, transparent 37%); }
.login-hero h1 { width: min(65%, 32rem); color: var(--yellow); font-size: clamp(1.25rem, 2.7vw, 2.65rem); line-height: 1.16; text-shadow: 0 .08em .32em var(--ink); }
.login-hero h1 img { display: block; width: 100%; height: auto; margin-bottom: .35rem; filter: drop-shadow(0 .3rem .55rem #17002ecf); }
.motion-toggle { position: absolute; right: .85rem; bottom: .85rem; min-height: 2.5rem; padding: .25rem .6rem; border: 1px solid #ffffff75; border-radius: .55rem; background: #17002ee6; color: var(--white); font-size: .72rem; }
.motion-toggle:focus-visible { outline-color: var(--yellow); }
.login-panel { padding: clamp(1.35rem, 3vw, 2.5rem); }
.login-panel h2 { font-size: 2rem; }
.login-panel p { margin-top: .6rem; color: var(--muted); }
.login-form { display: grid; gap: .6rem; margin-top: 1.3rem; }
.login-form label { font-size: .92rem; }
.login-form input { margin-bottom: .55rem; }
.login-form button { margin-top: .55rem; }

.game-login-panel {
    --focus: #fff99d;
    position: relative;
    isolation: isolate;
    justify-self: center;
    width: min(100%, 26rem);
    padding: 4px clamp(1.25rem, 3vw, 2rem) 1.9rem;
    background: transparent;
    border: 0;
    color: #fff99d;
}
.game-login-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-image: url(game-login-frame.png) 60 41 40 41 fill / 60px 41px 40px 41px stretch;
}
.game-login-panel h2 { min-height: 1.35rem; text-align: center; font-size: 1rem; }
.game-login-panel p { margin-top: 1.2rem; color: inherit; }
.game-login-panel .error { color: #fff0f7 !important; background: #661e49; padding: .35rem .6rem; border-radius: .3rem; }
.game-login-panel .login-form { gap: .25rem; margin-top: .75rem; }
.game-login-panel input:not([type=hidden]) {
    background: transparent;
    color: inherit;
    border: 0;
    border-image: url(game-login-field.png) 13 fill / 13px stretch;
    padding-inline: .9rem;
}
.game-login-panel input::selection { color: #00387b; background: #fff99d; }
.game-login-panel .primary-button {
    justify-self: center;
    min-width: 9.4rem;
    min-height: 2.75rem;
    background: transparent;
    color: inherit;
    border: 0;
    border-image: url(game-login-button-normal.png) 0 21 fill / 0 21px stretch;
}
.game-login-panel .primary-button:hover { border-image-source: url(game-login-button-hover.png); }
.game-login-panel .primary-button:active { border-image-source: url(game-login-button-pressed.png); }
.game-login-panel .primary-button:disabled { border-image-source: url(game-login-button-disabled.png); cursor: default; }

.dashboard-layout { display: grid; grid-template-columns: minmax(11rem, 15rem) minmax(0, 1fr); gap: clamp(1.2rem, 4vw, 4rem); padding: 2rem 0 3rem; }
.sidebar { min-width: 0; border-right: 1px solid var(--line); padding: .65rem 1.4rem 0 0; }
.sidebar-brand { width: min(100%, 12.5rem); }
.sidebar-brand img { display: block; width: 100%; height: auto; }
.account { margin-top: .7rem; color: var(--muted); overflow-wrap: anywhere; font-size: .87rem; }
.account strong { color: var(--ink); }
.sidebar h2 { color: var(--muted); margin: 2.5rem 0 .8rem; font-size: .9rem; }
.sim-list { display: grid; gap: .4rem; }
.sim-list a { display: flex; gap: .55rem; align-items: center; min-width: 0; min-height: 2.75rem; overflow-wrap: anywhere; border-radius: .75rem; padding: .25rem .6rem; color: var(--ink); text-decoration: none; }
.sim-color-2 { --sim-color: #ff8a00; }
.sim-color-3 { --sim-color: #538dff; }
.sim-color-4 { --sim-color: #39ff14; }
.sim-color-5 { --sim-color: var(--yellow); }
.sim-color-6 { --sim-color: #ff403a; }
.sim-color-7 { --sim-color: var(--cyan); }
.sim-color-8 { --sim-color: #be7aff; }
.sim-color-9 { --sim-color: #57ffc0; }
.sim-color-10 { --sim-color: #ff8dfa; }
.sim-color-11 { --sim-color: #ffc52a; }
.sim-color-12 { --sim-color: #a6aeff; }
.sim-list a:hover { text-decoration: underline; text-underline-offset: .2em; }
.sim-list a[aria-current] { outline: 2px solid var(--ink); outline-offset: -3px; }
.sim-portrait { display: block; flex: none; width: 33px; aspect-ratio: 1; }
.sim-portrait img { display: block; width: 100%; height: 100%; border-radius: .25rem; image-rendering: pixelated; }
.workspace { min-width: 0; }
.sim-heading { display: flex; align-items: center; gap: clamp(.65rem, 1.4vw, 1.15rem); width: fit-content; max-width: 100%; padding: .55rem clamp(.75rem, 1.4vw, 1.15rem); border-radius: clamp(1rem, 2vw, 1.6rem); font-size: clamp(2.25rem, 5vw, 4rem); letter-spacing: -.025em; overflow-wrap: anywhere; }
.sim-heading .sim-portrait { width: clamp(2.75rem, 5.25vw, 4.5rem); }
.sim-heading .sim-portrait img { border-radius: .55rem; }
.sim-heading > :last-child, .sim-list a > :last-child { min-width: 0; }
.view-tabs { display: flex; flex-wrap: wrap; gap: .55rem; margin: 1rem 0 1.35rem; }
.view-tabs a { display: flex; gap: .4rem; align-items: center; min-height: 2.5rem; padding: .35rem clamp(.55rem, 1.4vw, .9rem); border-radius: .7rem; color: var(--ink); text-decoration: none; }
.sim-list a, .sim-heading, .view-tabs a {
    border: 1px solid #4b0d7559;
    background: linear-gradient(180deg, #fff7ff65 0, #fff0 45%, #34055130 90%), var(--sim-color, var(--pink));
    box-shadow: inset 0 1px 2px #fff9, inset -2px -2px 4px #36014a45, 1px 3px 0 #2d084983, 2px 5px 7px #14232049;
}
.view-tabs a:hover { text-decoration: underline; text-underline-offset: .2em; }
.view-tabs a[aria-current] { border-color: var(--ink); box-shadow: inset 0 0 0 2px #fff9, inset 0 -4px 0 #68108f, 1px 3px 0 #370753bd, 2px 5px 7px #14232049; }
.view-tabs span { font-size: .72rem; border-radius: .4rem; padding: 0 .35rem; background: var(--ink); color: var(--white); }
.profile-panel, .profile-column > .panel, .appearance-details, .appearance-viewer,
.lots-head, .lot-card, .lots-section > .empty, .inventory-head, .object-card,
.object-viewer, .objects-section > .empty, .treasure-panel {
    --muted: #c9edf8;
    --line: #a1edff66;
    --deep-blue: #a1f6ff;
    --focus: #fff99d;
    --glass-inset: linear-gradient(155deg, #a6e8ff38, #082e4d66 56%, #3bd7ff24);
    --glass-inset-shadow: inset 0 1px 2px #dcfaff9e, inset 0 -2px 4px #52e3ff72, 0 1px 5px #002f5a75;
    color: #f5fcff;
    text-shadow: 0 1px 2px #00283fba;
    border: 1px solid #bdf8ff;
    border-radius: 1.35rem;
    background:
        radial-gradient(ellipse at 9% 0%, #b3d8ff50, transparent 58%),
        radial-gradient(ellipse at 100% 100%, #0addfe63, transparent 62%),
        linear-gradient(135deg, #1c527beb, #064462ef 54%, #086783e8);
    box-shadow:
        inset 0 1px 3px #f3fdff,
        inset 0 0 0 3px #7fe9ff66,
        inset -4px -5px 10px #48deffd1,
        inset 4px 5px 14px #d9f8ff45,
        0 0 0 1px #c3f8ff9c,
        2px 3px 0 1px #28c5f4,
        4px 5px 0 1px #137cae,
        5px 9px 15px #002d4080,
        0 0 14px #61efffb3;
    backdrop-filter: blur(8px);
}
.profile-stats > div, .profile-values li, .job-card, .job-shift > div,
.wardrobe-tabs, .wardrobe-card, .object-art, .object-viewer-header > div,
.treasure-balance, .treasure-notice {
    border: 1px solid #a8eaffab;
    background: var(--glass-inset);
    box-shadow: var(--glass-inset-shadow);
}
.profile-panel h3, .profile-details h3, .inventory-head h3, .lots-head h3 { font-size: 1.25rem; letter-spacing: -.025em; }
.profile-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; margin: .9rem 0 1.2rem; }
.profile-stats div { border-radius: .75rem; padding: .6rem .8rem; overflow-wrap: anywhere; }
.profile-stats dt { font-size: .78rem; color: var(--muted); }
.profile-stats dd { margin: 0; font-size: clamp(.9rem, 1.5vw, 1.16rem); font-weight: 700; font-variant-numeric: tabular-nums; }
.profile-stats div:first-child dd { color: var(--deep-blue); }
.profile-panel h4 { font-size: .9rem; }
.bio { margin-top: .35rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-details { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; margin-top: 1rem; align-items: start; }
.profile-column { display: grid; min-width: 0; gap: 1rem; }
.skills, .profile-values, .jobs { margin: .65rem 0 0; padding: 0; list-style: none; }
.skills li { padding: .65rem 0; border-bottom: 1px solid var(--line); }
.skills li:last-child { border-bottom: 0; }
.skills li { display: flex; gap: .4rem; justify-content: space-between; }
.skill-values { display: flex; gap: .65rem; white-space: nowrap; align-items: baseline; }
.skill-values strong { color: var(--deep-blue); font-variant-numeric: tabular-nums; }
.skills small, .jobs small, .muted, .lots-head p, .lot-meta { color: var(--muted); }
.profile-values { display: grid; gap: .5rem .8rem; }
.profile-values.interests { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.profile-values li { padding: .55rem .7rem; border-radius: .65rem; }
.profile-value-label { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
.profile-value-label span { overflow-wrap: anywhere; }
.profile-value-label strong { color: var(--deep-blue); font-size: .88rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.profile-values meter, .job-promotion progress { display: block; width: 100%; height: .7rem; margin-top: .4rem; }
.jobs { display: grid; gap: .7rem; }
.job-card { padding: .8rem .9rem; border-radius: .85rem; overflow-wrap: anywhere; }
.job-heading { display: flex; gap: .4rem .6rem; align-items: baseline; flex-wrap: wrap; }
.job-heading h4 { font-size: 1.08rem; }
.job-heading .accent { color: #fffdc0; background: linear-gradient(#673bd2, #261172); box-shadow: inset 0 1px 2px #ddc4ffb3, 0 0 5px #b877fe8f; }
.job-card .job-level { display: block; margin-top: .15rem; }
.job-description { white-space: pre-line; }
.job-description, .job-requirements, .job-promotion { margin-top: .65rem; }
.job-shift { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: .35rem .65rem; margin: .65rem 0 0; }
.job-shift div { padding: .35rem .5rem; border-radius: .5rem; }
.job-shift dt { color: var(--muted); font-size: .75rem; }
.job-shift dd { margin: 0; font-size: .85rem; }
.job-card h5 { margin: 0 0 .25rem; font-size: .9rem; line-height: 1.25; }
.job-card p, .job-card .job-requirements ul { font-size: .88rem; }
.job-card .job-requirements ul { margin: 0; padding-left: 1.15rem; }
.job-promotion { border-top: 1px solid var(--line); padding-top: .65rem; }
.job-promotion p + p { margin-top: .25rem; }
.job-xp { color: var(--deep-blue); }
@media (forced-colors: none) {
    .profile-values meter, .job-promotion progress {
        appearance: none;
        border: 0;
        border-radius: 1rem;
        background: linear-gradient(180deg, #001e3a, #104a64 64%, #3c829f);
        box-shadow: inset 0 0 0 1px #a7eaffc9, inset 0 2px 3px #001b32, 0 0 4px #8deeff80;
    }
    .profile-values meter {
        --bar-fill: linear-gradient(#e4ffc8, #91ff49 30%, #32e90b 54%, #116d05 100%);
        --bar-light: #80ff44;
    }
    .job-promotion progress {
        --bar-fill: linear-gradient(#fbe2ff, #b880ff 30%, #793ffa 54%, #3d16a9 100%);
        --bar-light: #c275ff;
    }
    .profile-values meter::-webkit-meter-bar, .job-promotion progress::-webkit-progress-bar {
        border: 0;
        border-radius: inherit;
        background: transparent;
    }
    .profile-values meter::-webkit-meter-optimum-value, .job-promotion progress::-webkit-progress-value {
        border-radius: 1rem;
        background: var(--bar-fill);
        box-shadow: inset 0 0 0 1px var(--bar-light), 0 0 6px var(--bar-light);
    }
    .profile-values meter::-moz-meter-bar {
        border-radius: 1rem;
        background: var(--bar-fill);
        box-shadow: inset 0 0 0 1px var(--bar-light), 0 0 6px var(--bar-light);
    }
    .job-promotion progress::-moz-progress-bar {
        border-radius: 1rem;
        background: var(--bar-fill);
        box-shadow: inset 0 0 0 1px var(--bar-light), 0 0 6px var(--bar-light);
    }
    .profile-values meter[value="0"]::-webkit-meter-optimum-value,
    .job-promotion progress[value="0"]::-webkit-progress-value { box-shadow: none; }
    .profile-values meter[value="0"]::-moz-meter-bar { box-shadow: none; }
    .job-promotion progress[value="0"]::-moz-progress-bar { box-shadow: none; }
}
.promotion-requirements { display: grid; gap: .3rem; margin: .55rem 0 0; font-size: .85rem; }
.promotion-requirements div { display: flex; justify-content: space-between; align-items: baseline; gap: .35rem .5rem; flex-wrap: wrap; }
.promotion-requirements dd { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem; margin: 0; }
.requirement-status { color: var(--muted); font-size: .75rem; }
.error { color: #7a003b !important; }
.empty, .muted { margin-top: .65rem; }
.empty p + a { display: inline-block; margin-top: .5rem; }
.lots-section > .empty a, .objects-section > .empty a { color: var(--deep-blue); }

.lots-head, .inventory-head { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: end; gap: .75rem; margin-bottom: 1rem; padding: clamp(1rem, 2vw, 1.4rem); }
.lots-head p, .inventory-head p { margin-top: .25rem; font-size: .87rem; }
.lot-search { display: grid; grid-template-columns: minmax(7rem, 15rem) auto auto; gap: .5rem; min-width: 0; }
.lot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15.5rem), 1fr)); gap: 1rem; }
.lot-card { padding: 0; overflow: hidden; }
.lot-image { background: var(--violet) url(atlas.png) center / cover; aspect-ratio: 16/9; border-bottom: 1px solid var(--line); }
.lot-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lot-body { padding: .85rem 1rem 1rem; }
.tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .4rem; }
.tag { display: inline-block; color: var(--ink); border: 1px solid var(--line); border-radius: .4rem; padding: .05rem .35rem; background: var(--paper); font-size: .73rem; white-space: nowrap; }
.tag.accent { color: var(--yellow); background: var(--blue); }
.lot-card .tag, .object-card .tag { color: #f5fcff; background: var(--glass-inset); box-shadow: var(--glass-inset-shadow); }
.lot-card .tag.accent { color: var(--yellow); background: linear-gradient(#673bd2, #261172); }
.lot-card h4 { font-size: 1.14rem; overflow-wrap: anywhere; }
.lot-meta, .lot-description { margin-top: .3rem; font-size: .85rem; overflow-wrap: anywhere; }
.lot-description { white-space: pre-wrap; }
.pagination { margin-top: 1.25rem; display: flex; justify-content: center; flex-wrap: wrap; gap: .8rem; align-items: center; color: var(--muted); font-size: .85rem; }

.object-search { display: flex; gap: .5rem; width: min(100%, 20rem); }
.object-search input { min-width: 0; }
.object-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr)); gap: .85rem; margin: 0; padding: 0; list-style: none; }
.object-card { display: flex; flex-direction: column; min-width: 0; gap: .5rem; padding: .65rem; text-align: center; }
.object-art { display: grid; place-items: center; width: 100%; height: calc(74px + 1rem); border-radius: .75rem; color: var(--muted); font-size: .72rem; }
.object-art img { display: block; width: min(100%, 74px); height: auto; max-height: 74px; object-fit: contain; image-rendering: pixelated; }
.object-card h4 { padding-inline: .2rem; font-size: .9rem; overflow-wrap: anywhere; }
.object-season { color: var(--deep-blue); font-size: .8rem; }
.object-meta { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: center; }
.object-view-button { margin-top: auto; padding-inline: .35rem; font-size: .82rem; }
.object-view-button[aria-expanded="true"] { color: var(--ink); background: var(--deep-blue); }
.object-viewer { width: min(100%, clamp(27rem, 63%, 44rem), 74dvh); margin: 0 0 1rem; padding: .65rem; scroll-margin-top: .75rem; }
.object-viewer-header { display: grid; grid-template-columns: auto 1fr; align-items: stretch; gap: .55rem; margin-bottom: .65rem; }
.object-viewer-header > div { min-width: 0; padding: .45rem .75rem; border-radius: .65rem; }
.object-viewer-header h4 { margin: 0; font-size: clamp(1.2rem, 3vw, 1.65rem); overflow-wrap: anywhere; }
.object-viewer-header p { margin: .15rem 0 0; font-size: .9rem; color: var(--deep-blue); }
.object-viewer-close { height: 100%; min-height: 2.5rem; min-width: 2.5rem; border: 1px solid var(--line); border-radius: .55rem; background: #77f746; color: var(--ink); font-size: 1.5rem; }
.object-viewer-close:hover { background: var(--yellow); }
.object-viewer-stage { position: relative; width: 100%; aspect-ratio: 1200 / 1181; border-radius: .65rem; overflow: hidden; background: #fa21a6 url("object-viewer-backdrop.webp") center / 100% 100% no-repeat; }
.object-viewer-model { position: absolute; inset: 15% 26% 9% 11%; }
.object-viewer-canvas { display: block; width: 100%; height: 100%; background: transparent; touch-action: none; }
.object-viewer-canvas:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.object-viewer-thumbnail:not([hidden]) { position: absolute; top: 4.5%; right: 3.5%; width: 12%; height: auto; aspect-ratio: 1; object-fit: contain; image-rendering: pixelated; }
.object-viewer-status:not(:empty) { position: absolute; inset: 46% 26% auto 11%; text-align: center; margin: 0; padding: .45rem; color: var(--ink); text-shadow: none; background: var(--paper); border-radius: .5rem; pointer-events: none; }
.object-viewer-help { margin: .55rem 0 0; text-align: center; font-size: .85rem; }
.object-redeem { margin-top: auto; padding-top: .35rem; font-size: .8rem; }
.object-redeem summary { cursor: pointer; border: 1px solid var(--deep-blue); border-radius: .5rem; padding: .4rem; color: var(--ink); text-shadow: none; background: var(--pink); }
.object-redeem summary:hover { background: var(--yellow); }
.object-redeem summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.object-redeem form { display: grid; gap: .45rem; margin-top: .55rem; }
.object-redeem button { padding-inline: .4rem; white-space: normal; }
.accessory-notice { margin-bottom: .9rem; }

.appearance-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; gap: 1rem; }
.appearance-viewer { padding: .65rem; }
.appearance-stage {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: .65rem;
    background: #ff02a8 url("appearance-backdrop.png") center / 100% 100% no-repeat;
}
.appearance-stage img {
    position: absolute;
    top: 1.33%;
    left: 50%;
    width: 69.15%;
    height: auto;
    transform: translateX(-50%);
}
.appearance-stage.is-close-up::before {
    /* The artwork is solid pink around the pedestal, inside the painted frame. */
    content: "";
    position: absolute;
    inset: 71% 15% 4.25%;
    background: #ff02a8;
}
.appearance-stage.is-close-up img { top: -22%; width: 140%; }
.appearance-controls:not([hidden]) { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: .75rem; }
.appearance-controls button[aria-pressed="true"] { background: var(--yellow); color: var(--ink); }
.appearance-details h3 { font-size: 1.25rem; }
.appearance-wardrobe { margin-top: .8rem; }
.wardrobe-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .15rem; margin-bottom: .9rem; padding: .2rem; border-radius: .75rem; }
.wardrobe-tabs button { min-height: 2.55rem; min-width: 0; border: 1px solid transparent; border-radius: .5rem; padding: .2rem; color: inherit; background: transparent; font-size: clamp(.8rem, 1.35vw, .95rem); }
.wardrobe-tabs button:hover { border-color: var(--line); }
.wardrobe-tabs button[aria-selected="true"] { border-color: var(--deep-blue); color: var(--white); background: var(--blue); }
.wardrobe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 7rem), 1fr)); gap: .55rem; margin: 0; padding: 0; list-style: none; }
.wardrobe-item { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.wardrobe-card { display: flex; flex-direction: column; width: 100%; height: 100%; align-items: center; gap: .3rem; border-radius: .65rem; padding: .45rem; text-align: center; color: inherit; }
.accessory-wear button { width: 100%; font-size: .8rem; }
.accessory-help { font-size: .85rem; }
button.wardrobe-card:hover, button.wardrobe-card[aria-pressed="true"] { border-color: var(--deep-blue); box-shadow: inset 0 0 0 1px var(--deep-blue); }
button.wardrobe-card[aria-pressed="true"] { color: var(--ink); text-shadow: none; background: var(--yellow); }
button.wardrobe-card[aria-pressed="true"] .wardrobe-equipped { color: var(--ink); }
.wardrobe-art { display: grid; width: 100%; height: 5rem; place-items: center; border-radius: .35rem; background: #03233a7a; color: var(--muted); font-size: .75rem; }
.wardrobe-art img { max-width: 100%; max-height: 4.5rem; object-fit: contain; }
.wardrobe-art img[hidden] { display: none; }
.wardrobe-item-name { font-size: .85rem; line-height: 1.25; overflow-wrap: anywhere; }
.wardrobe-equipped { color: var(--deep-blue); font-size: .72rem; }
.wardrobe-empty { margin: 0; padding: .65rem 0; }
.wardrobe-reset:not([hidden]) { display: inline-flex; margin-top: .6rem; font-size: .85rem; }
.wardrobe-reset:disabled { opacity: .65; cursor: default; }
.appearance-saved { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .7rem; }
.appearance-saved summary { width: fit-content; cursor: pointer; }
.appearance-saved summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.appearance-slots { margin: .8rem 0 0; }
.appearance-slots div { display: flex; justify-content: space-between; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.appearance-slots dd { margin: 0; color: var(--deep-blue); }

.view-tabs .treasure-tab { --sim-color: #ffca4c; }
.treasure-header, .treasure-notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; }
.treasure-header h3 { font-size: clamp(1.3rem, 3vw, 2rem); }
.treasure-balance { padding: .45rem .8rem; border-radius: .65rem; }
.treasure-balance strong, .treasure-price { color: #fff0a5; font-variant-numeric: tabular-nums; }
.treasure-balance strong { margin-left: .4em; }
.treasure-notice { margin-top: 1rem; padding: .65rem .85rem; border-radius: .75rem; }
.treasure-notice[role="alert"] { border-color: #ffb6d9; color: #ffe4f1; }
.treasure-chest { width: min(100%, 56rem); margin: 1rem auto 0; }
.treasure-chest > summary { display: grid; position: relative; border-radius: 1.1rem; cursor: pointer; }
.treasure-chest > summary::marker { content: ""; }
.treasure-chest > summary::-webkit-details-marker { display: none; }
.treasure-chest > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.treasure-stage {
    display: grid;
    width: 100%;
    aspect-ratio: 688 / 464;
    overflow: hidden;
    border-radius: inherit;
    border: 1px solid #f4acf699;
    background: #14091e;
    box-shadow: 0 .55rem 1.7rem #03051585, 0 0 1.35rem #c15aff50;
}
.treasure-stage :is(img, video) {
    grid-area: 1 / 1;
    display: block;
    width: 100%;
    height: auto;
}
.treasure-stage .treasure-opening-art, .treasure-stage .treasure-open-art, .treasure-close-label { display: none; }
.treasure-chest[open] .treasure-closed-art, .treasure-chest[open] .treasure-open-label { display: none; }
.treasure-chest[open] .treasure-open-art, .treasure-chest[open] .treasure-close-label,
.treasure-chest[open][data-opening] .treasure-closed-art, .treasure-chest[open][data-playing] .treasure-opening-art { display: block; }
.treasure-chest[open][data-opening] .treasure-open-art { display: none; }
.treasure-open-label, .treasure-close-label {
    position: absolute;
    padding: .48rem .9rem;
    border: 1px solid #fff2ad;
    border-radius: 2rem;
    color: #331c22;
    background: linear-gradient(#fff3ac, #ffcd55 58%, #d18828);
    box-shadow: inset 0 1px 3px #ffffd2, 0 3px 0 #875426, 0 0 12px #ffd26170;
    text-shadow: none;
}
.treasure-open-label { left: 50%; bottom: 7%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 1rem); }
.treasure-close-label { right: .7rem; top: .7rem; z-index: 2; font-size: clamp(.72rem, 1.75vw, .9rem); }
.treasure-chest > summary:hover :is(.treasure-open-label, .treasure-close-label) { background: linear-gradient(#fff9c9, #ffe184 58%, #e49a3e); }
.treasure-collection {
    position: relative;
    z-index: 1;
    isolation: isolate;
    width: min(calc(100% - 1.4rem), 46rem);
    margin: calc(-1 * clamp(2.7rem, 11vw, 12rem)) auto .45rem;
    padding: clamp(.8rem, 2.2vw, 1.4rem);
    border: 1px solid #f0c8ff;
    border-radius: 1.15rem;
    background: linear-gradient(150deg, #382250b8, #150c2cc9 50%, #171f43b8);
    box-shadow: inset 0 0 0 3px #dcb9ff55, inset 0 3px 12px #f9b4fba6,
        inset -5px -5px 13px #58cffa51, 0 0 1.3rem #bc60f067, 0 .7rem 1.6rem #10091db8;
    backdrop-filter: blur(7px);
}
.treasure-collection::before {
    content: "";
    position: absolute;
    inset: 1px;
    z-index: -1;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(100deg, #170d35ed, #22143db0 52%, #171337c9), url("treasure-prism.webp") center 46% / cover;
    opacity: .62;
}
.treasure-chest[data-opening] .treasure-collection { visibility: hidden; }
@media (prefers-reduced-motion: no-preference) {
    .treasure-chest[open]:not([data-opening]) .treasure-collection { animation: reveal-treasure .36s ease-out both; }
}
@keyframes reveal-treasure { from { opacity: 0; transform: translateY(.75rem); } }
.treasure-collection-heading { display: grid; grid-template-columns: auto minmax(0, auto) auto; align-items: center; justify-content: center; gap: clamp(.35rem, 2vw, 1rem); margin-bottom: 1rem; }
.treasure-collection-heading h4 { color: #fff4ff; font-size: clamp(1.17rem, 3.1vw, 2rem); text-align: center; text-shadow: 0 0 .75rem #e691fb9c; }
.treasure-jewel {
    display: block;
    width: clamp(2.3rem, 7vw, 4.45rem);
    aspect-ratio: 1.4;
    background-image: url("treasure-jewels.webp");
    background-repeat: no-repeat;
    pointer-events: none;
}
.treasure-jewel-cyan {
    background-size: 552% 1365%;
    background-position: 34.8% 26.55%;
    clip-path: polygon(1% 54%, 16% 33%, 29% 16%, 53% 6%, 82% 5%, 98% 20%, 99% 44%, 60% 98%, 32% 83%, 12% 70%);
}
.treasure-jewel-sapphire {
    background-size: 518% 1420%;
    background-position: 64.05% 25.45%;
    clip-path: polygon(0 23%, 14% 11%, 39% 1%, 62% 5%, 86% 25%, 98% 44%, 96% 59%, 71% 80%, 48% 99%, 28% 81%, 10% 53%);
}
.treasure-collection > .muted { text-align: center; }
.treasure-grid {
    --pedestal-gap: clamp(.5rem, 2vw, 1.35rem);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.4rem var(--pedestal-gap);
    width: min(100%, 42rem);
    margin: auto;
    padding: 0;
    list-style: none;
}
.treasure-offer {
    --display-light: #9e8dff8c;
    flex: 0 0 max(min(100%, 8.2rem), calc((100% - 2 * var(--pedestal-gap)) / 3));
    display: grid;
    gap: .19rem;
    align-content: start;
    justify-items: center;
    min-width: 0;
    text-align: center;
    text-shadow: 0 1px 3px #170e33, 0 0 6px #170e33;
}
.treasure-offer:nth-child(3n + 2) { --display-light: #ffb66687; }
.treasure-offer:nth-child(3n + 3) { --display-light: #90edff8c; }
.treasure-art {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    height: clamp(7.45rem, 16vw, 11rem);
    margin-bottom: .5rem;
    padding: 0 .16rem .72rem;
}
.treasure-art::before,
.treasure-art::after {
    content: "";
    position: absolute;
    pointer-events: none;
    z-index: -1;
}
.treasure-art::before {
    inset: 6% 0 0;
    background: radial-gradient(ellipse at 50% 72%, var(--display-light), transparent 69%);
}
.treasure-art::after {
    bottom: .15rem;
    width: min(86%, 10rem);
    height: 1.35rem;
    border: 1px solid #fff1c4c4;
    border-radius: 50%;
    background: radial-gradient(ellipse at 50% 28%, #f6f5ffad, transparent 68%), linear-gradient(#e7aaff, #6654b8 44%, #281450 94%);
    box-shadow: inset 0 1px 3px #fffbdb, 0 .25rem 0 #311956, 0 .33rem 0 #e9c37999,
        0 .1rem .9rem var(--display-light), 0 .5rem .7rem #10091ec9;
}
.treasure-art img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center bottom;
    filter: drop-shadow(0 .25rem .38rem #190f35ad);
}
.treasure-art .treasure-thumbnail {
    width: auto;
    height: auto;
    max-width: 78%;
    max-height: 78%;
    image-rendering: pixelated;
}
.treasure-offer h4 { font-size: clamp(.96rem, 2.2vw, 1.125rem); overflow-wrap: anywhere; }
.treasure-slot { font-size: .8rem; color: var(--muted); }
.treasure-price { font-size: 1.05rem; }
.treasure-offer form, .treasure-offer > a { margin-top: .25rem; }
.treasure-offer button:disabled { opacity: .65; cursor: default; }
.treasure-offer button:disabled:hover { background: var(--blue); color: var(--white); }
.treasure-offline { font-size: .81rem; }
.treasure-offer .quiet-button { border-color: #cbb3ffb5; background: linear-gradient(#7945c1, #45228b 68%, #32165b); box-shadow: inset 0 1px 2px #eed7ff94, 0 2px 4px #130b36c9; }
.treasure-offer .quiet-button:hover:not(:disabled) { background: #542d9e; }

@media (min-width: 56rem) {
    .treasure-offer h4 { min-block-size: 2.32em; }
}

@media (max-width: 760px) {
    .login-hero { aspect-ratio: 11/9; }
    .dashboard-layout { grid-template-columns: 1fr; gap: 1rem; padding-top: 1rem; }
    .sidebar { border: 0; border-bottom: 1px solid var(--line); padding: 0 0 .8rem; }
    .sidebar-brand { width: 8.25rem; }
    .sidebar h2 { margin: .8rem 0 .4rem; }
    .sim-list { display: flex; flex-wrap: wrap; }
    .sim-list a { max-width: 100%; }
    .profile-details { grid-template-columns: 1fr; }
    .appearance-layout { grid-template-columns: 1fr; }
}

@media (max-width: 410px) {
    .masthead-inner { gap: .6rem; }
    .lot-search { width: 100%; grid-template-columns: minmax(0, 1fr) auto auto; }
    .lot-search .quiet-button { padding-inline: .5rem; }
    .profile-stats { gap: .35rem; }
    .profile-stats div { padding: .5rem .4rem; }
    .object-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 360px) {
    .lot-search { grid-template-columns: minmax(0, 1fr) auto; }
    .lot-search input[type="search"] { grid-column: 1 / -1; }
}
