/* JBCave CSS Styles */

body {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #222;
    font-family: Arial, sans-serif;
    overflow: hidden;
    touch-action: none; /* Prevent default touch behaviors */
}

#game-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: 100vh;
    max-height: 600px;
    background-color: #000;
    overflow: hidden; /* Keep content inside container */
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    background-color: #000;
}

/* Improved score display positioning and styling */
#score-display {
    position: absolute;
    top: 10px;
    left: 10px; /* Move to left side instead of right */
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    z-index: 5;
    padding: 5px 10px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    text-shadow: 1px 1px 2px #000;
    transition: all 0.3s ease;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    font-size: 24px;
    overflow-y: auto;
    padding: 20px 0;
    z-index: 10;
    box-sizing: border-box;
}

.menu-title {
    font-size: 42px;
    margin: 15px 0;
    color: #39c;
    text-shadow: 0 0 10px #39c;
}

.high-score {
    font-size: 18px;
    margin: 5px 0;
}

.controls-info {
    font-size: 14px;
    margin-bottom: 15px;
    text-align: center;
    max-width: 80%;
}

.settings-container {
    display: none;
    flex-direction: column;
    margin: 10px 0;
    width: 90%;
    max-width: 500px;
}

.slider-container {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.slider-value {
    width: 40px;
    text-align: right;
}

input[type="range"] {
    width: 100%;
    margin-bottom: 15px;
}

.button-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 10px 0;
}

button {
    margin: 8px 0;
    padding: 8px 16px;
    font-size: 16px;
    cursor: pointer;
    background-color: #39c;
    color: white;
    border: none;
    border-radius: 5px;
    transition: all 0.2s;
    min-width: 180px;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

button:hover {
    background-color: #27a;
    transform: scale(1.05);
}

#start-btn {
    background-color: #4CAF50;
    font-size: 20px;
    padding: 12px 24px;
    min-width: 220px;
}

#start-btn:hover {
    background-color: #45a049;
}

.secondary-btn {
    background-color: #666;
    font-size: 16px;
}

.secondary-btn:hover {
    background-color: #555;
}

/* High Score CSS */
#high-score-input {
    z-index: 20; /* Make sure it's on top */
}

#name-input-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
}

#name-input {
    padding: 8px;
    margin: 10px 0;
    font-size: 18px;
    width: 200px;
    text-align: center;
    display: none; /* Hidden by default */
}

.leaderboard-table {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    border-collapse: collapse;
}

.leaderboard-table th, .leaderboard-table td {
    padding: 6px;
    text-align: left;
    border-bottom: 1px solid #444;
    font-size: 14px;
}

.leaderboard-table th {
    background-color: #333;
    color: #39c;
}

.leaderboard-table tr:nth-child(even) {
    background-color: rgba(57, 153, 204, 0.1);
}

.leaderboard-table tr:hover {
    background-color: rgba(57, 153, 204, 0.2);
}

.loading {
    margin: 10px;
    font-style: italic;
    color: #999;
    font-size: 14px;
}

#leaderboard-container {
    width: 90%;
    max-width: 600px;
    margin: 10px 0;
    padding: 5px;
}

#leaderboard-container h3 {
    text-align: center;
    color: #39c;
    margin: 10px 0;
    font-size: 18px;
}

.leaderboard-tabs {
    display: flex;
    justify-content: center;
    margin: 10px 0;
}

.tab-button {
    padding: 5px 10px;
    margin: 0 5px;
    background-color: #333;
    border: 1px solid #555;
    color: #ccc;
    cursor: pointer;
    font-size: 14px;
    border-radius: 3px;
}

.tab-button.active {
    background-color: #39c;
    color: white;
}

.tab-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.leaderboard-content {
    margin: 10px 0;
}

/* Mobile Optimization */
@media (max-width: 800px) {
    body {
        align-items: flex-start; /* Better positioning on mobile */
    }
    
    #game-container {
        height: 100vh;
        width: 100%;
        max-width: none;
        max-height: none;
    }
    
    canvas {
        width: 100%;
        height: 100%;
    }
    
    button {
        padding: 12px 24px; /* Larger touch targets */
        min-width: 200px;
        margin: 10px 0;
    }
    
    .menu-title {
        font-size: 36px;
        margin-top: 30px;
    }
    
    .overlay {
        padding: 10px;
        justify-content: flex-start;
    }
    #score-display {
        font-size: 20px;
        top: 5px;
        left: 5px;
        padding: 4px 8px;
    }
    
    #score-display.global-best {
        font-size: 22px;
    }
    
    #achievement-notification {
        font-size: 16px;
        top: 40px;
        width: 80%;
        max-width: 300px;
    }
}

/* Landscape mode specific styles */
@media (max-width: 800px) and (orientation: landscape) {
    #game-container {
        height: 100vh;
    }
    
    .overlay {
        padding: 5px;
    }
    
    .menu-title {
        font-size: 28px;
        margin: 5px 0;
    }
    
    .button-container {
        margin: 5px 0;
    }
    
    button {
        padding: 8px 16px;
        margin: 5px 0;
        font-size: 14px;
    }
    
    .controls-info {
        font-size: 12px;
        margin-bottom: 5px;
    }
    
    #leaderboard-container {
        margin: 5px 0;
    }
}

/* Add these styles to your style.css file */

/* Special styling for global high score screens */
#high-score-input.global-high-score h2 {
    color: #FFD700;  /* Gold color */
    text-shadow: 0 0 10px #FFD700, 0 0 20px #FFD700;
    font-size: 32px;
    animation: pulse 1.5s infinite;
}

#high-score-input.global-high-score {
    background-color: rgba(0, 0, 0, 0.9);  /* Darker background */
    border: 2px solid #FFD700;
}

/* Emphasize high score value */
#high-score-input.global-high-score #high-score-value {
    font-size: 26px;
    color: #fff;
    font-weight: bold;
    margin: 15px 0;
}

/* Highlight the submit button for global high scores */
.highlight-btn {
    background-color: #FFD700 !important;
    color: #000 !important;
    font-weight: bold !important;
    box-shadow: 0 0 10px #FFD700;
    transform: scale(1.1);
    animation: pulse 1.5s infinite;
}

.highlight-btn:hover {
    background-color: #FFC107 !important;
    transform: scale(1.15) !important;
}

/* Pulsing animation for important elements */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Date column styling */
.score-date {
    font-size: 12px;
    color: #aaa;
    white-space: nowrap;
    text-align: right !important;
}

/* Add tooltip styling */
[title] {
    position: relative;
    cursor: help;
}

/* Make the table responsive */
.leaderboard-table {
    width: 100%;
    table-layout: fixed;
}

.leaderboard-table th:nth-child(1), 
.leaderboard-table td:nth-child(1) {
    width: 15%;
}

.leaderboard-table th:nth-child(2), 
.leaderboard-table td:nth-child(2) {
    width: 35%;
}

.leaderboard-table th:nth-child(3), 
.leaderboard-table td:nth-child(3) {
    width: 25%;
}

.leaderboard-table th:nth-child(4), 
.leaderboard-table td:nth-child(4) {
    width: 25%;
}

/* For personal scores with only 3 columns */
#personal-leaderboard .leaderboard-table th:nth-child(1),
#personal-leaderboard .leaderboard-table td:nth-child(1) {
    width: 15%;
}

#personal-leaderboard .leaderboard-table th:nth-child(2),
#personal-leaderboard .leaderboard-table td:nth-child(2) {
    width: 50%;
}

#personal-leaderboard .leaderboard-table th:nth-child(3),
#personal-leaderboard .leaderboard-table td:nth-child(3) {
    width: 35%;
}

/* Add these styles to your CSS file for the toggle button */

.toggle-scores-container {
    text-align: center;
    margin: 8px 0;
}

.toggle-scores-btn {
    background-color: #555;
    color: #fff;
    border: none;
    border-radius: 3px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    min-width: 120px;
}

.toggle-scores-btn:hover {
    background-color: #666;
}

/* Alternating row colors for better readability in longer lists */
.leaderboard-table tbody tr:nth-child(odd) {
    background-color: rgba(57, 153, 204, 0.05);
}

.leaderboard-table tbody tr:nth-child(even) {
    background-color: rgba(57, 153, 204, 0.1);
}

/* Smooth transition for expanding/collapsing */
.extra-scores {
    transition: all 0.3s ease;
}

/* Add a subtle divider between initial and expanded scores */
.extra-scores tr:first-child td {
    border-top: 2px dashed #444;
}

/* Status message styling */
.status-message {
    margin: 10px 0;
    padding: 8px;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
    transition: all 0.3s ease;
}

.status-message.error {
    background-color: rgba(255, 0, 0, 0.2);
    color: #ff6666;
    border: 1px solid #ff6666;
}

.status-message.success {
    background-color: rgba(0, 255, 0, 0.1);
    color: #66ff66;
    border: 1px solid #66ff66;
}

.status-message.info {
    background-color: rgba(0, 0, 255, 0.1);
    color: #6666ff;
    border: 1px solid #6666ff;
}

/**
 * Update the CSS for better mobile landscape support
 * Add these to your style.css file
 */

/* Landscape mode specific styles */
@media (max-width: 900px) and (orientation: landscape) {
    /* Improve menu layout for landscape */
    #start-menu {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-around;
        align-content: flex-start;
        overflow-y: auto;
    }
    
    /* Title takes full width */
    .menu-title {
        width: 100%;
        font-size: 28px;
        margin: 5px 0;
        text-align: center;
    }
    
    /* Make columns of content */
    .menu-column {
        width: 48%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    /* High score and controls info */
    .high-score,
    .controls-info {
        font-size: 12px;
        margin: 5px 0;
        text-align: center;
    }
    
    /* Make leaderboard more compact */
    #leaderboard-container {
        max-height: 160px;
        overflow-y: auto;
        margin: 5px 0;
        padding: 2px;
    }
    
    /* Make buttons smaller but still tappable */
    button {
        padding: 8px 12px;
        margin: 5px 0;
        font-size: 14px;
        min-width: 120px;
    }
    
    #start-btn {
        font-size: 16px;
        padding: 10px 16px;
        position: fixed;
        bottom: 10px;
        right: 10px;
        z-index: 100;
    }
    
    .leaderboard-tabs {
        margin: 5px 0;
    }
    
    .tab-button {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .leaderboard-table th, 
    .leaderboard-table td {
        padding: 4px;
        font-size: 12px;
    }
    #score-display {
        font-size: 18px;
        top: 5px;
        left: 5px;
    }
    
    #achievement-notification {
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
    }
}

/* Personal best achievement styling */
#score-display.personal-best {
    color: #39c;
    background-color: rgba(0, 0, 0, 0.7);
    text-shadow: 0 0 10px #39c;
    animation: pulse-personal 2s infinite;
}

/* Global high score achievement styling */
#score-display.global-best {
    color: #FFD700;
    background-color: rgba(0, 0, 0, 0.8);
    text-shadow: 0 0 15px #FFD700;
    animation: pulse-global 1.5s infinite;
    font-size: 26px;
}

/* Achievement notification styling */
#achievement-notification {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    opacity: 0;
    z-index: 10;
    text-align: center;
    pointer-events: none;
    display: none;
}

/* Personal achievement styling */
.personal-achievement {
    border: 2px solid #39c;
    color: #39c;
    text-shadow: 0 0 8px #39c;
}

/* Global achievement styling */
.global-achievement {
    border: 2px solid #FFD700;
    color: #FFD700;
    text-shadow: 0 0 12px #FFD700;
}

/* Achievement animation */
.show-achievement {
    animation: show-notification 3s ease-in-out;
}

/* Pulse animation for personal best */
@keyframes pulse-personal {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* More dramatic pulse for global best */
@keyframes pulse-global {
    0% { transform: scale(1); box-shadow: 0 0 5px #FFD700; }
    50% { transform: scale(1.1); box-shadow: 0 0 20px #FFD700; }
    100% { transform: scale(1); box-shadow: 0 0 5px #FFD700; }
}

/* Notification popup animation */
@keyframes show-notification {
    0% { opacity: 0; transform: translate(-50%, -20px); }
    15% { opacity: 1; transform: translate(-50%, 0); }
    85% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, -20px); }
}

/* Rank achievement notification styling - more subtle than other notifications */
.rank-achievement {
    border: 1px solid #4CAF50; /* Green border */
    color: #4CAF50;
    text-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
    background-color: rgba(0, 0, 0, 0.6);
    font-size: 14px; /* Smaller than other achievements */
    padding: 6px 12px;
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Make rank achievements appear for less time with a quicker animation */
.rank-achievement.show-achievement {
    animation: show-rank-notification 2s ease-in-out; /* Shorter duration */
}

/* Custom animation for rank notifications */
@keyframes show-rank-notification {
    0% { opacity: 0; transform: translate(-50%, -5px); }
    15% { opacity: 0.9; transform: translate(-50%, 0); }
    85% { opacity: 0.9; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, -5px); }
}

/* Specific styling for rank achievements */
#achievement-notification.rank-achievement {
    border: 1px solid #4CAF50; /* Green border */
    color: #4CAF50;
    text-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
    font-size: 12px; /* Smaller than other achievements */
    padding: 4px 10px;
    top: 10px; /* Aligned with score */
    opacity: 0.9;
}

/* Add this to your style.css file */

/* Import Press Start 2P font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* Update main title styling */
.menu-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 48px;
    margin: 25px 0 15px 0;
    color: #39c;
    text-shadow: 0 0 10px #39c, 2px 2px 0px #000;
    letter-spacing: 2px;
    text-align: center;
}

/* High score in top left */
.top-score-display {
    position: absolute;
    top: 15px;
    left: 15px;
    text-align: left;
    z-index: 10;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 5px;
    border: 1px solid #39c;
}

#menu-high-score {
    font-size: 16px;
    margin: 0;
    color: #ffdd57;
    text-shadow: 1px 1px 2px #000;
}

/* Updated main menu content structure */
.menu-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 90%;
    max-width: 600px;
    margin: 20px 0;
}

/* Game controls container */
.game-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

/* Start button styling update */
#start-btn {
    background-color: #4CAF50;
    font-size: 20px;
    font-weight: bold;
    padding: 12px 24px;
    min-width: 220px;
    border-radius: 8px;
    box-shadow: 0 4px 0 #2E7D32, 0 0 10px rgba(76, 175, 80, 0.5);
    transition: all 0.2s;
}

#start-btn:hover {
    background-color: #45a049;
    transform: translateY(2px);
    box-shadow: 0 2px 0 #2E7D32, 0 0 15px rgba(76, 175, 80, 0.7);
}

#start-btn:active {
    transform: translateY(4px);
    box-shadow: none;
}

/* Secondary button styling update */
.secondary-btn {
    background-color: #555;
    font-size: 16px;
    padding: 8px 16px;
    min-width: 180px;
    border-radius: 6px;
    box-shadow: 0 3px 0 #333;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background-color: #666;
    transform: translateY(2px);
    box-shadow: 0 1px 0 #333;
}

/* Help overlay */
.sub-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 20;
}

.help-content {
    background-color: #222;
    border: 2px solid #39c;
    border-radius: 10px;
    padding: 20px;
    max-width: 80%;
    text-align: center;
    box-shadow: 0 0 20px rgba(57, 153, 204, 0.5);
}

.help-content h3 {
    color: #39c;
    margin-top: 0;
}

.help-content p {
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Hide settings button but keep it in DOM */
.hidden-settings {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Updated leaderboard styling */
#leaderboard-container {
    width: 100%;
    max-width: 500px;
    margin: 10px 0;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid #39c;
    padding: 10px;
}

#leaderboard-container h3 {
    text-align: center;
    color: #39c;
    margin: 5px 0 10px 0;
    font-size: 20px;
    font-family: 'Press Start 2P', cursive;
    font-size: 16px;
}

/* Updated tabs styling */
.leaderboard-tabs {
    display: flex;
    justify-content: center;
    margin: 10px 0;
    gap: 5px;
}

.tab-button {
    padding: 8px 15px;
    background-color: #333;
    border: 1px solid #555;
    color: #ccc;
    cursor: pointer;
    font-size: 14px;
    border-radius: 5px;
    transition: all 0.2s;
}

.tab-button.active {
    background-color: #39c;
    color: white;
    border-color: #39c;
    box-shadow: 0 0 10px rgba(57, 153, 204, 0.5);
}

.tab-button:hover:not(.active) {
    background-color: #444;
    border-color: #666;
}

/* Updated table styling */
.leaderboard-table {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    border-collapse: collapse;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.leaderboard-table th {
    background-color: #2a2a2a;
    color: #39c;
    padding: 8px;
    text-align: left;
    font-size: 14px;
}

.leaderboard-table td {
    padding: 8px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid #333;
}

.leaderboard-table tr:nth-child(odd) {
    background-color: rgba(0, 0, 0, 0.2);
}

.leaderboard-table tr:nth-child(even) {
    background-color: rgba(57, 153, 204, 0.05);
}

.leaderboard-table tr:hover {
    background-color: rgba(57, 153, 204, 0.1);
}

/* Responsive adjustments */
@media (max-width: 800px) {
    .menu-title {
        font-size: 32px;
        margin: 20px 0 10px 0;
    }
    
    .top-score-display {
        top: 10px;
        left: 10px;
    }
    
    #menu-high-score {
        font-size: 14px;
    }
    
    .help-content {
        padding: 15px;
        max-width: 90%;
    }
}

/* Landscape mode adjustments */
@media (max-width: 800px) and (orientation: landscape) {
    .menu-title {
        font-size: 28px;
        margin: 10px 0 5px 0;
    }
    
    .top-score-display {
        top: 5px;
        left: 5px;
    }
    
    #menu-high-score {
        font-size: 12px;
    }
    
    .menu-content {
        margin: 5px 0;
    }
    
    .game-controls {
        margin-top: 5px;
    }
    
    #start-btn {
        padding: 8px 16px;
        font-size: 16px;
    }
}

/* Add these layout fixes to your CSS */

/* Make the overlay use flex with better spacing */
#start-menu {
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* This will push content to edges, maximizing space */
    padding: 10px 0; /* Reduce vertical padding */
    max-height: 100vh; /* Ensure it doesn't exceed viewport height */
    overflow: hidden; /* Hide overflow to prevent scrolling */
    box-sizing: border-box; /* Include padding in height calculation */
}

/* Adjust title to take less vertical space */
.menu-title {
    font-size: 38px; /* Slightly smaller */
    margin: 10px 0; /* Less margin */
}

/* Make leaderboard more compact */
#leaderboard-container {
    margin: 5px 0;
    max-height: calc(60vh - 120px); /* Limit height to prevent overflow */
    overflow-y: auto; /* Allow scrolling within leaderboard if needed */
}

/* Reduce some spacing in the leaderboard */
.leaderboard-table th, 
.leaderboard-table td {
    padding: 5px 8px;
}

/* Reduce spacing around High Scores heading */
#leaderboard-container h3 {
    margin: 3px 0 5px 0;
}

/* Position the start button better */
.game-controls {
    margin: 10px 0 15px 0; /* More space at bottom */
    padding-bottom: 5px;
}

/* Make tabs more compact */
.leaderboard-tabs {
    margin: 5px 0;
}

/* For really small screens, make everything more compact */
@media (max-height: 600px) {
    .menu-title {
        font-size: 32px;
        margin: 5px 0;
    }
    
    #leaderboard-container {
        max-height: calc(60vh - 80px);
    }
    
    .leaderboard-table th, 
    .leaderboard-table td {
        padding: 3px 5px;
        font-size: 12px;
    }
    
    .game-controls {
        margin: 5px 0 10px 0;
    }
    
    #start-btn {
        padding: 8px 16px;
        font-size: 16px;
        min-width: 180px;
    }
}

/* For very small screens, consider stacking in a different way */
@media (max-height: 500px) {
    #start-menu {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-content: center;
    }
    
    .menu-title {
        width: 100%;
        font-size: 28px;
        margin: 0;
    }
    
    #leaderboard-container {
        width: 70%;
        max-height: 70vh;
    }
    
    .game-controls {
        width: 30%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
}

#start-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #4CAF50;
    padding: 10px 24px;
    min-width: 220px;
    border-radius: 8px;
    box-shadow: 0 4px 0 #2E7D32, 0 0 10px rgba(76, 175, 80, 0.5);
    transition: all 0.2s;
    line-height: 1.2;
  }
  
  #start-btn .main-text {
    font-size: 20px;
    font-weight: bold;
  }
  
  #start-btn .sub-text {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 3px;
  }
  
  #start-btn:hover {
    background-color: #45a049;
    transform: translateY(2px);
    box-shadow: 0 2px 0 #2E7D32, 0 0 15px rgba(76, 175, 80, 0.7);
  }
  
  #start-btn:active {
    transform: translateY(4px);
    box-shadow: none;
  }
  
  /* For smaller screens, adjust padding */
  @media (max-height: 600px) {
    #start-btn {
      padding: 8px 16px;
    }
    
    #start-btn .main-text {
      font-size: 16px;
    }
    
    #start-btn .sub-text {
      font-size: 10px;
      margin-top: 2px;
    }
  }

/* Pause Menu Styling */
#pause-menu {
    z-index: 15; /* Make sure it's above game but below high score input */
    background-color: rgba(0, 0, 0, 0.85);
}

#pause-menu h2 {
    color: #39c;
    text-shadow: 0 0 8px #39c;
    margin-bottom: 10px;
    font-family: 'Press Start 2P', monospace, sans-serif;
    font-size: 28px;
}

#pause-score {
    font-size: 24px;
    margin: 15px 0;
    color: white;
}

/* Countdown Animation */
#countdown-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 16;
}

#countdown {
    font-size: 80px;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 15px #39c, 0 0 30px #39c;
    animation: countdown-pulse 1s infinite alternate;
}

@keyframes countdown-pulse {
    from { transform: scale(1.0); opacity: 0.8; }
    to { transform: scale(1.2); opacity: 1; }
}

/* Resume button styling */
#resume-btn {
    background-color: #3498db; /* Blue for resume */
    box-shadow: 0 4px 0 #2980b9, 0 0 10px rgba(52, 152, 219, 0.5);
}

#resume-btn:hover {
    background-color: #2980b9;
    box-shadow: 0 2px 0 #2272a8, 0 0 15px rgba(52, 152, 219, 0.7);
}

#restart-from-pause-btn {
    background-color: #4CAF50; /* Green for restart */
    box-shadow: 0 4px 0 #2E7D32, 0 0 10px rgba(76, 175, 80, 0.5);
}

#restart-from-pause-btn:hover {
    background-color: #45a049;
    box-shadow: 0 2px 0 #2E7D32, 0 0 15px rgba(76, 175, 80, 0.7);
}

@media (max-width: 500px) {
    #achievement-notification {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    #achievement-notification.rank-achievement {
        font-size: 11px;
        padding: 3px 8px;
    }
}

/* Title at the top */
.menu-title {
    flex-shrink: 0; /* Prevent title from shrinking */
    margin: 15px 0 10px 0;
}

/* Center section with scores can scroll internally */
.menu-content {
    flex: 1; /* Take available space */
    overflow-y: auto; /* Allow scrolling here */
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 5px 0;
}

/* Keep leaderboard headings visible */
#leaderboard-container h3,
.leaderboard-tabs {
    position: sticky;
    top: 0;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 2;
    padding: 5px 0;
}

/* Style for scrollbar in menu content */
.menu-content::-webkit-scrollbar {
    width: 6px;
}

.menu-content::-webkit-scrollbar-track {
    background: rgba(57, 153, 204, 0.1);
}

.menu-content::-webkit-scrollbar-thumb {
    background-color: #39c;
    border-radius: 3px;
}

/* Ensure the game controls are always visible at the bottom */
.game-controls {
    flex-shrink: 0; /* Prevent shrinking */
    margin: 10px 0 15px 0;
    padding: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Make just the leaderboard content scrollable */
#leaderboard-container {
    max-height: 350px; /* Fixed height - adjust as needed */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Keep the table header visible */
#leaderboard-container h3,
.leaderboard-tabs {
    flex-shrink: 0; /* Don't let these shrink */
}

/* Make the actual leaderboard content area scrollable */
.leaderboard-content {
    overflow-y: auto; /* Only this part scrolls */
    max-height: 280px; /* Adjust as needed */
}

/* Style scrollbar for better visibility */
.leaderboard-content::-webkit-scrollbar {
    width: 6px;
}

.leaderboard-content::-webkit-scrollbar-track {
    background: rgba(57, 153, 204, 0.1);
    border-radius: 3px;
}

.leaderboard-content::-webkit-scrollbar-thumb {
    background-color: #39c;
    border-radius: 3px;
}
#high-score-input.global-high-score h2 {
    color: #FFD700;  /* Gold color */
    text-shadow: 0 0 10px #FFD700, 0 0 20px #FFD700;
    font-size: 32px;
    animation: pulse 1.5s infinite;
}

#high-score-input.global-high-score {
    background-color: rgba(0, 0, 0, 0.9);  /* Darker background */
    border: 2px solid #FFD700;
}

/* NEW: Leaderboard qualification styling (for top 15 scores) */
#high-score-input.leaderboard-score h2 {
    color: #39c;  /* Blue color (matches game theme) */
    text-shadow: 0 0 10px #39c, 0 0 15px #39c;
    font-size: 28px;
    animation: pulse 2s infinite;
}

#high-score-input.leaderboard-score {
    background-color: rgba(0, 0, 0, 0.85);
    border: 2px solid #39c;
}

/* Emphasize high score value for leaderboard qualification */
#high-score-input.leaderboard-score #high-score-value {
    font-size: 24px;
    color: #fff;
    font-weight: bold;
    margin: 15px 0;
}

/* You could also add a subtitle to clarify further */
#high-score-input.leaderboard-score h2::after {
    content: "Enter your name to join the top players!";
    display: block;
    font-size: 14px;
    color: #ccc;
    margin-top: 8px;
    font-weight: normal;
    text-shadow: none;
}

/* Add styling for the personal best score screen */

/* Personal best score styling */
#high-score-input.personal-best-score h2 {
    color: #39c;  /* Blue color (matches game theme) */
    text-shadow: 0 0 8px #39c;
    font-size: 24px;
}

#high-score-input.personal-best-score {
    background-color: rgba(0, 0, 0, 0.8);
    border: 1px solid #39c;
}

/* Emphasize high score value for personal best */
#high-score-input.personal-best-score #high-score-value {
    font-size: 22px;
    color: #fff;
    margin: 10px 0;
}

/* Add subtitle for personal best */
#high-score-input.personal-best-score h2::after {
    content: "You beat your previous personal record!";
    display: block;
    font-size: 14px;
    color: #ccc;
    margin-top: 8px;
    font-weight: normal;
    text-shadow: none;
}

/* Warning status message */
.status-message.warning {
    background-color: rgba(255, 165, 0, 0.2);
    color: #ffa500;
    border: 1px solid #ffa500;
}

/* Flagged score in leaderboard */
.flagged-score {
    position: relative;
}

.flagged-score::after {
    content: "⚠️";
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    color: #ffa500;
    font-size: 14px;
}

/* Hacker console animation effect */
@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink {
    0%, 100% { border-color: transparent }
    50% { border-color: #0f0 }
}

.typing-text {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid #0f0;
    animation: 
        typing 3.5s steps(40, end),
        blink 0.75s step-end infinite;
}