@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&family=Nunito:wght@400;600;700;800&display=swap');
/**
 * FieldForm - Jogo de Memória Bíblico
 * Desenvolvido por B20 Conteúdo Digital
 * https://www.b20.com.br
 * Todos os direitos reservados
 */

/* === CSS VARIABLES === */
:root {
    /* Gamified Palette */
    --primary-color: #FF9F1C;
    --primary-shadow: #CC7300;
    --secondary-color: #FFBF69;
    --accent-color: #2EC4B6;
    --accent-shadow: #1CA195;
    --surface-color: #FDFFFC;
    --text-color: #011627;
    
    --primary-hover: #F28C00;
    --primary-light: #FFD166;
    --bg-color: #E2F1F8;
    --text-muted: rgba(1, 22, 39, 0.5);
    --text-secondary: #5C6B73;
    
    --border-radius: 20px;
    --spacing-unit: 8px;
    --transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    --header-height: 70px;
    --bottom-nav-height: 75px;
    
    --shadow-sm: 0 4px 0 rgba(0,0,0,0.1);
    --shadow-md: 0 8px 0 rgba(0,0,0,0.15);
    --shadow-lg: 0 12px 24px rgba(0,0,0,0.2);
    
    --card-size: 85px;
    --card-gap: 12px;
}

/* Dark Mode */
[data-theme="dark"] {
    --bg-color: #011627;
    --surface-color: #0A2239;
    --text-color: #FDFFFC;
    --text-secondary: #A0B2C0;
    --text-muted: rgba(253, 255, 252, 0.5);
}

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: clamp(14px, 2.5vw, 18px);
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden;
}

body {
    font-family: 'Nunito', -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-color);
    padding-top: var(--header-height);
    padding-bottom: var(--bottom-nav-height);
    min-height: 100vh;
    overflow-x: hidden;
    touch-action: pan-y;
}

@media (min-width: 992px) {
    body {
        padding-bottom: 0;
    }
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: calc(var(--spacing-unit) * 2);
    letter-spacing: 0.5px;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: calc(var(--spacing-unit) * 2);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    text-decoration: underline;
}

/* === LAYOUT === */
.container {
    padding: 16px;
    max-width: 100%;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .container {
        padding: 24px;
        max-width: 720px;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1440px) {
    .container {
        max-width: 1200px;
    }
}

/* === HEADER === */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.header-logo h1 {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    color: var(--primary-color);
    text-shadow: 0 2px 0 rgba(0,0,0,0.1);
}

.header-logo i {
    margin-right: 8px;
}

/* Desktop Navigation */
.desktop-nav {
    display: none;
}

@media (min-width: 992px) {
    .desktop-nav {
        display: flex;
        gap: 12px;
    }
    
    .desktop-nav .nav-link {
        padding: 10px 24px;
        border-radius: 25px;
        color: var(--text-color);
        text-decoration: none;
        transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        font-family: 'Fredoka', sans-serif;
        font-weight: 600;
        font-size: 1.1rem;
        border: 2px solid transparent;
    }
    
    .desktop-nav .nav-link:hover {
        background: var(--bg-color);
        border-color: rgba(0,0,0,0.05);
        transform: translateY(-2px);
    }
    
    .desktop-nav .nav-link.active {
        background: var(--primary-color);
        color: white;
        border-color: var(--primary-shadow);
        box-shadow: 0 4px 0 var(--primary-shadow);
        transform: translateY(-2px);
    }
}

.header-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 45px;
    height: 45px;
    border: 3px solid rgba(0,0,0,0.05);
    background: var(--surface-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: var(--primary-color);
    box-shadow: 0 4px 0 rgba(0,0,0,0.05);
    font-size: 1.2rem;
}

.btn-icon:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-shadow);
    transform: translateY(-2px);
    box-shadow: 0 6px 0 var(--primary-shadow);
}

.btn-icon:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--primary-shadow);
}


/* === BOTTOM NAVIGATION === */
.bottom-nav {
    position: fixed;
    bottom: 15px;
    left: 15px;
    right: 15px;
    height: var(--bottom-nav-height);
    background: var(--surface-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-radius: 20px;
    border: 3px solid rgba(0,0,0,0.05);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1), 0 5px 0 rgba(0,0,0,0.05);
    z-index: 1000;
    padding: 0 10px;
    /* ensure it stays above the safe area on modern phones */
    margin-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 11px;
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-width: 60px;
    height: 100%;
    position: relative;
    z-index: 1;
}

.nav-item i {
    font-size: 20px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2;
}

/* Active State "Bubble" Indicator */
.nav-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 44px;
    height: 44px;
    background: var(--primary-color);
    border-radius: 14px;
    opacity: 0;
    z-index: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-item.active {
    color: var(--text-color);
}

.nav-item.active::before {
    transform: translate(-50%, -60%) scale(1);
    opacity: 1;
    box-shadow: inset 0 -3px 0 rgba(0,0,0,0.2);
}

.nav-item.active i {
    transform: translateY(-4px) scale(1.15);
    color: white;
}

.nav-item.active span {
    color: var(--text-color);
    font-weight: 700;
}

@media (min-width: 992px) {
    .bottom-nav {
        display: none !important;
    }
}

/* === VIEWS === */
.view {
    display: none;
    min-height: calc(100vh - var(--header-height) - var(--bottom-nav-height));
}

.view.active {
    display: block;
}

@media (min-width: 768px) {
    .view {
        min-height: calc(100vh - var(--header-height));
    }
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border: none;
    border-radius: var(--border-radius);
    font-family: 'Fredoka', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    min-height: 54px;
    min-width: 120px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 6px 0 var(--primary-shadow);
}

.btn-primary:active {
    transform: translateY(6px);
    box-shadow: 0 0 0 var(--primary-shadow);
}
.btn-primary:hover {
    transform: translateY(2px);
    box-shadow: 0 4px 0 var(--primary-shadow);
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 6px 0 var(--accent-shadow);
}

.btn-secondary:active {
    transform: translateY(6px);
    box-shadow: 0 0 0 var(--accent-shadow);
}
.btn-secondary:hover {
    transform: translateY(2px);
    box-shadow: 0 4px 0 var(--accent-shadow);
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.3rem;
    min-width: 200px;
    border-radius: 30px;
}

.btn-back {
    background: none;
    border: none;
    color: var(--text-color);
    font-family: 'Fredoka', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.btn-back:hover {
    background: var(--surface-color);
    transform: translateX(-4px);
}


/* === HOME SECTION === */
.hero-banner {
    text-align: center;
    border-radius: 30px;
    margin-bottom: calc(var(--spacing-unit) * 4);
}

.pattern-bg {
    background-color: var(--primary-color);
    background-image: url("data:image/svg+xml,%3Csvg width='120' height='120' viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.15' fill-rule='evenodd'%3E%3C!-- Cruz --%3E%3Cpath d='M25,45 L35,45 L35,30 L50,30 L50,20 L35,20 L35,5 L25,5 L25,20 L10,20 L10,30 L25,30 Z' transform='scale(0.5) translate(40,40)'/%3E%3C!-- Coracao --%3E%3Cpath d='M12,21.35L10.55,20.03C5.4,15.36 2,12.27 2,8.5C2,5.41 4.42,3 7.5,3C9.24,3 10.91,3.81 12,5.08C13.09,3.81 14.76,3 16.5,3C19.58,3 22,5.41 22,8.5C22,12.27 18.6,15.36 13.45,20.03L12,21.35Z' transform='scale(1.2) translate(60,20)'/%3E%3C!-- Estrela --%3E%3Cpath d='M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z' transform='scale(1.2) translate(10,80)'/%3E%3C/g%3E%3C/svg%3E");
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 -8px 0 rgba(0,0,0,0.1), 0 8px 24px rgba(0,0,0,0.15);
    padding: calc(var(--spacing-unit) * 4);
    border: 4px solid var(--surface-color);
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: calc(var(--spacing-unit) * 6) calc(var(--spacing-unit) * 2);
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 3px solid rgba(255, 255, 255, 0.4);
    display: inline-block;
    max-width: 800px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.hero-title {
    font-size: 4rem;
    margin-bottom: calc(var(--spacing-unit) * 2);
    color: white;
    text-shadow: 0 4px 0 var(--primary-shadow), 0 8px 15px rgba(0,0,0,0.3);
    line-height: 1.1;
    font-family: 'Fredoka', sans-serif;
    letter-spacing: 2px;
}

.hero-subtitle {
    font-size: 1.4rem;
    color: white;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    margin-bottom: calc(var(--spacing-unit) * 4);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}


.benefits-section {
    margin: calc(var(--spacing-unit) * 6) 0;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: calc(var(--spacing-unit) * 3);
    margin-top: calc(var(--spacing-unit) * 4);
}

.benefit-card {
    background: var(--surface-color);
    padding: calc(var(--spacing-unit) * 4);
    border-radius: var(--border-radius);
    text-align: center;
    transition: var(--transition);
    border: 3px solid var(--accent-color);
    box-shadow: 0 6px 0 rgba(0,0,0,0.05);
}

@media (hover: hover) { .benefit-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
} }

.benefit-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.benefit-card h4 {
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.seo-content {
    background: var(--surface-color);
    padding: calc(var(--spacing-unit) * 4);
    border-radius: var(--border-radius);
    margin-top: calc(var(--spacing-unit) * 6);
}

/* === GAME SECTION === */
.game-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.game-hud {
    display: flex;
    justify-content: space-around;
    background: var(--surface-color);
    padding: 16px;
    border-radius: var(--border-radius);
    margin-bottom: calc(var(--spacing-unit) * 3);
    flex-wrap: wrap;
    gap: 16px;
}

.hud-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.hud-item i {
    color: var(--primary-color);
}

.game-board { perspective: 1000px;
    display: grid;
    gap: var(--card-gap);
    justify-content: center;
    margin: calc(var(--spacing-unit) * 4) 0;
    padding: 16px;
    background: var(--surface-color);
    border-radius: var(--border-radius);
}

.game-board.easy {
    grid-template-columns: repeat(4, var(--card-size));
    grid-template-rows: repeat(4, var(--card-size));
}

.game-board.medium {
    grid-template-columns: repeat(6, var(--card-size));
    grid-template-rows: repeat(6, var(--card-size));
    --card-size: 70px;
}

.game-board.hard {
    grid-template-columns: repeat(8, var(--card-size));
    grid-template-rows: repeat(8, var(--card-size));
    --card-size: 60px;
}


* {
    -webkit-tap-highlight-color: transparent;
}

@media (max-width: 480px) {
    .game-board.easy {
        --card-size: 65px;
        --card-gap: 8px;
    }
    .game-board.medium {
        --card-size: 42px;
        --card-gap: 6px;
    }
    .game-board.hard {
        /* Hard mode 8x8 is extremely difficult to fit. We switch to smaller sizes */
        --card-size: 32px;
        --card-gap: 4px;
    }
    
    .game-board {
        padding: 8px;
        gap: var(--card-gap);
        margin: calc(var(--spacing-unit) * 2) 0;
    }
    
    .card {
        border-radius: 12px;
        box-shadow: 0 4px 0 var(--primary-shadow);
        border-width: 2px;
    }
    
    @media (hover: hover) { .card:hover {
        transform: translateY(-2px) scale(1.02);
        box-shadow: 0 6px 0 var(--primary-shadow);
    } }
    
    .card.matched {
        box-shadow: 0 2px 0 var(--accent-shadow);
    }
    
    .card-front, .card-back { pointer-events: none;
        border-radius: 12px;
        font-size: 1.5rem;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .quest-title {
        font-size: 1.8rem;
    }
    
    .modal-content {
        padding: calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 2);
    }
    
    .victory-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .game-hud {
        padding: 10px;
        font-size: 0.9rem;
    }
}


.card {
    width: var(--card-size);
    height: var(--card-size);
    background: var(--primary-color);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    position: relative;
    box-shadow: 0 6px 0 var(--primary-shadow);
}

@media (hover: hover) { .card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 0 var(--primary-shadow);
} }

.card.flipped {
    transform: rotateY(180deg) !important;
}

.card.matched {
    background: var(--accent-color);
    cursor: default;
    box-shadow: 0 4px 0 var(--accent-shadow);
    transform: rotateY(180deg) !important;
}

@media (hover: hover) { .card.matched:hover {
    transform: rotateY(180deg) scale(0.98);
} }

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Base font sizes for desktop */
.game-board.easy .card-front, .game-board.easy .card-back { font-size: 3rem; }
.game-board.medium .card-front, .game-board.medium .card-back { font-size: 2.2rem; }
.game-board.hard .card-front, .game-board.hard .card-back { font-size: 1.5rem; }

.card-front {
    background: linear-gradient(135deg, #2A313C, #1A1F26);
    color: #FFD166; /* Golden question mark */
    border: 3px solid rgba(255,255,255,0.05);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.3);
}

.card-back {
    background: white;
    transform: rotateY(180deg);
    border: 3px solid var(--primary-color);
    box-shadow: inset 0 0 15px rgba(0,0,0,0.05);
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: calc(var(--spacing-unit) * 4);
    flex-wrap: wrap;
}

/* === LEVELS SECTION === */
.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: calc(var(--spacing-unit) * 3);
    margin: calc(var(--spacing-unit) * 4) 0;
}

.level-card {
    background: var(--surface-color);
    padding: calc(var(--spacing-unit) * 4);
    border-radius: 30px;
    text-align: center;
    transition: var(--transition);
    border: 4px solid var(--bg-color);
    box-shadow: 0 8px 0 rgba(0,0,0,0.05);
}

@media (hover: hover) { .level-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
} }

.level-icon {
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.level-icon i {
    font-size: 4rem;
    color: var(--primary-color);
}

.level-description {
    color: var(--text-secondary);
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.level-stats {
    display: flex;
    justify-content: space-around;
    margin: calc(var(--spacing-unit) * 3) 0;
    padding: calc(var(--spacing-unit) * 2);
    background: var(--accent-color);
    border-radius: calc(var(--border-radius) / 2);
}

.level-stats span {
    font-weight: 600;
    color: var(--text-color);
}

.best-scores {
    background: var(--surface-color);
    padding: calc(var(--spacing-unit) * 4);
    border-radius: var(--border-radius);
    margin-top: calc(var(--spacing-unit) * 6);
}

.scores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: calc(var(--spacing-unit) * 2);
    margin-top: calc(var(--spacing-unit) * 3);
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: calc(var(--spacing-unit) * 2);
    background: var(--accent-color);
    border-radius: calc(var(--border-radius) / 2);
}

.score-level {
    font-weight: 600;
}

.score-time {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: var(--primary-color);
}

/* === ABOUT SECTION === */
.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-text ul {
    margin: calc(var(--spacing-unit) * 3) 0;
    padding-left: calc(var(--spacing-unit) * 3);
}

.about-text li {
    margin-bottom: calc(var(--spacing-unit) * 1);
}

/* === FAQ SECTION === */
.faq-section {
    margin-top: calc(var(--spacing-unit) * 6);
    background: var(--surface-color);
    padding: calc(var(--spacing-unit) * 4);
    border-radius: var(--border-radius);
}

.faq-container {
    margin-top: calc(var(--spacing-unit) * 3);
}

.faq-item {
    border-bottom: 1px solid var(--accent-color);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: calc(var(--spacing-unit) * 3);
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.faq-question:hover {
    background: var(--accent-color);
}

.faq-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 3);
    color: var(--text-secondary);
    animation: fadeIn 0.3s ease;
}

.faq-answer[hidden] {
    display: none;
}

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

/* === CONTACT SECTION === */
.contact-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: calc(var(--spacing-unit) * 6);
    margin-top: calc(var(--spacing-unit) * 4);
}

@media (min-width: 768px) {
    .contact-content {
        grid-template-columns: 1fr 1fr;
    }
}

.contact-info {
    background: var(--surface-color);
    padding: calc(var(--spacing-unit) * 4);
    border-radius: var(--border-radius);
}

.contact-methods {
    margin-top: calc(var(--spacing-unit) * 4);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 2);
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.contact-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
    width: 24px;
}

.contact-form {
    background: var(--surface-color);
    padding: calc(var(--spacing-unit) * 4);
    border-radius: var(--border-radius);
}

.form-group {
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.form-group label {
    display: block;
    margin-bottom: calc(var(--spacing-unit) * 1);
    font-weight: 600;
    color: var(--text-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--accent-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-color);
    color: var(--text-color);
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(135, 206, 235, 0.1);
}

.form-group input:invalid,
.form-group textarea:invalid {
    border-color: #e74c3c;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* === MODAL === */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal.show {
    display: flex;
}


/* Gamified Modal */
.modal-content {
    background: var(--surface-color);
    padding: calc(var(--spacing-unit) * 5) calc(var(--spacing-unit) * 3);
    border-radius: 30px;
    text-align: center;
    max-width: 450px;
    width: 90%;
    animation: modalBounceIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 4px solid var(--accent-color);
    box-shadow: 0 10px 0 var(--accent-shadow), 0 20px 40px rgba(0,0,0,0.5);
    position: relative;
}

.modal-content h3 {
    font-family: 'Fredoka', sans-serif;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: calc(var(--spacing-unit) * 2);
    text-shadow: 0 3px 0 var(--primary-shadow);
}



.victory-stats p {
    margin: 0;
    font-size: 1.2rem;
    display: flex;
    flex-direction: column;
}

.victory-stats strong {
    font-family: 'Fredoka', sans-serif;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
}

.victory-stats span {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-color);
}

.victory-verse {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    padding: calc(var(--spacing-unit) * 3);
    border-radius: 20px;
    margin: calc(var(--spacing-unit) * 3) 0;
    font-style: italic;
    font-size: 1.1rem;
    line-height: 1.4;
    box-shadow: 0 6px 0 var(--primary-shadow);
    position: relative;
    border: 2px solid rgba(255,255,255,0.2);
}

.victory-verse strong {
    display: block;
    font-family: 'Fredoka', sans-serif;
    font-size: 1.3rem;
    margin-bottom: 8px;
    font-style: normal;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.victory-stats {
    background: var(--surface-color);
    padding: calc(var(--spacing-unit) * 3);
    border-radius: var(--border-radius);
    margin: calc(var(--spacing-unit) * 3) 0;
}

.modal-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}


/* === GAMIFIED TOAST === */
.toast {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 20px);
    left: 50%;
    transform: translateX(-50%) translateY(150px) scale(0.5);
    background: var(--surface-color);
    padding: 12px 20px 12px 12px;
    border-radius: 16px;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2000;
    width: 90%;
    max-width: 500px;
    border: 3px solid var(--text-color);
    box-shadow: 0 8px 0 rgba(0,0,0,0.15), 0 15px 20px rgba(0,0,0,0.2);
    cursor: pointer;
}

@media (min-width: 768px) {
    .toast {
        bottom: 30px;
    }
}

.toast.show {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 1;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.toast-icon {
    width: 45px;
    height: 45px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    background: var(--text-color);
    box-shadow: inset 0 -3px 0 rgba(0,0,0,0.2);
}

.toast-text {
    font-family: 'Fredoka', sans-serif;
    font-size: 1rem;
    line-height: 1.3;
    font-weight: 500;
    color: var(--text-color);
    padding-right: 5px;
}

/* Toast Variants */
.toast-success {
    border-color: var(--accent-color);
}
.toast-success .toast-icon {
    background: var(--accent-color);
}
.toast-success .toast-text {
    color: var(--accent-color);
}

.toast-info {
    border-color: #3A7BD5;
}
.toast-info .toast-icon {
    background: #3A7BD5;
}
.toast-info .toast-text {
    color: #3A7BD5;
}

.toast:hover {
    transform: translateX(-50%) translateY(-5px) scale(1.02);
}


/* === FOOTER === */
.app-footer {
    background: var(--surface-color);
    padding: calc(var(--spacing-unit) * 4) 0;
    text-align: center;
    margin-top: calc(var(--spacing-unit) * 8);
    border-top: 1px solid var(--accent-color);
}

.app-footer p {
    margin-bottom: calc(var(--spacing-unit) * 1);
    color: var(--text-secondary);
}

.b20-link {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.b20-link:hover {
    text-decoration: underline;
    transform: scale(1.05);
}

/* === ANIMATIONS === */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-bounce {
    animation: bounce 1s;
}

/* === UTILITY CLASSES === */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

/* === RESPONSIVE ADJUSTMENTS === */
@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .benefits-grid {
        grid-template-columns: 1fr;
    }
    
    .game-hud { flex-direction: row; gap: 4px; flex-wrap: nowrap; 
        justify-content: space-between;
        padding: 8px;
        font-size: 0.85rem;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions .btn {
        width: 100%;
    }
}

/* === LOADING STATES === */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--border-radius);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
button:focus,
a:focus,
input:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0066cc;
        --text-color: #000000;
        --bg-color: #ffffff;
    }
}


.quest-section {
    text-align: center;
    position: relative;
    padding: calc(var(--spacing-unit) * 4) 0;
}

.section-badge {
    display: inline-block;
    background: var(--accent-color);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 800;
    font-family: 'Fredoka', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.9rem;
    margin-bottom: calc(var(--spacing-unit) * 2);
    box-shadow: 0 4px 0 var(--accent-shadow);
    transform: rotate(-2deg);
}

.quest-title {
    font-size: 2.5rem;
    color: var(--text-color);
    margin-bottom: calc(var(--spacing-unit) * 6);
}

.loot-card {
    position: relative;
    padding-top: calc(var(--spacing-unit) * 6) !important;
    border-width: 4px !important;
    border-radius: 24px !important;
}

.loot-icon {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid var(--surface-color);
    box-shadow: 0 6px 0 rgba(0,0,0,0.1);
    color: white;
    font-size: 2rem;
    z-index: 2;
}

.loot-card i {
    font-size: inherit !important;
    color: white !important;
    margin-bottom: 0 !important;
}

.loot-card h4 {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.4rem;
    color: var(--text-color);
}


@media (max-width: 480px) {
    .game-board {
        width: 100%;
        max-width: 100%;
        padding: 8px;
        box-sizing: border-box;
        margin: 10px auto;
    }
    
    .game-board.easy {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(4, 1fr);
        gap: 6px;
    }
    .game-board.medium {
        grid-template-columns: repeat(6, 1fr);
        grid-template-rows: repeat(6, 1fr);
        gap: 4px;
    }
    .game-board.hard {
        grid-template-columns: repeat(8, 1fr);
        grid-template-rows: repeat(8, 1fr);
        gap: 3px;
    }
    
    .game-board .card {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1; /* Makes cards perfectly square */
        border-radius: 8px;
        border-width: 2px;
        box-shadow: 0 4px 0 var(--primary-shadow);
    }
    
    .game-board .card-front, 
    .game-board .card-back {
        border-radius: 8px;
    }
    
    /* Proportional font sizes for mobile based on grid size */
    .game-board.easy .card-front, .game-board.easy .card-back { font-size: 8vmin; }
    .game-board.medium .card-front, .game-board.medium .card-back { font-size: 5.5vmin; }
    .game-board.hard .card-front, .game-board.hard .card-back { font-size: 4vmin; }
    
    @media (hover: hover) {
        .game-board .card:hover {
            transform: translateY(-2px) scale(1.02);
            box-shadow: 0 5px 0 var(--primary-shadow);
        }
    }
    
    .game-board .card.matched {
        box-shadow: 0 2px 0 var(--accent-shadow) !important;
        transform: rotateY(180deg) translateY(2px) !important;
    }
}


/* === GAMIFIED LEVELS === */
.gamified-levels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.level-card {
    background: var(--surface-color);
    border-radius: 24px;
    padding: 40px 20px 30px 20px;
    text-align: center;
    position: relative;
    border: 4px solid var(--surface-color);
    box-shadow: 0 10px 0 rgba(0,0,0,0.05);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

@media (hover: hover) { .level-card:hover {
    transform: translateY(-8px);
} }

.level-badge {
    position: absolute;
    top: -18px;
    background: var(--text-color);
    color: white;
    padding: 5px 15px;
    border-radius: 15px;
    font-family: 'Fredoka', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 0 rgba(0,0,0,0.2);
    z-index: 2;
}

.level-icon-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    margin-bottom: 20px;
    box-shadow: inset 0 -4px 0 rgba(0,0,0,0.1), 0 8px 15px rgba(0,0,0,0.1);
    position: relative;
}

.level-icon {
    font-size: 2.5rem;
}

/* Card Variants */
.mode-easy { border-color: #48E5C2; }
.mode-easy .level-icon { color: #48E5C2; }
.mode-easy .level-badge { background: #48E5C2; }
.mode-easy .btn { background: #48E5C2; box-shadow: 0 4px 0 #1CA195; }

.mode-medium { border-color: #FF9F1C; }
.mode-medium .level-icon { color: #FF9F1C; }
.mode-medium .level-badge { background: #FF9F1C; }
.mode-medium .btn { background: #FF9F1C; box-shadow: 0 4px 0 #CC7300; }

.mode-hard { border-color: #F38181; }
.mode-hard .level-icon { color: #F38181; }
.mode-hard .level-badge { background: #F38181; }
.mode-hard .btn { background: #F38181; box-shadow: 0 4px 0 #C44D4D; }

.level-card h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.level-description {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 20px;
    min-height: 48px;
}

.level-stats {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    width: 100%;
    justify-content: center;
}

.stat-pill {
    background: var(--bg-color);
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    border: 2px solid rgba(0,0,0,0.05);
}

.level-btn {
    width: 100%;
    margin-top: auto;
    border-radius: 15px;
    padding: 12px;
    font-size: 1.1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

/* === GAMIFIED LEADERBOARD === */
.gamified-leaderboard {
    background: var(--surface-color);
    border-radius: 24px;
    padding: 30px;
    border: 4px solid rgba(0,0,0,0.05);
}

.gamified-leaderboard h3 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 30px;
}

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

.score-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg-color);
    border-radius: 16px;
    border: 2px solid rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.score-item:hover {
    transform: scale(1.05);
}

.score-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    box-shadow: inset 0 -3px 0 rgba(0,0,0,0.2);
}

.score-easy .score-icon { background: #48E5C2; }
.score-medium .score-icon { background: #FF9F1C; }
.score-hard .score-icon { background: #F38181; }

.score-info {
    display: flex;
    flex-direction: column;
}

.score-level {
    font-weight: 800;
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.score-time {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.5rem;
    color: var(--text-color);
}


/* === GAMIFIED ABOUT PAGE === */
.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 50px;
}

@media (min-width: 992px) {
    .about-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.gamified-panel {
    background: var(--surface-color);
    border-radius: 24px;
    padding: 30px;
    border: 4px solid rgba(0,0,0,0.05);
    box-shadow: 0 10px 0 rgba(0,0,0,0.05);
    position: relative;
}

.mission-panel {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-color: var(--accent-color);
}

.mission-panel .panel-icon {
    width: 70px;
    height: 70px;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 20px;
    box-shadow: inset 0 -4px 0 rgba(0,0,0,0.2), 0 8px 15px rgba(0,0,0,0.1);
}

.mission-panel p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.features-panel h3 {
    margin-bottom: 25px;
    font-size: 1.6rem;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--bg-color);
    padding: 15px;
    border-radius: 16px;
    border: 2px solid rgba(0,0,0,0.03);
    transition: transform 0.2s;
}

.feature-item:hover {
    transform: translateX(10px);
}

.f-icon {
    width: 45px;
    height: 45px;
    background: var(--primary-color);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: inset 0 -3px 0 rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.f-text {
    display: flex;
    flex-direction: column;
}

.f-text strong {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.1rem;
    color: var(--text-color);
}

.f-text span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Gamified FAQ */
.gamified-faq .faq-item {
    background: var(--surface-color);
    border-radius: 16px;
    margin-bottom: 15px;
    border: 3px solid rgba(0,0,0,0.05);
    overflow: hidden;
    transition: all 0.3s;
}

.gamified-faq .faq-question {
    width: 100%;
    padding: 20px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    gap: 15px;
    font-family: 'Fredoka', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    text-align: left;
}

.gamified-faq .faq-question i:first-child {
    color: var(--primary-color);
    font-size: 1.4rem;
}

.gamified-faq .faq-icon {
    margin-left: auto;
    transition: transform 0.3s;
    color: var(--text-secondary);
}

.gamified-faq .faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(180deg);
    color: var(--primary-color);
}

.gamified-faq .faq-answer {
    padding: 0 20px 20px 20px;
    color: var(--text-secondary);
    line-height: 1.6;
}


/* === GAMIFIED FOOTER === */
.app-footer {
    background: var(--surface-color);
    padding: 60px 0 30px 0;
    margin-top: 80px;
    border-top: 5px solid var(--bg-color);
    box-shadow: 0 -10px 30px rgba(0,0,0,0.02);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-bottom: 40px;
    text-align: center;
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr;
        text-align: left;
    }
}

.footer-brand h3 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 300px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .footer-brand p {
        margin: 0;
    }
}

.footer-links h4, .footer-social h4 {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 20px;
}

.footer-links a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 10px;
    font-weight: 600;
    transition: all 0.2s;
}

.footer-links a:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

.footer-social p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.share-game-btn {
    width: 100%;
    border-radius: 15px;
    font-size: 1rem;
    padding: 12px;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 2px solid rgba(0,0,0,0.05);
}

.footer-bottom p {
    margin-bottom: 5px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* === SHARE MODAL === */
.gamified-modal {
    border-radius: 24px;
    border: 4px solid rgba(0,0,0,0.05);
}

.share-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    border-radius: 16px;
    border: none;
    color: white;
    font-family: 'Fredoka', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.share-btn:hover {
    transform: translateY(-3px);
}

.share-btn.whatsapp { background: #25D366; box-shadow: 0 5px 0 #1DA851; }
.share-btn.facebook { background: #1877F2; box-shadow: 0 5px 0 #1059B8; }
.share-btn.x-twitter { background: #000000; box-shadow: 0 5px 0 #333333; }

.copy-link-box {
    display: flex;
    gap: 10px;
    background: var(--bg-color);
    padding: 10px;
    border-radius: 16px;
    border: 2px solid rgba(0,0,0,0.05);
}

.copy-link-box input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-secondary);
    font-family: monospace;
    font-size: 0.9rem;
    padding: 0 10px;
}

.copy-link-box .btn {
    padding: 10px 20px;
    border-radius: 12px;
}


/* === SHARE MODAL FIXES === */
.modal-header {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 25px;
}

.modal-header h2 {
    margin: 0;
    color: var(--primary-color);
    font-size: 2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h2 i {
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    width: auto !important;
    height: auto !important;
    color: var(--text-color);
}

.close-modal {
    position: absolute;
    top: -30px;
    right: -10px;
    background: var(--surface-color);
    border: 3px solid rgba(0,0,0,0.05);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
    box-shadow: 0 4px 0 rgba(0,0,0,0.05);
    z-index: 10;
}

.close-modal i {
    background: transparent !important;
    box-shadow: none !important;
    width: auto !important;
    height: auto !important;
}

.close-modal:hover {
    background: #FF4B2B;
    color: white;
    border-color: #A81C37;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #A81C37;
}

.share-btn i {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    width: auto !important;
    height: auto !important;
    position: static !important;
    display: inline-block !important;
    font-size: 1.4rem;
    color: white;
    margin: 0;
}
