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

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #0d0f14;
    --surface: #161a23;
    --surface2: #1e2330;
    --surface3: #2a3045;
    --border: #2a3045;
    --text: #e8ecf4;
    --muted: #7a8299;
    --accent: #5865F2; /* Discord color as primary accent */
    --accent-hover: #4752C4;
    --success: #2ecc71;
    --danger: #e74c3c;
    --warning: #f1c40f;
}

body {
    font-family: 'Inter', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(88, 101, 242, 0.16), transparent 28%),
        radial-gradient(circle at top right, rgba(241, 196, 15, 0.08), transparent 24%),
        linear-gradient(180deg, #0b0e14 0%, #0f131c 55%, #0d1017 100%);
    color: var(--text);
    min-height: 100vh;
    padding-bottom: 3rem;
    line-height: 1.55;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,0.32), transparent 92%);
    opacity: 0.32;
    z-index: -1;
}

/* ─── Navbar ─────────────────────────────────────────────── */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: rgba(11, 14, 20, 0.8);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.3rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.5px;
    text-shadow: 0 0 18px rgba(88, 101, 242, 0.22);
}

.nav-mobile-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.nav-mobile-toggle span {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: #fff;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0.45rem 0.75rem;
    border-radius: 10px;
    transition: background 0.2s, color 0.2s;
}

.nav-dropdown:hover .nav-dropdown-btn,
.nav-dropdown:focus-within .nav-dropdown-btn {
    color: var(--text);
    background: rgba(255,255,255,0.04);
}

.nav-dropdown-btn::after {
    content: " ▾";
    font-size: 0.9rem;
}

.nav-dropdown-divider {
    height: 1px;
    margin: 0.4rem 0;
    background: rgba(255, 255, 255, 0.08);
}

.nav-dropdown-menu {
    position: absolute;
    top: 120%;
    left: 0;
    background: rgba(24, 29, 42, 0.98);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 0.55rem;
    min-width: 200px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
    display: none;
    z-index: 200;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu a {
    display: block;
    padding: 0.7rem 0.9rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 10px;
}

.nav-dropdown-menu a:hover {
    background: rgba(255,255,255,0.05);
}

.nav-links a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color .2s;
}

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

.nav-link-invite {
    color: var(--muted);
    font-weight: 700;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color .2s;
}

.nav-link-invite:hover {
    color: var(--text);
}

.nav-auth {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: linear-gradient(180deg, rgba(31, 37, 52, 0.94), rgba(22, 27, 38, 0.94));
    padding: 0.4rem 1rem 0.4rem 0.4rem;
    border-radius: 99px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-coins {
    color: var(--warning);
    font-weight: 700;
    font-size: 0.9rem;
    padding-left: 0.5rem;
}

.user-astral {
    color: #7dd3fc;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

/* ─── Common & Utils ─────────────────────────────────────── */
.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 2.75rem 1.5rem;
}

.page-title {
    font-size: clamp(2.1rem, 4vw, 3rem);
    font-weight: 900;
    margin-bottom: .5rem;
    letter-spacing: -1px;
}

.subtitle {
    color: var(--muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.xsmall {
    font-size: 0.85rem;
    color: var(--muted);
}

.header-with-action {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
}

.uid { color: var(--accent); }
.text-muted { color: var(--muted); }
.text-warning { color: var(--warning); }
.fw-bold { font-weight: 700; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-5 { margin-top: 2rem; }
.w-50 { width: 50%; }
.w-100 { width: 100%; }
.text-center { text-align: center; }
.flex-center { display: flex; justify-content: center; gap: 1rem; }
.italic { font-style: italic; }

/* ─── Alerts ─────────────────────────────────────────────── */
.flash-messages {
    margin-bottom: 2rem;
}

.flash-alert {
    background: linear-gradient(180deg, rgba(30, 35, 48, 0.96), rgba(23, 28, 39, 0.96));
    border: 1px solid rgba(255,255,255,0.08);
    border-left: 4px solid var(--accent);
    padding: 1rem 1.1rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    font-weight: 500;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
}

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
    padding: .6rem 1.2rem;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform .18s, filter .18s, box-shadow .18s, background .18s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.16);
}

.btn-sm {
    padding: .4rem .8rem;
    font-size: 0.85rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s, transform 0.18s, filter 0.18s;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn:hover { transform: translateY(-2px); filter: brightness(1.1); }
.btn:disabled { opacity: 0.5; pointer-events: none; }

.btn-discord { background: var(--accent); color: #fff; }
.btn-accent { background: linear-gradient(135deg, #5865F2, #7289da); color: #fff; }
.btn-success { background: linear-gradient(135deg, #27ae60, #2ecc71); color: #fff; }
.btn-danger { background: linear-gradient(135deg, #c0392b, #e74c3c); color: #fff; }
.btn-logout { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-logout:hover { color: var(--text); border-color: var(--muted); }
.btn-market { background: rgba(46, 204, 113, 0.16); color: var(--success); border: 1px solid rgba(46,204,113,0.22); }
.btn-market:hover { background: rgba(46, 204, 113, 0.24); }
.btn-trade { background: rgba(88, 101, 242, 0.16); color: var(--accent); border: 1px solid rgba(88,101,242,0.22); }
.btn-trade:hover { background: rgba(88, 101, 242, 0.24); }

.store-hero {
    text-align: center;
    margin-bottom: 2rem;
}

.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.store-card {
    background: linear-gradient(180deg, rgba(28, 33, 46, 0.95), rgba(20, 24, 35, 0.95));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 230px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.store-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.store-card-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
    text-shadow: 0 0 18px rgba(88,101,242,0.18);
}

.store-card-features {
    list-style: disc;
    padding-left: 1.2rem;
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.store-note {
    margin-top: 2rem;
    padding: 1.2rem;
    border-radius: 12px;
    border: 1px solid rgba(46, 204, 113, 0.4);
    background: rgba(46, 204, 113, 0.05);
    color: var(--text);
    text-align: center;
    font-size: 0.95rem;
}

.store-section {
    margin: 2.5rem 0;
}

.store-card-astral {
    border-color: rgba(125, 211, 252, 0.35);
    background: linear-gradient(180deg, rgba(14, 116, 144, 0.14), rgba(15, 23, 42, 0.92));
}

.astral-balance {
    border-color: rgba(125, 211, 252, 0.4);
    background: rgba(14, 116, 144, 0.08);
}

.astral-form {
    margin-top: auto;
}

.recycle-card {
    margin-top: 1.5rem;
    min-height: 0;
}

.astral-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.astral-card {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 12px;
    padding: 0.75rem;
    color: var(--text);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.astral-card:hover {
    transform: translateY(-2px);
    border-color: rgba(125, 211, 252, 0.55);
}

.astral-card.selected {
    border-color: #7dd3fc;
    box-shadow: 0 0 0 2px rgba(125, 211, 252, 0.2);
}

.astral-card img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
}

.astral-card-name {
    font-size: 0.85rem;
    font-weight: 700;
}

.astral-card-meta {
    font-size: 0.78rem;
    color: var(--muted);
}

.events-hero {
    text-align: center;
    margin-bottom: 2rem;
}
.events-hero .requirement-note {
    max-width: 720px;
    margin: 0.4rem auto 0;
    font-size: 0.95rem;
    color: var(--muted);
}
.event-detail-alert {
    border: 1px solid rgba(235, 69, 158, 0.3);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    margin: 0.6rem auto;
    background: rgba(235, 69, 158, 0.08);
    color: var(--muted);
    font-size: 0.95rem;
    text-align: center;
}

.event-section {
    margin-bottom: 2.5rem;
}

.event-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1px solid transparent;
}
.event-status-badge.active {
    color: var(--success);
    border-color: rgba(46, 204, 113, 0.5);
    background: rgba(46, 204, 113, 0.08);
}
.event-status-badge.upcoming {
    color: var(--warning);
    border-color: rgba(241, 196, 15, 0.5);
    background: rgba(241, 196, 15, 0.08);
}
.event-status-badge.ended,
.event-status-badge.inactive {
    color: var(--muted);
    border-color: rgba(250, 250, 250, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.event-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.event-card img,
.event-card video {
    width: 100%;
    height: 220px;
    object-fit: contain;
    background: #111;
}

.event-card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.event-card-top {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--muted);
}

.event-card h3 {
    margin: 0.2rem 0;
}

.event-card-footer {
    padding: 0 1rem 1rem;
    margin-top: auto;
}

.event-card-footer .btn {
    width: 100%;
}

.event-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.event-detail-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.event-detail-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

.event-detail-img-wrap img,
.event-detail-img-wrap video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.event-detail-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.event-detail-filters .input-modern {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    color: var(--text);
    font-size: 0.95rem;
    min-width: 200px;
    flex: 1;
    transition: border-color 0.2s;
}
.event-detail-filters .input-modern:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 2px rgba(114, 137, 218, 0.25);
}

.event-detail-card.r1 { border-top-color: #A0A0A0; }
.event-detail-card.r2 { border-top-color: #71B85F; }
.event-detail-card.r3 { border-top-color: #3498DB; }
.event-detail-card.r4 { border-top-color: #9B59B6; }
.event-detail-card.r5 { border-top-color: #E67E22; }
.event-detail-card.r6 { border-top-color: #F1C40F; }

.event-detail-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
}

.event-detail-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.25s;
}

.event-detail-card:hover .event-detail-img-wrap img {
    transform: scale(1.04);
}

.event-detail-stars {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.6);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}

.event-detail-tier {
    position: absolute;
    bottom: 0.75rem;
    left: 0.75rem;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(0, 0, 0, 0.65);
    padding: 0.15rem 0.6rem;
    border-radius: 8px;
}

.event-detail-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.event-detail-body h3 {
    margin: 0;
    font-size: 1.2rem;
}

.event-detail-serie {
    font-size: 0.85rem;
    color: var(--muted);
    letter-spacing: 0.06em;
}

.event-detail-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--muted);
    gap: 0.5rem;
}

.event-detail-availability {
    font-weight: 600;
    color: #69c8ff;
}

.event-detail-cost {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.history-hero {
    text-align: center;
    margin-bottom: 2rem;
}

.history-table-wrapper {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface2);
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th,
.history-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: left;
    font-size: 0.95rem;
}

.history-table th {
    color: var(--muted);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.history-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.history-card-stars {
    font-size: 1.1rem;
}

.history-card small {
    color: var(--muted);
}

/* ─── Ranking ────────────────────────────────────────────── */
.ranking-list {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1rem 1.4rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    transition: background .2s, transform .15s;
}

.ranking-item:hover {
    background: var(--surface2);
    transform: translateX(4px);
    border-color: var(--surface3);
}

.rank { font-size: 1.4rem; min-width: 2rem; text-align: center; }
.rank-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.rank-info { flex: 1; }
.rank-id { display: block; font-weight: 700; font-size: 1.05rem; margin-bottom: 0.2rem; }
.rank-stats { color: var(--muted); font-size: .85rem; }
.rank-arrow { color: var(--muted); }

/* ─── Cards Grid ─────────────────────────────────────────── */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.2rem;
    margin-top: 1.5rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 4px solid var(--accent);
    border-radius: 14px;
    padding: 1.2rem;
    transition: transform .2s, box-shadow .2s;
    position: relative;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(0,0,0,.3);
    border-color: var(--surface3);
}

.card-img-wrap {
    width: 100%;
    height: 200px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    cursor: pointer;
    transition: transform 0.2s;
}

.card-img-wrap:hover {
    transform: scale(1.05);
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.card-rareza {
    font-size: .75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--accent);
    margin-bottom: .6rem;
}

.card-nombre {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: .3rem;
    line-height: 1.3;
}

.card-serie {
    font-size: .8rem;
    color: var(--muted);
    margin-bottom: 1rem;
    flex-grow: 1;
}

.card-stats {
    display: flex;
    justify-content: space-between;
    font-size: .85rem;
    font-weight: 600;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border);
}

.card-id { color: var(--muted); font-weight: 400; }

.card-copies {
    position: absolute;
    top: .8rem;
    right: .8rem;
    background: var(--accent);
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    padding: .2rem .5rem;
    border-radius: 99px;
}

.collection-lock-form {
    position: absolute;
    top: 0.8rem;
    left: 0.8rem;
    z-index: 2;
}

.collection-lock-pill {
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(12, 15, 22, 0.78);
    color: var(--text);
    border-radius: 999px;
    padding: 0.28rem 0.62rem;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.collection-lock-pill:hover {
    background: rgba(25, 31, 44, 0.95);
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

.collection-lock-pill.is-locked {
    background: rgba(231, 76, 60, 0.14);
    border-color: rgba(231, 76, 60, 0.35);
    color: #ffd7d2;
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    align-items: stretch;
}

.card-actions form {
    display: block;
}

.card-actions .btn-sm,
.card-actions .badge,
.card-action-note {
    text-align: center;
    min-width: 0;
}

.card-actions .btn-sm {
    flex: 1 1 0;
    min-width: 120px;
}

.card-actions .badge,
.card-action-note {
    flex: 1 1 100%;
}

.card-action-note {
    padding: 0.55rem 0.75rem;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px dashed rgba(255,255,255,0.08);
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

/* ─── Mercado ────────────────────────────────────────────── */
.market-card {
    padding-top: 2rem;
}

.market-price-tag {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--warning);
    color: #000;
    font-weight: 900;
    padding: 0.3rem 0.8rem;
    border-radius: 99px;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(241, 196, 15, 0.3);
}

.seller-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface2);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

.seller-chip img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.badge.in-market {
    background: rgba(241, 196, 15, 0.15);
    color: var(--warning);
    padding: 0.4rem;
    border-radius: 6px;
    font-size: 0.8rem;
    text-align: center;
    width: 100%;
    font-weight: 600;
}

/* ─── Trades (Listado) ───────────────────────────────────── */
.trades-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.trade-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.2rem 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s;
}

.trade-item:hover { transform: translateY(-2px); border-color: var(--surface3); }
.trade-item.active { border-left: 4px solid var(--accent); }

.trade-date { color: var(--muted); font-size: 0.85rem; width: 100px; }

.trade-users {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 200px;
}

.trade-arrow-small { color: var(--muted); font-size: 1.2rem; }

.trade-summary {
    flex: 1;
    display: flex;
    gap: 2rem;
    font-size: 0.9rem;
}

.trade-side { display: flex; flex-direction: column; gap: 0.2rem; }

.trade-status {
    padding: 0.4rem 0.8rem;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-pendiente { background: rgba(241, 196, 15, 0.15); color: var(--warning); }
.status-aceptado { background: rgba(46, 204, 113, 0.15); color: var(--success); }
.status-rechazado { background: rgba(231, 76, 60, 0.15); color: var(--danger); }

/* ─── Forms & Modals ─────────────────────────────────────── */
.input-modern {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}
.input-modern:focus { outline: none; border-color: var(--accent); }

.form-group { margin-bottom: 1.2rem; position: relative; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; font-size: 0.9rem; color: var(--muted); }
.form-row { display: flex; gap: 1rem; }

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--surface);
    margin: 10% auto;
    padding: 2.5rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 24px 48px rgba(0,0,0,0.5);
    position: relative;
}

.modal-lg { max-width: 700px; }

.close {
    position: absolute;
    top: 1.5rem; right: 1.5rem;
    color: var(--muted);
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover { color: var(--text); }

.form-section {
    background: var(--surface2);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}
.form-section h3 { margin-bottom: 1.2rem; font-size: 1.1rem; }

/* ─── Autocomplete ───────────────────────────────────────── */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--surface3);
    min-width: 100%;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.5);
    z-index: 1;
    border-radius: 8px;
    border: 1px solid var(--border);
    max-height: 200px;
    overflow-y: auto;
    top: 100%;
    margin-top: 4px;
}

.dropdown-item {
    color: var(--text);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    cursor: pointer;
}

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

/* ─── Filter bar ─────────────────────────────────────────── */
.filter-bar {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.filter-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: .5rem 1.2rem;
    color: var(--muted);
    font-family: inherit;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.filter-search-input,
.collection-search-input {
    flex: 1 1 260px;
    min-width: 0;
    max-width: 300px;
}

.pending-spawns {
    margin-bottom: 2rem;
}

.pending-spawns-title {
    color: #f7a94b;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.pending-spawns-list {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.pending-spawn-card {
    background: rgba(247, 169, 75, 0.1);
    border: 1px solid rgba(247, 169, 75, 0.3);
    border-radius: 12px;
    padding: 1.2rem;
    flex: 1 1 250px;
    max-width: 320px;
}

.pending-spawn-card-title {
    margin: 0 0 0.5rem 0;
    color: #fff;
}

.pending-spawn-card-desc {
    margin: 0 0 1rem 0;
    color: #b9bbbe;
    font-size: 0.85rem;
}

.pending-spawn-card-link {
    display: block;
    text-align: center;
    text-decoration: none;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    border-radius: 8px;
}

/* ─── Search box (Ranking) ───────────────────────────────── */
.search-box {
    display: flex;
    gap: .6rem;
    margin: 1.5rem 0 .5rem;
}

.search-box input {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .8rem 1.2rem;
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color .2s;
}

.search-box input:focus { border-color: var(--accent); }
.search-box button { background: var(--surface3); color: #fff; border: 1px solid var(--border); border-radius: 8px; padding: .8rem 1.2rem; font-weight: 700; cursor: pointer; transition: background .2s; }
.search-box button:hover { background: var(--border); }

/* ─── Result boxes ───────────────────────────────────────── */
.result-box {
    text-align: center;
    padding: 3rem;
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid var(--border);
    margin-top: 2rem;
}
.result-box.success { border-top: 4px solid var(--success); }
.result-box.danger  { border-top: 4px solid var(--danger); }
.result-box.warning { border-top: 4px solid var(--warning); }

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--surface);
    border-radius: 16px;
    border: 1px dashed var(--border);
    margin-top: 2rem;
}
.empty-icon { font-size: 4rem; opacity: 0.5; margin-bottom: 1rem; filter: grayscale(1); }
.empty-state h3 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.empty-state p { color: var(--muted); }

/* ─── Single Trade View ──────────────────────────────────── */
.trade-side-panel {
    background: var(--surface2);
    padding: 2rem;
    border-radius: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.trade-coins { background: rgba(241, 196, 15, 0.15); color: var(--warning); padding: 0.5rem 1rem; border-radius: 8px; font-weight: 700; font-size: 1.1rem; }

/* ─── Lightbox Fullscreen ────────────────────────────────── */
.lightbox-modal {
    display: none; 
    position: fixed; 
    z-index: 2000; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(5, 5, 5, 0.95);
    backdrop-filter: blur(8px);
}
.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 85vh;
    border-radius: 8px;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 0 40px rgba(0,0,0,0.8);
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 2001;
}
.lightbox-close:hover {
    color: var(--danger);
    text-decoration: none;
}

/* ─── Profile Header ───────────────────────────────────────── */
.user-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    background: var(--surface);
    padding: 1.5rem 2rem;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.user-header img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
}

.user-header .page-title {
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.badge-premium {
    background: linear-gradient(45deg, #f1c40f, #e67e22);
    color: #fff;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    font-size: 0.9rem;
    font-weight: 800;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.4);
    animation: shine 2s infinite alternate;
}

@keyframes shine {
    from { filter: brightness(1) drop-shadow(0 0 2px gold); }
    to { filter: brightness(1.3) drop-shadow(0 0 8px gold); }
}

.premium-user-card {
    min-width: 140px;
    transition: transform 0.2s;
}
.premium-user-card:hover {
    transform: translateY(-3px);
}
.xsmall {
    font-size: 0.75rem;
}

.legal-page {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
    margin-bottom: 2rem;
}

.legal-section + .legal-section {
    margin-top: 1.6rem;
}

.legal-page h2 {
    font-size: 1.4rem;
    margin-top: 1.2rem;
    color: var(--text);
}

.legal-page p {
    color: var(--muted);
    line-height: 1.7;
    margin-top: 0.6rem;
}

.site-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 2.5rem auto 0;
    padding: 1.8rem 0 2.5rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
}

.site-footer__links {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.4rem;
}

.site-footer__links a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
}

.site-footer__links a:hover {
    color: var(--text);
}

.site-footer__links span {
    color: rgba(255, 255, 255, 0.5);
}

.site-footer__note {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.claims-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: linear-gradient(180deg, rgba(28, 33, 46, 0.94), rgba(20, 24, 35, 0.94));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1rem 1.1rem;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.16);
}

@media (max-width: 980px) {
    .navbar {
        padding: 0.9rem 1rem;
        flex-wrap: wrap;
        gap: 0.85rem;
    }

    .nav-links,
    .nav-auth {
        width: 100%;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .nav-links {
        order: 3;
    }

    .nav-auth {
        justify-content: space-between;
    }

    .container {
        padding: 2rem 1rem;
    }

    .header-with-action,
    .trade-item,
    .trade-summary {
        flex-direction: column;
        align-items: stretch;
    }

    .trade-users,
    .trade-date {
        width: auto;
    }

    .form-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .modal-content {
        margin: 6% auto;
        padding: 1.5rem;
    }

    .cards-grid,
    .event-grid,
    .event-detail-grid,
    .store-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 1rem;
    }

    .user-header {
        padding: 1.25rem;
    }
}

@media (max-width: 720px) {
    .navbar {
        position: static;
    }

    .nav-mobile-toggle {
        display: inline-flex;
        margin-left: auto;
    }

    .nav-links,
    .nav-auth {
        display: none;
    }

    .navbar.is-open .nav-links,
    .navbar.is-open .nav-auth {
        display: flex;
    }

    body {
        line-height: 1.45;
    }

    body::before {
        opacity: 0.18;
    }

    .logo {
        font-size: 1.15rem;
    }

    .nav-dropdown,
    .nav-links > a,
    .nav-link-invite {
        width: 100%;
    }

    .nav-dropdown:hover .nav-dropdown-menu,
    .nav-dropdown:focus-within .nav-dropdown-menu {
        display: none;
    }

    .nav-dropdown.is-open .nav-dropdown-menu {
        display: block;
    }

    .nav-dropdown-btn,
    .nav-links > a,
    .nav-link-invite {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 0.75rem 0.9rem;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.03);
    }

    .nav-dropdown-menu {
        position: static;
        width: 100%;
        min-width: 0;
        margin-top: 0.45rem;
    }

    .user-chip {
        width: 100%;
        justify-content: space-between;
        padding-right: 0.75rem;
    }

    .btn-logout,
    .btn-discord {
        width: 100%;
    }

    .page-title {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 0.98rem;
        margin-bottom: 1.35rem;
    }

    .user-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .user-header img {
        width: 72px;
        height: 72px;
    }

    .claims-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .cards-grid,
    .event-grid,
    .event-detail-grid,
    .store-grid,
    .astral-cards-grid {
        grid-template-columns: 1fr 1fr;
    }

    .card,
    .event-detail-card,
    .event-card,
    .store-card {
        border-radius: 16px;
    }

    .card,
    .store-card {
        padding: 0.85rem;
    }

    .card-img-wrap {
        height: 145px;
        margin-bottom: 0.8rem;
    }

    .card-nombre {
        font-size: 0.98rem;
    }

    .card-serie,
    .card-stats {
        font-size: 0.78rem;
    }

    .event-card img,
    .event-card video {
        height: 150px;
    }

    .event-detail-body,
    .event-card-body {
        padding: 0.85rem;
    }

    .event-detail-body h3,
    .event-card h3 {
        font-size: 1rem;
    }

    .history-table th,
    .history-table td {
        padding: 0.8rem 0.65rem;
        font-size: 0.86rem;
    }

    .search-box {
        flex-direction: column;
    }

    .filter-search-input,
    .collection-search-input {
        flex-basis: 100%;
        max-width: none;
    }

    .pending-spawn-card {
        max-width: none;
    }

    input,
    select,
    textarea,
    .input-modern,
    .search-box input {
        font-size: 16px;
    }

    .site-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .site-footer__links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 540px) {
    .container {
        padding: 1.35rem 0.8rem;
    }

    .page-title {
        font-size: 1.55rem;
        letter-spacing: -0.04em;
    }

    .subtitle,
    .text-muted,
    .card-serie,
    .event-detail-serie {
        font-size: 0.9rem;
    }

    .claims-grid,
    .cards-grid,
    .event-grid,
    .event-detail-grid,
    .store-grid,
    .astral-cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.7rem;
    }

    .btn,
    .btn-sm,
    .filter-btn {
        width: 100%;
    }

    .card-actions {
        grid-template-columns: 1fr;
    }

    .flex-center {
        flex-direction: column;
    }

    .filter-bar {
        gap: 0.65rem;
    }

    .input-modern,
    .search-box input,
    .search-box button {
        font-size: 0.92rem;
    }

    input,
    select,
    textarea,
    .input-modern,
    .search-box input {
        font-size: 16px;
    }

    .market-price-tag {
        font-size: 0.82rem;
        top: -10px;
    }

    .cards-grid {
        margin-top: 1rem;
    }

    .card {
        border-radius: 14px;
        padding: 0.75rem;
    }

    .card-img-wrap {
        height: 132px;
        margin-bottom: 0.7rem;
    }

    .card-copies {
        top: 0.55rem;
        right: 0.55rem;
        font-size: 0.7rem;
        padding: 0.16rem 0.42rem;
    }

    .card-rareza {
        font-size: 0.68rem;
        margin-bottom: 0.4rem;
    }

    .card-nombre {
        font-size: 0.9rem;
        margin-bottom: 0.2rem;
    }

    .card-serie {
        font-size: 0.74rem;
        margin-bottom: 0.65rem;
    }

    .card-stats {
        font-size: 0.74rem;
        padding-top: 0.6rem;
    }

    .event-card img,
    .event-card video {
        height: 135px;
    }

    .trade-item,
    .trade-side-panel,
    .legal-page {
        padding: 1rem;
    }

    .modal-content {
        width: calc(100% - 1rem);
        margin: 1.25rem auto;
        padding: 1.1rem;
    }

    .event-detail-body,
    .event-card-body {
        padding: 0.75rem;
    }

    .event-detail-body h3,
    .event-card h3 {
        font-size: 0.94rem;
    }
}
