* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        html, body {
            height: 100%;
        }

        body {
            font-family: 'Segoe UI', Arial, sans-serif;
            line-height: 1.6;
            color: #333;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px; /* Default desktop padding */
            flex: 1 0 auto;
            display: flex;
            flex-direction: column;
        }

        .header {
            text-align: center;
            color: white;
            margin-bottom: 40px;
        }

        .header h1 {
            font-size: 2.5rem;
            margin-bottom: 10px;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
        }

        .header p {
            font-size: 1.2rem;
            opacity: 0.9;
        }

        .majors-grid {
            display: grid;
            /* Desktop: Auto-fit columns, min 200px, max 250px per tile */
            grid-template-columns: repeat(auto-fit, minmax(200px, 250px));
            gap: 20px;
            margin-bottom: 40px;
            justify-content: center; /* Center grid items if they don't fill the row */
        }

        .major-card {
            background: white;
            border-radius: 12px;
            aspect-ratio: 1 / 1; /* Make it square */
            padding: 20px; /* Generous padding for desktop content */
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
            transition: all 0.3s ease;
            cursor: pointer;
            position: relative;
            overflow: hidden;
            display: flex;
            flex-direction: column; /* Stack content vertically */
            justify-content: center; /* Center vertically */
            align-items: center; /* Center horizontally */
            text-align: center; /* Center text */
            width: 100%; /* Take full width of grid cell */
        }

        .major-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: var(--color);
            transform: scaleX(0);
            transition: transform 0.3s ease;
        }

        .major-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 40px rgba(0,0,0,0.15);
        }

        .major-card:hover::before {
            transform: scaleX(1);
        }

        .major-icon {
            font-size: 3.5rem; /* Large icon for desktop */
            margin-right: 0;
            margin-bottom: 15px;
            display: block;
            flex-shrink: 0;
        }

        .major-details {
            flex-grow: 0;
        }

        .major-name {
            font-size: 1.6rem;
            font-weight: bold;
            margin-bottom: 8px;
            color: #2c3e50;
        }

        .major-description {
            color: #666;
            margin-bottom: 0;
            line-height: 1.3;
            font-size: 1.3rem;
            overflow: hidden;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            text-overflow: ellipsis;
        }

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

        .visible {
            display: grid !important; /* Override with grid for visibility */
        }

        .loading {
            text-align: center;
            padding: 40px;
            color: white;
        }

        .error {
            text-align: center;
            padding: 20px;
            color: #e74c3c;
            background: rgba(255,255,255,0.9);
            border-radius: 10px;
            margin: 20px 0;
        }

        .footer {
            flex-shrink: 0;
            text-align: center;
            color: white;
            opacity: 0.8;
            margin-top: 20px;
            padding: 10px;
        }

        .quiz-container {
            background: white;
            border-radius: 15px;
            padding: 30px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
            margin-bottom: 40px;
        }

        .question-progress {
            text-align: center;
            margin-bottom: 20px;
            color: #764ba2;
            font-size: 1.1rem;
            font-weight: bold;
        }

        .question-text {
            font-size: 1.8rem;
            font-weight: bold;
            color: #333;
            text-align: center;
            margin-bottom: 30px;
        }

        .answer-options {
            display: flex;
            flex-direction: row;
            gap: 15px;
            width: 80%;
            margin: 0 auto;
            justify-content: center;
            align-items: center;
        }

        .answer-button {
            background: #f0f0f0;
            border: 2px solid #ddd;
            border-radius: 10px;
            padding: 20px;
            font-size: 1.3rem;
            cursor: pointer;
            transition: all 0.3s ease;
            text-align: center;
            color: #333;
            display: flex;
            align-items: center;
            justify-content: center;
            height: 100px;
            flex: 1;
            max-width: 200px;
        }

        .answer-button:hover {
            background: #e0e0e0;
            border-color: #bbb;
            transform: translateY(-2px);
        }

        .answer-button.selected {
            background: #667eea;
            color: white;
            border-color: #667eea;
        }

        .result-container {
            background: white;
            border-radius: 15px;
            padding: 30px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
            margin-bottom: 40px;
            text-align: center;
        }

        .result-container h2 {
            font-size: 2rem;
            color: #333;
            margin-bottom: 20px;
        }

        .result-score {
            font-size: 3rem;
            font-weight: bold;
            color: #667eea;
            margin-bottom: 10px;
        }

        .result-text {
            font-size: 1.3rem;
            color: #555;
            line-height: 1.6;
        }

        #download-result-btn {
            background: linear-gradient(135deg, #89f7fe 0%, #66a6ff 100%);
            border: none;
            border-radius: 50px; /* Make it a pill shape */
            color: white;
            cursor: pointer;
            font-size: 1.2rem;
            font-weight: bold;
            padding: 15px 30px;
            margin: 30px auto 0; /* Center it with margin-top */
            display: block; /* To apply margin auto */
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
            text-transform: uppercase;
        }

        #download-result-btn:hover {
            transform: translateY(-3px) scale(1.05);
            box-shadow: 0 8px 25px rgba(102, 166, 255, 0.6);
        }

        /* Mobile styles */
        @media (max-width: 767px) {
            .container {
                padding: 15px;
            }
            .header h1 {
                font-size: 2rem;
                margin-bottom: 8px;
            }
            .header p {
                font-size: 1rem;
            }
            .majors-grid {
                /* Force two columns, splitting available horizontal space */
                grid-template-columns: repeat(2, 1fr);
                gap: 10px;
            }
            .major-card {
                padding: 15px;
            }
            .major-icon {
                font-size: 3rem;
                margin-bottom: 12px;
            }
            .major-name {
                font-size: 1.4rem;
                margin-bottom: 6px;
            }
            .major-description {
                font-size: 1.2rem;
                line-height: 1.2;
            }
            .question-text {
                font-size: 1.5rem;
            }
            .answer-button {
                padding: 15px;
                font-size: 1.1rem;
                height: 80px;
            }
        }

        /* Even smaller mobile screens (e.g., old phones) */
        @media (max-width: 480px) {
            .container {
                padding: 5px;
            }
            .header h1 {
                font-size: 1.8rem;
            }
            .header p {
                font-size: 0.9rem;
            }
            .majors-grid {
                gap: 5px;
            }
            .major-card {
                padding: 10px;
            }
            .major-icon {
                font-size: 2.5rem;
                margin-bottom: 10px;
            }
            .major-name {
                font-size: 1.1rem;
                margin-bottom: 5px;
            }
            .major-description {
                font-size: 1rem;
                line-height: 1.1;
            }
            .question-text {
                font-size: 1.3rem;
            }
            .answer-button {
                font-size: 1rem;
                height: 70px;
            }
        } 