body {
    margin: 0;
    padding: 0;
    background-color: #000;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

canvas {
    display: block;
    background-color: #222;
    width: 100%;
    height: 100%;
    object-fit: contain; 
    image-rendering: pixelated; 
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

#ui-layer, #start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

#start-screen {
    pointer-events: auto;
    background-color: #000; 
    background-size: cover;
    z-index: 110; 
    overflow: hidden; 
}

#menu-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; 
    background: transparent;
}

@keyframes pulse-glow {
    0% {
        transform: scale(1);
        text-shadow: 0 0 15px rgba(255, 0, 60, 0.8), 0 0 40px rgba(255, 0, 60, 0.4);
    }
    50% {
        transform: scale(1.05);
        text-shadow: 0 0 30px rgba(255, 0, 60, 1), 0 0 60px rgba(255, 0, 60, 0.8);
    }
    100% {
        transform: scale(1);
        text-shadow: 0 0 15px rgba(255, 0, 60, 0.8), 0 0 40px rgba(255, 0, 60, 0.4);
    }
}

.title {
    color: #ff003c; 
    font-size: 4em;
    margin-bottom: 50px;
    letter-spacing: 8px;
    font-family: sans-serif;
    font-weight: 900;
    text-transform: uppercase;
    animation: pulse-glow 3s infinite ease-in-out;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.btn {
    background-color: #000;
    border: 3px solid #ff003c;
    color: #ff003c;
    padding: 15px 40px;
    font-size: 1.3em;
    font-family: monospace;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    width: 300px;
    transition: all 0.2s ease-in-out;
    position: relative;
    outline: none;
    box-shadow: 0 0 10px rgba(255, 0, 60, 0.2);
    text-shadow: 0 0 5px rgba(255, 0, 60, 0.3);
    pointer-events: auto; 
}

.btn:hover {
    box-shadow: 0 0 30px rgba(255, 0, 60, 1), 0 0 60px rgba(255, 0, 60, 0.6), inset 0 0 20px rgba(255, 0, 60, 0.5); 
    transform: scale(1.05);
    text-shadow: 0 0 15px rgba(255, 0, 60, 1);
}

.btn.hard-active {
    background-color: rgba(255, 0, 60, 0.1);
    box-shadow: 0 0 20px rgba(255, 0, 60, 0.6);
}

.hidden {
    display: none !important;
}

#status-text {
    font-size: 3em;
    margin-bottom: 10px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#sub-text {
    font-size: 1.5em;
    color: #aaa;
}

#coin-display {
    position: absolute;
    top: 20px;
    right: 30px;
    font-family: monospace;
    font-size: 2em;
    font-weight: bold;
    color: #ffff00; 
    text-shadow: 0 0 10px #ffff00;
    pointer-events: none;
    z-index: 20;
}

.game-over-card {
    background-color: rgba(0, 0, 0, 0.9);
    padding: 40px;
    border: 2px solid #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 10px;
    text-align: center;
}

.stats-grid {
    display: flex;
    gap: 40px;
    margin: 20px 0;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-box .label {
    color: #888;
    font-size: 0.8em;
    margin-bottom: 5px;
}

.stat-box .value {
    color: #fff;
    font-size: 1.5em;
    font-family: monospace;
}

#result-canvas {
    width: 100px !important;
    height: 100px !important;
    background-color: #222; 
    border-radius: 8px;
    margin: 15px 0;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
    object-fit: fill; 
}

.play-wrapper {
    display: flex;
    flex-direction: row;
    gap: 10px;
    width: 300px;
}

.play-wrapper .btn {
    width: auto !important; 
    margin: 0;
}

#btn-play {
    flex-grow: 1; 
}

#btn-new {
    flex-grow: 0;
    min-width: 80px; 
    font-size: 1em;  
    padding: 0;      
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #110000; 
}

#btn-new.hidden {
    display: none !important;
}

#shop-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 600px;
    z-index: 120; 
}

.shop-title {
    color: #fff;
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 0 0 10px #fff;
    font-family: sans-serif;
    font-weight: 900;
    text-transform: uppercase;
}

#shop-balance {
    color: #ffff00;
    font-family: monospace;
    font-size: 1.5em;
    margin-bottom: 20px;
    text-shadow: 0 0 10px #ffff00;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); 
    gap: 15px;
    margin-bottom: 30px;
    width: 100%;
}

.skin-card {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #333;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.2s;
}

.skin-card.selected {
    border-color: #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.skin-preview {
    width: 40px;
    height: 40px;
    margin-bottom: 10px;
    background-color: transparent; 
    box-shadow: 
        0 0 15px currentColor,           
        inset 0 0 120px currentColor;     
    border: 2px solid rgba(255, 255, 255, 0.5); 
    border-radius: 4px; 
}

.skin-name {
    color: #fff;
    font-family: monospace;
    font-weight: bold;
    margin-bottom: 10px;
}

.shop-btn {
    background: #000;
    border: 2px solid #555;
    color: #888;
    padding: 5px 15px;
    font-family: monospace;
    cursor: pointer;
    width: 100%;
    text-transform: uppercase;
}

.shop-btn:hover {
    background: #222;
}

.shop-btn.buy {
    border-color: #ffff00;
    color: #ffff00;
}
.shop-btn.buy:hover {
    background: rgba(255, 255, 0, 0.1);
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.5);
}

.shop-btn.select {
    border-color: #fff;
    color: #fff;
}
.shop-btn.select:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.shop-btn.equipped {
    background: #00ff88;
    color: #000;
    border-color: #00ff88;
    cursor: default;
    font-weight: bold;
}

.small-btn {
    width: 150px;
    padding: 10px;
    font-size: 1em;
}

#rules-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 600px;
    z-index: 120;
}

.rules-content {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #555;
    padding: 30px;
    width: 100%;
    margin-bottom: 30px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.rule-row {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #222;
    padding-bottom: 5px;
    font-family: monospace;
    font-size: 1.2em; 
}

.rule-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.rule-row .label {
    color: #888;
    font-weight: bold;
}

.rule-row .value {
    color: #fff;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255,255,255,0.2);
}

#city-bg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; 
    object-position: bottom center; 
    z-index: -2; 
    filter: brightness(0.35);
}


#impact-flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    opacity: 0;
    pointer-events: none;
    z-index: 200; 
    transition: opacity 0.1s;
}

@keyframes shake-hard {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-5px, 5px); }
    50% { transform: translate(5px, -5px); }
    75% { transform: translate(-5px, -5px); }
    100% { transform: translate(0, 0); }
}

@keyframes shake-soft {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-2px, 0); }
    75% { transform: translate(2px, 0); }
    100% { transform: translate(0, 0); }
}

.shake-hard {
    animation: shake-hard 0.2s ease-in-out;
}

.shake-soft {
    animation: shake-soft 0.2s ease-in-out;
}

.hud-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: transparent;
    border: 2px solid #555;
    color: #888;
    font-family: monospace;
    font-weight: bold;
    padding: 10px;
    cursor: pointer;
    z-index: 150;
    text-transform: uppercase;
}

.hud-btn:hover {
    border-color: #fff;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.title-img {
    width: 650px;          
    max-width: 90%;        
    margin-bottom: 20px;
    z-index: 120;
    pointer-events: none;  
    image-rendering: pixelated; 
}

.title {
    display: none;
}