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

html {
    overflow-x: hidden;
}

body {
    font-family: 'Inter', 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #2d3748;
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
}

.layout-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

.container {
    max-width: 900px;
    min-width: 0;
    flex: 1 1 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    order: 2;
}

.ad-sidebar.left {
    order: 1;
}

.ad-sidebar.right {
    order: 3;
}

/* Ad Sidebars */
.ad-sidebar {
    width: 160px;
    flex-shrink: 0;
    display: none;
    /* Hidden for now - enable when ready for ads */
    flex-direction: column;
    gap: 20px;
    padding-top: 20px;
}

.ad-placeholder {
    background: rgba(255, 255, 255, 0.4);
    border: 2px dashed rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    text-align: center;
    font-size: 0.9em;
    backdrop-filter: blur(5px);
}

@media (max-width: 1100px) {
    .ad-sidebar {
        display: none;
    }

    .layout-wrapper {
        padding: 10px;
    }
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: 24px;
    margin-bottom: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.5);
    text-align: center;
    position: relative;
    overflow: hidden;
    border: none;
}

.header-flag {
    display: inline-block;
    margin-bottom: 10px;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.1));
    transform-origin: center;
}

.header-flag svg {
    width: 80px;
    height: 40px;
    border-radius: 8px;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(-2deg);
    }

    50% {
        transform: translateY(-10px) rotate(2deg);
    }
}

.header-content h1 {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    margin-bottom: 5px;
    color: #1a202c;
    font-weight: 900;
    letter-spacing: -1.5px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: clamp(0.9rem, 3vw, 1.2rem);
    color: #4a5568;
    font-weight: 600;
}

/* Screen Management */
.screen {
    display: none;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.5);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
}

.screen.active {
    display: block !important;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

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

/* Welcome Screen */
.welcome-content {
    text-align: center;
}

.welcome-icon {
    font-size: 5em;
    margin-bottom: 10px;
    display: inline-block;
    animation: bob 3s ease-in-out infinite;
}

@keyframes bob {

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

    50% {
        transform: translateY(-10px);
    }
}

.welcome-content h2 {
    color: #2D3748;
    font-size: clamp(1.4rem, 4vw, 2.2rem);
    margin-bottom: 15px;
    font-weight: 800;
}

.welcome-description {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: #718096;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.feature-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.9) 100%);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.feature-card:hover {
    transform: translateY(-12px) scale(1.03);
    border-color: #667eea;
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.3);
}

.feature-card:hover::before {
    opacity: 0.05;
}

.feature-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
    display: block;
}

.feature-card h4 {
    color: #4A5568;
    font-size: 1.1em;
    margin-bottom: 5px;
    font-weight: 700;
}

.feature-card p {
    color: #A0AEC0;
    font-size: 0.9em;
}

/* Encouragement Box */
.encouragement-box {
    background: linear-gradient(135deg, rgba(251, 207, 232, 0.3) 0%, rgba(251, 182, 206, 0.3) 100%);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(236, 72, 153, 0.3);
    padding: 25px;
    margin: 30px 0;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(236, 72, 153, 0.15);
}

.encouragement-box p {
    color: #831843;
    font-size: 1.1em;
    margin: 0;
    font-weight: 600;
}

/* Buttons */
.btn {
    padding: clamp(14px, 3vw, 18px) clamp(28px, 5vw, 44px);
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-weight: 700;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
    text-transform: none;
    min-height: 44px;
    min-width: 44px;
    box-shadow: 0 4px 14px 0 rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: #667EEA;
    border: 2px solid #667EEA;
    margin-top: 15px;
}

.btn-secondary:hover {
    background: white;
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

/* Progress Container */
.progress-container {
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.progress-label {
    font-size: 0.9em;
    color: #A0AEC0;
    font-weight: 700;
    text-transform: uppercase;
}

.progress-percent {
    font-size: 1.1em;
    color: #667EEA;
    font-weight: 800;
}

.progress-bar {
    width: 100%;
    height: 18px;
    background: rgba(237, 242, 247, 0.8);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 100%;
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 20px;
    position: relative;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg,
            rgba(255, 255, 255, 0.2) 25%,
            transparent 25%,
            transparent 50%,
            rgba(255, 255, 255, 0.2) 50%,
            rgba(255, 255, 255, 0.2) 75%,
            transparent 75%,
            transparent);
    background-size: 20px 20px;
    animation: moveStripe 1s linear infinite;
}

@keyframes moveStripe {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 20px 20px;
    }
}

/* Quiz Header */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.question-counter,
.score-display {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 12px 24px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.8);
    text-align: center;
}

.counter-label,
.score-label {
    display: block;
    font-size: 0.7em;
    color: #A0AEC0;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.counter-numbers,
.score-numbers {
    font-size: 1.4em;
    color: #4A5568;
    font-weight: 800;
}

.score-numbers {
    color: #48BB78;
}

/* Question Container */
.question-badge {
    font-size: 4em;
    text-align: center;
    margin-bottom: 10px;
    animation: bounce 2s infinite;
}

@keyframes bounce {

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

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

.question-text {
    font-size: clamp(1.1rem, 3.5vw, 1.6rem);
    color: #2D3748;
    margin-bottom: 30px;
    text-align: center;
    font-weight: 700;
    line-height: 1.4;
}

.answers-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.answer-btn {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(237, 242, 247, 0.8);
    padding: clamp(16px, 3vw, 22px) clamp(18px, 3vw, 28px);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: left;
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    color: #1a202c;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    min-height: 44px;
    position: relative;
    overflow: hidden;
}

.answer-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.answer-btn:hover:not(.disabled) {
    border-color: #667EEA;
    transform: translateX(8px);
    background: white;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.25);
}

.answer-btn:hover:not(.disabled)::before {
    opacity: 1;
}

.answer-btn.correct {
    background: #C6F6D5;
    border-color: #48BB78;
    color: #22543D;
    animation: pulseGreen 0.5s;
}

.answer-btn.incorrect {
    background: #FED7D7;
    border-color: #F56565;
    color: #742A2A;
    animation: shake 0.4s;
}

@keyframes pulseGreen {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

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

@keyframes shake {

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

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

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

.answer-btn.disabled {
    cursor: default;
    opacity: 0.8;
}

#next-btn {
    margin-top: 30px;
    width: 100%;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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



.results-content {
    text-align: center;
    padding: 40px;
}

.result-icon {
    font-size: 6em;
    margin: 20px 0;
    animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#result-title {
    font-size: 2.5em;
    font-weight: 800;
    margin-bottom: 10px;
}

.result-status.pass #result-title {
    color: #48BB78;
}

.result-status.fail #result-title {
    color: #ECC94B;
}

.score-summary {
    background: white;
    padding: 30px;
    border-radius: 30px;
    margin: 30px 0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    border: 2px solid #EDF2F7;
}

.final-score {
    font-size: 3.5em;
    font-weight: 800;
    color: #2D3748;
}

.percentage {
    font-size: 2em;
    color: #667EEA;
    font-weight: 700;
}

.action-buttons {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    justify-content: center;
}

.explanation-container {
    margin-top: 15px;
    background: #E6FFFA;
    border: 2px solid #38B2AC;
    padding: 15px;
    border-radius: 15px;
    color: #234E52;
    animation: slideUp 0.3s ease;
    font-size: 1.1em;
    line-height: 1.5;
}

.explanation-title {
    font-weight: 700;
    margin-bottom: 5px;
    display: block;
    color: #2C7A7B;
}

/* Review Screen */
.review-item {
    background: white;
    border: 2px solid #EDF2F7;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
}

.review-item.correct {
    border-color: #48BB78;
    background: #F0FFF4;
}

.review-item.incorrect {
    border-color: #F56565;
    background: #FFF5F5;
}

.review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 700;
}

.status-correct {
    color: #2F855A;
}

.status-incorrect {
    color: #C53030;
}

/* Particles */
.particle {
    position: fixed;
    pointer-events: none;
    animation: particleFloat 1s ease-out forwards;
    z-index: 9999;
}

@keyframes particleFloat {
    0% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translate(var(--tx), var(--ty)) rotate(var(--tr));
        opacity: 0;
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: #2D3748;
    font-size: 0.9em;
}

/* Responsive */
/* Tablet breakpoint */
@media (max-width: 768px) {
    .layout-wrapper {
        padding: 15px;
    }

    .screen {
        padding: 28px;
        border-radius: 20px;
    }

    header {
        padding: 28px;
        border-radius: 20px;
        margin-bottom: 20px;
    }

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

    .feature-card {
        padding: 25px;
    }

    .games-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 16px;
    }

    .game-card {
        padding: 25px;
    }

    .tips-grid {
        grid-template-columns: 1fr;
    }

    .quiz-header {
        flex-wrap: wrap;
        gap: 12px;
        justify-content: center;
    }

    .question-counter,
    .score-display {
        min-width: 120px;
    }

    /* Hide complex games on mobile/tablet */
    .game-card[href*="Citizenship Highway"],
    .game-card[href*="robin-hood.html"],
    .game-card[href*="Britannia Star Patrol"] {
        display: none;
    }

    /* Hide feature cards on mobile/tablet */
    .features-grid {
        display: none;
    }

    .selection-section {
        padding: 25px;
    }
}

/* Removed header/footer hiding - keep visible at all times */

/* Mobile breakpoint */
@media (max-width: 600px) {
    body {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    }

    .layout-wrapper {
        padding: 12px;
    }

    .screen {
        padding: 20px;
        border-radius: 18px;
    }

    header {
        padding: 20px;
        border-radius: 18px;
        margin-bottom: 15px;
    }

    /* Hide header when not on welcome screen on mobile */
    .container:has(#quiz-screen.active) header,
    .container:has(#results-screen.active) header,
    .container:has(#review-screen.active) header {
        display: none;
    }

    .welcome-icon {
        font-size: 3.5em;
    }

    .question-badge {
        font-size: 3em;
    }

    .btn {
        width: 100%;
        margin-bottom: 10px;
        padding: 16px 24px;
        border-radius: 14px;
    }

    .action-buttons {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .action-buttons .btn {
        width: 100%;
        margin: 0;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .feature-card {
        padding: 20px;
    }

    .games-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .game-card {
        padding: 22px;
    }

    .slider-container {
        padding: 18px;
        border-radius: 12px;
    }

    .final-score {
        font-size: 2.5em;
    }

    .result-icon {
        font-size: 4em;
    }

    .score-summary {
        padding: 20px;
        border-radius: 20px;
    }

    .answer-btn:hover:not(.disabled) {
        transform: translateX(4px);
    }

    .social-content {
        flex-direction: column;
        gap: 5px;
    }

    .encouragement-box {
        padding: 18px;
    }

    .study-guide-section,
    .study-tips-section,
    .faq-section {
        padding: 24px;
        border-radius: 20px;
    }

    .selection-section {
        padding: 20px;
        border-radius: 18px;
    }

    .quick-guide-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .quick-guide-link {
        padding: 22px 25px;
        border-radius: 18px;
    }

    .quick-guide-icon {
        font-size: 2.5em;
    }

    .quick-guide-text h4 {
        font-size: 1.3em;
    }

    .quick-guide-text p {
        font-size: 1em;
    }

    .quick-guide-arrow {
        display: none;
    }

    .progress-container {
        padding: 16px;
        border-radius: 16px;
    }

    .question-counter,
    .score-display {
        padding: 10px 18px;
        border-radius: 14px;
    }

}

/* Small mobile breakpoint */
@media (max-width: 375px) {
    .layout-wrapper {
        padding: 10px;
    }

    .screen {
        padding: 16px;
        border-radius: 16px;
    }

    header {
        padding: 16px;
        border-radius: 16px;
    }

    .feature-card {
        padding: 18px;
        border-radius: 16px;
    }

    .game-card {
        padding: 18px;
        border-radius: 16px;
    }

    .slider-container {
        padding: 15px;
        border-radius: 12px;
    }

    .blocks-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }

    .block-btn {
        padding: 14px 10px;
        font-size: 0.85em;
        border-radius: 12px;
    }

    .selection-section {
        padding: 18px;
        border-radius: 16px;
    }

    .btn {
        padding: 14px 20px;
        border-radius: 12px;
    }
}

/* Quiz Selection Styles */
.quiz-selection-container {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.selection-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    transition: all 0.3s ease;
}

.selection-section:hover {
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 12px 48px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.selection-section h3 {
    color: #4A5568;
    font-size: 1.4em;
    margin-bottom: 10px;
    font-weight: 800;
}

.selection-section p {
    color: #718096;
    margin-bottom: 20px;
    font-size: 0.95em;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #A0AEC0;
    font-weight: 700;
    font-size: 0.9em;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 2px dashed #CBD5E0;
}

.divider::before {
    margin-right: 15px;
}

.divider::after {
    margin-left: 15px;
}

/* Blocks Grid */
.blocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.block-btn {
    background: rgba(237, 242, 247, 0.8);
    backdrop-filter: blur(5px);
    border: 2px solid rgba(203, 213, 224, 0.6);
    padding: 16px 12px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 700;
    color: #1a202c;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 0.9em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.block-btn:hover {
    background: white;
    border-color: #667EEA;
    color: #667EEA;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.25);
}

/* Slider Styles */
.slider-container {
    margin-bottom: 25px;
    background: #F7FAFC;
    padding: 20px;
    border-radius: 15px;
}

.slider-container label {
    display: block;
    margin-bottom: 15px;
    font-weight: 700;
    color: #4A5568;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slider-value {
    background: #667EEA;
    color: white;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 1.1em;
}

input[type=range] {
    width: 100%;
    margin: 10px 0;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}

input[type=range]:focus {
    outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 10px;
    cursor: pointer;
    background: #CBD5E0;
    border-radius: 5px;
}

input[type=range]::-webkit-slider-thumb {
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: #667EEA;
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -7px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
}

input[type=range]:focus::-webkit-slider-runnable-track {
    background: #A0AEC0;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    color: #A0AEC0;
    font-size: 0.8em;
    font-weight: 600;
    margin-top: 5px;
}


/* Fancy Booking Button */
.btn-booking {
    display: inline-block;
    margin-top: 20px;
    margin-bottom: 30px;
    padding: 15px 30px;
    background: linear-gradient(135deg, #48BB78 0%, #38A169 100%);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1.1em;
    box-shadow: 0 10px 20px rgba(72, 187, 120, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-booking:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 30px rgba(72, 187, 120, 0.4);
    background: linear-gradient(135deg, #38A169 0%, #2F855A 100%);
    color: white;
}

.btn-booking:active {
    transform: translateY(-2px) scale(0.98);
}

/* Fireworks */
.firework-particle {
    position: fixed;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    animation: explode 1s ease-out forwards;
}

@keyframes explode {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(var(--fx), var(--fy)) scale(0);
        opacity: 0;
    }
}

/* Temporary Ad Placeholder for Local Testing */
ins.adsbygoogle {
    background: #f0f0f0;
    border: 1px dashed #ccc;
    position: relative;
}

ins.adsbygoogle::before {
    content: 'Ad Space (Will load on live site)';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #888;
    font-size: 0.8em;
    text-align: center;
    width: 100%;
}

/* Game Cards (Index) */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.game-card {
    text-decoration: none;
    color: inherit;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.game-card:hover {
    transform: translateY(-12px) scale(1.03);
    border-color: #667eea;
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.35);
}

.game-card:hover::before {
    opacity: 0.08;
}

.game-card-icon {
    font-size: 3em;
    margin-bottom: 10px;
    display: block;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

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

.game-card h4 {
    margin: 10px 0;
    color: #1a202c;
    font-size: 1.2em;
    font-weight: 800;
    position: relative;
    z-index: 1;
}

.game-card p {
    font-size: 0.9em;
    color: #4a5568;
    margin: 0;
    position: relative;
    z-index: 1;
}

/* Social Media Section */
.social-section {
    margin-top: 50px;
    text-align: center;
    background: white;
    padding: 40px 30px;
    border-radius: 25px;
    border: 2px solid #E2E8F0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.social-section h3 {
    color: #2D3748;
    font-size: 1.8em;
    margin-bottom: 10px;
    font-weight: 800;
}

.social-intro {
    color: #718096;
    font-size: 1.1em;
    margin-bottom: 30px;
}

.social-media-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: clamp(10px, 3vw, 20px);
    padding: clamp(15px, 3vw, 20px) clamp(20px, 5vw, 40px);
    background: white;
    border-radius: 30px;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    border: 5px solid transparent;
    font-size: clamp(2rem, 8vw, 5rem);
}

.social-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.social-link.tiktok:hover {
    border-color: #000000;
    background: linear-gradient(135deg, #69C9D0 0%, #EE1D52 100%);
    color: white;
}

.social-link.youtube:hover {
    border-color: #FF0000;
    background: #FF0000;
    color: white;
}

.social-link.facebook:hover {
    border-color: #1877F2;
    background: #1877F2;
    color: white;
}

.social-icon {
    width: clamp(50px, 15vw, 100px);
    height: clamp(50px, 15vw, 100px);
    flex-shrink: 0;
}

.social-link.tiktok .social-icon {
    color: #000000;
}

.social-link.tiktok:hover .social-icon {
    color: white;
}

.social-link.youtube .social-icon {
    color: #FF0000;
}

.social-link.youtube:hover .social-icon {
    color: white;
}

.social-link.facebook .social-icon {
    color: #1877F2;
}

.social-link.facebook:hover .social-icon {
    color: white;
}

.social-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.social-label {
    font-size: 0.65em;
    color: #A0AEC0;
    font-weight: 500;
}

.social-link:hover .social-label {
    color: rgba(255, 255, 255, 0.9);
}

.social-name {
    font-size: 0.75em;
    font-weight: 700;
    color: #2D3748;
}

.social-link:hover .social-name {
    color: white;
}

/* Ghost Game Styles */
.ghost-question-container {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.ghosts-container {
    position: relative;
    height: 400px;
    background: #2D3748;
    border-radius: 15px;
    overflow: hidden;
    border: 4px solid #4A5568;
    margin-bottom: 20px;
    cursor: crosshair;
}

.ghost {
    position: absolute;
    color: white;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 15px;
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    user-select: none;
    transition: transform 0.1s;
    font-weight: 600;
    white-space: nowrap;
    backdrop-filter: blur(5px);
}

.ghost:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
    transform: scale(1.1);
    z-index: 10;
}

.ghost.hit {
    background: #ef4444;
    transform: scale(0.9);
}

.player-base {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: #4A5568;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
}

.player-cannon {
    font-size: 3em;
    transform-origin: center;
    transition: transform 0.1s;
}

.arena-hud {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    background: white;
    padding: 10px 20px;
    border-radius: 15px;
    align-items: center;
}

.health-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    max-width: 300px;
}

.health-bar-bg {
    flex: 1;
    height: 15px;
    background: #EDF2F7;
    border-radius: 10px;
    overflow: hidden;
}

.health-bar {
    height: 100%;
    background: #48BB78;
    width: 100%;
    transition: width 0.3s, background-color 0.3s;
}

.health-text,
.level-container {
    font-weight: 700;
    color: #4A5568;
    font-size: 0.9em;
}

.level-value {
    color: #667EEA;
    font-size: 1.2em;
    margin-left: 5px;
}

/* Study Guide Section */
.study-guide-section {
    margin-top: 50px;
    text-align: left;
    background: white;
    padding: 30px;
    border-radius: 25px;
    border: 2px solid #E2E8F0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.study-guide-section h3 {
    color: #2D3748;
    font-size: 1.8em;
    margin-bottom: 15px;
    font-weight: 800;
    text-align: center;
}

.section-intro {
    text-align: center;
    color: #718096;
    font-size: 1.1em;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* Quick Guide Banner */
.quick-guide-banner {
    margin: 30px 0;
    padding: 0;
}

.quick-guide-link {
    display: block;
    text-decoration: none;
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    border-radius: 20px;
    padding: 25px 30px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.quick-guide-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.5);
}

.quick-guide-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.quick-guide-icon {
    font-size: 3em;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.quick-guide-text {
    flex: 1;
}

.quick-guide-text h4 {
    color: white;
    font-size: 1.5em;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.quick-guide-text p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.05em;
    margin: 0;
    line-height: 1.5;
}

.quick-guide-arrow {
    font-size: 2em;
    color: white;
    animation: bounceRight 1.5s infinite;
}

@keyframes bounceRight {

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

    50% {
        transform: translateX(10px);
    }
}

.study-guide-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.guide-topic {
    background: #F7FAFC;
    padding: 25px;
    border-radius: 15px;
    border-left: 5px solid #667EEA;
}

.guide-topic h4 {
    color: #667EEA;
    font-size: 1.4em;
    margin-bottom: 15px;
    font-weight: 700;
}

.topic-content p {
    color: #4A5568;
    line-height: 1.8;
    margin-bottom: 15px;
    font-size: 1em;
}

.topic-content p:last-child {
    margin-bottom: 0;
}

.topic-content strong {
    color: #2D3748;
    font-weight: 700;
}

/* Study Tips Section */
.study-tips-section {
    margin-top: 50px;
    text-align: left;
    background: white;
    padding: 30px;
    border-radius: 25px;
    border: 2px solid #E2E8F0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.study-tips-section h3 {
    color: #2D3748;
    font-size: 1.8em;
    margin-bottom: 25px;
    font-weight: 800;
    text-align: center;
}

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

.tip-card {
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    transition: transform 0.3s, box-shadow 0.3s;
}

.tip-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.tip-card h4 {
    font-size: 1.3em;
    margin-bottom: 10px;
    font-weight: 700;
}

.tip-card p {
    line-height: 1.6;
    font-size: 1em;
    opacity: 0.95;
}

/* FAQ Section */
.faq-section {
    margin-top: 50px;
    text-align: left;
    background: white;
    padding: 30px;
    border-radius: 25px;
    border: 2px solid #E2E8F0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.faq-section h3 {
    color: #2D3748;
    font-size: 1.8em;
    margin-bottom: 25px;
    font-weight: 800;
    text-align: center;
}

.faq-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #EDF2F7;
}

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

.faq-item h4 {
    color: #4A5568;
    font-size: 1.2em;
    margin-bottom: 10px;
    font-weight: 700;
}

.faq-item p {
    color: #718096;
    line-height: 1.6;
    font-size: 1em;
}

.faq-item a {
    color: #667EEA;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.faq-item a:hover {
    color: #5A67D8;
    text-decoration: underline;
}

/* Featured Game Styles */
.game-card.featured {
    border: 3px solid #ECC94B;
    background: linear-gradient(135deg, #FFF 0%, #FFF5F7 100%);
    transform: scale(1.02);
    box-shadow: 0 10px 40px rgba(236, 201, 75, 0.3);
    order: -1;
}

.game-card.featured:hover {
    transform: translateY(-12px) scale(1.05);
    border-color: #F6E05E;
    box-shadow: 0 20px 60px rgba(236, 201, 75, 0.4);
}

.new-badge {
    position: absolute;
    top: 20px;
    right: -30px;
    background: #E53E3E;
    color: white;
    padding: 5px 35px;
    font-size: 0.7em;
    font-weight: 800;
    text-transform: uppercase;
    transform: rotate(45deg);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 10;
    line-height: 1.2;
    letter-spacing: 0.5px;
}

@media (max-width: 600px) {
    .game-card.featured {
        transform: none;
    }

    .game-card.featured:hover {
        transform: translateY(-5px);
    }
}

/* Refactored Inline Styles */
.featured-challenge-section {
    border: 2px solid #ECC94B;
    background: linear-gradient(to bottom right, rgba(255, 255, 255, 0.9), rgba(255, 250, 240, 0.9));
}

.featured-challenge-title {
    color: #D69E2E;
}

.featured-games-grid {
    grid-template-columns: 1fr;
    max-width: 450px;
    margin: 0 auto;
}

.featured-game-card {
    width: 100%;
}

.study-resources-section {
    margin: 40px 0;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
}

.study-resources-title {
    color: white;
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.8rem;
}

.study-resources-subtitle {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

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

.study-guide-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    transition: transform 0.3s, box-shadow 0.3s;
    display: block;
}

.study-guide-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.study-guide-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.study-guide-card h4 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.study-guide-description {
    color: #666;
    margin: 0;
    font-size: 0.95rem;
}

.read-guide-text {
    color: #667eea;
    margin-top: 15px;
    font-weight: bold;
    font-size: 0.9rem;
}

.game-quiz-btn {
    padding: 10px 20px;
    font-size: 1rem;
    margin-top: 0;
}

.mini-flag-icon {
    display: inline-block;
    vertical-align: middle;
    margin-left: 5px;
}

.footer-link {
    color: #012169;
    text-decoration: underline;
}

/* App Download Section */
.app-download-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(240, 249, 255, 0.9) 100%);
    border: 2px solid rgba(66, 153, 225, 0.3);
}

.app-buttons-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
    flex-wrap: wrap;
    align-items: center;
}

.app-badge {
    width: 160px;
    height: auto;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: block;
    object-fit: contain;
}

/* Individual adjustments if needed based on the specific images */
.badge-android {
    /* Google Play sometimes needs to be slightly larger or smaller depending on margins */
    width: 180px;
}

.badge-ios {
    width: 160px;
}

.app-link {
    display: inline-block;
    text-decoration: none;
    border: none;
    background: none;
    padding: 0;
}

.app-link:hover .app-badge {
    transform: translateY(-4px) scale(1.05);
}

.app-badge.faded {
    opacity: 0.6;
    filter: grayscale(100%);
    cursor: not-allowed;
}

.app-link.disabled {
    cursor: default;
}

/* Domain Header */
.site-domain-header {
    font-size: 3rem;
    font-weight: 900;
    color: #4a5568;
    background: linear-gradient(300deg, #C8102E, #3B82F6, #C8102E);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
    display: inline-block;
    animation: gradientFlow 6s ease infinite;
    text-transform: uppercase;
}

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Header Nav Links */
.header-nav-links {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.header-nav-links a {
    text-decoration: none;
    color: #4a5568;
    background: rgba(255, 255, 255, 0.7);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.header-nav-links a:hover {
    background: white;
    transform: translateY(-2px);
    color: #3B82F6;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

@media (max-width: 600px) {
    .site-domain-header {
        font-size: 1.2rem;
        letter-spacing: 0.5px;
        white-space: normal;
        word-wrap: break-word;
        max-width: 100%;
        line-height: 1.4;
    }

    .header-nav-links {
        gap: 6px;
        margin-top: 10px;
    }

    .header-nav-links a {
        padding: 4px 8px;
        font-size: 0.7rem;
    }

    .container {
        padding: 10px;
    }

    /* Quiz Mode Simplification */
    body.quiz-mode-active {
        padding-top: 80px;
        /* Compensate for fixed header */
    }

    body.quiz-mode-active .site-domain-header {
        font-size: 1.2rem;
        background: linear-gradient(300deg, #C8102E, #3B82F6, #C8102E) !important;
        background-size: 300% 300% !important;
        -webkit-background-clip: text !important;
        background-clip: text !important;
        -webkit-text-fill-color: transparent !important;
        color: transparent !important;
        display: block !important;
        position: relative;
        z-index: 10001;
        animation: gradientFlow 6s ease infinite !important;
    }

    body.quiz-mode-active .header-nav-links,
    body.quiz-mode-active .subtitle {
        display: none !important;
    }

    body.quiz-mode-active header {
        padding: 5px;
        margin-bottom: 0;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 60px;
        /* Fixed height */
        z-index: 2147483647;
        /* Max z-index */
        border-radius: 0 0 15px 15px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        background: #ffffff !important;
        /* Solid white */
        display: flex !important;
        align-items: center;
        justify-content: center;
        overflow: visible !important;
        backdrop-filter: none !important;
        animation: none !important;
    }

    body.quiz-mode-active .header-flag {
        margin-bottom: 0;
        transform: none !important;
        /* Remove scale to avoid stacking issues */
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
    }

    body.quiz-mode-active .header-content {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    /* Ensure screen content doesn't get hidden */
    body.quiz-mode-active .screen {
        margin-top: 20px;
    }

    /* Results Screen Mobile Tweaks */
    #result-title {
        font-size: 1.8rem;
        /* Scale down from 2.5em */
    }

    .final-score {
        font-size: 2.5rem;
        /* Scale down from 3.5em */
    }

    .result-icon {
        font-size: 4em;
        /* Scale down from 6em */
        margin: 10px 0;
    }

}

/* TTS Button Icon Style */
#tts-btn {
    padding: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: unset;
    /* Override any button min-width */
}

#tts-btn svg {
    width: 24px;
    height: 24px;
    stroke-width: 2px;
}