:root {
  color-scheme: dark;
  --bg: #06040d;
  --panel: rgba(13, 9, 25, .94);
  --panel-soft: rgba(22, 13, 39, .88);
  --ink: #f7f1ff;
  --muted: #aca1bf;
  --violet: #ad6cff;
  --violet-deep: #6d2ec3;
  --cyan: #59e8ff;
  --gold: #efc36f;
  --green: #70efb4;
  --red: #ff7895;
  --line: rgba(181, 119, 255, .25);
  --line-cyan: rgba(89, 232, 255, .3);
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 300px; background: radial-gradient(circle at 50% -10%, #25113d 0, transparent 32rem), var(--bg); color: var(--ink); font: 14px/1.55 var(--sans); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }

.skip-link { position: fixed; z-index: 1000; top: 10px; left: 10px; padding: 10px 14px; border: 1px solid var(--cyan); border-radius: 8px; background: #05030b; color: var(--ink); font-weight: 900; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

.auction-rail { position: sticky; z-index: 40; top: 0; display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 24px; padding: 10px max(24px, calc((100vw - 1440px) / 2)); border-bottom: 1px solid var(--line); background: rgba(5, 3, 12, .9); backdrop-filter: blur(18px); }
.auction-brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.auction-brand b, .auction-brand small { display: block; letter-spacing: .16em; }
.auction-brand b { font-size: 13px; }
.auction-brand small { margin-top: 3px; color: var(--cyan); font-size: 8px; font-weight: 900; }
.brand-sigil { position: relative; display: grid; width: 36px; height: 42px; place-items: center; border: 1px solid var(--line-cyan); clip-path: polygon(50% 0, 96% 24%, 86% 80%, 50% 100%, 14% 80%, 4% 24%); background: linear-gradient(160deg, rgba(173,108,255,.38), rgba(4,23,35,.88)); }
.brand-sigil::before, .brand-sigil::after, .brand-sigil i { content: ""; position: absolute; width: 2px; background: var(--cyan); box-shadow: 8px 0 var(--violet), -8px 0 var(--violet); }
.brand-sigil::before { top: 10px; bottom: 10px; }
.brand-sigil::after { top: 16px; bottom: 16px; transform: rotate(90deg); box-shadow: none; }
.brand-sigil i { top: 7px; bottom: 7px; background: var(--gold); opacity: .45; transform: rotate(45deg); box-shadow: none; }
.auction-rail nav { display: flex; align-items: center; gap: 5px; }
.auction-rail nav a, .auction-rail nav button { min-height: 42px; padding: 9px 12px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #c9bed8; text-decoration: none; font-size: 11px; font-weight: 800; cursor: pointer; }
.auction-rail nav a:hover, .auction-rail nav button:hover { border-color: var(--line); color: #fff; background: rgba(173,108,255,.08); }

.hall-scene { position: relative; min-height: min(780px, calc(100vh - 68px)); overflow: hidden; isolation: isolate; border-bottom: 1px solid rgba(239,195,111,.26); background: #090710; }
.hall-image, .hall-shade, .hall-grid { position: absolute; inset: 0; width: 100%; height: 100%; }
.hall-image { z-index: -3; object-fit: cover; object-position: center 53%; filter: saturate(.94) contrast(1.04) brightness(.78); transform: scale(1.015); }
.hall-shade { z-index: -2; background: linear-gradient(90deg, rgba(3,2,8,.92) 0, rgba(3,2,8,.58) 31%, rgba(3,2,8,.1) 59%, rgba(3,2,8,.3) 100%), linear-gradient(0deg, rgba(5,3,10,.96), transparent 39%, rgba(3,2,8,.34)); }
.hall-grid { z-index: -1; opacity: .16; background-image: linear-gradient(rgba(89,232,255,.09) 1px, transparent 1px), linear-gradient(90deg, rgba(89,232,255,.09) 1px, transparent 1px); background-size: 72px 72px; mask-image: linear-gradient(transparent, #000 65%); }
.hall-copy { position: relative; z-index: 2; width: min(1440px, calc(100% - 48px)); margin: auto; padding: clamp(90px, 12vh, 150px) 0 210px; pointer-events: none; }
.hall-kicker, .eyebrow { margin: 0 0 9px; color: var(--cyan); font-size: 10px; font-weight: 950; letter-spacing: .22em; }
.hall-copy h1 { max-width: 800px; margin: 0; font: 700 clamp(52px, 7.5vw, 108px)/.84 var(--serif); letter-spacing: -.045em; text-shadow: 0 8px 44px #000; }
.hall-copy h1 span { color: transparent; background: linear-gradient(98deg, #f7e0a1, #bc7aff 54%, #61e5ff); background-clip: text; -webkit-background-clip: text; }
.hall-copy > p:not(.hall-kicker) { max-width: 620px; margin: 24px 0 0; color: #d6ccdf; font-size: clamp(15px, 1.4vw, 19px); line-height: 1.7; text-shadow: 0 2px 20px #000; }
.hall-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; pointer-events: auto; }

.action { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 10px 16px; border: 1px solid var(--line); border-radius: 9px; background: rgba(13,9,25,.82); color: var(--ink); font-size: 11px; font-weight: 900; letter-spacing: .055em; text-decoration: none; cursor: pointer; }
.action:hover:not(:disabled) { border-color: var(--cyan); background: rgba(89,232,255,.09); transform: translateY(-1px); }
.action.primary { border-color: rgba(239,195,111,.7); background: linear-gradient(135deg, #efd18d, #b77c34); color: #160c04; box-shadow: 0 15px 36px rgba(177,116,43,.18); }
.action.secondary { border-color: var(--line-cyan); color: var(--cyan); }
.action.compact { min-height: 42px; padding: 8px 13px; align-self: end; }
.action.full { width: 100%; }
.action:disabled { cursor: not-allowed; opacity: .45; transform: none; }

.hall-hotspot { position: absolute; z-index: 3; display: grid; min-width: 150px; gap: 2px; padding: 11px 13px 10px 38px; border: 1px solid rgba(89,232,255,.5); border-radius: 8px; background: rgba(3,8,17,.8); color: #f5effc; text-align: left; box-shadow: 0 10px 38px #000, inset 0 0 20px rgba(89,232,255,.06); backdrop-filter: blur(7px); cursor: pointer; }
.hall-hotspot::before { content: ""; position: absolute; top: 50%; left: 14px; width: 12px; height: 12px; border: 1px solid var(--cyan); transform: translateY(-50%) rotate(45deg); box-shadow: inset 0 0 0 3px rgba(89,232,255,.18), 0 0 16px rgba(89,232,255,.5); }
.hall-hotspot span { font-size: 9px; font-weight: 950; letter-spacing: .11em; }
.hall-hotspot small { color: var(--muted); font-size: 8px; }
.hall-hotspot:hover { border-color: var(--gold); transform: translateY(-3px); }
.hall-hotspot:hover::before { border-color: var(--gold); box-shadow: inset 0 0 0 3px rgba(239,195,111,.2), 0 0 18px rgba(239,195,111,.6); }
.hotspot-browse { right: 25%; bottom: 31%; }
.hotspot-sell { right: 8%; bottom: 45%; }
.hotspot-ledger { left: 38%; bottom: 19%; }

.hall-telemetry { position: absolute; z-index: 4; right: max(24px, calc((100vw - 1440px) / 2)); bottom: 24px; left: max(24px, calc((100vw - 1440px) / 2)); display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; border: 1px solid rgba(173,108,255,.3); border-radius: 13px; background: rgba(4,3,11,.88); backdrop-filter: blur(16px); }
.hall-telemetry div { min-width: 0; padding: 14px 18px; border-right: 1px solid rgba(255,255,255,.08); }
.hall-telemetry div:last-child { border: 0; }
.hall-telemetry dt { color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .16em; }
.hall-telemetry dd { overflow: hidden; margin: 3px 0 0; color: var(--cyan); font-size: 14px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }

.market-rules { display: grid; grid-template-columns: repeat(4, 1fr); width: min(1440px, calc(100% - 48px)); margin: 24px auto 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.market-rules article { display: grid; grid-template-columns: auto 1fr; gap: 13px; padding: 20px; border-right: 1px solid var(--line); }
.market-rules article:last-child { border: 0; }
.market-rules article > span { color: var(--gold); font: 800 19px/1 var(--serif); }
.market-rules b { display: block; font-size: 12px; }
.market-rules p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }

.panel { width: min(1440px, calc(100% - 48px)); margin: 18px auto 0; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, rgba(18,11,33,.96), rgba(7,6,14,.96)); box-shadow: 0 28px 80px -58px #000; }
.account-gate { display: grid; grid-template-columns: auto 1fr auto auto auto; align-items: center; gap: 16px; }
.gate-mark { position: relative; width: 48px; height: 48px; border: 1px solid var(--line-cyan); border-radius: 50%; background: radial-gradient(circle, rgba(89,232,255,.18), transparent 62%); }
.gate-mark::before, .gate-mark::after, .gate-mark i { content: ""; position: absolute; inset: 13px; border: 1px solid var(--cyan); transform: rotate(45deg); }
.gate-mark::after { inset: 19px; background: var(--violet); border: 0; }
.gate-mark i { inset: 7px; border-color: rgba(173,108,255,.35); border-radius: 50%; transform: none; }
.account-gate h2 { margin: 0; font: 700 22px/1.1 var(--serif); }
.account-gate p:not(.eyebrow) { margin: 5px 0 0; color: var(--muted); }

.market-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(310px, .65fr); gap: 18px; width: min(1440px, calc(100% - 48px)); margin: 18px auto 0; align-items: start; }
.market-layout .panel { width: auto; margin: 0; }
.sell-panel { position: sticky; top: 86px; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.panel-heading h2 { margin: 0; font: 700 clamp(26px, 3vw, 40px)/1 var(--serif); }
.server-seal, .counter { padding: 6px 9px; border: 1px solid var(--line-cyan); border-radius: 999px; color: var(--cyan); font-size: 8px; font-weight: 950; letter-spacing: .13em; white-space: nowrap; }

.filters { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(150px, .62fr) minmax(170px, .7fr) auto; gap: 9px; padding: 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; background: rgba(255,255,255,.025); }
label { display: grid; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
input, select { min-width: 0; min-height: 42px; width: 100%; padding: 9px 11px; border: 1px solid rgba(173,108,255,.28); border-radius: 8px; background: #070511; color: var(--ink); outline: 0; }
input:focus, select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(89,232,255,.08); }
.section-status { margin: 15px 0; color: var(--muted); font-size: 12px; }
.section-status.good { color: var(--green); }
.section-status.bad { color: var(--red); }

.listing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.listing-card { position: relative; display: grid; grid-template-columns: 58px 1fr auto; gap: 12px; min-height: 126px; padding: 14px; overflow: hidden; border: 1px solid rgba(255,255,255,.09); border-radius: 13px; background: linear-gradient(145deg, rgba(255,255,255,.035), rgba(4,3,10,.48)); }
.listing-card::after { content: ""; position: absolute; right: -25px; bottom: -35px; width: 110px; height: 110px; border: 1px solid rgba(173,108,255,.12); border-radius: 50%; }
.item-crystal { position: relative; display: grid; width: 52px; height: 52px; place-items: center; align-self: center; border: 1px solid currentColor; border-radius: 50%; color: var(--violet); background: radial-gradient(circle, currentColor 0 7%, transparent 8% 32%, rgba(173,108,255,.12) 33% 48%, transparent 49%); box-shadow: inset 0 0 18px rgba(173,108,255,.16); }
.item-crystal::before, .item-crystal::after { content: ""; position: absolute; width: 15px; height: 15px; border: 1px solid currentColor; transform: rotate(45deg); }
.item-crystal::after { width: 28px; height: 28px; border-color: color-mix(in srgb, currentColor 35%, transparent); }
.item-crystal.rarity-uncommon { color: var(--cyan); }
.item-crystal.rarity-rare { color: var(--gold); }
.listing-copy { min-width: 0; }
.listing-copy h3 { overflow: hidden; margin: 0; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.listing-copy p { margin: 4px 0; color: var(--muted); font-size: 10px; }
.listing-meta { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 9px; }
.listing-meta span { padding: 4px 7px; border: 1px solid rgba(255,255,255,.09); border-radius: 999px; color: #d5cbe0; font-size: 8px; }
.listing-price { position: relative; z-index: 2; display: flex; min-width: 108px; flex-direction: column; align-items: end; justify-content: space-between; text-align: right; }
.listing-price strong { color: var(--gold); font: 800 20px/1 var(--serif); }
.listing-price small { color: var(--muted); font-size: 8px; }
.listing-price .action { min-height: 37px; padding: 7px 11px; }
.empty-card { grid-column: 1/-1; padding: 32px 18px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; }

.sell-panel form { display: grid; gap: 14px; }
.form-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.sale-preview { display: grid; gap: 7px; padding: 13px; border: 1px solid rgba(239,195,111,.22); border-radius: 11px; background: rgba(239,195,111,.045); }
.sale-preview div { display: flex; justify-content: space-between; gap: 12px; }
.sale-preview span { color: var(--muted); font-size: 11px; }
.sale-preview b { color: var(--gold); font-size: 12px; }
.sale-preview small { color: #9e8f77; font-size: 9px; }
.inventory-available { margin: 0; color: var(--cyan); font-size: 10px; }

.personal-list, .history-list { display: grid; gap: 8px; }
.personal-row, .history-row { display: grid; grid-template-columns: minmax(180px, 1.2fr) repeat(3, minmax(90px, .5fr)) auto; gap: 12px; align-items: center; padding: 12px 13px; border: 1px solid rgba(255,255,255,.08); border-radius: 10px; background: rgba(255,255,255,.025); }
.personal-row strong, .history-row strong { display: block; }
.personal-row small, .history-row small { color: var(--muted); }
.personal-row .action { min-height: 36px; padding: 7px 11px; }
.state-pill { justify-self: start; padding: 4px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--violet); font-size: 8px; font-weight: 900; }
.state-pill.sold { border-color: rgba(112,239,180,.35); color: var(--green); }
.state-pill.expired, .state-pill.cancelled { border-color: rgba(255,120,149,.3); color: var(--red); }

.buy-dialog { width: min(520px, calc(100% - 24px)); padding: 0; border: 1px solid rgba(239,195,111,.55); border-radius: 18px; background: #0d0918; color: var(--ink); box-shadow: 0 28px 100px #000; }
.buy-dialog::backdrop { background: rgba(2,1,6,.84); backdrop-filter: blur(5px); }
.buy-dialog form { padding: 24px; }
.buy-dialog h2 { margin: 0; font: 700 32px/1 var(--serif); }
.buy-dialog > form > p:not(.eyebrow) { color: var(--muted); }
.buy-dialog dl { margin: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.buy-dialog dl div { display: flex; justify-content: space-between; gap: 20px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.07); }
.buy-dialog dl div:last-child { border: 0; }
.buy-dialog dt { color: var(--muted); }
.buy-dialog dd { margin: 0; color: var(--gold); font-weight: 900; text-align: right; }
.dialog-warning { font-size: 11px; }
.dialog-actions { display: flex; justify-content: end; gap: 8px; margin-top: 18px; }

.auction-footer { display: flex; width: min(1440px, calc(100% - 48px)); align-items: center; justify-content: space-between; gap: 20px; margin: 18px auto 0; padding: 28px 0 40px; color: var(--muted); font-size: 10px; }
.auction-footer a { color: var(--cyan); font-weight: 900; text-decoration: none; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

@media (max-width: 1100px) {
  .hall-copy { padding-top: 105px; }
  .hotspot-browse { right: 13%; }
  .hotspot-sell { right: 4%; bottom: 51%; }
  .hotspot-ledger { left: auto; right: 27%; bottom: 20%; }
  .market-rules { grid-template-columns: repeat(2, 1fr); }
  .market-rules article:nth-child(2) { border-right: 0; }
  .market-rules article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .market-layout { grid-template-columns: 1fr; }
  .sell-panel { position: static; }
  .filters { grid-template-columns: 1fr 1fr; }
  .account-gate { grid-template-columns: auto 1fr auto; }
  .account-gate .action { grid-column: 3; }
}

@media (max-width: 760px) {
  .auction-rail { min-height: 60px; padding: 8px 13px; }
  .auction-rail nav button { display: none; }
  .auction-rail nav a { min-height: 40px; padding: 8px; }
  .hall-scene { min-height: 720px; }
  .hall-image { object-position: 61% center; }
  .hall-shade { background: linear-gradient(180deg, rgba(3,2,8,.72), rgba(3,2,8,.15) 50%, rgba(3,2,8,.95) 76%); }
  .hall-copy { width: calc(100% - 26px); padding: 55px 0 320px; }
  .hall-copy h1 { font-size: clamp(43px, 14vw, 68px); }
  .hall-copy > p:not(.hall-kicker) { max-width: 93%; font-size: 14px; }
  .hall-hotspot { right: 13px; left: 13px; min-width: 0; width: auto; }
  .hotspot-browse { bottom: 192px; }
  .hotspot-sell { bottom: 132px; }
  .hotspot-ledger { bottom: 72px; }
  .hall-telemetry { right: 13px; bottom: 12px; left: 13px; grid-template-columns: repeat(2, 1fr); }
  .hall-telemetry div { padding: 8px 10px; }
  .hall-telemetry div:nth-child(2) { border-right: 0; }
  .hall-telemetry div:nth-child(-n+2) { border-bottom: 1px solid rgba(255,255,255,.08); }
  .market-rules, .panel, .market-layout, .auction-footer { width: calc(100% - 26px); }
  .market-rules { grid-template-columns: 1fr; }
  .market-rules article { border-right: 0; border-bottom: 1px solid var(--line); }
  .market-rules article:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .account-gate { grid-template-columns: auto 1fr; }
  .account-gate .action { grid-column: 1/-1; width: 100%; }
  .filters, .listing-grid { grid-template-columns: 1fr; }
  .personal-row, .history-row { grid-template-columns: 1fr 1fr; }
  .personal-row > :first-child, .history-row > :first-child { grid-column: 1/-1; }
  .personal-row .action { width: 100%; }
  .auction-footer { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .auction-brand small { display: none; }
  .auction-rail nav a { font-size: 9px; }
  .panel { padding: 16px; border-radius: 13px; }
  .hall-copy h1 { font-size: 41px; }
  .hall-actions .action { width: 100%; }
  .form-pair { grid-template-columns: 1fr; }
  .listing-card { grid-template-columns: 45px 1fr; }
  .item-crystal { width: 42px; height: 42px; }
  .listing-price { grid-column: 1/-1; display: grid; grid-template-columns: 1fr auto; min-width: 0; align-items: center; text-align: left; }
  .listing-price small { grid-column: 1; }
  .listing-price .action { grid-row: 1/3; grid-column: 2; }
  .panel-heading { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hall-image { transform: none; }
}
