/* Base styles and CSS reset */
:root {
    --primary-color: #F4A460;
    --secondary-color: #20B2AA;
    --background-color: #ebaf67;
    --text-color: #333;
    --border-color: #4A4A4A;
    --success-color: #4CAF50;
    --error-color: #F44336;
    --canvas-width: 893px;
    --canvas-height: 856px;
    --canvas-ratio: calc(var(--canvas-height) / var(--canvas-width) * 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Header styles */
header {
    padding: 1rem;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h1 {
    font-size: 2rem;
    color: var(--primary-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

/* Main game container */
main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    flex-direction: column;
    font-size: 2em;
}

#game-container {
    width: 100%;
    max-width: var(--canvas-width);
    margin: 0 auto;
    position: relative;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}

#game-container canvas {
    width: 100% !important;
    height: auto !important;
    display: block;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Footer styles */
footer {
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.9);
}

#social-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin: 1.5rem 0;
}

#game-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Button styles */
button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

button:hover {
    transform: translateY(-2px);
}

.cta-button {
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-weight: bold;
    transition: background-color 0.2s;
    -webkit-tap-highlight-color: transparent;
    display: inline-block;
    touch-action: manipulation;
}

.cta-button:hover {
    background-color: darken(var(--primary-color), 10%);
}

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

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 90%;
    width: 500px;
    text-align: center;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
    touch-action: manipulation;
    position: relative;
    z-index: 1001;
}

.modal-content h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.modal-content p {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: bold;
}

/* Form styles */
#mailing-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 1010;
}

#mailing-list input {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    position: relative;
    z-index: 1011;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
    touch-action: auto;
    width: 100%;
    box-sizing: border-box;
}

#mailing-list button {
    background-color: var(--secondary-color);
    color: white;
    position: relative;
    z-index: 1011;
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
}

/* Animation classes */
.flash-success {
    animation: flashSuccess 0.5s;
}

.flash-error {
    animation: flashError 0.5s;
}

@keyframes flashSuccess {
    0%, 100% { background-color: transparent; }
    50% { background-color: var(--success-color); }
}

@keyframes flashError {
    0%, 100% { background-color: transparent; }
    50% { background-color: var(--error-color); }
}

/* Responsive design */
@media (max-width: 768px) {
    h1 {
        font-size: 1.5rem;
    }

    #social-links {
        flex-wrap: wrap;
    }

    button {
        font-size: 0.9rem;
    }

    main {
        padding: 0.5rem;
    }
    
    #mailing-list {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0.5rem;
    }

    .modal-content {
        padding: 1.5rem;
        width: 95%;
    }

    #game-container {
        margin: 0;
    }
    
    #social-links {
        gap: 0.5rem;
    }
    
    #social-links button {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .modal-content p {
        font-size: 1rem;
    }
    
    #mailing-list {
        max-width: 100%;
    }
    
    #mailing-list input,
    #mailing-list button {
        font-size: 1rem;
        padding: 0.75rem;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    
}

#close-modal {
    margin-top: 1rem;
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
}

/* Instructions Modal */
#instructions-modal .modal-content {
    max-width: 600px;
}

#instructions-modal h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#instructions-modal p {
    text-align: left;
    margin-bottom: 1rem;
    line-height: 1.5;
    font-size: 1.1rem;
}

#close-instructions-modal {
    margin-top: 1.5rem;
    font-size: 1.2rem;
    padding: 0.75rem 2rem;
}
