/* ============================================================
   HIGH SCORE SYSTEM STYLES  –  highscores.css
   ============================================================ */

/* ── Trophy button in stats bar ─────────────────────────── */
#hs-trophy-btn {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
    transition: transform 0.15s;
    flex-shrink: 0;
}
#hs-trophy-btn:hover { transform: scale(1.25); }

/* ── Modal overlay ──────────────────────────────────────── */
/* position:fixed + JS-set width/height/top/left bypasses   */
/* mobile WebKit's overflow:hidden viewport clipping bug    */
#hs-modal {
    display: none;
    position: fixed;
    /* width/height/top/left are set by positionModal() in JS */
    background: rgba(0, 0, 0, 0.75);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
}

/* ── Panel ──────────────────────────────────────────────── */
#hs-panel {
    background: #1a1a2e;
    border: 2px solid var(--gold, #d4a017);
    border-radius: 12px;
    width: min(560px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px 22px 16px;
    box-sizing: border-box;
    color: #eee;
    font-family: sans-serif;
    box-shadow: 0 8px 40px rgba(0,0,0,0.7);
}

/* ── Header ─────────────────────────────────────────────── */
#hs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
#hs-title {
    font-size: 1.3rem;
    font-weight: bold;
    letter-spacing: 1px;
    color: var(--gold, #d4a017);
}
#hs-close {
    background: transparent;
    border: 1px solid #555;
    color: #bbb;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}
#hs-close:hover { background: #444; color: #fff; }

/* ── Tabs ───────────────────────────────────────────────── */
#hs-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
}
.hs-tab {
    flex: 1;
    padding: 7px 0;
    border: 1px solid #444;
    background: #111;
    color: #bbb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.15s, color 0.15s;
}
.hs-tab.active {
    background: var(--gold, #d4a017);
    color: #111;
    font-weight: bold;
    border-color: var(--gold, #d4a017);
}

/* ── Tab description ─────────────────────────────────────── */
#hs-tab-desc {
    font-size: 0.75rem;
    color: #888;
    margin: 0 0 10px;
    font-style: italic;
}

/* ── Table ──────────────────────────────────────────────── */
#hs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
#hs-table th {
    text-align: left;
    padding: 6px 8px;
    border-bottom: 1px solid #444;
    color: #aaa;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}
#hs-table td {
    padding: 7px 8px;
    border-bottom: 1px solid #2a2a3e;
}
#hs-table tr:last-child td { border-bottom: none; }
#hs-table tr:hover td { background: rgba(255,255,255,0.04); }

/* New entry highlight */
#hs-tbody tr.hs-new td {
    background: rgba(212, 160, 23, 0.15);
    animation: hs-pulse 1.4s ease-in-out 3;
}
@keyframes hs-pulse {
    0%, 100% { background: rgba(212, 160, 23, 0.15); }
    50%       { background: rgba(212, 160, 23, 0.30); }
}

.hs-pos { color: #4caf50; }
.hs-neg { color: #f44336; }

/* ── Empty state ─────────────────────────────────────────── */
#hs-empty {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 24px 0;
    margin: 0;
}

/* ── Footer ─────────────────────────────────────────────── */
#hs-footer {
    margin-top: 14px;
    text-align: right;
}
#hs-clear {
    background: transparent;
    border: 1px solid #555;
    color: #888;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    transition: background 0.15s, color 0.15s;
}
#hs-clear:hover { background: #3a1a1a; color: #f88; border-color: #f44336; }
