/* Toddler Games CSS - Fun and Accessible Design */

/* Base Styles */
body {
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Comic Neue', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    touch-action: manipulation;
    user-select: none;
}

/* Game Container */
.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* Game Header */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.progress-bar {
    flex: 1;
    height: 30px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    overflow: hidden;
    margin-right: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
}

.progress-star {
    font-size: 20px;
    animation: bounce 1s infinite;
}

.score-display {
    font-size: 24px;
}

.score-stars {
    display: inline-block;
    animation: pulse 2s infinite;
}

/* Menu Title */
.menu-title {
    text-align: center;
    margin: 20px 0 40px;
    font-size: 3em;
}

.rainbow-text {
    background: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #8b00ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbow 3s linear infinite;
    font-weight: bold;
}

/* Game Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    padding: 20px;
}

/* Game Cards */
.game-card {
    background: white;
    border: none;
    border-radius: 25px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    min-height: 200px;
}

.game-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.game-card:active {
    transform: scale(0.95);
}

.game-icon {
    width: 100px;
    height: 100px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
}

.icon-emoji {
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
}

.game-name {
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
}

/* Parent Menu Button */
.parent-menu-btn {
    position: fixed;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid white;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: all 0.3s;
}

.parent-menu-btn:hover {
    opacity: 0.8;
    background: rgba(0, 0, 0, 0.5);
}

.parent-menu-btn:active {
    transform: scale(1.1);
    opacity: 1;
}

/* Add a progress ring animation when holding */
@keyframes holdProgress {
    0% {
        stroke-dashoffset: 126;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

.parent-menu-btn.holding::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-top-color: white;
    animation: spin 2s linear;
}

/* Parent Modal */
.parent-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h2 {
    color: #333;
    margin-bottom: 20px;
}

.settings-group {
    margin-bottom: 30px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.setting-item span {
    color: #555;
    font-size: 16px;
}

.setting-item input[type="checkbox"] {
    width: 50px;
    height: 25px;
    cursor: pointer;
}

.setting-item select {
    padding: 5px 10px;
    font-size: 16px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

/* Progress Report */
.progress-report {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.progress-report h3 {
    color: #333;
    margin-bottom: 15px;
}

.stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
}

.stat-label {
    color: #666;
}

.stat-value {
    font-weight: bold;
    color: #333;
}

.close-modal-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    transition: transform 0.2s;
}

.close-modal-btn:hover {
    transform: scale(1.05);
}

/* Celebration Overlay */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 1500;
}

.celebration-content {
    background: white;
    padding: 40px;
    border-radius: 30px;
    text-align: center;
    animation: zoomIn 0.5s ease;
}

.celebration-stars {
    font-size: 4em;
    margin-bottom: 20px;
    animation: starSpin 1s ease;
}

.celebration-text {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 20px;
}

.celebration-character {
    font-size: 5em;
    animation: bounce 1s infinite;
}

.play-again-btn {
    background: linear-gradient(45deg, #4CAF50, #8BC34A);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 1.2em;
    cursor: pointer;
    margin-top: 20px;
    transition: transform 0.2s;
}

.play-again-btn:hover {
    transform: scale(1.1);
}

/* Game Area */
.game-area {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    padding: 30px;
    min-height: 400px;
}

.back-btn {
    background: linear-gradient(45deg, #ff6b6b, #feca57);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 18px;
    cursor: pointer;
    margin: 20px auto;
    display: block;
    transition: transform 0.2s;
}

.back-btn:hover {
    transform: scale(1.05);
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 40px;
    font-size: 1.5em;
    color: #666;
}

.error-message a {
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
}

/* Animations */
@keyframes rainbow {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes starSpin {
    0% { transform: rotate(0deg) scale(0); }
    100% { transform: rotate(360deg) scale(1); }
}

@keyframes zoomIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .game-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        padding: 10px;
    }
    
    .menu-title {
        font-size: 2em;
    }
    
    .game-card {
        min-height: 150px;
    }
    
    .game-icon {
        width: 80px;
        height: 80px;
        font-size: 2.5em;
    }
    
    .game-name {
        font-size: 1.2em;
    }
}

@media (max-width: 480px) {
    .game-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .game-container {
        padding: 10px;
    }
    
    .celebration-content {
        padding: 20px;
    }
    
    .celebration-text {
        font-size: 1.8em;
    }
}

/* Prevent text selection and highlighting */
* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Make buttons and interactive elements more responsive on touch */
button, .game-card {
    -webkit-tap-highlight-color: transparent;
}
