* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    transition: background 0.3s ease;
}

body.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.screen {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.app-header {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
}

.app-title {
    font-size: 3.5em;
    color: white;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
}

.app-subtitle {
    font-size: 1.3em;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
}

.icon-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.game-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.game-card.coming-soon {
    opacity: 0.6;
    cursor: default;
}

.game-card.coming-soon:hover {
    transform: translateY(0);
}

body.dark-mode .game-card {
    background: #0f3460;
    color: #e0e0e0;
}

.game-icon {
    font-size: 5em;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.game-card h3 {
    font-size: 1.8em;
    margin-bottom: 10px;
    color: #333;
}

body.dark-mode .game-card h3 {
    color: #e0e0e0;
}

.game-card p {
    color: #666;
    margin-bottom: 20px;
    font-size: 1em;
}

body.dark-mode .game-card p {
    color: #aaa;
}

.play-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.play-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.play-btn:disabled {
    background: linear-gradient(135deg, #adb5bd 0%, #868e96 100%);
    cursor: not-allowed;
    box-shadow: none;
}

.settings-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

body.dark-mode .settings-header {
    background: #0f3460;
}

.settings-header h1 {
    margin: 0;
    color: #333;
}

body.dark-mode .settings-header h1 {
    color: #e0e0e0;
}

.back-btn {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.back-btn:hover {
    background: #5a6268;
    transform: translateX(-3px);
}

.settings-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 25px;
}

body.dark-mode .settings-content {
    background: #0f3460;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.setting-item label {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

body.dark-mode .setting-item label {
    color: #e0e0e0;
}

.setting-item select {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

body.dark-mode .setting-item select {
    background: #16213e;
    color: #e0e0e0;
    border-color: #1a1a2e;
}

.setting-item select:hover {
    border-color: #667eea;
}

.setting-item select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.setting-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
}

#game-container {
    display: none;
}

#game-container.active {
    display: block;
}

@media (max-width: 768px) {
    .app-title {
        font-size: 2.5em;
    }

    .app-subtitle {
        font-size: 1.1em;
    }

    .games-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .icon-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2em;
    }

    .game-icon {
        font-size: 4em;
    }

    .settings-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
