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

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f0e1;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-image: linear-gradient(to bottom, #ffd8cc, #ffb6c1);
}

#game-container {
    width: 100%;
    max-width: 500px;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    position: relative;
    touch-action: manipulation; /* Improves touch responsiveness */
}

.screen {
    padding: 20px;
    text-align: center;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.game-logo {
    margin-bottom: 30px;
    animation: bounce 2s infinite alternate;
}

.small-logo {
    margin-bottom: 15px;
    transform: scale(0.8);
}

.mini-logo {
    margin-bottom: 10px;
    align-self: center;
}

@keyframes bounce {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-10px);
    }
}

.hidden {
    display: none;
}

h1 {
    font-size: 3rem;
    color: #ff6b6b;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

h2 {
    font-size: 1.8rem;
    color: #4ecdc4;
    margin-bottom: 30px;
}

button {
    background-color: #ff6b6b;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1.2rem;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

button:hover {
    background-color: #ff8e8e;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

button.active {
    background-color: #ff8e8e;
    transform: scale(0.95);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#level-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.level-button {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    margin: 5px;
}

#game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    background-color: #f9f9f9;
    border-radius: 10px;
    padding: 10px 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#level-info {
    font-size: 1.3rem;
    font-weight: bold;
    color: #4ecdc4;
    padding: 5px 10px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#level-number {
    display: block;
    padding: 2px 5px;
}

#moves-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: white;
    border-radius: 8px;
    padding: 5px 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#moves-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 2px;
}

#moves-left {
    font-size: 1.4rem;
    color: #ff6b6b;
    font-weight: bold;
    line-height: 1;
}

#objectives-container {
    background-color: #f9f9f9;
    border-radius: 10px;
    padding: 12px 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#objectives-container h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    font-size: 1.1rem;
}

#objectives {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.objective {
    display: flex;
    align-items: center;
    background-color: white;
    padding: 8px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.objective img {
    width: 30px;
    height: 30px;
    margin-right: 8px;
}

.cat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-right: 8px;
    background-color: #f5f5f5;
    border-radius: 50%;
    overflow: hidden;
}

.cat-icon svg {
    width: 30px;
    height: 30px;
}

.objective span {
    font-weight: bold;
    font-size: 1.1rem;
    color: #333;
}

#game-board-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    position: relative;
    border: 3px solid #4ecdc4;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f0f0f0;
}

#game-board {
    display: block;
    max-width: 100%;
    max-height: 100%;
    background-color: #f0f0f0;
    touch-action: none; /* Prevent browser handling of touch gestures */
    image-rendering: -webkit-optimize-contrast; /* Sharper image rendering */
    image-rendering: crisp-edges;
}

#game-controls {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.item-button {
    font-size: 1rem;
    padding: 8px 16px;
}

.help-button {
    font-size: 0.9rem;
    padding: 6px 12px;
    background-color: #4ecdc4;
    margin-left: 10px;
}

/* Animations */
@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes fade {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes slide-down {
    0% { transform: translateY(-20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.pop {
    animation: pop 0.3s ease-in-out;
}

.fade {
    animation: fade 0.5s ease-in-out;
}

.slide-down {
    animation: slide-down 0.5s ease-in-out;
}

/* Introduction Screen Styles */
#introduction-screen {
    overflow-y: auto;
    max-height: 100vh;
}

.intro-content {
    padding: 10px;
    text-align: left;
}

.intro-section {
    background-color: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.intro-section h3 {
    color: #ff6b6b;
    margin-bottom: 10px;
    font-size: 1.4rem;
}

.intro-section p {
    margin-bottom: 15px;
    line-height: 1.5;
}

.intro-image {
    text-align: center;
    margin: 15px 0;
}

.intro-image img {
    max-width: 100%;
    border-radius: 8px;
    border: 2px solid #eee;
}

.intro-image p {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

.intro-section ul {
    padding-left: 20px;
    margin-bottom: 15px;
}

.intro-section li {
    margin-bottom: 8px;
    line-height: 1.4;
}

.objective-explanation {
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 12px;
    margin-top: 15px;
    border-left: 4px solid #4ecdc4;
}

.objective-explanation h4 {
    color: #4ecdc4;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.objective-explanation ul {
    margin-bottom: 10px;
}

.objective-explanation p:last-child {
    margin-bottom: 0;
}

.objective-example {
    display: flex;
    align-items: center;
    background-color: white;
    padding: 10px 15px;
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 15px auto;
    width: fit-content;
}

.example-cat {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    margin-right: 10px;
    background-color: #f9f9f9;
    border-radius: 50%;
    overflow: hidden;
}

.example-progress {
    font-weight: bold;
    font-size: 1.3rem;
    color: #333;
}

.objective-hint {
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    background-color: #4ecdc4;
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    cursor: help;
    margin-left: 5px;
    vertical-align: middle;
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

/* Footer Styles */
#game-footer {
    width: 100%;
    padding: 15px 0;
    margin-top: 20px;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
    font-size: 0.9rem;
}

.footer-content {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    margin-bottom: 10px;
}

.footer-links a {
    color: #4ecdc4;
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #ff6b6b;
    text-decoration: underline;
}

.copyright {
    color: #666;
    font-size: 0.8rem;
}

/* Mobile Responsive Styles */
@media (max-width: 480px) {
    .game-logo img {
        width: 250px;
        height: auto;
    }

    .small-logo img {
        width: 180px;
        height: auto;
    }

    .mini-logo img {
        width: 100px;
        height: auto;
    }
    #game-container {
        max-width: 100%;
        border-radius: 0;
        box-shadow: none;
        height: 100vh;
        display: flex;
        flex-direction: column;
    }

    .screen {
        min-height: auto;
        flex: 1;
        padding: 15px;
    }

    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    button {
        padding: 10px 20px;
        font-size: 1.1rem;
        margin: 8px;
    }

    #level-buttons {
        gap: 10px;
    }

    .level-button {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }

    #game-controls {
        margin-top: 10px;
    }

    .item-button {
        padding: 6px 12px;
        font-size: 0.9rem;
    }

    #game-header {
        padding: 8px 10px;
        margin-bottom: 10px;
    }

    #level-info {
        font-size: 1.1rem;
        padding: 4px 8px;
    }

    #moves-container {
        padding: 4px 8px;
    }

    #moves-label {
        font-size: 0.8rem;
    }

    #moves-left {
        font-size: 1.2rem;
    }

    #objectives-container {
        padding: 8px 10px;
        margin-bottom: 10px;
    }

    .objective {
        padding: 4px 8px;
    }

    .objective img {
        width: 25px;
        height: 25px;
    }

    #game-footer {
        padding: 10px 0;
    }

    .footer-links a {
        margin: 0 5px;
        font-size: 0.8rem;
    }

    .copyright {
        font-size: 0.7rem;
    }
}
