/* ---------- GLOBAL RESET ---------- */
*, *::before, *::after {
    box-sizing: border-box;
}
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

/* ---------- TERMINAL BACKGROUND (no logo) ---------- */
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, Helvetica, Arial, sans-serif;
    background-color: #020308;
    color: #e5e5e5;
}

/* ---------- TERMINAL SHELL (outer frame removed) ---------- */
.terminal-shell {
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 10px;
}

/* CRT scanline overlay (kept unless you want removed too) */
.terminal-shell::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        repeating-linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.0) 0px,
            rgba(0, 0, 0, 0.0) 2px,
            rgba(0, 0, 0, 0.25) 3px
        );
    opacity: 0.18;
    mix-blend-mode: soft-light;
    animation: crtScroll 10s linear infinite;
    z-index: 999;
}

@keyframes crtScroll {
    from { transform: translateY(0); }
    to   { transform: translateY(3px); }
}

/* ---------- HEADER BAR ---------- */
.terminal-header {
    height: 42px;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    background: radial-gradient(circle at top left, #182033 0, #090b10 55%);
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid #1e2533;
    position: relative;
    z-index: 2;
}

.terminal-title {
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #f4f5ff;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: #9ea4b3;
}

.header-pill {
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid #1f3a2e;
    background: radial-gradient(circle at top, #1a3f2c, #07120c);
    color: #6bff9d;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.terminal-clock {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
                 "Liberation Mono", "Courier New", monospace;
}

/* ---------- MAIN PANELS LAYOUT ---------- */
.chartsContainer {
    position: relative;
    z-index: 1;
    flex: 1;
    display: grid;
    grid-template-columns: 0.95fr 1.7fr;
    grid-auto-rows: 1fr;
    height: calc(100vh - 42px - 20px); /* header + padding */
    margin-top: 6px;
    gap: 6px;
    background: linear-gradient(135deg, #10131d 0%, #05060b 80%);
    border-radius: 0 0 8px 8px;
    padding: 6px 8px 8px 8px;
}

/* ---------- LEFT PANEL – LEADERBOARD TABLE ---------- */
#table_div {
    overflow-y: auto;
    overflow-x: hidden;

    border-radius: 6px;
    border: 1px solid #353c4f;
    box-shadow:
        0 0 0 1px #181c29,
        0 0 18px rgba(0, 0, 0, 0.9);
    background: radial-gradient(circle at top left, #101525 0, #050609 55%);
    padding: 2px;
}

/* Smooth scrolling */
#table_div {
    scroll-behavior: smooth;
}

/* Custom terminal-style scrollbar */
#table_div::-webkit-scrollbar {
    width: 9px;
}
#table_div::-webkit-scrollbar-track {
    background: #050608;
}
#table_div::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #2f3a54, #1d2334);
    border-radius: 0;
    border: 1px solid #050608;
}
#table_div::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #3c4a6a, #232a3d);
}
#table_div {
    scrollbar-width: thin;
    scrollbar-color: #30384a #050608;
}

/* Google Visualization Table */
.google-visualization-table-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    background-color: transparent !important;
}

/* Table header */
.google-visualization-table-table
th.google-visualization-table-th.gradient {
    background: linear-gradient(to bottom, #171c28, #10131f) !important;
    color: #f7f8ff !important;
    font-weight: 600;
    border-bottom: 1px solid #262c3a !important;
    padding: 4px 6px;
    text-align: left;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* Table cells */
.google-visualization-table-table td {
    padding: 3px 6px;
    border-bottom: 1px solid #10131b !important;
    color: #e4e7f2 !important;
    background-color: #070b13 !important;
    white-space: nowrap;
}

/* Zebra rows */
.google-visualization-table-table tr:nth-child(even) td {
    background-color: #0c1320 !important;
}

/* Row hover */
.google-visualization-table-table tr:hover td {
    background-color: #183457 !important;
    color: #f5f7ff !important;
}

/* Right-align numeric columns */
.google-visualization-table-table td:nth-child(3),
.google-visualization-table-table td:nth-child(4),
.google-visualization-table-table td:nth-child(5) {
    text-align: right;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
                 "Liberation Mono", "Courier New", monospace;
}

/* Row number column dim */
.google-visualization-table-table td:nth-child(1),
.google-visualization-table-table th:nth-child(1) {
    color: #7b8193 !important;
}

/* ---------- TOP 3 HIGHLIGHTS ---------- */
.bbm-row-1 td {
    background-color: #403112 !important;
    border-bottom-color: #56401a !important;
    border-left: 3px solid #f7d774 !important;
    box-shadow: inset 0 0 0 1px rgba(247, 215, 116, 0.45);
}
.bbm-row-1 td:nth-child(2) {
    font-weight: 600;
    color: #fff8db !important;
}

.bbm-row-2 td {
    background-color: #5a627a !important;
    border-bottom-color: #6b738c !important;
    border-left: 3px solid #e6ecff !important;
    box-shadow: inset 0 0 0 1px rgba(230, 236, 255, 0.9);
}
.bbm-row-2 td:nth-child(2) {
    font-weight: 600;
    color: #f6f7ff !important;
}

.bbm-row-3 td {
    background-color: #3b2618 !important;
    border-bottom-color: #51331f !important;
    border-left: 3px solid #ffbf7f !important;
    box-shadow: inset 0 0 0 1px rgba(255, 191, 127, 0.6);
}
.bbm-row-3 td:nth-child(2) {
    font-weight: 600;
    color: #ffe9d0 !important;
}

.bbm-row-1:hover td,
.bbm-row-2:hover td,
.bbm-row-3:hover td {
    background-color: #214060 !important;
}

/* ---------- RIGHT PANEL – BAR CHART ---------- */
#chart {
    position: relative;
    margin: 0;
    border-radius: 6px;
    border: 1px solid #1e2533;
    box-shadow:
        0 0 0 1px #181c29,
        0 0 18px rgba(0, 0, 0, 0.9);
    padding: 6px;
    background: radial-gradient(circle at top left, #121725 0, #05060a 60%);
    display: flex;
    align-items: stretch;
    justify-content: center;
}

#chart > div {
    width: 100% !important;
    height: 100% !important;
}

/* ---------- RESPONSIVE ---------- */
@media only screen and (max-width: 959px) {
    html, body {
        overflow: auto;
    }
    .chartsContainer {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        height: auto;
    }
    #table_div {
        height: 50vh;
    }
    #chart {
        height: 50vh;
        margin-top: 6px;
    }
    #chart > div {
        height: 100% !important;
    }
}

