/* Flag Academy - Fun & Kid-Friendly Styles */

/* ===== CONTAINER ===== */
.flag-academy-container {
    width: 100%;
    min-height: 100vh;
}

/* ===== HOME PAGE ===== */
.flag-academy-home {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.flag-academy-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.flag-academy-header h1 {
    font-size: 2.5rem;
    color: #2d3748;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.flag-academy-header h1::before {
    content: '🏴‍☠️';
    font-size: 3rem;
}

.flag-academy-header h1::after {
    content: '🎯';
    font-size: 3rem;
}

.flag-academy-header p {
    color: #4a5568;
    font-size: 1.2rem;
}

/* Stats Section */
.flag-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.stat-item {
    background: linear-gradient(135deg, #fff 0%, #f0f4ff 100%);
    border-radius: 16px;
    padding: 20px 30px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 3px solid #e2e8f0;
}

.stat-item:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 1rem;
    color: #4a5568;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Menu Grid */
.flag-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    padding: 20px;
}

/* CLICKABLE MENU CARDS - Main Interactive Elements */
.flag-menu-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9ff 100%);
    border-radius: 24px;
    padding: 30px 25px;
    text-align: center;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 4px solid transparent;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.flag-menu-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* Hover Effects for Cards */
.flag-menu-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 50px rgba(102, 126, 234, 0.4);
    border-color: #667eea;
}

.flag-menu-card:hover::before {
    opacity: 1;
}

/* Active/Click Effect */
.flag-menu-card:active {
    transform: translateY(-2px) scale(0.98);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* Card Icon */
.flag-menu-card .card-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    display: block;
    transition: transform 0.3s ease;
}

.flag-menu-card:hover .card-icon {
    transform: scale(1.2) rotate(5deg);
    animation: bounce 0.5s ease infinite alternate;
}

@keyframes bounce {
    from { transform: scale(1.2) rotate(5deg) translateY(0); }
    to { transform: scale(1.2) rotate(5deg) translateY(-10px); }
}

/* Card Title */
.flag-menu-card h3 {
    font-size: 1.4rem;
    color: #2d3748;
    margin-bottom: 10px;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

/* Card Description */
.flag-menu-card p {
    font-size: 1rem;
    color: #718096;
    line-height: 1.5;
    position: relative;
    z-index: 1;
}

/* Color Variations for Cards */
.flag-menu-card.card-explore {
    background: linear-gradient(145deg, #e0f7fa 0%, #b2ebf2 100%);
    border-color: #4dd0e1;
}

.flag-menu-card.card-explore:hover {
    border-color: #00bcd4;
    box-shadow: 0 20px 50px rgba(0, 188, 212, 0.4);
}

.flag-menu-card.card-easy {
    background: linear-gradient(145deg, #e8f5e9 0%, #c8e6c9 100%);
    border-color: #81c784;
}

.flag-menu-card.card-easy:hover {
    border-color: #4caf50;
    box-shadow: 0 20px 50px rgba(76, 175, 80, 0.4);
}

.flag-menu-card.card-medium {
    background: linear-gradient(145deg, #fff3e0 0%, #ffe0b2 100%);
    border-color: #ffb74d;
}

.flag-menu-card.card-medium:hover {
    border-color: #ff9800;
    box-shadow: 0 20px 50px rgba(255, 152, 0, 0.4);
}

.flag-menu-card.card-hard {
    background: linear-gradient(145deg, #fce4ec 0%, #f8bbd9 100%);
    border-color: #f06292;
}

.flag-menu-card.card-hard:hover {
    border-color: #e91e63;
    box-shadow: 0 20px 50px rgba(233, 30, 99, 0.4);
}

.flag-menu-card.card-similar {
    background: linear-gradient(145deg, #e8eaf6 0%, #c5cae9 100%);
    border-color: #7986cb;
}

.flag-menu-card.card-similar:hover {
    border-color: #3f51b5;
    box-shadow: 0 20px 50px rgba(63, 81, 181, 0.4);
}

.flag-menu-card.card-patterns {
    background: linear-gradient(145deg, #f3e5f5 0%, #e1bee7 100%);
    border-color: #ba68c8;
}

.flag-menu-card.card-patterns:hover {
    border-color: #9c27b0;
    box-shadow: 0 20px 50px rgba(156, 39, 176, 0.4);
}

.flag-menu-card.card-states {
    background: linear-gradient(145deg, #e3f2fd 0%, #bbdefb 100%);
    border-color: #64b5f6;
}

.flag-menu-card.card-states:hover {
    border-color: #2196f3;
    box-shadow: 0 20px 50px rgba(33, 150, 243, 0.4);
}

.flag-menu-card.card-stories {
    background: linear-gradient(145deg, #fce4ec 0%, #f8bbd0 100%);
    border-color: #ec407a;
}

.flag-menu-card.card-stories:hover {
    border-color: #e91e63;
    box-shadow: 0 20px 50px rgba(233, 30, 99, 0.4);
}

/* Premium Badge */
.premium-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    color: #333;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 4px 15px rgba(255, 170, 0, 0.4);
    z-index: 10;
}

.premium-badge::before {
    content: '👑';
}

/* Locked Card Overlay */
.flag-menu-card.locked {
    position: relative;
}

.flag-menu-card.locked::after {
    content: '🔒 Premium Feature';
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    color: #333;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    white-space: nowrap;
}

/* ===== FLAG BROWSER ===== */
.flag-browser {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.browser-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    flex-wrap: wrap;
    gap: 15px;
}

.browser-header h2 {
    font-size: 1.8rem;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Search & Filter */
.search-filter-group {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.flag-search {
    padding: 12px 20px;
    font-size: 1rem;
    border: 3px solid #e2e8f0;
    border-radius: 30px;
    min-width: 250px;
    transition: all 0.3s ease;
    background: #fff;
}

.flag-search:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.continent-filter {
    padding: 12px 20px;
    font-size: 1rem;
    border: 3px solid #e2e8f0;
    border-radius: 30px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.continent-filter:focus {
    outline: none;
    border-color: #667eea;
}

/* Back Button */
.back-btn {
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Arrow is included in button text, no need for ::before */

.back-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.back-btn:active {
    transform: translateY(0);
}

/* Flag Grid */
.flag-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    padding: 10px;
}

/* Individual Flag Cards */
.flag-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.flag-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.flag-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-bottom: 3px solid #e2e8f0;
}

.flag-card .flag-name {
    padding: 15px;
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    text-align: center;
    background: linear-gradient(to bottom, #fff, #f8f9ff);
}

/* ===== QUIZ SECTION ===== */
.quiz-section {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 20px 25px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    flex-wrap: wrap;
    gap: 15px;
}

.quiz-header h2 {
    font-size: 1.8rem;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 10px;
}

.quiz-progress {
    display: flex;
    align-items: center;
    gap: 20px;
}

.progress-bar-container {
    width: 200px;
    height: 20px;
    background: #e2e8f0;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    border-radius: 30px;
    transition: width 0.5s ease;
}

.score-display {
    font-size: 1.3rem;
    font-weight: 700;
    color: #667eea;
    display: flex;
    align-items: center;
    gap: 8px;
}

.score-display::before {
    content: '⭐';
    font-size: 1.5rem;
}

/* Quiz Content */
.quiz-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.quiz-flag {
    width: 100%;
    max-width: 350px;
    height: auto;
    margin: 0 auto 30px;
    display: block;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 5px solid #e2e8f0;
}

.quiz-question {
    font-size: 1.5rem;
    color: #2d3748;
    text-align: center;
    margin-bottom: 25px;
    font-weight: 600;
}

/* Quiz Options */
.quiz-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.quiz-option {
    padding: 20px 25px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    background: linear-gradient(145deg, #fff 0%, #f0f4ff 100%);
    border: 4px solid #e2e8f0;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.quiz-option:hover {
    transform: translateY(-5px);
    border-color: #667eea;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.quiz-option:active {
    transform: translateY(-2px);
}

.quiz-option.correct {
    background: linear-gradient(145deg, #c6f6d5 0%, #9ae6b4 100%);
    border-color: #48bb78;
    animation: correct-pulse 0.5s ease;
}

.quiz-option.incorrect {
    background: linear-gradient(145deg, #fed7d7 0%, #feb2b2 100%);
    border-color: #f56565;
    animation: shake 0.5s ease;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Quiz Complete */
.quiz-complete {
    text-align: center;
    padding: 40px;
}

.quiz-complete h2 {
    font-size: 2.5rem;
    color: #2d3748;
    margin-bottom: 20px;
}

.final-score {
    font-size: 4rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
}

.score-message {
    font-size: 1.5rem;
    color: #4a5568;
    margin-bottom: 30px;
}

.restart-btn {
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.restart-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

/* ===== SIMILAR FLAGS SECTION ===== */
.similar-flags-section {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.similar-group {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.similar-group h3 {
    font-size: 1.5rem;
    color: #2d3748;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.similar-flags-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.similar-flag-item {
    text-align: center;
    transition: transform 0.3s ease;
}

.similar-flag-item:hover {
    transform: translateY(-8px) scale(1.05);
}

.similar-flag-item img {
    width: 150px;
    height: 100px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border: 3px solid #e2e8f0;
    margin-bottom: 10px;
}

.similar-flag-item span {
    display: block;
    font-weight: 600;
    color: #2d3748;
}

/* ===== PATTERNS SECTION ===== */
.patterns-section {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.pattern-category {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.pattern-category h3 {
    font-size: 1.5rem;
    color: #2d3748;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pattern-category p {
    color: #718096;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.pattern-flags-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.pattern-flag-item {
    text-align: center;
    transition: transform 0.3s ease;
}

.pattern-flag-item:hover {
    transform: translateY(-8px) scale(1.05);
}

.pattern-flag-item img {
    width: 130px;
    height: 85px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
    border: 3px solid #e2e8f0;
    margin-bottom: 8px;
}

.pattern-flag-item span {
    display: block;
    font-weight: 600;
    color: #2d3748;
    font-size: 0.9rem;
}

/* ===== STATE FLAGS SECTION ===== */
.state-flags-section {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.state-flags-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.state-flag-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.state-flag-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.state-flag-card img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-bottom: 3px solid #e2e8f0;
}

.state-flag-card .state-name {
    padding: 15px;
    font-weight: 600;
    color: #2d3748;
    text-align: center;
    background: linear-gradient(to bottom, #fff, #f8f9ff);
}

/* ===== FLAG STORIES SECTION ===== */
.flag-stories-section {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.story-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.story-card h3 {
    font-size: 1.5rem;
    color: #2d3748;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.story-card img {
    width: 180px;
    height: 120px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    float: right;
    margin-left: 20px;
    margin-bottom: 10px;
}

.story-card p {
    color: #4a5568;
    line-height: 1.8;
    font-size: 1.1rem;
}

/* ===== FLAG DETAIL MODAL ===== */
.flag-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

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

.flag-modal-content {
    background: #fff;
    border-radius: 24px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.flag-modal-header {
    position: relative;
    padding: 20px;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 24px 24px 0 0;
}

.flag-modal-header img {
    width: 100%;
    max-width: 300px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close-btn:hover {
    background: #fff;
    transform: scale(1.1);
}

.flag-modal-body {
    padding: 30px;
}

.flag-modal-body h2 {
    font-size: 2rem;
    color: #2d3748;
    margin-bottom: 20px;
    text-align: center;
}

.flag-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.flag-info-item {
    background: linear-gradient(145deg, #f8f9ff 0%, #e8eaff 100%);
    padding: 15px 20px;
    border-radius: 12px;
}

.flag-info-item label {
    display: block;
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.flag-info-item span {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    .flag-academy-home {
        padding: 15px;
    }

    .flag-academy-header h1 {
        font-size: 1.8rem;
    }

    .flag-academy-header h1::before,
    .flag-academy-header h1::after {
        font-size: 2rem;
    }

    .flag-stats {
        gap: 10px;
    }

    .stat-item {
        padding: 15px 20px;
    }

    .stat-number {
        font-size: 2rem;
    }

    .flag-menu-grid {
        grid-template-columns: 1fr;
        padding: 10px;
        gap: 15px;
    }

    .flag-menu-card {
        padding: 25px 20px;
    }

    .flag-menu-card .card-icon {
        font-size: 3rem;
    }

    .browser-header {
        flex-direction: column;
        text-align: center;
    }

    .search-filter-group {
        width: 100%;
        flex-direction: column;
    }

    .flag-search,
    .continent-filter {
        width: 100%;
        min-width: unset;
    }

    .flag-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }

    .quiz-header {
        flex-direction: column;
        text-align: center;
    }

    .quiz-options {
        grid-template-columns: 1fr;
    }

    .quiz-option {
        padding: 15px 20px;
    }

    .similar-flag-item img,
    .pattern-flag-item img {
        width: 100px;
        height: 65px;
    }

    .flag-info-grid {
        grid-template-columns: 1fr;
    }

    .story-card img {
        float: none;
        display: block;
        margin: 0 auto 20px;
    }
}

@media (max-width: 480px) {
    .flag-academy-header h1 {
        font-size: 1.5rem;
        flex-wrap: wrap;
    }

    .stat-item {
        padding: 12px 15px;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    .stat-label {
        font-size: 0.85rem;
    }

    .flag-menu-card h3 {
        font-size: 1.2rem;
    }

    .flag-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .flag-card img {
        height: 80px;
    }

    .flag-card .flag-name {
        padding: 10px;
        font-size: 0.85rem;
    }

    .quiz-flag {
        max-width: 280px;
    }

    .final-score {
        font-size: 3rem;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .flag-menu-card,
    .flag-card,
    .quiz-option,
    .similar-flag-item,
    .pattern-flag-item,
    .state-flag-card {
        transition: none;
    }

    .flag-menu-card:hover .card-icon {
        animation: none;
    }

    .quiz-option.correct,
    .quiz-option.incorrect {
        animation: none;
    }
}

/* ===== REGION FILTERS ===== */
.region-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.region-btn {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    color: #4a5568;
    background: linear-gradient(145deg, #f0f4ff 0%, #e8eaff 100%);
    border: 3px solid #e2e8f0;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.region-btn:hover {
    transform: translateY(-3px);
    border-color: #667eea;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.region-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

/* ===== FLAG DETAIL PAGE ===== */
.flag-detail {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.detail-header {
    margin-bottom: 20px;
}

.detail-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.detail-flag {
    text-align: center;
    margin-bottom: 30px;
}

.detail-flag img {
    max-width: 100%;
    width: 400px;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    border: 5px solid #e2e8f0;
}

.detail-info h1 {
    font-size: 2.5rem;
    color: #2d3748;
    margin-bottom: 25px;
    text-align: center;
}

.info-row {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(145deg, #f8f9ff 0%, #e8eaff 100%);
    border-radius: 12px;
    margin-bottom: 12px;
}

.info-label {
    font-weight: 600;
    color: #667eea;
    min-width: 120px;
}

.info-value {
    color: #2d3748;
    font-weight: 500;
}

.color-meanings {
    margin-top: 30px;
    padding: 25px;
    background: linear-gradient(145deg, #fff 0%, #f0f4ff 100%);
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.color-meanings h3 {
    font-size: 1.4rem;
    color: #2d3748;
    margin-bottom: 15px;
}

.color-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.color-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.color-name {
    font-weight: 600;
    color: #4a5568;
    min-width: 80px;
}

.color-meaning {
    color: #718096;
}

.flag-story,
.fun-facts {
    margin-top: 25px;
    padding: 25px;
    background: linear-gradient(145deg, #fff 0%, #f0f4ff 100%);
    border-radius: 16px;
}

.flag-story h3,
.fun-facts h3 {
    font-size: 1.4rem;
    color: #2d3748;
    margin-bottom: 15px;
}

.flag-story p,
.fun-facts ul {
    color: #4a5568;
    line-height: 1.8;
}

.fun-facts ul {
    list-style: none;
    padding: 0;
}

.fun-facts li {
    padding: 10px 15px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    margin-bottom: 10px;
    position: relative;
    padding-left: 35px;
}

.fun-facts li::before {
    content: '✨';
    position: absolute;
    left: 10px;
}

.premium-blur {
    position: relative;
}

.blur-text {
    filter: blur(4px);
    user-select: none;
}

.unlock-btn {
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.unlock-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(255, 170, 0, 0.4);
}

.unlock-btn.small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.similar-flags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
}

.mini-flag {
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.mini-flag:hover {
    transform: translateY(-5px);
}

.mini-flag img {
    width: 100px;
    height: 65px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    margin-bottom: 8px;
}

.mini-flag span {
    display: block;
    font-size: 0.85rem;
    color: #4a5568;
    font-weight: 500;
}

/* ===== PATTERNS PAGE ===== */
.patterns-page,
.state-flags-page,
.flag-stories-page {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.page-intro {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 25px;
    border-radius: 16px;
    text-align: center;
    color: #4a5568;
    font-size: 1.1rem;
    margin-bottom: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.patterns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.pattern-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    position: relative;
}

.pattern-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
}

.pattern-card.premium-locked {
    opacity: 0.85;
}

.pattern-emoji {
    font-size: 3rem;
    margin-bottom: 15px;
}

.pattern-card h3 {
    font-size: 1.3rem;
    color: #2d3748;
    margin-bottom: 10px;
}

.pattern-card p {
    color: #718096;
    font-size: 0.95rem;
}

.pattern-examples {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
}

.pattern-examples img {
    width: 40px;
    height: 26px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

/* ===== PATTERN DETAIL ===== */
.pattern-detail {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.pattern-info {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.pattern-description {
    font-size: 1.2rem;
    color: #2d3748;
    margin-bottom: 15px;
}

.pattern-facts {
    color: #718096;
    line-height: 1.6;
}

.pattern-examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.example-flag {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    overflow: hidden;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.example-flag:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
}

.example-flag img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.example-flag span {
    display: block;
    padding: 15px;
    font-weight: 600;
    color: #2d3748;
}

/* ===== SIMILAR FLAGS PAGE ===== */
.similar-flags-page {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.similar-groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.similar-group-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.similar-group-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
}

.similar-group-card h3 {
    font-size: 1.4rem;
    color: #2d3748;
    margin-bottom: 10px;
}

.similar-group-card p {
    color: #718096;
    margin-bottom: 15px;
}

.preview-flags,
.group-flags-preview {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.preview-flags img,
.group-flags-preview img {
    width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ===== SIMILAR FLAGS DETAIL ===== */
.similar-detail {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Alias for similar-detail */
.similar-group-detail {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.group-description {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 25px;
    border-radius: 16px;
    text-align: center;
    color: #4a5568;
    font-size: 1.1rem;
    margin-bottom: 25px;
}

.similar-flags-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

.comparison-flag {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.comparison-flag:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
}

.comparison-flag img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.comparison-flag h4 {
    font-size: 1.2rem;
    color: #2d3748;
    margin-bottom: 10px;
}

.flag-hint {
    color: #718096;
    font-size: 0.9rem;
}

.tip-box {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    background: linear-gradient(145deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 16px;
    padding: 20px 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.tip-icon {
    font-size: 2rem;
}

.tip-content strong {
    color: #92400e;
    display: block;
    margin-bottom: 5px;
}

.tip-content {
    color: #78350f;
    line-height: 1.6;
}

/* ===== STATE FLAGS GRID ===== */
.state-flags-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.state-flag-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.state-flag-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
}

.state-flag-image img {
    width: 100%;
    height: 130px;
    object-fit: cover;
}

.state-name {
    padding: 15px;
    text-align: center;
    font-weight: 600;
    color: #2d3748;
    background: linear-gradient(to bottom, #fff, #f8f9ff);
}

.flag-placeholder {
    width: 100%;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    font-size: 3rem;
}

/* ===== FLAG STORIES ===== */
.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

.story-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}

.story-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
}

.story-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.story-content {
    padding: 20px;
}

.story-content h4 {
    font-size: 1.3rem;
    color: #2d3748;
    margin-bottom: 10px;
}

.story-content p {
    color: #718096;
    line-height: 1.6;
}

/* ===== LOADING STATE ===== */
.flag-academy-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    text-align: center;
    padding: 40px;
}

.flag-academy-loading::before {
    content: '🏁';
    font-size: 5rem;
    animation: flag-wave 1s ease-in-out infinite;
    margin-bottom: 20px;
}

@keyframes flag-wave {
    0%, 100% { transform: rotate(-10deg); }
    50% { transform: rotate(10deg); }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    .flag-academy-home {
        background: linear-gradient(135deg, #1a1c2e 0%, #2d1f47 100%);
    }

    .flag-academy-header,
    .browser-header,
    .quiz-header,
    .quiz-content,
    .similar-group,
    .pattern-category,
    .story-card,
    .flag-modal-content {
        background: #1e2030;
        color: #e2e8f0;
    }

    .flag-academy-header h1,
    .browser-header h2,
    .quiz-header h2,
    .similar-group h3,
    .pattern-category h3,
    .story-card h3,
    .flag-modal-body h2 {
        color: #e2e8f0;
    }

    .flag-academy-header p,
    .story-card p {
        color: #a0aec0;
    }

    .stat-item {
        background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
        border-color: #4a5568;
    }

    .flag-menu-card {
        background: linear-gradient(145deg, #2d3748 0%, #1a202c 100%);
        border-color: #4a5568;
    }

    .flag-menu-card h3,
    .flag-card .flag-name,
    .state-flag-card .state-name {
        color: #e2e8f0;
    }

    .flag-menu-card p {
        color: #a0aec0;
    }

    .flag-card,
    .state-flag-card {
        background: #2d3748;
    }

    .quiz-option {
        background: linear-gradient(145deg, #2d3748 0%, #1a202c 100%);
        border-color: #4a5568;
        color: #e2e8f0;
    }

    .flag-search,
    .continent-filter {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }

    .region-btn {
        background: linear-gradient(145deg, #2d3748 0%, #1a202c 100%);
        border-color: #4a5568;
        color: #e2e8f0;
    }

    .detail-content,
    .pattern-info,
    .page-intro,
    .pattern-card,
    .similar-group-card,
    .comparison-flag,
    .example-flag,
    .info-row,
    .color-meanings,
    .flag-story,
    .fun-facts {
        background: #1e2030;
        color: #e2e8f0;
    }

    .info-row,
    .fun-facts li {
        background: rgba(102, 126, 234, 0.2);
    }

    .detail-info h1,
    .pattern-card h3,
    .similar-group-card h3,
    .comparison-flag h4,
    .example-flag span {
        color: #e2e8f0;
    }

    .pattern-card p,
    .similar-group-card p,
    .flag-hint,
    .pattern-facts,
    .color-meaning {
        color: #a0aec0;
    }
}

/* ===== MOBILE RESPONSIVE FOR NEW ELEMENTS ===== */
@media (max-width: 768px) {
    .region-filters {
        padding: 15px;
        gap: 8px;
    }

    .region-btn {
        padding: 10px 18px;
        font-size: 0.9rem;
    }

    .detail-flag img {
        width: 100%;
        max-width: 280px;
    }

    .detail-info h1 {
        font-size: 1.8rem;
    }

    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .patterns-grid,
    .similar-groups-grid,
    .stories-grid {
        grid-template-columns: 1fr;
    }

    .similar-flags-comparison {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .comparison-flag img {
        height: 100px;
    }

    .tip-box {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .similar-flags-comparison {
        grid-template-columns: 1fr;
    }

    .preview-flags img {
        width: 45px;
        height: 30px;
    }

    .state-flags-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* ===== SEARCH BOX STYLES ===== */
.flag-search-container {
    max-width: 500px;
    margin: 0 auto 25px auto;
    padding: 0 20px;
}

.flag-search-box {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 50px;
    padding: 8px 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border: 3px solid #e2e8f0;
    transition: all 0.3s ease;
}

.flag-search-box:focus-within {
    border-color: #667eea;
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.flag-search-box span {
    font-size: 1.5rem;
    margin-right: 12px;
}

.flag-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.1rem;
    padding: 10px 0;
    background: transparent;
    color: #2d3748;
}

.flag-search-input::placeholder {
    color: #a0aec0;
}

/* ===== QUIZ FLAG FIT IMPROVEMENTS ===== */
.quiz-flag {
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 20px;
    min-height: 220px;
    border: 3px solid #94a3b8;
}

.quiz-flag img {
    max-width: 100%;
    width: 320px;
    height: auto;
    min-height: 180px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    background: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.quiz-flag img[src] {
    opacity: 1;
}

/* ===== QUIZ ANSWER FEEDBACK ===== */
.quiz-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    max-width: 600px;
    margin: 0 auto;
}

.quiz-option {
    background: white;
    border: 3px solid #e2e8f0;
    border-radius: 16px;
    padding: 18px 24px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.quiz-option:hover:not([disabled]) {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
    background: #f0f4ff;
}

.quiz-option.correct {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border-color: #059669 !important;
    color: white !important;
    animation: correctPulse 0.5s ease;
}

.quiz-option.wrong {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    border-color: #dc2626 !important;
    color: white !important;
    animation: wrongShake 0.5s ease;
}

.quiz-option.correct-reveal {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border-color: #059669 !important;
    color: white !important;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

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

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    50% { transform: translateX(10px); }
    75% { transform: translateX(-5px); }
}

.quiz-option[disabled] {
    pointer-events: none;
    opacity: 0.85;
}

/* ===== STATE QUIZ STYLES ===== */
.state-quiz-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.state-quiz-header {
    text-align: center;
    margin-bottom: 30px;
}

.state-quiz-header h2 {
    font-size: 2rem;
    color: white;
    margin-bottom: 10px;
}

.state-quiz-progress {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
}

.state-quiz-progress span {
    font-size: 1.2rem;
    color: white;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 30px;
}

.state-quiz-flag {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.state-quiz-flag img {
    max-width: 350px;
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.state-quiz-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    max-width: 600px;
    margin: 0 auto;
}

.state-quiz-option {
    background: white;
    border: 3px solid #e2e8f0;
    border-radius: 16px;
    padding: 18px 24px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.state-quiz-option:hover:not([disabled]) {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border-color: #3b82f6;
    background: #eff6ff;
}

.state-quiz-option.correct {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border-color: #059669 !important;
    color: white !important;
    animation: correctPulse 0.5s ease;
}

.state-quiz-option.wrong {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    border-color: #dc2626 !important;
    color: white !important;
    animation: wrongShake 0.5s ease;
}

.state-quiz-option.correct-reveal {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border-color: #059669 !important;
    color: white !important;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

/* ===== STATE QUIZ RESULTS ===== */
.state-quiz-results {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    padding: 40px;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
}

.state-quiz-results h2 {
    font-size: 2rem;
    color: #2d3748;
    margin-bottom: 15px;
}

.state-quiz-results .result-emoji {
    font-size: 4rem;
    margin-bottom: 15px;
}

.state-quiz-results .score {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.state-quiz-results .percentage {
    font-size: 1.3rem;
    color: #4a5568;
    margin-bottom: 25px;
}

.state-quiz-results .result-btns {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.state-quiz-results .btn {
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.state-quiz-results .btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.state-quiz-results .btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.state-quiz-results .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* ===== QUIZ RESULTS (World Flags) ===== */
.quiz-results {
    text-align: center;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 28px;
    padding: 50px 40px;
    max-width: 450px;
    margin: 40px auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: popIn 0.4s ease-out;
}

@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.quiz-results .results-emoji {
    font-size: 5rem;
    margin-bottom: 15px;
    animation: bounce 0.6s ease-in-out;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.quiz-results h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: #2d3748;
    margin-bottom: 25px;
    line-height: 1.3;
}

.quiz-results .score-circle {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 5px;
    margin-bottom: 10px;
}

.quiz-results .score-number {
    font-size: 4.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.quiz-results .score-total {
    font-size: 2rem;
    font-weight: 700;
    color: #718096;
}

.quiz-results .score-percentage {
    font-size: 1.3rem;
    font-weight: 600;
    color: #48bb78;
    margin-bottom: 30px;
}

.quiz-results .results-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.quiz-results .action-btn {
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quiz-results .action-btn.primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.quiz-results .action-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
}

.quiz-results .action-btn.secondary {
    background: #f1f5f9;
    color: #4a5568;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.quiz-results .action-btn.secondary:hover {
    transform: translateY(-3px);
    background: #e2e8f0;
}

/* ===== SIMILAR FLAGS SECTION SIZE FIX ===== */
.detail-similar-section {
    margin-top: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
}

.detail-similar-section h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: white;
}

.detail-similar-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: flex-start;
}

.detail-similar-flag {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.detail-similar-flag:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.25);
}

.detail-similar-flag img {
    width: 80px;
    height: 52px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.detail-similar-flag span {
    font-size: 0.85rem;
    color: white;
    text-align: center;
}

/* ===== NO RESULTS FOUND ===== */
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    margin: 20px;
}

.no-results .emoji {
    font-size: 4rem;
    margin-bottom: 15px;
}

.no-results h3 {
    font-size: 1.5rem;
    color: white;
    margin-bottom: 10px;
}

.no-results p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
}

/* ===== NEUTRAL MODE FIXES FOR FLAG ACADEMY ===== */
body.lite-mode .flag-academy-home,
body.lite-mode .flag-browser,
body.lite-mode .flag-browser-page,
body.lite-mode .flag-quiz-page,
body.lite-mode .flag-detail-page,
body.lite-mode .flag-detail,
body.lite-mode .flag-patterns-page,
body.lite-mode .flag-similar-page,
body.lite-mode .flag-stories-page,
body.lite-mode .state-flags-page,
body.lite-mode .patterns-similar-page,
body.lite-mode .quiz-container,
body.lite-mode .quiz-results,
body.lite-mode .similar-flags-page,
body.lite-mode .similar-group-detail,
body.lite-mode .pattern-detail,
body.lite-mode .patterns-page,
body.lite-mode .state-detail,
body.lite-mode .state-quiz-results {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%) !important;
}

body.lite-mode .flag-menu-card {
    background: white;
    border-color: #e2e8f0;
}

body.lite-mode .flag-menu-card h3,
body.lite-mode .flag-menu-card p {
    color: #334155;
}

body.lite-mode .region-filters {
    background: white;
}

body.lite-mode .region-btn {
    background: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

body.lite-mode .region-btn.active,
body.lite-mode .region-btn:hover {
    background: #334155;
    color: white;
}

body.lite-mode .flag-grid-item {
    background: white;
    border-color: #e2e8f0;
}

body.lite-mode .flag-grid-item:hover {
    border-color: #94a3b8;
}

body.lite-mode .flag-name {
    color: #334155;
}

body.lite-mode .state-flag-card {
    background: white;
    border-color: #e2e8f0;
}

body.lite-mode .state-flag-card:hover {
    border-color: #94a3b8;
}

body.lite-mode .state-name {
    color: #334155;
}

body.lite-mode .quiz-container {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

body.lite-mode .quiz-header h2,
body.lite-mode .quiz-progress span {
    color: #334155;
}

body.lite-mode .quiz-progress span {
    background: rgba(51, 65, 85, 0.1);
}

body.lite-mode .state-quiz-header h2,
body.lite-mode .state-quiz-progress span {
    color: #334155;
}

body.lite-mode .state-quiz-progress span {
    background: rgba(51, 65, 85, 0.1);
}

body.lite-mode .no-results h3 {
    color: #334155;
}

body.lite-mode .no-results p {
    color: #64748b;
}

body.lite-mode .no-results {
    background: rgba(51, 65, 85, 0.05);
}

/* Tab buttons in lite mode */
body.lite-mode .tab-btn {
    background: rgba(51, 65, 85, 0.1);
    color: #334155;
    border: 2px solid #e2e8f0;
}

body.lite-mode .tab-btn:hover {
    background: rgba(51, 65, 85, 0.2);
}

body.lite-mode .tab-btn.active {
    background: #334155;
    color: white;
    border-color: #334155;
}

/* ===== MOBILE RESPONSIVE FOR NEW ELEMENTS ===== */
@media (max-width: 768px) {
    .flag-search-container {
        margin-bottom: 20px;
    }

    .flag-search-box {
        padding: 6px 15px;
    }

    .flag-search-input {
        font-size: 1rem;
        padding: 8px 0;
    }

    .quiz-options,
    .state-quiz-options {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .quiz-option,
    .state-quiz-option {
        padding: 15px 20px;
        font-size: 1rem;
    }

    .state-quiz-results {
        padding: 30px 20px;
    }

    .state-quiz-results .result-btns {
        flex-direction: column;
    }
}

/* ===== VOICE BUTTON STYLES ===== */
.name-voice-row {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.name-voice-row h1 {
    margin: 0;
}

.voice-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.voice-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.voice-btn:active {
    transform: translateY(0);
}

body.lite-mode .voice-btn {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    box-shadow: 0 4px 15px rgba(51, 65, 85, 0.2);
}

body.lite-mode .voice-btn:hover {
    box-shadow: 0 6px 20px rgba(51, 65, 85, 0.3);
}

@media (max-width: 480px) {
    .name-voice-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .voice-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

/* ===== BROWSER HINT ===== */
.browser-hint {
    text-align: center;
    color: white;
    font-size: 1.1rem;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    margin-bottom: 20px;
}

/* ===== FLAG CLICK HINT ===== */
.flag-click-hint {
    font-size: 0.75rem;
    color: #9ca3af;
    text-align: center;
    padding-top: 5px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.flag-card:hover .flag-click-hint {
    opacity: 1;
}

/* ===== LETTER FILTER BUTTONS ===== */
.letter-filter-btns {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.letter-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 3px solid transparent;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 700;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.3s ease;
}

.letter-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.letter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: white;
}

/* ===== QUIZ PROMPT ===== */
.quiz-prompt {
    text-align: center;
    margin-top: 30px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
}

.quiz-prompt p {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

/* ===== PATTERN TABS ===== */
.pattern-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid transparent;
    border-radius: 30px;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tab-btn.active {
    background: white;
    color: #667eea;
}

.tab-content {
    transition: opacity 0.3s ease;
}

.tab-content.hidden {
    display: none;
}

/* ===== QUIZ HINT SECTION ===== */
.quiz-hint-section {
    margin: 15px 0;
    text-align: center;
}

.hint-btn {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 10px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.hint-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

.hint-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
}

.hint-box {
    margin-top: 12px;
    padding: 12px 20px;
    background: rgba(251, 191, 36, 0.2);
    border: 2px solid #fbbf24;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    animation: hintFadeIn 0.3s ease;
}

@keyframes hintFadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== CARD-LEARN STYLE ===== */
.card-learn {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

.card-learn:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
}

/* ===== COMBINED PATTERNS & SIMILAR PAGE ===== */
.patterns-similar-page {
    padding: 15px;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.patterns-similar-page .browser-header,
.patterns-similar-page .browser-header.patterns-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 15px;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 15px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.patterns-similar-page .browser-header h2 {
    color: #2d3748;
    font-size: 1.3rem;
    margin: 0;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .patterns-similar-page .browser-header h2 {
        font-size: 1rem;
    }
}

.patterns-similar-page .browser-header h2::before {
    display: none;
}

/* Pattern Examples with full country names - Override earlier definition */
.pattern-card .pattern-examples {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin: 15px 0;
}

.example-flag-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.5);
}

.example-flag-item:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.05);
}

.example-flag-item img {
    width: 80px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.example-flag-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
    text-align: center;
    max-width: 100%;
    word-wrap: break-word;
}

/* Similar Flags Grid */
.similar-flags-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin: 15px 0;
}

.similar-flag-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.5);
}

.similar-flag-item:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.05);
}

.similar-flag-item img {
    width: 80px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.similar-flag-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
    text-align: center;
}

/* Pattern Card Improvements */
.pattern-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.pattern-card h3 {
    font-size: 1.3rem;
    color: #2d3748;
    margin-bottom: 10px;
}

.pattern-desc {
    color: #4a5568;
    margin-bottom: 15px;
}

.pattern-card .pattern-info {
    font-size: 0.9rem;
    color: #718096;
    font-style: italic;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
    background: transparent;
    box-shadow: none;
}

/* Similar Group Card */
.similar-group-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.similar-group-card h3 {
    font-size: 1.3rem;
    color: #2d3748;
    margin-bottom: 10px;
}

/* Filter Bar with inline search */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.filter-bar .region-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    background: transparent;
    padding: 0;
    margin: 0;
}

.filter-divider {
    color: #cbd5e0;
    font-size: 1.2rem;
    margin: 0 5px;
}

.letter-range-btn {
    font-family: monospace;
    font-weight: 700;
}

.search-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    padding: 8px 12px;
    border-radius: 8px;
    min-width: 150px;
}

.search-inline span {
    color: #64748b;
}

.search-inline .flag-search-input {
    border: none;
    background: transparent;
    padding: 0;
    font-size: 0.95rem;
    width: 120px;
}

.search-inline .flag-search-input:focus {
    outline: none;
}

/* Header with hint */
.browser-header .header-hint {
    display: none;
    font-size: 0.9rem;
    color: #64748b;
    margin-left: auto;
}

@media (min-width: 768px) {
    .browser-header .header-hint {
        display: block;
    }
}

/* ===== NEUTRAL MODE FIXES - COMPREHENSIVE ===== */
body.lite-mode .flag-academy-home,
body.lite-mode .flag-browser,
body.lite-mode .flag-detail-page,
body.lite-mode .flag-detail,
body.lite-mode .quiz-container,
body.lite-mode .quiz-results,
body.lite-mode .patterns-similar-page,
body.lite-mode .state-flags-page,
body.lite-mode .state-detail,
body.lite-mode .state-quiz-results,
body.lite-mode .patterns-page,
body.lite-mode .similar-flags-page,
body.lite-mode .pattern-detail,
body.lite-mode .similar-group-detail {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%) !important;
}

body.lite-mode .patterns-similar-page .browser-header,
body.lite-mode .browser-header {
    background: white;
}

body.lite-mode .filter-bar {
    background: white;
}

body.lite-mode .pattern-card,
body.lite-mode .similar-group-card {
    background: white;
    border: 1px solid #e2e8f0;
}

/* ===== MOBILE RESPONSIVE NEW ELEMENTS ===== */
@media (max-width: 768px) {
    .browser-hint {
        font-size: 1rem;
        padding: 10px 15px;
    }
    
    .letter-filter-btns {
        gap: 8px;
    }
    
    .letter-btn {
        padding: 10px 18px;
        font-size: 0.9rem;
    }
    
    .pattern-tabs {
        flex-direction: column;
        gap: 8px;
    }
    
    .tab-btn {
        width: 100%;
    }
    
    .hint-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .filter-bar {
        flex-direction: column;
        gap: 10px;
    }
    
    .filter-bar .region-filters {
        justify-content: center;
    }
    
    .search-inline {
        width: 100%;
    }
    
    .search-inline .flag-search-input {
        width: 100%;
    }
    
    .example-flag-item img,
    .similar-flag-item img {
        width: 60px;
    }
}

@media (max-width: 480px) {
    .flag-click-hint {
        opacity: 1;
    }
    
    .filter-divider {
        display: none;
    }
}

/* ===== FILTER LABEL FOR STATE FLAGS ===== */
.filter-label {
    font-weight: 600;
    color: #374151;
    font-size: 0.95rem;
}

/* ===== ENSURE FLAG IMAGES DISPLAY ===== */
.example-flag-item,
.similar-flag-item {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px;
    border-radius: 10px;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.7);
}

.example-flag-item:hover,
.similar-flag-item:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: scale(1.05);
}

.example-flag-item img,
.similar-flag-item img {
    width: 100px;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    display: block !important;
}

.example-flag-name,
.similar-flag-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    text-align: center;
    max-width: 100px;
    word-wrap: break-word;
}

/* ===== PATTERN EXAMPLES AND SIMILAR FLAGS GRIDS ===== */
.pattern-examples {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
    margin: 15px 0;
}

.similar-flags-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
    margin: 15px 0;
}

/* ===== MOBILE RESPONSIVE ENHANCEMENTS ===== */
@media (max-width: 640px) {
    /* Quiz Container Mobile */
    .quiz-container {
        padding: 15px;
    }
    
    .quiz-header {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .quiz-question h2 {
        font-size: 1.1rem;
    }
    
    .quiz-flag {
        padding: 15px;
        min-height: 160px;
    }
    
    .quiz-flag img {
        width: 280px;
        min-height: 140px;
    }
    
    .quiz-options {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .quiz-option {
        padding: 14px 18px;
        font-size: 1rem;
    }
    
    /* Patterns Mobile */
    .pattern-tabs {
        flex-direction: column;
        gap: 8px;
    }
    
    .tab-btn {
        width: 100%;
        padding: 12px 20px;
    }
    
    .pattern-card,
    .similar-group-card {
        padding: 15px;
    }
    
    .pattern-card h3,
    .similar-group-card h3 {
        font-size: 1.1rem;
    }
    
    .pattern-examples,
    .similar-flags-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .example-flag-item img,
    .similar-flag-item img {
        width: 70px;
    }
    
    .example-flag-name,
    .similar-flag-name {
        font-size: 0.7rem;
        max-width: 70px;
    }
    
    /* Flag Browser Mobile */
    .flag-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .flag-card {
        padding: 12px;
    }
    
    .state-flags-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    /* Browser Header Mobile */
    .browser-header {
        flex-wrap: wrap;
        padding: 12px;
        gap: 10px;
    }
    
    .browser-header h2 {
        font-size: 1.2rem;
        flex: 1;
    }
    
    .header-hint {
        display: none;
    }
    
    /* Filter Bar Mobile */
    .filter-bar {
        flex-direction: column;
        gap: 10px;
    }
    
    .region-filters {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .region-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}