body {
    font-family: 'Press Start 2P', cursive;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: #333;
    user-select: none; /* Prevent text selection */
    margin: 0; /* Reset default body margin */
    padding: 0; /* Reset default body padding */
    overflow: hidden; /* Hide overflow if game container is larger than screen */
}

#game-container {
    /* position: relative; Removed as leaderboard is now outside */
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
    border: 4px solid #333;
    z-index: 1; /* Ensure it's above the background, below fixed elements */
}

#leaderboard-button {
    /* Position relative to the viewport */
    position: fixed; 
    top: 20px; /* Add some padding from the top */
    left: 20px; /* Add some padding from the left */
    font-family: 'Press Start 2P', cursive;
    background-color: #555; /* Dark grey */
    color: white;
    border: 2px solid #333;
    padding: 8px 15px;
    font-size: 0.7em;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: 0 2px #333; /* Button shadow */
    z-index: 10; /* Ensure it's above the game container */
}

#leaderboard-button:hover {
    background-color: #444;
}

#leaderboard-button:active {
    transform: translateY(2px); /* Push button down */
    box-shadow: none; /* Remove shadow on click */
}

#leaderboard-overlay {
    /* position: relative; Removed as leaderboard is now outside */
    background-color: #fff;
    padding-left: 100px;
    padding-right: 100px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
    border: 4px solid #333;
    z-index: 2; /* Ensure it's above the background, below fixed elements */
}

#leaderboard-content {
    background: #fff;
    text-align: center;
}

#leaderboard-table th,
#leaderboard-table td {
    padding: 12px 20px;
    text-align: center;
}

h1 {
    color: #f7931a; /* Bitcoin orange */
    text-shadow: 2px 2px #333;
    margin-bottom: 30px;
}

#score-container {
    font-size: 2em;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#bitcoin-logo {
    width: 40px;
    height: 40px;
    margin-right: 15px;
    vertical-align: middle;
    animation: spin 5s linear infinite;
}

#click-button {
    font-family: 'Press Start 2P', cursive;
    background-color: #f7931a;
    color: white;
    border: 2px solid #333;
    padding: 15px 30px;
    font-size: 1.2em;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    margin-bottom: 30px;
    box-shadow: 0 4px #e68918; /* Button shadow */
}

#click-button:hover {
    background-color: #e68918;
}

#click-button:active {
    transform: translateY(4px); /* Push button down */
    box-shadow: none; /* Remove shadow on click */
}

#upgrades-container {
    margin-top: 20px;
    border-top: 2px dashed #ccc;
    padding-top: 20px;
    /* Add scrolling */
    max-height: 350px; /* Adjust this value to fit approximately 3 upgrades */
    overflow-y: auto; /* Add vertical scrollbar when content exceeds max-height */
    border: 2px solid #ccc; /* Add a border around the scrollable area */
    padding: 20px; /* Add padding inside the scrollable area */
    border-radius: 5px;
    background-color: #f9f9f9; /* Slightly different background */
}

h2 {
    font-size: 1.5em;
    margin-top: 0; /* Reset default margin */
    margin-bottom: 20px;
    color: #555;
    text-align: center; /* Center the heading within the scrollable container */
}

.upgrade {
    background-color: #eee;
    border: 2px solid #ccc;
    padding: 15px;
    margin-bottom: 15px; /* Add margin between upgrades */
    border-radius: 5px;
    text-align: left;
}

.upgrade h3 {
    font-size: 1em;
    margin-top: 0;
    margin-bottom: 5px;
}

.upgrade p {
    font-size: 0.8em;
    margin-top: 0;
    margin-bottom: 10px;
    color: #666;
}

.upgrade button {
    font-family: 'Press Start 2P', cursive;
    background-color: #aaa; /* Default grey background */
    color: white;
    border: 2px solid #333;
    padding: 8px 15px;
    font-size: 0.8em;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
    box-shadow: 0 2px #888; /* Default grey shadow */
}

.upgrade button.affordable {
    background-color: #4CAF50; /* Green */
    box-shadow: 0 2px #39843c; /* Green shadow */
}

.upgrade button:hover:not(:disabled) {
    background-color: #39843c;
}

.upgrade button:active:not(:disabled) {
     transform: translateY(2px);
     box-shadow: none;
}

.upgrade button:disabled {
    background-color: #aaa;
    cursor: not-allowed;
    box-shadow: 0 2px #888;
}

.upgrade button:disabled.affordable {
    animation: none;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}