/* Custom Font Integration */
@font-face {
    font-family: "Proxima";
    src: url("./Proxima.OTF") format("opentype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body {
    font-family: "Proxima", "Inter", sans-serif;
    overscroll-behavior-y: contain; /* Prevents pull-to-refresh on mobile */
}
.screen {
    min-height: 100vh; /* Fallback for older browsers */
    min-height: 100dvh; /* Dynamic viewport height */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    box-sizing: border-box;
    text-align: center;
}
.header-text {
    font-size: 1.125rem; /* text-lg */
    font-weight: 600; /* semibold */
    color: #ffffff; /* white */
    letter-spacing: 0.1em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}
.footer-text {
    font-size: 1rem; /* text-base */
    font-weight: 600; /* semibold */
    color: #9ca3af; /* gray-400 */
    margin-top: auto; /* Pushes footer to bottom */
    padding-bottom: 10px;
}
.card {
    background-color: white;
    border-radius: 16px; /* rounded-2xl */
    padding: 24px; /* p-6 */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05); /* shadow-lg */
    width: 90%;
    max-width: 400px;
    min-height: 200px; /* Ensure card has some height */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    cursor: grab;
}
.card-content {
    font-size: 1.875rem; /* text-3xl */
    font-weight: 700; /* bold */
    color: #1f2937; /* gray-800 */
    margin-bottom: 16px; /* mb-4 */
}
.card-instruction {
    font-size: 0.875rem; /* text-sm */
    color: #6b7280; /* gray-500 */
}
.btn {
    padding: 12px 24px; /* py-3 px-6 */
    border-radius: 8px; /* rounded-lg */
    font-weight: 600; /* semibold */
    color: white;
    transition: background-color 0.3s;
    cursor: pointer;
}
.btn-primary {
    background-color: #2563eb; /* blue-600 */
}
.btn-primary:hover {
    background-color: #1d4ed8; /* blue-700 */
}
.btn-secondary {
    background-color: #4f46e5; /* indigo-600 */
}
.btn-secondary:hover {
    background-color: #4338ca; /* indigo-700 */
}
.input-field {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #d1d5db; /* gray-300 */
    margin-bottom: 10px;
    color: #374151; /* gray-700 */
    font-size: 14px;
    box-sizing: border-box;
}
/* Background gradient like the PDF */
.bg-quiz-gradient {
    background: linear-gradient(
        135deg,
        #06b6d4,
        #3b82f6
    ); /* cyan-500 to blue-500 */
}
.swipe-indicator {
    position: fixed;
    top: 50%;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: bold;
    color: white;
    z-index: 50;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.swipe-left-indicator {
    left: 20px;
    background-color: rgba(239, 68, 68, 0.8); /* red-500 with opacity */
    transform: translateY(-50%) rotate(-15deg);
}
.swipe-right-indicator {
    right: 20px;
    background-color: rgba(34, 197, 94, 0.8); /* green-500 with opacity */
    transform: translateY(-50%) rotate(15deg);
}

/* Swipe Instruction Icons */
.swipe-instructions {
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.swipe-icon {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: transform 0.2s ease;
}

.swipe-icon:hover {
    transform: scale(1.1);
}

.swipe-instructions span {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    font-family: "Proxima", "Inter", sans-serif;
    font-weight: 600;
}

/* ===== RESPONSIVE DESIGN ===== */

/* iPhone SE and very small screens (320px - 375px) */
@media (max-width: 375px) {
    .screen {
        padding: 8px;
        min-height: 100vh;
        min-height: 100dvh;
        justify-content: space-between;
    }

    .header-text {
        font-size: 0.875rem;
        margin-bottom: 8px;
        margin-top: 4px;
    }

    .footer-text {
        padding-bottom: 8px;
        margin-top: 8px;
    }

    .footer-text img {
        width: 80px !important;
        height: 50px !important;
        margin-bottom: 4px !important;
    }

    /* Welcome screen adjustments */
    .w-40.h-60 {
        width: 120px !important;
        height: 200px !important;
        margin-bottom: 16px !important;
    }

    h1 {
        font-size: 2.5rem !important;
        margin-bottom: 12px !important;
    }

    .text-3xl {
        font-size: 1.5rem !important;
    }

    .text-5xl {
        font-size: 2.5rem !important;
    }

    /* Button adjustments for iPhone SE */
    .btn {
        padding: 10px 16px;
        font-size: 0.875rem;
        min-height: 44px;
        width: auto;
        min-width: 140px;
        margin-bottom: 12px !important;
    }

    .mb-16 {
        margin-bottom: 12px !important;
    }

    /* Card adjustments */
    .card {
        width: 98%;
        max-width: 300px;
        min-height: 160px;
        padding: 12px;
        margin: 8px 0;
    }

    .card-content {
        font-size: 1.25rem;
        line-height: 1.3;
        margin-bottom: 8px;
    }

    .card-instruction {
        font-size: 0.7rem;
    }

    /* Form container for iPhone SE */
    .bg-white\/20 {
        padding: 8px !important;
        width: 98% !important;
        /* Remove max-height and overflow to prevent internal scrolling */
    }

    .input-field {
        padding: 6px 8px;
        font-size: 14px;
        margin-bottom: 6px;
        min-height: 36px;
    }

    /* Reduce spacing in form elements */
    .my-3 {
        margin-top: 8px !important;
        margin-bottom: 8px !important;
    }

    .text-2xl {
        font-size: 1.25rem !important;
        margin-bottom: 8px !important;
    }

    .mb-4 {
        margin-bottom: 8px !important;
    }

    /* How to play screen adjustments */
    .max-w-md {
        max-width: 95% !important;
    }

    .space-y-4 > * + * {
        margin-top: 12px !important;
    }

    .text-lg {
        font-size: 0.875rem !important;
    }

    /* Score screen adjustments */
    .text-7xl,
    .text-8xl {
        font-size: 3rem !important;
    }

    .text-4xl,
    .text-5xl {
        font-size: 1.75rem !important;
    }

    .w-36,
    .w-48 {
        width: 100px !important;
        height: 100px !important;
    }

    /* Swipe instructions for iPhone SE */
    .swipe-instructions {
        margin-top: 16px !important;
        max-width: 280px !important;
    }

    .swipe-icon {
        width: 32px !important;
        height: 32px !important;
    }

    .swipe-instructions span {
        font-size: 0.75rem !important;
    }
}

/* Mobile First - Base styles for mobile devices */
@media (max-width: 480px) {
    .screen {
        padding: 10px;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .header-text {
        font-size: 1rem;
        margin-bottom: 10px;
    }

    .card {
        width: 95%;
        max-width: 320px;
        min-height: 180px;
        padding: 16px;
        margin: 10px 0;
    }

    .card-content {
        font-size: 1.5rem;
        line-height: 1.4;
        margin-bottom: 12px;
    }

    .card-instruction {
        font-size: 0.75rem;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.875rem;
        min-height: 44px; /* Minimum touch target size */
        width: auto;
        min-width: 120px;
    }

    .input-field {
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
        margin-bottom: 12px;
        min-height: 44px;
    }

    /* Form container adjustments */
    .bg-white\/20 {
        padding: 12px !important;
        /* Remove max-height and overflow to prevent internal scrolling */
    }

    /* Swipe indicators for mobile */
    .swipe-left-indicator,
    .swipe-right-indicator {
        padding: 6px 12px;
        font-size: 0.875rem;
    }

    .swipe-left-indicator {
        left: 10px;
    }

    .swipe-right-indicator {
        right: 10px;
    }
}

/* Tablet Portrait */
@media (min-width: 481px) and (max-width: 768px) {
    .screen {
        padding: 15px;
    }

    .card {
        width: 85%;
        max-width: 380px;
        min-height: 200px;
        padding: 20px;
    }

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

    .btn {
        padding: 12px 24px;
        font-size: 1rem;
        min-height: 48px;
    }

    .input-field {
        padding: 12px;
        font-size: 16px;
        margin-bottom: 14px;
    }
}

/* Tablet Landscape and Small Desktop */
@media (min-width: 769px) and (max-width: 1024px) {
    .screen {
        padding: 20px;
    }

    .card {
        width: 70%;
        max-width: 400px;
        min-height: 220px;
    }

    .btn {
        min-height: 50px;
    }
}

/* Large Desktop */
@media (min-width: 1025px) {
    .screen {
        padding: 24px;
    }

    .card {
        width: 60%;
        max-width: 450px;
        min-height: 240px;
    }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 600px) {
    .screen {
        padding: 8px;
        min-height: 100vh;
    }

    .header-text {
        font-size: 0.875rem;
        margin-bottom: 5px;
    }

    .card {
        min-height: 150px;
        padding: 12px;
        margin: 5px 0;
    }

    .card-content {
        font-size: 1.25rem;
        margin-bottom: 8px;
    }

    .btn {
        padding: 8px 16px;
        font-size: 0.875rem;
        min-height: 40px;
    }

    .footer-text {
        padding-bottom: 5px;
    }

    /* Form adjustments for landscape */
    .bg-white\/20 {
        padding: 12px !important;
        max-height: 70vh;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .card {
        box-shadow: 0 12px 20px -4px rgba(0, 0, 0, 0.15),
            0 6px 8px -2px rgba(0, 0, 0, 0.08);
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .card,
    .btn,
    .swipe-indicator {
        transition: none;
    }
}

/* Focus styles for keyboard navigation */
.btn:focus,
.input-field:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Ensure buttons are always accessible */
.btn {
    border: none;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

/* Prevent text selection on game elements */
.card,
.card-content,
.card-instruction {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}
