body {
    margin: 0;
    font-family: 'Tahoma', sans-serif;
    background-color: #1a1a1a;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    direction: rtl;
}

#game-container {
    position: relative;
    border: 2px solid #555;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

canvas {
    display: block;
    background-color: #000;
}

#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
    font-size: 16px;
}

#hud-left, #hud-right, #hud-center {
    padding: 5px 10px;
    background: rgba(0,0,0,0.5);
    border-radius: 5px;
}

#hud-right {
    text-align: left;
}

#hud-center {
    text-align: center;
}

#timer {
    font-size: 24px;
    font-weight: bold;
    color: #ffc107;
}

#shop-button {
    pointer-events: all;
    padding: 8px 12px;
    background-color: #ffc107;
    color: #000;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

#shop-button:hover {
    background-color: #ffda73;
}

.hidden {
    display: none !important;
}

#shop-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

#shop-content {
    background: #2a2a2a;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #ffc107;
    width: 80%;
    max-width: 800px;
    max-height: 80%;
    overflow-y: auto;
}

#shop-content h2 {
    text-align: center;
    margin-top: 0;
    color: #ffc107;
}

#shop-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.shop-section h3 {
    color: #eee;
    border-bottom: 1px solid #555;
    padding-bottom: 5px;
}

.shop-item {
    display: flex;
    align-items: center;
    background: #3a3a3a;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.shop-item img {
    width: 48px;
    height: 48px;
    margin-left: 15px;
    background: #555;
    padding: 2px;
    border-radius: 4px;
    image-rendering: pixelated;
}

.shop-item-info {
    flex-grow: 1;
}

.shop-item-info p {
    margin: 2px 0;
    font-size: 14px;
}

.shop-item-buy-button {
    padding: 8px 15px;
    background: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 5px;
}

.shop-item-buy-button:hover {
    background: #66bb6a;
}

.shop-item-buy-button:disabled {
    background: #555;
    cursor: not-allowed;
}

#close-shop-button {
    display: block;
    margin: 20px auto 0 auto;
    padding: 10px 20px;
    font-size: 16px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#game-over-screen, #start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
    text-align: center;
}

#game-over-screen h1, #start-screen h1 {
    font-size: 48px;
    color: #f44336;
}

#start-screen h1 { color: #ffc107; }

#game-over-screen button, #start-screen button {
    padding: 15px 30px;
    font-size: 20px;
    cursor: pointer;
    background: #ffc107;
    border: none;
    border-radius: 5px;
    color: #000;
    font-weight: bold;
}

#start-screen a {
    margin-top: 20px;
    color: #ccc;
}