/* ============================================
   PANELMINER — CORE DESIGN SYSTEM
   Dark / energy-flow theme. Shared across all pages.
   ============================================ */

:root {
    /* -- Surfaces -- */
    --void: #050505;
    --panel: #0d0f0d;
    --card: #12140f;
    --card-hover: #171a13;
    --border: #262922;
    --border-bright: #3a3f32;

    /* -- Energy palette (each color = a state in the sun->panel->wire->miner chain) -- */
    --sun-gold: #ffb800;        /* solar generation */
    --sun-gold-dim: rgba(255, 184, 0, 0.12);
    --mine-green: #39ff14;      /* mining active / earnings */
    --mine-green-dim: rgba(57, 255, 20, 0.1);
    --wire-blue: #4d9fff;       /* electricity in transit */
    --wire-blue-dim: rgba(77, 159, 255, 0.1);
    --grid-red: #ff3d3d;        /* grid draw / stopped / error */
    --grid-red-dim: rgba(255, 61, 61, 0.1);

    /* -- Rank accents (leaderboard only) -- */
    --rank-gold: #ffd700;
    --rank-silver: #c8ced6;
    --rank-bronze: #cd7f32;

    /* -- Text -- */
    --text-hi: #f4f5f2;
    --text-mid: #9ba39a;
    --text-low: #5c6459;

    /* -- Type -- */
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;

    /* -- Motion -- */
    --ease-flow: cubic-bezier(0.16, 1, 0.3, 1);
    --dur-scroll: 0.8s;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    background: var(--void);
    color: var(--text-hi);
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--text-hi); font-weight: 700; letter-spacing: 0.5px; }
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); line-height: 1.05; }
h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 10px; }
h3 { font-size: 1.3rem; }

p { color: var(--text-mid); }

a { color: inherit; text-decoration: none; }

.highlight { color: var(--mine-green); }
.highlight-gold { color: var(--sun-gold); }
.highlight-blue { color: var(--wire-blue); }
.highlight-red { color: var(--grid-red); }

.text-center { text-align: center; }
.text-muted { color: var(--text-mid); }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-40 { margin-top: 40px; }
.hidden { display: none !important; }

/* -- Layout -- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 720px; margin: 0 auto; padding: 0 24px; }

main { padding-top: 88px; }

section { padding: 90px 0; }

.section-header { text-align: center; max-width: 640px; margin: 0 auto 50px; }
.section-header p { margin-top: 12px; }
.eyebrow {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 0.7rem;
    letter-spacing: 3px;
    color: var(--mine-green);
    text-transform: uppercase;
    margin-bottom: 14px;
}

/* -- Grids -- */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }

/* -- Panels / Cards -- */
.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 32px;
    margin-bottom: 24px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 24px;
    transition: border-color 0.3s var(--ease-flow), transform 0.3s var(--ease-flow), background 0.3s var(--ease-flow);
}
.card:hover { border-color: var(--border-bright); background: var(--card-hover); }

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 20px 24px;
    text-align: left;
}
.stat-card .stat-label {
    font-family: var(--font-display);
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: var(--text-mid);
    text-transform: uppercase;
    margin-bottom: 8px;
}
.stat-card .stat-value {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--mine-green);
}

/* -- Buttons -- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--mine-green);
    color: #06120a;
    border: none;
    padding: 13px 26px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    transition: transform 0.25s var(--ease-flow), box-shadow 0.25s var(--ease-flow), background 0.25s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 0 24px rgba(57, 255, 20, 0.35); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-outline { background: transparent; border: 1px solid var(--mine-green); color: var(--mine-green); padding: 12px 25px; }
.btn-outline:hover { background: var(--mine-green-dim); box-shadow: none; }

.btn-gold { background: var(--sun-gold); color: #1a1200; }
.btn-gold:hover { box-shadow: 0 0 24px rgba(255, 184, 0, 0.35); }

.btn-danger { background: var(--grid-red); color: #1a0505; }
.btn-danger:hover { box-shadow: 0 0 24px rgba(255, 61, 61, 0.35); }

.btn-sm { padding: 8px 16px; font-size: 0.72rem; clip-path: none; border-radius: 3px; }
.btn-block { width: 100%; }

/* -- Forms -- */
label { display: block; color: var(--text-mid); font-size: 0.85rem; margin-bottom: 6px; }
input, select, textarea {
    width: 100%;
    padding: 13px 14px;
    background: #0a0b09;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-hi);
    font-family: var(--font-body);
    font-size: 1rem;
    margin-bottom: 16px;
    transition: border-color 0.25s;
}
input:focus, select:focus, textarea:focus { border-color: var(--mine-green); outline: none; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
    outline: 2px solid var(--wire-blue);
    outline-offset: 2px;
}
.error-msg { color: var(--grid-red); font-size: 0.9rem; margin-bottom: 14px; display: none; }
.success-msg { color: var(--mine-green); font-size: 0.9rem; margin-bottom: 14px; display: none; }

/* -- Nav (shared shell, see nav.html fragment logic in core.js) -- */
nav.site-nav {
    position: fixed;
    top: 0; left: 0; width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 32px;
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.logo {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 2px;
    white-space: nowrap;
    cursor: pointer;
}
.logo span { color: var(--mine-green); text-shadow: 0 0 12px rgba(57,255,20,0.5); }
.nav-links { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.nav-link {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-mid);
    padding: 8px 14px;
    font-family: var(--font-display);
    font-size: 0.72rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 3px;
    transition: 0.25s;
}
.nav-link:hover, .nav-link.active { color: var(--mine-green); background: var(--mine-green-dim); }
.nav-user {
    font-size: 0.85rem;
    color: var(--text-hi);
    padding-right: 16px;
    border-right: 1px solid var(--border);
    margin-right: 6px;
    white-space: nowrap;
}

/* -- Footer -- */
footer.site-footer { background: #070806; border-top: 1px solid var(--border); padding: 60px 24px 28px; margin-top: 100px; }
.footer-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; }
.footer-col h4 { font-family: var(--font-display); font-size: 0.85rem; letter-spacing: 1px; margin-bottom: 18px; color: var(--text-hi); }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: var(--text-mid); font-size: 0.9rem; transition: color 0.2s; }
.footer-col a:hover { color: var(--mine-green); }
.footer-bottom { text-align: center; margin-top: 50px; padding-top: 22px; border-top: 1px solid var(--border); color: var(--text-low); font-size: 0.8rem; }

/* -- Modals -- */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.85);
    z-index: 2000; display: none; justify-content: center; align-items: center;
    backdrop-filter: blur(6px); padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal-box {
    background: var(--panel); border: 1px solid var(--mine-green); border-radius: 8px;
    padding: 30px; width: 100%; max-width: 560px; max-height: 85vh; overflow-y: auto;
    box-shadow: 0 0 40px rgba(57,255,20,0.15);
}
.modal-title { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

/* -- Tables -- */
.table-wrap { width: 100%; overflow-x: auto; background: #0a0b09; border: 1px solid var(--border); border-radius: 6px; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th { background: #0f100c; color: var(--text-mid); font-family: var(--font-display); font-size: 0.72rem; letter-spacing: 1px; text-transform: uppercase; padding: 14px; text-align: left; border-bottom: 1px solid var(--border); }
td { padding: 14px; border-bottom: 1px solid #1a1c16; color: #ccc; }
tr:last-child td { border-bottom: none; }

/* -- Scroll reveal base state (JS adds .is-visible) -- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity var(--dur-scroll) var(--ease-flow), transform var(--dur-scroll) var(--ease-flow); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
}

/* -- Mobile -- */
@media (max-width: 768px) {
    nav.site-nav { flex-direction: column; padding: 14px; gap: 12px; }
    .nav-links { justify-content: center; gap: 6px; }
    .nav-user { border-right: none; padding-right: 0; margin: 0 0 6px; width: 100%; text-align: center; }
    main { padding-top: 150px; }
    section { padding: 60px 0; }
    .panel { padding: 20px; }
    .modal-box { padding: 20px; }
}
