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

.game-container {
    text-align: center;
    background-color: #2c2c2c;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    width: 90%;
    max-width: 500px;
    position: relative;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    background: #3d3d3d;
    padding: 10px 15px;
    border-radius: 10px;
}

.gems-container {
    font-weight: bold;
    color: #00d4ff;
    font-size: 1.1rem;
}

h1 {
    color: #4CAF50;
    margin: 10px 0;
    font-size: 1.5rem;
}

#topControls {
    margin-bottom: 15px;
}

#game-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 10px;
    margin: 20px auto;
    max-width: 350px;
    min-height: 200px;
}

.color-button {
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    border: 3px solid rgba(255,255,255,0.1);
}

.color-button:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

.color-button.active {
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 0 25px currentColor;
    filter: brightness(1.5);
}

#startButton, #restartButton, .action-button, .special-button {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

#startButton {
    font-size: 1.3rem;
    width: 100%;
    background: linear-gradient(to bottom, #4CAF50, #2E7D32);
}

.action-button { background-color: #3498db; }
.special-button { background-color: #f1c40f; color: #000; }

.hidden { display: none !important; }

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #333;
    padding: 25px;
    border-radius: 15px;
    width: 85%;
    max-width: 400px;
    position: relative;
}

.close-button {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 28px;
    cursor: pointer;
}

.shop-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.shop-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #444;
    padding: 10px;
    border-radius: 8px;
}

.color-preview {
    display: flex;
    gap: 5px;
}

.color-preview span {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

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

.buy-button.equipped {
    background: #777;
    cursor: default;
}

canvas {
    background: #000;
    border: 4px solid #444;
    border-radius: 8px;
    max-width: 100%;
}