* { box-sizing: border-box; }
:root {
    color-scheme: dark;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: #17141e;
    color: #f7f3ff;
    --panel: #231e2f;
    --deep: #191522;
    --line: #393044;
    --muted: #c3b8d2;
    --action: #c6a9ff;
    --accent: #eece9c;
}
body { margin: 0; min-height: 100dvh; }
a { color: var(--action); text-underline-offset: .18em; }
button, .button, input, select {
    min-height: 44px;
    font: inherit;
    border-radius: .65rem;
}
button, .button {
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid transparent; padding: .55rem .95rem;
    color: #231333; background: var(--action); font-weight: 650;
    cursor: pointer; text-decoration: none; text-align: center;
}
button:hover, .button:hover { filter: brightness(1.11); }
button:disabled { filter: saturate(.35); cursor: default; opacity: .56; }
button.secondary, .button.secondary { background: #322843; border-color: #534468; color: #f2e5ff; }
button.danger { background: #512e42; border-color: #74445b; color: #ffe0e8; }
button.small { min-height: 36px; font-size: .86rem; padding: .35rem .65rem; }
:focus-visible { outline: 2px solid #fde3ac; outline-offset: 3px; }
input, select { background: var(--deep); border: 1px solid #544864; color: inherit; padding: .45rem .65rem; width: 100%; }
input[type=checkbox] { width: 1.15rem; min-height: 1.15rem; accent-color: var(--action); }
label { display: grid; align-content: center; gap: .35rem; }
label.check { display: flex; align-items: center; min-height: 44px; gap: .55rem; }
form { display: grid; gap: .7rem; }
.top {
    display: flex; justify-content: space-between; align-items: center;
    min-height: 56px; padding: calc(env(safe-area-inset-top) + .75rem) max(1rem, calc((100% - 48rem) / 2)) .75rem;
    border-bottom: 1px solid var(--line); background: #201928;
}
.top a { text-decoration: none; }
.brand { color: var(--accent); font-weight: 850; font-size: 1.25rem; letter-spacing: .025em; }
.profile-link { max-width: 48vw; overflow: hidden; text-overflow: ellipsis; }
.content, .browser-page { max-width: 48rem; margin: auto; padding: 1.2rem 1rem calc(5.5rem + env(safe-area-inset-bottom)); }
.browser-page { max-width: 32rem; margin-top: 1.5rem; }
.browser-page code { display: inline-block; font-size: 1.35rem; letter-spacing: .16em; background: var(--panel); padding: .8rem 1rem; border-radius: .5rem; }
h1 { margin: .15rem 0 1rem; font-size: clamp(1.52rem, 6vw, 2.2rem); line-height: 1.12; }
h2 { margin: 1.25rem 0 .7rem; font-size: 1.12rem; }
p { line-height: 1.5; overflow-wrap: anywhere; }
.panel h2:first-child { margin-top: 0; }
.panel {
    padding: 1rem; border-radius: .95rem; border: 1px solid var(--line);
    background: var(--panel); margin: .8rem 0; min-width: 0;
}
.balance { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.balance strong { font-size: 2rem; color: var(--accent); }
.balance p { margin: .25rem 0; }
.muted, small { color: var(--muted); }
small { display: block; font-size: .78rem; line-height: 1.35; }
.notice { padding: .7rem .8rem; border-radius: .6rem; background: #263c32; border: 1px solid #3b5f4b; }
.notice.error { background: #452633; border-color: #74445b; }
.toolbar, .pager { display: flex; align-items: end; flex-wrap: wrap; gap: .55rem; margin: .8rem 0; }
.toolbar > label:not(.check) { flex: 1 1 9rem; }
.pager { justify-content: space-between; align-items: center; }
.back { display: inline-flex; min-height: 38px; align-items: center; }
.links { display: grid; gap: .42rem; margin: .6rem 0; }
.links a {
    display: flex; align-items: center; justify-content: space-between; gap: .6rem;
    padding: .65rem .75rem; min-height: 44px; border: 1px solid var(--line);
    border-radius: .65rem; background: var(--panel); text-decoration: none; color: inherit;
}
.links a:hover { border-color: var(--action); }
.links span { color: var(--accent); text-align: right; }
.links img { flex: 0 0 2.6rem; width: 2.6rem; height: 2.6rem; object-fit: contain; }
.auctions a > div { flex: 1; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 8.6rem), 1fr)); gap: .55rem; margin: .7rem 0; align-items: start; }
.item-card { background: var(--panel); border: 1px solid var(--line); border-radius: .75rem; overflow: clip; min-width: 0; }
.item-card summary { list-style: none; display: grid; gap: .24rem; cursor: pointer; padding: .55rem; }
.item-card summary::-webkit-details-marker { display: none; }
.item-card strong { overflow-wrap: anywhere; font-size: .9rem; }
.item-art { aspect-ratio: 1.25; display: grid; place-items: center; border-radius: .5rem; background: radial-gradient(ellipse at 50% 40%, var(--item-accent, #4a3a59), #241b30 90%); }
.item-art img { width: 80%; height: 80%; object-fit: contain; filter: drop-shadow(0 5px 8px #0006); }
.item-info { border-top: 1px solid var(--line); padding: .45rem .55rem; font-size: .84rem; }
.item-info p { margin: .4rem 0; }
.item-card.rarity-1 .rarity { color: #8ed3ff; }
.item-card.rarity-2 .rarity { color: #d3a9ff; }
.item-card.rarity-3 .rarity { color: #ffce81; }
.item-card.rarity-4 .rarity { color: #ff9aab; }
.pool-item small { padding: .16rem .1rem; }
.outcome { border-color: #8c6ba6; }
.picker { display: grid; gap: .35rem; max-height: 22rem; overflow: auto; margin: .7rem 0; }
.option { background: var(--deep); border: 1px solid var(--line); border-radius: .5rem; padding: .35rem .55rem; }
.welcome { max-width: 30rem; margin: 2rem auto; }
.welcome-icon { width: 3.2rem; height: 3.2rem; object-fit: contain; margin-bottom: .6rem; }
.tabs {
    position: fixed; bottom: 0; width: 100%; z-index: 1;
    display: flex; justify-content: center;
    padding: .35rem .15rem calc(.35rem + env(safe-area-inset-bottom)); gap: .12rem;
    background: #211a2d; border-top: 1px solid #473650;
}
.tabs a {
    display: grid; justify-items: center; align-content: center; gap: .2rem;
    flex: 1 1 0; max-width: 9.5rem; min-width: 0; min-height: 47px; font-size: clamp(.6rem, 3.1vw, .76rem);
    color: var(--muted); text-decoration: none; border-radius: .55rem; line-height: 1.1;
}
.tabs a.active { background: #44305a; color: #fff; }
.tabs img { width: 19px; height: 19px; object-fit: contain; }

