/**
 * K12 Auto Games - Premium Styles
 */

.k12-games-section {
    margin: 40px 0;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.k12-games-section .section-title {
    font-size: 24px;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 25px;
    text-align: center;
    letter-spacing: -0.5px;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.game-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 18px;
    padding: 24px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.9);
}

.game-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #4dabf7;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.game-title {
    font-size: 20px;
    font-weight: 700;
    margin: 15px 0 10px;
    color: #343a40;
}

.game-preview-icon {
    font-size: 48px;
    margin: 10px 0;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.game-desc {
    font-size: 14px;
    color: #6c757d;
    line-height: 1.5;
    margin-bottom: 20px;
}

.play-game-btn {
    background: linear-gradient(45deg, #228be6, #15aabf);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s;
    width: 100%;
}

.play-game-btn:hover {
    transform: scale(1.05);
    background: linear-gradient(45deg, #1c7ed6, #1098ad);
}

/* Modal Overlay */
.game-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.game-container {
    background: #fff;
    width: 90%;
    max-width: 800px;
    min-height: 500px;
    border-radius: 25px;
    position: relative;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: pop 0.4s ease-out forwards;
}

.close-game-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #f1f3f5;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    line-height: 40px;
}

/* Animations */
@keyframes pop {
    0% {
        transform: scale(0.9);
        opacity: 0;
    }

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

/* Badge Notifications */
.badge-toast {
    position: fixed;
    bottom: -150px;
    right: 30px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border: 3px solid #ffd43b;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    z-index: 999999;
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 350px;
}

.badge-toast.show {
    bottom: 30px;
}

.badge-icon {
    font-size: 40px;
}

.badge-label {
    font-weight: 900;
    color: #f08c00;
    font-size: 12px;
    text-transform: uppercase;
}

.badge-text {
    font-weight: 700;
    color: #1a1a1a;
    font-size: 16px;
}

.game-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
}

.game-question {
    font-size: 32px;
    text-align: center;
    margin: 40px 0;
    color: #2b2b2b;
}

.game-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.game-opt-btn {
    background: #f8f9fa;
    border: 3px solid #dee2e6;
    border-radius: 15px;
    padding: 20px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.game-opt-btn:hover {
    border-color: #228be6;
    background: #e7f5ff;
    transform: scale(1.02);
}

.memory-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.memory-card {
    height: 80px;
    background: #343a40;
    color: transparent;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    transition: all 0.3s;
    text-align: center;
    padding: 10px;
}

.memory-card.selected {
    background: #228be6;
    color: white;
}

.memory-card.matched {
    background: #40c057 !important;
    color: white;
}

.sortable-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
}

.sort-item {
    background: #fff;
    border: 2px solid #ced4da;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    text-align: center;
}

.sort-item.selected {
    border-color: #228be6;
    background: #e7f5ff;
}

.game-over {
    text-align: center;
    padding: 30px 0;
}

.final-score {
    font-size: 44px;
    font-weight: 900;
    color: #fcc419;
    margin: 15px 0;
}

/* Animations */
@keyframes shake {

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

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

/* Confetti */
.confetti-particle {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    will-change: transform, opacity;
}