/* لعبة ترتيب الآيات - Ayakids */
/* Setup Screen */
.setup-screen {
    min-height: 100vh;
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    padding: 120px 20px 60px;
    position: relative;
    overflow: hidden;
}


.setup-header {
    background: linear-gradient(135deg, #667EEA, #764BA2);
    color: white;
    padding: 50px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.setup-icon {
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    font-size: 3rem;
    backdrop-filter: blur(10px);
    animation: brainBounce 2s ease-in-out infinite;
}

@keyframes brainBounce {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-10px) rotate(-5deg);
    }

    75% {
        transform: translateY(-10px) rotate(5deg);
    }
}

.setup-header h1 {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 15px;
}

.setup-header p {
    font-size: 1.3rem;
    opacity: 0.95;
}

/* الخلفية المتحركة */
.animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: -1;
    overflow: hidden;
}

.star-pattern {
    position: absolute;
    color: rgba(255, 255, 255, 0.1);
    font-size: 2rem;
    animation: float 6s ease-in-out infinite;
}

.pattern-1 {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.pattern-2 {
    top: 20%;
    right: 15%;
    animation-delay: 1s;
}

.pattern-3 {
    bottom: 30%;
    left: 20%;
    animation-delay: 2s;
}

.pattern-4 {
    top: 50%;
    right: 10%;
    animation-delay: 3s;
}

.pattern-5 {
    bottom: 20%;
    right: 25%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

/* شاشة البداية */
.start-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.start-content {
    text-align: center;
    max-width: 800px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.game-icon {
    position: relative;
    display: inline-block;
    font-size: 4rem;
    color: #667eea;
    margin-bottom: 1.5rem;
}

.icon-sparkle {
    position: absolute;
    font-size: 1rem;
    animation: sparkle 2s ease-in-out infinite;
}

.sparkle-1 {
    top: -10px;
    right: -10px;
    animation-delay: 0s;
}

.sparkle-2 {
    bottom: -10px;
    left: -10px;
    animation-delay: 0.5s;
}

.sparkle-3 {
    top: 50%;
    left: -20px;
    animation-delay: 1s;
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0);
    }

    50% {
        opacity: 1;
        transform: scale(1);
    }
}

.game-title {
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.5rem;
    font-weight: 800;
    display: block;
    margin-bottom: 0.5rem;
}

.title-decoration {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.decoration-line {
    height: 2px;
    width: 50px;
    background: linear-gradient(90deg, transparent, #667eea, transparent);
}

.decoration-icon {
    color: #667eea;
}

.game-description {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* اختيار المستوى */
.level-selection, .surah-selection {
    margin-bottom: 2rem;
}

.selection-title {
    color: #333;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.level-cards, .surah-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.level-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    border: 2px solid #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.level-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.level-card.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: #667eea;
    transform: scale(1.05);
}

.level-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
}

.level-icon.easy {
    background: #28a745;
    color: white;
}

.level-icon.medium {
    background: #ffc107;
    color: white;
}

.level-icon.hard {
    background: #dc3545;
    color: white;
}

.level-card h4 {
    margin: 0.5rem 0;
    font-weight: 700;
}

.level-card p {
    color: #666;
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.level-badge {
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.recommended-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #ffc107;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    animation: pulse 2s infinite;
}

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

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

/* اختيار السورة */
.surah-btn {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
}

.surah-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.surah-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* أزرار */
.start-button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 1rem 3rem;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.start-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.button-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shine 3s infinite;
}

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

    100% {
        left: 100%;
    }
}

/* شاشة اللعب */
.game-screen {
    min-height: 100vh;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.95);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-info {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.info-card {
    background: white;
    border-radius: 15px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    min-width: 150px;
}

.timer-card {
    position: relative;
    overflow: hidden;
}

.timer-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: #28a745;
    transition: width 1s linear;
}

.info-card i {
    font-size: 2rem;
    color: #dbad2b;
}

.info-content {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 0.8rem;
    color: #666;
    font-weight: 600;
}

.info-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.action-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.hint-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
}

/* منطقة اللعب */
.play-area {
    margin-bottom: 2rem;
}

.sorting-container {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.area-title {
    color: #333;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ayahs-sortable {
    display: grid;
    gap: 1rem;
    min-height: 200px;
}

.ayah-item {
    background: linear-gradient(135deg, #F9FAFB, #FFFFFF);
    border: 3px dashed #D1D5DB;
    border-radius: 20px;
    padding: 3px;
    cursor: grab;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ayah-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: #dbad2b;
}

.ayah-item .ayah-number {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 35px;
    height: 35px;
    background: #dbad2b;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1rem;
}

.ayah-item .ayah-text {
    font-family: 'Amiri', serif;
    font-size: 1.3rem;
    line-height: 2;
    color: #1F2937;
    text-align: center;
    padding-top: 10px;
}

.ayah-item.dragging {
    opacity: 0.5;
    transform: scale(1.05);
}

.ayah-item.correct {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border-color: #28a745;
    color: #155724;
}

.ayah-item.incorrect {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border-color: #dc3545;
    color: #721c24;
    animation: shake 0.5s;
}

.check-button, .reset-btn {
    background: linear-gradient(135deg, var(--success-green), #34D399);
    color: white;
    border: none;
    border-radius: 60px;
    padding: 14px 41px;
    font-size: 1.1rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 15px 40px rgba(16, 185, 129, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}
@media(max-width:991px){
    .check-button, .reset-btn{
       padding: 10px 10px !important;
       font-size: .8rem !important;
    }
}
.reset-btn {
    background: linear-gradient(90deg, #dbad2b, #f4d03f);
}

.game-controls {
    display: flex;
    margin: auto;
    justify-content: center;
    margin-top: 20px;
}

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

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

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

/* زر التحقق */
.check-button-container {
    text-align: center;
}

.check-button {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.check-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(40, 167, 69, 0.3);
}

/* شاشة النتيجة */
.result-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    /* مهم: إخفاء افتراضي */
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(10px);
}

.result-screen.show {
    display: flex;
    /* إظهار عند الإضافة */
}

.result-content {
    text-align: center;
    max-width: 600px;
    background: white;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.result-title {
    color: #28a745;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.result-message {
    color: #666;
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

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

.stat-item {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
}

.stat-item i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.result-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.result-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

/* منطقة عرض الصور والآيات */
.ayah-images-preview {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    text-align: center;
}

.ayah-images-preview h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: 700;
}

.selected-ayahs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.ayah-image-item {
    background: white;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.ayah-image-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.ayah-image-item img {
    width: 100px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
}

.ayah-image-item p {
    margin: 5px 0 0 0;
    font-size: 0.9rem;
    color: #555;
    font-weight: 600;
}

.area-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1F2937;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .start-content, .result-content {
        padding: 2rem 1.5rem;
    }

    .game-header {
        flex-direction: column;
        align-items: center;
    }

    .header-info {
        justify-content: center;
    }

    .level-cards, .surah-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ayahs-sortable {
        grid-template-columns: 1fr;
    }

    .result-actions {
        flex-direction: column;
        align-items: center;
    }

    .result-btn {
        width: 100%;
        max-width: 200px;
    }
    .area-title{
        font-size: 1rem;
    }
    .ayah-item .ayah-text{
        font-size: 1rem;
        padding-top: 4px;
    }
    .result-content{
        min-width: 95%;
    }
    .result-actions{
        flex-direction: row;
    }
}

@media (max-width: 480px) {
    .gradient-text {
        font-size: 2rem;
    }

    .level-cards, .surah-grid {
        grid-template-columns: 1fr;
    }

    .info-card {
        min-width: 100px;
        padding: 0.75rem;
    }

    .ayah-item {
        padding: 1rem;
        font-size: 1rem;
    }
    .game-screen{
        padding: 2rem .5rem;
    }

    .header-info{
        gap: .3rem;
    }
}


/* ========================================
   GAME CONTROLS (Fullscreen & Share)
======================================== */
.game-controls {
    display: flex !important;
    gap: 10px;
    margin: 0 15px;
}

.btn-control {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    padding: 0 !important;
}

.btn-control:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-control:active {
    transform: scale(0.95);
}

.btn-control i {
    font-size: 16px;
}

/* ========================================
   FULLSCREEN MODE STYLES
======================================== */
.game-screen:fullscreen {
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    padding: 0;
    overflow: auto;
}

.game-screen:fullscreen .game-header {
    position: fixed;
    top: 0 !important;
    left: 0;
    right: 0;
    z-index: 100;
}
.game-screen:fullscreen .ayahs-section{
    margin-top: 100px;
}
/* ========================================
   SHARE MODAL - BASE STYLES
======================================== */
.share-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.share-modal.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.share-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.share-title {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
}

.share-subtitle {
    color: #7f8c8d;
    margin-bottom: 30px;
    font-size: 14px;
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.share-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.share-btn:hover {
    border-color: #667eea;
    background: #f8f9fa;
    transform: translateY(-3px);
}

.share-btn i {
    font-size: 24px;
}

.share-btn.whatsapp { color: #25d366; }
.share-btn.facebook { color: #1877f2; }
.share-btn.twitter { color: #1da1f2; }
.share-btn.copy { color: #6c757d; }

.share-btn span {
    font-size: 12px;
    font-weight: 500;
    color: #2c3e50;
}

.share-link-box {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.share-link-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 14px;
    direction: ltr;
    text-align: left;
}

.share-link-copy {
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

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

.share-close {
    margin-top: 20px;
    padding: 12px 30px;
    background: #e9ecef;
    color: #6c757d;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.share-close:hover {
    background: #dee2e6;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #28a745;
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    font-weight: bold;
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.3);
    z-index: 10001;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
