/* GameAP UI - Arix-style glassmorphism theme.
   Loaded from /ui/theme.css after the panel's own stylesheets. */

:root,
html.dark {
    --gameap-surface: #1C1610;
    --gameap-surface-raised: #241C14;
    --gameap-surface-overlay: #2A2118;
    --gameap-surface-hover: #33261A;
    --gameap-scrim: rgba(8, 5, 3, 0.72);

    --gameap-border: #3A2C1F;
    --gameap-border-strong: #4A3826;

    --gameap-text: #F5EEE6;
    --gameap-text-secondary: #C4B3A2;
    --gameap-text-muted: #9C8A78;
    --gameap-text-faint: #7D6C5C;

    --gameap-primary: #F27900;
    --gameap-primary-hover: #FF8A1F;
    --gameap-primary-soft: #2B1A0B;
    --gameap-primary-soft-text: #FFC27A;

    --gameap-success: #22c55e;
    --gameap-success-hover: #16a34a;
    --gameap-success-soft: #10291c;
    --gameap-success-soft-text: #86efac;

    --gameap-danger: #ff253a;
    --gameap-danger-hover: #e01e32;
    --gameap-danger-soft: #2e1018;
    --gameap-danger-soft-text: #fda4af;

    --gameap-warning: #f59e0b;
    --gameap-warning-hover: #d97706;
    --gameap-warning-soft: #2f220c;
    --gameap-warning-soft-text: #fcd34d;

    --gameap-info: #E06A00;
    --gameap-info-hover: #2743d6;
    --gameap-info-soft: #2A1A0B;
    --gameap-info-soft-text: #FFC27A;

    --gameap-chrome: #0F0B08;
    --gameap-chrome-item: #1A130D;
    --gameap-chrome-hover: #2A1F15;

    --gameap-table-header: #1A130D;
    --gameap-tab-accent: #F27900;
    --gameap-ring-subtle: rgba(242, 121, 0, 0.30);
    --gameap-selection-outline: #F27900;
    --gameap-selection-outline-weak: rgba(242, 121, 0, 0.38);

    --gameap-terminal-bg: #090604;
    --gameap-terminal-text: #cdd0e3;
}

html {
    color-scheme: dark;
}

html,
body {
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif !important;
    letter-spacing: 0.015em;
}

body {
    background:
        radial-gradient(1000px 520px at 12% -10%, rgba(242, 121, 0, 0.26), transparent 60%),
        radial-gradient(820px 420px at 100% 0%, rgba(224, 106, 0, 0.14), transparent 55%),
        radial-gradient(700px 380px at 50% 110%, rgba(104, 13, 229, 0.12), transparent 60%),
        repeating-linear-gradient(135deg, rgba(255,255,255,.012) 0 2px, transparent 2px 7px),
        #14100D !important;
    background-attachment: fixed !important;
}

h1, h2, h3, h4 {
    letter-spacing: -0.015em;
}

/* ---------- Cards: glassmorphism ---------- */

html.dark [class*="dark:bg-stone-800"],
html.dark [class*="dark:bg-stone-900"] {
    background: linear-gradient(160deg, rgba(38, 28, 19, 0.72), rgba(20, 16, 12, 0.62)) !important;
    border-color: rgba(242, 150, 60, 0.20) !important;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
}

html.dark [class*="dark:bg-stone-800"][class*="rounded-lg"],
html.dark [class*="dark:bg-stone-800"][class*="rounded-md"],
html.dark [class*="dark:bg-stone-900"][class*="rounded-lg"] {
    transition: transform .18s ease, box-shadow .22s ease, border-color .22s ease;
}

html.dark [class*="dark:bg-stone-800"][class*="rounded-lg"]:hover,
html.dark [class*="dark:bg-stone-800"][class*="rounded-md"]:hover,
html.dark [class*="dark:bg-stone-900"][class*="rounded-lg"]:hover {
    transform: translateY(-2px);
    border-color: rgba(242, 121, 0, 0.55) !important;
    box-shadow:
        0 18px 44px rgba(242, 121, 0, 0.22),
        0 8px 22px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html.dark [class*="dark:hover:bg-stone-900"]:hover,
html.dark [class*="dark:hover:bg-stone-700"]:hover {
    background: rgba(42, 42, 82, 0.65) !important;
}

/* ---------- Buttons ---------- */

.bg-primary {
    background-image: linear-gradient(135deg, #FFB15C 0%, #F27900 55%, #E06A00 100%) !important;
    border: 1px solid rgba(160, 150, 255, 0.28) !important;
    box-shadow: 0 8px 22px rgba(242, 121, 0, 0.35);
    transition: filter .18s ease, box-shadow .18s ease, transform .12s ease;
}

.bg-primary:hover {
    filter: brightness(1.08);
    box-shadow: 0 12px 30px rgba(242, 121, 0, 0.50);
}

.bg-primary:active {
    transform: translateY(1px) scale(.985);
}

.bg-primary-soft {
    background: rgba(242, 121, 0, 0.16) !important;
    border: 1px solid rgba(242, 121, 0, 0.35) !important;
    color: #FFC27A !important;
}

.n-button--primary-type:not(.n-button--text-type) {
    background-image: linear-gradient(135deg, #FFB15C 0%, #F27900 55%, #E06A00 100%) !important;
    border: 1px solid rgba(160, 150, 255, 0.28) !important;
    box-shadow: 0 8px 22px rgba(242, 121, 0, 0.32);
}

.n-button {
    border-radius: 10px !important;
    transition: filter .18s ease, box-shadow .18s ease, transform .12s ease;
}

.n-button:not(.n-button--disabled):active {
    transform: translateY(1px) scale(.985);
}

/* ---------- Inputs ---------- */

.n-input,
.n-base-selection,
.n-input-number {
    background: rgba(12, 13, 33, 0.65) !important;
    border: 1px solid #3A2C1F !important;
    border-radius: 10px !important;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.n-input:focus-within,
.n-base-selection:focus-within,
.n-input-number:focus-within {
    border-color: #F27900 !important;
    box-shadow: 0 0 0 3px rgba(242, 121, 0, 0.25) !important;
}

input,
textarea,
select {
    border-radius: 10px !important;
}

input:focus,
textarea:focus,
select:focus {
    outline: none !important;
    border-color: #F27900 !important;
    box-shadow: 0 0 0 3px rgba(242, 121, 0, 0.25) !important;
}

button {
    border-radius: 10px;
    transition: transform .12s ease, box-shadow .18s ease, filter .18s ease;
}

button:not([disabled]):active {
    transform: translateY(1px) scale(.985);
}

a:hover {
    color: #FFC27A;
}

/* ---------- Tables ---------- */

table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

table thead th {
    text-transform: uppercase;
    letter-spacing: .07em;
    font-size: 11px;
    font-weight: 700;
    color: #9C8A78;
}

table tbody tr:hover {
    background: rgba(242, 121, 0, 0.08);
}

.n-data-table {
    background: transparent !important;
}

.n-data-table .n-data-table-th {
    background: rgba(20, 20, 40, 0.70) !important;
    color: #9C8A78 !important;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.n-data-table .n-data-table-td {
    background: transparent !important;
    border-color: rgba(48, 36, 24, 0.60) !important;
}

.n-data-table .n-data-table-tr:hover .n-data-table-td {
    background: rgba(242, 121, 0, 0.08) !important;
}

/* ---------- Tags / badges ---------- */

.n-tag {
    border-radius: 9999px !important;
    background: rgba(242, 121, 0, 0.14) !important;
    border: 1px solid rgba(242, 121, 0, 0.30) !important;
}

/* ---------- Overlays ---------- */

.n-modal-mask,
.n-drawer-mask {
    background: rgba(8, 5, 3, 0.70) !important;
    backdrop-filter: blur(8px);
}

.n-modal,
.n-drawer {
    background: rgba(20, 20, 40, 0.88) !important;
    border: 1px solid rgba(242, 150, 60, 0.22) !important;
    border-radius: 18px !important;
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.60);
    backdrop-filter: blur(20px) saturate(140%);
}

/* ---------- Scrollbars ---------- */

* {
    scrollbar-width: thin;
    scrollbar-color: #3A2C1F #14100D;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #14100D;
}

::-webkit-scrollbar-thumb {
    background: #3A2C1F;
    border-radius: 8px;
    border: 2px solid #14100D;
}

::-webkit-scrollbar-thumb:hover {
    background: #4A3826;
}

::selection {
    background: #F27900;
    color: #ffffff;
}

/* Login page */
body:has(#email) .n-card {
    max-width: 520px !important;
    margin: 110px auto 40px auto !important;
    background: linear-gradient(165deg, rgba(40, 30, 20, 0.86), rgba(20, 16, 12, 0.90)) !important;
    border: 1px solid rgba(242, 150, 60, 0.28) !important;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 60px rgba(242, 121, 0, 0.10) !important;
}

body:has(#email) .n-card-header {
    background: linear-gradient(135deg, rgba(242, 121, 0, 0.24), rgba(224, 106, 0, 0.10)) !important;
}

body:has(#email) button {
    width: 100% !important;
    display: block !important;
    background-image: linear-gradient(135deg, #FFB15C, #F27900 55%, #E06A00) !important;
    border: 1px solid rgba(255, 200, 140, 0.35) !important;
    color: #14100D !important;
    font-weight: 800;
    box-shadow: 0 10px 26px rgba(242, 121, 0, 0.35);
}

body:has(#email) section[class*="dark:bg-stone-800"] {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}

/* Badges */
.badge-green, .badge-red, .badge-orange, .badge-yellow, .badge-blue {
    border-radius: 9999px !important;
    font-weight: 700 !important;
    padding: 2px 10px !important;
    border: 1px solid transparent;
}

.badge-green {
    background: rgba(34, 197, 94, 0.16) !important;
    color: #86efac !important;
    border-color: rgba(34, 197, 94, 0.38) !important;
}

.badge-red {
    background: rgba(239, 68, 68, 0.16) !important;
    color: #fca5a5 !important;
    border-color: rgba(239, 68, 68, 0.38) !important;
}

.badge-orange, .badge-yellow {
    background: rgba(242, 121, 0, 0.18) !important;
    color: #ffc27a !important;
    border-color: rgba(242, 121, 0, 0.42) !important;
}

.badge-blue {
    background: rgba(251, 146, 60, 0.16) !important;
    color: #ffd7a8 !important;
    border-color: rgba(251, 146, 60, 0.38) !important;
}

/* ---------- Naive UI cards (forms, panels) ---------- */

.n-card {
    background: linear-gradient(160deg, rgba(38, 28, 19, 0.72), rgba(20, 16, 12, 0.66)) !important;
    border: 1px solid rgba(242, 150, 60, 0.20) !important;
    border-radius: 18px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(16px) saturate(140%);
}

.n-card-header,
.n-card-header.g-card-header {
    background: linear-gradient(135deg, rgba(242, 121, 0, 0.28), rgba(224, 106, 0, 0.14)) !important;
    border-bottom: 1px solid rgba(242, 150, 60, 0.20) !important;
    color: #F5EEE6 !important;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.n-card__footer,
.n-card-footer {
    background: rgba(20, 16, 12, 0.55) !important;
    border-top: 1px solid rgba(242, 150, 60, 0.14) !important;
    border-radius: 0 0 18px 18px !important;
}

/* ---------- Rounded everything ---------- */

html.dark [class*="dark:bg-stone-800"],
html.dark [class*="dark:bg-stone-900"] {
    border-radius: 18px !important;
}

html.dark [class*="dark:border-stone-"] {
    border-radius: 16px;
}

.n-modal,
.n-drawer {
    border-radius: 20px !important;
}

button,
input,
textarea,
select,
.n-button,
.n-input,
.n-base-selection {
    border-radius: 12px !important;
}

html.dark [class*="dark:bg-stone-700"],
html.dark [class*="dark:bg-stone-600"] {
    background: linear-gradient(160deg, rgba(44, 33, 22, 0.90), rgba(26, 20, 14, 0.85)) !important;
    border-color: rgba(242, 150, 60, 0.22) !important;
    border-radius: 18px !important;
}

/* ---------- Shell: topbar + sidebar ---------- */

nav.fixed.bg-chrome {
    background: rgba(15, 11, 8, 0.72) !important;
    backdrop-filter: blur(18px) saturate(150%);
    border-bottom: 1px solid rgba(242, 150, 60, 0.16);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

a[class*="bg-chrome-item"] {
    border-radius: 12px !important;
    border: 1px solid rgba(242, 150, 60, 0.10);
    background: linear-gradient(135deg, rgba(32, 24, 17, 0.85), rgba(20, 16, 12, 0.85)) !important;
    margin: 4px 8px;
    width: auto !important;
    transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

a[class*="bg-chrome-item"]:hover {
    transform: translateX(4px);
    background: linear-gradient(135deg, rgba(242, 121, 0, 0.30), rgba(224, 106, 0, 0.18)) !important;
    box-shadow: 0 8px 22px rgba(242, 121, 0, 0.20);
}

/* ---------- Home stat cards ---------- */

a[class*="m-2"][class*="h-28"] {
    background: linear-gradient(160deg, rgba(242, 121, 0, 0.22), rgba(26, 20, 14, 0.72)) !important;
    border: 1px solid rgba(242, 150, 60, 0.32) !important;
    border-radius: 20px !important;
    box-shadow:
        0 16px 40px rgba(242, 121, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
    transition: transform .18s ease, box-shadow .22s ease;
}

a[class*="m-2"][class*="h-28"]:hover {
    transform: translateY(-3px);
    box-shadow:
        0 22px 50px rgba(242, 121, 0, 0.30),
        inset 0 1px 0 rgba(255, 255, 255, 0.10) !important;
}

/* ---------- Console ---------- */

[class*="break-all"][class*="whitespace-pre-wrap"] {
    background: rgba(8, 5, 3, 0.85) !important;
    border: 1px solid rgba(242, 150, 60, 0.18);
    border-radius: 14px !important;
    padding: 14px !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* ---------- Exact GameAP version/daemon card on Home. ---------- */
div.w-full.mt-10.p-3.border,
div[class*="dark:bg-stone-800"][class*="mt-10"][class*="p-3"] {
    display: none !important;
}

/* Utility-colored buttons -> palette */
.bg-red-500, .bg-red-600, .bg-red-700 {
    background-image: linear-gradient(135deg, #ff4d5e, #e01e32) !important;
    border-color: rgba(255, 120, 130, .28) !important;
    color: #fff !important;
    border-radius: 12px !important;
    box-shadow: 0 6px 18px rgba(255, 37, 58, .25);
}

.bg-orange-500, .bg-orange-600, .bg-orange-700 {
    background-image: linear-gradient(135deg, #fbbf24, #f59e0b) !important;
    border-color: rgba(253, 230, 138, .30) !important;
    color: #1a1207 !important;
    border-radius: 12px !important;
    box-shadow: 0 6px 18px rgba(245, 158, 11, .22);
}

.bg-lime-500, .bg-green-500, .bg-emerald-500 {
    background-image: linear-gradient(135deg, #4ade80, #22c55e) !important;
    border-color: rgba(134, 239, 172, .30) !important;
    color: #062213 !important;
    border-radius: 9999px !important;
    box-shadow: 0 4px 14px rgba(34, 197, 94, .22);
}

.bg-stone-700, .bg-stone-600 {
    background: rgba(48, 36, 24, .85) !important;
    border-color: #4A3826 !important;
    color: #F5EEE6 !important;
    border-radius: 12px !important;
}

table a, .content a:not([class*="bg-"]) {
    color: #F5EEE6;
}

/* ---------- Hide upstream GameAP version / channels / support blocks ---------- */

div.w-full.mt-5.p-3:has(a[href*="patreon.com"]),
div.w-full.mt-5.p-3:has(a[href*="boosty.to"]),
div.w-full.mt-5.p-3:has(a[href*="t.me/gameap"]),
div.w-full.mt-5.p-3:has(a[href*="vk.com/gameap"]),
div.w-full.mt-5.p-3:has(a[href*="youtube.com"]),
div.w-full.mt-5.p-3:has(a[href*="reddit.com/r/gameap"]),
div.w-full.mt-5.p-3:has(a[href*="discord.gg"]),
div.w-full.mt-5.p-3:has(a[href*="/docs"]),
div.w-full.mt-5.p-3:has(a[href*="github.com/gameap"]),
div.grid.grid-cols-1.gap-y-6:has(div.sm\:pl-6),
div:has(> div.sm\:pl-6),
div.sm\:pr-6,
div.sm\:pl-6 {
    display: none !important;
}

/* ---------- Flat pass: no shadows, no blur, tighter radii ---------- */

html.dark * {
    box-shadow: none !important;
    text-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

html.dark [class*="dark:bg-stone-800"],
html.dark [class*="dark:bg-stone-900"],
html.dark [class*="dark:bg-stone-700"],
html.dark [class*="dark:bg-stone-600"],
html.dark .n-card {
    border-radius: 12px !important;
}

html.dark a[class*="bg-chrome-item"] {
    border-radius: 10px !important;
}

html.dark a[class*="m-2"][class*="h-28"] {
    border-radius: 14px !important;
}

html.dark .n-modal,
html.dark .n-drawer {
    border-radius: 14px !important;
}

html.dark button,
html.dark input,
html.dark textarea,
html.dark select,
html.dark .n-button,
html.dark .n-input,
html.dark .n-base-selection {
    border-radius: 8px !important;
}

/* Remaining Tailwind palette -> warm theme */
html.dark [class*="text-stone-900"],
html.dark [class*="text-stone-800"],
html.dark [class*="text-stone-700"] {
    color: #F5EEE6 !important;
}

html.dark [class*="text-stone-600"],
html.dark [class*="text-stone-500"],
html.dark [class*="text-stone-400"] {
    color: #B9A793 !important;
}

html.dark [class*="text-stone-300"],
html.dark [class*="text-stone-200"] {
    color: #D9CBBE !important;
}

html.dark [class*="text-lime-"],
html.dark [class*="text-green-"] {
    color: #86efac !important;
}

html.dark [class*="text-red-"] {
    color: #fca5a5 !important;
}

html.dark [class*="text-sky-"],
html.dark [class*="text-blue-"] {
    color: #FFC27A !important;
}

html.dark [class*="text-orange-"],
html.dark [class*="text-amber-"] {
    color: #FFD7A8 !important;
}

html.dark [class*="border-stone-"],
html.dark [class*="divide-stone-"] {
    border-color: #3A2C1F !important;
}

html.dark [class*="bg-stone-100"],
html.dark [class*="bg-stone-50"],
html.dark [class*="bg-stone-200"] {
    background-color: rgba(32, 24, 17, 0.55) !important;
}

/* Responsive polish */
@media (max-width: 640px) {
    #brand-logo {
        max-height: 30px;
        width: auto;
    }

    html.dark a[class*="bg-chrome-item"] {
        margin: 3px 6px;
    }

    .content {
        padding-left: 0 !important;
    }
}

/* Admin action buttons/links -> warm accent */
html.dark [class*="bg-sky-"],
html.dark [class*="bg-blue-"],
html.dark .bg-info,
html.dark .bg-info-hover {
    background-image: linear-gradient(135deg, #FFB15C, #F27900 60%, #E06A00) !important;
    border-color: rgba(255, 200, 140, 0.32) !important;
    color: #14100D !important;
    border-radius: 8px !important;
}

html.dark .bg-danger,
html.dark [class*="bg-red-"] {
    background-image: linear-gradient(135deg, #ff4d5e, #e01e32) !important;
    border-color: rgba(255, 120, 130, 0.28) !important;
    color: #fff !important;
    border-radius: 8px !important;
}

html.dark [class*="text-info"],
html.dark [class*="text-sky-"],
html.dark [class*="text-blue-"] {
    color: #FFC27A !important;
}
