/* ========================================
   FLIP CARDS GAME - STACKED CARDS STYLE
======================================== */

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

/* Animated Background Bubbles */
.animated-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    animation: floatBubble 15s infinite ease-in-out;
}

.bubble-1 {
    width: 80px;
    height: 80px;
    left: 10%;
    bottom: -80px;
    animation-delay: 0s;
    animation-duration: 12s;
}

.bubble-2 {
    width: 120px;
    height: 120px;
    left: 30%;
    bottom: -120px;
    animation-delay: 2s;
    animation-duration: 15s;
}

.bubble-3 {
    width: 60px;
    height: 60px;
    left: 50%;
    bottom: -60px;
    animation-delay: 4s;
    animation-duration: 18s;
}

.bubble-4 {
    width: 100px;
    height: 100px;
    left: 70%;
    bottom: -100px;
    animation-delay: 1s;
    animation-duration: 14s;
}

.bubble-5 {
    width: 90px;
    height: 90px;
    left: 85%;
    bottom: -90px;
    animation-delay: 3s;
    animation-duration: 16s;
}

.bubble-6 {
    width: 70px;
    height: 70px;
    left: 20%;
    bottom: -70px;
    animation-delay: 5s;
    animation-duration: 13s;
}

@keyframes floatBubble {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.6;
    }

    90% {
        opacity: 0.6;
    }

    100% {
        transform: translateY(-120vh) rotate(360deg);
        opacity: 0;
    }
}

.setup-card {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 30px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
    z-index: 2;
    /* animation: slideUp 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55); */
}

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

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

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

.setup-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.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);
    position: relative;
    z-index: 1;
    animation: pulse 2s ease-in-out infinite;
}

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

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


.setup-body .form-group {
    margin-bottom: 10px;
}

.setup-body .form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--dark);
}

.setup-body .form-group input,
.setup-body .form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #E5E7EB;
    border-radius: 15px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.setup-body .form-group input:focus,
.setup-body .form-group select:focus {
    border-color: #8B5CF6;
    outline: none;
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.2);
}

.setup-body .form-group .input-group {
    display: flex;
    flex-direction: row-reverse;
}

.setup-body .form-group .input-group input {
    width: 80%;
}



.setup-header h1 {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.setup-header p {
    font-size: 1rem;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

.setup-body {
    padding: 50px 40px;
}

.child-info {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #E8DEF8, #D4C5F9);
    border-radius: 25px;
    margin-bottom: 40px;
}

.child-avatar-large {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #667EEA, #764BA2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    margin: 0 auto 20px;
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
    animation: bounce 2s ease-in-out infinite;
}

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

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

.child-info h3 {
    font-size: 2rem;
    font-weight: 900;
    color: var(--dark);
    margin-bottom: 15px;
}

.child-stats-inline {
    display: flex;
    gap: 30px;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--gray);
}

.child-stats-inline strong {
    color: #667EEA;
    font-weight: 900;
}

.form-section {
    margin-bottom: 35px;
}

.section-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 20px;
}

.section-label i {
    color: #667EEA;
    font-size: 1.5rem;
}

.surahs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.surah-option {
    padding: 20px 15px;
    background: white;
    border: 3px solid #E8DEF8;
    border-radius: 18px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.surah-option:hover {
    transform: translateY(-5px);
    border-color: #667EEA;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.surah-option.selected {
    background: linear-gradient(135deg, #667EEA, #764BA2);
    border-color: #667EEA;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    transform: scale(1.05);
}

.surah-option .surah-name {
    font-size: 1.2rem;
    font-weight: 800;
}

.surah-option .check-icon {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 25px;
    height: 25px;
    background: #10B981;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
}


/* Theme Selection */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.theme-option {
    padding: 25px 15px;
    background: white;
    border: 3px solid #E5E7EB;
    border-radius: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.theme-option:hover {
    transform: translateY(-5px) scale(1.05);
    border-color: #8B5CF6;
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.2);
}

.theme-option.selected {
    border-color: #8B5CF6;
    background: linear-gradient(135deg, #F3E8FF, #FCE7F3);
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.3);
}

.theme-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    animation: float 3s ease-in-out infinite;
}

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

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

.theme-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--dark);
}

.theme-option.selected .theme-icon {
    animation: bounce 0.5s ease;
}

.surah-option.selected .check-icon {
    display: flex;
}

.selected-count {
    text-align: center;
    font-size: 1.15rem;
    color: var(--gray);
    padding: 15px;
    background: #F3F4F6;
    border-radius: 15px;
}

.selected-count strong {
    color: #667EEA;
    font-size: 1.5rem;
    font-weight: 900;
}

.btn-start-game {
    width: 100%;
    padding: 25px;
    background: linear-gradient(135deg, #667EEA, #764BA2);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 1.5rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}

.btn-start-game:not(:disabled):hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5);
}

.btn-start-game:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.btn-start-game:not(:disabled):hover .btn-glow {
    left: 100%;
}

.btn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: #F3F4F6;
    color: var(--gray);
    text-decoration: none;
    border-radius: 15px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: #E5E7EB;
    color: var(--dark);
    transform: translateX(5px);
}

/* ========================================
   GAME SCREEN
======================================== */
.game-screen {
    min-height: 100vh;
    position: relative;
}

/* Animated Game Background */
.game-bg {
    position: fixed;
    inset: 0;
    /* background: linear-gradient(135deg, #FFE5E5 0%, #E5F3FF 50%, #FFF5E5 100%); */
    z-index: -1;
}

/* Clouds */
.clouds {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.cloud {
    position: absolute;
    background: white;
    border-radius: 100px;
    opacity: 0.6;
}

.cloud::before,
.cloud::after {
    content: '';
    position: absolute;
    background: white;
    border-radius: 100px;
}

.cloud-1 {
    width: 100px;
    height: 50px;
    top: 20%;
    left: -120px;
    animation: cloudMove 30s linear infinite;
}

.cloud-1::before {
    width: 50px;
    height: 50px;
    top: -25px;
    left: 10px;
}

.cloud-1::after {
    width: 60px;
    height: 40px;
    top: -15px;
    right: 10px;
}

.cloud-2 {
    width: 120px;
    height: 60px;
    top: 40%;
    left: -150px;
    animation: cloudMove 40s linear infinite 5s;
}

.cloud-2::before {
    width: 60px;
    height: 60px;
    top: -30px;
    left: 15px;
}

.cloud-2::after {
    width: 70px;
    height: 50px;
    top: -20px;
    right: 15px;
}

.cloud-3 {
    width: 90px;
    height: 45px;
    top: 60%;
    left: -100px;
    animation: cloudMove 35s linear infinite 10s;
}

.cloud-3::before {
    width: 45px;
    height: 45px;
    top: -20px;
    left: 10px;
}

.cloud-3::after {
    width: 55px;
    height: 35px;
    top: -15px;
    right: 10px;
}

@keyframes cloudMove {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(calc(100vw + 200px));
    }
}

/* Stars */
.stars {
    position: absolute;
    width: 100%;
    height: 100%;
}

.star {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-bottom: 25px solid #FFD700;
    animation: twinkle 2s ease-in-out infinite;
}

.star::before {
    content: '';
    position: absolute;
    top: 8px;
    left: -15px;
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 25px solid #FFD700;
}

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

.star-2 {
    top: 15%;
    right: 20%;
    animation-delay: 0.5s;
    transform: scale(0.8);
}

.star-3 {
    top: 25%;
    left: 30%;
    animation-delay: 1s;
    transform: scale(0.6);
}

.star-4 {
    top: 35%;
    right: 10%;
    animation-delay: 1.5s;
    transform: scale(0.7);
}

.star-5 {
    top: 45%;
    left: 10%;
    animation-delay: 2s;
    transform: scale(0.9);
}

.star-6 {
    top: 20%;
    right: 40%;
    animation-delay: 2.5s;
    transform: scale(0.75);
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1) rotate(0deg);
    }

    50% {
        opacity: 1;
        transform: scale(1.2) rotate(180deg);
    }
}

/* Rainbow */
.rainbow {
    position: absolute;
    top: 5%;
    right: 5%;
    width: 300px;
    height: 150px;
    border-radius: 300px 300px 0 0;
    border: 8px solid transparent;
    border-top-color: #FF0000;
    box-shadow:
        inset 0 15px 0 #FF7F00,
        inset 0 30px 0 #FFFF00,
        inset 0 45px 0 #00FF00,
        inset 0 60px 0 #0000FF,
        inset 0 75px 0 #4B0082,
        inset 0 90px 0 #9400D3;
    opacity: 0.6;
    animation: rainbowGlow 3s ease-in-out infinite;
}

@keyframes rainbowGlow {
    0%, 100% {
        opacity: 0.6;
    }

    50% {
        opacity: 0.8;
    }
}

/* Game Header */
.game-header {
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 12px 0;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    z-index: 100;
}

.game-info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.student-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.student-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667EEA, #764BA2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.student-info strong {
    display: block;
    font-size: 1.1rem;
    color: var(--dark);
}

.stars-display {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #F59E0B;
    font-weight: 900;
}

.game-stats {
    flex: 1;
    display: flex;
    justify-content: center;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--gray);
    font-size: 1rem;
    padding: 12px 25px;
    background: #F3F4F6;
    border-radius: 50px;
}

.stat-item i {
    color: #667EEA;
    font-size: 1.2rem;
}

.stat-item strong {
    color: #667EEA;
}

.btn-end-game {
    padding: 12px 25px;
    background: #FEE2E2;
    color: #991B1B;
    border: none;
    border-radius: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-end-game:hover {
    background: #EF4444;
    color: white;
    transform: translateY(-2px);
}

/* Game Container */
.game-container {
    padding: 200px 20px 180px;
}

.game-title {
    text-align: center;
    margin-bottom: 10px;
}

.game-title h2 {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--dark);
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.game-title p {
    font-size: 1.1rem;
    color: var(--gray);
}

/* Cards Play Area */
.cards-play-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 80px;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 250px;
    position: relative;
}

/* Shuffle Button */
.shuffle-button {
    padding: 20px 35px;
    background: linear-gradient(135deg, #F59E0B, #EF4444);
    color: white;
    border: none;
    border-radius: 20px;
    font-weight: 800;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.3);
    position: relative;
    overflow: hidden;
}

.shuffle-button:hover {
    transform: translateY(-5px) rotate(5deg);
    box-shadow: 0 15px 40px rgba(245, 158, 11, 0.5);
}

.shuffle-button i {
    font-size: 2.5rem;
}

.shuffle-sound-wave {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 20px;
    display: flex;
    align-items: flex-end;
    gap: 3px;
    opacity: 0;
}

.shuffle-button:active .shuffle-sound-wave {
    opacity: 1;
    animation: soundWave 0.5s ease;
}

/* Stack Container */
.stack-container {
    position: relative;
    width: 300px;
    height: 310px;
    perspective: 1000px;
}

.stacked-card {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667EEA, #764BA2);
    border-radius: 25px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.stacked-card::before {
    content: '';
    position: absolute;
    inset: 15px;
    border: 3px dashed rgba(255, 255, 255, 0.3);
    border-radius: 20px;
}

.stacked-card .card-icon {
    font-size: 8rem;
    margin-bottom: 20px;
    animation: cardFloat 3s ease-in-out infinite;
}

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

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

.stacked-card .card-label {
    font-size: 1.8rem;
    font-weight: 800;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.stacked-card .card-number {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 900;
    color: white;
}

.stacked-card:hover {
    transform: translateY(-10px) scale(1.02);
}

/* Flipped Card Area */
.flipped-card-area {
    width: 300px;
    height: 310px;
    position: relative;
}

.flipped-card {
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 25px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 4px solid #667EEA;
    animation: flipIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes flipIn {
    from {
        transform: rotateY(-90deg) translateX(-100px);
        opacity: 0;
    }

    to {
        transform: rotateY(0) translateX(0);
        opacity: 1;
    }
}

.flipped-card .card-decoration {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border: 2px dashed #E8DEF8;
    border-radius: 20px;
}

.flipped-card .surah-number {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667EEA, #764BA2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 900;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.flipped-card .surah-icon {
    font-size: 6rem;
    margin-bottom: 30px;
    filter: drop-shadow(0 5px 15px rgba(102, 126, 234, 0.3));
}

.flipped-card .surah-name {
    font-family: 'Amiri', serif;
    font-size: 3rem;
    font-weight: 700;
    color: #667EEA;
    text-align: center;
    margin-bottom: 20px;
}

.flipped-card .surah-info {
    font-size: 1.1rem;
    color: var(--gray);
    text-align: center;
}


.no-cards {
    text-align: center;
    padding: 0px 20px;
}

.success-animation {
    background: white;
    border-radius: 30px;
    padding: 30px 40px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.15);
    max-width: 600px;
    margin: 0 auto;
    animation: scaleIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }

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

.success-icon {
    font-size: 4rem;
    margin-bottom: 30px;
    animation: celebrate 1s ease-in-out infinite;
}

@keyframes celebrate {
    0%, 100% {
        transform: rotate(-10deg) scale(1);
    }

    50% {
        transform: rotate(10deg) scale(1.1);
    }
}

.success-animation h2 {
    font-size: 2rem;
    font-weight: 900;
    color: var(--dark);
    margin-bottom: 20px;
}

.success-animation p {
    font-size: 1.3rem;
    color: var(--gray);
    margin-bottom: 40px;
}

.btn-play-again {
    background: linear-gradient(135deg, #10B981, #3B82F6);
    color: white;
    border: none;
    padding: 20px 50px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 15px 40px rgba(16, 185, 129, 0.4);
}

.btn-play-again:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(16, 185, 129, 0.5);
}


/* Action Buttons Bottom */
.action-buttons-bottom {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.btn-action {
    padding: 5px 20px;
    border: none;
    border-radius: 20px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn-correct {
    background: linear-gradient(135deg, #10B981, #3B82F6);
    color: white;
}

.btn-correct:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(16, 185, 129, 0.4);
}

.btn-wrong {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
}

.btn-wrong:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(239, 68, 68, 0.4);
}

.btn-return {
    background: linear-gradient(135deg, #6B7280, #9CA3AF);
    color: white;
}

.btn-return:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(107, 114, 128, 0.4);
}


/* ========================================
   ENCOURAGEMENT PANEL
======================================== */
.encouragement-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    padding: 5px 0;
    z-index: 99;
}

.encouragement-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-encourage {
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 1rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.btn-encourage:hover {
    transform: translateY(-5px) scale(1.1);
}

.btn-encourage.clap {
    background: linear-gradient(135deg, #F59E0B, #EF4444);
}

.btn-encourage.star2 {
    background: linear-gradient(135deg, #FBBF24, #F59E0B);
}

.btn-encourage.heart {
    background: linear-gradient(135deg, #EC4899, #EF4444);
}

.btn-encourage.trophy {
    background: linear-gradient(135deg, #3B82F6, #8B5CF6);
}

.btn-encourage.excellent {
    background: linear-gradient(135deg, #10B981, #3B82F6);
}

.btn-encourage i {
    font-size: 1.5rem;
}


/* ========================================
   CELEBRATION OVERLAY
======================================== */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99999;
}

#confettiCanvas {
    width: 100%;
    height: 100%;
}

.celebration-character {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 15rem;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.celebration-character.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}


/* Celebration Overlay */
/* .celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    display: none;
}

.celebration-overlay.active {
    display: block;
}

#confettiCanvas {
    width: 100%;
    height: 100%;
} */

/* Responsive */
@media (max-width: 992px) {
    .cards-play-area {
        flex-direction: row;
        gap: 18px;
    }

    .shuffle-button {
        order: -1;
    }
}

@media (max-width: 768px) {
    .setup-header h1 {
        font-size: 2rem;
    }

    .setup-header p {
        font-size: 1rem;
    }

    .setup-body {
        padding: 30px 10px;
    }

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

    .game-container {
        padding: 170px 0px 150px;
    }

    .game-title h2 {
        font-size: 1rem;
    }

    .game-title p {
        font-size: .9rem;
    }

    .stack-container,
    .flipped-card-area {
        width: 280px;
        height: 400px;
    }

    .action-buttons-bottom {
        flex-direction: row;
    }

    .btn-action {
        /* width: 100%; */
        justify-content: center;
    }
}

@media (max-width: 576px) {

    .stack-container,
    .flipped-card-area {
        width: 225px;
        height: 225px;
    }

    .flipped-card .surah-icon {
        font-size: 4rem;
    }

    .flipped-card .surah-name {
        font-size: 1.1rem;
    }
}





/* ################################# Public Footer Game   ##########################  */
@media(max-width:991px) {
    .surahs-remaining {
        gap: 4px;
        font-size: .7rem;
        font-weight: 600;
    }

    .game-info-bar {
        gap: 5px;
    }

    .btn-end-game {
        padding: 7px 10px;
        gap: 5px;
        font-size: 11px;
    }

    .surahs-remaining i {
        font-size: 1rem;
    }

    .surahs-remaining strong {
        font-size: 1rem;
    }

    .student-avatar {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }

    .student-info strong {
        font-size: .8rem;
    }

    .encouragement-buttons {
        display: flex;
        gap: 3px;
        justify-content: center;
        flex-wrap: wrap;
    }

    .btn-encourage {
        padding: 6px 14px;
        gap: 5px;
        font-size: .9rem;
    }

    .btn-encourage i {
        font-size: 13px;
    }
}


.card-item.card-removing {
    animation: cardRemove 0.8s ease-in-out forwards;
    transform-origin: center;
}

@keyframes cardRemove {
    0% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }

    50% {
        transform: scale(1.1) rotate(5deg);
        opacity: 0.8;
    }

    100% {
        transform: scale(0) rotate(15deg);
        opacity: 0;
    }
}



@media(max-width:991px) {
    .cards-remaining {
        font-size: .6rem;
    }

    .card-front-number {
        font-size: 2rem;
    }

    .card-front-icon {
        font-size: 3rem;
        margin: 0px 0;
    }

    .card-front-text {
        font-size: 1rem;
    }

    .card-front-number {
        margin-bottom: 0;
    }

    .setup-screen {
        min-height: 100vh;
        background: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
        padding: 90px 0px 30px;
    }
}


@media(max-width:991px) {
    .stat-item {
        gap: 5px;
        font-size: .7rem;
        padding: 2px 5px;
    }

    .shuffle-button {
        padding: 3px 24px;
        font-size: .8rem;
    }

    .stacked-card .card-icon {
        font-size: 3rem;
        margin-bottom: 10px;
    }

    .stacked-card .card-label {
        font-size: .9rem;
    }

    .flipped-card {
        padding: 40px 10px;
    }

    .shuffle-button i {
        font-size: 1rem;
    }

    .game-container .container {
        padding: 2px;
    }

    .success-animation {
        padding: 15px;
    }

    .success-animation h2 {
        font-size: 1.2rem;
    }

    .success-animation p {
        font-size: .9rem;
    }

    .btn-play-again {
        padding: 10px 30px;
        font-size: 1rem;
    }

    .setup-icon {
        width: 70px;
        height: 70px;
        font-size: 2rem;
    }

    .setup-header h1 {
        font-size: 1.5rem;
    }

    .setup-header p {
        font-size: .9rem;
        margin: 2px;
    }

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

    .theme-option {
        padding: 4px !important;
        border-width: 2px;

    }

    .btn-start-game {
        padding: 10px;
        font-size: 1rem;
    }

    .theme-icon {
        font-size: 2rem !important;
    }

    .theme-grid {
        gap: 1px !important;
    }
    .theme-icon {
        font-size: 2rem !important;
        margin-bottom: 2px;
    }
    .theme-name{
 font-size: 12px !important;
    }
    .setup-body .form-group .input-group input{
        width: 60%;
    }
}

/* ========================================
   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;
}

/* ========================================
   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;
}
