/* Общие стили для детских игр Glazeikin.com */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    /* Предотвращаем горизонтальный скролл на мобильных */
    overflow-x: hidden;
    width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    margin-top: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Заголовки */
header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

header h1 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

header p {
    font-size: 1.2em;
    color: #666;
}

.back-button {
    position: absolute;
    left: 0;
    top: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.back-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Главная страница */
.welcome-section {
    text-align: center;
    margin: 40px 0;
    padding: 30px;
    background: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
    border-radius: 20px;
    color: #333;
}

.welcome-section h2 {
    font-size: 2em;
    margin-bottom: 15px;
}

.games-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.game-card {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.game-card.clickable:hover {
    background: #f8f9fa;
}

.game-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.game-icon.large {
    font-size: 4em;
}

.game-card h3,
.game-card h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.game-card p {
    color: #666;
    font-size: 1em;
    margin-bottom: 20px;
}

.play-button {
    display: inline-block;
    background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
    color: white;
    text-decoration: none;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 1.3em;
    font-weight: bold;
    transition: all 0.3s ease;
    margin: 20px 0;
}

.play-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 184, 148, 0.4);
}

.action-section {
    text-align: center;
    margin: 40px 0;
}

.features {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1em;
    color: #333;
}

.feature-icon {
    font-size: 1.5em;
}

/* Страница выбора игр */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.game-item {
    display: flex;
    flex-direction: column;
}

.difficulty {
    margin: 15px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.difficulty-label {
    font-weight: bold;
    color: #666;
}

.stars {
    color: #ffd700;
    font-size: 1.2em;
}

.game-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: auto;
}

.game-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.tips {
    background: #e8f4fd;
    padding: 30px;
    border-radius: 20px;
    margin: 40px 0;
}

.tips h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.tips ul {
    list-style: none;
    padding: 0;
}

.tips li {
    margin: 10px 0;
    padding: 10px;
    background: white;
    border-radius: 10px;
    position: relative;
    padding-left: 40px;
}

.tips li:before {
    content: "✨";
    position: absolute;
    left: 15px;
    top: 10px;
}

/* Общие стили для игр */
.game-info {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    font-size: 1.1em;
    color: #333;
    flex-wrap: wrap;
    gap: 15px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Подвал */
footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px;
    border-top: 2px solid #eee;
    color: #666;
}

footer p {
    margin: 5px 0;
}

/* Мобильная адаптивность - улучшенная для всех устройств */
/* Базовые мобильные устройства (до 480px) */
@media (max-width: 480px) {
    body {
        font-size: 14px;
        -webkit-text-size-adjust: 100%;
        -webkit-tap-highlight-color: transparent;
    }
    
    .container {
        margin: 5px;
        padding: 10px;
        border-radius: 10px;
    }
    
    header h1 {
        font-size: 1.5em;
        margin-bottom: 5px;
    }
    
    header p {
        font-size: 0.9em;
    }
    
    .back-button {
        position: static;
        display: inline-block;
        margin-bottom: 15px;
        padding: 6px 12px;
        font-size: 0.85em;
    }
    
    .games-preview,
    .games-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin: 20px 0;
    }
    
    .features {
        flex-direction: column;
        gap: 10px;
        margin: 20px 0;
    }
    
    .feature {
        font-size: 0.95em;
    }
    
    .game-card {
        padding: 15px;
    }
    
    .game-card h3,
    .game-card h2 {
        font-size: 1.2em;
    }
    
    .game-card p {
        font-size: 0.9em;
    }
    
    .welcome-section {
        padding: 15px;
        margin: 20px 0;
    }
    
    .welcome-section h2 {
        font-size: 1.3em;
        margin-bottom: 10px;
    }
    
    .welcome-section p {
        font-size: 0.95em;
    }
    
    .play-button {
        padding: 12px 24px;
        font-size: 1em;
        width: 100%;
        max-width: 300px;
    }
    
    .game-icon {
        font-size: 2.5em;
    }
    
    .game-icon.large {
        font-size: 3em;
    }
    
    .tips {
        padding: 15px;
        margin: 20px 0;
    }
    
    .tips h3 {
        font-size: 1.2em;
    }
    
    .tips li {
        font-size: 0.9em;
        padding: 8px;
        padding-left: 35px;
    }
}

/* Планшеты и средние экраны (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    body {
        font-size: 15px;
        -webkit-text-size-adjust: 100%;
    }
    
    .container {
        margin: 10px;
        padding: 15px;
        border-radius: 15px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .back-button {
        position: static;
        display: inline-block;
        margin-bottom: 20px;
    }
    
    .games-preview {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .features {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
    }
    
    .game-card {
        padding: 20px;
    }
    
    .welcome-section {
        padding: 20px;
    }
    
    .welcome-section h2 {
        font-size: 1.6em;
    }
    
    .play-button {
        padding: 14px 28px;
        font-size: 1.15em;
    }
    
    .game-icon {
        font-size: 3em;
    }
}

/* Большие планшеты (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 900px;
    }
    
    .games-preview {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Touch устройства - улучшенные стили для касаний */
@media (hover: none) and (pointer: coarse) {
    .game-card,
    .play-button,
    .back-button,
    .card {
        -webkit-tap-highlight-color: rgba(102, 126, 234, 0.2);
        cursor: pointer;
    }
    
    .game-card:active,
    .card:active {
        transform: scale(0.98);
    }
    
    .play-button:active {
        transform: scale(0.95);
    }
    
    /* Увеличиваем области для касания */
    .back-button {
        padding: 10px 18px;
        min-height: 44px; /* Минимальная высота для удобного касания */
    }
    
    .play-button {
        min-height: 48px;
        padding: 14px 28px;
    }
    
    .game-card,
    .card {
        min-height: 120px;
    }
}

/* Ориентация экрана - портретная */
@media (max-width: 768px) and (orientation: portrait) {
    header h1 {
        font-size: 1.8em;
    }
    
    .welcome-section h2 {
        font-size: 1.4em;
    }
}

/* Ориентация экрана - альбомная */
@media (max-width: 1024px) and (orientation: landscape) {
    .container {
        margin: 10px;
        padding: 15px;
    }
    
    header h1 {
        font-size: 2em;
        margin-bottom: 5px;
    }
    
    .welcome-section {
        padding: 15px;
        margin: 15px 0;
    }
}

/* Анимации */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.game-icon:hover {
    animation: bounce 1s;
}

/* Дополнительные эффекты */
.container {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
