:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #1a1f2e;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-blue: #00d4ff;
    --accent-purple: #9d00ff;
    --accent-green: #00ff9d;
    --accent-red: #ff0033;
    --border-color: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* ── Discreet scrollbar (all scrollable areas) ── */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

*::-webkit-scrollbar {
    width: 4px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.aiwar-layout {
    min-height: 100vh;
    position: relative;
}

/* ── Viewport-based layout visibility (instant, pre-JS, pre-Blazor) ── */
/* Prevents the desktop layout from flashing on narrow viewports during SSR */
@media (max-width: 768px) {
    .aiwar-layout {
        display: none !important;
    }
}

/* Prevents the mobile layout from flashing on wide viewports during SSR */
@media (min-width: 769px) {
    .mobile-layout {
        display: none !important;
    }
}

/* ==================== BACKGROUND ==================== */
.cyber-background {
    position: fixed;
    inset: 0;
    background-color: #080a14;
    pointer-events: none;
    z-index: 0;
}

/* ==================== MAIN WRAPPER ==================== */
.main-wrapper {
    position: relative;
    z-index: 10;
}

/* ==================== NAVIGATION ==================== */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    background-color: rgba(0, 0, 0, 0.6);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    position: relative;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Left: Logo and tagline */
.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    outline: none;
}

.brand *:focus,
.brand *:focus-visible {
    outline: none;
}

.brand-logo {
    height: 2.5rem;
    width: auto;
    filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.3));
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.tagline {
    font-size: 0.75rem;
    color: #9ca3af;
    display: none;
}

@media (min-width: 768px) {
    .tagline {
        display: block;
    }
}

/* Center: Campaign status — absolutely centered in the nav */
.campaign-status {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

@media (min-width: 1024px) {
    .campaign-status {
        display: flex;
    }
}

.status-indicator {
    width: 0.5rem;
    height: 0.5rem;
    background-color: var(--accent-green);
    border-radius: 50%;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.status-text {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Right: Navigation buttons */
.nav-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-btn {
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: all 0.2s;
    border: 1px solid transparent;
    text-decoration: none;
    color: #9ca3af;
    cursor: pointer;
}

.nav-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color);
}

.nav-btn-active {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.nav-btn-patreon {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.nav-btn-patreon:hover {
    background-color: rgba(0, 212, 255, 0.1);
}

.nav-btn-desktop {
    display: none;
}

@media (min-width: 768px) {
    .nav-btn-desktop {
        display: block;
    }
}

.nav-btn-legal {
    font-size: 0.75rem;
    color: #6b7280;
}

.nav-btn-legal:hover {
    color: #9ca3af;
}

.nav-btn-large {
    display: none;
}

@media (min-width: 1024px) {
    .nav-btn-large {
        display: block;
    }
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    padding-top: 4rem;
    min-height: 100vh;
}

/* ==================== LEGAL PAGES ==================== */
.legal-page {
    display: flex;
    justify-content: center;
    padding: 2rem 1.5rem 4rem;
}

.legal-container {
    max-width: 720px;
    width: 100%;
}

.legal-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.legal-updated {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.legal-section {
    margin-bottom: 2rem;
}

.legal-section h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    padding-bottom: 0.375rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.legal-section h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent-blue);
    margin: 1rem 0 0.375rem;
}

.legal-section p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 0.5rem;
}

.legal-section ul {
    margin: 0.5rem 0 0.75rem 1.25rem;
    padding: 0;
}

.legal-section li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 0.25rem;
}

.legal-section li strong {
    color: var(--text-primary);
}

.legal-section a {
    color: var(--accent-blue);
    text-decoration: none;
}

.legal-section a:hover {
    text-decoration: underline;
}

/* ==================== ERROR UI ==================== */
#blazor-error-ui {
    background: #dc3545;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: white;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.reload {
    color: white;
    text-decoration: underline;
}

/* ==================== SITE TOUR (Driver.js overrides) ==================== */
.aiwar-tour-popover {
    background: linear-gradient(135deg, #0d1117 0%, #161b2e 100%) !important;
    border: 1px solid rgba(0, 212, 255, 0.3) !important;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.15), 0 8px 32px rgba(0, 0, 0, 0.6) !important;
    color: #ffffff !important;
    border-radius: 10px !important;
    max-width: 380px !important;
}

.aiwar-tour-popover .driver-popover-title {
    color: #00d4ff !important;
    font-size: 1.05rem !important;
    font-weight: 600 !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

.aiwar-tour-popover .driver-popover-description {
    color: #c8c8d0 !important;
    font-size: 0.875rem !important;
    line-height: 1.55 !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

.aiwar-tour-popover .driver-popover-progress-text {
    color: #606070 !important;
    font-size: 0.75rem !important;
}

.aiwar-tour-popover .driver-popover-navigation-btns button {
    background: transparent !important;
    border: 1px solid rgba(0, 212, 255, 0.4) !important;
    color: #00d4ff !important;
    border-radius: 6px !important;
    padding: 6px 16px !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.aiwar-tour-popover .driver-popover-navigation-btns button:hover {
    background: rgba(0, 212, 255, 0.15) !important;
    border-color: #00d4ff !important;
}

.aiwar-tour-popover .driver-popover-navigation-btns .driver-popover-next-btn {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(157, 0, 255, 0.2)) !important;
    border-color: rgba(0, 212, 255, 0.5) !important;
}

.aiwar-tour-popover .driver-popover-navigation-btns .driver-popover-next-btn:hover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.35), rgba(157, 0, 255, 0.35)) !important;
}

.aiwar-tour-popover .driver-popover-close-btn {
    color: #606070 !important;
}

.aiwar-tour-popover .driver-popover-close-btn:hover {
    color: #00d4ff !important;
}

.aiwar-tour-popover .driver-popover-arrow-side-left .driver-popover-arrow,
.aiwar-tour-popover .driver-popover-arrow-side-right .driver-popover-arrow,
.aiwar-tour-popover .driver-popover-arrow-side-top .driver-popover-arrow,
.aiwar-tour-popover .driver-popover-arrow-side-bottom .driver-popover-arrow {
    border-color: rgba(0, 212, 255, 0.3) !important;
}

/* Tour help button in top nav */
.tour-help-btn {
    background: transparent;
    border: 1px solid rgba(0, 212, 255, 0.3);
    color: var(--accent-blue);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tour-help-btn:hover {
    background: rgba(0, 212, 255, 0.12);
    border-color: var(--accent-blue);
}

/* Mobile: show emoji-only tour button in nav-buttons */
.tour-help-btn-mobile {
    display: inline-flex;
    padding: 4px 8px;
}

/* Desktop: hide the mobile button (tour button lives in campaign-status instead) */
@media (min-width: 1024px) {
    .tour-help-btn-mobile {
        display: none;
    }
}