/* ─── GAME-SPECIFIC STYLES ─── */

.game-body { overflow: hidden; height: 100vh; }

#game-canvas {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0; display: block;
}

/* ─── HUD ─── */
#hud {
    position: fixed; top: 90px; left: 0;
    width: 100%; padding: 0 40px;
    display: flex; justify-content: space-between;
    z-index: 100; pointer-events: none;
}
.hud-label {
    display: block; font-size: 0.55rem;
    letter-spacing: 0.3em; color: #555;
    margin-bottom: 4px; font-family: 'Share Tech Mono', monospace;
}
#score-value, #lives-value, #best-value {
    font-size: 1.3rem; font-weight: 900;
    letter-spacing: 0.08em; color: var(--accent-color);
    font-family: 'Share Tech Mono', monospace;
}

/* ─── PINBALL LEADERBOARD PANEL ─── */
#leaderboard-panel {
    position: fixed;
    right: 0; top: 0; bottom: 0;
    width: 200px;
    z-index: 90;
    display: flex; flex-direction: column;
    border-left: 1px solid rgba(235,255,0,0.12);
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    padding: 0;
    overflow: hidden;
}

#lb-header {
    padding: 80px 0 16px;
    text-align: center;
    border-bottom: 1px solid rgba(235,255,0,0.15);
}

#lb-title-flash {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.3em;
    color: var(--accent-color);
    animation: pinFlash 1.4s ease-in-out infinite;
}

@keyframes pinFlash {
    0%, 49%  { opacity: 1; }
    50%, 100% { opacity: 0.2; }
}

#lb-entries {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.lb-entry {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(235,255,0,0.06);
    transition: background 0.3s ease;
    font-family: 'Share Tech Mono', monospace;
}

.lb-entry.highlight {
    background: rgba(235,255,0,0.08);
    animation: pinEntryFlash 0.6s ease 3;
}

@keyframes pinEntryFlash {
    0%, 100% { background: rgba(235,255,0,0.08); }
    50%       { background: rgba(235,255,0,0.22); }
}

.lb-rank {
    font-size: 0.6rem;
    color: #444;
    min-width: 18px;
}
.lb-rank.top3 { color: var(--accent-color); }

.lb-name {
    font-size: 0.72rem;
    color: #ccc;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: 0.05em;
}

.lb-score {
    font-size: 0.72rem;
    color: var(--accent-color);
    letter-spacing: 0.05em;
}

#lb-footer {
    padding: 14px 0;
    text-align: center;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.55rem;
    letter-spacing: 0.4em;
    color: #333;
    border-top: 1px solid rgba(235,255,0,0.08);
    animation: pinFlash 2s ease-in-out infinite 0.7s;
}

/* Scrolling ticker effect for lb-entries */
#lb-entries .lb-scroll-track {
    position: absolute;
    top: 0; left: 0; right: 0;
}

/* ─── OVERLAYS ─── */
.game-overlay {
    position: fixed; inset: 0;
    display: flex; justify-content: center; align-items: center;
    z-index: 200;
    background: rgba(0,0,0,0.88);
    backdrop-filter: blur(14px);
}
.game-overlay.hidden { display: none; }

.overlay-content {
    text-align: center;
    max-width: 460px;
    width: 100%;
    padding: 0 24px;
}

.lb-overlay-content { max-width: 540px; }

/* ─── GAME TITLE / OVER ─── */
.game-title {
    font-size: clamp(4rem, 12vw, 8rem);
    line-height: 0.9; margin-bottom: 20px;
}
.game-over-title {
    font-size: clamp(2.8rem, 8vw, 5.5rem);
    line-height: 0.9; margin-bottom: 24px;
}

.game-desc {
    font-size: 0.85rem; letter-spacing: 0.18em;
    color: #777; line-height: 1.9; margin-bottom: 32px;
}

.game-controls-hint {
    display: flex; justify-content: center; gap: 40px;
    margin-bottom: 36px; font-size: 0.72rem;
    letter-spacing: 0.25em; color: var(--accent-color);
    font-family: 'Share Tech Mono', monospace;
}

/* ─── BUTTON ─── */
.game-btn {
    background: transparent;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    padding: 16px 52px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem; font-weight: 900;
    letter-spacing: 0.2em;
    cursor: none;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    display: block; margin: 0 auto;
}
.game-btn:hover {
    background: var(--accent-color); color: #000;
    box-shadow: 0 0 40px rgba(235,255,0,0.35);
    transform: scale(1.04);
}

/* ─── FINAL SCORE ─── */
.final-score-label {
    font-size: 0.65rem; letter-spacing: 0.3em;
    color: #555; margin-bottom: 6px;
    font-family: 'Share Tech Mono', monospace;
}
.final-score-value {
    font-size: 3rem; font-weight: 900;
    color: var(--accent-color); margin-bottom: 4px;
    font-family: 'Share Tech Mono', monospace;
}
.new-best {
    font-size: 0.7rem; letter-spacing: 0.3em;
    color: var(--accent-color); margin-bottom: 24px;
    animation: pinFlash 0.8s ease infinite;
    font-family: 'Share Tech Mono', monospace;
}
.new-best.hidden { display: none; }

/* ─── NAME ENTRY ─── */
.name-entry-wrap {
    margin: 28px 0 32px;
}
.name-input {
    background: transparent;
    border: none; border-bottom: 2px solid var(--accent-color);
    color: var(--accent-color);
    font-family: 'Share Tech Mono', monospace;
    font-size: 2.2rem; font-weight: 700;
    letter-spacing: 0.3em; text-align: center;
    width: 100%; max-width: 300px;
    outline: none; padding: 8px 0;
    text-transform: uppercase;
    caret-color: var(--accent-color);
}
.name-input::placeholder { color: #333; }

.skip-link {
    background: none; border: none; color: #444;
    font-family: 'Outfit', sans-serif; font-size: 0.7rem;
    letter-spacing: 0.2em; cursor: none; margin-top: 18px;
    display: block; text-align: center;
    transition: color 0.2s;
}
.skip-link:hover { color: #888; }

/* ─── LEADERBOARD REVEAL ─── */
.lb-reveal-title {
    font-size: clamp(2.5rem, 7vw, 4.5rem);
    line-height: 0.9; margin-bottom: 36px;
}

#lb-reveal-list { margin-bottom: 36px; }

.lb-reveal-entry {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(235,255,0,0.1);
    font-family: 'Share Tech Mono', monospace;
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.lb-reveal-entry.visible { opacity: 1; transform: translateX(0); }
.lb-reveal-entry.is-you  { background: rgba(235,255,0,0.07); }

.lbr-rank  { font-size: 0.8rem; color: #555; text-align: right; }
.lbr-rank.top3 { color: var(--accent-color); }
.lbr-name  { font-size: 0.95rem; color: #ddd; text-align: left; }
.lbr-name .you-tag {
    font-size: 0.55rem; color: var(--accent-color);
    letter-spacing: 0.2em; margin-left: 8px; vertical-align: middle;
}
.lbr-score { font-size: 0.95rem; color: var(--accent-color); text-align: right; }

.lb-reveal-actions { display: flex; gap: 20px; justify-content: center; }

/* ─── START SCREEN LEADERBOARD ─── */
#start-leaderboard {
    margin-top: 40px; padding-top: 32px;
    border-top: 1px solid rgba(235,255,0,0.12);
}
.start-lb-row {
    display: flex; gap: 12px; justify-content: center;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem; padding: 6px 0;
    color: #666; letter-spacing: 0.05em;
}
.start-lb-row .slb-rank { color: #444; min-width: 20px; text-align: right; }
.start-lb-row .slb-name { color: #999; flex: 1; text-align: left; }
.start-lb-row .slb-score { color: var(--accent-color); }
.start-lb-row.top1 { color: var(--accent-color); }
.start-lb-row.top1 .slb-name, .start-lb-row.top1 .slb-rank { color: var(--accent-color); }

nav a.logo { text-decoration: none; color: var(--text-color); }
.nav-item.active { color: var(--accent-color); }
