/* Eritrean/Ethiopian Christian Aesthetic with Live Background */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    background: 
        linear-gradient(135deg, rgba(139, 0, 0, 0.1) 0%, rgba(255, 215, 0, 0.1) 100%),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" opacity="0.05"><path d="M50 10 L60 40 L90 40 L65 60 L75 90 L50 70 L25 90 L35 60 L10 40 L40 40 Z" fill="%238B0000"/></svg>'),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" opacity="0.03"><rect x="45" y="10" width="10" height="80" fill="%23FFD700"/><rect x="10" y="45" width="80" height="10" fill="%23FFD700"/></svg>');
    background-color: #f9f5e9;
    color: #2c3e50;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow-x: hidden;
    touch-action: pan-y; /* Allow vertical scrolling but prevent horizontal */
}

/* Enhanced Floating Elements */
body::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: 
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M50 10 L60 40 L90 40 L65 60 L75 90 L50 70 L25 90 L35 60 L10 40 L40 40 Z" fill="%238B000022"/></svg>') 0 0 repeat,
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="none" stroke="%23FFD70022" stroke-width="2"/></svg>') 0 0 repeat;
    animation: float 20s linear infinite;
    z-index: -1;
    opacity: 0.6;
}

.logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid #FFD700;
    margin-right: 15px;
    object-fit: cover;
    z-index: 1;
    transition: all 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Video Background Layer */
.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

.video-background video {
    min-width: 100%;
    min-height: 100%;
    object-fit: cover;
    opacity: 0.15;
}

/* Animated Gif Background Layer */
.gif-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: url('path/to/your/ethiopian-pattern.gif') center/cover no-repeat;
    opacity: 0.1;
    animation: subtlePulse 30s infinite alternate;
}

@keyframes subtlePulse {
    0% { opacity: 0.08; }
    100% { opacity: 0.15; }
}

/* Enhanced Header */
.header {
    position: relative;
    background: 
        linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
        url("../../assets/images/AbuneYemaeta.gif") center/cover no-repeat;
    color: white;
    padding: 10px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border-bottom: 3px solid var(--ethiopian-gold);
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" opacity="0.1"><path d="M50 10 L60 40 L90 40 L65 60 L75 90 L50 70 L25 90 L35 60 L10 40 L40 40 Z" fill="%23FFD700"/></svg>');
    pointer-events: none;
}

/* Animated Ethiopian Crosses Floating */
.floating-cross {
    position: absolute;
    width: 40px;
    height: 40px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect x="45" y="10" width="10" height="80" fill="%23FFD700"/><rect x="10" y="45" width="80" height="10" fill="%23FFD700"/></svg>') no-repeat;
    background-size: contain;
    opacity: 0.3;
    animation: floatCross 25s infinite linear;
    z-index: -1;
}

@keyframes floatCross {
    0% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0.3;
    }
    25% {
        transform: translate(50vw, 25vh) rotate(90deg);
    }
    50% {
        transform: translate(75vw, 50vh) rotate(180deg);
        opacity: 0.1;
    }
    75% {
        transform: translate(25vw, 75vh) rotate(270deg);
    }
    100% {
        transform: translate(0, 0) rotate(360deg);
        opacity: 0.3;
    }
}

/* Grid Layout */
.container {
    display: grid;
    grid-template-areas:
        "header header header"
        "menu main-content resource"
        "feed main-content resource"
        "footer footer footer";
    grid-template-columns: 20% 1fr 25%;
    grid-template-rows: auto 1fr auto;
    gap: 10px;
    padding: 80px 10px 60px;
    min-height: 100vh;
    width: 100%;
}

.header { grid-area: header; }
.menu { grid-area: menu; }
.main-content { grid-area: main-content; }
.resource { grid-area: resource; }
.feed { grid-area: feed; }
.footer { grid-area: footer; }

/* Shared Styles for Main Content, Resource, and Feed */
.main-content, .resource, .feed {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Footer */
.footer {
    position: relative;
    bottom: auto;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 20px;
    text-align: center;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    margin-top: auto;
}

/* Updated Main Menu */
#main-menu {
    position: fixed;
    top: 0;
    left: 10px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 10px 0;
}

/* Menu items visible by default */
.menu-dropdown {
    display: flex;
    flex-direction: column;
    gap: 5px;
    justify-content: center;
    background-color: white;
    padding: 10px;
    border-radius: 5px;
    transition: background-color 0.3s ease, max-height 0.3s ease-out, visibility 0.3s ease-out;
}

/* Menu buttons */
.menu-button {
    padding: 12px 20px;
    text-decoration: none;
    color: #333;
    font-weight: bold;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.menu-button:hover {
    background: #4CAF50;
    color: white;
}

/* Mode Selection Buttons */
#mode-selection {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

.mode-button {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.mode-button.active {
    background-color: #45a049;
}

.mode-button:hover {
    background-color: #388e3c;
}

/* Hide elements based on mode */
.hidden {
    display: none;
}

/* Updated Alphabet Grid */
.grid-container {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 25px;
    margin: 2rem auto;
    max-width: 1200px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 20px;
    backdrop-filter: blur(5px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.button {
    font-size: 2.5rem;
    padding: 1.5rem;
    border: none;
    border-radius: 15px;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, 
        rgba(76, 175, 80, 0.1) 0%,
        rgba(76, 175, 80, 0.2) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.button:hover::before {
    opacity: 1;
}

/* Row Layout for Sections */
.row-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 20px;
    gap: 40px;
}

/* Styling for Alphabet Section */
#alphabet-section {
    width: 90%;
    max-width: 800px;
    padding: 20px;
    background: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    text-align: center;
}

/* Styling for Fill in the Blanks Section */
#fill-blanks-section {
    width: 90%;
    max-width: 800px;
    padding: 20px;
    background: #f9f9f9;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    text-align: center;
}

/* Updated Next Button */
#next-alphabet {
    margin: 2rem auto;
    padding: 1rem 3rem;
    background: linear-gradient(145deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 2;
}

#next-alphabet:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2);
}

#next-alphabet:disabled {
    background: linear-gradient(145deg, #cccccc, #b3b3b3);
    cursor: not-allowed;
    opacity: 0.7;
}

/* Updated Letter Animations */
@keyframes grow {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.letter-animation {
    animation: grow 0.5s ease-out forwards;
}

.button {
    transform: scale(1);
}

/* Floating Cloud Effect */
.cloud {
    position: absolute;
    background: white;
    border-radius: 20px;
    animation: cloudFloat 30s infinite linear;
    opacity: 0.8;
    z-index: -1;
}

@keyframes cloudFloat {
    0% { transform: translateX(-100%) translateY(0); }
    100% { transform: translateX(100vw) translateY(-20px); }
}

.cloud.small { width: 80px; height: 30px; }
.cloud.medium { width: 120px; height: 40px; }
.cloud.large { width: 160px; height: 50px; }

/* Updated Footer */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.1);
    padding: 10px 0;
    text-align: center;
}

.feedback-link a {
    padding: 12px 25px;
    background: linear-gradient(145deg, #4CAF50, #45a049);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.feedback-link a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Section Management */
.section {
    display: none;
    flex-direction: column;
    align-items: center;
}

.section.active {
    display: flex;
}

#alphabet-grid, #draggable-letters, #blank-space {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 20px;
}

/* ========== DRAG AND DROP FIXES ========== */
#draggable-letters {
    touch-action: none; /* Prevent scrolling when dragging */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    min-height: 100px;
    padding: 15px;
    background: rgba(249, 249, 249, 0.8);
    border-radius: 10px;
    margin: 20px 0;
}

.draggable {
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    cursor: grab;
    position: relative;
    z-index: 1000;
    transition: all 0.2s ease;
    padding: 15px 20px;
    margin: 8px;
    background: linear-gradient(145deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
}

.draggable:active {
    cursor: grabbing;
}

.draggable.dragging {
    z-index: 10000;
    opacity: 0.9;
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.draggable:hover {
    background: linear-gradient(145deg, #45a049, #4CAF50);
    transform: translateY(-2px);
}

.draggable.used {
    opacity: 0.4;
    cursor: not-allowed;
    transform: scale(0.9);
    background: #cccccc;
}

/* Blank Spaces */
#blank-space {
    display: flex;
    gap: 15px;
    margin: 25px 0;
    flex-wrap: wrap;
    justify-content: center;
    touch-action: none;
    min-height: 120px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    border: 2px dashed #ddd;
}

.blank, .fixed {
    padding: 15px 25px;
    border: 3px solid #ccc;
    border-radius: 10px;
    min-width: 60px;
    min-height: 70px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    transition: all 0.3s ease;
    background: white;
}

.blank {
    background: #f8f9fa;
    border-style: dashed;
}

.fixed {
    background: #e9ecef;
    border-style: solid;
}

/* Drop Zone States */
.blank.drag-over {
    background-color: #e8f5e8 !important;
    border: 3px dashed #4CAF50 !important;
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

.blank.correct {
    background-color: #e8f5e8 !important;
    border: 3px solid #4CAF50 !important;
    color: #2e7d32;
}

.blank.incorrect {
    background-color: #ffebee !important;
    border: 3px solid #f44336 !important;
    color: #c62828;
}

.blank.filled {
    background-color: #e3f2fd !important;
    border: 3px solid #2196F3 !important;
}

/* Score and Feedback */
#total-score, #score {
    font-size: 1.3rem;
    font-weight: bold;
    margin: 15px 0;
    padding: 10px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#total-value, #score-value {
    color: #4CAF50;
    font-size: 1.4rem;
}

/* Buttons */
#check-answer, #next-exercise {
    margin: 10px;
    padding: 12px 25px;
    font-size: 1.1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#check-answer {
    background: linear-gradient(145deg, #2196F3, #1976D2);
    color: white;
}

#check-answer:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.3);
}

#next-exercise {
    background: linear-gradient(145deg, #FF9800, #F57C00);
    color: white;
}

#next-exercise:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 152, 0, 0.3);
}

#check-answer:disabled, #next-exercise:disabled {
    background: #cccccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* No Scroll Fix */
.no-scroll {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Family Tree Layout */
#family-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
}

.family-layer {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.family-branch {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.family-block {
    padding: 10px;
    border: 2px solid #333;
    border-radius: 5px;
    text-align: center;
    background-color: #f9f9f9;
    min-width: 100px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 100px;
    margin: 5px;
}

#player {
    background-color: #4CAF50;
    color: white;
    font-weight: bold;
}

/* Word Bank */
.word-bank {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.draggable-word {
    padding: 10px;
    border: 2px solid #333;
    border-radius: 5px;
    background-color: #f0f0f0;
    cursor: grab;
    flex: 1 1 100px;
    text-align: center;
}

/* Color Boxes */
.color-boxes {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.color-box {
    width: 100px;
    height: 100px;
    border: 2px solid #333;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

/* Switch Buttons */
.switch-buttons {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.column {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.column h3 {
    margin-top: 0;
}

.top-right-image {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 100px;
    height: auto;
    border-radius: 50%;
    border: 2px solid #fff;
}

h1, h2, h3 {
    text-align: center;
}

ul {
    list-style-type: none;
    padding: 0;
}

li {
    padding: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

li:hover {
    background-color: #e0e0e0;
}

#form-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px;
}

#form-container h2 {
    margin-bottom: 10px;
}

#form-container label {
    display: block;
    margin-bottom: 5px;
}

#form-container input {
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    width: 100%;
}

#form-container button {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#form-container button:hover {
    background-color: #45a049;
}

/* Resource Upload Section */
#upload-section {
    margin-bottom: 40px;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#upload-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#upload-form input[type="file"] {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: #f9f9f9;
    font-size: 1rem;
}

#upload-form button {
    padding: 10px;
    background: #2c3e50;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
}

#upload-form button:hover {
    background: #34495e;
}

#upload-status {
    margin-top: 10px;
    font-size: 0.9rem;
}

#upload-status .success {
    color: #27ae60;
}

#upload-status .error {
    color: #e74c3c;
}

/* Resource List Section */
#resource-list-section {
    margin-bottom: 40px;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.resource-list {
    margin-top: 20px;
}

.resource-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-bottom: 10px;
    background: #f9f9f9;
    transition: box-shadow 0.3s ease;
}

.resource-item:hover {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.resource-item a {
    color: #2c3e50;
    text-decoration: none;
    font-size: 1rem;
}

.resource-item a:hover {
    text-decoration: underline;
}

.resource-item button {
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.resource-item button:hover {
    background: #c0392b;
}

/* Lessons Sections */
#lessons {
    margin-bottom: 40px;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.lesson-section {
    margin-bottom: 20px;
}

.lesson-section h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.lesson-section ul {
    list-style-type: none;
    padding: 0;
}

.lesson-section ul li {
    padding: 5px 0;
}

.lesson-section ul li a {
    color: #2c3e50;
    text-decoration: none;
    font-size: 1rem;
}

.lesson-section ul li a:hover {
    text-decoration: underline;
}

/* Grid Layout for Resource Container */
.resource-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
}

.grid-item {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Specific Grid Placement for Sections */
#upload-section {
    grid-column: 1 / -1;
}

#lessons {
    grid-column: 1 / -1;
}

/* Main Content */
main {
    flex: 1;
    padding-top: 80px;
    padding-bottom: 80px;
    margin: 0 auto;
    width: 90%;
    max-width: 800px;
    min-height: calc(100vh - 160px);
}

/* Animations */
@keyframes float {
    0% { transform: translateY(0) translateX(0); }
    25% { transform: translateY(-20px) translateX(10px); }
    50% { transform: translateY(0) translateX(20px); }
    75% { transform: translateY(20px) translateX(-10px); }
    100% { transform: translateY(0) translateX(0); }
}

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

.letter-animation {
    animation: fadeIn 0.5s ease-out;
}

/* Animated Floating Elements */
.floating-element {
    position: absolute;
    pointer-events: none;
    animation: floatElement 15s infinite linear;
    opacity: 0.6;
}

@keyframes floatElement {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0.3;
    }
    100% {
        transform: translateY(-200vh) rotate(720deg);
        opacity: 0;
    }
}

/* Keyboard Container */
.keyboard-container {
    margin-top: 20px;
    text-align: center;
}

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

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
    body {
        background-size: auto, 150px 150px, 100px 100px;
        font-family: 'Roboto', sans-serif;
        font-size: 16px;
        touch-action: pan-y; /* Ensure vertical scrolling only */
    }
    
    .header {
        min-height: 150px;
        flex-direction: column;
        padding: 15px;
    }
    
    .logo {
        width: 60px;
        height: 60px;
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .header h1 {
        font-size: 1.4rem;
        max-width: 70%;
    }
    
    /* Reduce animation intensity on mobile */
    .floating-cross {
        width: 25px;
        height: 25px;
        animation-duration: 40s;
    }
    
    .video-background video {
        display: none;
    }
    
    .gif-background {
        animation: none;
        opacity: 0.05;
    }
    
    /* Mobile menu */
    .menu-toggle {
        display: block;
        background: #4CAF50;
        color: white;
        border: none;
        padding: 10px;
        font-size: 1.5rem;
        cursor: pointer;
        border-radius: 5px;
        margin-bottom: 5px;
    }

    .menu-dropdown {
        display: none;
        max-height: 0;
        overflow: hidden;
        visibility: hidden;
        background-color: white;
    }

    .menu-dropdown.open {
        display: flex;
        max-height: 500px;
        visibility: visible;
        background-color: white;
    }
    
    /* Adjust grid layout */
    .container {
        grid-template-areas:
            "header"
            "menu"
            "main-content"
            "resource"
            "feed"
            "footer";
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr auto auto auto;
    }
    
    .grid-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .button {
        font-size: 2rem;
        padding: 1rem;
    }
    
    #next-alphabet {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
    
    .floating-element {
        width: 50px;
        height: 50px;
    }
    
    /* Mobile drag and drop optimizations */
    .draggable {
        min-width: 70px;
        min-height: 70px;
        padding: 18px;
        font-size: 1.8rem;
        margin: 6px;
    }
    
    .blank, .fixed {
        min-width: 70px;
        min-height: 80px;
        font-size: 1.8rem;
        padding: 18px 22px;
    }
    
    #draggable-letters, #blank-space {
        gap: 12px;
        margin: 15px 0;
        padding: 15px;
    }
    
    #draggable-letters {
        min-height: 120px;
    }
    
    #blank-space {
        min-height: 140px;
    }
    
    /* Family tree mobile adjustments */
    .family-layer {
        gap: 10px;
    }

    .family-branch {
        gap: 5px;
    }

    .family-block {
        min-width: 80px;
        min-height: 40px;
        font-size: 0.9rem;
    }

    .draggable-word {
        min-width: 80px;
        font-size: 0.9rem;
    }
    
    h1, h2, h3 {
        font-family: 'Playfair Display', 'Times New Roman', serif;
        font-weight: 700;
        line-height: 1.2;
    }

    code {
        font-family: 'Source Code Pro', monospace;
        font-size: 14px;
    }
}

@media (max-width: 600px) {
    .menu-button {
        flex: 1 1 100%;
        text-align: center;
    }

    #main-menu {
        flex-direction: column;
    }

    .grid-container {
        grid-template-columns: 1fr;
    }
    
    .draggable {
        min-width: 60px;
        min-height: 60px;
        font-size: 1.6rem;
        padding: 15px;
    }
    
    .blank, .fixed {
        min-width: 60px;
        min-height: 70px;
        font-size: 1.6rem;
        padding: 15px 18px;
    }
}