:root {
    --retro-font-heading: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
    --retro-font-body: "Space Grotesk", "IBM Plex Mono", "Courier New", monospace;
    --retro-midnight: #141824;
    --retro-ink: #0b0f1c;
    --retro-panel: rgba(20, 26, 43, 0.72);
    --retro-accent: #f6c945;
    --retro-accent-dark: #d5a821;
    --retro-secondary: #7fffd4;
    --retro-muted: #b8c1ec;
    --retro-shadow: rgba(0, 0, 0, 0.35);
    --retro-body-text: #f8f9ff;
    --retro-contrast-text: #101425;
    --retro-header-bg: rgba(6, 11, 23, 0.65);
    --retro-panel-bg: rgba(6, 11, 23, 0.55);
    --retro-panel-border: rgba(246, 201, 69, 0.12);
    --retro-card-border: rgba(246, 201, 69, 0.15);
    --retro-card-header-bg: rgba(246, 201, 69, 0.12);
    --retro-card-header-border: rgba(246, 201, 69, 0.2);
    --retro-list-hover-bg: rgba(246, 201, 69, 0.16);
    --retro-list-hover-text: var(--retro-contrast-text);
    --retro-banner-bg: rgba(10, 14, 25, 0.85);
    --retro-banner-border: rgba(246, 201, 69, 0.25);
    --retro-input-bg: rgba(6, 11, 23, 0.65);
    --retro-input-border: rgba(246, 201, 69, 0.3);
    --retro-input-focus-bg: rgba(6, 11, 23, 0.9);
    --retro-input-focus-shadow: rgba(246, 201, 69, 0.25);
    --retro-outline-border: rgba(246, 201, 69, 0.6);
    --retro-outline-hover-bg: rgba(246, 201, 69, 0.15);
    --retro-ticker-border: rgba(246, 201, 69, 0.25);
    --retro-ticker-bg: rgba(6, 11, 23, 0.7);
    --retro-gradient-highlight: rgba(246, 201, 69, 0.15);
    --retro-gradient-accent: rgba(127, 255, 212, 0.1);
    --retro-footer-bg: rgba(6, 11, 23, 0.75);
    --retro-border-accent: rgba(246, 201, 69, 0.45);
    --retro-link: var(--retro-secondary);
    --retro-listing-border: rgba(127, 255, 212, 0.2);
    --retro-listing-header-bg: rgba(127, 255, 212, 0.1);
    --retro-listing-header-border: rgba(127, 255, 212, 0.2);
    --retro-listing-footer-bg: rgba(127, 255, 212, 0.08);
    --retro-alert-bg: rgba(127, 255, 212, 0.12);
    --retro-alert-border: rgba(127, 255, 212, 0.3);
    --retro-alert-danger-bg: rgba(220, 53, 69, 0.12);
    --retro-alert-danger-border: rgba(220, 53, 69, 0.35);
}

body[data-theme="sunset"] {
    --retro-midnight: #2a102b;
    --retro-ink: #190814;
    --retro-panel: rgba(44, 17, 36, 0.78);
    --retro-accent: #ff8f5a;
    --retro-accent-dark: #d36b2a;
    --retro-secondary: #ff6ac1;
    --retro-muted: #ffd6e8;
    --retro-body-text: #fff2f0;
    --retro-contrast-text: #2a102b;
    --retro-header-bg: rgba(36, 12, 30, 0.82);
    --retro-panel-bg: rgba(36, 12, 30, 0.68);
    --retro-panel-border: rgba(255, 143, 90, 0.24);
    --retro-card-border: rgba(255, 143, 90, 0.2);
    --retro-card-header-bg: rgba(255, 143, 90, 0.24);
    --retro-card-header-border: rgba(255, 143, 90, 0.38);
    --retro-list-hover-bg: rgba(255, 143, 90, 0.3);
    --retro-list-hover-text: #2a102b;
    --retro-banner-bg: rgba(48, 18, 37, 0.88);
    --retro-banner-border: rgba(255, 143, 90, 0.36);
    --retro-input-bg: rgba(36, 12, 30, 0.78);
    --retro-input-border: rgba(255, 143, 90, 0.42);
    --retro-input-focus-bg: rgba(36, 12, 30, 0.92);
    --retro-input-focus-shadow: rgba(255, 143, 90, 0.3);
    --retro-outline-border: rgba(255, 143, 90, 0.72);
    --retro-outline-hover-bg: rgba(255, 143, 90, 0.26);
    --retro-ticker-border: rgba(255, 143, 90, 0.4);
    --retro-ticker-bg: rgba(36, 12, 30, 0.82);
    --retro-gradient-highlight: rgba(255, 143, 90, 0.28);
    --retro-gradient-accent: rgba(255, 106, 193, 0.2);
    --retro-footer-bg: rgba(36, 12, 30, 0.88);
    --retro-border-accent: rgba(255, 143, 90, 0.52);
    --retro-link: #ff6ac1;
    --retro-listing-border: rgba(255, 106, 193, 0.28);
    --retro-listing-header-bg: rgba(255, 106, 193, 0.2);
    --retro-listing-header-border: rgba(255, 106, 193, 0.38);
    --retro-listing-footer-bg: rgba(255, 106, 193, 0.18);
    --retro-alert-bg: rgba(255, 106, 193, 0.24);
    --retro-alert-border: rgba(255, 106, 193, 0.42);
    --retro-alert-danger-bg: rgba(219, 63, 91, 0.2);
    --retro-alert-danger-border: rgba(219, 63, 91, 0.42);
}

body[data-theme="oasis"] {
    --retro-midnight: #001f29;
    --retro-ink: #001018;
    --retro-panel: rgba(0, 32, 43, 0.78);
    --retro-accent: #4cdfff;
    --retro-accent-dark: #07b0d9;
    --retro-secondary: #a4f870;
    --retro-muted: #9ed4f0;
    --retro-body-text: #e7fbff;
    --retro-contrast-text: #002933;
    --retro-header-bg: rgba(0, 27, 38, 0.8);
    --retro-panel-bg: rgba(0, 32, 43, 0.65);
    --retro-panel-border: rgba(76, 223, 255, 0.22);
    --retro-card-border: rgba(76, 223, 255, 0.18);
    --retro-card-header-bg: rgba(76, 223, 255, 0.18);
    --retro-card-header-border: rgba(76, 223, 255, 0.34);
    --retro-list-hover-bg: rgba(164, 248, 112, 0.25);
    --retro-list-hover-text: #002933;
    --retro-banner-bg: rgba(0, 36, 49, 0.88);
    --retro-banner-border: rgba(76, 223, 255, 0.32);
    --retro-input-bg: rgba(0, 27, 38, 0.72);
    --retro-input-border: rgba(76, 223, 255, 0.36);
    --retro-input-focus-bg: rgba(0, 27, 38, 0.92);
    --retro-input-focus-shadow: rgba(76, 223, 255, 0.28);
    --retro-outline-border: rgba(76, 223, 255, 0.68);
    --retro-outline-hover-bg: rgba(76, 223, 255, 0.22);
    --retro-ticker-border: rgba(76, 223, 255, 0.36);
    --retro-ticker-bg: rgba(0, 27, 38, 0.82);
    --retro-gradient-highlight: rgba(76, 223, 255, 0.22);
    --retro-gradient-accent: rgba(164, 248, 112, 0.18);
    --retro-footer-bg: rgba(0, 27, 38, 0.88);
    --retro-border-accent: rgba(76, 223, 255, 0.5);
    --retro-link: #a4f870;
    --retro-listing-border: rgba(76, 223, 255, 0.28);
    --retro-listing-header-bg: rgba(76, 223, 255, 0.2);
    --retro-listing-header-border: rgba(76, 223, 255, 0.38);
    --retro-listing-footer-bg: rgba(76, 223, 255, 0.18);
    --retro-alert-bg: rgba(76, 223, 255, 0.22);
    --retro-alert-border: rgba(76, 223, 255, 0.38);
    --retro-alert-danger-bg: rgba(237, 88, 111, 0.2);
    --retro-alert-danger-border: rgba(237, 88, 111, 0.42);
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--retro-font-body);
    background: radial-gradient(circle at top left, var(--retro-gradient-highlight), transparent 40%),
        radial-gradient(circle at bottom right, var(--retro-gradient-accent), transparent 45%),
        linear-gradient(135deg, var(--retro-midnight), var(--retro-ink));
    color: var(--retro-body-text);
    min-height: 100vh;
    transition: background 0.4s ease, color 0.4s ease;
}

.bg-midnight {
    background-color: transparent;
}

.text-amber {
    color: var(--retro-accent) !important;
}

.text-muted {
    color: rgba(184, 193, 236, 0.65) !important;
}

.bg-amber {
    background-color: var(--retro-accent) !important;
    color: var(--retro-contrast-text) !important;
}

.text-pastel {
    color: var(--retro-muted) !important;
}

.border-amber {
    border-color: var(--retro-border-accent) !important;
}

a,
.list-group-item-action {
    color: var(--retro-link);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover,
a:focus {
    color: var(--retro-accent);
    text-decoration: underline;
}

.page-wrapper {
    backdrop-filter: blur(6px);
}

.retro-header {
    background: var(--retro-header-bg);
}

.retro-card.card {
    background: var(--retro-panel);
    border: 1px solid var(--retro-card-border);
    border-radius: 18px;
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

.retro-card .card-header {
    background: var(--retro-card-header-bg);
    border-bottom: 1px solid var(--retro-card-header-border);
    letter-spacing: 0.08em;
    font-family: var(--retro-font-heading);
    color: var(--retro-accent);
}

.retro-card .card-body {
    color: var(--retro-muted);
}

.retro-list .list-group-item {
    background: transparent;
    border: 0;
    color: var(--retro-muted);
    letter-spacing: 0.04em;
    font-size: 0.95rem;
    transition: transform 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.retro-list-item:hover,
.retro-list-item:focus {
    background: var(--retro-list-hover-bg);
    color: var(--retro-list-hover-text);
    transform: translateX(4px);
}

.retro-banner {
    background: var(--retro-banner-bg);
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--retro-banner-border);
    padding: 0.75rem;
}

.retro-input.form-control,
.retro-input.form-select {
    background: var(--retro-input-bg);
    border: 1px solid var(--retro-input-border);
    color: var(--retro-body-text);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.retro-input.form-control:focus,
.retro-input.form-select:focus {
    background: var(--retro-input-focus-bg);
    color: var(--retro-body-text);
    border-color: var(--retro-accent);
    box-shadow: 0 0 0 0.25rem var(--retro-input-focus-shadow);
}

.btn-amber {
    background: linear-gradient(135deg, var(--retro-accent), var(--retro-accent-dark));
    color: var(--retro-contrast-text);
    font-weight: 600;
    border: none;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 0 10px 25px -12px var(--retro-shadow);
}

.btn-amber:hover,
.btn-amber:focus {
    color: var(--retro-contrast-text);
    background: linear-gradient(135deg, var(--retro-accent-dark), var(--retro-accent));
}

.btn-outline-amber {
    border: 1px solid var(--retro-outline-border);
    color: var(--retro-accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.btn-outline-amber:hover,
.btn-outline-amber:focus {
    background: var(--retro-outline-hover-bg);
    color: var(--retro-contrast-text);
}

.retro-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.retro-panel {
    background: var(--retro-panel-bg);
    border: 1px solid var(--retro-panel-border);
    border-radius: 18px;
    padding: 1.5rem;
    box-shadow: 0 14px 28px -18px var(--retro-shadow);
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

.retro-ticker {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--retro-ticker-border);
    border-radius: 999px;
    background: var(--retro-ticker-bg);
}

.retro-ticker-track {
    display: inline-flex;
    gap: 2rem;
    padding: 0.75rem 2rem;
    animation: retro-scroll 18s linear infinite;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--retro-muted);
}

@keyframes retro-scroll {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

.retro-footer {
    background: var(--retro-footer-bg);
}

.retro-footer p {
    letter-spacing: 0.08em;
}

.tracking-tight {
    letter-spacing: 0.38em;
}

.listing-card {
    background: var(--retro-panel);
    border: 1px solid var(--retro-listing-border);
}

.listing-card .card-header {
    background: var(--retro-listing-header-bg);
    border-bottom: 1px solid var(--retro-listing-header-border);
    color: var(--retro-secondary);
    letter-spacing: 0.05em;
}

.listing-card .card-body {
    color: var(--retro-body-text);
}

.listing-card .card-footer {
    background: var(--retro-listing-footer-bg);
    border-top: 1px solid var(--retro-listing-header-border);
}

.listing-media,
.listing-image-preview-wrapper {
    border: 1px dashed var(--retro-listing-border);
    border-radius: 14px;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.15);
    text-align: center;
}

.listing-media img,
.listing-image-preview-wrapper img {
    max-width: 100%;
    height: auto;
}

.listing-card-premium {
    border-color: #f8d34c;
    box-shadow: 0 0.75rem 1.5rem rgba(248, 211, 76, 0.25);
}

.listing-card-premium .card-header {
    background: rgba(248, 211, 76, 0.15);
}

.listing-card-premium .badge {
    letter-spacing: 0.1em;
}

.premium-featured .retro-card {
    border-color: #f8d34c;
}

.alert-retro {
    background: var(--retro-alert-bg);
    border: 1px solid var(--retro-alert-border);
    color: var(--retro-body-text);
    border-radius: 16px;
    letter-spacing: 0.05em;
}

.alert-retro-danger {
    background: var(--retro-alert-danger-bg);
    border-color: var(--retro-alert-danger-border);
}

.form-label {
    letter-spacing: 0.1em;
}

.sticky-lg-top {
    top: 6rem;
}

.theme-switcher {
    display: inline-flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-start;
}

.theme-switcher label {
    font-size: 0.75rem;
    letter-spacing: 0.18em;
}

.theme-select {
    min-width: 170px;
}

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

.dashboard-grid .retro-card {
    min-height: 100%;
}

.dashboard-grid .badge {
    font-size: 0.85rem;
}

.affiliate-link-group .form-control {
    font-family: 'IBM Plex Mono', 'Space Grotesk', monospace;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
}

.affiliate-link-group .btn {
    white-space: nowrap;
}

.progress {
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    height: 0.5rem;
}

.progress-bar.bg-amber {
    background-color: var(--retro-accent) !important;
    color: var(--retro-contrast-text);
}

@media (max-width: 991.98px) {
    .sticky-lg-top {
        position: static !important;
    }

    .retro-ticker-track {
        animation-duration: 24s;
    }

    .theme-switcher {
        align-items: stretch;
    }
}

@media (prefers-reduced-motion: reduce) {
    .retro-ticker-track {
        animation: none;
    }

    .retro-list-item,
    .btn-amber,
    .btn-outline-amber,
    body {
        transition: none;
    }
}
