body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Fredoka', sans-serif;
}

.game-heading {    
    text-align: center;
    padding: 20px 0;
    margin: 0;
    font-size: 150px;
    width: 100%;
    position: fixed;
    top: 0px;
    left: 0;
    z-index: 1000;
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    display: block;
    color: #ffc569;
    text-shadow: 
        /* White outline*/
        -2px -2px 0 #fff,
        2px -2px 0 #fff,
        -2px 2px 0 #fff,
        2px 2px 0 #fff,
        /* Drop shadow */
        2px 4px 4px rgba(0, 0, 0, 0.3);
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100vh;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    position: relative;
}

#backgroundCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
}

#gameCanvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1;    
}

.message-container {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    min-height: 40px;
    width: auto;
    max-width: 800px;
    text-align: center;
    padding: 10px 20px;
    font-size: 20px;
    font-family: 'Fredoka', sans-serif;
    z-index: 100;
    color: white;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: pre-line;
}

.message-container.active {
    background-color: rgba(0, 0, 0, 0.7);
}

#gameCanvas {
    display: block;
    margin: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;    
}

/* Add responsive adjustments */
@media screen and (max-width: 768px) {
    .score-container {
        transform: translateX(50px);
    }

    .level-container {
        transform: translateX(-50px);
    }

    .level-text, .round-text {
        padding: 12px 16px;
    }

    #levelDisplay, #roundDisplay, #scoreDisplay {
        font-size: 16px;
    }
}

@media screen and (max-width: 480px) {
    .score-container {
        transform: translateX(160px);
        padding: 10px 16px;
    }

    .level-container {
        transform: translateX(-160px);
    }

    .level-text, .round-text {
        padding: 10px 14px;
    }

    #levelDisplay, #roundDisplay, #scoreDisplay {
        font-size: 14px;
    }

    .star-icon {
        width: 20px;
        height: 20px;
    }
}

.level-select {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* background: #b3c4cd; */
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 700px;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(146, 64, 14, 0.3);    
    border: 4px solid #fff;
    text-align: center;
    z-index: 2000;
}

.level-select h2 {
    color: #fff;
    font-size: 36px;
    margin: 0 0 40px 0;
    width: 100%;
    text-align: center;
    position: relative;
    top: 0;
    text-shadow: 0 2px 3px rgba(146, 64, 14, 0.3);
}

.level-buttons {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);     
    gap: 20px;
    padding: 0 10px;
    max-width: 600px;
    white-space: pre-line;
}

.level-button {
    background: #fe878b;
    color: white;
    border: none;
    border-radius: 15px;
    font-family: 'Fredoka', sans-serif;
    cursor: pointer;
    transition: all 0.2s;    
    border: 3px solid #ffffff;
    box-shadow: 0 4px 6px rgba(146, 64, 14, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    width: 120px;  /* Increased from 100px */
    height: 140px;  /* Fixed height */
    padding: 5px 5px 10px;  /* Reduce top padding */
    gap: 15px;  /* Increase gap between stars and text background */
    justify-content: flex-start;  /* Align items to start */
}

.level-button:hover {
    background: #fea987;
    transform: translateY(-2px);
}

.level-button.locked {
    background-color: #6b5959;
    cursor: not-allowed;
}

.level-button.locked:hover {
    transform: none;
    box-shadow: none;
}

.level-button.locked .star-holder {
    opacity: 0.5;  /* Make star holders more visible in locked state */
}

.level-text {
    font-size: 50px;
    font-weight: bold;    
    padding: 2px 0;
}

.text-background {
    background: rgba(0, 0, 0, 0.2);
    width: 97%;
    flex-grow: 1;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;    
    padding: 4px 0;  /*Add some vertical padding*/
    box-shadow: inset 0 4px 3px -4px rgba(0, 0, 0, 0.3);  /* Add inner shadow at top */
}

.star-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90%;  /* Give some side padding */    
    height: 20px;
}

.star-wrapper {
    margin: 0;
    flex-shrink: 0;
    padding: 0 3px;  /* Add some padding around each star */
}

.star-holder {
    opacity: 0.4;
    position: absolute;    
    transform: translate(-50%, 20%);
}

.earned-star {
    position: absolute;    
    transform: translate(-50%, 20%);
}

.lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    overflow: hidden;  /* Ensure lock stays within button borders */
}

.lock-icon {
    width: 80%;
    height: 80%;
    filter: brightness(0) invert(1);
    opacity: 1;
    object-fit: contain;  /* Maintain aspect ratio */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@media screen and (max-width: 480px) {
    .level-buttons {
        grid-template-columns: repeat(3, 1fr);  /* Show 3 buttons per row on mobile */
        gap: 10px;
        max-width: 400px;
    }

    .level-button {
        padding: 12px 20px;
        font-size: 16px;
    }
}

.home-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;    
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    background: transparent;
}

.home-screen-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.play-button {
    background: #5abfdd;
    color: white;
    border: none;
    padding: 15px 60px;
    border-radius: 25px;
    font-family: 'Fredoka', sans-serif;
    font-size: 35px;
    cursor: pointer;
    transition: all 0.2s;
    border: 4px solid #ace8ff;
    box-shadow: 0 6px 6px rgba(146, 64, 14, 0.3);
    width: 250px;
}

.play-button:disabled {    
    cursor: not-allowed;
}

.play-button:not(:disabled):hover {
    background: #86d4ea;
    transform: translateY(-2px);
}

.name-input {
    display: block;
    padding: 20px 30px;
    font-size: 26px;
    border: 3px solid #3d0120;
    border-radius: 50px;
    width: 400px;
    text-align: center;
    font-family: 'Fredoka', sans-serif;
    margin-bottom: 10px;
    box-shadow: 0 4px 6px rgba(146, 64, 14, 0.1);
}

/* Add responsive styling for mobile */
@media screen and (max-width: 480px) {
    .name-input {
        width: 280px;
        font-size: 24px;
        padding: 15px 25px;
    }
}

.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.particles {
    width: 100%;
    height: 100%;
}

.particle {
    fill: #EAB308;
    opacity: 0.3;
}

@keyframes float-up {
    from { transform: translateY(100%); }
    to { transform: translateY(-100%); }
}

/* Analytics styles */
.analytics-input {
    font-family: 'Fredoka', sans-serif;
    padding: 12px 20px;
    font-size: 18px;
    border: 3px solid #3d0120;
    border-radius: 25px;
    width: 200px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(146, 64, 14, 0.1);
}

.analytics-button-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

/* Analytics styles */
.analytics-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 8px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-family: Arial;
    font-size: 12px;
    z-index: 1000;
}

.analytics-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2010;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 15px;
    border-radius: 5px;
    width: 300px;
    text-align: center;
}

.modal-content h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.close-button {
    position: absolute;
    right: 8px;
    top: 5px;
    font-size: 24px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

.submit-button {
    background-color: #007bff;
    color: white;
    padding: 8px 20px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    margin-top: 5px;
}

.password-input {
    width: 100%;
    padding: 8px;
    margin: 5px 0;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.error-message {
    color: #dc3545;
    margin: 5px 0;
    font-size: 14px;
    min-height: 16px;
}

.stream-select {
    width: 100%;
    padding: 8px;
    margin: 5px 0;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: Arial;
    font-size: 14px;
}

.stream-select:focus {
    outline: none;
    border-color: #007bff;
}