/* Run Ape Game Styles */

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

@keyframes neonPulse {
    0% { text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #ff0000, 0 0 20px #ff0000, 0 0 25px #ff0000; }
    50% { text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #ff0000, 0 0 40px #ff0000, 0 0 50px #ff0000; }
    100% { text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #ff0000, 0 0 20px #ff0000, 0 0 25px #ff0000; }
}

@keyframes arcadeFlicker {
    0% { opacity: 1.0; }
    92% { opacity: 1.0; }
    93% { opacity: 0.8; }
    94% { opacity: 1.0; }
    98% { opacity: 1.0; }
    99% { opacity: 0.5; }
    100% { opacity: 1.0; }
}

@keyframes scanline {
    0% { transform: translateY(0); }
    100% { transform: translateY(100dvh); }
}

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

@keyframes letterFloat {
    0% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0); }
}

@keyframes countdown {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.7; }
    100% { transform: scale(1); opacity: 0.3; }
}

@keyframes imageFloat {
    0% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0); }
}

:root {
    --primary-color: #000000;
    --secondary-color: #f0f0f0;
    --accent-color: #ff0000;
    --accent-glow: #ff3333;
    --text-color: #ffffff;
    --background-color: #000000;
    --border-color: #00ffff;
    --shadow-color: rgba(255, 0, 0, 0.5);
    --game-width: 800px;
    --game-height: 450px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

html, body {
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100dvh;
    overflow: hidden !important;
    position: fixed;
    touch-action: manipulation;
    background-color: #000033;
    background-image: url('assets/images/bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer and Edge */
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none;
}

/* Global scroll bar hiding for all elements except leaderboard content */
*:not(#leaderboardContent)::-webkit-scrollbar {
    display: none;
}

*:not(#leaderboardContent) {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

body {
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#gameContainer {
    position: relative;
    width: 100%;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #000;
    background-image: url('assets/images/bg.png');
    background-size: cover;
    background-position: center;
    touch-action: manipulation;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

#gameCanvas {
    display: block;
    background-color: transparent;
    margin: 0 auto;
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100dvh;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
    border: 2px solid var(--accent-color);
    touch-action: none; /* Prevent browser handling of touch events */
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    image-rendering: -webkit-optimize-contrast; /* Improve image quality on Safari */
    image-rendering: crisp-edges; /* Modern browsers */
    object-fit: contain;
}

/* Scanline effect for arcade feel */
#gameContainer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
    animation: scanline 8s linear infinite;
    pointer-events: none;
    z-index: 10;
    display: none; /* Hide the scanline */
}

/* Control instructions that will be shown inside the canvas */
.control-text {
    font-size: 12px;
    color: var(--text-color);
    margin-top: 10px;
    text-align: center;
}

.control-text p {
    margin: 5px 0;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: arcadeFlicker 10s infinite;
}

.overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
}

.overlay-content {
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    padding: 30px;
    margin: 0 auto;
    width: 80%;
    max-width: 600px;
    position: relative;
    animation: fadeIn 1s;
    color: #fff;
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 20px var(--shadow-color);
    text-align: center;
    z-index: 2;
}

.overlay-content::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle,
        transparent 30%,
        rgba(0, 0, 0, 0.5) 100%
    );
    pointer-events: none;
}

/* Arcade-style title with individual letters */
.arcade-title {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.title-letter {
    font-size: 48px;
    color: var(--accent-color);
    text-shadow: 0 0 10px var(--accent-glow);
    margin: 0 5px;
    animation: neonPulse 2s infinite;
    display: inline-block;
    transform-origin: center;
}

.title-letter:nth-child(1) { animation-delay: 0s; }
.title-letter:nth-child(2) { animation-delay: 0.1s; }
.title-letter:nth-child(3) { animation-delay: 0.2s; }
.title-letter:nth-child(4) { width: 20px; }
.title-letter:nth-child(5) { animation-delay: 0.3s; }
.title-letter:nth-child(6) { animation-delay: 0.4s; }
.title-letter:nth-child(7) { animation-delay: 0.5s; }

.arcade-subtitle {
    font-size: 16px;
    color: #00ffff;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.7);
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.game-over-title {
    font-size: 42px;
    margin-bottom: 20px;
    color: #ff0000;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.7);
    letter-spacing: 3px;
    animation: neonPulse 1s infinite;
}

.menu-character {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    position: relative;
}

.character-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: imageFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 0 8px var(--accent-color));
}

.pixel-art-explosion {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background-color: #ff0000;
    clip-path: polygon(
        50% 0%, 61% 35%, 98% 35%,
        68% 57%, 79% 91%, 50% 70%,
        21% 91%, 32% 57%, 2% 35%,
        39% 35%
    );
    animation: letterFloat 1s ease-in-out infinite;
}

.insert-coin {
    font-size: 16px;
    color: #ffff00;
    margin: 20px 0;
    text-shadow: 0 0 5px rgba(255, 255, 0, 0.7);
    animation: blink 1s infinite;
}

.continue-text {
    font-size: 24px;
    color: #ffff00;
    margin: 10px 0;
    text-shadow: 0 0 5px rgba(255, 255, 0, 0.7);
    animation: blink 1s infinite;
}

.countdown {
    font-size: 36px;
    color: #ff0000;
    margin: 10px 0 20px;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.7);
    animation: countdown 1s infinite;
}

.credits {
    font-size: 12px;
    color: #888;
    margin-top: 20px;
    letter-spacing: 1px;
}

.overlay-content p {
    margin-bottom: 20px;
    font-size: 16px;
    color: #00ffff;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.7);
}

#finalScore {
    font-size: 28px;
    margin: 20px 0;
    color: #ffff00;
    text-shadow: 0 0 10px rgba(255, 255, 0, 0.7);
}

.buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

.arcade-button {
    background-color: #000;
    color: var(--accent-color);
    border: 3px solid var(--accent-color);
    padding: 15px 30px;
    font-size: 18px;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.2s ease;
    box-shadow: 0 0 10px var(--shadow-color);
    text-shadow: 0 0 5px var(--accent-glow);
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
}

.arcade-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: 0.5s;
}

.arcade-button:hover {
    transform: translateY(-2px);
    background-color: rgba(255, 0, 0, 0.2);
    box-shadow: 0 0 15px var(--shadow-color);
}

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

.arcade-button:active {
    transform: translateY(1px);
    box-shadow: 0 0 5px var(--shadow-color);
}

/* Leaderboard Modal Styles */
.modal {
    display: none !important;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s;
    z-index: 3000; /* Above overlays and all other elements */
}

/* Force initial hidden state */
#leaderboardModal {
    display: none !important;
    z-index: 3000; /* Ensure it appears above all other elements */
}

.modal-content {
    background-color: #000;
    margin: 10% auto;
    padding: 20px;
    border: 2px solid #ff0000;
    border-radius: 5px;
    width: 60%; /* Narrower width for desktop */
    max-width: 600px; /* Smaller max-width */
    position: relative;
    animation: modalSlideIn 0.3s;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
}

/* Animation for modal appearance */
@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 0, 0, 0.3);
}

.modal-header h2 {
    color: #ff0000;
    margin: 0;
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.3);
    font-size: 1.5rem;
}

.close {
    color: #ff0000;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.close:hover {
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.7);
    transform: scale(1.1);
}

.modal-body {
    margin-top: 15px;
    max-height: 60dvh;
    overflow-y: auto;
}

.modal-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    color: #fff;
    margin-top: 10px;
    table-layout: fixed; /* Fixed table layout for better column alignment */
}

.modal-body th {
    background-color: rgba(255, 0, 0, 0.2);
    padding: 10px;
    text-align: center;
    color: #ff0000;
    font-weight: normal;
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.3);
}

.modal-body td {
    padding: 8px;
    border-bottom: 1px solid rgba(255, 0, 0, 0.1);
    text-align: center; /* Center align all cells for consistency */
}

/* Specific column widths for better alignment */
.modal-body th:nth-child(1), 
.modal-body td:nth-child(1) {
    width: 15%; /* Rank column */
}

.modal-body th:nth-child(2),
.modal-body td:nth-child(2) {
    width: 15%; /* Ape column */
}

.modal-body th:nth-child(3),
.modal-body td:nth-child(3) {
    width: 45%; /* User column */
    text-align: left; /* Left align user names */
}

.modal-body th:nth-child(4),
.modal-body td:nth-child(4) {
    width: 25%; /* Score column */
}

.modal-body tr:nth-child(even) {
    background-color: rgba(50, 0, 0, 0.2);
}

.modal-body tr.current-user {
    background-color: rgba(255, 0, 0, 0.2);
    font-weight: bold;
}

.modal-body tr:hover {
    background-color: rgba(255, 0, 0, 0.1);
}

/* Force leaderboard modal to display when visible regardless of other states */
#leaderboardModal.force-show {
    display: block !important;
}

/* Ensure leaderboard modal appears above game over screen on desktop too */
body.game-over #leaderboardModal,
body.game-over #leaderboardModal.force-show {
    z-index: 10000 !important;
    display: block !important;
}

#difficultyBar {
    position: absolute;
    top: 100px;
    left: 20px;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 5px;
    width: 200px;
    z-index: 10;
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 10px var(--shadow-color);
    display: none; /* Hide the external difficulty bar */
}

#difficultyText {
    font-size: 14px;
    margin-bottom: 5px;
    color: var(--accent-color);
    text-shadow: 0 0 5px var(--accent-glow);
    letter-spacing: 1px;
}

#difficultyProgress {
    width: 100%;
    height: 10px;
    background-color: #333;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--accent-color);
}

#difficultyFill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), #00ffff);
    width: 0%;
    transition: width 0.5s ease;
    box-shadow: 0 0 5px var(--accent-glow);
}

#difficultyNotification {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: var(--accent-color);
    padding: 15px 30px;
    border-radius: 5px;
    font-size: 24px;
    display: none;
    z-index: 50;
    text-align: center;
    animation: fadeIn 0.5s;
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 20px var(--shadow-color);
    text-shadow: 0 0 10px var(--accent-glow);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}



/* Mobile Touch Controls */
.mobile-controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    display: none; /* Hidden by default, shown on mobile */
}

.mobile-controls.active {
    display: block;
}

/* Virtual Thumbstick */
.thumbstick-container {
    position: absolute;
    bottom: 30px;
    left: 30px;
    width: 120px;
    height: 120px;
    pointer-events: auto;
}

.thumbstick-base {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(34, 139, 34, 0.3), rgba(34, 139, 34, 0.1));
    border: 3px solid rgba(34, 139, 34, 0.6);
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.thumbstick-knob {
    position: absolute;
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, #32CD32, #228B22);
    border: 2px solid #FFD700;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.1s ease;
}

.thumbstick-knob.active {
    background: radial-gradient(circle, #90EE90, #32CD32);
    border-color: #FFA500;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

/* Fire Button */
.fire-button {
    position: absolute;
    bottom: 30px;
    right: 30px;
    width: 80px;
    height: 80px;
    pointer-events: auto;
}

.fire-button-inner {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, #ff4444 0%, #cc0000 100%);
    border: 3px solid #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    box-shadow: 0 4px 15px rgba(255, 68, 68, 0.4);
    transition: all 0.1s ease;
    user-select: none;
}

.fire-button-inner:active,
.fire-button-inner.active {
    transform: scale(0.9);
    background: radial-gradient(circle, #ff6666 0%, #ff0000 100%);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.8);
}

/* Control hints in start screen */
.arcade-subtitle {
    color: #00ffff;
    font-size: 16px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 0 #000;
}

.menu-character + p {
    color: #ffff00;
    font-size: 12px;
    margin: 10px 0;
    text-shadow: 1px 1px 0 #000;
}

.menu-character + p + p {
    color: #ff8800;
    font-size: 10px;
    margin: 5px 0;
    text-shadow: 1px 1px 0 #000;
}

/* Game elements styling */
.difficulty-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: #00ff00;
    padding: 5px 10px;
    border-radius: 5px;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    border: 1px solid #00ff00;
    z-index: 100;
}

/* Platform and enemy visual enhancements */
.game-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: #ffffff;
    padding: 20px;
    border-radius: 10px;
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    text-align: center;
    z-index: 1000;
    border: 2px solid #00ff00;
    max-width: 300px;
    display: none;
}

.game-hint.show {
    display: block;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from { transform: translate(-50%, -60%); opacity: 0; }
    to { transform: translate(-50%, -50%); opacity: 1; }
}



@media (max-width: 999px) {
    #scoreContainer {
        top: 10px;
        right: 10px;
        font-size: 14px;
        padding: 8px;
        max-width: 45%;
    }
    
    .title-letter {
        font-size: 36px;
    }
    
    .arcade-subtitle {
        font-size: 14px;
    }
    
    .game-over-title {
        font-size: 32px;
    }
    
    .arcade-button {
        padding: 12px 24px;
        font-size: 16px;
        min-height: 44px;
    }
    
    .control-text {
        font-size: 10px;
        position: absolute;
        bottom: 10px;
        left: 10px;
        background-color: rgba(0, 0, 0, 0.7);
        padding: 8px;
        border-radius: 5px;
        border: 1px solid var(--accent-color);
        max-width: 45%;
    }
    
    .modal-content {
        margin: 15% auto;
        padding: 15px;
    }
    
    .modal-header h2 {
        font-size: 20px;
    }
    
    #difficultyBar {
        top: 10px;
        left: 10px;
        width: 45%;
        padding: 5px;
    }
    
    #difficultyProgress {
        height: 8px;
    }
    
    #difficultyNotification {
        font-size: 20px;
        padding: 10px 20px;
    }
    
    .menu-character {
        width: 100px;
        height: 100px;
    }
    
    .countdown {
        font-size: 30px;
    }

    .buttons {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    /* Show mobile controls on tablets and phones */
    .mobile-controls.active {
        display: block;
    }
    
    /* Adjust thumbstick size for mobile */
    .thumbstick-container {
        width: 100px;
        height: 100px;
        bottom: 20px;
        left: 20px;
    }
    
    .thumbstick-knob {
        width: 40px;
        height: 40px;
    }
    
    .fire-button {
        width: 70px;
        height: 70px;
        bottom: 20px;
        right: 20px;
    }
    
    .fire-button-inner {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    #scoreContainer {
        top: 5px;
        right: 5px;
        font-size: 10px;
        padding: 5px;
        max-width: 45%;
    }
    
    .overlay-content {
        padding: 20px;
        width: 95%;
    }
    
    .title-letter {
        font-size: 24px;
        margin: 0 2px;
    }
    
    .arcade-subtitle {
        font-size: 12px;
    }
    
    .game-over-title {
        font-size: 24px;
    }
    
    .arcade-button {
        padding: 10px 20px;
        font-size: 14px;
        margin: 5px 0;
        min-height: 44px;
    }
    
    .control-text {
        font-size: 8px;
        max-width: 45%;
    }
    
    .modal-body {
        max-height: 300px;
    }
    
    .modal-body th,
    .modal-body td {
        padding: 8px;
        font-size: 12px;
    }
    
    .buttons {
        gap: 8px;
    }
    
    #difficultyBar {
        top: 5px;
        left: 5px;
        width: 45%;
        padding: 5px;
    }
    
    #difficultyProgress {
        height: 6px;
    }
    
    #difficultyNotification {
        font-size: 16px;
        padding: 8px 16px;
        width: 80%;
    }
    
    .menu-character {
        width: 80px;
        height: 80px;
        margin-bottom: 15px;
    }
    
    .insert-coin, .continue-text {
        font-size: 14px;
    }
    
    .countdown {
        font-size: 24px;
    }
    
    .credits {
        font-size: 10px;
    }

    #gameContainer::after {
        display: none;
    }
}

@media (max-width: 999px) and (orientation: portrait) {
    /* Portrait mode with full screen rotated canvas */
    html, body {
        overflow: hidden !important;
        height: 100dvh;
        width: 100vw;
        margin: 0;
        padding: 0;
        position: fixed;
    }
    
    #gameContainer {
        width: 100vw;
        height: 100dvh;
        position: fixed;
        top: 0;
        left: 0;
        overflow: hidden;
        padding: 0;
        margin: 0;
        box-sizing: border-box;
        display: block !important;
        align-items: unset !important;
        justify-content: unset !important;
        flex-direction: unset !important;
    }
    
    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100dvh;
        z-index: 2000;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .buttons {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .arcade-button {
        width: 80%;
        max-width: 250px;
        margin: 4px 0;
        padding: 12px 16px;
        font-size: 0.8rem;
        min-height: 44px;
    }
    
    .control-text {
        position: absolute;
        bottom: 15px;
        left: 50%;
        transform: translateX(-50%);
        max-width: 90%;
        text-align: center;
        font-size: 0.7rem;
    }
}

/* Ensure landscape mode doesn't interfere with portrait */
@media (max-width: 999px) and (orientation: landscape) {
    html, body {
        overflow: hidden !important;
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
    }
    
    #gameContainer {
        width: 100%;
        height: 100dvh;
        max-width: 100vw;
        max-height: 100dvh;
        overflow: hidden;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }
    
    .buttons {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .arcade-button {
        width: auto;
        margin: 0;
    }
    
    .control-text {
        bottom: 5px;
        max-width: 30%;
    }
    
    .overlay-content {
        max-height: 85dvh;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 10px;
        box-sizing: border-box;
    }
}

/* Hide mobile controls on desktop */
@media (min-width: 1000px) {
    .mobile-controls {
        display: none !important;
    }
}

/* For desktop, ensure smaller modal width */
@media (min-width: 1024px) {
    .modal-content {
        width: 50%;
        max-width: 500px;
    }
    
    .overlay-content {
        width: 50%;
        max-width: 500px;
        padding: 25px;
    }
} 