/* ============================================================
   MineStax gold theme — sitewide design layer (2026-07-12)
   Loaded last in <head>: overrides app.css (Tailwind v4) and
   per-template inline <style> blocks.
   Palette: gold #fbbf24 / deep gold #d97706 / white on warm dark.
   ============================================================ */

/* ---- 1. Design tokens ------------------------------------- */
:root {
    /* Tailwind orange-* rewired to the gold scale: every
       text-orange-*, bg-orange-*/xx, from/via/to-orange-*,
       border-orange-*/xx utility across the site follows. */
    --color-orange-300: #fcd34d;
    --color-orange-400: #fbbf24;
    --color-orange-500: #f59e0b;
    --color-orange-600: #d97706;
    --color-orange-700: #b45309;
    --color-orange-900: #78350f;

    /* Site variables used by per-template inline styles */
    --bg-color-dark: #0a0a0a;
    --bg-color: #111111;
    --card-bg: #1a1a1a;
    --card-bg-hover: #1f1f1f;
    --primary: #fbbf24;
    --primary-hover: #fde047;
    --primary-glow: rgba(251, 191, 36, 0.45);
    --border-color: rgba(255, 255, 255, 0.06);

    --gold-100: #fef3c7;
    --gold-200: #fde68a;
    --gold-300: #fcd34d;
    --gold-400: #fbbf24;
    --gold-500: #f59e0b;
    --gold-600: #d97706;
    --ink-on-gold: #221a02;
}

/* ---- 2. Page canvas ------------------------------------------
   Dark: near-black + the classic grid lines + two cool steel
   glows (slate tones — deliberately no warm hue so the page
   never reads brown).
   Light: dimmed gray canvas with dark-tint grid so white cards
   pop clearly off the background. */
body,
body.bg-grid {
    background-color: var(--bg-color-dark);
    background-image:
        radial-gradient(1200px 600px at 50% -12%, rgba(148, 163, 184, 0.06), transparent 60%),
        radial-gradient(900px 500px at 108% 112%, rgba(148, 163, 184, 0.04), transparent 60%),
        linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: auto, auto, 22px 22px, 22px 22px;
    background-attachment: fixed, fixed, scroll, scroll;
}

html.light body,
html.light body.bg-grid {
    background-image:
        radial-gradient(1100px 520px at 50% -10%, rgba(255, 255, 255, 0.85), transparent 65%),
        radial-gradient(900px 480px at 108% 112%, rgba(20, 22, 27, 0.05), transparent 60%),
        linear-gradient(to right, rgba(20, 22, 27, 0.045) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(20, 22, 27, 0.045) 1px, transparent 1px);
}

::selection { background: rgba(251, 191, 36, 0.3); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0e0e0e; }
::-webkit-scrollbar-thumb { background: #2d2d2d; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #3d3d3d; }

:focus-visible { outline: 2px solid rgba(251, 191, 36, 0.55); outline-offset: 2px; }

/* ---- 3. Surfaces ------------------------------------------- */
.glass {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0) 42%),
        rgba(24, 24, 24, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.glass-darker {
    background: rgba(14, 14, 14, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-color: rgba(255, 255, 255, 0.05);
}

/* Cards lift softly and pick up a gold edge on hover */
.stat-card,
.card-lift {
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.stat-card:hover,
.card-lift:hover {
    transform: translateY(-3px);
    border-color: rgba(251, 191, 36, 0.28);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

/* ---- 4. Navigation ----------------------------------------- */
nav .hidden a { position: relative; }
nav .hidden a::after {
    content: "";
    position: absolute;
    left: 12px; right: 12px; bottom: 3px;
    height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, var(--gold-500), var(--gold-300));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}
nav .hidden a:hover::after { transform: scaleX(1); }
nav .hidden a.text-orange-400::after { transform: scaleX(1); }

/* ---- 5. Gold call-to-action surfaces ------------------------
   Yellow needs dark ink for contrast: anywhere the old theme put
   white text on orange, switch the pair to gold + dark ink. */

/* Login button (styled inline + JS hover handlers → !important) */
button[onclick*="'/login'"] {
    background: linear-gradient(135deg, var(--gold-500), var(--gold-400)) !important;
    color: var(--ink-on-gold) !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 14px rgba(251, 191, 36, 0.28) !important;
    transition: all 0.25s ease !important;
}
button[onclick*="'/login'"]:hover {
    background: linear-gradient(135deg, var(--gold-400), var(--gold-300)) !important;
    box-shadow: 0 4px 20px rgba(251, 191, 36, 0.45) !important;
    transform: translateY(-1px);
}

/* Solid gold buttons (search submit etc.) */
.bg-orange-600 {
    background: linear-gradient(135deg, var(--gold-500), var(--gold-400)) !important;
    color: var(--ink-on-gold) !important;
}
.hover\:bg-orange-500:hover {
    background: linear-gradient(135deg, var(--gold-400), var(--gold-300)) !important;
    color: var(--ink-on-gold) !important;
}

/* Active pagination pill */
.pagination-current {
    background: linear-gradient(135deg, var(--gold-500), var(--gold-300)) !important;
    box-shadow: 0 0 14px rgba(251, 191, 36, 0.45) !important;
    color: var(--ink-on-gold) !important;
    font-weight: 700 !important;
}

/* Primary form buttons (login submit etc.) — gold with dark ink */
.btn-primary {
    background: linear-gradient(135deg, var(--gold-500), var(--gold-400)) !important;
    color: var(--ink-on-gold) !important;
    font-weight: 600 !important;
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--gold-400), var(--gold-300)) !important;
    box-shadow: 0 5px 18px rgba(251, 191, 36, 0.35) !important;
}

/* ---- 5b. Gradient utilities missing from compiled app.css ----
   These "to", "via" and "from" classes are referenced by templates
   but were never compiled into app.css, so gradients silently fell
   back to transparent. Defined here in Tailwind v4 format. */
.to-yellow-400 { --tw-gradient-to: var(--color-yellow-400); --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position)); }

/* ---- 5c. Responsive utilities missing from compiled app.css --
   Same story as 5b: referenced in templates, never compiled, so
   grids collapsed to a single column on wide screens. */
@media (min-width: 640px) {
    .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
    .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\:items-center { align-items: center; }
    .md\:gap-4 { gap: 1rem; }
    .md\:gap-6 { gap: 1.5rem; }
    .md\:gap-8 { gap: 2rem; }
    .md\:h-12 { height: 3rem; }
    .md\:h-16 { height: 4rem; }
    .md\:h-20 { height: 5rem; }
    .md\:w-12 { width: 3rem; }
    .md\:w-16 { width: 4rem; }
    .md\:w-20 { width: 5rem; }
    .md\:max-h-96 { max-height: 24rem; }
    .md\:mb-4 { margin-bottom: 1rem; }
    .md\:mb-6 { margin-bottom: 1.5rem; }
    .md\:mb-8 { margin-bottom: 2rem; }
    .md\:mb-16 { margin-bottom: 4rem; }
    .md\:p-4 { padding: 1rem; }
    .md\:p-6 { padding: 1.5rem; }
    .md\:p-8 { padding: 2rem; }
    .md\:pb-4 { padding-bottom: 1rem; }
    .md\:pl-6 { padding-left: 1.5rem; }
    .md\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
    .md\:py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
    .md\:py-8 { padding-top: 2rem; padding-bottom: 2rem; }
    .md\:py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
    .md\:py-12 { padding-top: 3rem; padding-bottom: 3rem; }
    .md\:py-24 { padding-top: 6rem; padding-bottom: 6rem; }
    .md\:space-x-4 > :not(:last-child) { margin-inline-end: 1rem; }
    .md\:space-y-0 > :not(:last-child) { margin-block-end: 0; }
    .md\:space-y-4 > :not(:last-child) { margin-block-end: 1rem; }
    .md\:space-y-6 > :not(:last-child) { margin-block-end: 1.5rem; }
    .md\:text-sm { font-size: 0.875rem; line-height: 1.25rem; }
    .md\:text-base { font-size: 1rem; line-height: 1.5rem; }
    .md\:text-lg { font-size: 1.125rem; line-height: 1.75rem; }
    .md\:text-xl { font-size: 1.25rem; line-height: 1.75rem; }
    .md\:text-2xl { font-size: 1.5rem; line-height: 2rem; }
    .md\:text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
    .md\:text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
    .md\:text-6xl { font-size: 3.75rem; line-height: 1.1; }
}
@media (min-width: 1024px) {
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lg\:flex-row { flex-direction: row; }
    .lg\:items-center { align-items: center; }
    .lg\:justify-between { justify-content: space-between; }
    .lg\:h-24 { height: 6rem; }
    .lg\:w-24 { width: 6rem; }
    .lg\:w-auto { width: auto; }
    .lg\:space-x-8 > :not(:last-child) { margin-inline-end: 2rem; }
    .lg\:text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
    .lg\:text-5xl { font-size: 3rem; line-height: 1.1; }
}
@media (min-width: 1280px) {
    .xl\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .xl\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* ---- 5d. Misc utilities missing from compiled app.css ------- */
.rounded-2xl { border-radius: 1rem; }
.top-1\/2 { top: 50%; }
.left-3\.5 { left: 0.875rem; }
.pr-4 { padding-right: 1rem; }
.-translate-y-1\/2 { transform: translateY(-50%); }
.translate-x-2 { transform: translateX(0.5rem); }

/* ---- 5e. Select controls (anticheat filters etc.) ----------- */
.ac-select {
    background-color: #161616 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border-radius: 0.6rem !important;
    padding: 0.55rem 2.4rem 0.55rem 0.9rem !important;
    font-size: 0.875rem !important;
    min-width: 9.5rem;
    appearance: none !important;
    -webkit-appearance: none !important;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23fbbf24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 0.9rem !important;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.ac-select:hover { border-color: rgba(251, 191, 36, 0.45) !important; background-color: #191919 !important; }
.ac-select:focus { outline: none !important; border-color: rgba(251, 191, 36, 0.55) !important; box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.14) !important; }
.ac-select option { background-color: #161616; color: #fff; }

/* ---- 6. Forms ----------------------------------------------- */
input[type="text"]:focus,
input[type="search"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    border-color: rgba(251, 191, 36, 0.45);
}

input::placeholder { color: rgba(255, 255, 255, 0.35); }

/* ---- 7. Tables & rows --------------------------------------- */
tbody tr { transition: background 0.18s ease; }

/* ---- 9. Custom dropdown (msx-select) ------------------------- */
:root {
    --panel-bg: #161616;
    --panel-line: rgba(255, 255, 255, 0.1);
    --panel-ink: rgba(255, 255, 255, 0.85);
}

.msx-select { position: relative; display: inline-block; }
.msx-btn {
    display: inline-flex; align-items: center; justify-content: space-between;
    gap: 0.6rem; min-width: 10rem;
    background: var(--panel-bg);
    border: 1px solid var(--panel-line);
    color: var(--panel-ink);
    border-radius: 0.6rem;
    padding: 0.55rem 0.9rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}
.msx-btn:hover { border-color: rgba(251, 191, 36, 0.45); }
.msx-btn:focus-visible { outline: none; border-color: rgba(251, 191, 36, 0.55); box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.14); }
.msx-btn > i { font-size: 0.68rem; color: #fbbf24; transition: transform 0.2s ease; flex: none; }
.msx-menu {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 70;
    min-width: 100%; max-height: 300px; overflow-y: auto;
    background: var(--panel-bg);
    border: 1px solid var(--panel-line);
    border-radius: 0.75rem;
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.45);
    padding: 0.35rem;
}
.msx-opt {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    width: 100%; text-align: left;
    padding: 0.5rem 0.75rem; border-radius: 0.5rem;
    font-size: 0.85rem; color: var(--panel-ink);
    background: transparent; border: none; cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}
.msx-opt:hover { background: rgba(251, 191, 36, 0.12); color: #fbbf24; }
.msx-opt.active { color: #fbbf24; font-weight: 600; }
.msx-opt.active::after {
    content: "\f00c";
    font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 0.68rem;
}

/* ---- 10. Theme toggle ---------------------------------------- */
.theme-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; flex: none;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: #fbbf24; font-size: 15px; cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.theme-toggle:hover { border-color: rgba(251, 191, 36, 0.5); transform: rotate(12deg); }
.theme-toggle .moon { display: none; }
html.light .theme-toggle .sun { display: none; }
html.light .theme-toggle .moon { display: inline; }

/* ---- 11. Light theme ------------------------------------------
   The whole site is authored with white-based utilities
   (text-white/80, bg-white/5, border-white/10 ...). All of them
   resolve through --color-white, so flipping that single variable
   to ink inverts text, borders and surface tints coherently. */
html.light {
    --color-white: #171a21;

    --bg-color-dark: #e7eaef;
    --bg-color: #dfe3e9;
    --card-bg: #ffffff;
    --card-bg-hover: #f8f9fb;
    --border-color: rgba(20, 22, 27, 0.1);

    /* Gold text accents need deeper tones for contrast on white */
    --color-orange-300: #f59e0b;
    --color-orange-400: #d97706;
    --color-orange-500: #b45309;
    --color-orange-600: #92400e;
    --color-yellow-400: #ca8a04;

    --panel-bg: #ffffff;
    --panel-line: rgba(20, 22, 27, 0.12);
    --panel-ink: rgba(23, 26, 33, 0.85);
}

html.light body { color: #171a21; }

html.light ::-webkit-scrollbar-track { background: #e8eaee; }
html.light ::-webkit-scrollbar-thumb { background: #c3c7cf; }
html.light ::-webkit-scrollbar-thumb:hover { background: #a9aeb9; }

html.light .glass {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(20, 22, 27, 0.11);
    box-shadow: 0 10px 30px rgba(20, 22, 27, 0.12), 0 1px 3px rgba(20, 22, 27, 0.06);
}
html.light .glass-darker {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(20, 22, 27, 0.1);
    box-shadow: 0 2px 12px rgba(20, 22, 27, 0.08);
}
html.light .stat-card:hover,
html.light .card-lift:hover {
    border-color: rgba(180, 83, 9, 0.35);
    box-shadow: 0 12px 28px rgba(20, 22, 27, 0.12);
}

html.light .lang-dropdown {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(20, 22, 27, 0.1);
    box-shadow: 0 10px 30px rgba(20, 22, 27, 0.16);
}
html.light .lang-option { color: #171a21; }
html.light .lang-option:hover { background: rgba(20, 22, 27, 0.06); }

html.light .ac-select {
    background-color: #ffffff !important;
    border-color: rgba(20, 22, 27, 0.12) !important;
    color: #171a21 !important;
}
html.light .ac-select option { background-color: #ffffff; color: #171a21; }

/* Anticheat components authored with literal white rgba values */
html.light .ac-badge { background: rgba(20, 22, 27, 0.05); border-color: rgba(20, 22, 27, 0.1); color: rgba(23, 26, 33, 0.82); }
html.light .conf-track, html.light .cat-bar-track, html.light .ev-bar-track { background: rgba(20, 22, 27, 0.08); }
html.light .ac-details { background: rgba(20, 22, 27, 0.03); }
html.light tbody tr.ac-row:hover, html.light .suspect-row:hover { background: rgba(180, 83, 9, 0.05); }
html.light .risk-tab { color: rgba(23, 26, 33, 0.6); border-color: rgba(20, 22, 27, 0.12); background: rgba(20, 22, 27, 0.03); }
html.light .risk-tab:hover { color: #171a21; border-color: rgba(180, 83, 9, 0.4); }
html.light .hm-cell { background: rgba(20, 22, 27, 0.07); }
html.light .live-badge { background: rgba(21, 128, 61, 0.08); border-color: rgba(21, 128, 61, 0.32); color: #15803d; }
html.light .live-dot, html.light .live-dot::after { background: #16a34a; }
html.light .ring-label { color: rgba(23, 26, 33, 0.5); }
html.light .chip-gray { background: rgba(20, 22, 27, 0.06); color: rgba(23, 26, 33, 0.6); }
html.light .theme-toggle { border-color: rgba(20, 22, 27, 0.12); background: rgba(20, 22, 27, 0.04); color: #b45309; }
html.light ::selection { background: rgba(217, 119, 6, 0.25); color: #171a21; }

/* ---- 12. Micro-interactions (life!) --------------------------- */
h1 span.bg-clip-text,
h1.bg-clip-text {
    background-size: 200% auto;
    animation: msxSheen 7s ease-in-out infinite;
}
@keyframes msxSheen {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.action-button:active,
.btn-primary:active,
.risk-tab:active,
.msx-btn:active,
.pagination-current:active,
button[onclick*="'/login'"]:active { transform: scale(0.96); }

body { transition: background-color 0.3s ease, color 0.3s ease; }

/* ---- 13. Mobile fit (<768px) ----------------------------------
   The nav's right cluster (theme toggle + language + login/avatar
   + hamburger) is wider than a phone screen with desktop spacing,
   pushing the hamburger off-canvas and forcing horizontal scroll
   on every page. Compact each piece so the whole row fits 360px. */
@media (max-width: 767px) {
    nav .container-wide,
    nav .container { padding-left: 0.75rem; padding-right: 0.75rem; }
    /* tighter gaps between nav cluster items (overrides space-x-4/8) */
    nav .space-x-4 > :not(:last-child) { margin-inline-end: 0.45rem; }
    nav .space-x-8 > :not(:last-child) { margin-inline-end: 0.5rem; }
    /* slightly smaller server name */
    nav a .font-bold.text-lg { font-size: 1rem; }
    /* language button: hide the chevron, tighten padding */
    nav .lang-selector > button { padding-left: 0.55rem; padding-right: 0.55rem; }
    nav .lang-selector > button > svg.w-4 { display: none; }
    /* login button: icon only (text hidden via font-size, svg keeps
       its attribute size); !important beats the inline styles */
    nav button[onclick*="'/login'"] {
        font-size: 0 !important;
        gap: 0 !important;
        padding: 8px 10px !important;
    }
    /* cards and heroes breathe less on small screens */
    main .glass.rounded-2xl.p-6 { padding: 1.1rem; }
    h1.text-4xl { font-size: 1.9rem; }

    /* backdrop blur is the single most expensive paint effect while
       scrolling on phones; near-opaque backgrounds look the same over
       the dark grid, so trade the blur for smooth scrolling. */
    .glass, .glass-darker, .lang-dropdown, .msx-menu {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
    .glass {
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0) 42%),
            rgba(22, 22, 22, 0.97);
    }
    .glass-darker { background: rgba(13, 13, 13, 0.97); }
    html.light .glass { background: #ffffff; }
    html.light .glass-darker { background: rgba(248, 249, 251, 0.98); }
}

/* Cards with backdrop-filter (.glass) each form a stacking context,
   so an open .msx-menu cannot rise above a LATER sibling card via
   z-index alone. While a dropdown is open (Alpine toggles .msx-open
   on its root) lift the whole containing card above its siblings. */
.glass:has(.msx-select.msx-open),
.rounded-2xl:has(.msx-select.msx-open) {
    position: relative;
    z-index: 45;
}

/* ---- 14. Anticheat no-reload filtering ------------------------ */
main.ac-loading {
    opacity: 0.55;
    pointer-events: none;
}
main { transition: opacity 0.15s ease; }

/* ---- 8. Motion hygiene -------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .stat-card, .card-lift, nav .hidden a::after,
    button[onclick*="'/login'"], .theme-toggle { transition: none !important; }
    .fade-in { animation: none !important; opacity: 1 !important; }
    h1 span.bg-clip-text, h1.bg-clip-text { animation: none !important; }
}
