/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Arial', sans-serif;
    background: #ffffff;
    position: relative;
}
#gameContainer {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: none; /* Hidden initially */
}
/* Title Screen Styles */
#titleScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #55AAA3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
#titleScreen h1 {
    font-size: 6rem; /* Increased font size */
    margin-bottom: 3rem;
    color: #ffffff;
    font-family: 'Arial', sans-serif;
    text-align: center;
}
#titleScreen .control {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column; /* Changed to column for better alignment */
    align-items: center;
}
#titleScreen label {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #ffffff;
    font-family: 'Arial', sans-serif;
}
#titleScreen input[type="range"] {
    -webkit-appearance: none; /* Removes default styling */
    width: 300px; /* Increased width */
    height: 15px; /* Increased height */
    background: #ddd;
    border-radius: 5px;
    outline: none;
    margin-bottom: 1rem;
    touch-action: manipulation;
}
#titleScreen input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 30px; /* Increased thumb size */
    height: 30px;
    background: #55AAA3;
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid #fff;
}
#titleScreen input[type="range"]::-moz-range-thumb {
    width: 30px;
    height: 30px;
    background: #55AAA3;
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid #fff;
}
#titleScreen input[type="checkbox"] {
    width: 30px;
    height: 30px;
    margin-bottom: 1rem;
}
#titleScreen #startButton {
    font-size: 2.5rem; /* Increased font size */
    padding: 1rem 2rem; /* Increased padding */
    margin-top: 2rem;
    cursor: pointer;
    background-color: #ffffff;
    color: #55AAA3;
    border: none;
    border-radius: 10px;
    font-family: 'Arial', sans-serif;
    transition: background-color 0.3s, color 0.3s;
    touch-action: manipulation;
}
#titleScreen #startButton:hover {
    background-color: #55AAA3;
    color: #ffffff;
}
#titleScreen span {
    font-size: 2rem;
    color: #ffffff;
    font-family: 'Arial', sans-serif;
}
/* Background Sectors for Grid Pattern */
.background-sector {
    position: absolute;
    width: 50%;
    height: 50%;
    z-index: 0;
}
.background-sector.top-left { top: 0; left: 0; }
.background-sector.top-right { top: 0; left: 50%; }
.background-sector.bottom-left { top: 50%; left: 0; }
.background-sector.bottom-right { top: 50%; left: 50%; }
/* Background Letters */
.background-letter {
    position: absolute;
    font-size: 50vw;
    max-font-size: 200px;
    color: rgba(0, 0, 0, 0.05);
    user-select: none;
    pointer-events: none;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    transform: translate(-50%, -50%);
    z-index: 0;
}
/* Responsive Font Size for Background Letters */
@media (max-width: 1024px) {
    .background-letter {
        font-size: 30vw;
        max-font-size: 150px;
    }
}
@media (max-width: 768px) {
    .background-letter {
        font-size: 20vw;
        max-font-size: 100px;
    }
}
/* Specific styling for level 5 background letters */
.level-5 .background-letter {
    font-size: 30vw;
    max-font-size: 100px;
}

@media (max-width: 1024px) {
    .level-5 .background-letter {
        font-size: 20vw;
        max-font-size: 80px;
    }
}

@media (max-width: 768px) {
    .level-5 .background-letter {
        font-size: 15vw;
        max-font-size: 60px;
    }
}
/* Positioning for Split Screen Background Letters */
.background-letter.split-left {
    top: 50%;
    left: 25%;
}
.background-letter.split-right {
    top: 50%;
    left: 75%;
}
/* Positioning for Grid Background Letters */
.background-letter.grid-top-left {
    top: 25%;
    left: 25%;
}
.background-letter.grid-top-right {
    top: 25%;
    left: 75%;
}
.background-letter.grid-bottom-left {
    top: 75%;
    left: 25%;
}
.background-letter.grid-bottom-right {
    top: 75%;
    left: 75%;
}
/* Game Letters */
.letter {
    position: absolute;
    font-size: 4rem;
    color: white;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    touch-action: none;
    z-index: 1;
}
/* Fireworks Canvas */
#fireworksCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: none;
    z-index: 2;
}
/* Victory Message */
#victoryMessage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    display: none;
    z-index: 3;
}
/* Level Loaded Message */
#levelLoadedMessage {
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    color: white;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 10px;
    display: none;
    z-index: 4;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}
