/*
 * Coding Ireland proprietary interactive activity
 * Copyright (c) 2017-2026 Coding Ireland. All rights reserved.
 *
 * Part of the Coding Ireland online learning platform. Licensed for use only
 * as delivered on the platform. Copying, redistributing, or adapting this
 * file, in whole or in part, for use in any other product or service is not
 * permitted. Ref: CI-maths-picture-sort
 */
/* Sizing is set for four-year-old hands on an IWB: the picture carries the
   meaning, the word rides underneath, and every target is deliberately large. */
.ps-stage { font-family: 'Nunito', system-ui, sans-serif; }

/* ---- The one question --------------------------------------------------- */
.ps-question {
    margin: 0 0 16px;
    padding: 14px 20px;
    background: linear-gradient(180deg, #fff7ed, #ffedd5);
    border: 1px solid #fed7aa;
    border-left: 6px solid #f97316;
    border-radius: 12px;
    font-size: 22px; font-weight: 800; color: #7c2d12;
    text-align: center;
}

/* ---- Hoops -------------------------------------------------------------- */
.ps-bins {
    display: grid; gap: 18px; margin-bottom: 18px;
    grid-template-columns: repeat(var(--ps-bin-count, 2), minmax(0, 1fr));
}
.ps-bin {
    background: #ffffff; border: 1px solid #e2e8f0; border-top: 5px solid #6366f1;
    border-radius: 18px; padding: 14px;
    box-shadow: 0 6px 16px -10px rgba(15, 42, 80, .4);
}
.ps-bin-head {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    margin-bottom: 10px;
}
.ps-bin-emoji { font-size: 34px; line-height: 1; }
.ps-bin-label { font-size: 19px; font-weight: 800; margin: 0; color: #312e81; }

.ps-drop {
    min-height: 150px; border: 3px dashed #cbd5e1; border-radius: 14px; padding: 12px;
    display: flex; flex-wrap: wrap; gap: 12px; align-content: flex-start;
    background: #f8fafc;
    transition: background .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.ps-drop.ps-over {
    border-style: solid; border-color: #4338ca; background: #eef0ff;
    box-shadow: inset 0 0 0 4px rgba(67, 56, 202, .14);
}

/* ---- Tray --------------------------------------------------------------- */
.ps-tray-wrap { margin-bottom: 12px; }
.ps-tray {
    min-height: 120px; display: flex; flex-wrap: wrap; gap: 12px; padding: 14px;
    background: linear-gradient(180deg, #f1f5f9, #e7eef6);
    border: 2px dashed #cbd5e1; border-radius: 18px;
}

/* ---- Cards -------------------------------------------------------------- */
.ps-card {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px;
    width: 104px; min-height: 104px; padding: 10px 8px;
    background: linear-gradient(180deg, #ffffff, #f3f7fb);
    border: 2px solid #cbd5e1; border-radius: 18px;
    cursor: grab; user-select: none; touch-action: none;
    box-shadow: 0 2px 8px rgba(15, 42, 80, .14);
    transition: transform .12s ease, box-shadow .12s ease, border-color .14s ease;
}
.ps-card-emoji { font-size: 46px; line-height: 1; }
.ps-card-img { width: 62px; height: 62px; object-fit: contain; }
.ps-card-label {
    font-size: 14px; font-weight: 800; color: #1f2a37; text-align: center;
    line-height: 1.15; overflow-wrap: anywhere;
}
.ps-card:hover { transform: translateY(-2px); box-shadow: 0 10px 18px -6px rgba(15, 42, 80, .35); }
.ps-card:active { cursor: grabbing; }
.ps-card.ps-dragging { opacity: .35; }

/* ---- Display mode ------------------------------------------------------- */
/* The finished sort, for the teacher to talk over. Nothing is draggable. */
body.display-mode .ps-card,
.activity-container.display-mode .ps-card { cursor: default; }
body.display-mode .ps-card:hover,
.activity-container.display-mode .ps-card:hover { transform: none; box-shadow: 0 2px 8px rgba(15, 42, 80, .14); }
body.display-mode .ps-tray-wrap,
.activity-container.display-mode .ps-tray-wrap { display: none; }

@media (max-width: 640px) {
    .ps-bins { grid-template-columns: 1fr; }
    .ps-question { font-size: 19px; }
}

/* ---- Status line + picked-up card --------------------------------------- */
.ps-tray-status {
    min-height: 1.6em; margin: 0 4px 6px; font-weight: 800; font-size: 15px; color: #64748b;
}
.ps-tray-status.is-done { color: #15803d; }
.ps-card:focus-visible { outline: 3px solid #1F4E8C; outline-offset: 2px; }
.ps-card.pd-selected { transform: translateY(-3px); }

/* ---- Board / tablet-landscape: fill the frame, bigger pictures ----------
   Layout only. Display mode, lesson thumbnails and Challenge frames are not touched. */
@media (min-width: 1500px) and (min-height: 760px) {
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .activity-container {
        height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden;
    }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .activity-header { flex: 0 0 auto; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .ps-stage {
        flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
    }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .ps-question {
        flex: 0 0 auto; font-size: 1.6rem; padding: .7rem 1.4rem; margin-bottom: 1rem;
    }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .ps-bins {
        flex: 1 1 auto; min-height: 0; gap: 1.25rem; margin-bottom: 1rem;
    }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .ps-bin {
        display: flex; flex-direction: column; min-height: 0; padding: 1rem;
    }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .ps-bin-head { flex: 0 0 auto; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .ps-bin-emoji { font-size: 3rem; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .ps-bin-label { font-size: 1.6rem; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .ps-drop {
        flex: 1 1 auto; min-height: 0; overflow-y: auto; gap: 1rem; padding: 1rem;
    }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .ps-tray-wrap { flex: 0 0 auto; margin-bottom: .6rem; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .ps-tray-status { font-size: 1.1rem; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .ps-tray { min-height: 9.5rem; gap: 1rem; padding: 1rem; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .ps-card { width: 8rem; min-height: 8rem; padding: .7rem .5rem; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .ps-card-emoji { font-size: 4rem; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .ps-card-img { width: 5rem; height: 5rem; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .ps-card-label { font-size: 1.05rem; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .ps-your-turn { flex: 0 0 auto; margin-top: 0; }
}
