@font-face { font-family: Space; src: url('./body.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: Barlow; src: url('./display.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #111119;
  --surface: #1b1a25;
  --surface-raised: #22212e;
  --line: #343342;
  --text: #f7f6fc;
  --muted: #b6b3c7;
  --accent: #d6ff4d;
  --accent-visible: #d6ff4d;
  --panel: #a978ff;
  --ink: #15161c;
  --accent-ink: #15161c;
  --display: Barlow, 'Arial Narrow', sans-serif;
  --body: Space, system-ui, sans-serif;
  font: 16px/1.5 var(--body);
  background: var(--bg);
  color: var(--text);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .46; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
svg { width: 1.15em; height: 1.15em; flex: 0 0 auto; vertical-align: -.18em; }
.sr-only { position: absolute; overflow: hidden; width: 1px; height: 1px; clip-path: inset(50%); white-space: nowrap; }
.shell, .header-inner { width: min(1160px, calc(100% - 64px)); margin: 0 auto; }

.topbar { min-height: 72px; border-bottom: 1px solid #2c2b38; background: #15151f; }
.header-inner { min-height: 72px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; justify-self: start; gap: 10px; font: 700 1.63rem/1 var(--display); white-space: nowrap; letter-spacing: .025em; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: 1.14rem; transform: rotate(-8deg); }
.brand-mark svg { transform: rotate(8deg); }
.brand-accent { color: var(--accent-visible); }
.nav { display: flex; align-self: stretch; gap: 34px; }
.nav a { display: grid; place-items: center; position: relative; color: var(--muted); font-size: .91rem; font-weight: 600; white-space: nowrap; }
.nav a:hover, .nav a[aria-current] { color: var(--text); }
.nav a[aria-current]::after { content: ''; position: absolute; bottom: -1px; inset-inline: 0; height: 3px; background: var(--accent); border-radius: 2px 2px 0 0; }
.account { justify-self: end; display: flex; align-items: center; gap: 11px; }
.wallet { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border: 1px solid #3a3e31; border-radius: 8px; color: var(--accent-visible); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); font-weight: 700; white-space: nowrap; }
.wallet svg { width: 16px; height: 16px; }
.profile { display: flex; align-items: center; gap: 5px; color: var(--muted); background: transparent; border: 0; padding: 4px 0 4px 3px; }
.profile > svg { width: 14px; height: 14px; }
.avatar { --avatar: #c9a7ff; display: inline-grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; border-radius: 9px; color: var(--ink); background: var(--avatar); font-size: .76rem; font-weight: 700; }
.profile .avatar { border-radius: 50%; width: 35px; height: 35px; }

main.shell { padding-top: 35px; min-height: 64vh; }
.heading, .section-heading { display: flex; justify-content: space-between; align-items: end; gap: 18px; }
.heading { margin-bottom: 25px; }
.heading h1 { font: 700 clamp(3.25rem, 6.1vw, 5.45rem)/.92 var(--display); letter-spacing: -.02em; text-transform: uppercase; }
.heading h1 em { font-style: normal; color: var(--accent-visible); }
.heading p { margin-top: 12px; color: var(--muted); }
.section-heading { margin: 30px 0 15px; }
.section-heading h2 { font: 700 clamp(1.85rem, 4vw, 2.5rem)/1 var(--display); letter-spacing: .015em; text-transform: uppercase; }
.subheading { margin-top: 6px; color: var(--muted); }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); border-radius: 9px; padding: 9px 14px; min-height: 42px; background: var(--surface-raised); color: var(--text); font-size: .9rem; font-weight: 700; line-height: 1.25; text-align: center; }
.button:hover:not(:disabled) { border-color: var(--muted); filter: brightness(1.14); }
.primary { border-color: transparent; color: var(--accent-ink); background: var(--accent); }
.primary:hover:not(:disabled) { border-color: transparent; }
.quiet { background: transparent; }
.danger { color: #ff9baf; }
.icon-button { width: 42px; flex: 0 0 auto; padding: 0; }
.text-link { color: var(--accent-visible); font-size: .92rem; font-weight: 700; white-space: nowrap; }
.text-link:hover { text-decoration: underline; }

.arena { display: grid; grid-template-columns: minmax(0, 1.58fr) minmax(0, 1fr); gap: 20px; }
.hero, .bid-panel, .card, .setting-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.hero { overflow: hidden; display: flex; flex-direction: column; }
.hero-visual { --item-color: var(--panel); min-height: 290px; height: clamp(290px, 28vw, 366px); display: grid; place-items: center; position: relative; isolation: isolate; overflow: hidden; background: #171021; background: radial-gradient(ellipse at 55% 52%, color-mix(in srgb, var(--item-color) 39%, #171021), #171021 73%); }
.hero-visual::before { content: ''; position: absolute; z-index: -1; inset: 0; background: repeating-radial-gradient(ellipse at 54% 54%, transparent 0 42px, color-mix(in srgb, var(--item-color) 19%, transparent) 43px 44px, transparent 45px 56px); mask-image: radial-gradient(ellipse, black, transparent 74%); }
.hero-image { position: absolute; z-index: -1; left: 50%; width: auto; height: 100%; transform: translateX(-46%); mask-image: linear-gradient(90deg, transparent, black 15%, black 84%, transparent); }
.hero-visual.has-art { background: radial-gradient(ellipse at 62% 52%, color-mix(in srgb, var(--item-color) 34%, #130b21), #130b21 73%); }
.hero-visual.has-art::after { content: ''; position: absolute; inset: 0; z-index: -1; box-shadow: inset 0 0 80px #120c24a0; background: linear-gradient(0deg, #17102532, transparent 34%); pointer-events: none; }
.hero-symbol { color: var(--item-color); transform: rotate(-9deg); filter: drop-shadow(0 0 35px color-mix(in srgb, var(--item-color) 65%, transparent)); font-size: 7.2rem; }
.live-pill { position: absolute; z-index: 1; top: 17px; left: 17px; display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 7px; background: #151322ef; color: #f2eafa; border: 1px solid #ffffff28; font-size: .76rem; font-weight: 700; letter-spacing: .095em; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 56%, transparent); }
.live .live-dot { animation: signal 2.4s ease infinite; }
.hero-info { flex: 1; padding: 19px 22px 22px; }
.hero-info h2 { font: 700 clamp(2rem, 4vw, 3rem)/1 var(--display); text-transform: uppercase; max-width: 100%; overflow-wrap: anywhere; }
.hero-info p { color: var(--muted); margin-top: 7px; font-size: .96rem; overflow-wrap: anywhere; }

.bid-panel { display: flex; flex-direction: column; padding: 20px; min-width: 0; }
.statline { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 12px; }
.statline > div:last-child { text-align: right; }
.label { font-size: .76rem; font-weight: 700; letter-spacing: .095em; color: var(--muted); text-transform: uppercase; }
.stat { display: flex; align-items: center; gap: 7px; color: var(--accent-visible); margin-top: 1px; font: 700 clamp(2.85rem, 5vw, 3.8rem)/.95 var(--display); white-space: nowrap; }
.stat svg { font-size: 1.22rem; }
.timer { font-variant-numeric: tabular-nums; justify-content: end; color: color-mix(in srgb, var(--panel) 37%, #fff); }
.timer.long { font-size: clamp(2.15rem, 4vw, 2.85rem); }
.timer.urgent { color: #ff91b7; }
.lead { margin-top: 15px; min-height: 43px; padding: 7px 9px; display: flex; align-items: center; gap: 9px; background: #242332; color: var(--muted); border: 1px solid #353346; border-radius: 9px; font-size: .86rem; overflow-wrap: anywhere; }
.lead strong { color: var(--text); }
.lead .avatar { width: 26px; height: 26px; border-radius: 7px; }
.lead > svg { color: var(--panel); }
.bid-controls { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; margin-top: 13px; }
.stepper { display: flex; align-items: center; padding: 3px; background: #14141d; border: 1px solid var(--line); border-radius: 9px; }
.stepper button { display: grid; place-items: center; background: transparent; color: var(--text); border: 0; width: 33px; min-height: 35px; padding: 0; border-radius: 6px; }
.stepper button:hover:not(:disabled) { background: var(--surface-raised); }
.stepper input { appearance: textfield; -moz-appearance: textfield; width: 47px; text-align: center; border: 0; background: transparent; color: var(--text); padding: 0; font-weight: 700; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { appearance: none; }
.bid-controls .primary { font-size: .98rem; }
.power { width: 100%; margin-top: 9px; color: color-mix(in srgb, var(--panel) 38%, #fff); background: color-mix(in srgb, var(--panel) 16%, var(--surface)); border-color: color-mix(in srgb, var(--panel) 25%, var(--line)); }
.power:hover:not(:disabled) { border-color: #bb9be8; }
.power svg { color: #d7b9ff; }
.power-count { font-size: .74rem; background: #46365e; padding: 2px 5px; border-radius: 5px; }
.result { margin-top: 13px; padding: 13px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 7%, #161720); border-radius: 9px; }
.result strong { color: var(--accent-visible); }
.result button { margin-top: 9px; }
.feed { margin-top: 17px; padding-top: 13px; border-top: 1px solid var(--line); }
.feed h3 { font-size: .92rem; }
.feed ul { padding: 0; margin: 7px 0 0; list-style: none; }
.feed li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 34px; font-size: .82rem; }
.feed .avatar { width: 24px; height: 24px; font-size: .65rem; border-radius: 7px; }
.feed li span:nth-child(2) { overflow-wrap: anywhere; }
.feed time { color: var(--muted); font-size: .74rem; }
.feed-empty { color: var(--muted); font-size: .89rem; margin-top: 7px; }
.flash { animation: flash .58s ease both; }
.arrival { animation: arrival .42s ease both; }
.win-flash { animation: win .82s ease both; }
@keyframes flash { 0% { transform: translateY(-4px) scale(1.12); text-shadow: 0 0 24px var(--accent); } 100% { transform: none; } }
@keyframes arrival { from { opacity: .35; transform: translateY(-5px); } to { opacity: 1; transform: none; } }
@keyframes win { 30% { box-shadow: 0 0 34px color-mix(in srgb, var(--accent) 34%, transparent); border-color: var(--accent); } }
@keyframes signal { 50% { opacity: .55; } }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.card { min-width: 0; padding: 17px; border-radius: 13px; }
.card h3 { font-size: 1.05rem; line-height: 1.24; overflow-wrap: anywhere; }
.card p { color: var(--muted); font-size: .93rem; margin-top: 7px; overflow-wrap: anywhere; }
.challenge { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 11px; align-items: start; }
.tile-icon { --item-color: var(--accent-visible); display: grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; border-radius: 9px; background: color-mix(in srgb, var(--item-color) 13%, var(--surface)); color: var(--item-color); font-size: 1.1rem; }
.cards > .card:nth-child(3n + 2) .challenge .tile-icon { --item-color: #c9a7ff; }
.cards > .card:nth-child(3n + 3) .challenge .tile-icon { --item-color: #5ce8f8; }
.reward { display: inline-flex; gap: 3px; align-items: center; white-space: nowrap; color: var(--accent-visible); font-size: .85rem; font-weight: 700; }
.reward svg { font-size: .83rem; }
.wide-card .actions { margin-top: 14px; }
.lot-detail { display: flex; align-items: start; gap: 10px; }
.lot-detail + .actions { justify-content: space-between; }
.lot-detail h3 { margin-top: 2px; }
.empty { grid-column: 1 / -1; padding: 20px; border: 1px dashed var(--line); border-radius: 13px; color: var(--muted); }
.auction-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.auction-tabs .button[aria-pressed='true'] { color: var(--accent-visible); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.history { display: grid; gap: 8px; }
.history button { text-align: left; justify-content: space-between; width: 100%; }
.history button span:last-child { color: var(--muted); }

.setting-panel { padding: 20px; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 17px; }
.setting-panel h2 { font: 700 1.72rem/1.1 var(--display); text-transform: uppercase; margin-bottom: 14px; }
.theme-preview { min-height: 170px; display: grid; align-content: center; justify-items: start; gap: 10px; background: radial-gradient(ellipse at 100% 0%, color-mix(in srgb, var(--panel) 26%, #171722), #171722 70%); }
.theme-preview strong { color: var(--accent-visible); font: 700 3rem/.95 var(--display); text-transform: uppercase; }
.theme-preview p { color: var(--muted); overflow-wrap: anywhere; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatches .button { gap: 6px; min-height: 36px; padding: 6px 9px; }
.swatch { width: 13px; height: 13px; border-radius: 50%; background: linear-gradient(135deg, var(--swatch-a) 50%, var(--swatch-b) 50%); }

dialog { width: min(500px, calc(100% - 30px)); max-height: calc(100% - 36px); padding: 22px; border: 1px solid #494658; border-radius: 16px; background: #201e2b; color: var(--text); box-shadow: 0 20px 95px #080712bd; }
dialog::backdrop { background: #0b0915b8; backdrop-filter: blur(4px); }
dialog:not([open]) { display: none; }
.fallback-modal-open { overflow: hidden; }
.modal-backdrop { position: fixed; inset: 0; background: #0b0915b8; z-index: 10; }
dialog[data-modal-fallback][open] { display: block; position: fixed; inset: 50% auto auto 50%; margin: 0; transform: translate(-50%, -50%); overflow: auto; z-index: 11; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.dialog-head h2 { font: 700 2.35rem/1 var(--display); text-transform: uppercase; }
.dialog-copy { color: var(--muted); margin-bottom: 12px; }
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 5px; font-size: .9rem; font-weight: 600; }
.form input:not([type='checkbox']), .form select, .form textarea { color: var(--text); width: 100%; border: 1px solid var(--line); border-radius: 7px; background: #15141e; padding: 8px 10px; min-height: 39px; }
.form input[type='color'] { padding: 3px 5px; cursor: pointer; }
.form input[type='checkbox'] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.form .check-label { display: flex; align-items: center; gap: 8px; }
.form textarea { resize: vertical; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fields.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form .actions { margin-top: 3px; }
.person-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin: 7px 0; }
.person-row .button:first-child { justify-content: start; }
.person-row .button[aria-pressed='true'] { border-color: var(--accent); }
.create-player { margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line); }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 2; width: max-content; max-width: calc(100% - 44px); padding: 11px 15px; border: 1px solid #525267; border-radius: 9px; box-shadow: 0 12px 36px #040309a0; background: #272637; color: var(--text); }
.toast:empty { display: none; }
.toast.error { border-color: #d9778d; }
dialog .form-error { color: #ffacc0; margin-top: 10px; }
.form-error:empty { display: none; }
.footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 37px; padding: 17px 0 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.footer > span:first-child { letter-spacing: .09em; font-weight: 700; }
.footer .live-dot { margin-right: 5px; }
.loading { color: var(--muted); }

.welcome { min-height: 560px; display: grid; grid-template-columns: minmax(0, 1.28fr) minmax(0, .92fr); gap: 20px; align-items: stretch; }
.welcome-hero { min-height: 100%; position: relative; isolate: isolate; display: flex; align-items: end; background: #171025; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; }
.welcome-hero img, .welcome-hero::after { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.welcome-hero img { object-fit: cover; object-position: 65% 50%; }
.welcome-hero::after { content: ''; background: linear-gradient(0deg, #0c0915 0%, #0c0915e8 12%, transparent 65%); }
.welcome-hero > div { padding: clamp(22px, 4vw, 42px); }
.welcome-hero h1 { font: 700 clamp(3rem, 6.4vw, 5.25rem)/.94 var(--display); text-transform: uppercase; }
.welcome-hero em { color: var(--accent); font-style: normal; }
.welcome-hero p { color: #e7dff7; margin-top: 12px; max-width: 40ch; }
.auth-panel { align-self: center; padding: clamp(20px, 3.4vw, 38px); }
.auth-panel h2 { font-size: 2.7rem; }
.auth-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.auth-panel .notice { margin-bottom: 12px; }
.form-hint, .invite-url { color: var(--muted); font-size: .87rem; }
.form-error { color: #ffacc0; }
.notice, .claim-note { padding: 9px 12px; border-radius: 8px; background: #302640; color: #e6d7ff; }
.directory-grid { margin-bottom: 10px; }
.dashboard-actions { margin-top: 14px; }
.invitation-panel { margin-bottom: 14px; }
.invitation-panel .form { margin-top: 12px; max-width: 400px; }
.account-actions { justify-items: start; }
.empty-arena { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; }
.empty-arena .hero-info { padding: clamp(16px, 3vw, 34px); }
.empty-arena .button { margin-top: 15px; }
.compact-challenges { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.member-list { display: grid; gap: 8px; margin-top: 12px; }
.member { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding: 7px 0; }
.member-id { display: flex; align-items: center; gap: 10px; }
.member strong { display: block; overflow-wrap: anywhere; }
.member > div span:not(.avatar) { display: block; color: var(--muted); font-size: .82rem; }
.secret-code { margin: 12px 0; padding: 12px; color: var(--accent-visible); background: #15141e; border: 1px solid var(--line); border-radius: 8px; overflow-wrap: anywhere; }
.invite-url { display: grid; gap: 4px; }
.invite-url input { color: var(--text); background: #15141e; width: 100%; min-height: 38px; padding: 6px; border: 1px solid var(--line); border-radius: 7px; }
.footer { flex-wrap: wrap; }
.footer-links { display: flex; gap: 12px; flex-wrap: wrap; }
.footer-button { border: 0; padding: 0; background: transparent; color: inherit; }
.ads-area { display: grid; gap: 10px; margin-top: 18px; }
.ad-card { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.ad-card h2 { margin-top: 2px; font-size: 1.15rem; }
.ad-card p { margin-top: 3px; }
.ad-display .adsbygoogle { margin-top: 8px; min-height: 90px; }
:root[data-neon='on'] .hero { box-shadow: 0 0 26px #a978ff55; }
:root[data-neon='on'] .hero-info h2 { text-shadow: 0 0 14px #a978ff99; }
.footer a:hover, .footer-button:hover { text-decoration: underline; }
.legal { max-width: 760px; margin: 35px auto; padding: 0 18px; }
.legal h1 { font: 700 3.2rem/1 var(--display); color: var(--accent); margin: 18px 0; }
.legal h2 { margin: 20px 0 6px; }
.legal p { color: var(--muted); margin-bottom: 8px; }
.legal a { color: var(--accent-visible); text-decoration: underline; }

@media (max-width: 850px) {
  .shell, .header-inner { width: min(100% - 34px, 1160px); }
  .arena { gap: 12px; }
  .bid-panel { padding: 14px; }
  .nav { gap: 20px; }
  .challenge { grid-template-columns: auto minmax(0, 1fr); }
  .challenge .reward { grid-column: 2; }
  .compact-challenges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .header-inner { grid-template-columns: 1fr auto; gap: 0 10px; padding-top: 9px; }
  .account { grid-column: 2; grid-row: 1; }
  .nav { grid-row: 2; grid-column: 1 / -1; justify-content: space-between; gap: 12px; }
  .nav a { font-size: .84rem; }
  .nav a { min-height: 43px; }
  main.shell { padding-top: 23px; }
  .heading { align-items: start; flex-direction: column; gap: 12px; }
  .heading h1 { font-size: clamp(2.8rem, 12vw, 4.5rem); }
  .arena, .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .welcome, .empty-arena { grid-template-columns: minmax(0, 1fr); }
  .welcome { min-height: 0; gap: 12px; }
  .welcome-hero { min-height: 218px; }
  .welcome-hero h1 { font-size: clamp(2.5rem, 9vw, 3.5rem); }
  .hero-visual { min-height: 190px; height: 55vw; max-height: 285px; }
  .hero-image { transform: translateX(-50%); }
  .hero-info { padding: 15px; }
  .bid-panel { padding: 16px; }
  .cards { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .challenge { grid-template-columns: auto minmax(0, 1fr) auto; }
  .challenge .reward { grid-column: auto; }
  .section-heading { align-items: start; }
  .footer { margin-top: 26px; }
}
@supports (padding: env(safe-area-inset-top)) {
  .topbar { padding-top: env(safe-area-inset-top); }
  .footer { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; } }
:root[data-motion='off'] *, :root[data-motion='off'] *::before, :root[data-motion='off'] *::after { animation: none !important; }
