/**
 * Código Bíblico - Stylesheet
 * Desenvolvido por B20 Conteúdo Digital
 * https://www.b20.com.br
 */

/* CSS Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS Variables */
:root {
    /* Color Palette - Cartoon Theme */
    --primary-color: #FF7A00;
    --secondary-color: #00C2FF;
    --accent-color: #FFD600;
    --surface-color: #FFFFFF;
    --text-color: #2D3748;
    --primary-hover: #E66A00;
    --primary-light: #FFE4CC;
    --bg-color: #F0F8FF;
    --text-muted: #718096;

    /* Utility Colors */
    --gold-color: #FFD600;
    --parchment-color: #FFFDF0;
    --deep-blue: #0055FF;
    --warm-white: #FFFFFF;
    --victory-green: #00D084;
    --error-red: #FF3B30;

    /* Spacing & Layout */
    /* Spacing & Layout */
    --border-radius: 20px;
    --spacing-unit: 8px;
    --transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --header-height: 70px;
    --bottom-nav-height: 70px;

    /* Typography */
    --font-primary: 'Fredoka', sans-serif;
    --font-biblical: 'Fredoka', sans-serif;
    --font-gamified: 'Fredoka', sans-serif;

    /* Shadows - Video Game Style */
    --shadow-light: 0 4px 0px rgba(0, 0, 0, 0.15);
    --shadow-medium: 0 6px 0px rgba(0, 0, 0, 0.2);
    --shadow-heavy: 0 8px 0px rgba(0, 0, 0, 0.25);
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-color: #1A0B2E;
        --surface-color: #361767;
        --text-color: #FFFFFF;
        --text-muted: #A0AEC0;
        --shadow-light: 0 4px 0px #090314;
        --shadow-medium: 0 6px 0px #090314;
        --shadow-heavy: 0 8px 0px #090314;
        --primary-light: #5A2D91;
    }
}

:root[data-theme="dark"] {
    --bg-color: #1A0B2E;
    --surface-color: #361767;
    --text-color: #FFFFFF;
    --text-muted: #A0AEC0;
    --shadow-light: 0 4px 0px #090314;
    --shadow-medium: 0 6px 0px #090314;
    --shadow-heavy: 0 8px 0px #090314;
    --primary-light: #5A2D91;
}

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

body {
    font-family: var(--font-primary);
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    padding-top: var(--header-height);
    padding-bottom: env(safe-area-inset-bottom, 0);
    min-height: 100vh;
    transition: var(--transition);
}

@media (max-width: 767px) {
    body {
        padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0));
    }
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: calc(var(--spacing-unit) * 2);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

.biblical-text {
    font-family: var(--font-biblical);
}

.gamified-text {
    font-family: var(--font-gamified);
}

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

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

@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(--surface-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    box-shadow: 0 4px 0 #1A202C;
    /* Gamer pixel-style shadow */
    border-bottom: 2px solid #1A202C;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

[data-theme="dark"] .app-header {
    box-shadow: 0 4px 0 var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.header-logo .logo-text {
    font-family: var(--font-biblical);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 1px 1px 0 #1A202C;
    /* Gamer text shadow */
}

[data-theme="dark"] .header-logo .logo-text {
    text-shadow: 1px 1px 0 var(--accent-color);
}

.main-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    filter: drop-shadow(1px 1px 0 #1A202C);
    border-radius: 8px;
    /* For a squircle look */
    background-color: transparent;
}

.desktop-nav {
    display: none;
    gap: 8px;
}

@media (min-width: 992px) {
    .desktop-nav {
        display: flex;
    }
}

.desktop-nav .nav-link {
    padding: 8px 18px;
    border-radius: 12px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.1s;
    font-weight: 700;
    font-family: var(--font-gamified);
    border: 2px solid transparent;
}

.desktop-nav .nav-link:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.desktop-nav .nav-link.active {
    background: var(--primary-color);
    color: white;
    border: 2px solid #1A202C;
    box-shadow: 0 4px 0 #1A202C;
    transform: translateY(-4px);
}

[data-theme="dark"] .desktop-nav .nav-link.active {
    border-color: var(--accent-color);
    box-shadow: 0 4px 0 var(--accent-color);
    color: #1A202C;
}

.desktop-nav .nav-link:active {
    transform: translateY(0px) !important;
    box-shadow: 0 0px 0 #1A202C !important;
}

[data-theme="dark"] .desktop-nav .nav-link:active {
    box-shadow: 0 0px 0 var(--accent-color) !important;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: 3px solid #1A202C;
    border-radius: 16px;
    font-family: var(--font-gamified);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.1s;
    min-height: 48px;
    min-width: 48px;
    box-shadow: 0 6px 0px #1A202C;
}

.btn:active {
    transform: translateY(6px);
    box-shadow: 0 0px 0px #1A202C;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    filter: brightness(1.1);
}

.btn-secondary {
    background: var(--surface-color);
    color: var(--text-color);
    border: 3px solid #1A202C;
}

.btn-secondary:hover {
    background: #F7FAFC;
    color: var(--text-color);
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
}

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

.btn-icon {
    width: 42px;
    height: 42px;
    padding: 0;
    border: 2px solid #1A202C;
    border-radius: 12px;
    background: var(--surface-color);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 4px 0 #1A202C;
}

[data-theme="dark"] .btn-icon {
    border-color: var(--primary-color);
    box-shadow: 0 4px 0 var(--primary-color);
}

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

[data-theme="dark"] .btn-icon:hover {
    box-shadow: 0 6px 0 var(--primary-color);
}

.btn-icon:active {
    transform: translateY(4px) !important;
    box-shadow: 0 0px 0 #1A202C !important;
}

[data-theme="dark"] .btn-icon:active {
    box-shadow: 0 0px 0 var(--primary-color) !important;
}

.btn-icon .current-lang {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Sections */
.section {
    display: none;
    min-height: calc(100vh - var(--header-height));
    padding: calc(var(--spacing-unit) * 3) 0;
}

#home.section {
    padding-top: 0;
}

.section.active {
    display: block;
}

.section-title {
    text-align: center;
    font-family: var(--font-biblical);
    color: var(--primary-color);
    margin-bottom: calc(var(--spacing-unit) * 6);
    font-size: 2.5rem;
}

/* Hero Section */
.hero-section {
    position: relative;
    background: url('../img/cartoon_biblical_bg.png') center/cover no-repeat;
    padding: calc(var(--spacing-unit) * 10) 0;
    text-align: center;
    border-bottom: 8px solid rgba(0, 0, 0, 0.1);
}

/* Overlay removed to keep the background 100% bright and happy */



.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-content {
    max-width: 600px;
    margin: 0 auto calc(var(--spacing-unit) * 4);
    padding: 50px 30px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 40px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2), inset 0 0 20px rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

[data-theme="dark"] .hero-content {
    background: rgba(26, 11, 46, 0.6);
    border-color: var(--primary-color);
}

.hero-logo-wrapper {
    margin-bottom: 25px;
    animation: float 4s ease-in-out infinite;
}

.hero-main-logo {
    width: 150px;
    height: 150px;
    object-fit: contain;
    border-radius: 35px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border: 4px solid var(--primary-color);
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px) rotate(3deg);
    }

    100% {
        transform: translateY(0px);
    }
}

.hero-title {
    font-family: var(--font-biblical);
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    color: #FFD600;
    margin-bottom: calc(var(--spacing-unit) * 2);
    line-height: 1.1;
    text-shadow: 3px 3px 0px #1A202C;
    -webkit-text-stroke: 1.5px #1A202C;
}

.hero-subtitle {
    font-size: 1.4rem;
    font-weight: 800;
    color: #FFFFFF;
    margin-bottom: calc(var(--spacing-unit) * 4);
    text-shadow: 2px 2px 0px #1A202C;
    -webkit-text-stroke: 1px #1A202C;
    letter-spacing: 0.5px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

#start-game-btn {
    font-size: 1.5rem;
    padding: 18px 40px;
    background: var(--victory-green);
    color: #FFF;
    border-radius: 20px;
    box-shadow: 0 8px 0px #1A202C;
    animation: pulseGlow 2s infinite, pulse-cta 2s infinite cubic-bezier(0.66, 0, 0, 1);
    -webkit-text-stroke: 1px #1A202C;
    text-shadow: 2px 2px 0 #1A202C;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 6px 0px #1A202C, 0 0 0 0 rgba(0, 208, 132, 0.4);
    }

    70% {
        box-shadow: 0 6px 0px #1A202C, 0 0 0 20px rgba(0, 208, 132, 0);
    }

    100% {
        box-shadow: 0 6px 0px #1A202C, 0 0 0 0 rgba(0, 208, 132, 0);
    }
}

#start-game-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 0px #1A202C;
    filter: brightness(1.2);
}

#start-game-btn:active {
    transform: translateY(8px);
    box-shadow: 0 0px 0px #1A202C;
    animation: none;
}

@keyframes pulse-cta {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.hero-preview {
    display: flex;
    justify-content: center;
    margin-top: calc(var(--spacing-unit) * 6);
}

.game-preview {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: calc(var(--spacing-unit) * 4);
    box-shadow: var(--shadow-medium);
    max-width: 300px;
}

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

.gallows {
    width: 120px;
    height: 140px;
    margin: 0 auto;
    position: relative;
}

.gallows .base {
    position: absolute;
    bottom: 0;
    left: 10px;
    width: 100px;
    height: 4px;
    background: #8B4513;
}

.gallows .pole {
    position: absolute;
    bottom: 0;
    left: 30px;
    width: 4px;
    height: 120px;
    background: #8B4513;
}

.gallows .beam {
    position: absolute;
    top: 0;
    left: 30px;
    width: 60px;
    height: 4px;
    background: #8B4513;
}

.gallows .noose {
    position: absolute;
    top: 4px;
    left: 86px;
    width: 4px;
    height: 20px;
    background: #8B4513;
}

.word-preview {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.word-preview .letter {
    width: 40px;
    height: 40px;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 600;
    background: var(--surface-color);
}

.word-preview .letter.revealed {
    background: var(--primary-color);
    color: white;
}

/* Categories Section */
.categories-section {
    padding: calc(var(--spacing-unit) * 8) 0;
}

.categories-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);
}

.category-card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: calc(var(--spacing-unit) * 4);
    text-align: center;
    box-shadow: 0 6px 0px #1A202C;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    border: 3px solid #1A202C;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 14px 0px #1A202C;
    border-color: var(--primary-color);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: calc(var(--spacing-unit) * 2);
}

/* Colorize pixel icons dynamically */
.category-icon i,
.feature-icon i,
.stat-icon i,
.achievement-icon i {
    text-shadow: 2px 2px 0 #1A202C, -2px -2px 0 #1A202C, 2px -2px 0 #1A202C, -2px 2px 0 #1A202C, 0 3px 0 #1A202C;
}

/* Add unique colors to cards by order */
.category-card:nth-child(6n+1) .category-icon i,
.feature-card:nth-child(4n+1) .feature-icon i,
.stat-card:nth-child(4n+1) .stat-icon i {
    color: #FF3B30;
}

/* Red */
.category-card:nth-child(6n+2) .category-icon i,
.feature-card:nth-child(4n+2) .feature-icon i,
.stat-card:nth-child(4n+2) .stat-icon i {
    color: #00C2FF;
}

/* Sky Blue */
.category-card:nth-child(6n+3) .category-icon i,
.feature-card:nth-child(4n+3) .feature-icon i,
.stat-card:nth-child(4n+3) .stat-icon i {
    color: #FFD600;
}

/* Yellow */
.category-card:nth-child(6n+4) .category-icon i,
.feature-card:nth-child(4n+4) .feature-icon i,
.stat-card:nth-child(4n+4) .stat-icon i {
    color: #00D084;
}

/* Green */
.category-card:nth-child(6n+5) .category-icon i {
    color: #FF7A00;
}

/* Orange */
.category-card:nth-child(6n+6) .category-icon i {
    color: #9146FF;
}

/* Purple */

.achievement-icon i {
    color: var(--gold-color);
}


.category-card h3 {
    color: var(--primary-color);
    margin-bottom: calc(var(--spacing-unit) * 1);
}

.category-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.category-difficulty {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: calc(var(--spacing-unit) * 2);
}

.difficulty-star {
    color: var(--gold-color);
    font-size: 1.2rem;
}

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

/* Features Section */
.features-section {
    background: var(--parchment-color);
    padding: calc(var(--spacing-unit) * 8) 0;
}

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

.feature-card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: calc(var(--spacing-unit) * 4);
    text-align: center;
    box-shadow: 0 6px 0px #1A202C;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 3px solid #1A202C;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 14px 0px #1A202C;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.feature-card h3 {
    color: var(--primary-color);
    margin-bottom: calc(var(--spacing-unit) * 2);
}

/* FAQ Section */
.faq-section {
    padding: calc(var(--spacing-unit) * 8) 0;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border: 1px solid var(--text-muted);
    border-radius: var(--border-radius);
    margin-bottom: calc(var(--spacing-unit) * 2);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: calc(var(--spacing-unit) * 3);
    background: var(--surface-color);
    border: none;
    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(--primary-light);
}

.faq-question[aria-expanded="true"] {
    background: var(--primary-color);
    color: white;
}

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

.faq-icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.faq-answer {
    padding: calc(var(--spacing-unit) * 3);
    background: var(--bg-color);
    border-top: 1px solid var(--text-muted);
}

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

/* Game Section */
.game-container {
    max-width: 800px;
    margin: 0 auto;
    padding: calc(var(--spacing-unit) * 4);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: calc(var(--spacing-unit) * 4);
    flex-wrap: wrap;
    gap: 16px;
}

.game-info {
    display: flex;
    gap: calc(var(--spacing-unit) * 3);
    align-items: center;
}

.lives-counter,
.score-counter,
.category-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--surface-color);
    border: 3px solid #1A202C;
    border-radius: 16px;
    box-shadow: 0 4px 0px #1A202C;
    font-weight: 700;
    font-family: var(--font-gamified);
}

.lives-counter i {
    color: var(--error-red);
}

.score-counter i {
    color: var(--gold-color);
}

.category-display {
    color: var(--primary-color);
}

/* Hangman Drawing */
.hangman-container {
    display: flex;
    justify-content: center;
    margin: calc(var(--spacing-unit) * 4) 0;
}

.hangman-svg {
    max-width: 100%;
    height: auto;
}

/* Word Display */
.word-container {
    text-align: center;
    margin: calc(var(--spacing-unit) * 4) 0;
}

.word-display {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.word-letter {
    width: 50px;
    height: 50px;
    border: 3px solid #1A202C;
    border-radius: 12px;
    box-shadow: 0 4px 0px #1A202C;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-gamified);
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--surface-color);
    color: var(--text-color);
    transition: all 0.1s;
}

.word-letter.revealed {
    background: var(--accent-color);
    color: #1A202C;
    transform: translateY(4px);
    box-shadow: 0 0px 0px #1A202C;
}

.word-letter.space {
    border: none;
    background: transparent;
}

.word-hint {
    padding: calc(var(--spacing-unit) * 2);
    background: var(--primary-light);
    border-radius: var(--border-radius);
    margin-top: calc(var(--spacing-unit) * 3);
}

.word-hint p {
    margin: 0;
    font-style: italic;
    color: var(--primary-color);
}

/* Virtual Keyboard */
.keyboard-container {
    margin: calc(var(--spacing-unit) * 4) 0;
}

.virtual-keyboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
    gap: 8px;
    max-width: 600px;
    margin: 0 auto;
}

.keyboard-key {
    aspect-ratio: 1;
    border: 3px solid #1A202C;
    border-radius: 12px;
    box-shadow: 0 4px 0px #1A202C;
    background: var(--surface-color);
    color: var(--text-color);
    font-family: var(--font-gamified);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
}

.keyboard-key:hover {
    background: var(--primary-light);
    transform: translateY(2px);
    box-shadow: 0 2px 0px #1A202C;
}

.keyboard-key.correct {
    background: var(--victory-green);
    color: white;
    transform: translateY(4px);
    box-shadow: 0 0px 0px #1A202C;
}

.keyboard-key.incorrect {
    background: var(--error-red);
    color: white;
    transform: translateY(4px);
    box-shadow: 0 0px 0px #1A202C;
}

.keyboard-key.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

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

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal-content {
    background: var(--surface-color);
    border-radius: 16px;
    border: 4px solid var(--text-color);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 8px 8px 0px var(--text-color);
    position: relative;
}

[data-theme="dark"] .modal-content {
    border-color: var(--primary-color);
    box-shadow: 8px 8px 0px var(--primary-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 4px solid var(--text-color);
    background: var(--primary-color);
    color: white;
}

[data-theme="dark"] .modal-header {
    border-bottom-color: var(--primary-color);
    background: var(--surface-color);
}

.modal-header h2 {
    margin: 0;
    color: white;
    font-family: var(--font-primary);
    font-size: 2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.3);
}

[data-theme="dark"] .modal-header h2 {
    color: var(--primary-color);
    text-shadow: none;
}

.modal-close {
    background: white;
    border: 2px solid var(--text-color);
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-color);
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 2px 0px var(--text-color);
    transition: transform 0.1s;
}

[data-theme="dark"] .modal-close {
    background: var(--error-red);
    color: white;
    border-color: white;
    box-shadow: 2px 2px 0px white;
}

.modal-close:hover {
    transform: scale(1.1);
}
.modal-close:active {
    transform: scale(0.9) translateY(2px);
    box-shadow: 0px 0px 0px var(--text-color);
}

.modal-body {
    padding: calc(var(--spacing-unit) * 3);
}

.modal-footer {
    padding: 24px;
    border-top: 4px solid var(--text-color);
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    background: var(--surface-color);
}

[data-theme="dark"] .modal-footer {
    border-top-color: var(--primary-color);
}

/* Result Modal Elements */
.result-word {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px dashed var(--text-muted);
}

.result-word h3 {
    color: var(--text-muted);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.result-word p {
    font-family: var(--font-primary);
    font-size: 2.5rem;
    color: var(--primary-color);
    font-weight: bold;
    margin: 0;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.1);
}

.result-context h3,
.result-reference h3 {
    font-family: var(--font-primary);
    color: var(--secondary-color);
    font-size: 1.2rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-context p,
.result-reference p {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-color);
    margin-bottom: 20px;
    background: var(--bg-color);
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
}

.result-stats {
    background: linear-gradient(135deg, var(--gold-color), #FFA000);
    padding: 16px 24px;
    border-radius: 12px;
    margin-top: 24px;
    border: 3px solid var(--text-color);
    box-shadow: 4px 4px 0px var(--text-color);
    color: #1A202C;
    font-family: var(--font-primary);
    font-size: 1.2rem;
    font-weight: bold;
}

[data-theme="dark"] .result-stats {
    border-color: white;
    box-shadow: 4px 4px 0px white;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.stat-item span:last-child {
    color: var(--victory-green);
    font-size: 1.2rem;
}

/* Stats Section */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: calc(var(--spacing-unit) * 3);
    margin-bottom: calc(var(--spacing-unit) * 6);
}

.stat-card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: calc(var(--spacing-unit) * 4);
    text-align: center;
    box-shadow: 0 6px 0px #1A202C;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 3px solid #1A202C;
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 14px 0px #1A202C;
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.stat-info h3 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: calc(var(--spacing-unit) * 1);
}

.stat-info p {
    color: var(--text-muted);
    margin: 0;
}

/* Level Progress */
.level-progress {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: calc(var(--spacing-unit) * 4);
    box-shadow: 0 6px 0px #1A202C;
    border: 3px solid #1A202C;
}

.level-progress h3 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.level-info {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 2);
}

.level-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 60px;
    text-align: center;
}

.xp-bar {
    flex: 1;
    height: 20px;
    background: var(--text-muted);
    border-radius: 10px;
    overflow: hidden;
}

.xp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--gold-color));
    transition: width 0.5s ease;
    width: 0%;
}

.xp-text {
    font-weight: 600;
    color: var(--text-color);
    min-width: 100px;
    text-align: right;
}

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

.achievement-card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: calc(var(--spacing-unit) * 3);
    text-align: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

/* Locked State (Gray, dashed, flat) */
.achievement-card:not(.unlocked) {
    background: var(--bg-color);
    border: 3px dashed var(--text-muted);
    box-shadow: none;
    opacity: 0.6;
    filter: grayscale(100%);
    transform: scale(0.95);
}

.achievement-card:not(.unlocked):hover {
    transform: scale(0.95);
    cursor: not-allowed;
}

.achievement-card:not(.unlocked) .achievement-icon {
    color: var(--text-muted);
    opacity: 0.3;
}

.achievement-card:not(.unlocked) p {
    color: var(--text-muted);
}

/* Unlocked State (Gold, solid, shiny) */
.achievement-card.unlocked {
    border: 3px solid var(--gold-color);
    background: linear-gradient(135deg, var(--surface-color) 0%, #FFFDF0 100%);
    box-shadow: 0 6px 0px var(--gold-color), 0 0 15px rgba(255, 214, 0, 0.3);
    overflow: hidden;
}

[data-theme="dark"] .achievement-card.unlocked {
    background: linear-gradient(135deg, var(--surface-color) 0%, #2a2015 100%);
}

.achievement-card.unlocked:hover {
    transform: translateY(-8px);
    box-shadow: 0 14px 0px var(--gold-color), 0 0 25px rgba(255, 214, 0, 0.5);
}

.achievement-card.unlocked .achievement-icon {
    color: var(--gold-color);
    text-shadow: 0 0 10px rgba(255, 214, 0, 0.5);
}

/* Shine Animation for Unlocked Cards */
.achievement-card.unlocked::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    animation: achievementShine 4s infinite;
}

@keyframes achievementShine {
    0% {
        left: -100%;
    }

    15% {
        left: 200%;
    }

    100% {
        left: 200%;
    }
}

.achievement-card h3 {
    margin-bottom: calc(var(--spacing-unit) * 1);
}

.achievement-icon {
    font-size: 3.5rem;
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.achievement-card.unlocked h3 {
    color: var(--gold-color);
}

.achievement-card:not(.unlocked) h3 {
    color: var(--text-muted);
}

.achievement-card p {
    font-size: 0.9rem;
    margin: 0;
}

.achievement-card.unlocked p {
    color: var(--text-color);
}

.achievement-card:not(.unlocked) p {
    color: var(--text-muted);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--surface-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 0 #1A202C;
    /* Gamer style solid shadow */
    border-top: 2px solid #1A202C;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

[data-theme="dark"] .bottom-nav {
    box-shadow: 0 -4px 0 var(--primary-color);
    border-top: 2px solid var(--primary-color);
}


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

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 0px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 10px;
    font-weight: 700;
    font-family: var(--font-gamified);
    transition: all 0.1s;
    flex: 1;
    max-width: 65px;
    height: 50px;
    border: 2px solid transparent;
    border-radius: 12px;
    margin: 0 4px;
    background: transparent;
}

.nav-item i {
    font-size: 18px;
    margin-bottom: 2px;
}

.nav-item.active {
    background: var(--primary-color);
    color: white;
    border: 2px solid #1A202C;
    box-shadow: 0 4px 0px #1A202C;
    transform: translateY(-4px);
}

[data-theme="dark"] .nav-item.active {
    border: 2px solid var(--accent-color);
    box-shadow: 0 4px 0px var(--accent-color);
    color: #1A202C;
}

.nav-item:active {
    transform: translateY(0px) !important;
    box-shadow: 0 0px 0px #1A202C !important;
}

[data-theme="dark"] .nav-item:active {
    box-shadow: 0 0px 0px var(--accent-color) !important;
}

.nav-item:not(.active):hover {
    color: var(--primary-color);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 20px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    pointer-events: none;
}

@media (min-width: 992px) {
    .toast-container {
        bottom: 20px;
    }
}

.toast {
    background: var(--surface-color);
    color: var(--text-color);
    padding: 14px 28px;
    border-radius: 12px;
    margin-bottom: 12px;
    opacity: 0;
    transform: translateY(100px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: auto;
    border: 3px solid #1A202C;
    box-shadow: 0 6px 0px #1A202C;
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    display: flex;
    align-items: center;
    gap: 10px;
}

[data-theme="dark"] .toast {
    border-color: var(--primary-color);
    box-shadow: 0 6px 0px var(--primary-color);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    border-color: var(--victory-green);
    color: var(--victory-green);
}

.toast.error {
    border-color: var(--error-red);
    color: var(--error-red);
}

.toast.warning {
    border-color: var(--gold-color);
    color: var(--gold-color);
}

/* Footer */
.app-footer {
    background: var(--surface-color);
    padding: calc(var(--spacing-unit) * 6) 0 calc(var(--bottom-nav-height) + 20px);
    border-top: 4px solid #1A202C;
    margin-top: auto;
    position: relative;
    z-index: 10;
}

[data-theme="dark"] .app-footer {
    border-top: 4px solid var(--primary-color);
}

.footer-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

@media (min-width: 768px) {
    .app-footer {
        padding-bottom: calc(var(--spacing-unit) * 6);
    }
    .footer-top {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.footer-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

@media (min-width: 768px) {
    .footer-info {
        align-items: flex-start;
        text-align: left;
    }
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-biblical);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    text-shadow: 1px 1px 0px #1A202C;
}

[data-theme="dark"] .footer-brand {
    text-shadow: 1px 1px 0px var(--accent-color);
}

.footer-logo-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
}

.footer-description {
    font-size: 0.95rem;
    color: var(--text-muted);
    text-align: center;
    max-width: 300px;
    margin: 0;
}

@media (min-width: 768px) {
    .footer-description {
        text-align: left;
        max-width: 500px;
    }
}

.footer-links {
    display: flex;
    gap: 15px;
    font-weight: 600;
    font-size: 0.9rem;
}

.footer-links a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

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

.footer-bottom-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(0,0,0,0.1);
    font-size: 0.85rem;
    width: 100%;
}

[data-theme="dark"] .footer-bottom-centered {
    border-top: 1px solid rgba(255,255,255,0.1);
}

@media (min-width: 768px) {
    .footer-bottom-centered {
        flex-direction: row;
        gap: 16px;
    }
}

.footer-credits {
    margin: 0;
    color: var(--text-muted);
}

.app-version {
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(0,0,0,0.05);
    padding: 2px 8px;
    border-radius: 12px;
}

[data-theme="dark"] .app-version {
    background: rgba(255,255,255,0.1);
}

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

.b20-link:hover {
    text-decoration: underline;
}

.btn-share {
    background: var(--secondary-color);
    box-shadow: 0 6px 0px #1A202C;
    font-size: 1.1rem;
    padding: 12px 24px;
}

.btn-share:hover {
    background: #00A3D9;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.5s ease-out;
}

.animate-pulse {
    animation: pulse 1s ease-in-out infinite;
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

/* 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);
}

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

.bg-primary {
    background: var(--primary-color);
}

.bg-surface {
    background: var(--surface-color);
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .btn-large {
        width: 100%;
        max-width: 300px;
    }

    .game-info {
        justify-content: center;
        flex-wrap: wrap;
    }

    .word-letter {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .virtual-keyboard {
        grid-template-columns: repeat(6, 1fr);
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

@media (max-width: 320px) {
    .container {
        padding: 0 12px;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .word-letter {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .keyboard-key {
        min-height: 40px;
        font-size: 1rem;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    .hangman-svg {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

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

/* Print Styles */
@media print {

    .app-header,
    .bottom-nav,
    .btn,
    .modal {
        display: none !important;
    }

    body {
        padding: 0;
        background: white;
        color: black;
    }

    .section {
        display: block !important;
        page-break-inside: avoid;
    }
}

/* =========================================
   GAMER HINT & WORD HISTORY
   ========================================= */

.word-hint.gamer-hint {
    background: var(--surface-color);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 15px 20px;
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 0 var(--primary-color), inset 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .word-hint.gamer-hint {
    box-shadow: 0 4px 0 var(--primary-color), 0 0 15px rgba(145, 70, 255, 0.3);
    background: linear-gradient(145deg, var(--surface-color), #2a2045);
}

.word-hint.gamer-hint::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-color);
}

.hint-icon {
    font-size: 24px;
    color: var(--accent-color);
    animation: pulse 2s infinite;
}

.word-history-container {
    margin-top: 30px;
    background: var(--surface-color);
    border: 3px solid var(--text-color);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 4px 4px 0 var(--text-color);
}

.history-title {
    font-family: 'Fredoka', sans-serif;
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px dashed var(--text-muted);
    padding-bottom: 10px;
}

.word-history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    background: var(--bg-color);
    border: 2px solid var(--text-color);
    border-radius: 10px;
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    position: relative;
    box-shadow: 2px 2px 0 var(--text-muted);
    animation: slideIn 0.3s ease-out;
}

.history-item.win {
    border-color: var(--success-color);
}

.history-item.loss {
    border-color: var(--danger-color);
}

.history-word {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-color);
    letter-spacing: 1px;
}

.history-context {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.4;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}