@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg-0: #0c1115;
    --bg-1: #10161c;
    --bg-2: #171f27;
    --bg-3: #1e2830;
    --border: #232d37;
    --text: #ffffff;
    --text-dim: #aab4bf;
    --text-muted: #6b7684;
    --accent: #3b82f6;
    --accent-hover: #2d6de0;
    --accent-soft: rgba(59, 130, 246, 0.14);
    --orange: #f5a623;
    --green: #1fbf6b;
    --radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body.market-body {
    background-color: var(--bg-0);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100vw;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, select { font-family: inherit; }

/* UTILITY BAR */

.utility-bar {
    height: 38px;
    display: flex;
    align-items: center;
    padding: 0 28px;
    background-color: #090d11;
    border-bottom: 1px solid var(--border);
    font-size: 11.5px;
}

.utility-links {
    display: flex;
    gap: 22px;
}

.utility-links a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.2);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    transition: color 0.15s ease;
}

.utility-links a:hover { color: var(--accent); }
.utility-links i { font-size: 11px; }

/* MAIN NAVBAR */

.market-nav {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    background-color: var(--bg-1);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 40px;
}

.logo-badge {
    display: flex;
    align-items: center;
    height: 48px;
}

.logo-badge img {
    height: 46px;
    width: auto;
    display: block;
}

.nav-tabs {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: rgba(255, 255, 255, 0.2);
    transition: color 0.15s ease;
}

.nav-tab i { font-size: 13px; }

.nav-tab:hover { color: var(--accent); }

.nav-tab.active {
    color: var(--accent);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn {
    padding: 9px 18px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 800;
    border: none;
    transition: all 0.15s ease;
}

.btn-ghost {
    background: var(--bg-3);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    border-color: #34424e;
    background-color: #253038;
}

.btn-accent {
    background-color: var(--accent);
    color: white;
}

.btn-accent:hover {
    background-color: var(--accent-hover);
}

/* PAGE LAYOUT */

.market-page {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 16px 16px 40px;
}

.market-main {
    flex: 1;
    min-width: 0;
}

/* CONTROL BAR */

.control-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.control-search {
    flex: 1;
    min-width: 180px;
    position: relative;
}

.control-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 12px;
}

.control-search input {
    width: 100%;
    height: 38px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background-color: var(--bg-2);
    color: var(--text);
    padding: 0 12px 0 32px;
    font-size: 13px;
}

.control-search input::placeholder { color: var(--text-muted); }

.control-pills {
    display: flex;
    gap: 6px;
    background-color: var(--bg-2);
    border-radius: 6px;
    padding: 3px;
}

.control-pill {
    padding: 7px 12px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}

.control-pill.active {
    background-color: var(--accent);
    color: white;
}

.control-select {
    height: 38px;
    border-radius: 6px;
    background-color: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 0 10px;
    font-size: 12.5px;
    font-weight: 700;
}

/* LISTING GRID */

.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.listing-card {
    background-color: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.15s ease, transform 0.15s ease;
    cursor: pointer;
}

.listing-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.listing-thumb {
    height: 110px;
    width: 100%;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 8px;
    background-size: cover;
    background-position: center;
}

.thumb-badge {
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 9.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.badge-buy {
    background-color: rgba(31, 191, 107, 0.16);
    color: var(--green);
}

.badge-offer {
    background-color: rgba(59, 130, 246, 0.16);
    color: var(--accent);
}

.badge-new {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: var(--orange);
    color: #1a1204;
}

.listing-body {
    padding: 10px 12px 12px;
}

.listing-title {
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.listing-price {
    font-size: 16px;
    font-weight: 800;
    color: var(--accent);
}

/* FOOTER */

.market-footer {
    margin-top: auto;
    background-color: var(--bg-1);
    border-top: 1px solid var(--border);
    padding: 28px 28px 20px;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.footer-links {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
}

.footer-links a {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.footer-links a:hover { color: var(--text); }

.footer-note {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 900px;
}

.footer-copy {
    font-size: 12px;
    color: var(--text-muted);
}

/* LEGAL / DOC PAGES */

.legal-page {
    max-width: 780px;
    margin: 0 auto;
    padding: 48px 24px 80px;
    color: var(--text-dim);
    line-height: 1.7;
    font-size: 14px;
}

.legal-page h1 {
    color: var(--text);
    font-size: 26px;
    margin-bottom: 6px;
}

.legal-page .legal-updated {
    color: var(--text-muted);
    font-size: 12.5px;
    margin-bottom: 32px;
}

.legal-page h2 {
    color: var(--text);
    font-size: 16px;
    margin: 32px 0 10px;
}

.legal-page p, .legal-page li {
    margin-bottom: 12px;
}

.legal-page ul {
    padding-left: 20px;
    list-style: disc;
}

.legal-page a {
    color: var(--accent);
    text-decoration: underline;
}

/* HOME PAGE */

.hero {
    padding: 130px 28px 110px;
    text-align: center;
    background:
        linear-gradient(180deg, rgba(12,17,21,0.3) 0%, rgba(12,17,21,0.45) 60%, var(--bg-0) 100%),
        url('bg2.png') center 12% / cover no-repeat;
    border-bottom: 1px solid var(--border);
}

.hero h1 {
    font-size: 40px;
    font-weight: 800;
    max-width: 720px;
    margin: 0 auto 14px;
    line-height: 1.15;
}

.hero h1 span { color: var(--accent); }

.hero p {
    color: var(--text-dim);
    font-size: 15px;
    max-width: 560px;
    margin: 0 auto 28px;
    line-height: 1.6;
}

.trust-row {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
}

.trust-item i {
    color: var(--accent);
    font-size: 13px;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.hero .btn {
    padding: 12px 24px;
    font-size: 14px;
}

.home-section {
    max-width: 1300px;
    margin: 0 auto;
    padding: 48px 28px;
}

.home-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.home-section-head h2 {
    font-size: 20px;
    font-weight: 800;
}

.home-section-head a {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
}

.how-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.how-step {
    background-color: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
}

.how-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    margin-bottom: 12px;
}

.how-step h3 {
    font-size: 14.5px;
    margin-bottom: 6px;
}

.how-step p {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.55;
}

/* RESPONSIVE */

@media (max-width: 1000px) {
    .nav-tabs { display: none; }
    .how-steps { grid-template-columns: 1fr; }
    .hero h1 { font-size: 28px; }
}

/* NAV ACCOUNT MENU */

.nav-account-menu {
    position: relative;
}

.nav-account-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 12px;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
}

.nav-account-trigger img,
.nav-account-fallback {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
}

.nav-account-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
    font-size: 12px;
}

.nav-account-trigger i {
    font-size: 10px;
    color: var(--text-muted);
}

.nav-account-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px;
    z-index: 20;
}

.nav-account-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-dim);
}

.nav-account-dropdown a:hover {
    background: var(--bg-3);
    color: var(--text);
}

.nav-account-dropdown i {
    width: 14px;
    text-align: center;
}

/* SETTINGS PAGE */

.settings-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 60px 24px 100px;
    flex: 1;
    width: 100%;
}

.settings-page h1 {
    font-size: 26px;
    font-weight: 800;
}

.settings-sub {
    color: var(--text-muted);
    font-size: 13.5px;
    margin-top: 6px;
    margin-bottom: 28px;
}

.settings-loading,
.settings-signed-out {
    padding: 80px 0;
    text-align: center;
    color: var(--text-muted);
}

.settings-signed-out h1 {
    margin-bottom: 12px;
}

.settings-signed-out .btn {
    display: inline-flex;
    margin-top: 20px;
}

.settings-notice {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 20px;
}

.settings-notice-ok {
    border-color: rgba(31, 191, 107, 0.4);
    color: var(--green);
}

.settings-notice-error {
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.settings-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 20px;
}

.settings-card h2 {
    font-size: 15px;
    margin-bottom: 6px;
}

.settings-hint {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.settings-label {
    display: block;
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.settings-input {
    width: 100%;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 12px;
    color: var(--text-dim);
    font-size: 13.5px;
}

.connected-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.connected-row:first-of-type {
    border-top: none;
    padding-top: 0;
}

.connected-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.connected-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-2);
    border-radius: 8px;
    font-size: 15px;
    color: var(--text-dim);
}

.connected-icon-discord {
    color: #5865f2;
}

.connected-name {
    font-size: 13.5px;
    font-weight: 600;
}

.connected-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.connected-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(31, 191, 107, 0.14);
    color: var(--green);
    white-space: nowrap;
}

.btn-danger {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}
