/* StarNova Enterprise Tactical CSS & Standalone Utility Framework */
*, ::before, ::after {
    box-sizing: border-box;
    border-width: 0;
    border-style: solid;
    border-color: #1e293b;
    margin: 0;
    padding: 0;
}

:root {
    --color-space-950: #030712;
    --color-space-900: #0b0f19;
    --color-space-850: #111827;
    --color-space-800: #1f293d;
    --color-space-700: #334155;
    --color-cyan-glow: #06b6d4;
    --color-emerald-glow: #10b981;
    --color-amber-glow: #f59e0b;
    --color-rose-glow: #f43f5e;
    --color-violet-glow: #8b5cf6;
}

body {
    background-color: #030712;
    color: #e2e8f0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: clip;
    position: relative;
}

/* CRT Scanline Ambient Effect */
body::after {
    content: " ";
    display: block;
    position: fixed;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    z-index: 40;
    background-size: 100% 3px, 6px 100%;
    pointer-events: none;
    opacity: 0.75;
}

.starnova-grid {
    background-size: 40px 40px;
    background-image: 
        linear-gradient(to right, rgba(56, 189, 248, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(56, 189, 248, 0.03) 1px, transparent 1px);
}

/* Layout Utilities */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }
.grid { display: grid; }
.block { display: block; }
.inline-block { display: inline-block; }
.hidden { display: none; }

.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }

.min-h-screen { min-height: 100vh; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.w-auto { width: auto; }
.h-auto { height: auto; }
.max-w-md { max-width: 28rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-7xl { max-width: 80rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

.w-16 { width: 4rem; }
.w-20 { width: 5rem; }
.w-24 { width: 6rem; }
.w-48 { width: 12rem; }
.w-2\.5 { width: 0.625rem; }
.h-2\.5 { height: 0.625rem; }
.w-3 { width: 0.75rem; }
.h-3 { height: 0.75rem; }
.w-2 { width: 0.5rem; }
.h-2 { height: 0.5rem; }
.h-1\.5 { height: 0.375rem; }

/* Grid Columns */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

@media (min-width: 768px) {
    .md\:block { display: block !important; }
    .md\:hidden { display: none !important; }
    .md\:flex { display: flex !important; }
    .md\:inline { display: inline !important; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .md\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .md\:col-span-1 { grid-column: span 1 / span 1; }
    .md\:col-span-4 { grid-column: span 4 / span 4; }
    .md\:flex-row { flex-direction: row; }
}

@media (min-width: 1024px) {
    .lg\:block { display: block !important; }
    .lg\:hidden { display: none !important; }
    .lg\:flex { display: flex !important; }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .lg\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .lg\:col-span-5 { grid-column: span 5 / span 5; }
    .lg\:flex-row { flex-direction: row; }
}

/* Spacing & Gaps */
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.p-2 { padding: 0.5rem; }
.p-2\.5 { padding: 0.625rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-2\.5 { padding-left: 0.625rem; padding-right: 0.625rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }

.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.ml-1 { margin-left: 0.25rem; }
.ml-6 { margin-left: 1.5rem; }
.pt-2 { padding-top: 0.5rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pb-3 { padding-bottom: 0.75rem; }
.my-2 { margin-top: 0.5rem; margin-bottom: 0.5rem; }

.space-y-1 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.25rem; }
.space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.5rem; }
.space-y-3 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.75rem; }
.space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: 1rem; }
.space-y-6 > :not([hidden]) ~ :not([hidden]) { margin-top: 1.5rem; }
.space-x-2 > :not([hidden]) ~ :not([hidden]) { margin-left: 0.5rem; }

/* Colors & Backgrounds */
.bg-slate-950 { background-color: #030712; }
.bg-slate-900 { background-color: #0f172a; }
.bg-slate-900\/80 { background-color: rgba(15, 23, 42, 0.8); }
.bg-slate-900\/90 { background-color: rgba(15, 23, 42, 0.9); }
.bg-slate-900\/95 { background-color: rgba(15, 23, 42, 0.95); }
.bg-slate-900\/40 { background-color: rgba(15, 23, 42, 0.4); }
.bg-slate-800 { background-color: #1e293b; }
.bg-slate-800\/80 { background-color: rgba(30, 41, 59, 0.8); }
.bg-slate-700 { background-color: #334155; }
.bg-slate-400 { background-color: #94a3b8; }
.bg-white { background-color: #ffffff; }

.bg-cyan-950 { background-color: #083344; }
.bg-cyan-950\/80 { background-color: rgba(8, 51, 68, 0.8); }
.bg-cyan-950\/60 { background-color: rgba(8, 51, 68, 0.6); }
.bg-cyan-950\/20 { background-color: rgba(8, 51, 68, 0.2); }
.bg-cyan-900 { background-color: #164e63; }
.bg-cyan-600 { background-color: #0891b2; }
.bg-cyan-500 { background-color: #06b6d4; }
.bg-cyan-400 { background-color: #22d3ee; }

.bg-emerald-950 { background-color: #022c22; }
.bg-emerald-950\/80 { background-color: rgba(2, 44, 34, 0.8); }
.bg-emerald-900 { background-color: #064e3b; }
.bg-emerald-600 { background-color: #059669; }
.bg-emerald-500 { background-color: #10b981; }
.bg-emerald-400 { background-color: #34d399; }

.bg-rose-950 { background-color: #4c0519; }
.bg-rose-950\/80 { background-color: rgba(76, 5, 25, 0.8); }
.bg-rose-950\/70 { background-color: rgba(76, 5, 25, 0.7); }
.bg-rose-900 { background-color: #881337; }
.bg-rose-700 { background-color: #be123c; }
.bg-rose-600 { background-color: #e11d48; }
.bg-rose-500 { background-color: #f43f5e; }
.bg-rose-400 { background-color: #fb7185; }

.bg-amber-950 { background-color: #451a03; }
.bg-amber-900 { background-color: #78350f; }
.bg-amber-700 { background-color: #b45309; }
.bg-amber-500 { background-color: #f59e0b; }
.bg-amber-400 { background-color: #fbbf24; }

.bg-violet-950 { background-color: #2e1065; }
.bg-violet-500 { background-color: #8b5cf6; }

/* Text Colors */
.text-slate-100 { color: #f1f5f9; }
.text-slate-200 { color: #e2e8f0; }
.text-slate-300 { color: #cbd5e1; }
.text-slate-400 { color: #94a3b8; }
.text-slate-500 { color: #64748b; }
.text-slate-600 { color: #475569; }
.text-slate-700 { color: #334155; }
.text-white { color: #ffffff; }

.text-cyan-400 { color: #38bdf8; }
.text-cyan-300 { color: #7dd3fc; }
.text-cyan-200 { color: #bae6fd; }

.text-emerald-400 { color: #34d399; }
.text-emerald-300 { color: #6ee7b7; }
.text-emerald-200 { color: #a7f3d0; }

.text-amber-400 { color: #fbbf24; }
.text-amber-300 { color: #fcd34d; }
.text-amber-200 { color: #fde68a; }

.text-rose-500 { color: #f43f5e; }
.text-rose-400 { color: #fb7185; }
.text-rose-300 { color: #fda4af; }
.text-rose-200 { color: #fecdd3; }

.text-violet-400 { color: #c084fc; }
.text-violet-300 { color: #d8b4fe; }

/* Borders & Radius */
.border { border-width: 1px; }
.border-2 { border-width: 2px; }
.border-b { border-bottom-width: 1px; }
.border-t { border-top-width: 1px; }

.border-slate-800 { border-color: #1e293b; }
.border-slate-800\/80 { border-color: rgba(30, 41, 59, 0.8); }
.border-slate-800\/60 { border-color: rgba(30, 41, 59, 0.6); }
.border-slate-700 { border-color: #334155; }
.border-slate-700\/60 { border-color: rgba(51, 65, 85, 0.6); }
.border-cyan-900 { border-color: #164e63; }
.border-cyan-900\/40 { border-color: rgba(22, 78, 99, 0.4); }
.border-cyan-800 { border-color: #155e75; }
.border-cyan-700 { border-color: #0e7490; }
.border-cyan-700\/60 { border-color: rgba(14, 116, 144, 0.6); }
.border-cyan-500 { border-color: #06b6d4; }
.border-cyan-500\/50 { border-color: rgba(6, 182, 212, 0.5); }
.border-cyan-500\/40 { border-color: rgba(6, 182, 212, 0.4); }
.border-cyan-500\/30 { border-color: rgba(6, 182, 212, 0.3); }
.border-cyan-400 { border-color: #38bdf8; }

.border-emerald-800 { border-color: #065f46; }
.border-emerald-700 { border-color: #047857; }
.border-emerald-500 { border-color: #10b981; }

.border-rose-950 { border-color: #4c0519; }
.border-rose-900 { border-color: #881337; }
.border-rose-900\/60 { border-color: rgba(136, 19, 55, 0.6); }
.border-rose-900\/50 { border-color: rgba(136, 19, 55, 0.5); }
.border-rose-800 { border-color: #9f1239; }
.border-rose-700 { border-color: #be123c; }
.border-rose-500 { border-color: #f43f5e; }

.border-amber-800 { border-color: #92400e; }
.border-amber-700 { border-color: #b45309; }
.border-transparent { border-color: transparent; }

.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }

.divide-y > :not([hidden]) ~ :not([hidden]) {
    border-top-width: 1px;
    border-color: #1e293b;
}

/* Typography */
.font-sans { font-family: system-ui, -apple-system, sans-serif; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }
.font-semibold { font-weight: 600; }

.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-\[10px\] { font-size: 10px; }
.text-\[11px\] { font-size: 11px; }

.tracking-wide { letter-spacing: 0.025em; }
.tracking-wider { letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.1em; }

.uppercase { text-transform: uppercase; }
.capitalize { text-transform: capitalize; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.italic { font-style: italic; }

/* Positioning & Effects */
.relative { position: relative; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.top-0 { top: 0; }
.z-50 { z-index: 50; }
.overflow-hidden { overflow: hidden; }
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }
.transition { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.duration-300 { transition-duration: 300ms; }

.backdrop-blur-md { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }

/* Animations */
@keyframes pulse {
    50% { opacity: .5; }
}
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

@keyframes spin {
    to { transform: rotate(360deg); }
}
.animate-spin { animation: spin 1s linear infinite; }

/* Custom HUD Panel */
.hud-panel {
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(56, 189, 248, 0.25);
    box-shadow: 0 4px 25px -2px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(6, 182, 212, 0.06);
    transition: border-color 0.5s ease, box-shadow 0.5s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.hud-panel:hover {
    border-color: rgba(56, 189, 248, 0.55);
    box-shadow: 0 8px 30px -4px rgba(6, 182, 212, 0.25), inset 0 0 25px rgba(6, 182, 212, 0.12);
}

.building-card {
    transition: border-color 0.5s ease, box-shadow 0.5s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.blueprint-card {
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.1) 0%, transparent 80%),
        linear-gradient(rgba(56, 189, 248, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.05) 1px, transparent 1px);
    background-size: 100% 100%, 16px 16px, 16px 16px;
}

/* Hover States */
.hover\:bg-cyan-500:hover { background-color: #06b6d4; }
.hover\:bg-cyan-900:hover { background-color: #164e63; }
.hover\:bg-cyan-950\/60:hover { background-color: rgba(8, 51, 68, 0.6); }
.hover\:text-cyan-300:hover { color: #7dd3fc; }
.hover\:text-white:hover { color: #ffffff; }
.hover\:underline:hover { text-decoration-line: underline; }
.hover\:border-cyan-800:hover { border-color: #155e75; }
.hover\:border-cyan-500:hover { border-color: #06b6d4; }
.hover\:border-cyan-500\/50:hover { border-color: rgba(6, 182, 212, 0.5); }
.hover\:border-cyan-500\/60:hover { border-color: rgba(6, 182, 212, 0.6); }
.focus\:border-cyan-400:focus { border-color: #38bdf8; outline: 2px solid transparent; outline-offset: 2px; }
.focus\:outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; }

/* Tabular numbers for stable zero-jitter text rendering */
.tabular-nums, #ticker-metal, #ticker-crystal, #ticker-deuterium, .font-mono {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* Modal, Inset & Admin Dropdown Utilities */
.inset-0 { inset: 0; top: 0; right: 0; bottom: 0; left: 0; }
.z-50 { z-index: 50; }
.z-\[9999\] { z-index: 9999; }
.backdrop-blur-sm { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.backdrop-blur-md { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.bg-black\/80 { background-color: rgba(0, 0, 0, 0.8); }
.bg-black\/85 { background-color: rgba(0, 0, 0, 0.85); }
.bg-slate-950\/90 { background-color: rgba(2, 6, 23, 0.9); }
.bg-slate-950\/95 { background-color: rgba(2, 6, 23, 0.95); }
.bg-slate-950\/98 { background-color: rgba(2, 6, 23, 0.98); }
.admin-dropdown-container { position: relative; }
.admin-dropdown-menu { display: none; }
.admin-dropdown-container:hover .admin-dropdown-menu { display: block; }
.scrollbar-thin { scrollbar-width: thin; }
