/* SCOPED TO GAME CONTENT ONLY — A BARE p RULE WOULD BLEED INTO THE FOOTER VIA
   INHERITANCE LOSS ON ANY PAGE THAT LOADS dad.css VIA $extraCss: THE FOOTER'S
   <p> ELEMENTS INHERIT THEIR COLOUR FROM .main-footer, AND INHERITANCE LOSES TO
   ANY DIRECTLY MATCHING SELECTOR NO MATTER HOW WEAK.
   .keymap-section IS LISTED FIRST BECAUSE IT IS WHERE THE <p> ELEMENTS ACTUALLY
   LIVE — ALL 18 OF THEM, TWO PER GAME PAGE. .content-section CURRENTLY HOLDS NO
   <p> AT ALL; IT IS KEPT HERE SO GAME COPY ADDED TO THE CARD LATER PICKS THE
   STYLE UP WITHOUT ANOTHER EDIT. */
.keymap-section p,
.content-section p {
    font-family: 'Noto Serif Bengali', serif;
    color: #666;
}

/* OVERRIDE THE GLOBAL .container RULE (style.css) FOR THE
   DAD GAME'S WHITE CARD — .content-section > .container.
   THE GLOBAL RULE ADDS max-width:1200px AND margin:0 auto,
   WHICH THIS CARD NEVER HAD BEFORE AND WHICH LEFT DEAD WHITE
   SPACE ON BOTH SIDES OF THE GAME ON WIDE SCREENS. */
.content-section .container {
    max-width: none;
    margin: 0;
}

.image-wrapper {
    width: 100%;
    margin-bottom: 30px;
}

.images {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    width: 100%;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 18px;
    padding: 25px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(6px);
}

.images img {
    width: calc((100% - 80px) / 9);
    min-width: 80px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 18px;
    cursor: grab;
    transition: all 0.18s ease;
    border: 3px solid transparent;
    background: white;
    touch-action: none;
    -webkit-user-drag: none;
    user-select: none;
}

.images img:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 20px 5px rgba(255, 200, 0, 0.6);
    animation: bounce 0.5s ease;
}

.images img:active {
    cursor: grabbing;
    transform: scale(1.02);
}

.targets {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    width: 100%;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 18px;
    padding: 25px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(6px);
}

.dropzone {
    flex: 1;
    min-width: 0;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fefefe;
    border: 3px dashed #ccc;
    border-radius: 18px;
    text-align: center;
    font-family: 'Noto Serif Bengali', serif;
    font-size: 18px;
    font-weight: 600;
    color: #666;
    transition: all 0.18s ease;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.05);
    position: relative;
}

.dropzone:hover {
    border-color: #5b7dd8;
    background: #f0f4ff;
}

.dropzone.hovered {
    background-color: #e8fcef;
    border-color: #00c853;
    transform: scale(1.06);
    color: #00c853;
}

.dropzone.drag-over {
    border-color: #00c853;
    background: #e8f5e9;
    transform: scale(1.02);
}

.dropzone::after {
    content: "\f028";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 1.2rem;
    color: #ff4f2f;
    position: absolute;
    bottom: 8px;
    right: 8px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.dropzone:hover::after {
    opacity: 1;
}

/* FUN BOUNCE ANIMATION */
@keyframes bounce {

    0%,
    100% {
        transform: translateY(0) scale(1.1) rotate(5deg);
    }

    50% {
        transform: translateY(-10px) scale(1.15) rotate(-5deg);
    }
}

.bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border-radius: 40px;
    padding: 20px 35px;
    box-shadow: var(--shadow);
    width: 100%;
    transition: all 0.3s ease;
    flex-wrap: wrap;
    gap: 15px;
}

#scoreboard {
    font-size: 1.5rem;
    background: linear-gradient(135deg, #5b7dd8 0%, #4f6bc4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    flex: 1;
    text-align: left;
    letter-spacing: 1px;
    padding: 10px 20px;
    border-radius: 20px;
    background-color: rgba(91, 125, 216, 0.1);
    background-image: linear-gradient(135deg, #5b7dd8 0%, #4f6bc4 100%);
    -webkit-background-clip: text;
    display: inline-block;
    position: relative;
    animation: scoreGlow 2s ease-in-out infinite;
}

/* MODAL OVERLAY */
.modal {
    font-family: 'Noto Serif Bengali', serif;
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(135deg, #5b7dd8 0%, #4f6bc4 100%);
    color: white;
    margin: auto;
    padding: 30px 40px;
    border-radius: var(--radius);
    text-align: center;
    max-width: 400px;
    box-shadow: var(--shadow);
    animation: popIn 0.3s ease;
}

.modal-content .close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
}

/* TABLETS AND SMALLER (BELOW 768PX) */
@media (max-width: 768px) {

    /* OVERRIDE MAIN HEIGHT CONSTRAINTS TO ALLOW SCROLLING */
    main,
    .content-section {
        max-height: none !important;
        height: auto !important;
        overflow: visible !important;
    }

    .images {
        flex-wrap: wrap;
        gap: 8px;
        padding: 15px;
    }

    .images img {
        width: calc((100% - 16px) / 3);
        min-width: 50px;
        max-width: 100px;
        aspect-ratio: 1 / 1;
    }

    .targets {
        flex-wrap: wrap;
        gap: 8px;
        padding: 15px;
    }

    .dropzone {
        flex: 0 0 100px;
        width: 100px;
        min-width: 50px;
        max-width: 100px;
        font-size: 16px;
    }

    .dropzone::after {
        font-size: 1rem;
        bottom: 6px;
        right: 6px;
    }

    .bottom-bar {
        padding: 15px 20px;
        gap: 10px;
    }

    #scoreboard {
        font-size: 1.3rem;
        padding: 8px 15px;
    }

    .modal-content {
        max-width: 90%;
        padding: 25px 30px;
    }
}

/* MOBILE PHONES (BELOW 480PX) */
@media (max-width: 480px) {

    /* OVERRIDE MAIN HEIGHT CONSTRAINTS TO ALLOW SCROLLING */
    main,
    .content-section {
        max-height: none !important;
        height: auto !important;
        overflow: visible !important;
    }

    .images {
        gap: 6px;
        padding: 12px;
    }

    .images img {
        width: calc((100% - 12px) / 2);
        min-width: 50px;
        max-width: 100px;
        aspect-ratio: 1 / 1;
        border-radius: 12px;
    }

    .images img:hover {
        transform: scale(1.05) rotate(3deg);
    }

    .targets {
        gap: 6px;
        padding: 12px;
    }

    .dropzone {
        flex: 0 0 100px;
        width: 100px;
        min-width: 50px;
        max-width: 100px;
        font-size: 14px;
        border-radius: 12px;
        border-width: 2px;
    }

    .dropzone::after {
        font-size: 0.9rem;
        bottom: 4px;
        right: 4px;
    }

    .dropzone.hovered {
        transform: scale(1.03);
    }

    .bottom-bar {
        padding: 12px 15px;
        border-radius: 25px;
        flex-direction: column;
        text-align: center;
    }

    #scoreboard {
        font-size: 1.2rem;
        padding: 6px 12px;
        text-align: center;
        width: 100%;
    }

    .button-group {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .modal-content {
        padding: 20px 25px;
    }

    .modal-content h2 {
        font-size: 1.5rem;
    }

    .modal-content p {
        font-size: 0.95rem;
    }
}

/* VERY SMALL PHONES (BELOW 360PX) */
@media (max-width: 360px) {

    /* OVERRIDE MAIN HEIGHT CONSTRAINTS TO ALLOW SCROLLING */
    main,
    .content-section {
        max-height: none !important;
        height: auto !important;
        overflow: visible !important;
    }

    .images img {
        min-width: 50px;
        max-width: 100px;
    }

    .dropzone {
        flex: 0 0 100px;
        width: 100px;
        min-width: 50px;
        max-width: 100px;
        font-size: 13px;
    }

    #scoreboard {
        font-size: 1.1rem;
    }
}