/* CSS Reset and Variables */
:root {
    --bg-dark: #f8f9fa;
    --bg-darker: #e9ecef;
    --neon-pink: #ff0055;
    --hot-pink: #ff1493;
    --pink-glow: rgba(255, 0, 85, 0.3);
    --text-light: #212529;
    --text-gray: #495057;
    --islamic-gold: #b8860b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Islamic Geometric Pattern with Dark Theme */
.background-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ff1493' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    z-index: -2;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 0%, var(--bg-darker) 100%);
    z-index: -1;
}

/* Header Section */
.main-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 2px solid var(--neon-pink);
    box-shadow: 0 4px 20px rgba(255, 0, 85, 0.3);
    background: #0f0f11; /* Sleek dark background */
}

.profile-section {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 20px;
    row-gap: 2px;
    align-items: center;
    text-align: right;
}

.profile-pic-container {
    position: relative;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    grid-row: 1 / span 2;
}

.demon-glow {
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--neon-pink), #8a2be2, #000);
    z-index: 1;
    animation: glow-pulse 2.5s infinite alternate;
    filter: blur(8px);
}

.profile-pic {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    z-index: 2;
    border: 2px solid #2a2a2a;
}

@keyframes glow-pulse {
    0% {
        opacity: 0.6;
        transform: scale(1);
    }
    100% {
        opacity: 1;
        transform: scale(1.08);
    }
}

.platform-title {
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #ffffff;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
    align-self: end;
    line-height: 1.2;
}

.accent-text {
    color: var(--neon-pink);
    text-shadow: 0 0 8px var(--pink-glow), 0 0 15px var(--pink-glow);
}

.subtitle {
    font-size: 0.95rem;
    color: var(--islamic-gold);
    font-weight: 700;
    opacity: 0.9;
    align-self: start;
    line-height: 1.2;
}

/* Main Content */
.content-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Dynamic Navigation Styles */
.hidden {
    display: none !important;
}

.grid-container, .lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    width: 100%;
}

/* Unit Buttons */
.unit-btn {
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid var(--neon-pink);
    border-radius: 15px;
    padding: 30px 20px;
    color: var(--text-light);
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
}

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

.unit-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--pink-glow);
    background: rgba(255, 20, 147, 0.1);
}

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

/* Lesson Cards (Kpop Demon Hunters Style) */
.lesson-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #ffffff, #f0f0f5);
    border: 1px solid rgba(255, 0, 85, 0.3);
    border-radius: 12px;
    padding: 20px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    text-align: right;
    position: relative;
    overflow: hidden;
}

.lesson-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--neon-pink);
    box-shadow: 0 8px 25px rgba(255, 0, 85, 0.4);
}

.lesson-card-number {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 0, 85, 0.1);
    border: 2px solid var(--neon-pink);
    border-radius: 50%;
    color: var(--neon-pink);
    font-size: 1.2rem;
    font-weight: bold;
    flex-shrink: 0;
    margin-left: 15px; /* RTL spacing */
    box-shadow: 0 0 10px rgba(255, 0, 85, 0.2);
}

.lesson-card-content {
    flex-grow: 1;
}

.lesson-card-content h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: #222;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.8);
    line-height: 1.4;
}

.lesson-card-icon {
    color: var(--islamic-gold);
    font-size: 1.2rem;
    opacity: 0.7;
    transition: all 0.3s ease;
    margin-right: 10px;
}

.lesson-card:hover .lesson-card-icon {
    opacity: 1;
    transform: translateX(-5px); /* Move left in RTL */
    color: var(--neon-pink);
}

/* Lessons Header and Back Button */
.lessons-header {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 0, 85, 0.3);
}

.unit-title {
    font-size: 2rem;
    color: var(--neon-pink);
    text-shadow: 0 0 10px rgba(255, 0, 85, 0.5);
}

.back-btn {
    background: transparent;
    border: 1px solid var(--text-gray);
    color: var(--text-gray);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border-color: var(--text-light);
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: rgba(255, 20, 147, 0.05);
    border: 1px dashed var(--neon-pink);
    border-radius: 15px;
    color: var(--text-gray);
    font-size: 1.2rem;
}

/* Lesson Content Styles */
.lesson-body {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--neon-pink);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    line-height: 1.8;
}

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

.lesson-section-title {
    color: var(--hot-pink);
    font-size: 1.8rem;
    margin-bottom: 20px;
    border-bottom: 2px dashed rgba(255, 20, 147, 0.3);
    padding-bottom: 10px;
    text-shadow: 0 0 5px rgba(255, 20, 147, 0.5);
}

.quran-text {
    font-family: 'Amiri Quran', 'Amiri', 'Cairo', serif;
    font-size: 2.2rem;
    color: var(--islamic-gold);
    text-align: center;
    line-height: 2.2;
    background: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.bismillah {
    text-align: center;
    color: #4CAF50;
    font-size: 1.8rem;
    margin-bottom: 15px;
}

/* Table Styles */
.lesson-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.6);
}

.lesson-table th {
    background: rgba(255, 0, 85, 0.2);
    color: var(--neon-pink);
    padding: 15px;
    border: 1px solid var(--neon-pink);
    font-size: 1.2rem;
}

.lesson-table td {
    padding: 15px;
    border: 1px solid rgba(255, 0, 85, 0.3);
    color: var(--text-light);
}

/* Lists */
.lesson-list {
    list-style: none;
    padding-right: 15px;
}

.lesson-list li {
    margin-bottom: 15px;
    position: relative;
}

.lesson-list li::before {
    content: '•';
    color: var(--neon-pink);
    position: absolute;
    right: -15px;
    font-size: 1.5rem;
    top: -5px;
}

/* Tabs Styles */
.lesson-tabs-header {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--neon-pink);
    color: var(--text-gray);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: rgba(255, 20, 147, 0.1);
    color: var(--text-light);
}

.tab-btn.active {
    background: var(--neon-pink);
    color: #fff;
    box-shadow: 0 0 15px var(--pink-glow);
    border-color: var(--hot-pink);
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

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

/* Discussion Accordion Styles (using details/summary) */
.discussion-details {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 0, 85, 0.3);
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 15px;
    transition: all 0.3s ease;
}

.discussion-details[open] {
    border-color: var(--neon-pink);
    box-shadow: 0 0 10px rgba(255, 0, 85, 0.2);
}

.discussion-summary {
    font-size: 1.2rem;
    color: var(--text-light);
    cursor: pointer;
    font-weight: bold;
    list-style: none; /* Hide default arrow */
    position: relative;
    padding-right: 25px; /* Space for custom arrow */
}

.discussion-summary::-webkit-details-marker {
    display: none;
}

.discussion-summary::before {
    content: '+';
    position: absolute;
    right: 0;
    color: var(--neon-pink);
    font-size: 1.5rem;
    line-height: 1;
    transition: transform 0.3s ease;
}

.discussion-details[open] .discussion-summary::before {
    content: '-';
    color: var(--hot-pink);
}

.discussion-answer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed rgba(255, 20, 147, 0.3);
    color: var(--islamic-gold);
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Audio & Memorization Controls */
.audio-controls {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
}

.audio-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-light);
    padding: 12px 25px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    border: 2px solid var(--neon-pink);
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 0, 85, 0.2);
}

.audio-btn:hover {
    background: rgba(255, 0, 85, 0.1);
    transform: scale(1.05);
}

.audio-btn.playing {
    background: var(--neon-pink);
    color: white;
    box-shadow: 0 0 20px var(--pink-glow);
}

.audio-btn.memorizing {
    background: var(--islamic-gold);
    color: #000;
    border-color: var(--islamic-gold);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

/* Verse Highlighting */
.verse {
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 5px;
    transition: all 0.3s ease;
    display: inline;
}

.verse:hover {
    background: rgba(255, 0, 85, 0.2);
}

.verse.playing-verse {
    background: rgba(255, 0, 85, 0.3);
    color: var(--neon-pink);
    text-shadow: 0 0 10px var(--pink-glow);
    font-weight: bold;
}

/* Memorization Timer */
.memo-timer-container {
    display: none;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-light);
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 15px auto 25px auto;
    border: 2px solid var(--islamic-gold);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    max-width: fit-content;
    text-align: center;
}

.memo-timer-container.active {
    display: block;
    animation: pulse-gold 1s infinite;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    background: #0f0f11;
    border-top: 1px solid var(--neon-pink);
    color: #a0a0a0;
    font-size: 1rem;
    box-shadow: 0 -5px 20px rgba(255, 0, 85, 0.1);
}

.site-footer p {
    margin: 0;
}

.footer-link {
    color: var(--neon-pink);
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
}

.footer-link:hover {
    color: var(--hot-pink);
    text-shadow: 0 0 8px var(--pink-glow);
}

@keyframes pulse-gold {
    0% { transform: scale(1); box-shadow: 0 0 15px rgba(255, 215, 0, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 25px rgba(255, 215, 0, 0.7); }
    100% { transform: scale(1); box-shadow: 0 0 15px rgba(255, 215, 0, 0.4); }
}

/* =========================================
   Memory Game Styles
   ========================================= */
.memory-game-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    border: 2px solid var(--neon-pink);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.memory-game-intro, .memory-game-win {
    text-align: center;
    margin-bottom: 20px;
}

.memory-game-intro h3, .memory-game-win h3 {
    color: var(--neon-pink);
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.start-game-btn {
    background: linear-gradient(45deg, var(--neon-pink), var(--hot-pink));
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--pink-glow);
    transition: transform 0.3s ease;
    margin-top: 15px;
}

.start-game-btn:hover {
    transform: scale(1.05);
}

.memory-game-board {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    width: 100%;
    max-width: 800px;
    perspective: 1000px;
}

.memory-card {
    width: calc(25% - 15px);
    height: 120px;
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.5s;
}

@media (max-width: 768px) {
    .memory-card {
        width: calc(33.33% - 15px);
        height: 100px;
    }
}

@media (max-width: 480px) {
    .memory-card {
        width: calc(50% - 15px);
        height: 100px;
    }
}

.memory-card.flipped {
    transform: rotateY(180deg);
}

.memory-card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
}

.memory-card-front, .memory-card-back {
    width: 100%;
    height: 100%;
    position: absolute;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    backface-visibility: hidden;
    padding: 10px;
    box-sizing: border-box;
    text-align: center;
}

.memory-card-front {
    background: linear-gradient(135deg, #1a1a1f, #0f0f11);
    border: 2px solid var(--neon-pink);
    font-size: 2.5rem;
    color: var(--neon-pink);
}

.memory-card-back {
    background: white;
    transform: rotateY(180deg);
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.memory-card-back.card-word {
    border: 2px solid var(--islamic-gold);
    color: var(--islamic-gold);
}

.memory-card-back.card-meaning {
    border: 2px solid var(--hot-pink);
    color: #333;
    font-size: 0.95rem;
}

.memory-card.matched .memory-card-back {
    background: rgba(46, 204, 113, 0.1);
    border-color: #2ecc71;
    color: #27ae60;
    animation: match-pulse 0.5s;
}

.memory-card.mismatched .memory-card-back {
    animation: shake 0.5s;
    background: rgba(231, 76, 60, 0.1);
    border-color: #e74c3c;
}

@keyframes match-pulse {
    0% { transform: rotateY(180deg) scale(1); }
    50% { transform: rotateY(180deg) scale(1.1); }
    100% { transform: rotateY(180deg) scale(1); }
}

@keyframes shake {
    0%, 100% { transform: rotateY(180deg) translateX(0); }
    25% { transform: rotateY(180deg) translateX(-5px); }
    75% { transform: rotateY(180deg) translateX(5px); }
}

/* =========================================
   Play and Learn Games Hub
   ========================================= */
.play-learn-wrapper {
    text-align: center;
    padding: 20px;
}

.play-learn-hub h3 {
    color: var(--neon-pink);
    font-size: 2rem;
    margin-bottom: 30px;
}

.games-grid {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.back-to-hub-btn {
    background: transparent;
    border: 2px solid var(--neon-pink);
    color: var(--neon-pink);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    margin-bottom: 20px;
    display: inline-block;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    font-weight: bold;
}

.back-to-hub-btn:hover {
    background: var(--neon-pink);
    color: #fff;
    box-shadow: 0 0 10px var(--pink-glow);
}

.game-card {
    background: rgba(255,255,255,0.9);
    border: 2px solid var(--islamic-gold);
    border-radius: 20px;
    padding: 30px;
    width: 250px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(255, 0, 85, 0.3);
    border-color: var(--neon-pink);
}

.game-card .game-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.game-card h4 {
    color: #333;
    font-size: 1.5rem;
    margin: 0;
}

/* =========================================
   Game 1: RPG Mode
   ========================================= */
.rpg-game {
    background: #111;
    border: 4px solid var(--neon-pink);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 0 20px var(--pink-glow);
    max-width: 800px;
    margin: 0 auto;
    color: #fff;
    font-family: 'Cairo', sans-serif;
}

.rpg-scene {
    height: 200px;
    background: linear-gradient(to bottom, #2b0038, #000);
    border-radius: 10px;
    border: 2px solid var(--islamic-gold);
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}

.rpg-hero {
    position: absolute;
    bottom: 20px;
    right: 30px;
    font-size: 5rem;
}

.rpg-monster {
    position: absolute;
    top: 30px;
    left: 40px;
    font-size: 6rem;
    transition: transform 0.2s;
}

.rpg-attack-effect {
    position: absolute;
    top: 50px;
    left: 50px;
    font-size: 8rem;
    z-index: 10;
    animation: flash 0.5s ease-out;
}

@keyframes flash {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

.rpg-dialogue {
    background: rgba(255, 255, 255, 0.95);
    color: #000;
    padding: 15px 25px;
    border-radius: 10px;
    border: 3px solid var(--islamic-gold);
    font-size: 1.3rem;
    font-weight: bold;
    min-height: 80px;
    margin-bottom: 20px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
}

.rpg-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rpg-btn {
    background: linear-gradient(90deg, #1a1a1a, #333);
    color: #fff;
    border: 2px solid var(--neon-pink);
    padding: 15px;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    text-align: right;
    transition: all 0.2s;
}

.rpg-btn:hover {
    background: var(--neon-pink);
    color: #fff;
    box-shadow: 0 0 10px var(--pink-glow);
}

.shake-anim {
    animation: shake-monster 0.5s;
}

@keyframes shake-monster {
    0%, 100% { transform: translateX(0) scale(1); }
    25% { transform: translateX(-10px) scale(0.9); filter: brightness(2) hue-rotate(90deg); }
    75% { transform: translateX(10px) scale(1.1); filter: brightness(0.5) hue-rotate(180deg); }
}

/* =========================================
   Game 2: Treasure Chest
   ========================================= */
.treasure-game {
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    border: 3px solid var(--islamic-gold);
    border-radius: 20px;
    padding: 30px;
    max-width: 900px;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.treasure-question {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    border-right: 5px solid var(--neon-pink);
}

.treasure-question h3 {
    color: #333;
    font-size: 1.5rem;
    margin: 0;
    line-height: 1.5;
}

.chest-container {
    text-align: center;
    margin-bottom: 40px;
}

.chest {
    font-size: 8rem;
    transition: all 0.5s ease;
}

.glow-anim {
    animation: chest-glow 1.5s ease-out;
}

@keyframes chest-glow {
    0% { transform: scale(1); filter: drop-shadow(0 0 0px var(--islamic-gold)); }
    50% { transform: scale(1.2); filter: drop-shadow(0 0 50px var(--neon-pink)); }
    100% { transform: scale(1); filter: drop-shadow(0 0 0px var(--islamic-gold)); }
}

.scrolls-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.scroll-item {
    background: #fff9e6;
    border: 2px solid #deb887;
    border-radius: 5px;
    padding: 15px;
    width: 250px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.1);
    position: relative;
}

.scroll-item::before, .scroll-item::after {
    content: '';
    position: absolute;
    left: -10px;
    right: -10px;
    height: 10px;
    background: #cdaa7d;
    border-radius: 5px;
}

.scroll-item::before { top: -5px; }
.scroll-item::after { bottom: -5px; }

.scroll-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    background: #fffdf5;
}

.scroll-icon {
    font-size: 2rem;
    display: block;
    text-align: center;
    margin-bottom: 10px;
}

.scroll-item p {
    font-size: 1.1rem;
    color: #4a3b2c;
    text-align: center;
    margin: 0;
    font-weight: bold;
}

/* =========================================
   Game 3: Puzzle Reveal
   ========================================= */
.puzzle-game {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.puzzle-board {
    position: relative;
    width: 100%;
    height: 400px;
    border-radius: 15px;
    overflow: hidden;
    border: 4px solid var(--neon-pink);
    box-shadow: 0 10px 30px rgba(255,0,85,0.2);
}

.puzzle-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    /* Generic beautiful Islamic pattern or landscape as requested */
    background: url('https://images.unsplash.com/photo-1584551246679-0daf3d275d0f?auto=format&fit=crop&q=80&w=800') center/cover no-repeat;
    z-index: 1;
}

.puzzle-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(10px);
    z-index: 2;
    transition: opacity 0.5s ease;
}

.puzzle-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    width: 80%;
    z-index: 10;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    border: 2px solid var(--islamic-gold);
    text-align: center;
}

.puzzle-modal h3 {
    color: var(--neon-pink);
    font-size: 1.6rem;
    margin-bottom: 25px;
    line-height: 1.4;
}

.puzzle-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.puzzle-btn {
    background: #fff;
    border: 2px solid #eee;
    padding: 15px;
    border-radius: 10px;
    font-size: 1.2rem;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Cairo', sans-serif;
    font-weight: bold;
}

.puzzle-btn:hover {
    border-color: var(--islamic-gold);
    background: rgba(255, 215, 0, 0.1);
    transform: scale(1.02);
}

.game-win-screen {
    text-align: center;
    background: rgba(255,255,255,0.9);
    padding: 40px;
    border-radius: 20px;
    border: 3px dashed var(--islamic-gold);
}

.game-win-screen h2 {
    color: var(--neon-pink);
    font-size: 3rem;
    margin-bottom: 10px;
}

.game-win-screen p {
    font-size: 1.5rem;
    color: #555;
    margin-bottom: 30px;
}

/* =========================================
   Game 4: Magic Portals
   ========================================= */
.portal-game {
    background: #050510;
    padding: 30px;
    border-radius: 20px;
    border: 3px solid #8a2be2;
    box-shadow: 0 0 30px rgba(138,43,226,0.3);
    max-width: 900px;
    margin: 0 auto;
    color: #fff;
    text-align: center;
}

.portal-question {
    font-size: 1.6rem;
    color: #00ffff;
    margin-bottom: 40px;
    text-shadow: 0 0 10px rgba(0,255,255,0.5);
}

.portals-container {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.portal-item {
    width: 250px;
    cursor: pointer;
    transition: transform 0.3s;
}

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

.portal-door {
    font-size: 6rem;
    animation: portal-spin 5s linear infinite;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px var(--neon-pink));
}

@keyframes portal-spin {
    100% { transform: rotate(360deg); }
}

.portal-label {
    background: rgba(255,255,255,0.1);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid var(--islamic-gold);
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
}

.portal-suck-anim {
    animation: suck-in 1s forwards;
}

@keyframes suck-in {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.5) rotate(180deg); filter: brightness(2); }
    100% { transform: scale(0) rotate(360deg); opacity: 0; }
}

/* =========================================
   Game 5: Energy Potions
   ========================================= */
.potion-game {
    background: linear-gradient(to bottom, #2b1055, #7597de);
    padding: 30px;
    border-radius: 20px;
    border: 4px solid var(--islamic-gold);
    max-width: 900px;
    margin: 0 auto;
    color: #fff;
    text-align: center;
}

.potion-question {
    background: rgba(0,0,0,0.5);
    padding: 20px;
    border-radius: 15px;
    font-size: 1.5rem;
    margin-bottom: 30px;
    border: 2px dashed var(--neon-pink);
}

.cauldron-area {
    margin-bottom: 40px;
}

.cauldron {
    font-size: 8rem;
    display: inline-block;
    transition: all 0.3s;
}

.potions-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.potion-bottle {
    width: 200px;
    cursor: pointer;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 20px;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.potion-bottle:hover {
    border-color: var(--neon-pink);
    transform: translateY(-10px);
    background: rgba(255,255,255,0.2);
}

.bottle-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.bottle-label {
    font-size: 1rem;
    font-weight: bold;
}

.pour-anim {
    animation: pour-potion 0.5s forwards;
}

@keyframes pour-potion {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-50px) rotate(-45deg); opacity: 0; }
}

.explode-anim {
    animation: cauldron-explode 1s forwards;
}

@keyframes cauldron-explode {
    0% { transform: scale(1); filter: drop-shadow(0 0 0px var(--neon-pink)); }
    50% { transform: scale(1.5); filter: drop-shadow(0 0 100px var(--neon-pink)) hue-rotate(90deg); }
    100% { transform: scale(1); filter: drop-shadow(0 0 20px var(--neon-pink)); }
}

/* =========================================
   Game 6: Spell Breaker (Runes)
   ========================================= */
.rune-game {
    background: #1a1a2e;
    padding: 40px;
    border-radius: 20px;
    border: 2px solid #16213e;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.magic-barrier {
    background: rgba(226, 43, 138, 0.2);
    border: 3px solid var(--neon-pink);
    border-radius: 15px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 0 30px rgba(226, 43, 138, 0.5);
    position: relative;
    overflow: hidden;
}

.magic-barrier h3 {
    color: #fff;
    font-size: 1.6rem;
    text-shadow: 0 0 10px var(--neon-pink);
    position: relative;
    z-index: 2;
}

.magic-barrier::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%; right: -50%; bottom: -50%;
    background: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,0.1) 10px, rgba(255,255,255,0.1) 20px);
    animation: barrier-move 10s linear infinite;
    z-index: 1;
}

@keyframes barrier-move {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.runes-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.rune-stone {
    background: #0f3460;
    border: 3px solid #e94560;
    border-radius: 50% 50% 10px 10px;
    padding: 30px 20px;
    width: 220px;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.5), 0 5px 15px rgba(0,0,0,0.3);
}

.rune-stone:hover {
    transform: translateY(-5px);
    box-shadow: inset 0 0 20px #e94560, 0 10px 25px rgba(233, 69, 96, 0.5);
}

.rune-text {
    color: #fff;
    font-size: 1.1rem;
    font-weight: bold;
    text-shadow: 0 0 5px #000;
}

.rune-glow-anim {
    animation: rune-glow 0.5s forwards;
}

@keyframes rune-glow {
    0% { filter: brightness(1); }
    50% { filter: brightness(2) contrast(1.5); }
    100% { filter: brightness(1); }
}

.barrier-break-anim {
    animation: shatter 1s forwards;
}

/* =========================================
   Game 7: Fortress Siege
   ========================================= */
.siege-game {
    background: linear-gradient(to bottom, #111, #4a0000);
    padding: 40px;
    border-radius: 20px;
    border: 4px solid #ff4500;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    color: #fff;
    overflow: hidden;
    position: relative;
}

.fortress {
    font-size: 8rem;
    margin-bottom: 20px;
    text-shadow: 0 0 20px #ff4500;
}

.fortress-shake {
    animation: shake-damage 0.5s;
    filter: sepia(1) hue-rotate(-50deg) saturate(3);
}

@keyframes shake-damage {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-15px) rotate(-5deg); }
    75% { transform: translateX(15px) rotate(5deg); }
}

.siege-question {
    font-size: 1.5rem;
    background: rgba(0,0,0,0.6);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 40px;
    border: 2px solid var(--islamic-gold);
}

.cannons-container {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.cannon-item {
    position: relative;
    cursor: pointer;
    width: 220px;
    transition: transform 0.2s;
}

.cannon-item:hover {
    transform: scale(1.1);
}

.cannon-icon {
    font-size: 4rem;
    margin-bottom: 10px;
    filter: drop-shadow(0 5px 5px rgba(0,0,0,0.5));
}

.cannon-label {
    background: #333;
    color: #fff;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid #555;
    font-weight: bold;
}

.cannon-fire {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3rem;
    z-index: 10;
}

.fire-anim {
    animation: shoot-up 1s forwards;
}

@keyframes shoot-up {
    0% { transform: translate(-50%, 0) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -200px) scale(2); opacity: 0; }
}

/* =========================================
   Game 8: Magic Sword
   ========================================= */
.sword-game {
    background: radial-gradient(circle, #2a2a4a 0%, #0d0d1a 100%);
    padding: 40px;
    border-radius: 20px;
    border: 3px solid #6495ed;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.sword-question {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 30px;
    text-shadow: 0 0 10px #6495ed;
}

.sword-stone {
    position: relative;
    height: 200px;
    margin-bottom: 50px;
}

.sword {
    font-size: 8rem;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    transition: all 0.5s;
    filter: drop-shadow(0 0 5px #fff);
}

.stone {
    font-size: 6rem;
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

.sword-pull-anim {
    transform: translate(-50%, -50px) rotate(15deg);
    filter: drop-shadow(0 0 30px var(--neon-pink)) brightness(1.5);
}

.elements-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.element-stone {
    background: rgba(255,255,255,0.05);
    border: 2px solid #aaa;
    border-radius: 15px;
    padding: 20px;
    width: 220px;
    cursor: pointer;
    transition: all 0.3s;
}

.element-stone:hover {
    background: rgba(255,255,255,0.1);
    border-color: #fff;
    box-shadow: 0 0 15px #fff;
}

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

.element-label {
    color: #fff;
    font-weight: bold;
}

.element-drain-anim {
    animation: drain-energy 1s forwards;
}

@keyframes drain-energy {
    0% { filter: brightness(1); transform: scale(1); }
    50% { filter: brightness(2); transform: scale(0.9); }
    100% { filter: brightness(0.2) grayscale(1); transform: scale(1); }
}

/* =========================================
   Game 9: Lost Crystal
   ========================================= */
.crystal-game {
    background: #000;
    padding: 50px;
    border-radius: 20px;
    border: 2px solid #444;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    transition: background 1.5s ease;
}

.cave-light-anim {
    background: radial-gradient(circle, #fff 0%, #00ffff 30%, #000 100%);
    border-color: #00ffff;
}

.crystal-question {
    color: #eee;
    font-size: 1.5rem;
    margin-bottom: 50px;
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 10px;
}

.crystals-container {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.crystal-item {
    cursor: pointer;
    width: 200px;
    transition: transform 0.3s;
}

.crystal-item:hover {
    transform: translateY(-15px);
}

.crystal-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 5px rgba(255,255,255,0.3));
    transition: filter 0.5s;
}

.crystal-shine-anim {
    filter: drop-shadow(0 0 50px #fff) brightness(2) contrast(1.5);
    animation: float-crystal 1s infinite alternate;
}

@keyframes float-crystal {
    0% { transform: translateY(0); }
    100% { transform: translateY(-10px); }
}

.crystal-label {
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #777;
    font-weight: bold;
}

