/*
 * 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-sound-explorer
 */

.se-stage { display: flex; gap: 18px; align-items: stretch; flex-wrap: wrap; }
.se-scene { flex: 1 1 380px; min-width: 300px; height: auto; }
.se-side { flex: 0 1 250px; display: flex; flex-direction: column; gap: 10px; }

.se-shell { fill: #b45309; }
.se-rim { fill: none; stroke: #7c2d12; stroke-width: 5; }
.se-skin { fill: none; stroke: #fde68a; stroke-width: 7; stroke-linecap: round; }
.se-neck { stroke: #7c2d12; stroke-width: 8; stroke-linecap: round; }
.se-box { fill: #b45309; }
.se-string { fill: none; stroke: #1e293b; stroke-width: 4.5; stroke-linecap: round; }
.se-string--slack { stroke: #64748b; stroke-width: 3; }
.se-finger { fill: #fca5a5; stroke: #b91c1c; stroke-width: 2; }
/* The spreading rings ARE the sound. Thin and fading, so they read as air moving
   rather than as solid circles sitting in the room. */
.se-wave { fill: none; stroke: #1565c0; stroke-width: 2.5; }
.se-ear { fill: #fde2e2; stroke: #b91c1c; stroke-width: 2.5; }
.se-tag { font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 700; fill: #334155; }
.se-tag--dim { fill: #64748b; font-weight: 600; }

.se-readouts { display: flex; gap: 8px; }
.se-read { flex: 1; background: #fff; border: 2px solid #d9e6f2; border-radius: 10px; padding: 6px 8px; text-align: center; }
.se-read-label { font-size: 11px; font-weight: 700; color: #64748b; line-height: 1.2; }
/* Words, not numbers: this is four to eight year olds, and decibels teach nothing. */
.se-read-val { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 20px; color: #163a5f; }
.se-verdict { margin: 0; font-size: 13.5px; line-height: 1.45; color: #334155; }

.se-ctl-label { display: block; font-weight: 700; font-size: 13.5px; color: #163a5f; margin-bottom: 4px; }
.se-control input[type="range"] { width: 100%; }
.se-hit, .se-tone { width: 100%; }

.se-chips { display: flex; gap: 6px; }
.se-chip {
    flex: 1; border: 2px solid #cbd5e1; background: #fff; border-radius: 999px;
    padding: 6px 4px; font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 13px;
    color: #334155; cursor: pointer;
}
.se-chip.is-on { background: #1565c0; border-color: #1565c0; color: #fff; }

.se-guided { background: #f8fafc; border-left: 4px solid #1565c0; border-radius: 8px; padding: 10px 12px; }
.se-guided-text { margin: 0 0 8px; font-size: 14px; line-height: 1.45; color: #1e293b; }
.se-guided-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.se-guided-count { font-size: 12px; color: #64748b; white-space: nowrap; }

.se-your-turn {
    margin-top: 16px; background: #fffaf0; border-left: 4px solid #dd6b20;
    border-radius: 8px; padding: 10px 14px;
}
.se-your-turn-label { font-weight: 800; color: #9a3412; font-size: 13px; margin-bottom: 4px; }
#yourTurnList { margin: 0; padding-left: 18px; font-size: 14px; color: #334155; }

body.display-mode .activity-header,
.activity-container.display-mode .activity-header { display: none; }
body.display-mode .se-scene { flex-basis: 460px; }
body.display-mode .se-read-val { font-size: 26px; }
body.display-mode .se-verdict { font-size: 15px; }

@media (max-width: 560px) {
    .se-side { flex-basis: 100%; }
}

/* =====================================================================
 * Fit to the screen (layout only, 31 Oct 2026)
 * The scene used to take its height from its width, so on a 1920 or 1366
 * wide screen it ran off the bottom. Now, on a laptop / board sized frame,
 * the scene fills the height that is left. Display mode and small frames
 * (phones, lesson thumbnails) are not touched.
 * ===================================================================== */
@media (min-width: 1000px) and (min-height: 600px) {
    body.maths-activity:not(.display-mode) .activity-container {
        height: 100vh; height: 100dvh; box-sizing: border-box;
        display: flex; flex-direction: column; overflow: hidden;
        padding-top: 0.6rem; padding-bottom: 0.6rem;
    }
    body.maths-activity:not(.display-mode) .activity-header { flex: 0 0 auto; margin-bottom: 0.5rem; }
    body.maths-activity:not(.display-mode) .se-stage { flex: 1 1 auto; min-height: 0; flex-wrap: nowrap; }
    body.maths-activity:not(.display-mode) .se-scene { flex: 1 1 0; min-width: 0; min-height: 0; width: auto; height: auto; align-self: stretch; }
    body.maths-activity:not(.display-mode) .se-side { min-height: 0; overflow-y: auto; }
    body.maths-activity:not(.display-mode) .se-your-turn { flex: 0 0 auto; margin-top: 0.5rem; padding-top: 6px; padding-bottom: 6px; }
}


/* =====================================================================
 * Board-scale controls (31 Oct 2026)
 * The side panel was set in 11-14px type with 34px buttons: fine at a desk,
 * unreadable from the back of a classroom and hard to hit with a finger on a
 * board. Laptop-size frames get 40px targets; board-size frames (1500 x 760
 * and up) get bigger type, wider panel and 52-56px targets. Display mode and
 * challenge (compete) rounds are not touched.
 * ===================================================================== */
@media (min-width: 700px) {
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .se-chip { min-height: 40px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .se-side .btn-primary-activity,
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .se-side .btn-control { min-height: 40px; }
}
@media (min-width: 1500px) and (min-height: 760px) {
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .se-side { flex-basis: 400px; gap: 16px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .se-read-label { font-size: 14px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .se-read-val { font-size: 30px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .se-verdict { font-size: 17px; line-height: 1.5; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .se-ctl-label { font-size: 17px; margin-bottom: 8px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .se-chips { gap: 10px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .se-chip { min-height: 52px; font-size: 17px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .se-side .btn-primary-activity,
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .se-side .btn-control { min-height: 56px; font-size: 18px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .se-guided { padding: 14px 16px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .se-guided-text { font-size: 17px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .se-guided-count { font-size: 15px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .se-your-turn-label { font-size: 16px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .se-your-turn li, html:not(.mcr-compete) body.maths-activity:not(.display-mode) #yourTurnList { font-size: 17px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .se-tag { font-size: 16px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .se-hit { min-height: 64px; font-size: 22px; }
}

/* Tapping the drum or the string in the picture hits it. */
body.maths-activity:not(.display-mode) #seScene .se-shell,
body.maths-activity:not(.display-mode) #seScene .se-skin,
body.maths-activity:not(.display-mode) #seScene .se-rim,
body.maths-activity:not(.display-mode) #seScene .se-box,
body.maths-activity:not(.display-mode) #seScene .se-string { cursor: pointer; }
