body {
    margin: 0;
    overflow: hidden;
    background-color: #87CEEB;
    /* Sky blue */
    touch-action: none;
    /* Prevent default touch actions like scrolling */
    font-family: 'Comic Sans MS', 'Chalkboard SE', sans-serif;
}

#gameCanvas {
    display: block;
}

#start-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    font-size: 2rem;
    pointer-events: auto;
    /* Ensure it catches clicks */
}

/* Settings UI */
#settings-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 50;
    opacity: 0.7;
    transition: transform 0.2s;
}

#settings-btn:active {
    transform: scale(0.9);
}

/* Settings Panel Polish */
#settings-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    text-align: center;
    min-width: 300px;
    border: 4px solid #FFD700;
    font-family: 'Comic Sans MS', sans-serif;
    backdrop-filter: blur(5px);
}

#settings-panel.hidden {
    display: none;
}

#settings-panel h2 {
    margin: 0 0 20px 0;
    color: #4a4a4a;
    font-size: 1.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: #333;
    padding: 5px 0;
    border-bottom: 1px dashed #ddd;
}

.setting-item label {
    font-weight: bold;
}

.control-wrapper input,
.control-wrapper select {
    padding: 5px;
    border-radius: 5px;
    border: 2px solid #ccc;
    font-size: 1rem;
    text-align: center;
}

.checkbox-item {
    justify-content: center;
    gap: 10px;
    border-bottom: none;
}

.settings-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 20px 0;
}

button {
    cursor: pointer;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 1rem;
    transition: transform 0.1s, opacity 0.2s;
}

button:active {
    transform: scale(0.95);
}

.btn-primary {
    background: #FF6347;
    color: white;
    width: 100%;
    font-size: 1.2rem;
    box-shadow: 0 4px 0 #cd371e;
}

.btn-danger {
    background: #FF4444;
    color: white;
    flex: 1;
    font-size: 0.9rem;
    box-shadow: 0 3px 0 #cc0000;
}

.btn-secondary {
    background: #555;
    color: white;
    flex: 1;
    font-size: 0.9rem;
    box-shadow: 0 3px 0 #333;
}

/* Close X Button */
.close-x-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 1.2rem;
    line-height: 30px;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1002;
    transition: transform 0.2s, background 0.2s;
}

.close-x-btn:hover {
    background: #cc0000;
    transform: scale(1.1);
}

.close-x-btn:active {
    transform: scale(0.9);
}

/* Contact Button style */
.btn-contact {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background: #4CAF50;
    color: white;
    text-decoration: none;
    padding: 10px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 1rem;
    text-align: center;
    box-shadow: 0 4px 0 #388E3C;
    transition: transform 0.1s;
    margin-bottom: 5px;
}

.btn-contact:active {
    transform: scale(0.95);
    box-shadow: 0 2px 0 #388E3C;
}

/* About Section */
.about-section {
    margin: 15px 0;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 10px;
    border: 1px dashed #ddd;
    text-align: left;
}

.about-section p {
    font-size: 0.9rem;
    color: #555;
    margin: 5px 0;
    line-height: 1.4;
}

.about-section .credits {
    text-align: center;
    font-weight: bold;
    margin-top: 10px;
}

.about-section a {
    color: #FF6347;
    text-decoration: none;
    font-weight: bold;
}

.about-section a:hover {
    text-decoration: underline;
}

/* Footer */
#game-footer {
    position: absolute;
    bottom: 5px;
    width: 100%;
    text-align: center;
    font-size: 0.8rem;
    color: rgba(0, 0, 0, 0.4);
    pointer-events: auto;
    z-index: 90;
    /* Below overlay but readable */
}

#game-footer a {
    color: inherit;
    text-decoration: none;
    font-weight: bold;
}

#game-footer a:hover {
    text-decoration: underline;
    color: rgba(0, 0, 0, 0.7);
}