/* =========================================================
   RuneForge — Gamified NFT Marketplace Design System
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
    /* Colors - Dark Cyberpunk / Neon Magic Theme */
    --bg-base: #06080F;
    --bg-surface: #0B1120;
    --bg-raised: #131B33;
    --bg-glass: rgba(19, 27, 51, 0.6);

    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(0, 240, 255, 0.3);

    --accent-cyan: #00E5FF;
    --accent-purple: #B388FF;
    --accent-orange: #FFAB40;
    --accent-pink: #FF4081;
    --color-success: #00E676;
    --color-error: #FF1744;

    --text-primary: #FFFFFF;
    --text-sec: #A0ABC0;
    --text-muted: #64748B;

    /* Typography */
    --font-sans: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing */
    --sp-xs: 4px;
    --sp-sm: 8px;
    --sp-md: 16px;
    --sp-lg: 24px;
    --sp-xl: 32px;
    --sp-2xl: 48px;

    /* Radii */
    --rad-sm: 8px;
    --rad-md: 12px;
    --rad-lg: 20px;
    --rad-full: 9999px;

    /* Shadows */
    --shadow-neon: 0 0 20px rgba(0, 229, 255, 0.2);
    --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);

    /* Transitions */
    --trans-fast: 150ms ease;
    --trans-base: 300ms ease;
}

/* ── Reset & Base ───────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* ── Utility Classes ────────────────────────────────────── */
.text-neon-cyan {
    color: var(--accent-cyan);
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}

.text-muted {
    color: var(--text-muted);
}

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

.full-width {
    width: 100%;
}

/* ── Background Animation (Stars/Particles) ─────────────── */
#stars,
#stars2,
#stars3 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: transparent;
    pointer-events: none;
}

/* A CSS-only starfield via box-shadow could go here, omitting for brevity to focus on UI */

/* ── Live Price Ticker ──────────────────────────────────── */
.price-ticker-wrap {
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid var(--border-subtle);
    padding: 8px 0;
    overflow: hidden;
    white-space: nowrap;
    margin-bottom: var(--sp-2xl);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-sec);
}

.price-ticker {
    display: inline-block;
    animation: ticker 25s linear infinite;
    padding-left: 100%;
}

.price-ticker span {
    margin-right: 2rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ticker-up {
    color: var(--color-success);
}

.ticker-down {
    color: var(--color-error);
}

.ticker-neutral {
    color: var(--accent-cyan);
}

@keyframes ticker {
    0% {
        transform: translate3d(0, 0, 0);
    }

    100% {
        transform: translate3d(-100%, 0, 0);
    }
}

/* ── Layout & Navbar ────────────────────────────────────── */
#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content-wrapper {
    flex: 1;
    padding: 0 var(--sp-lg) var(--sp-2xl);
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--sp-md) var(--sp-2xl);
    background: rgba(6, 8, 15, 0.8);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    cursor: pointer;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.nav-logo {
    font-size: 1.6rem;
    filter: drop-shadow(0 0 10px var(--accent-purple));
}

.nav-brand span {
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.nav-brand small {
    font-size: 0.7rem;
    color: var(--text-sec);
    -webkit-text-fill-color: initial;
    margin-left: var(--sp-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.nav-links {
    display: flex;
    gap: var(--sp-sm);
    background: var(--bg-surface);
    padding: 4px;
    border-radius: var(--rad-full);
    border: 1px solid var(--border-subtle);
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-sec);
    padding: var(--sp-sm) var(--sp-xl);
    border-radius: var(--rad-full);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--trans-fast);
}

.nav-btn:hover {
    color: var(--text-primary);
}

.nav-btn.active {
    background: var(--bg-raised);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ── Buttons ────────────────────────────────────────────── */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    color: #fff;
    border: none;
    padding: var(--sp-sm) var(--sp-lg);
    border-radius: var(--rad-full);
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--trans-fast);
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 229, 255, 0.4);
}

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

.btn-secondary {
    background: var(--bg-raised);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    padding: var(--sp-sm) var(--sp-lg);
    border-radius: var(--rad-full);
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--trans-fast);
}

.btn-secondary:hover {
    border-color: var(--accent-cyan);
    background: rgba(0, 229, 255, 0.05);
}

.btn-mega {
    background: linear-gradient(45deg, #FFAB40, #FF4081);
    color: #fff;
    border: none;
    padding: var(--sp-lg) var(--sp-2xl);
    border-radius: var(--rad-lg);
    font-family: inherit;
    font-size: 1.25rem;
    font-weight: 900;
    cursor: pointer;
    transition: all var(--trans-base);
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    box-shadow: 0 8px 30px rgba(255, 64, 129, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-mega::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.btn-mega:hover::after {
    transform: translateX(100%);
}

.btn-mega:active {
    transform: scale(0.98);
}

.btn-mega:disabled {
    background: var(--bg-raised);
    color: var(--text-muted);
    box-shadow: none;
    cursor: not-allowed;
}

/* ── Section & View Management ──────────────────────────── */
.view-section {
    display: none;
    animation: fadeIn var(--trans-base);
}

.view-section.active {
    display: block;
}

.section-header {
    text-align: center;
    margin-bottom: var(--sp-2xl);
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: var(--sp-sm);
}

.section-header p {
    color: var(--text-sec);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Marketplace Filters & Grid ─────────────────────────── */
.filter-bar {
    display: flex;
    gap: var(--sp-md);
    margin-bottom: var(--sp-xl);
}

.filter-bar input,
.filter-bar select {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: var(--sp-sm) var(--sp-md);
    border-radius: var(--rad-md);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color var(--trans-fast);
}

.filter-bar input {
    flex: 1;
}

.filter-bar input:focus,
.filter-bar select:focus {
    border-color: var(--accent-cyan);
}

.nft-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--sp-xl);
}

/* ── NFT Card ───────────────────────────────────────────── */
.nft-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--rad-lg);
    overflow: hidden;
    transition: transform var(--trans-base), box-shadow var(--trans-base), border-color var(--trans-base);
    position: relative;
    display: flex;
    flex-direction: column;
}

.nft-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-neon);
    border-color: rgba(0, 229, 255, 0.4);
}

.nft-media {
    width: 100%;
    aspect-ratio: 1/1;
    background: var(--bg-raised);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.nft-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nft-media .emoji-art {
    font-size: 5rem;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.2));
}

.nft-rarity-badge {
    position: absolute;
    top: var(--sp-sm);
    right: var(--sp-sm);
    padding: 2px var(--sp-sm);
    border-radius: var(--rad-full);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    border: 1px solid;
}

.rarity-common {
    color: #A0ABC0;
    border-color: rgba(160, 171, 192, 0.3);
}

.rarity-rare {
    color: var(--accent-cyan);
    border-color: rgba(0, 229, 255, 0.3);
}

.rarity-epic {
    color: var(--accent-purple);
    border-color: rgba(179, 136, 255, 0.3);
}

.rarity-legendary {
    color: var(--accent-orange);
    border-color: rgba(255, 171, 64, 0.3);
    text-shadow: 0 0 8px rgba(255, 171, 64, 0.5);
}

.nft-info {
    padding: var(--sp-md);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.nft-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: var(--sp-xs);
}

.nft-creator {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-sec);
    margin-bottom: var(--sp-md);
}

.nft-price-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: var(--sp-md);
    margin-top: auto;
}

.price-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
    display: block;
}

.price-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--accent-cyan);
    font-family: var(--font-mono);
}

.price-usd {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ── Mempool Miner Game UI ──────────────────────────────── */
.game-container {
    max-width: 600px;
    margin: 0 auto;
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: var(--sp-xl);
    margin-bottom: var(--sp-xl);
}

.stat-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: var(--sp-md) var(--sp-xl);
    border-radius: var(--rad-md);
    text-align: center;
    flex: 1;
    max-width: 250px;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-sec);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--sp-xs);
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--accent-cyan);
    transition: color var(--trans-fast);
}

.miner-game-area {
    background: var(--bg-surface);
    border: 2px solid var(--border-focus);
    border-radius: var(--rad-xl);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-neon);
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    height: 400px;
}

#miner-canvas {
    display: block;
    width: 100%;
    height: 100%;
    background: #04060b;
}

.game-overlay {
    position: absolute;
    inset: 0;
    background: rgba(6, 8, 15, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--sp-2xl);
    z-index: 10;
    transition: opacity var(--trans-base);
}

.game-overlay h3 {
    font-size: 2rem;
    margin-bottom: var(--sp-md);
    color: #fff;
}

.game-overlay p {
    margin-bottom: var(--sp-lg);
    font-size: 0.95rem;
    max-width: 80%;
}

.game-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ── Modals & Notifications ─────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 8, 15, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity var(--trans-base);
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    width: 100%;
    max-width: 440px;
    padding: var(--sp-2xl);
    position: relative;
    transform: scale(0.95);
    transition: transform var(--trans-base);
    text-align: center;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: var(--sp-md);
    right: var(--sp-md);
    background: none;
    border: none;
    color: var(--text-sec);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: var(--sp-xs);
    transition: color var(--trans-fast);
}

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

.modal-info {
    font-size: 0.85rem;
    margin: var(--sp-lg) 0;
    padding: var(--sp-md);
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--rad-md);
    border: 1px solid var(--border-subtle);
}

.input-group {
    text-align: left;
    margin: var(--sp-lg) 0;
}

.input-group label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-sec);
    margin-bottom: var(--sp-xs);
}

.input-group input {
    width: 100%;
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: var(--sp-md);
    border-radius: var(--rad-md);
    font-family: var(--font-mono);
    font-size: 1.1rem;
    outline: none;
    transition: border-color var(--trans-fast);
}

.input-group input:focus {
    border-color: var(--accent-cyan);
}

.modal-nft-preview {
    display: flex;
    align-items: center;
    gap: var(--sp-md);
    background: var(--bg-base);
    padding: var(--sp-sm);
    border-radius: var(--rad-md);
    border: 1px solid var(--border-subtle);
    margin-top: var(--sp-lg);
}

.modal-nft-preview .thumb {
    width: 64px;
    height: 64px;
    border-radius: var(--rad-sm);
    background: var(--bg-raised);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.modal-nft-preview .details {
    text-align: left;
}

.modal-nft-preview h4 {
    font-size: 1rem;
    margin: 0;
}

.modal-nft-preview p {
    font-size: 0.8rem;
    color: var(--text-sec);
    margin: 0;
    font-family: var(--font-mono);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: var(--sp-lg);
    right: var(--sp-lg);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: var(--sp-sm);
    pointer-events: none;
}

.toast {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: var(--sp-md) var(--sp-lg);
    border-radius: var(--rad-md);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    pointer-events: auto;
    animation: slideInRight 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.toast.success {
    border-left: 4px solid var(--color-success);
}

.toast.error {
    border-left: 4px solid var(--color-error);
}

.toast.info {
    border-left: 4px solid var(--accent-cyan);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ── Portfolio states ───────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: var(--sp-3xl) var(--sp-lg);
    background: var(--bg-surface);
    border: 1px dashed var(--border-subtle);
    border-radius: var(--rad-xl);
    max-width: 600px;
    margin: 0 auto;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: var(--sp-md);
    opacity: 0.7;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: var(--sp-sm);
}

.empty-state p {
    color: var(--text-sec);
    margin-bottom: var(--sp-lg);
}