/*
 * 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-float-or-sink
 */

.fs-stage { display: flex; gap: 14px; align-items: stretch; flex-wrap: wrap; }
.fs-left { flex: 0 1 132px; }
.fs-scene { flex: 1 1 320px; min-width: 260px; height: auto; }
.fs-side { flex: 0 1 214px; display: flex; flex-direction: column; gap: 10px; }

.fs-tank { fill: #f8fbff; stroke: #7c9cb8; stroke-width: 3; }
.fs-water { fill: #bfe0f5; }
.fs-water-front { fill: rgba(150, 205, 240, .38); pointer-events: none; }
.fs-surface { stroke: #5b9bd5; stroke-width: 3; }
.fs-obj { font-size: 34px; }

/* The tray keeps every object visible with what the class said about it, so the
   predictions stay on screen instead of living in the teacher's memory. */
.fs-tray { display: flex; flex-direction: column; gap: 6px; }
.fs-item {
    display: flex; align-items: center; gap: 6px; width: 100%;
    border: 2px solid #cbd5e1; background: #fff; border-radius: 10px;
    padding: 5px 7px; cursor: pointer; text-align: left;
}
.fs-item.is-on { border-color: #1565c0; box-shadow: 0 0 0 2px rgba(21,101,192,.15); }
.fs-item.is-done { background: #f1f5f9; }
.fs-item-emoji { font-size: 20px; }
.fs-item-name { font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 13px; color: #163a5f; }
.fs-item-tag { margin-left: auto; font-size: 10.5px; font-weight: 700; color: #64748b; white-space: nowrap; }

.fs-picked { background: #fff; border: 2px solid #d9e6f2; border-radius: 10px; padding: 6px 10px; }
.fs-picked-label { font-size: 11px; font-weight: 700; color: #64748b; }
.fs-picked-name { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 21px; color: #163a5f; }

.fs-predict { display: flex; flex-direction: column; gap: 6px; }
.fs-btn {
    border: 2px solid #cbd5e1; background: #fff; border-radius: 10px; padding: 8px 6px;
    font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 14px; color: #334155; cursor: pointer;
}
.fs-btn--float.is-on { background: #dcfce7; border-color: #15803d; color: #14532d; }
.fs-btn--sink.is-on { background: #dbeafe; border-color: #1d4ed8; color: #1e3a8a; }
.fs-btn:disabled { opacity: .55; cursor: default; }
.fs-drop { width: 100%; }
.fs-drop:disabled { opacity: .5; cursor: default; }
/* No score, no ticks, no streak: one plain sentence about what happened. */
.fs-result { margin: 0; font-size: 13.5px; line-height: 1.45; color: #334155; }

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

.fs-your-turn {
    margin-top: 16px; background: #fffaf0; border-left: 4px solid #dd6b20;
    border-radius: 8px; padding: 10px 14px;
}
.fs-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 .fs-scene { flex-basis: 460px; }
body.display-mode .fs-result { font-size: 16px; }

@media (max-width: 620px) {
    .fs-left, .fs-side { flex-basis: 100%; }
    .fs-tray { flex-direction: row; flex-wrap: wrap; }
    .fs-item { width: auto; }
}

/* =====================================================================
 * 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) .fs-stage { flex: 1 1 auto; min-height: 0; flex-wrap: nowrap; }
    body.maths-activity:not(.display-mode) .fs-scene { flex: 1 1 0; min-width: 0; min-height: 0; width: auto; height: auto; align-self: stretch; }
    body.maths-activity:not(.display-mode) .fs-side { min-height: 0; overflow-y: auto; }
    body.maths-activity:not(.display-mode) .fs-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) .fs-chip { min-height: 40px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .fs-side .btn-primary-activity,
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .fs-side .btn-control { min-height: 40px; }
}
@media (min-width: 1500px) and (min-height: 760px) {
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .fs-side { flex-basis: 400px; gap: 16px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .fs-read-label { font-size: 14px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .fs-read-val { font-size: 30px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .fs-verdict { font-size: 17px; line-height: 1.5; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .fs-ctl-label { font-size: 17px; margin-bottom: 8px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .fs-chips { gap: 10px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .fs-chip { min-height: 52px; font-size: 17px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .fs-side .btn-primary-activity,
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .fs-side .btn-control { min-height: 56px; font-size: 18px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .fs-guided { padding: 14px 16px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .fs-guided-text { font-size: 17px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .fs-guided-count { font-size: 15px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .fs-your-turn-label { font-size: 16px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .fs-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) .fs-left { flex-basis: 210px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .fs-tray { gap: 10px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .fs-item { min-height: 56px; padding: 6px 12px; gap: 10px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .fs-item-emoji { font-size: 30px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .fs-item-name { font-size: 19px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .fs-item-tag { font-size: 13px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .fs-picked { padding: 8px 14px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .fs-picked-label { font-size: 14px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .fs-picked-name { font-size: 30px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .fs-predict { gap: 10px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .fs-btn { min-height: 56px; font-size: 19px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .fs-result { font-size: 18px; line-height: 1.5; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .fs-obj { font-size: 38px; }
}

@media (min-width: 700px) {
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .fs-item { min-height: 40px; }
    html:not(.mcr-compete) body.maths-activity:not(.display-mode) .fs-btn { min-height: 40px; }
}
.fs-item:focus-visible, .fs-btn:focus-visible { outline: 3px solid #0d3f7a; outline-offset: 2px; }
