/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 50%, #d1fae5 100%);
    min-height: 100vh;
    scroll-behavior: smooth;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, #0F172A 0%, #1B9C85 100%);
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(27, 156, 133, 0.9) 100%);
    backdrop-filter: blur(10px);
}

/* Navigation */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
}

.logo {
    position: relative;
    z-index: 2;
}

.logo-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.3s ease;
}

.logo-link .tagline {
    text-decoration: none;
    border: none;
    outline: none;
}

.logo-link:hover {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    align-items: center;
}

.rules-link {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.rules-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.logo-image {
    height: 50px;
    width: auto;
    margin-bottom: 0.5rem;
    /* Improve logo visibility on gradient background */
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
}

.tagline {
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    letter-spacing: 0.5px;
}

/* Hero Section - Main Page */
.hero-main {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 50%, #f0fdf4 100%);
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
    min-height: 70vh;
    display: flex;
    align-items: center;
}

/* Hero Section - Rules Page */
.hero {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 50%, #f0fdf4 100%);
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(27, 156, 133, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(27, 156, 133, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease-out;
}

.badge-text {
    background: linear-gradient(135deg, #1B9C85 0%, #059669 100%);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(27, 156, 133, 0.3);
}

.hero-title {
    font-size: 3.5rem;
    color: #0F172A;
    margin-bottom: 1rem;
    font-weight: 800;
    letter-spacing: -1px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: #1B9C85;
    margin-bottom: 2.5rem;
    font-weight: 600;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-description-box {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2.5rem;
    margin: 0 auto 3rem;
    max-width: 700px;
    border: 1px solid rgba(27, 156, 133, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.hero-description {
    margin: 0 0 1.5rem 0;
    line-height: 1.7;
}

.hero-description.yoruba-text {
    font-size: 1.1rem;
    color: #0F172A;
    font-weight: 600;
}

.hero-description.english-text {
    font-size: 1rem;
    color: #4b5563;
    font-style: italic;
    margin-bottom: 0;
}

.quick-start {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

.quick-start-text {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.scroll-arrow {
    font-size: 1.5rem;
    color: #1B9C85;
    animation: bounce 2s ease-in-out infinite;
}

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

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

/* Main Page Specific Styles */
.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.cta-primary, .cta-secondary, .cta-large {
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    display: inline-block;
    min-width: 200px;
    text-align: center;
}

.cta-primary, .cta-large {
    background: linear-gradient(135deg, #1B9C85 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(27, 156, 133, 0.3);
}

.cta-primary:hover, .cta-large:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(27, 156, 133, 0.4);
}

.cta-secondary {
    background: transparent;
    color: #1B9C85;
    border: 2px solid #1B9C85;
}

.cta-secondary:hover {
    background: #1B9C85;
    color: white;
    transform: translateY(-3px);
}

/* Game Highlights Section */
.game-highlights {
    padding: 5rem 0;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
}

.highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    margin: 3rem 0;
}

.highlight-card {
    text-align: center;
    padding: 2.5rem 2rem;
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.highlight-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1B9C85 0%, #059669 100%);
}

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

.highlight-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: block;
}

/* Media Gallery Section */
.game-preview {
    padding: 5rem 0;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.section-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: #4b5563;
    margin-bottom: 3rem;
    font-style: italic;
}

.media-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.media-slot {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

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

.media-placeholder {
    padding: 3rem 2rem;
    text-align: center;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.7;
}

.media-placeholder h4 {
    color: #0F172A;
    margin-bottom: 0.8rem;
    font-size: 1.3rem;
}

.media-placeholder p {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.coming-soon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.instagram-link {
    background: linear-gradient(135deg, #e1306c 0%, #f56040 100%);
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.instagram-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(225, 48, 108, 0.3);
}

/* Ready to Play Section */
.ready-to-play {
    padding: 5rem 0;
    background: linear-gradient(135deg, #1B9C85 0%, #059669 100%);
    color: white;
    text-align: center;
}

.ready-to-play h2 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.ready-to-play .section-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    margin-bottom: 3rem;
}

.play-cta {
    max-width: 500px;
    margin: 0 auto;
}

.cta-large {
    font-size: 1.2rem;
    padding: 1.2rem 2.5rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 1rem;
}

.cta-large:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.cta-helper {
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
    margin: 0;
}

.cta-buttons-main {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.cta-buy {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 2px solid rgba(255, 255, 255, 0.4) !important;
}

.cta-buy:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
}

/* Sections */
section {
    padding: 3rem 0;
}

section:nth-child(even) {
    background-color: #f9fafb;
}

h2 {
    font-size: 2rem;
    color: #0F172A;
    margin-bottom: 1.5rem;
    text-align: center;
}

h3 {
    font-size: 1.5rem;
    color: #1B9C85;
    margin-bottom: 1rem;
}

h4 {
    font-size: 1.2rem;
    color: #0F172A;
    margin-bottom: 0.75rem;
}

p {
    margin-bottom: 1rem;
    color: #4b5563;
    font-size: 1rem;
}

/* Enhanced Game Overview Section */
.game-overview {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    position: relative;
}

.game-overview h2 {
    font-size: 2.5rem;
    color: #0F172A;
    margin-bottom: 2rem;
    font-weight: 800;
}

.game-intro {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.game-description {
    font-size: 1.2rem;
    color: #4b5563;
    line-height: 1.7;
    background: linear-gradient(135deg, rgba(27, 156, 133, 0.05) 0%, rgba(255, 255, 255, 0.8) 100%);
    padding: 2rem;
    border-radius: 16px;
    border-left: 4px solid #1B9C85;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}


/* Player Configurations */
.player-configurations {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.config-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-left: 4px solid #1B9C85;
    transition: transform 0.3s ease;
}

.config-card:hover {
    transform: translateY(-3px);
}

.config-card h3 {
    color: #0F172A;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.config-card ul {
    list-style: none;
    padding-left: 0;
}

.config-card li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: #4b5563;
}

.config-card li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #1B9C85;
    font-weight: bold;
}

/* Interactive Rules - Flashcard System */
.interactive-rules {
    background: transparent;
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.interactive-rules::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(27, 156, 133, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(27, 156, 133, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 40% 80%, rgba(27, 156, 133, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.interactive-rules h2 {
    font-size: 3rem;
    background: linear-gradient(135deg, #1B9C85 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin-bottom: 1rem;
    font-weight: 800;
}

.rules-instruction {
    text-align: center;
    font-size: 1.2rem;
    color: #6b7280;
    margin-bottom: 3rem;
    font-weight: 500;
}

.flashcards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    perspective: 1000px;
}

.flashcard {
    height: 250px;
    cursor: pointer;
    position: relative;
    animation: floatIn 0.6s ease-out;
    animation-fill-mode: both;
    /* Mobile touch optimization */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.flashcard:nth-child(1) { animation-delay: 0.1s; }
.flashcard:nth-child(2) { animation-delay: 0.2s; }
.flashcard:nth-child(3) { animation-delay: 0.3s; }
.flashcard:nth-child(4) { animation-delay: 0.4s; }

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    border-radius: 16px;
    /* Mobile fix for perspective */
    perspective: 1000px;
    -webkit-perspective: 1000px;
}

.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(27, 156, 133, 0.2);
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(27, 156, 133, 0.1);
    overflow: hidden;
    /* Force hardware acceleration for mobile */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.flashcard-front::before, .flashcard-back::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1B9C85 0%, #059669 100%);
    z-index: 1;
}

.flashcard-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, #1B9C85 0%, #059669 100%);
    color: white;
    /* Ensure back face is fully opaque */
    opacity: 1;
    z-index: 2;
}

/* Removed all hover effects that were causing conflicts */

.flashcard:active {
    opacity: 0.9;
}

.flashcard.flipped:active {
    opacity: 0.9;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 0;
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
}

.rule-number {
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #1B9C85 0%, #059669 100%);
    color: white;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.flashcard-back .rule-number {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.language-indicator {
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    background: rgba(27, 156, 133, 0.1);
    color: #1B9C85;
    letter-spacing: 1px;
}

.flashcard-back .language-indicator {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
}

.card-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.5rem;
    position: relative;
    z-index: 2;
}

.card-content p {
    font-size: 1.1rem;
    line-height: 1.6;
    font-weight: 500;
    margin: 0;
    text-align: center;
}

.flashcard-back .card-content p {
    color: white;
    font-weight: 400;
}

.card-footer {
    padding: 1rem 1.5rem;
    text-align: center;
    position: relative;
    z-index: 2;
}

.flip-hint {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
    opacity: 0.8;
}

.flashcard-back .flip-hint {
    color: rgba(255, 255, 255, 0.8);
}

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

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

.flashcard:nth-child(odd) {
    animation: gentleFloat 6s ease-in-out infinite;
}

.flashcard:nth-child(even) {
    animation: gentleFloat 6s ease-in-out infinite;
    animation-delay: -3s;
}

/* Interactive Player Selector */
.player-selector {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    padding: 4rem 0;
    position: relative;
}

.player-selector h2 {
    font-size: 2.5rem;
    text-align: center;
    color: #0F172A;
    margin-bottom: 1rem;
    font-weight: 700;
}

.selector-instruction {
    text-align: center;
    font-size: 1.1rem;
    color: #6b7280;
    margin-bottom: 3rem;
    font-weight: 500;
}

.mode-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto 3rem;
    padding: 0 1rem;
}

.mode-button {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 20px;
    padding: 2rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    /* Mobile optimization */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px;
    outline: none;
}

.mode-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(27, 156, 133, 0.1), transparent);
    transition: left 0.6s ease;
}

.mode-button:hover::before {
    left: 100%;
}

.mode-button:hover {
    transform: translateY(-5px);
    border-color: #1B9C85;
    box-shadow: 0 10px 30px rgba(27, 156, 133, 0.2);
}

.mode-button.active {
    border-color: #1B9C85;
    background: linear-gradient(135deg, #1B9C85 0%, #059669 100%);
    color: white;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(27, 156, 133, 0.3);
}

.mode-button.active h3 {
    color: white !important;
    font-weight: 600 !important;
}

.mode-button.active p {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500 !important;
}

.mode-icon {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
}

.player-avatars {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.player-avatars.large-group {
    gap: 0.3rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1B9C85 0%, #059669 100%);
    position: relative;
    border: 3px solid white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    animation: avatarPulse 2s ease-in-out infinite;
}

.avatar:nth-child(2) { animation-delay: 0.3s; }
.avatar:nth-child(3) { animation-delay: 0.6s; }
.avatar:nth-child(4) { animation-delay: 0.9s; }

.mode-button.active .avatar {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
}

.avatar-more {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    border: 3px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.mode-button.active .avatar-more {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
}

.mode-button h3 {
    margin: 0 0 0.5rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.mode-button p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Game Flow */
.game-flow {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.flow-content {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.flow-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.flow-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #1B9C85 0%, #059669 100%);
    border-radius: 16px;
    color: white;
}

.flow-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
}

.flow-steps {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 2rem;
    background: white;
    border-radius: 16px;
    border-left: 4px solid #1B9C85;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.step::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #1B9C85 0%, #059669 100%);
}

.step-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1B9C85 0%, #059669 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(27, 156, 133, 0.3);
}

.step-content {
    flex: 1;
}

.step-content .yoruba {
    font-size: 1.1rem;
    color: #0F172A;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.step-content .english {
    font-size: 1rem;
    color: #4b5563;
    margin-bottom: 0;
    line-height: 1.5;
    font-style: italic;
}

@keyframes avatarPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 15px rgba(27, 156, 133, 0.3);
    }
}

/* Enhanced Learner Rules Section */
.learner-rules {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    position: relative;
    overflow: hidden;
}

.learner-rules::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 80% 20%, rgba(27, 156, 133, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.learner-header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    z-index: 2;
}

.learner-badge {
    margin-bottom: 1.5rem;
}

.special-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
    display: inline-block;
}

.learner-rules h2 {
    font-size: 2.5rem;
    color: #0F172A;
    margin-bottom: 0.5rem;
    font-weight: 800;
}

.learner-subtitle {
    font-size: 1.3rem;
    color: #1B9C85;
    margin-bottom: 1rem;
    font-weight: 600;
}

.learner-intro {
    font-size: 1.1rem;
    color: #4b5563;
    max-width: 600px;
    margin: 0 auto;
    font-style: italic;
}

.enhanced-bilingual-rules {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.enhanced-rule-item {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border-left: 6px solid #1B9C85;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.enhanced-rule-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(27, 156, 133, 0.2);
}

.enhanced-rule-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #1B9C85 0%, #059669 100%);
}

.rule-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.rule-content h4 {
    font-size: 1.3rem;
    color: #0F172A;
    margin-bottom: 1rem;
    font-weight: 700;
}

.rule-content .yoruba {
    font-size: 1.05rem;
    color: #0F172A;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.rule-content .english {
    font-size: 1rem;
    color: #4b5563;
    line-height: 1.5;
    font-style: italic;
}

/* Tips Section */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.tip-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-top: 4px solid #1B9C85;
}

.tip-card ul {
    list-style: none;
    padding-left: 0;
}

.tip-card li {
    padding: 0.5rem 0;
    padding-left: 2rem;
    position: relative;
    color: #4b5563;
}

.tip-card li::before {
    content: "→";
    position: absolute;
    left: 0.5rem;
    color: #1B9C85;
    font-weight: bold;
}

/* Footer */
footer {
    background: #0F172A;
    color: white;
    padding: 2rem 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 1rem;
}

.footer-content h3 {
    color: #1B9C85;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.footer-content a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-content a:hover {
    color: #1B9C85;
}

.copyright {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #374151;
    color: #9ca3af;
    font-size: 0.9rem;
}

/* Mobile-First Optimizations */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }
    
    /* Header Mobile */
    header {
        padding: 1.2rem 0;
    }
    
    .main-nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .nav-links {
        flex-shrink: 0;
    }
    
    .rules-link {
        padding: 0.8rem 1.8rem;
        font-size: 0.95rem;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .logo-image {
        height: 45px;
    }
    
    .tagline {
        font-size: 0.9rem;
    }
    
    /* Hero Mobile */
    .hero, .hero-main {
        padding: 3rem 0 2rem;
        min-height: auto;
    }
    
    .hero-title {
        font-size: 2.8rem;
        line-height: 1.1;
        margin-bottom: 0.8rem;
        font-weight: 800;
    }
    
    .hero-subtitle {
        font-size: 1.3rem;
        margin-bottom: 2rem;
        font-weight: 600;
        color: #1B9C85;
    }
    
    .hero-description-box {
        padding: 2rem 1.5rem;
        margin: 0 0 2.5rem;
        border-radius: 16px;
    }
    
    .hero-description.yoruba-text {
        font-size: 1.05rem;
        line-height: 1.6;
        margin-bottom: 1.2rem;
    }
    
    .hero-description.english-text {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    /* Rules Page Hero Titles Side by Side */
    .hero .hero-content {
        display: flex;
        flex-direction: column;
    }
    
    .hero-title-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-title-row .hero-title {
        flex: 1;
        text-align: left;
        margin-bottom: 0;
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero-title-row .hero-subtitle {
        flex: 1;
        text-align: right;
        margin-bottom: 0;
        font-size: 1.1rem;
        line-height: 1.2;
    }
    
    .badge-text {
        font-size: 0.85rem;
        padding: 0.7rem 1.8rem;
    }
    
    .quick-start-text {
        font-size: 0.85rem;
    }
    
    /* Section Spacing */
    section {
        padding: 2.5rem 0;
    }
    
    h2 {
        font-size: 2rem;
        margin-bottom: 1.2rem;
        font-weight: 700;
        color: #0F172A;
    }
    
    /* Interactive Rules Mobile */
    .interactive-rules {
        padding: 3rem 0;
    }
    
    .interactive-rules h2 {
        font-size: 2.5rem;
        margin-bottom: 0.8rem;
    }
    
    .rules-instruction {
        font-size: 1rem;
        margin-bottom: 2.5rem;
        padding: 0 1rem;
    }
    
    .flashcards-container {
        grid-template-columns: 1fr;
        gap: 1.8rem;
        padding: 0 1rem;
        display: grid;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .flashcard {
        height: 260px;
        margin: 0 auto;
        max-width: 380px;
        min-height: 260px;
        display: block;
        position: relative;
    }
    
    .card-content p {
        font-size: 1.1rem;
        line-height: 1.6;
        padding: 0 0.8rem;
        /* Better mobile readability */
        font-weight: 500;
    }
    
    .card-header {
        padding: 1.2rem 1.5rem 0;
    }
    
    .rule-number {
        font-size: 0.85rem;
        padding: 0.4rem 0.9rem;
    }
    
    .language-indicator {
        font-size: 0.75rem;
        padding: 0.25rem 0.7rem;
    }
    
    .flip-hint {
        font-size: 0.85rem;
    }
    
    /* Player Selector Mobile */
    .player-selector {
        padding: 3rem 0;
    }
    
    .player-selector h2 {
        font-size: 2.2rem;
        margin-bottom: 0.8rem;
    }
    
    .selector-instruction {
        font-size: 1rem;
        margin-bottom: 2.5rem;
        padding: 0 1rem;
    }
    
    .mode-selector {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.8rem;
        padding: 0 0.5rem;
    }
    
    .mode-button {
        padding: 1rem 0.8rem;
        border-radius: 12px;
        min-height: 100px;
        /* Ensure touch targets meet Apple's 44px minimum */
        touch-action: manipulation;
    }
    
    .mode-button h3 {
        font-size: 1rem;
        margin-bottom: 0.3rem;
    }
    
    .mode-button p {
        font-size: 0.8rem;
    }
    
    .mode-button.active h3 {
        color: white !important;
        font-weight: 600;
    }
    
    .mode-button.active p {
        color: rgba(255, 255, 255, 0.9) !important;
    }
    
    .avatar {
        width: 28px;
        height: 28px;
        border-width: 2px;
    }
    
    .avatar-more {
        width: 28px;
        height: 28px;
        border-width: 2px;
        font-size: 0.9rem;
    }
    
    /* Game Flow Mobile */
    .flow-header {
        padding: 1.5rem;
        border-radius: 12px;
        margin-bottom: 1.8rem;
    }
    
    .flow-header h3 {
        font-size: 1.3rem;
        color: white;
    }
    
    .step {
        flex-direction: row;
        align-items: flex-start;
        gap: 1.2rem;
        padding: 1.8rem 1.5rem;
        border-radius: 12px;
    }
    
    .step-number {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
        flex-shrink: 0;
        margin-top: 0.2rem;
    }
    
    .step-content .yoruba {
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: 0.8rem;
    }
    
    .step-content .english {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    /* Tips Mobile */
    .tips-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .tip-card {
        padding: 1.8rem 1.5rem;
        border-radius: 12px;
    }
    
    .tip-card h4 {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
    }
    
    .tip-card li {
        font-size: 0.9rem;
        padding: 0.4rem 0;
        line-height: 1.4;
        padding-left: 1.8rem;
    }
    
    .tip-card li::before {
        left: 0.3rem;
    }
    
    /* Enhanced sections mobile */
    .enhanced-bilingual-rules {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .enhanced-rule-item {
        padding: 2rem 1.5rem;
        border-radius: 16px;
    }
    
    .rule-icon {
        font-size: 2rem;
        margin-bottom: 0.8rem;
    }
    
    .rule-content h4 {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
    }
    
    .rule-content .yoruba {
        font-size: 1rem;
        margin-bottom: 0.6rem;
    }
    
    .rule-content .english {
        font-size: 0.9rem;
    }
    
    .learner-rules h2 {
        font-size: 2rem;
    }
    
    .learner-subtitle {
        font-size: 1.1rem;
    }
    
    .learner-intro {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    .game-overview h2 {
        font-size: 2rem;
    }
    
    .game-description {
        font-size: 1.1rem;
        padding: 1.5rem;
        margin: 0 1rem;
    }
    
    /* Footer Mobile */
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        text-align: left;
    }
    
    .footer-content a {
        color: #1B9C85;
        font-weight: 500;
    }
    
    .footer-content a:hover {
        color: #059669;
    }
    
    .footer-content h3 {
        font-size: 1rem;
        margin-bottom: 0.8rem;
    }
    
    .copyright {
        font-size: 0.85rem;
        padding-top: 1.5rem;
    }
    
    /* Main Page Mobile Optimizations */
    .cta-buttons {
        display: flex;
        flex-direction: row;
        gap: 0.8rem;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .cta-buttons-main {
        display: flex;
        flex-direction: row;
        gap: 0.8rem;
        justify-content: center;
        flex-wrap: wrap;
        width: 100%;
    }
    
    .cta-primary, .cta-secondary, .cta-large {
        flex: 1;
        max-width: 180px;
        min-width: 140px;
        min-height: 50px;
        padding: 1rem 1rem;
        font-size: 0.9rem;
        text-align: center;
        font-weight: 600;
        letter-spacing: 0.3px;
    }
    
    .cta-large {
        min-height: 54px;
        font-size: 1rem;
        padding: 1.2rem 1rem;
    }
    
    /* Game Highlights Mobile */
    .highlights-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin: 2rem 0;
    }
    
    .highlight-card {
        padding: 2rem 1.5rem;
        text-align: center;
    }
    
    .highlight-icon {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
    
    .highlight-card h3 {
        font-size: 1.2rem;
        margin-bottom: 0.8rem;
    }
    
    /* Media Gallery Mobile */
    .media-gallery {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .media-slot {
        border-radius: 16px;
    }
    
    .media-placeholder {
        padding: 2rem 1.5rem;
        min-height: 220px;
    }
    
    .placeholder-icon {
        font-size: 3rem;
        margin-bottom: 1rem;
    }
    
    .media-placeholder h4 {
        font-size: 1.2rem;
        margin-bottom: 0.6rem;
    }
    
    .media-placeholder p {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .coming-soon {
        padding: 0.4rem 1.2rem;
        font-size: 0.85rem;
    }
    
    .instagram-link {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Ready to Play Section Mobile */
    .ready-to-play {
        padding: 3rem 0;
    }
    
    .ready-to-play h2 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .ready-to-play .section-subtitle {
        font-size: 1rem;
        margin-bottom: 2.5rem;
        padding: 0 1rem;
    }
    
    .play-cta {
        padding: 0 1rem;
    }
    
    .cta-helper {
        font-size: 0.9rem;
        margin-top: 1rem;
    }
}

@media (max-width: 480px) {
    .logo-image {
        height: 40px;
    }
    
    .tagline {
        font-size: 0.85rem;
    }
    
    .hero-title {
        font-size: 2rem;
        letter-spacing: -0.5px;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .hero-description-box {
        padding: 1.5rem;
        margin: 0 0.5rem 2rem;
    }
    
    .hero-description.yoruba-text {
        font-size: 0.95rem;
    }
    
    .hero-description.english-text {
        font-size: 0.85rem;
    }
    
    .badge-text {
        font-size: 0.8rem;
        padding: 0.6rem 1.5rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    
    .flashcard {
        height: 240px;
        min-height: 240px;
        display: block;
        position: relative;
        width: 100%;
    }
    
    .card-content p {
        font-size: 1rem;
        line-height: 1.5;
        padding: 0 0.6rem;
        font-weight: 500;
    }
    
    .interactive-rules h2 {
        font-size: 2rem;
    }
    
    .rules-instruction {
        font-size: 1rem;
        padding: 0 0.5rem;
    }
    
    .card-header {
        padding: 1rem 1.2rem 0;
    }
    
    .card-footer {
        padding: 0.8rem 1.2rem;
    }
    
    .flip-hint {
        font-size: 0.8rem;
    }
    
    .mode-button h3 {
        font-size: 1.1rem;
    }
    
    .mode-button p {
        font-size: 0.8rem;
    }
    
    .mode-button.active h3 {
        color: white !important;
    }
    
    .mode-button.active p {
        color: rgba(255, 255, 255, 0.9) !important;
    }
    
    .avatar {
        width: 32px;
        height: 32px;
    }
    
    .avatar-more {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .step-content .yoruba {
        font-size: 1rem;
    }
    
    .step-content .english {
        font-size: 0.9rem;
    }
    
    /* Main Page Small Mobile Optimizations */
    .main-nav {
        gap: 0.8rem;
    }
    
    .rules-link {
        padding: 0.7rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .cta-primary, .cta-secondary, .cta-large {
        max-width: 160px;
        min-width: 120px;
        padding: 1rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .cta-large {
        font-size: 0.9rem;
        padding: 1.1rem 0.8rem;
    }
    
    .hero-title-row .hero-title {
        font-size: 1.6rem;
    }
    
    .hero-title-row .hero-subtitle {
        font-size: 0.95rem;
    }
    
    .highlight-card {
        padding: 1.5rem 1rem;
    }
    
    .highlight-icon {
        font-size: 2rem;
    }
    
    .highlight-card h3 {
        font-size: 1.1rem;
    }
    
    .highlight-card p {
        font-size: 0.9rem;
    }
    
    .media-placeholder {
        padding: 1.5rem 1rem;
        min-height: 200px;
    }
    
    .placeholder-icon {
        font-size: 2.5rem;
    }
    
    .media-placeholder h4 {
        font-size: 1.1rem;
    }
    
    .media-placeholder p {
        font-size: 0.85rem;
    }
    
    .ready-to-play h2 {
        font-size: 1.8rem;
    }
    
    .ready-to-play .section-subtitle {
        font-size: 0.95rem;
        padding: 0 0.5rem;
    }
    
    .section-subtitle {
        font-size: 0.95rem;
        padding: 0 0.5rem;
    }
}

/* Print Styles for QR Code Users */
@media print {
    header, footer, .hero {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .config-card, .tip-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .rule-section {
        page-break-inside: avoid;
    }
}

/* Mobile device optimizations */
.mobile-device .flashcard-inner {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    /* Enhanced 3D support for mobile */
    -webkit-transform-style: preserve-3d !important;
    transform-style: preserve-3d !important;
}

.mobile-device .flashcard {
    /* Disable floating animations on mobile */
    animation: none !important;
}

.mobile-device .flashcard-front,
.mobile-device .flashcard-back {
    /* Stronger backface hiding for mobile */
    -webkit-backface-visibility: hidden !important;
    backface-visibility: hidden !important;
    /* Ensure solid backgrounds */
    background-color: rgba(255, 255, 255, 1);
}

.mobile-device .flashcard-back {
    background: linear-gradient(135deg, #1B9C85 0%, #059669 100%) !important;
    background-color: #1B9C85 !important;
}

.low-end-device .flashcard,
.low-end-device .hero-badge,
.low-end-device .hero-title,
.low-end-device .hero-subtitle {
    animation: none !important;
}

.low-end-device .flashcard-inner {
    transition: transform 0.2s ease;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .config-card, .tip-card {
        border: 1px solid #000;
    }
    
    .flashcard-front, .flashcard-back {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .config-card, .tip-card, .flashcard {
        transition: none;
    }
    
    .config-card:hover, .tip-card:hover, .flashcard:hover {
        transform: none;
    }
    
    .flashcard-inner {
        transition: transform 0.1s ease !important;
    }
}

/* High refresh rate displays */
@media (min-resolution: 120dpi) {
    .flashcard-inner {
        transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    }
}