﻿*,*::before,*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg:         #0d1117;
    --surface:    #161b22;
    --border:     #30363d;
    --text:       #e6edf3;
    --muted:      #8b949e;
    --green:      #3fb950;
    --green-bg:   #0d2318;
    --red:        #f85149;
    --red-bg:     #2d1117;
    --yellow:     #e3b341;
    --yellow-bg:  #272115;
    --accent:     #58a6ff;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 14px;
    min-height: 100vh;
}

/* ── HEADER ─────────────────────────────────────────────────────── */
header {
    background: #000;
    border-bottom: 1px solid var(--border);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
}

.logo span { color: var(--text); }
.logo-img { display: block; }



.hdr-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.live-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--green);
    font-weight: 600;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--green);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%,100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .4; transform: scale(1.4); }
}

#lastUpdate {
    font-size: 12px;
    color: var(--muted);
}

/* ── STATS BAR ──────────────────────────────────────────────────── */
.stats-bar {
    display: flex;
    gap: 20px;
    padding: 14px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    align-items: center;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 80px;
}

.stat-lbl {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.stat-val  { font-size: 22px; font-weight: 700; }
.c-green   { color: var(--green); }
.c-red     { color: var(--red); }
.c-yellow  { color: var(--yellow); }
.c-accent  { color: var(--accent); }

.bar-wrap {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.bar-lbl { font-size: 12px; color: var(--muted); }

.bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--green), #39d353);
    border-radius: 4px;
    transition: width .7s ease;
    width: 0%;
}

.countdown {
    font-size: 12px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.countdown strong { color: var(--yellow); }

/* ── TABLE ──────────────────────────────────────────────────────── */
.container { padding: 20px 24px; }

.tbl-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.tbl-title { font-size: 15px; font-weight: 600; }
.row-cnt   { font-size: 12px; color: var(--muted); }

.latest-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    background: rgba(88,166,255,.1);
    border: 1px solid rgba(88,166,255,.3);
    border-radius: 20px;
    padding: 2px 8px;
    margin-left: 6px;
    vertical-align: middle;
}

.tbl-wrap {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow-x: scroll;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

table { width: max-content; min-width: 100%; border-collapse: collapse; }

thead th {
    background: var(--surface);
    padding: 10px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background .15s;
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover      { background: rgba(255,255,255,.03); }

tbody td {
    padding: 11px 14px;
    font-size: 13px;
    color: var(--text);
    white-space: nowrap;
}

.symb-link {
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
}
.symb-link:hover { text-decoration: underline; }

.price {
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

/* ── BADGES ─────────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .03em;
}

.b-hit     { background: var(--green-bg);  color: var(--green);  border: 1px solid var(--green); }
.b-missed  { background: var(--red-bg);    color: var(--red);    border: 1px solid var(--red); }
.b-pending { background: var(--yellow-bg); color: var(--yellow); border: 1px solid var(--yellow); }

/* ── CELLS ──────────────────────────────────────────────────────── */
.desc-cell {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--muted);
    font-size: 12px;
}

.kline-link {
    font-size: 11px;
    color: var(--green);
    text-decoration: none;
    border: 1px solid var(--green);
    padding: 2px 7px;
    border-radius: 4px;
    white-space: nowrap;
}
.kline-link:hover { background: var(--green-bg); }
.kline-none       { color: var(--border); }

/* ── STATES ─────────────────────────────────────────────────────── */
#loadingEl {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 50px;
    color: var(--muted);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty {
    text-align: center;
    padding: 60px;
    color: var(--muted);
}
.empty .icon { font-size: 48px; margin-bottom: 12px; }

/* ── NEW ROW FLASH ──────────────────────────────────────────────── */
@keyframes rowFlash {
    0%   { background: rgba(88,166,255,.18); }
    100% { background: transparent; }
}
.new-row { animation: rowFlash .9s ease; }

/* ── FOOTER ─────────────────────────────────────────────────────── */
footer {
    text-align: center;
    padding: 20px;
    color: var(--muted);
    font-size: 12px;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

/* ── RESPONSIVE ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
    header, .stats-bar, .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    table {
        min-width: 640px;
    }

    thead th, tbody td {
        padding: 9px 10px;
        font-size: 12px;
    }

    .stat-val { font-size: 18px; }
    .stats-bar { gap: 12px; }
}
.since-date { font-size: 11px; color: var(--muted); margin-left: 8px; }
