:root {
    --bg-base: #0a0a0f;
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.08);
    --gold: #f5c542;
    --gold-dark: #d4a017;
    --blue: #6eb5ff;
    --text: #e8e8ec;
    --muted: #888894;
    --input-bg: #16161f;
    --font: 'Outfit', system-ui, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--bg-base);
    color: var(--text);
    font-family: var(--font);
}

#bg-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: auto;
    cursor: grab;
    touch-action: none;
}

#bg-canvas:active {
    cursor: grabbing;
}

.app-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.app-left {
    flex: 0 0 min(54%, 760px);
    width: min(54%, 760px);
    max-width: 760px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-base);
    border-right: 1px solid var(--glass-border);
    position: relative;
    z-index: 2;
}

.earth-stage {
    flex: 1;
    position: sticky;
    top: 0;
    height: 100vh;
    min-height: 320px;
    overflow: hidden;
    background: radial-gradient(ellipse at 40% 35%, #12122a 0%, #0a0a0f 55%, #050508 100%);
}

.geo-widget {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.45rem;
    max-width: min(280px, calc(100% - 1.5rem));
}

.geo-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    background: rgba(10, 10, 15, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text);
    cursor: pointer;
    text-align: left;
    font: inherit;
    transition: border-color 0.2s, background 0.2s;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.geo-chip:hover,
.geo-chip.open {
    border-color: rgba(245, 197, 66, 0.45);
    background: rgba(16, 16, 24, 0.88);
}

.geo-chip-flag {
    font-size: 1.15rem;
    line-height: 1;
}

.geo-chip-text {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    min-width: 0;
}

.geo-chip-city {
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 10rem;
}

.geo-chip-hint {
    font-size: 0.68rem;
    white-space: nowrap;
}

.geo-chip-caret {
    color: var(--muted);
    font-size: 0.7rem;
}

.geo-popover {
    width: min(260px, 100%);
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.geo-popover[hidden] {
    display: none !important;
}

.geo-popover-label {
    font-size: 0.78rem;
    color: var(--muted);
}

.geo-city-input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    color: var(--text);
    font: inherit;
}

.geo-city-input:focus {
    outline: none;
    border-color: rgba(245, 197, 66, 0.55);
}

.geo-popover-actions {
    display: flex;
    gap: 0.45rem;
}

.btn-ghost {
    flex: 1;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border-radius: 10px;
    padding: 0.55rem 0.65rem;
    cursor: pointer;
    font: inherit;
    font-size: 0.85rem;
}

.btn-ghost:hover {
    border-color: rgba(245, 197, 66, 0.35);
}

.geo-save-btn {
    flex: 1;
    margin-top: 0;
    min-height: 0;
    padding: 0.55rem 0.65rem;
    font-size: 0.85rem;
}

.earth-hint {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    font-size: 0.75rem;
    pointer-events: none;
    z-index: 1;
    opacity: 0.7;
}

.earth-pin-popup {
    position: absolute;
    z-index: 6;
    width: min(240px, calc(100% - 1.5rem));
    padding: 0.85rem 1rem 0.95rem;
    pointer-events: auto;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(245, 197, 66, 0.2);
    animation: earth-pin-in 0.18s ease-out;
}

.earth-pin-popup[hidden] {
    display: none !important;
}

@keyframes earth-pin-in {
    from { opacity: 0; transform: translateY(6px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.earth-pin-close {
    position: absolute;
    top: 0.35rem;
    right: 0.4rem;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
}

.earth-pin-close:hover {
    color: var(--gold);
    background: rgba(255, 255, 255, 0.06);
}

.earth-pin-rank {
    color: var(--gold);
    font-size: 0.78rem;
    margin-bottom: 0.25rem;
}

.earth-pin-name {
    margin: 0 0 0.25rem;
    font-size: 1.05rem;
    padding-right: 1.4rem;
    line-height: 1.25;
}

.earth-pin-tagline {
    margin: 0 0 0.65rem;
    font-size: 0.8rem;
    line-height: 1.35;
}

.earth-pin-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.82rem;
    padding-top: 0.55rem;
    border-top: 1px solid var(--glass-border);
}

.ui-layer {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.gold { color: var(--gold); }
.muted { color: var(--muted); }
.error { color: #ff6b6b; }

.site-header {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: nowrap;
    margin: 0.5rem 0.75rem 0;
    padding: 0.4rem 0.65rem;
    flex-shrink: 0;
    overflow: visible;
    min-width: 0;
}

.logo {
    text-decoration: none;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 1;
    min-width: 0;
    white-space: nowrap;
    line-height: 1.1;
}

.logo-mark {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 50%;
    display: block;
    box-shadow: 0 0 10px rgba(110, 181, 255, 0.28);
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    min-width: 0;
}

.logo-main {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gold);
}

.logo-sub {
    font-size: 0.58rem;
    color: var(--muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    max-width: 9rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-tabs {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 1;
    min-width: 0;
}

.channel-tabs .tab {
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    text-decoration: none;
    color: var(--muted);
    border: 1px solid transparent;
    transition: 0.2s;
    font-size: 0.78rem;
    white-space: nowrap;
}

.channel-tabs .tab.active,
.channel-tabs .tab:hover {
    color: var(--text);
    border-color: var(--glass-border);
    background: rgba(255,255,255,0.04);
}

.header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.board-toggle, .lang-switch {
    display: flex;
    gap: 0.15rem;
    flex-shrink: 0;
}

.pill, .lang-link {
    padding: 0.25rem 0.45rem;
    border-radius: 999px;
    text-decoration: none;
    color: var(--muted);
    font-size: 0.72rem;
    border: 1px solid transparent;
    white-space: nowrap;
}

.pill.active, .lang-link.active {
    color: var(--gold);
    border-color: rgba(245,197,66,0.35);
}

.lang-select-wrap {
    display: inline-flex;
    flex-shrink: 0;
}

.lang-select {
    appearance: none;
    -webkit-appearance: none;
    background: var(--input-bg);
    color: var(--text);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.28rem 1.4rem 0.28rem 0.45rem;
    font: inherit;
    font-size: 0.72rem;
    cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 10px) calc(50% - 2px), calc(100% - 6px) calc(50% - 2px);
    background-size: 4px 4px, 4px 4px;
    background-repeat: no-repeat;
    max-width: 5.2rem;
}

.lang-select:focus {
    outline: none;
    border-color: rgba(245, 197, 66, 0.55);
}

.main-nav a {
    color: var(--muted);
    text-decoration: none;
    margin-left: 0.5rem;
    font-size: 0.9rem;
}

.main-nav a:hover { color: var(--blue); }

.icon-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.28rem 0.4rem;
    cursor: pointer;
    font-size: 0.95rem;
    flex-shrink: 0;
    line-height: 1;
}

.online-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    color: var(--muted);
    padding: 0.28rem 0.45rem;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.site-main {
    flex: 1;
    padding: 0.5rem 0.75rem 0.75rem;
    width: 100%;
    min-width: 0;
}

.page-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1rem;
}

.startup-layout .sidebar { max-height: 80vh; overflow: auto; }

@media (max-width: 900px) {
    .page-grid { grid-template-columns: 1fr; }
}

.bid-hero {
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.bid-hero-head {
    margin-bottom: 1.25rem;
}

.form-card {
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 1rem;
    margin-bottom: 0.85rem;
}

.form-card:last-of-type {
    margin-bottom: 0;
}

.form-row-inline {
    flex-direction: row !important;
    gap: 0.75rem;
}

.input-with-prefix {
    display: flex;
    align-items: stretch;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-with-prefix:focus-within {
    border-color: rgba(245, 197, 66, 0.6);
    box-shadow: 0 0 0 3px rgba(245, 197, 66, 0.12);
}

.input-prefix {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    padding: 0 0.65rem;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.03);
    border-right: 1px solid var(--glass-border);
    font-size: 0.95rem;
}

.input-with-prefix input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.option-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.55rem;
}

.option-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 0.55rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: var(--input-bg);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
    text-align: center;
}

.option-card:hover {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.04);
}

.option-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-card:has(input:checked) {
    border-color: rgba(245, 197, 66, 0.55);
    background: rgba(245, 197, 66, 0.08);
    box-shadow: 0 0 0 1px rgba(245, 197, 66, 0.15);
}

.option-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.option-icon-img {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.option-icon-img img {
    width: 28px;
    height: 28px;
    display: block;
    border-radius: 7px;
}

.option-label {
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.25;
}

.option-card:has(input:checked) .option-label {
    color: var(--text);
}

.payment-cards {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
}

.btn-pay {
    width: 100%;
    margin-top: 1rem;
    min-height: 52px;
    font-size: 1.05rem;
    gap: 0.5rem;
    box-shadow: 0 8px 24px rgba(245, 197, 66, 0.22);
}

.btn-arrow {
    font-size: 1.15rem;
    transition: transform 0.2s;
}

.btn-pay:hover .btn-arrow {
    transform: translateX(3px);
}

.claim-title {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    margin: 0 0 0.5rem;
    color: var(--gold);
}

.claim-hint { color: var(--muted); margin: 0 0 1.25rem; }

.bid-form .form-row {
    margin-bottom: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.bid-form label {
    font-size: 0.85rem;
    color: var(--muted);
}

.bid-form input,
.bid-form select {
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 0.65rem 0.8rem;
    color: var(--text);
    font: inherit;
}

.bid-form input:focus,
.bid-form select:focus {
    outline: none;
    border-color: rgba(245,197,66,0.6);
    box-shadow: 0 0 0 3px rgba(245,197,66,0.15);
}

.amount-block {
    gap: 0.45rem;
}

.amount-block > label {
    margin: 0;
}

.amount-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.field-grow { flex: 1; min-width: 0; }

.step-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    color: var(--gold);
    font-size: 1.35rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.step-btn:hover {
    border-color: rgba(245, 197, 66, 0.45);
    background: rgba(245, 197, 66, 0.08);
}

.payment-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.estimate {
    min-height: 1.4rem;
    color: var(--blue);
    font-size: 0.95rem;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.35rem;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #111;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    margin-top: 0.5rem;
    transition: filter 0.2s, transform 0.15s;
}

.btn-primary:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.leaderboard { margin-top: 1rem; }

.top-three {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.listing-card {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    gap: 0.75rem;
    padding: 1rem;
    align-items: center;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-width: 0;
}

.listing-card:hover {
    border-color: rgba(255, 255, 255, 0.14);
}

.listing-card.top-card {
    grid-template-columns: auto auto 1fr auto;
    grid-template-rows: auto;
    padding: 0.9rem 1rem;
}

.listing-card.top-card .listing-avatar {
    align-self: center;
}

.listing-card.top-card .listing-bid {
    justify-self: end;
    text-align: right;
    font-size: 1.15rem;
    padding-top: 0;
    margin-top: 0;
    border-top: none;
}

.listing-card.top-card.rank-1 {
    box-shadow: 0 0 28px rgba(245, 197, 66, 0.22);
    border-color: rgba(245, 197, 66, 0.4);
}

.listing-card.top-card.rank-2 {
    border-color: rgba(192, 192, 192, 0.25);
}

.listing-card.top-card.rank-3 {
    border-color: rgba(205, 127, 50, 0.28);
}

.rank-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    min-width: 2.5rem;
}

.rank-medal {
    font-size: 1.1rem;
    line-height: 1;
}

.listing-avatar {
    position: relative;
    flex-shrink: 0;
    border-radius: 14px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.12);
    background: hsl(var(--avatar-hue, 220), 55%, 42%);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.listing-avatar.avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border-width: 1px;
}

.listing-avatar.avatar-md {
    width: 44px;
    height: 44px;
}

.listing-avatar.avatar-lg {
    width: 64px;
    height: 64px;
    border-radius: 16px;
}

.listing-avatar .avatar-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    background: linear-gradient(145deg, hsl(var(--avatar-hue, 220), 62%, 48%), hsl(calc(var(--avatar-hue, 220) + 28), 55%, 32%));
}

.listing-avatar.avatar-sm .avatar-fallback { font-size: 0.72rem; }
.listing-avatar.avatar-lg .avatar-fallback { font-size: 1.35rem; }

.listing-avatar img,
.listing-avatar .avatar-img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: transparent;
    padding: 12%;
}

.listing-avatar .avatar-img.is-broken {
    display: none;
}

.rank-badge {
    font-family: var(--mono);
    font-weight: 700;
    color: var(--gold);
    font-size: 1rem;
}

.listing-head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    flex-wrap: wrap;
}

.listing-head .flag {
    font-size: 1rem;
    line-height: 1;
}

.listing-city {
    font-size: 0.75rem;
    font-weight: 400;
}

.location-field {
    display: flex;
    align-items: stretch;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
}

.location-field:focus-within {
    border-color: rgba(245, 197, 66, 0.6);
    box-shadow: 0 0 0 3px rgba(245, 197, 66, 0.12);
}

.location-flag {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.6rem;
    padding: 0 0.4rem;
    border-right: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.03);
    font-size: 1.15rem;
}

.location-field input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.location-refresh {
    width: 42px;
    border: none;
    border-left: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--gold);
    font-size: 1.1rem;
    cursor: pointer;
}

.location-refresh:hover {
    background: rgba(245, 197, 66, 0.1);
}

.location-hint {
    margin: 0.25rem 0 0;
    font-size: 0.75rem;
}

.listing-name {
    margin: 0;
    font-size: 1.05rem;
}

.listing-name a {
    color: var(--text);
    text-decoration: none;
}

.listing-name a:hover { color: var(--blue); }

.listing-tagline {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.listing-bid {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gold);
    white-space: nowrap;
}

.listing-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.5rem;
}

.chip {
    display: inline-block;
    margin-top: 0.35rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: rgba(110,181,255,0.12);
    color: var(--blue);
    font-size: 0.75rem;
}

.rank-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.listing-card.compact {
    grid-template-columns: auto auto 1fr auto;
    padding: 0.7rem 1rem;
}

.empty-state {
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--muted);
}

.empty-icon {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.65rem;
    opacity: 0.85;
}

.empty-state p {
    margin: 0;
    font-size: 0.95rem;
}

.activity-strip {
    padding: 1rem;
    margin-bottom: 1rem;
}

.activity-strip h2 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    color: var(--muted);
}

.activity-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
}

.activity-rank {
    color: var(--muted);
    font-size: 0.8rem;
}

.activity-empty {
    margin: 0;
    font-size: 0.85rem;
}

.cat-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.cat-icon {
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list a {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0.5rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--muted);
    font-size: 0.85rem;
}

.category-list a.active,
.category-list a:hover {
    color: var(--text);
    background: rgba(255,255,255,0.04);
}

.sidebar { padding: 1rem; }

.stats-panel p { margin: 0.35rem 0; }

.content-page, .checkout-page {
    padding: 2rem;
    max-width: 720px;
    margin: 2rem auto;
}

.rules-list {
    line-height: 1.7;
    color: var(--muted);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-bottom: 2rem;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid var(--glass-border);
    padding: 0.5rem;
    text-align: left;
}

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    flex-wrap: nowrap;
    margin: 0 0.75rem 0.5rem;
    padding: 0.45rem 0.75rem;
    flex-shrink: 0;
    font-size: 0.78rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.site-footer::-webkit-scrollbar { display: none; }

.footer-slogan {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.footer-copy {
    flex-shrink: 0;
    white-space: nowrap;
    margin: 0;
}

.site-footer p { margin: 0.25rem 0; }

.flash-error {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    color: #ff8a8a;
    border-color: rgba(255,107,107,0.35);
}

@media (prefers-reduced-motion: reduce) {
    #bg-canvas { display: none; }
    body {
        background: radial-gradient(circle at 50% 20%, #1a1030 0%, #0a0a0f 55%, #000 100%);
    }
}

.stats-mini {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.85rem;
}

.stats-mini p { margin: 0.25rem 0; }

/* ---- Currency / Country ---- */
.currency-tabs {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.country-list a {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0.5rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--muted);
    font-size: 0.85rem;
}

.country-list a.active,
.country-list a:hover {
    color: var(--text);
    background: rgba(255,255,255,0.04);
}

.country-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dot-live {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 6px #4ade80;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 0.65rem;
    flex-wrap: nowrap;
    flex-shrink: 0;
    margin: 0;
}

.footer-nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.85rem;
}

.footer-nav a:hover { color: var(--blue); }

/* ---- Legal modals ---- */
.legal-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.legal-modal[hidden] {
    display: none !important;
}

.legal-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 4, 10, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.legal-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    max-height: min(78vh, 640px);
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
    animation: legal-modal-in 0.22s ease-out;
}

@keyframes legal-modal-in {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.legal-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--glass-border);
}

.legal-modal-header h2 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--gold);
}

.legal-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.legal-modal-close:hover {
    border-color: rgba(245, 197, 66, 0.4);
    color: var(--gold);
}

.legal-modal-body {
    padding: 1rem 1.25rem 1.35rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.legal-modal-body .rules-list {
    margin: 0;
    padding-left: 1.15rem;
}

.legal-modal-body .rules-list li {
    margin-bottom: 0.65rem;
}

.legal-modal-body .rules-list li:last-child {
    margin-bottom: 0;
}

body.modal-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .legal-modal {
        align-items: flex-end;
        padding: 0;
    }

    .legal-modal-dialog {
        width: 100%;
        max-height: 85vh;
        border-radius: 18px 18px 0 0;
        animation: legal-sheet-in 0.24s ease-out;
    }

    @keyframes legal-sheet-in {
        from { opacity: 0; transform: translateY(40px); }
        to { opacity: 1; transform: translateY(0); }
    }
}

.header-top {
    display: none;
}

.mobile-only { display: none; }

.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: none;
    justify-content: space-around;
    align-items: center;
    padding: 0.5rem 1rem calc(0.5rem + env(safe-area-inset-bottom));
    background: rgba(10, 10, 15, 0.92);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--glass-border);
}

.mobile-bottom-nav a,
.mobile-nav-btn {
    color: var(--muted);
    text-decoration: none;
    font-size: 1.35rem;
    background: none;
    border: none;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
}

.mobile-bottom-nav a.active { color: var(--gold); }

@media (max-width: 900px) {
    .app-shell {
        flex-direction: column;
    }

    .app-left {
        width: 100%;
        max-width: none;
        flex: none;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
    }

    .earth-stage {
        order: -1;
        position: relative;
        height: 36vh;
        min-height: 220px;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .mobile-only { display: inline-flex; }

    .site-header {
        margin: 0.35rem 0.5rem 0;
        padding: 0.4rem 0.55rem;
    }

    .header-actions {
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
        width: 100%;
        margin-left: 0;
        padding-top: 0.5rem;
        border-top: 1px solid var(--glass-border);
    }

    .header-actions.open {
        display: flex;
        position: absolute;
        left: 0.5rem;
        right: 0.5rem;
        top: 100%;
        margin-top: 0.25rem;
        padding: 0.65rem;
        background: rgba(10, 10, 15, 0.96);
        backdrop-filter: blur(12px);
        border: 1px solid var(--glass-border);
        border-radius: 12px;
        z-index: 30;
    }

    .site-header {
        position: relative;
        flex-wrap: wrap;
    }

    .board-toggle, .lang-switch, .payment-options {
        flex-wrap: wrap;
    }

    .site-main {
        padding-bottom: calc(4.5rem + env(safe-area-inset-bottom));
    }

    .mobile-bottom-nav { display: flex; }

    .site-footer {
        flex-wrap: wrap;
        font-size: 0.72rem;
    }

    .footer-slogan {
        flex: 1 1 100%;
        text-align: center;
    }

    .bid-hero { padding: 1rem; }

    .amount-row .step-btn {
        width: 48px;
        height: 48px;
    }

    .top-three {
        gap: 0.5rem;
    }

    .listing-card.top-card .listing-bid {
        font-size: 1.05rem;
    }

    .listing-card {
        grid-template-columns: auto auto 1fr auto;
        grid-template-areas: none;
    }

    .listing-card.compact {
        grid-template-columns: auto auto 1fr auto;
    }

    .form-row-inline {
        flex-direction: column !important;
    }

    .option-cards {
        grid-template-columns: 1fr 1fr;
    }

    .payment-cards {
        grid-template-columns: 1fr;
    }

    .payment-options label {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .btn-primary {
        width: 100%;
        min-height: 48px;
        font-size: 1rem;
    }
}
