body {
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    background: linear-gradient(to bottom, #0a0a1a 0%, #050510 20%, #020208 40%, #000000 60%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: 'Arial', sans-serif;
    color: white;
}

#starCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.content {
    text-align: center;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100vh;
}

#title {
    font-family: 'Orbitron', sans-serif;
    font-size: 5rem;
    font-weight: bold;
    color: #ff3333;
    text-shadow: 
        0 1px 0 #cc0000,
        0 2px 0 #bb0000,
        0 3px 0 #aa0000,
        0 4px 0 #990000,
        0 5px 10px rgba(0, 0, 0, 0.6);
    margin-bottom: 50px;
}

.buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    width: 100%;
}

button {
    padding: 12px 30px;
    font-size: 1.5rem;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    font-family: 'Arial', sans-serif;
    font-weight: bold;
    transition: all 0.3s ease;
    width: 300px;
    max-width: 90%;
}

#play-button {
    background-color: #ff6347;
    color: white;
    box-shadow: 0 0 15px rgba(255, 99, 71, 0.5);
}

#credits-button, #back-button, #back-to-menu-button {
    background-color: #4da6ff;
    color: white;
    box-shadow: 0 0 15px rgba(77, 166, 255, 0.5);
}

button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.7);
}

#credits-screen h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    color: #ff6347;
    margin-bottom: 30px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.credits-content {
    background-color: rgba(0, 0, 0, 0.6);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    max-width: 600px;
    line-height: 1.6;
}

.credits-content p {
    margin-bottom: 15px;
}

.game-ui {
    position: absolute;
    top: 20px;
    width: 100%;
    text-align: center;
}

.game-ui p {
    background-color: rgba(0, 0, 0, 0.6);
    padding: 10px 20px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 10px;
}

#back-to-menu-button {
    width: auto;
    font-size: 1rem;
    padding: 8px 16px;
}

.bottom-right-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 10;
}

#choose-fireworks-button {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
    border-radius: 30px;
    padding: 10px 20px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: auto;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

#choose-fireworks-button:hover {
    background-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: rgba(20, 20, 40, 0.95);
    border-radius: 15px;
    padding: 30px;
    max-width: 80%;
    max-height: 80%;
    overflow-y: auto;
    box-shadow: 0 0 30px rgba(100, 100, 255, 0.3);
    border: 1px solid rgba(100, 100, 255, 0.5);
    width: 90%;
    max-width: 1000px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.modal-content h2 {
    font-family: 'Orbitron', sans-serif;
    color: white;
    margin-bottom: 20px;
    text-align: center;
}

.firework-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-auto-rows: auto;
    gap: 20px;
    width: 100%;
}

.firework-types {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    width: 100%;
    max-height: 600px;
    overflow-y: auto;
    padding: 10px;
    box-sizing: border-box;
}

.firework-type {
    width: auto;
    height: auto;
    min-height: 200px;
    padding: 15px;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.firework-type:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.firework-type.selected {
    background-color: rgba(77, 166, 255, 0.3);
    border: 2px solid #4da6ff;
}

.firework-type img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 10px;
}

.firework-type h3 {
    margin: 0 0 5px 0;
    font-size: 1rem;
    flex-shrink: 0;
}

.firework-type p {
    margin: 0;
    font-size: 0.8rem;
    flex-grow: 1;
    overflow: hidden;
}

.firework-types.scrollable {
    overflow-y: auto;
}

.firework-types::-webkit-scrollbar {
    width: 10px;
}

.firework-types::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.firework-types::-webkit-scrollbar-thumb {
    background: rgba(100, 100, 255, 0.5);
    border-radius: 10px;
}

.firework-types::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 100, 255, 0.7);
}

#close-modal-button {
    display: block;
    margin: 0 auto;
    width: auto;
    font-size: 1rem;
    padding: 8px 16px;
}

.random-button-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 20px;
    margin-bottom: 10px;
}

#random-fireworks-button {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
    border-radius: 30px;
    padding: 12px 30px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: auto;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

#random-fireworks-button:hover {
    background-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

#random-fireworks-button.active {
    background-color: rgba(100, 255, 100, 0.4);
    border-color: rgba(100, 255, 100, 0.8);
    box-shadow: 0 0 15px rgba(100, 255, 100, 0.5);
}