:root {
    --radius: 0.75rem;

    /* Brand accent — San Andreas warm gold */
    --color-brand: #d4a853;
    --color-brand-soft: rgba(212, 168, 83, 0.12);
    --color-brand-glow: rgba(212, 168, 83, 0.25);

    /* Light theme */
    --color-background: #fafaf9;
    --color-foreground: #0a0a0a;
    --color-card: #ffffff;
    --color-card-foreground: #0a0a0a;
    --color-border: #e7e5e4;
    --color-divider: rgba(0, 0, 0, 0.06);
    --color-input: #e7e5e4;
    --color-ring: #a8a29e;
    --color-primary: #1c1917;
    --color-primary-foreground: #fafaf9;
    --color-primary-50: #fafaf9;
    --color-primary-100: #f5f5f4;
    --color-primary-200: #e7e5e4;
    --color-primary-300: #d6d3d1;
    --color-primary-400: #a8a29e;
    --color-primary-500: #78716c;
    --color-primary-600: #57534e;
    --color-primary-700: #44403c;
    --color-primary-800: #292524;
    --color-primary-900: #1c1917;
    --color-muted: #f5f5f4;
    --color-muted-foreground: #78716c;
    --color-accent: #f5f5f4;
    --color-accent-foreground: #0a0a0a;
    --color-destructive: #ef4444;
    --color-destructive-foreground: #ffffff;
    --color-success: #16a34a;
    --color-success-foreground: #ffffff;
    --color-warning: #d97706;
    --color-warning-foreground: #ffffff;
    --color-scrollbar-thumb: #d6d3d1;
    --color-scrollbar-thumb-hover: #a8a29e;
}

.dark {
    --color-background: #0a0a08;
    --color-foreground: #f5f5f0;
    --color-card: #161614;
    --color-card-foreground: #f5f5f0;
    --color-border: #2a2a24;
    --color-divider: rgba(212, 168, 83, 0.08);
    --color-input: #222220;
    --color-ring: #d4a853;
    --color-primary: #f0ede4;
    --color-primary-foreground: #161614;
    --color-primary-50: #fafaf9;
    --color-primary-100: #f0ede4;
    --color-primary-200: #d4d4cc;
    --color-primary-300: #c4b896;
    --color-primary-400: #a8a890;
    --color-primary-500: #7a7a6e;
    --color-primary-600: #5a5a50;
    --color-primary-700: #404038;
    --color-primary-800: #2a2a24;
    --color-primary-900: #161614;
    --color-muted: #1e1e1a;
    --color-muted-foreground: #a8a890;
    --color-accent: #222220;
    --color-accent-foreground: #f5f5f0;
    --color-destructive: #7f1d1d;
    --color-destructive-foreground: #fecaca;
    --color-success: #14532d;
    --color-success-foreground: #86efac;
    --color-warning: #713f12;
    --color-warning-foreground: #fde047;
    --color-scrollbar-thumb: #3a3a32;
    --color-scrollbar-thumb-hover: #4a4a40;
}

/* ── Base ── */
html {
    scroll-behavior: smooth;
}

body {
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

::selection {
    background: var(--color-brand-soft);
    color: var(--color-foreground);
}

/* ── Atmospheric background ── */
.ucp-bg {
    background-color: var(--color-background);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, var(--color-brand-soft), transparent),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(212, 168, 83, 0.04), transparent);
}

.dark .ucp-bg {
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(212, 168, 83, 0.06), transparent),
        radial-gradient(ellipse 50% 30% at 0% 80%, rgba(212, 168, 83, 0.03), transparent),
        radial-gradient(ellipse 40% 25% at 100% 60%, rgba(100, 100, 80, 0.04), transparent);
}

.ucp-auth-bg {
    background-color: var(--color-background);
    background-image:
        radial-gradient(ellipse 70% 50% at 50% 0%, var(--color-brand-soft), transparent 70%),
        radial-gradient(ellipse 50% 40% at 80% 100%, rgba(212, 168, 83, 0.05), transparent);
}

.dark .ucp-auth-bg {
    background-image:
        radial-gradient(ellipse 70% 50% at 50% 0%, rgba(212, 168, 83, 0.08), transparent 70%),
        radial-gradient(ellipse 50% 40% at 20% 100%, rgba(212, 168, 83, 0.04), transparent),
        radial-gradient(ellipse 40% 30% at 80% 80%, rgba(80, 80, 60, 0.06), transparent);
}

/* ── Cards ── */
.ucp-card {
    background: var(--color-card);
    border: 1px solid var(--color-divider);
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.dark .ucp-card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.ucp-card-hover:hover {
    border-color: rgba(212, 168, 83, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(212, 168, 83, 0.06);
    transform: translateY(-1px);
}

.dark .ucp-card-hover:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(212, 168, 83, 0.1);
}

/* ── Welcome banner ── */
.ucp-welcome {
    position: relative;
    overflow: hidden;
}

.ucp-welcome::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--color-brand-soft) 0%, transparent 50%);
    pointer-events: none;
}

.ucp-welcome::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-brand-glow), transparent);
    pointer-events: none;
}

/* ── Navigation ── */
.ucp-nav-item {
    position: relative;
    transition: color 0.15s ease, background-color 0.15s ease;
}

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

.ucp-nav-active {
    background: var(--color-accent) !important;
    color: var(--color-accent-foreground) !important;
}

.ucp-nav-active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, var(--color-brand), rgba(212, 168, 83, 0.5));
}

/* ── Buttons ── */
.ucp-btn-primary {
    background: linear-gradient(135deg, var(--color-brand) 0%, #b8923f 100%);
    color: #1a1508;
    font-weight: 600;
    transition: filter 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.ucp-btn-primary:hover {
    filter: brightness(1.08);
    box-shadow: 0 4px 12px rgba(212, 168, 83, 0.25);
}

.ucp-btn-primary:active {
    transform: scale(0.97);
}

/* ── Form inputs ── */
.ucp-input {
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ucp-input:focus {
    border-color: rgba(212, 168, 83, 0.4) !important;
    box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.12) !important;
    outline: none;
}

/* ── Server status pulse ── */
@keyframes ucp-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50% { opacity: 0.85; box-shadow: 0 0 0 4px rgba(34, 197, 94, 0); }
}

.ucp-status-online {
    animation: ucp-pulse 2s ease-in-out infinite;
}

/* ── Logo glow ── */
.ucp-logo {
    box-shadow: 0 0 0 1px var(--color-divider), 0 2px 8px rgba(212, 168, 83, 0.08);
}

.dark .ucp-logo {
    box-shadow: 0 0 0 1px var(--color-divider), 0 2px 12px rgba(212, 168, 83, 0.12);
}

/* ── Section headings ── */
.ucp-section-title {
    letter-spacing: -0.01em;
}

/* ── Animations ── */
@keyframes fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fade-in 0.25s ease-out;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--color-scrollbar-thumb);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-scrollbar-thumb-hover);
}

/* ── Topbar glass ── */
.ucp-topbar {
    background: color-mix(in srgb, var(--color-background) 82%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* ── Auth card ── */
.ucp-auth-card {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 0 0 1px var(--color-divider);
}

.dark .ucp-auth-card {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--color-divider), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

/* ── Stat cards accent on hover ── */
.ucp-stat-card:hover .ucp-stat-icon {
    transform: scale(1.05);
}

.ucp-stat-icon {
    transition: transform 0.2s ease;
}
