/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

/* Utility classes */
.hidden {
    display: none !important;
}

/* Splash Screen Styles */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #E1F5FE 0%, #B3E5FC 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.8s ease-out;
}

.splash-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* Tap to Start Overlay */
.tap-to-start {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    animation: pulse 2s ease-in-out infinite;
}

.tap-to-start .start-icon {
    width: 120px;
    height: 120px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.tap-to-start p {
    margin-top: 1.5rem;
    font-size: 1.5rem;
    color: #6200EE;
    font-weight: 600;
}

.tap-to-start.hidden {
    display: none;
}

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

.flying-face {
    width: 120px;
    height: 120px;
    position: absolute;
    will-change: transform, left, top;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    transition: opacity 0.8s ease-out;
}

.flying-face.fade-out {
    opacity: 0;
}

/* Home Screen Styles */
.home-screen {
    width: 100%;
    height: 100%;
    background: #F5F5F5;
    overflow-y: auto;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Header */
header {
    background: linear-gradient(135deg, #6200EE 0%, #3700B3 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0;
}

/* Main Content */
main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.card h2 {
    color: #6200EE;
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.card p {
    color: #424242;
    line-height: 1.6;
    font-size: 1rem;
}

/* Tablet-specific optimizations for Fire HD */
@media screen and (min-width: 768px) {
    header h1 {
        font-size: 3rem;
    }

    .card {
        padding: 2.5rem;
    }

    .card h2 {
        font-size: 1.75rem;
    }

    .card p {
        font-size: 1.125rem;
    }
}

/* Landscape orientation optimization */
@media screen and (orientation: landscape) {
    main {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 1.5rem;
    }

    .card {
        margin-bottom: 0;
    }
}

/* Performance optimizations */
.flying-face,
.splash-screen {
    backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-font-smoothing: antialiased;
}
