/* Kaspa Flyer - Neon Blockchain Theme */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Orbitron', monospace;
    background: linear-gradient(135deg, #0a0a0a, #1a1a2e, #16213e);
    color: #70C7BA;
    overflow: hidden;
    height: 100vh;
}

#gameContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Neon Effects */
.neon-glow {
    text-shadow: 
        0 0 5px #70C7BA,
        0 0 10px #70C7BA,
        0 0 15px #70C7BA,
        0 0 20px #70C7BA;
}

/* Main Menu Styles */
.screen {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: radial-gradient(ellipse at center, rgba(112, 199, 186, 0.1) 0%, rgba(0, 0, 0, 0.8) 70%);
    z-index: 100; /* Ensure screens appear above game canvas */
}

#mainMenu {
    padding: 20px;
    box-sizing: border-box;
    justify-content: flex-start;
    padding-top: 15vh; /* Push everything down */
}

#mainMenu .logo-container {
    margin-bottom: 25px; /* Reduced spacing */
}

#mainMenu .menu-buttons {
    margin-bottom: 15px; /* Reduced spacing */
}

#mainMenu .kaspa-info {
    margin-bottom: 5px; /* Even less spacing under leaderboard */
}

/* Quick Selectors - Separate positioning */
.quick-avatar-selector {
    position: absolute;
    top: 20px;
    left: 20px;
}

.quick-game-mode-selector {
    position: absolute;
    top: 20px;
    right: 20px;
    min-width: 180px; /* Ensure dropdown fits */
}

.quick-avatar-selector,
.quick-game-mode-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(112, 199, 186, 0.1);
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid rgba(112, 199, 186, 0.3);
    backdrop-filter: blur(5px);
}

.quick-avatar-selector label,
.quick-game-mode-selector label {
    color: #70C7BA;
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.quick-avatar-dropdown {
    background: rgba(26, 26, 46, 0.9);
    border: 1px solid #70C7BA;
    color: #70C7BA;
    padding: 5px 10px;
    font-family: 'Orbitron', monospace;
    font-size: 0.8rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    min-width: 120px; /* Ensure dropdown is wide enough */
}

.quick-avatar-dropdown:hover {
    background: rgba(112, 199, 186, 0.1);
    box-shadow: 0 0 5px #70C7BA;
}

.quick-avatar-dropdown option {
    background: #1a1a2e;
    color: #70C7BA;
}

.logo-container {
    text-align: center;
    margin-bottom: 50px;
}

.kaspa-logo {
    font-size: 4rem;
    font-weight: 900;
    color: #70C7BA;
    text-shadow: 
        0 0 3px #70C7BA,
        0 0 6px #70C7BA,
        0 0 9px #70C7BA;
    margin-bottom: 10px;
    animation: pulse 2s ease-in-out infinite alternate;
    padding: 0 40px; /* Add horizontal padding for more spacing */
}

.subtitle {
    font-size: 1.2rem;
    color: #ffffff;
    opacity: 0.8;
    letter-spacing: 2px;
}

@keyframes pulse {
    from { text-shadow: 0 0 10px #70C7BA, 0 0 20px #70C7BA, 0 0 30px #70C7BA; }
    to { text-shadow: 0 0 20px #70C7BA, 0 0 30px #70C7BA, 0 0 40px #70C7BA, 0 0 50px #70C7BA; }
}

/* Button Styles */
.neon-button {
    background: transparent;
    border: 2px solid #70C7BA;
    color: #70C7BA;
    font-family: 'Orbitron', monospace;
    font-size: 1rem; /* Smaller font */
    font-weight: 700;
    padding: 12px 24px; /* Much smaller padding */
    margin: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    min-width: 160px; /* Smaller minimum width */
}

.neon-button:hover {
    background: rgba(112, 199, 186, 0.1);
    box-shadow: 
        0 0 10px #70C7BA,
        0 0 20px #70C7BA,
        inset 0 0 10px rgba(112, 199, 186, 0.1);
    transform: translateY(-2px);
}

.neon-button:active {
    transform: translateY(0);
}

/* Menu Info */
.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px; /* Even closer together */
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.kaspa-info {
    text-align: center;
    margin-top: 40px;
    opacity: 0.7;
}

.kaspa-info p {
    margin: 5px 0;
    font-size: 0.9rem;
}

.donation-section {
    text-align: center;
    margin-top: 20px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    padding: 15px;
    background: rgba(112, 199, 186, 0.1);
    border: 2px solid rgba(112, 199, 186, 0.3);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(112, 199, 186, 0.2);
}

.donation-text {
    color: #70C7BA;
    font-family: 'Orbitron', monospace;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(112, 199, 186, 0.5);
}

.kaspa-copy-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(112, 199, 186, 0.2);
    border: 2px solid #70C7BA;
    border-radius: 25px;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(15px);
    user-select: none;
    box-shadow: 0 0 20px rgba(112, 199, 186, 0.3);
    font-weight: 700;
}

.kaspa-copy-button:hover {
    background: rgba(112, 199, 186, 0.3);
    border-color: #ffffff;
    transform: scale(1.08);
    box-shadow: 0 0 30px rgba(112, 199, 186, 0.5);
}

.kaspa-truncated {
    color: #ffffff;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.clipboard-icon {
    font-size: 1.2rem;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.3));
}

/* Game Canvas */
#gameCanvas {
    border: none; /* Remove border to maximize space */
    box-shadow: none; /* Remove shadow for full screen */
    background: linear-gradient(180deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    width: 100vw;
    height: calc(100vh - 80px); /* Leave space for top UI */
    position: fixed;
    top: 80px; /* Start below the UI */
    left: 0;
    z-index: 1;
}

/* Game UI Overlay */
.game-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 10;
}

/* Make sure UI elements can be clicked */
.game-overlay > * {
    pointer-events: auto;
}

.score, .tokens {
    position: absolute;
    font-size: 1.5rem;
    font-weight: 700;
    color: #70C7BA;
    text-shadow: 0 0 10px #70C7BA;
    pointer-events: none;
}

.score {
    top: 20px;
    left: 20px;
}

.tokens {
    top: 25px;
    right: 20px;
    font-size: 1.2rem;
}

.pause-button {
    position: absolute;
    top: 20px;
    right: 50%;
    transform: translateX(50%);
    background: transparent;
    border: 2px solid #70C7BA;
    color: #70C7BA;
    font-size: 1.2rem;
    width: 50px;
    height: 50px;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.3s ease;
}

.pause-button:hover {
    background: rgba(112, 199, 186, 0.2);
    box-shadow: 0 0 10px #70C7BA;
}

.settings-gear-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: 2px solid #70C7BA;
    color: #70C7BA;
    font-size: 1.2rem;
    width: 50px;
    height: 50px;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.settings-gear-button:hover {
    background: rgba(112, 199, 186, 0.2);
    box-shadow: 0 0 10px #70C7BA;
    transform: rotate(45deg);
}

/* Game Over Screen */
.game-over-content {
    text-align: center;
    max-width: 600px;
    padding: 30px 40px; /* Much less padding */
    max-height: 90vh;
    overflow-y: auto;
}

.game-over-title {
    font-size: 3rem;
    color: #ff4757;
    text-shadow: 0 0 20px #ff4757;
    margin-bottom: 15px; /* Much less margin */
}

.final-score, .high-score {
    font-size: 1.5rem;
    margin: 5px 0; /* Tighter margins */
    color: #70C7BA;
}

.game-over-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px; /* Reduced gap between buttons */
    justify-content: center;
    align-items: center;
    margin-top: 20px; /* Less space above buttons */
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.high-score {
    color: #ffa502;
    text-shadow: 0 0 10px #ffa502;
}

/* Username Section */
.username-section {
    margin: 20px 0;
    padding: 20px;
    border: 2px solid #70C7BA;
    border-radius: 10px;
    background: rgba(112, 199, 186, 0.1);
    text-align: center;
}

.username-section h3 {
    color: #70C7BA;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.username-input {
    width: 100%;
    max-width: 300px;
    padding: 12px 15px;
    border: 2px solid #70C7BA;
    border-radius: 8px;
    background: rgba(26, 26, 46, 0.8);
    color: #70C7BA;
    font-family: 'Orbitron', monospace;
    font-size: 1rem;
    margin-bottom: 15px;
    text-align: center;
}

.username-input:focus {
    outline: none;
    border-color: #ffa502;
    box-shadow: 0 0 10px rgba(255, 165, 0, 0.5);
}

.username-input::placeholder {
    color: rgba(112, 199, 186, 0.6);
}

/* Revival Section */
.revival-section {
    margin: 30px 0;
    padding: 20px;
    border: 1px solid #70C7BA;
    border-radius: 10px;
    background: rgba(112, 199, 186, 0.05);
}

.revival-section h3 {
    color: #70C7BA;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

/* Removed scroll indicator - it wasn't working properly */

.trivia-question {
    font-size: 1rem;
    margin-bottom: 15px;
    color: #ffffff;
    line-height: 1.4;
}

.trivia-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.trivia-option {
    background: transparent;
    border: 1px solid #70C7BA;
    color: #70C7BA;
    padding: 10px 15px;
    cursor: pointer;
    font-family: 'Orbitron', monospace;
    transition: all 0.3s ease;
    text-align: left;
}

.trivia-option:hover {
    background: rgba(112, 199, 186, 0.1);
    box-shadow: 0 0 5px #70C7BA;
}

.trivia-option.correct {
    background: rgba(39, 174, 96, 0.2);
    border-color: #27ae60;
    color: #27ae60;
}

.trivia-option.incorrect {
    background: rgba(231, 76, 60, 0.2);
    border-color: #e74c3c;
    color: #e74c3c;
}

.skip-button {
    background: transparent;
    border: 1px solid #ff4757;
    color: #ff4757;
    padding: 8px 16px;
    font-family: 'Orbitron', monospace;
    cursor: pointer;
    transition: all 0.3s ease;
}

.skip-button:hover {
    background: rgba(255, 71, 87, 0.1);
    box-shadow: 0 0 5px #ff4757;
}

/* Settings Screen */
.settings-content, .leaderboard-content, .pause-content {
    text-align: center;
    max-width: 800px;
    padding: 30px;
}

.settings-content h2, .leaderboard-content h2, .pause-content h2 {
    font-size: 2.5rem;
    color: #70C7BA;
    text-shadow: 0 0 15px #70C7BA;
    margin-bottom: 20px;
    margin-top: 20px;
    text-align: center;
    width: 100%;
}

.setting-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    padding: 15px;
    border: 1px solid rgba(112, 199, 186, 0.3);
    border-radius: 5px;
    gap: 20px; /* Add spacing between label and control */
}

.setting-group label {
    color: #70C7BA;
    font-weight: 600;
}

.neon-select {
    background: transparent;
    border: 1px solid #70C7BA;
    color: #70C7BA;
    padding: 8px 12px;
    font-family: 'Orbitron', monospace;
    cursor: pointer;
}

.neon-select option {
    background: #1a1a2e;
    color: #70C7BA;
}

input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #70C7BA;
    background: transparent;
    cursor: pointer;
    position: relative;
}

input[type="checkbox"]:checked {
    background: #70C7BA;
}

input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: #0a0a0a;
    font-size: 14px;
    top: -2px;
    left: 2px;
}

/* Leaderboard */
.leaderboard-content {
    max-width: 1000px !important;
}

.leaderboard-list {
    max-height: 550px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.leaderboard-entry {
    display: grid;
    grid-template-columns: 50px 1fr 80px 80px 80px;
    gap: 10px;
    align-items: center;
    padding: 12px 15px;
    margin: 5px 0;
    border: 1px solid rgba(112, 199, 186, 0.3);
    border-radius: 5px;
    background: rgba(112, 199, 186, 0.05);
}

.leaderboard-entry.top3 {
    border-color: #ffa502;
    background: rgba(255, 165, 2, 0.1);
    color: #ffa502;
    text-shadow: 0 0 5px #ffa502;
}

.leaderboard-rank {
    font-weight: 700;
    text-align: center;
}

.leaderboard-name {
    font-weight: 600;
    color: #70C7BA;
}

.leaderboard-mode {
    font-weight: 500;
    color: #ffa502;
    text-align: center;
    font-size: 0.8rem;
}

.leaderboard-score {
    font-weight: 600;
    color: #70C7BA;
    text-align: center;
}

.leaderboard-date {
    font-weight: 400;
    color: rgba(112, 199, 186, 0.7);
    text-align: center;
    font-size: 0.8rem;
}

.leaderboard-mode-section {
    margin-bottom: 30px;
    border: 1px solid rgba(112, 199, 186, 0.3);
    border-radius: 10px;
    padding: 15px;
    background: rgba(112, 199, 186, 0.05);
}

.leaderboard-mode-title {
    color: #70C7BA;
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.2rem;
    text-shadow: 0 0 10px #70C7BA;
    border-bottom: 1px solid rgba(112, 199, 186, 0.3);
    padding-bottom: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .kaspa-logo {
        font-size: 2.5rem;
        padding: 0 30px; /* Responsive padding for tablets */
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .neon-button {
        font-size: 1rem;
        padding: 12px 24px;
    }
    
    .game-over-title {
        font-size: 2rem;
    }
    
    .settings-content, .leaderboard-content, .pause-content {
        padding: 20px;
        max-width: 90%;
    }
    
    .setting-group {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    #gameCanvas {
        width: 100vw;
        height: calc(100vh - 80px); /* Leave space for top UI on mobile */
        top: 80px;
        border: none;
        box-shadow: none;
    }
    
    /* Mobile quick selectors */
    .quick-avatar-selector {
        top: 10px;
        left: 10px;
        padding: 8px 12px;
        flex-direction: column;
        gap: 5px;
        max-width: 140px;
    }
    
    .quick-game-mode-selector {
        top: 10px;
        right: 10px;
        padding: 8px 12px;
        flex-direction: column;
        gap: 5px;
        min-width: 150px; /* Wider on mobile for dropdown */
    }
    
    .quick-avatar-selector label,
    .quick-game-mode-selector label {
        font-size: 0.8rem;
    }
    
    .quick-avatar-dropdown {
        font-size: 0.7rem;
        padding: 4px 8px;
    }
    
    /* Smaller token counter on mobile */
    .tokens {
        font-size: 0.9rem !important;
        right: 20px !important; /* Proper right alignment */
    }
    
    .leaderboard-entry {
        grid-template-columns: 40px 1fr 60px 60px;
        gap: 8px;
        font-size: 0.8rem;
    }
    
    .leaderboard-date {
        display: none;
    }
    
    .leaderboard-mode-section {
        margin-bottom: 20px;
        padding: 10px;
    }
    
    .leaderboard-mode-title {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    .username-input {
        max-width: 250px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .kaspa-logo {
        font-size: 2rem;
        padding: 0 20px; /* Responsive padding for mobile */
    }
    
    /* Game over screen mobile fixes */
    .game-over-content {
        padding: 20px 15px; /* Much tighter mobile padding */
        max-height: 90vh;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        justify-content: flex-start; /* Start from top to allow scrolling */
        gap: 15px; /* Add gap between elements */
    }
    
    .game-over-title {
        font-size: 1.8rem;
        margin-bottom: 10px; /* Tighter margin */
    }
    
    .final-score, .high-score {
        font-size: 1.2rem;
        margin: 3px 0; /* Much tighter margins */
    }
    
    .revival-section {
        padding: 10px;
        margin: 10px 0; /* Tighter revival section spacing */
    }
    
    .trivia-options {
        gap: 8px;
    }
    
    .trivia-option {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    /* Mobile button layout - 2 side by side, 1 below */
    .game-over-buttons {
        gap: 8px; /* Even tighter spacing on mobile */
        margin-top: 15px; /* Less space above buttons */
        max-width: 320px;
        flex-wrap: wrap; /* Allow buttons to wrap to next line */
        justify-content: center;
    }
    
    .game-over-buttons .neon-button {
        font-size: 0.8rem; /* Even smaller font */
        padding: 8px 12px; /* Much smaller padding */
        min-width: 120px; /* Smaller minimum width */
        flex: 1 1 120px; /* Allow buttons to grow but maintain minimum width */
        margin: 2px; /* Add small margin for better spacing */
    }
    
    /* Ensure screen doesn't overflow */
    .screen {
        padding: 10px;
        box-sizing: border-box;
        max-height: 100vh;
        overflow-y: auto;
    }
}

/* Animations for BlockDAG elements */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px #70C7BA; }
    50% { box-shadow: 0 0 20px #70C7BA, 0 0 30px #70C7BA; }
}

@keyframes slideInFromRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInFromLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeInUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.floating {
    animation: float 3s ease-in-out infinite;
}

.glowing {
    animation: glow 2s ease-in-out infinite;
}

.slide-in-right {
    animation: slideInFromRight 0.5s ease-out;
}

.slide-in-left {
    animation: slideInFromLeft 0.5s ease-out;
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.scale-in {
    animation: scaleIn 0.4s ease-out;
}

/* Loading animation for game elements */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spinning {
    animation: spin 2s linear infinite;
}

/* Kaspa-specific visual enhancements */
.kaspa-grid-bg {
    background-image: 
        linear-gradient(rgba(112, 199, 186, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(112, 199, 186, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { background-position: 0 0; }
    100% { background-position: 20px 20px; }
}

/* Enhanced button hover effects */
.neon-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(112, 199, 186, 0.2), transparent);
    transition: left 0.5s;
}

.neon-button:hover::before {
    left: 100%;
}

/* Particle trail effect for UI elements */
.particle-trail {
    position: relative;
    overflow: hidden;
}

.particle-trail::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(112, 199, 186, 0.1) 0%, transparent 70%);
    opacity: 0;
    animation: particleTrail 2s ease-out infinite;
}

@keyframes particleTrail {
    0% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.5); }
}

/* Rules Screen Styles */
.rules-content {
    padding: 30px 20px;
    max-width: 700px;
    margin: 0 auto;
    text-align: left;
    max-height: 90vh;
    overflow-y: auto;
}

.rules-content h2 {
    text-align: center;
    color: #70C7BA;
    font-family: 'Orbitron', monospace;
    font-weight: 900;
    font-size: 2rem;
    margin-bottom: 30px;
    text-shadow: 0 0 10px rgba(112, 199, 186, 0.5);
}

.rules-section {
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(112, 199, 186, 0.05);
    border: 1px solid rgba(112, 199, 186, 0.2);
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

.rules-section h3 {
    color: #70C7BA;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 10px;
    text-shadow: 0 0 5px rgba(112, 199, 186, 0.3);
}

.rules-section p {
    color: #ffffff;
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 8px;
    opacity: 0.9;
}

.rules-section p strong {
    color: #70C7BA;
    font-weight: 700;
}

/* Mobile Rules Styles */
@media (max-width: 768px) {
    .rules-content {
        padding: 20px 15px;
        max-height: 85vh;
    }
    
    .rules-content h2 {
        font-size: 1.5rem;
    }
    
    .rules-section {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .rules-section h3 {
        font-size: 1rem;
    }
    
    .rules-section p {
        font-size: 0.8rem;
    }
}
