/* Base styles */
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000;
    font-family: 'Silkscreen', monospace;
    color: #fff;
    touch-action: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

#gameContainer {
    position: relative;
    width: 95%;
    height: 95%;
    max-width: 1400px;
    max-height: 900px;
    background-color: #000;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

#gameCanvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 20px;
}

/* Mobile message overlay */
#mobileMessage {
    display: none; /* Hidden by default, shown on mobile */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 9999;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#mobileMessage h1 {
    font-size: 24px;
    color: #0af;
    margin-bottom: 20px;
}

#mobileMessage p {
    font-size: 16px;
    margin: 10px 0;
    color: #fff;
}

/* UI Elements */
#gameUI {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
    font-size: 18px;
    text-shadow: 0 0 5px #000;
}

#gameUI > div {
    margin-bottom: 5px;
}

#shield {
    color: #4488ff;
    font-weight: bold;
}

/* Hull integrity status colors */
#hullIntegrity {
    transition: color 0.3s ease;
}

#hullIntegrity.warning {
    color: #ffcc00;
    font-weight: bold;
}

#hullIntegrity.critical {
    color: #ff3300;
    font-weight: bold;
    animation: blinkHull 1s infinite;
}

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

/* Shield recharge animation */
@keyframes pulseShield {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.recharging {
    animation: pulseShield 1.5s infinite;
    color: #22aaff;
}

/* Game screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 200;
    border-radius: 20px;
    padding: 20px 0;
    box-sizing: border-box;
    overflow: hidden;
}

#gameOverScreen, #shopScreen, #pauseScreen {
    display: none;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: 'Silkscreen', monospace;
    text-align: center;
    margin-bottom: 10px;
}

h1 {
    font-size: 48px;
    color: #fff;
    text-shadow: 0 0 10px #0af;
    margin-bottom: 0;
}

h2 {
    font-size: 32px;
    color: #0af;
    margin-top: 5px;
    margin-bottom: 30px;
}

h3 {
    font-size: 20px; 
    color: #fff;
}

h4 {
    font-size: 16px;
    color: #aaf;
    margin-top: 20px;
    margin-bottom: 20px;
}

/* Buttons */
.button, .smallButton {
    background-color: white;
    color: black;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Silkscreen', monospace;
    transition: all 0.2s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.button {
    padding: 10px 20px;
    margin: 10px;
    font-size: 16px;
}

.smallButton {
    padding: 5px 10px;
    font-size: 14px;
    border-radius: 5px;
}

.button:hover, .smallButton:hover {
    background-color: #08f;
    color: white;
    transform: scale(1.05);
}

/* Game buttons container */
#gameButtons {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: row-reverse;
    gap: 10px;
    z-index: 100;
}

#pauseButton, #cargoHoldButton {
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-family: 'Silkscreen', monospace;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
    white-space: nowrap;
    min-width: 80px;
    text-align: center;
}

#pauseButton {
    background-color: #0a4a6b;
    color: white;
    border: 2px solid #0f6f9d;
}

#cargoHoldButton {
    background-color: #0a6b4a;
    color: white;
    border: 2px solid #0f9d6f;
    min-width: 130px;
}

#pauseButton:hover {
    background-color: #0f6f9d;
    transform: scale(1.05);
}

#cargoHoldButton:hover {
    background-color: #0f9d6f;
    transform: scale(1.05);
}

/* Shop items */
.shopItem {
    width: 90%;
    max-width: 450px;
    padding: 10px;
    margin: 8px auto;
    background-color: rgba(0, 100, 200, 0.3);
    border: 1px solid #0af;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0, 170, 255, 0.2);
    text-align: left;
}

.shopItem:hover {
    background-color: rgba(0, 100, 200, 0.5);
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(0, 170, 255, 0.4);
}

.shopItem h3 {
    margin-top: 0;
    margin-bottom: 5px;
    color: #0ff;
    font-size: 18px;
}

.shopItem p {
    margin: 5px 0;
    font-size: 14px;
}

.flash-red {
    animation: flashRed 0.5s alternate 3;
}

@keyframes flashRed {
    from {
        background-color: rgba(255, 0, 0, 0.3);
    }
    to {
        background-color: rgba(255, 0, 0, 0.7);
    }
}

/* Inventory styles */
#inventoryItems {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-bottom: 15px;
}

.inventoryRow {
    display: flex;
    justify-content: space-between;
    padding: 8px 15px;
    background-color: rgba(0, 100, 200, 0.1);
    border-radius: 5px;
    transition: all 0.2s;
}

.inventoryRow:hover {
    background-color: rgba(0, 100, 200, 0.3);
}

.inventoryLabel {
    color: #0ff;
    font-weight: bold;
}

.inventoryValue {
    color: #fff;
}

/* Pause controls */
#pauseControls {
    width: 80%;
    max-width: 400px;
    background-color: rgba(0, 0, 0, 0.7);
    border: 1px solid #0af;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

.controlRow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 8px;
    border-bottom: 1px solid rgba(0, 170, 255, 0.3);
}

.controlLabel {
    color: #0ff;
    font-size: 18px;
}

.sliderContainer {
    flex-grow: 1;
    margin-left: 20px;
}

.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 10px;
    border-radius: 5px;
    background: #2c3e50;
    outline: none;
    opacity: 0.7;
    transition: opacity .2s;
}

.slider:hover {
    opacity: 1;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0af;
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0af;
    cursor: pointer;
}

.controlInfo {
    color: #aaf;
    text-align: center;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.4;
}

.controlInfo p {
    margin: 5px 0;
}

/* Cargo Hold Styles */
.cargoSection {
    background-color: rgba(0, 100, 200, 0.2);
    border: 2px solid #0af;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 12px rgba(0, 170, 255, 0.2);
    transition: all 0.2s;
    text-align: center;
}

.cargoSection h2 {
    color: #0af;
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
    font-size: 24px;
    text-shadow: 0 0 10px rgba(0, 170, 255, 0.5);
    font-family: 'Silkscreen', monospace;
}

.highlight {
    background-color: rgba(0, 170, 255, 0.2);
    border: 1px solid #0af;
    border-radius: 8px;
    padding: 8px;
    margin-top: 10px;
    box-shadow: 0 0 10px rgba(0, 170, 255, 0.3);
}

.highlight .inventoryLabel {
    color: #ffcc00;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255, 204, 0, 0.5);
}

.highlight .inventoryValue {
    color: #ffcc00;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255, 204, 0, 0.5);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    h1 {
        font-size: 36px;
    }
    
    h2 {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    h3 {
        font-size: 16px;
    }
    
    .shopItem {
        padding: 10px;
    }
    
    .shopItem h3 {
        font-size: 16px;
    }
    
    .shopItem p {
        font-size: 14px;
    }
    
    #mobileMessage {
        display: flex;
    }
    
    #gameContainer {
        display: none;
    }
}
