/**
 * Crypto HUD Styles for NZ:P
 * Non-intrusive overlay for crypto tracking
 */

/* Crypto Wallet Button */
.crypto-wallet-button {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(20, 241, 149, 0.1);
    border: 2px solid #14F195;
    color: #14F195;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    transition: all 0.3s ease;
    border-radius: 25px;
    backdrop-filter: blur(5px);
    box-shadow: 0 0 20px rgba(20, 241, 149, 0.3);
}

.crypto-wallet-button:hover {
    background: rgba(20, 241, 149, 0.2);
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(20, 241, 149, 0.5);
}

.crypto-wallet-button.connected {
    background: rgba(20, 241, 149, 0.2);
    border-color: #00ff00;
    color: #00ff00;
}

/* Crypto HUD Overlay Styles */
#crypto-hud {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    z-index: 10000;
}

/* Wallet Gate Overlay */
#wallet-gate-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.5s ease;
}

.wallet-gate {
    width: 90%;
    max-width: 800px;
    color: #fff;
}

.wallet-gate-content {
    text-align: center;
}

.wallet-gate h1 {
    font-size: 3em;
    margin: 0;
    color: #00ff88;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

.wallet-gate h2 {
    font-size: 1.5em;
    margin: 10px 0 40px;
    color: #888;
    letter-spacing: 3px;
}

.rewards-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.reward-box {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 10px;
    padding: 20px;
    text-align: left;
}

.reward-box h3 {
    margin-top: 0;
    color: #00ff88;
    font-size: 1.2em;
}

.reward-box ul {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.reward-box li {
    margin: 8px 0;
    padding-left: 20px;
    position: relative;
}

.reward-box li:before {
    content: "▸";
    position: absolute;
    left: 0;
    color: #00ff88;
}

.coming-soon {
    grid-column: 1 / -1;
    background: rgba(255, 165, 0, 0.1);
    border-color: rgba(255, 165, 0, 0.5);
}

.coming-soon h3 {
    color: #ffa500;
}

.wallet-gate-buttons {
    margin: 30px 0;
}

.btn-primary {
    background: linear-gradient(135deg, #00ff88 0%, #00cc66 100%);
    color: #000;
    border: none;
    padding: 18px 40px;
    font-size: 1.2em;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 5px 20px rgba(0, 255, 136, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 255, 136, 0.6);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wallet-gate-info {
    margin-top: 40px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.wallet-gate-info ul {
    list-style: none;
    padding: 0;
    text-align: left;
    max-width: 400px;
    margin: 10px auto;
}

.wallet-gate-disclaimer {
    margin-top: 30px;
    font-size: 0.9em;
    color: #666;
    line-height: 1.6;
}

/* Top Bar */
.crypto-hud-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 100%);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(0, 255, 136, 0.3);
    z-index: 10001;
    transition: transform 0.3s ease;
}

.wallet-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 14px;
}

.wallet-icon {
    font-size: 20px;
}

.wallet-address {
    font-family: 'Courier New', monospace;
    background: rgba(0, 255, 136, 0.1);
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.session-stats {
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #00ff88;
    font-weight: bold;
    font-size: 16px;
}

.stat-icon {
    font-size: 20px;
}

.multiplayer-badge {
    background: linear-gradient(135deg, #ff6b6b, #ff0000);
    color: #fff;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.hud-btn {
    background: rgba(0, 255, 136, 0.1);
    border: 2px solid rgba(0, 255, 136, 0.3);
    color: #00ff88;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s;
}

.hud-btn:hover {
    background: rgba(0, 255, 136, 0.2);
    border-color: #00ff88;
    transform: translateY(-2px);
}

/* Game Stats Overlay (replaces bottom-right corner) */
.game-stats-overlay {
    position: fixed;
    bottom: 10px;
    right: 10px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    z-index: 10001;
    /* Make sure it covers everything underneath */
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 8px;
}

.stat-box {
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 8px;
    padding: 15px 25px;
    min-width: 140px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.stat-box.highlight {
    border-color: #00ff88;
    background: rgba(0, 255, 136, 0.1);
}

.stat-label {
    color: #888;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.stat-value {
    color: #00ff88;
    font-size: 24px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

/* Leaderboard Panel */
.leaderboard-panel {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 450px;
    max-height: calc(100vh - 100px);
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid rgba(0, 255, 136, 0.5);
    border-radius: 10px;
    backdrop-filter: blur(20px);
    overflow: hidden;
    z-index: 10002;
}

.leaderboard-header {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2), rgba(0, 204, 102, 0.2));
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(0, 255, 136, 0.3);
}

.leaderboard-header h2 {
    margin: 0;
    color: #00ff88;
    font-size: 1.5em;
}

.close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #00ff88;
}

.tournament-info {
    padding: 15px 20px;
    background: rgba(255, 165, 0, 0.1);
    border-bottom: 1px solid rgba(255, 165, 0, 0.3);
    color: #ffa500;
    text-align: center;
}

.prize-pool {
    margin-top: 10px;
    font-size: 1.2em;
    font-weight: bold;
}

.leaderboard-content {
    max-height: 500px;
    overflow-y: auto;
    padding: 10px;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leaderboard-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s;
}

.leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(0, 255, 136, 0.3);
}

.leaderboard-item.current-player {
    background: rgba(0, 255, 136, 0.1);
    border-color: #00ff88;
}

.rank {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50px;
}

.rank-number {
    font-size: 18px;
    font-weight: bold;
    color: #00ff88;
}

.rank span:last-child {
    font-size: 24px;
}

.player-info {
    flex: 1;
}

.player-wallet {
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
}

.player-stats {
    color: #888;
    font-size: 12px;
    margin-top: 4px;
}

.player-zap {
    text-align: right;
}

.zap-amount {
    color: #00ff88;
    font-size: 18px;
    font-weight: bold;
}

.prize-share {
    color: #ffa500;
    font-size: 12px;
    margin-top: 4px;
}

/* Notification Toast */
.notification-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 0, 0, 0.95);
    color: #fff;
    padding: 15px 30px;
    border-radius: 50px;
    border: 2px solid #00ff88;
    font-weight: bold;
    z-index: 10003;
    transition: transform 0.3s ease;
}

.notification-toast.show {
    transform: translateX(-50%) translateY(0);
}

.notification-toast.success {
    border-color: #00ff88;
    background: rgba(0, 255, 136, 0.2);
}

.notification-toast.error {
    border-color: #ff4444;
    background: rgba(255, 68, 68, 0.2);
}

/* Loading and Empty States */
.loading, .empty, .error {
    text-align: center;
    padding: 40px;
    color: #888;
}

.error {
    color: #ff4444;
}

/* Scrollbar Styling */
.leaderboard-content::-webkit-scrollbar {
    width: 8px;
}

.leaderboard-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.leaderboard-content::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 136, 0.3);
    border-radius: 4px;
}

.leaderboard-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 136, 0.5);
}

/* Hide "Starting game" message */
#status {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .crypto-hud-topbar {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .leaderboard-panel {
        width: calc(100% - 40px);
        left: 20px;
        right: 20px;
    }
    
    .game-stats-overlay {
        grid-template-columns: 1fr;
        bottom: 10px;
        right: 10px;
    }
    
    .stat-box {
        min-width: 100px;
        padding: 8px 15px;
    }
}

/* Kill Notifications */
.crypto-kill-notification,
.crypto-round-notification,
.crypto-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 20px 40px;
    border-radius: 10px;
    z-index: 10001;
    pointer-events: none;
    animation: slideIn 0.3s ease-out;
    border: 2px solid #14F195;
    box-shadow: 0 0 30px rgba(20, 241, 149, 0.5);
}

.crypto-kill-notification {
    top: 40%;
}

.crypto-kill-notification span {
    font-size: 24px;
    font-weight: bold;
    color: #14F195;
    text-shadow: 0 0 10px rgba(20, 241, 149, 0.8);
}

.crypto-kill-notification .headshot {
    color: #ff0000;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
    font-size: 28px;
}

.crypto-round-notification span {
    font-size: 32px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
}

.crypto-notification {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.notification-title {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
}

.notification-amount {
    font-size: 20px;
    color: #14F195;
    font-weight: bold;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* Game Over Screen */
.crypto-game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    backdrop-filter: blur(5px);
}

.game-over-content {
    background: rgba(0, 0, 0, 0.8);
    border: 3px solid #14F195;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    text-align: center;
    color: #fff;
    box-shadow: 0 0 50px rgba(20, 241, 149, 0.5);
}

.game-over-content h2 {
    color: #ff0000;
    font-size: 48px;
    margin: 0 0 30px 0;
    text-shadow: 0 0 20px rgba(255, 0, 0, 0.8);
}

.final-stats {
    margin: 20px 0;
    font-size: 18px;
    line-height: 1.8;
}

.final-stats div {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.rewards-earned {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #14F195;
}

.rewards-earned h3 {
    color: #14F195;
    font-size: 24px;
    margin: 0 0 15px 0;
}

.reward-amount {
    font-size: 36px;
    font-weight: bold;
    color: #14F195;
    text-shadow: 0 0 20px rgba(20, 241, 149, 0.8);
    margin: 20px 0;
}

.rewards-earned button {
    background: #14F195;
    color: #000;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 30px;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.rewards-earned button:hover {
    background: #00ff00;
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.5);
}

.rewards-earned button:disabled {
    background: #666;
    cursor: not-allowed;
    transform: scale(1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .crypto-wallet-button {
        top: 10px;
        right: 10px;
        font-size: 12px;
        padding: 8px 16px;
    }

    .crypto-hud {
        top: 60px;
        right: 10px;
        padding: 10px;
        min-width: 150px;
    }

    .crypto-stats {
        font-size: 12px;
    }

    .crypto-notification {
        padding: 15px 25px;
    }

    .notification-title {
        font-size: 20px;
    }

    .notification-amount {
        font-size: 18px;
    }

    .game-over-content {
        padding: 20px;
        margin: 20px;
    }

    .game-over-content h2 {
        font-size: 36px;
    }

    .reward-amount {
        font-size: 28px;
    }
}

/* Dark mode for crypto elements */
@media (prefers-color-scheme: light) {
    .crypto-hud {
        background: rgba(255, 255, 255, 0.9);
        border-color: rgba(0, 0, 0, 0.2);
    }

    .crypto-stats .stat {
        color: #000;
    }
}