/* ============================================================
   multiplication.one - Friendly Classroom theme
   Day 3 rewrite 2026-05-27. Cache-busted via ?v=3.0 in header.
   ============================================================ */

/* ----- Color palette + design tokens (extracted from mockup) ----- */
:root {
    /* Brand palette */
    --m1-blue:        #1E61D0;  /* Action Blue - CTAs, links, active state */
    --m1-blue-dark:   #013FA6;  /* Royal Blue - sidebar/topbar BG, hover */
    --m1-blue-darker: #013FA6;  /* legacy compat alias */
    --m1-yellow:      #F6AB10;  /* Accent Yellow - .one, highlights */
    --m1-mint:        #52AA55;  /* Success Green - correct answers */
    --m1-navy:        #213664;  /* Deep Navy - headings, body text */
    --m1-grey-200:    #CDD5DF;  /* Pale Gray - borders, dividers */
    --m1-grey-400:    #9DABCC;  /* Soft Blue Gray - muted text, icons */
    --m1-grey-600:    #4B5563;
    --m1-page-bg:     #FCFCFD;  /* Off White - page background */

    /* Soft pastel tints derived from base colors */
    --m1-sky:         #E8EEFA;  /* light Action Blue tint */
    --m1-yellow-soft: #FEF1D2;  /* light yellow tint */
    --m1-mint-soft:   #E0F2E1;  /* light green tint */
    --m1-purple-soft: #EDE8F6;
    --m1-pink-soft:   #FCEAEA;

    --m1-topbar-h:           56px;
    --m1-sidebar-w:          240px;  /* expanded (default) */
    --m1-sidebar-w-narrow:   85px;   /* collapsed */
}

* { box-sizing: border-box; }

body {
    background: var(--m1-page-bg);
    color: var(--m1-navy);
    padding-top: var(--m1-topbar-h);
}

a { text-decoration: none; }


/* ----- Icon font (icomoon, preserved) ----- */
@font-face {
    font-family: 'icomoon';
    src:  url('fonts/icomoon.eot?qjygr1');
    src:  url('fonts/icomoon.eot?qjygr1#iefix') format('embedded-opentype'),
        url('fonts/icomoon.ttf?qjygr1') format('truetype'),
        url('fonts/icomoon.woff?qjygr1') format('woff'),
        url('fonts/icomoon.svg?qjygr1#icomoon') format('svg');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}


/* ============================================================
   NEW LAYOUT (Day 3): topbar + left sidebar + main wrap
   ============================================================ */

/* Topbar */
.m1-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--m1-topbar-h);
    background: var(--m1-blue-dark);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    z-index: 1030;
}

.m1-hamburger {
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0.4rem 0.6rem;
    margin-right: 0.5rem;
    border-radius: 6px;
}
.m1-hamburger:hover, .m1-hamburger:focus {
    background: rgba(255,255,255,0.12);
    outline: none;
}

.m1-brand {
    font-family: 'Medula One', serif;
    font-size: 32px;
    line-height: 1;
    font-weight: 300;
    color: #fff;
    letter-spacing: 0.5px;
    text-decoration: none;
}
.m1-brand:hover { color: #fff; }
.m1-brand-accent { color: var(--m1-yellow); }

.m1-topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.m1-topbar-btn {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 6px;
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.4;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.m1-topbar-btn:hover, .m1-topbar-btn:focus {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-color: rgba(255,255,255,0.7);
    outline: none;
}


/* Sidebar (desktop, lg+) - expanded by default, collapses to narrow
   when body has class .m1-sidebar-collapsed */
.m1-sidebar {
    position: fixed;
    top: var(--m1-topbar-h);
    left: 0;
    bottom: 0;
    width: var(--m1-sidebar-w);
    background: var(--m1-blue-dark);
    color: #fff;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1020;
    padding-top: 1rem;
    transition: width 0.2s ease;
}

.m1-sidebar-nav,
.m1-sidebar-nav li {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Expanded layout: icon + label horizontally side-by-side */
.m1-sidebar-link {
    display: flex;
    width: 100%;
    box-sizing: border-box;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.85rem;
    padding: 0.75rem 1.25rem;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    transition: background 0.15s, color 0.15s, padding 0.2s ease;
}
.m1-sidebar-link i { font-size: 20px; line-height: 1; min-width: 24px; text-align: center; }
.m1-sidebar-label { font-size: 15px; font-weight: 500; line-height: 1.2; white-space: nowrap; }

.m1-sidebar-link:hover, .m1-sidebar-link:focus {
    background: rgba(255,255,255,0.08);
    color: #fff;
    outline: none;
}
.m1-sidebar-link.active {
    background: rgba(255,255,255,0.14);
    color: #fff;
}

/* Collapsed layout: vertical, icon over small label */
body.m1-sidebar-collapsed .m1-sidebar {
    width: var(--m1-sidebar-w-narrow);
}
body.m1-sidebar-collapsed .m1-sidebar-link {
    flex-direction: column;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.9rem 0.25rem;
}
body.m1-sidebar-collapsed .m1-sidebar-link i { font-size: 22px; }
body.m1-sidebar-collapsed .m1-sidebar-label { font-size: 11px; font-weight: 400; }


/* Offcanvas sidebar (mobile, < lg) */
.m1-offcanvas {
    background: var(--m1-blue-dark);
    color: #fff;
    width: 260px;
}
.m1-offcanvas .offcanvas-header {
    border-bottom: 1px solid rgba(255,255,255,0.2);
}
.m1-offcanvas .offcanvas-title { color: #fff; }
.m1-offcanvas .btn-close { filter: invert(1); }
.m1-offcanvas-nav .nav-link { color: rgba(255,255,255,0.85); padding: 0.6rem 1rem; }
.m1-offcanvas-nav .nav-link:hover,
.m1-offcanvas-nav .nav-link:focus { background: rgba(255,255,255,0.1); color: #fff; }
.m1-offcanvas-nav .nav-link.active { background: rgba(255,255,255,0.18); color: #fff; }
.m1-offcanvas hr { border-color: rgba(255,255,255,0.2); }


/* Main wrap - shifts content right to clear the sidebar on lg+ */
.m1-main-wrap {
    min-height: calc(100vh - var(--m1-topbar-h));
}
@media (min-width: 992px) {
    .m1-main-wrap {
        margin-left: var(--m1-sidebar-w);
        transition: margin-left 0.2s ease;
    }
    body.m1-sidebar-collapsed .m1-main-wrap {
        margin-left: var(--m1-sidebar-w-narrow);
    }
}


/* ============================================================
   HERO + HOMEPAGE CARDS (Phase 2 of day 3)
   ============================================================ */

/* Hero section */
.m1-hero {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: #fff;
    border: 1px solid var(--m1-grey-200);
    border-radius: 14px;
    padding: 1.75rem;
    margin-top: 1rem;
}
@media (min-width: 768px) {
    .m1-hero {
        flex-direction: row;
        align-items: center;
        gap: 2rem;
        padding: 2.5rem;
    }
}
.m1-hero-text { flex: 1 1 50%; min-width: 0; }
.m1-hero-illustration {
    flex: 1 1 50%;
    min-width: 0;       /* allow shrinking below intrinsic content width */
    text-align: center;
}

.m1-hero-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    line-height: 1.15;
    color: var(--m1-navy);
    margin: 0 0 0.75rem 0;
}
.m1-hero-subtitle {
    font-size: 1.05rem;
    color: var(--m1-grey-600);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.m1-hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.m1-hero-cta .btn { padding: 0.65rem 1.5rem; font-weight: 600; }

/* Hero illustration - centred, scales smoothly across breakpoints */
.m1-hero-svg,
.m1-hero-img {
    display: block;
    width: 100%;
    max-width: 420px;
    height: auto;
    margin: 0 auto;
}
/* Phones + small tablets - image fills most of its column */
@media (max-width: 767px) {
    .m1-hero-img { max-width: 90%; }
}
/* Tablets through smaller desktops - hide the hero illustration entirely.
   In this range sidebar (240px) + hero row layout leave the image too
   cramped to look good; text + CTAs get the full column instead. */
@media (min-width: 768px) and (max-width: 1199px) {
    .m1-hero-illustration { display: none; }
}


/* Section heading shared by Home sub-sections */
.m1-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--m1-navy);
    margin: 1.75rem 0 0.75rem 0;
}


/* Practice cards (4 across on lg, 2 on md, 1 on xs) */
.m1-practice-card {
    display: block;
    background: #fff;
    border: 1px solid var(--m1-grey-200);
    border-radius: 14px;
    padding: 1.25rem;
    text-decoration: none;
    color: var(--m1-navy);
    height: 100%;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    position: relative;
}
.m1-practice-card:hover, .m1-practice-card:focus {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 54, 100, 0.08);
    border-color: var(--m1-grey-400);
    color: var(--m1-navy);
    outline: none;
}

.m1-practice-card-blue   { background: var(--m1-sky); }
.m1-practice-card-green  { background: var(--m1-mint-soft); }
.m1-practice-card-yellow { background: var(--m1-yellow-soft); }
.m1-practice-card-purple { background: var(--m1-purple-soft); }

.m1-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    color: #fff;
    margin-bottom: 0.85rem;
}
.m1-card-icon svg { width: 22px; height: 22px; }
.m1-card-icon-blue   { background: var(--m1-blue); }
.m1-card-icon-green  { background: var(--m1-mint); }
.m1-card-icon-yellow { background: var(--m1-yellow); }
.m1-card-icon-purple { background: #8B5CF6; }

.m1-practice-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 0.4rem 0;
    color: var(--m1-navy);
}
.m1-practice-card p {
    font-size: 0.9rem;
    color: var(--m1-grey-600);
    margin: 0 0 0.85rem 0;
    line-height: 1.4;
}
.m1-card-action {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--m1-blue);
}
.m1-practice-card-green  .m1-card-action { color: #3F8C42; }
.m1-practice-card-yellow .m1-card-action { color: #B97F0A; }
.m1-practice-card-purple .m1-card-action { color: #6D45C8; }

.m1-card-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: var(--m1-purple-soft);
    color: #6D45C8;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}


/* Info cards (Tables / Charts / Did you know) */
.m1-info-card {
    background: #fff;
    border: 1px solid var(--m1-grey-200);
    border-radius: 14px;
    padding: 1.25rem;
    height: 100%;
}
.m1-info-card-yellow { background: var(--m1-yellow-soft); border-color: rgba(246, 171, 16, 0.3); }

.m1-info-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.m1-info-card-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: var(--m1-navy);
}
.m1-info-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: var(--m1-mint);
    background: var(--m1-mint-soft);
    flex-shrink: 0;
}
.m1-info-card-icon svg { width: 20px; height: 20px; }
.m1-info-card-icon-yellow { color: var(--m1-yellow); background: rgba(246, 171, 16, 0.18); }

.m1-info-card-desc {
    font-size: 0.9rem;
    color: var(--m1-grey-600);
    margin-bottom: 0.85rem;
    line-height: 1.4;
}

/* Quick-link buttons inside info cards (table numbers, chart sizes) */
.m1-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.85rem;
}
.m1-quick-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    padding: 0.3rem 0.65rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--m1-blue);
    background: #fff;
    border: 1px solid var(--m1-grey-200);
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.m1-quick-link:hover, .m1-quick-link:focus {
    background: var(--m1-blue);
    color: #fff;
    border-color: var(--m1-blue);
    outline: none;
}

.m1-info-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--m1-blue);
    text-decoration: none;
}
.m1-info-link:hover { text-decoration: underline; }


/* Did you know? fact body */
.m1-fact-body {
    font-size: 0.95rem;
    color: var(--m1-navy);
    line-height: 1.5;
    margin-bottom: 0.85rem;
}


/* Trust badges row (Build Confidence / Improve Every Day / Have Fun) */
.m1-trust-row {
    background: var(--m1-sky);
    border-radius: 14px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.m1-trust-badge {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}
.m1-trust-badge-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: #fff;
    flex-shrink: 0;
}
.m1-trust-badge-icon svg { width: 22px; height: 22px; }
.m1-trust-badge-icon-blue   { background: var(--m1-blue); }
.m1-trust-badge-icon-green  { background: var(--m1-mint); }
.m1-trust-badge-icon-yellow { background: var(--m1-yellow); }

.m1-trust-badge h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    color: var(--m1-navy);
}
.m1-trust-badge p {
    font-size: 0.85rem;
    color: var(--m1-grey-600);
    margin: 0;
    line-height: 1.4;
}


/* ============================================================
   FLASHCARDS (Quick Practice)
   ============================================================ */

.m1-flashcards {
    max-width: 640px;
    margin: 0 auto;
    padding: 1rem 0;
}

/* ----- Setup screen ----- */
.m1-flashcards-setup {
    text-align: center;
}
.m1-flashcards-setup h1 {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 700;
    color: var(--m1-navy);
    margin-bottom: 0.5rem;
}
.m1-flashcards-setup p {
    color: var(--m1-grey-600);
    margin-bottom: 1.5rem;
}

/* Table picker - grid of 12 number buttons + an "All tables" pill */
.m1-table-picker {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}
@media (min-width: 576px) {
    .m1-table-picker { grid-template-columns: repeat(6, 1fr); }
}
.m1-table-picker-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    border: 2px solid var(--m1-grey-200);
    border-radius: 14px;
    background: #fff;
    color: var(--m1-navy);
    font-size: 1.6rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s ease, border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.m1-table-picker-btn:hover,
.m1-table-picker-btn:focus {
    border-color: var(--m1-blue);
    color: var(--m1-blue);
    outline: none;
    transform: translateY(-1px);
}
.m1-table-picker-all {
    display: block;
    width: 100%;
    padding: 0.85rem 1rem;
    border: 2px solid var(--m1-blue);
    border-radius: 14px;
    background: var(--m1-blue);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.m1-table-picker-all:hover,
.m1-table-picker-all:focus {
    background: var(--m1-blue-dark);
    border-color: var(--m1-blue-dark);
    color: #fff;
    outline: none;
}

/* Endless-mode toggle on the setup screen */
.m1-endless-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin: 1rem auto 0;
    padding: 0.45rem 0.95rem;
    border: 1px solid var(--m1-grey-200);
    border-radius: 999px;
    cursor: pointer;
    color: var(--m1-grey-600);
    font-size: 0.9rem;
    font-weight: 500;
    user-select: none;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.m1-endless-toggle:hover {
    border-color: var(--m1-blue);
    color: var(--m1-blue);
    background: var(--m1-sky);
}
.m1-endless-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--m1-blue);
    cursor: pointer;
}
.m1-endless-toggle-hint {
    color: var(--m1-grey-400);
    font-size: 0.78rem;
    font-weight: 400;
    margin-left: 0.2rem;
}

/* In endless mode, hide the round-progress bar (it's infinite) */
.m1-flashcards-bar.endless .m1-flashcards-progress { visibility: hidden; }


/* ----- Playing screen ----- */
.m1-flashcards-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    color: var(--m1-grey-600);
    font-size: 0.95rem;
    font-weight: 500;
}
.m1-flashcards-progress {
    flex: 1;
    margin: 0 1rem;
    height: 6px;
    background: var(--m1-grey-200);
    border-radius: 999px;
    overflow: hidden;
}
.m1-flashcards-progress-bar {
    height: 100%;
    background: var(--m1-blue);
    width: 0;
    transition: width 0.2s ease;
}
.m1-flashcards-quit {
    background: transparent;
    border: 0;
    color: var(--m1-grey-400);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}
.m1-flashcards-quit:hover { color: var(--m1-navy); }

.m1-flashcards-card {
    background: #fff;
    border: 2px solid var(--m1-grey-200);
    border-radius: 18px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    user-select: none;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.m1-flashcards-card:hover {
    border-color: var(--m1-blue);
    box-shadow: 0 8px 24px rgba(33, 54, 100, 0.08);
}
.m1-flashcards-card.revealed { border-color: var(--m1-mint); }

.m1-flashcards-question {
    font-size: clamp(2.4rem, 7vw, 3.4rem);
    font-weight: 700;
    color: var(--m1-navy);
    line-height: 1.2;
    letter-spacing: 0.02em;
}
.m1-flashcards-answer {
    color: var(--m1-mint);
}
.m1-flashcards-hint {
    margin-top: 1.25rem;
    color: var(--m1-grey-400);
    font-size: 0.9rem;
    font-weight: 500;
}

.m1-flashcards-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

/* ----- End screen ----- */
.m1-flashcards-end {
    text-align: center;
    padding: 2rem 1rem;
}
.m1-flashcards-end-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--m1-mint-soft);
    color: var(--m1-mint);
    margin-bottom: 1rem;
}
.m1-flashcards-end-icon svg { width: 44px; height: 44px; }
.m1-flashcards-end h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--m1-navy);
    margin-bottom: 0.5rem;
}
.m1-flashcards-end p {
    color: var(--m1-grey-600);
    margin-bottom: 1.5rem;
}
.m1-flashcards-end-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}


/* Game-page "below the picker" content (How it works / Tips / Cross-links).
   Lives inside the setup section so it auto-hides when the game starts. */
.m1-game-info {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--m1-grey-200);
    text-align: left;
}
.m1-game-info h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--m1-navy);
    margin-bottom: 1rem;
    margin-top: 2rem;
}
.m1-game-info h2:first-child { margin-top: 0; }
.m1-game-info p { color: var(--m1-grey-600); line-height: 1.5; }

.m1-game-steps {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}
@media (min-width: 576px) {
    .m1-game-steps { grid-template-columns: repeat(3, 1fr); }
}
.m1-game-step {
    background: #fff;
    border: 1px solid var(--m1-grey-200);
    border-radius: 12px;
    padding: 1rem 1.1rem;
}
.m1-game-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--m1-blue);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}
.m1-game-step h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--m1-navy);
    margin: 0 0 0.25rem 0;
}
.m1-game-step p {
    font-size: 0.85rem;
    color: var(--m1-grey-600);
    margin: 0;
    line-height: 1.4;
}

.m1-game-tips {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}
@media (min-width: 576px) {
    .m1-game-tips { grid-template-columns: repeat(3, 1fr); }
}
.m1-game-tip {
    background: var(--m1-sky);
    border-radius: 12px;
    padding: 1rem 1.1rem;
}
.m1-game-tip h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--m1-navy);
    margin: 0 0 0.4rem 0;
}
.m1-game-tip p {
    font-size: 0.85rem;
    color: var(--m1-grey-600);
    margin: 0;
    line-height: 1.4;
}

.m1-game-related {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
}
@media (min-width: 576px) {
    .m1-game-related { grid-template-columns: repeat(2, 1fr); }
}


/* ============================================================
   QUIZ (multiple-choice practice)
   Reuses .m1-table-picker / .m1-table-picker-btn from Flashcards
   for the setup screen.
   ============================================================ */

.m1-quiz {
    max-width: 640px;
    margin: 0 auto;
    padding: 1rem 0;
}

.m1-quiz-setup {
    text-align: center;
}
.m1-quiz-setup h1 {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 700;
    color: var(--m1-navy);
    margin-bottom: 0.5rem;
}
.m1-quiz-setup p {
    color: var(--m1-grey-600);
    margin-bottom: 1.5rem;
}

/* Playing screen: top bar shared in style with flashcards but with
   a score counter on the right */
.m1-quiz-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    color: var(--m1-grey-600);
    font-size: 0.95rem;
    font-weight: 500;
    gap: 0.75rem;
}
.m1-quiz-progress {
    flex: 1;
    height: 6px;
    background: var(--m1-grey-200);
    border-radius: 999px;
    overflow: hidden;
}
.m1-quiz-progress-bar {
    height: 100%;
    background: var(--m1-blue);
    width: 0;
    transition: width 0.2s ease;
}
/* Timed mode: bar drains from 100 -> 0; turn red when <10s left. */
.m1-quiz-bar.timed .m1-quiz-progress-bar { transition: width 1s linear; }
.m1-quiz-bar.timed.low .m1-quiz-progress-bar { background: #D9534F; }
.m1-quiz-bar.timed.low #quiz-progress-txt { color: #D9534F; font-weight: 700; }
.m1-quiz-score { white-space: nowrap; font-weight: 600; color: var(--m1-navy); }
.m1-quiz-quit {
    background: transparent;
    border: 0;
    color: var(--m1-grey-400);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}
.m1-quiz-quit:hover { color: var(--m1-navy); }

/* Question card */
.m1-quiz-question-card {
    background: #fff;
    border: 2px solid var(--m1-grey-200);
    border-radius: 18px;
    padding: 2rem 1.5rem;
    text-align: center;
    margin-bottom: 1rem;
}
.m1-quiz-question {
    font-size: clamp(2.2rem, 6vw, 3rem);
    font-weight: 700;
    color: var(--m1-navy);
    letter-spacing: 0.02em;
}

/* Answer grid (2x2) */
.m1-quiz-answers {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}
.m1-quiz-answer {
    padding: 1.25rem 1rem;
    background: #fff;
    border: 2px solid var(--m1-grey-200);
    border-radius: 14px;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--m1-navy);
    cursor: pointer;
    transition: transform 0.1s ease, border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
    text-align: center;
}
.m1-quiz-answer:hover,
.m1-quiz-answer:focus {
    border-color: var(--m1-blue);
    color: var(--m1-blue);
    outline: none;
    transform: translateY(-1px);
}
.m1-quiz-answer:disabled {
    cursor: default;
    transform: none;
}
.m1-quiz-answer.correct {
    background: var(--m1-mint-soft);
    border-color: var(--m1-mint);
    color: var(--m1-mint);
}
.m1-quiz-answer.wrong {
    background: var(--m1-pink-soft);
    border-color: #D9534F;
    color: #B23A3A;
}

/* End screen */
.m1-quiz-end {
    text-align: center;
    padding: 2rem 1rem;
}
.m1-quiz-end-score {
    font-size: clamp(3rem, 10vw, 5rem);
    font-weight: 800;
    color: var(--m1-blue);
    line-height: 1;
    margin-bottom: 0.5rem;
}
.m1-quiz-end h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--m1-navy);
    margin-bottom: 0.5rem;
}
.m1-quiz-end p {
    color: var(--m1-grey-600);
    margin-bottom: 1.5rem;
}
.m1-quiz-end-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}


/* ============================================================
   TIPS FORM (/tips)
   Honeypot fields: NOT display:none since some bots skip that.
   Instead move off-screen. Also aria-hidden + tabindex=-1 in the
   markup so keyboard + screen-reader users skip past.
   ============================================================ */

.m1-honeypot {
    position: absolute !important;
    left: -10000px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
.m1-tips-form .form-label { color: var(--m1-navy); }
.m1-tips-form textarea    { font-family: 'Nunito', sans-serif; }


/* ============================================================
   HUB LANDING (used by /practice/quick)
   Marketing-style hub layout: starred H1, two big primary cards
   (one recommended), a numbered "good place to start" step row,
   "other ways to practice" pastel cross-links, trust badge row.
   ============================================================ */

.m1-hub-title {
    text-align: center;
    font-size: clamp(2rem, 5.5vw, 2.6rem);
    font-weight: 800;
    color: var(--m1-navy);
    margin: 0.5rem 0 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.m1-hub-star {
    display: inline-flex;
    color: var(--m1-yellow);
    width: 1.4rem;
    height: 1.4rem;
}
.m1-hub-star svg { width: 100%; height: 100%; }
.m1-hub-lead {
    text-align: center;
    color: var(--m1-grey-600);
    font-size: clamp(0.95rem, 2.2vw, 1.05rem);
    max-width: 640px;
    margin: 0 auto 1.5rem;
    line-height: 1.55;
}

/* Primary cards */
.m1-hub-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 2px solid var(--m1-grey-200);
    border-radius: 18px;
    padding: 1.5rem 1.25rem 1.25rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.m1-hub-card:hover,
.m1-hub-card:focus-visible {
    border-color: var(--m1-blue);
    box-shadow: 0 10px 28px rgba(33, 54, 100, 0.10);
    text-decoration: none;
    color: inherit;
    outline: none;
    transform: translateY(-2px);
}
.m1-hub-card-recommended {
    border-color: var(--m1-blue);
    box-shadow: 0 6px 20px rgba(33, 54, 100, 0.08);
}
.m1-hub-card-recbadge {
    position: absolute;
    top: 0.85rem;
    left: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: var(--m1-blue);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
}
.m1-hub-card-recbadge svg { width: 12px; height: 12px; }

.m1-hub-card-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}
.m1-hub-card:not(.m1-hub-card-recommended) .m1-hub-card-head {
    margin-top: 0;
}
.m1-hub-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--m1-sky);
    color: var(--m1-blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.m1-hub-card-icon svg { width: 28px; height: 28px; }
.m1-hub-card-head-text { flex: 1; }
.m1-hub-card-head-text h2 {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: 800;
    color: var(--m1-navy);
    margin: 0 0 0.3rem 0;
    line-height: 1.2;
}
.m1-hub-card-pill {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    background: var(--m1-sky);
    color: var(--m1-blue);
}
.m1-hub-card-pill-green {
    background: var(--m1-mint-soft);
    color: #3F8C42;
}
.m1-hub-card-desc {
    color: var(--m1-grey-600);
    font-size: 0.95rem;
    margin: 0 0 1rem 0;
    line-height: 1.5;
}
.m1-hub-card-illustration {
    background: #F4F7FE;
    border-radius: 12px;
    padding: 1.25rem 1rem;
    text-align: center;
    margin-bottom: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 110px;
}
.m1-hub-card-illustration svg { max-width: 100%; height: auto; }
.m1-hub-card-caption {
    margin-top: 0.65rem;
    font-weight: 700;
    color: var(--m1-navy);
    font-size: 0.95rem;
}
.m1-hub-card-cta {
    display: block;
    background: var(--m1-blue);
    color: #fff;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
    transition: background 0.15s ease;
}
.m1-hub-card:hover .m1-hub-card-cta,
.m1-hub-card:focus-visible .m1-hub-card-cta {
    background: var(--m1-blue-dark);
}

/* Section titles between blocks */
.m1-hub-section-title {
    text-align: center;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--m1-navy);
    margin: 2.5rem 0 1rem;
}

/* Numbered step cards: 2x2 grid layout - number top-left, illustration
   bottom-left (close to the number, left-aligned), body spans both rows
   on the right. Tight column gap + narrower icon column gives the body
   more horizontal room. */
.m1-hub-step-card {
    display: grid;
    grid-template-columns: 90px 1fr;
    grid-template-rows: auto auto;
    column-gap: 0.5rem;
    row-gap: 0.25rem;
    align-items: center;
    background: #fff;
    border: 1px solid var(--m1-grey-200);
    border-radius: 14px;
    padding: 1.1rem 1.25rem 1.1rem 0.9rem;
    height: 100%;
}
.m1-hub-step-num {
    grid-column: 1;
    grid-row: 1;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--m1-blue);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    justify-self: start;
}
.m1-hub-step-icon {
    grid-column: 1;
    grid-row: 2;
    width: 90px;
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: start;
}
.m1-hub-step-icon svg,
.m1-hub-step-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.m1-hub-step-body {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    min-width: 0;
}
.m1-hub-step-body h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--m1-navy);
    margin: 0 0 0.3rem 0;
}
.m1-hub-step-body p {
    font-size: 0.9rem;
    color: var(--m1-grey-600);
    margin: 0;
    line-height: 1.45;
}

/* "Other ways to practice" pastel cards */
.m1-hub-other-card {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    height: 100%;
}
.m1-hub-other-card:hover,
.m1-hub-other-card:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(33, 54, 100, 0.08);
    text-decoration: none;
    color: inherit;
    outline: none;
}
.m1-hub-other-purple { background: var(--m1-purple-soft); }
.m1-hub-other-green  { background: var(--m1-mint-soft); }
.m1-hub-other-yellow { background: var(--m1-yellow-soft); }

.m1-hub-other-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}
.m1-hub-other-purple .m1-hub-other-icon { background: #8B5CF6; }
.m1-hub-other-green  .m1-hub-other-icon { background: var(--m1-mint); }
.m1-hub-other-yellow .m1-hub-other-icon { background: var(--m1-yellow); }
.m1-hub-other-icon svg { width: 24px; height: 24px; }
.m1-hub-other-body { flex: 1; min-width: 0; }
.m1-hub-other-body h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.2rem 0;
}
.m1-hub-other-purple .m1-hub-other-body h3 { color: #6D45C8; }
.m1-hub-other-green  .m1-hub-other-body h3 { color: #3F8C42; }
.m1-hub-other-yellow .m1-hub-other-body h3 { color: #B97F0A; }
.m1-hub-other-body p {
    font-size: 0.85rem;
    color: var(--m1-grey-600);
    margin: 0 0 0.35rem 0;
    line-height: 1.4;
}
.m1-hub-other-start {
    font-size: 0.85rem;
    font-weight: 700;
}
.m1-hub-other-purple .m1-hub-other-start { color: #6D45C8; }
.m1-hub-other-green  .m1-hub-other-start { color: #3F8C42; }
.m1-hub-other-yellow .m1-hub-other-start { color: #B97F0A; }

/* Trust badges row */
.m1-hub-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    background: var(--m1-sky);
    border-radius: 14px;
    padding: 1.1rem 1.25rem;
}
.m1-hub-trust-item {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}
.m1-hub-trust-icon {
    width: 36px;
    height: 36px;
    color: var(--m1-blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.m1-hub-trust-icon svg { width: 24px; height: 24px; }
.m1-hub-trust-item h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--m1-navy);
    margin: 0 0 0.1rem 0;
}
.m1-hub-trust-item p {
    font-size: 0.8rem;
    color: var(--m1-grey-600);
    margin: 0;
    line-height: 1.4;
}


/* ============================================================
   GAME BACK LINK
   Sits at the top of every game container (Quick / Quiz / Type /
   Memory). Always visible across setup/play/end so the user can
   exit the game without using the sidebar or browser-back.
   ============================================================ */

.m1-game-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--m1-grey-600);
    text-decoration: none;
    padding: 0.4rem 0.6rem 0.4rem 0.4rem;
    margin-bottom: 0.75rem;
    border-radius: 8px;
    transition: color 0.15s ease, background 0.15s ease;
}
.m1-game-back:hover,
.m1-game-back:focus-visible {
    color: var(--m1-blue);
    background: var(--m1-sky);
    text-decoration: none;
    outline: none;
}
.m1-game-back svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}


/* ============================================================
   MODE SELECTOR (round-length chips)
   Used on Quiz + Type Practice setup screens, above the table
   picker. Five chips: 10 Questions / Endless / 1 min / 2 min /
   5 min. Exactly one is always .selected. JS reads the
   selected chip when the user picks a table.
   ============================================================ */

.m1-mode-selector-label {
    display: block;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--m1-grey-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0.5rem 0 0.4rem;
}
.m1-mode-selector {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    margin: 0 0 1.5rem;
}
.m1-mode-chip {
    padding: 0.4rem 0.95rem;
    background: #fff;
    border: 2px solid var(--m1-grey-200);
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--m1-grey-600);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
    white-space: nowrap;
}
.m1-mode-chip:hover {
    border-color: var(--m1-blue);
    color: var(--m1-blue);
}
.m1-mode-chip:focus-visible {
    outline: 2px solid var(--m1-blue);
    outline-offset: 2px;
}
.m1-mode-chip.selected {
    background: var(--m1-blue);
    border-color: var(--m1-blue);
    color: #fff;
}


/* ============================================================
   PRACTICE-HUB MODE CARD
   The 4 "pick a mode" cards on /practice and /practice/games.
   White body with a thin coloured top stripe that marks which
   mode it is (matches the home-page card colour for that mode).
   ============================================================ */

.m1-mode-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid var(--m1-grey-200);
    border-top: 4px solid var(--m1-grey-200);
    border-radius: 12px;
    padding: 1.25rem 1rem;
    text-align: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.m1-mode-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(33, 54, 100, 0.08);
}
.m1-mode-card h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--m1-navy);
    margin: 0 0 0.35rem 0;
}
.m1-mode-card p {
    flex: 1;
    color: var(--m1-grey-600);
    font-size: 0.9rem;
    margin: 0 0 1rem 0;
}
.m1-mode-card-blue   { border-top-color: var(--m1-blue); }
.m1-mode-card-purple { border-top-color: #8B5CF6; }
.m1-mode-card-green  { border-top-color: var(--m1-mint); }
.m1-mode-card-yellow { border-top-color: var(--m1-yellow); }


/* ============================================================
   TYPE PRACTICE
   Reuses .m1-table-picker / .m1-table-picker-btn for setup
   and .m1-endless-toggle for the endless checkbox.
   ============================================================ */

.m1-type {
    max-width: 640px;
    margin: 0 auto;
    padding: 1rem 0;
}
.m1-type-setup h1 {
    text-align: center;
    color: var(--m1-navy);
    margin-bottom: 0.5rem;
}
.m1-type-setup > p {
    text-align: center;
    color: var(--m1-grey-600);
    margin-bottom: 1.5rem;
}

/* Top bar (progress + score + quit) - same layout as quiz */
.m1-type-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    color: var(--m1-grey-600);
    font-size: 0.95rem;
    font-weight: 500;
    gap: 0.75rem;
}
.m1-type-bar.endless .m1-type-progress { display: none; }
.m1-type-progress {
    flex: 1;
    height: 8px;
    background: var(--m1-grey-200);
    border-radius: 4px;
    overflow: hidden;
}
.m1-type-progress-bar {
    height: 100%;
    background: var(--m1-blue);
    transition: width 0.25s ease;
    width: 0%;
}
/* Timed mode: bar drains from 100 -> 0; turn red when <10s left. */
.m1-type-bar.timed .m1-type-progress-bar { transition: width 1s linear; }
.m1-type-bar.timed.low .m1-type-progress-bar { background: #D9534F; }
.m1-type-bar.timed.low #type-progress-txt { color: #D9534F; font-weight: 700; }
.m1-type-score {
    font-weight: 700;
    color: var(--m1-navy);
    white-space: nowrap;
}
.m1-type-quit {
    background: none;
    border: none;
    color: var(--m1-grey-600);
    font-size: 1.5rem;
    line-height: 1;
    padding: 0 0.25rem;
    cursor: pointer;
}
.m1-type-quit:hover { color: var(--m1-navy); }

/* Question card with inline equation + input */
.m1-type-question-card {
    background: #fff;
    border: 2px solid var(--m1-grey-200);
    border-radius: 18px;
    padding: 2rem 1.5rem;
    text-align: center;
    margin-bottom: 1rem;
}
.m1-type-equation {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 700;
    color: var(--m1-navy);
    letter-spacing: 0.02em;
    line-height: 1.2;
}
.m1-type-op,
.m1-type-eq {
    padding: 0 0.15rem;
    color: var(--m1-grey-400);
}
.m1-type-input {
    display: inline-block;
    width: 7rem;
    max-width: 50vw;
    padding: 0.3rem 0.5rem;
    border: 3px solid var(--m1-grey-200);
    border-radius: 12px;
    background: var(--m1-sky);
    font-size: inherit;
    font-weight: inherit;
    font-family: inherit;
    text-align: center;
    color: var(--m1-navy);
    -moz-appearance: textfield;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.m1-type-input::-webkit-outer-spin-button,
.m1-type-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.m1-type-input:focus {
    outline: none;
    border-color: var(--m1-blue);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(30, 97, 208, 0.18);
}
.m1-type-input.correct {
    background: var(--m1-mint-soft);
    border-color: var(--m1-mint);
    color: var(--m1-mint);
}
.m1-type-input.wrong {
    background: var(--m1-pink-soft);
    border-color: #D9534F;
    color: #B23A3A;
}
.m1-type-actions {
    margin-top: 1.25rem;
}
.m1-type-actions .btn {
    min-width: 120px;
}
.m1-type-hint {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--m1-grey-600);
}
.m1-type-feedback {
    margin-top: 0.5rem;
    min-height: 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--m1-grey-600);
}
.m1-type-feedback.correct { color: var(--m1-mint); }
.m1-type-feedback.wrong   { color: #B23A3A; }

/* End screen - same shape as quiz end */
.m1-type-end {
    text-align: center;
    padding: 2rem 1rem;
}
.m1-type-end-score {
    font-size: clamp(3rem, 10vw, 5rem);
    font-weight: 800;
    color: var(--m1-blue);
    line-height: 1;
    margin-bottom: 0.5rem;
}
.m1-type-end h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--m1-navy);
    margin-bottom: 0.5rem;
}
.m1-type-end p {
    color: var(--m1-grey-600);
    margin-bottom: 1.5rem;
}
.m1-type-end-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}


/* ============================================================
   EQUAL GROUPS (Quick Practice)
   Visual multiplication as "a groups of b items". Each problem
   shows a x b group boxes with b colorful emoji each. Same
   tap-to-reveal grammar as Flashcards (the other Quick Practice
   exercise) but with a visual reveal instead of just a number.

   Noto Color Emoji is loaded only on this page (it's ~5MB) -
   for users who already have a system emoji font (most), the
   font stack falls back to theirs.
   ============================================================ */

.m1-groups {
    max-width: 720px;
    margin: 0 auto;
    padding: 1rem 0;
}
.m1-groups-setup h1 {
    text-align: center;
    color: var(--m1-navy);
    margin-bottom: 0.5rem;
}
.m1-groups-setup > p {
    text-align: center;
    color: var(--m1-grey-600);
    margin-bottom: 1.5rem;
}
.m1-groups-note {
    text-align: center;
    color: var(--m1-grey-400);
    margin: 0.5rem 0 0;
}

/* Bar - same shape as flashcards bar */
.m1-groups-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    color: var(--m1-grey-600);
    font-size: 0.95rem;
    gap: 0.75rem;
}
.m1-groups-bar.endless .m1-groups-progress { display: none; }
.m1-groups-progress {
    flex: 1;
    height: 6px;
    background: var(--m1-grey-200);
    border-radius: 999px;
    overflow: hidden;
}
.m1-groups-progress-bar {
    height: 100%;
    background: var(--m1-blue);
    width: 0;
    transition: width 0.2s ease;
}
.m1-groups-quit {
    background: transparent;
    border: 0;
    color: var(--m1-grey-400);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
}
.m1-groups-quit:hover { color: var(--m1-navy); }

/* Score on the bar */
.m1-groups-score {
    white-space: nowrap;
    font-weight: 600;
    color: var(--m1-navy);
}

/* The card */
.m1-groups-card {
    background: #fff;
    border: 2px solid var(--m1-grey-200);
    border-radius: 18px;
    padding: 1.5rem 1rem;
    text-align: center;
}

.m1-groups-prompt {
    font-size: clamp(1rem, 3vw, 1.2rem);
    font-weight: 600;
    color: var(--m1-grey-600);
    margin-bottom: 1rem;
    text-align: left;
}

/* Visual area: circular group containers, flex-wrap on small screens */
.m1-groups-visual {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 0.5rem 0 1.25rem;
    min-height: 110px;
}
.m1-groups-circle {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    background: #fff;
    border: 2px solid var(--m1-grey-200);
    border-radius: 50%;
    aspect-ratio: 1;
    gap: 0.3rem;
}
.m1-groups-circle-sm { width: 110px; padding: 0.85rem; }
.m1-groups-circle-md { width: 140px; padding: 0.9rem;  }
.m1-groups-circle-lg { width: 165px; padding: 1rem;    }

.m1-groups-emoji {
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
    font-size: 1.3rem;
    line-height: 1;
    display: inline-block;
}
.m1-groups-circle-sm .m1-groups-emoji { font-size: 1.4rem; }
.m1-groups-circle-md .m1-groups-emoji { font-size: 1.25rem; }
.m1-groups-circle-lg .m1-groups-emoji { font-size: 1.1rem; }

/* Clipart variant (See the Groups peek-style uses SVG art under
   /images/cliparts/ instead of emoji glyphs). Sized per circle tier
   so groups stay consistent regardless of items per group. */
.m1-groups-clipart {
    display: inline-block;
    object-fit: contain;
    width: 36px;
    height: 36px;
}
.m1-groups-circle-sm .m1-groups-clipart { width: 38px; height: 38px; }
.m1-groups-circle-md .m1-groups-clipart { width: 32px; height: 32px; }
.m1-groups-circle-lg .m1-groups-clipart { width: 26px; height: 26px; }

/* The equation row: [a] x [b] = [c] - three boxed inputs */
.m1-groups-equation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0.75rem 0;
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    color: var(--m1-navy);
}
.m1-groups-op {
    color: var(--m1-grey-400);
    padding: 0 0.15rem;
}
.m1-groups-input {
    width: 3.2rem;
    padding: 0.3rem 0.4rem;
    border: 3px solid var(--m1-grey-200);
    border-radius: 12px;
    background: var(--m1-sky);
    font-size: inherit;
    font-weight: inherit;
    font-family: inherit;
    text-align: center;
    color: var(--m1-navy);
    -moz-appearance: textfield;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.m1-groups-input-wide { width: 4.2rem; }
.m1-groups-input::-webkit-outer-spin-button,
.m1-groups-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.m1-groups-input:focus {
    outline: none;
    border-color: var(--m1-blue);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(30, 97, 208, 0.18);
}
.m1-groups-input.correct {
    background: var(--m1-mint-soft);
    border-color: var(--m1-mint);
    color: var(--m1-mint);
}
.m1-groups-input.wrong {
    background: var(--m1-pink-soft);
    border-color: #D9534F;
    color: #B23A3A;
}

.m1-groups-check {
    margin-top: 0.5rem;
    min-width: 160px;
}
.m1-groups-feedback {
    margin-top: 0.75rem;
    min-height: 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--m1-grey-600);
}
.m1-groups-feedback.correct { color: var(--m1-mint); }
.m1-groups-feedback.wrong   { color: #B23A3A; }


/* ============================================================
   SEE THE GROUPS (Quick Practice peek variant)
   Reuses the .m1-groups-visual / .m1-groups-circle / .m1-groups-emoji
   primitives. Adds peek-only styles for the reveal block and the
   clickable card wrapper. Reuses .m1-flashcards-bar / -progress
   / -end patterns from the existing Flashcards exercise.
   ============================================================ */

.m1-see-card {
    background: #fff;
    border: 2px solid var(--m1-grey-200);
    border-radius: 18px;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
}
.m1-see-card:hover {
    border-color: var(--m1-blue);
    box-shadow: 0 4px 14px rgba(33, 54, 100, 0.08);
}
.m1-see-card:focus-visible {
    outline: 2px solid var(--m1-blue);
    outline-offset: 4px;
}

.m1-see-reveal {
    min-height: 3.2rem;
    margin: 0.5rem 0 0.4rem;
}
.m1-see-card.revealed .m1-see-reveal {
    animation: m1-see-fade-in 0.3s ease both;
}
.m1-see-eq {
    font-size: clamp(1.6rem, 4.5vw, 2.4rem);
    font-weight: 800;
    color: var(--m1-navy);
    line-height: 1.1;
}
.m1-see-eq strong {
    color: var(--m1-blue);
    margin-left: 0.15rem;
}
.m1-see-words {
    margin-top: 0.4rem;
    font-size: 0.95rem;
    color: var(--m1-grey-600);
}
.m1-see-hint {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--m1-grey-600);
}

@keyframes m1-see-fade-in {
    0%   { opacity: 0; transform: translateY(6px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* End screen - same shape as flashcards end */
.m1-groups-end {
    text-align: center;
    padding: 2rem 1rem;
}
.m1-groups-end-icon {
    color: var(--m1-mint);
    margin-bottom: 1rem;
}
.m1-groups-end-icon svg { width: 56px; height: 56px; }
.m1-groups-end h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--m1-navy);
    margin-bottom: 0.5rem;
}
.m1-groups-end p {
    color: var(--m1-grey-600);
    margin-bottom: 1.5rem;
}
.m1-groups-end-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}


/* ============================================================
   TAP THE MULTIPLES (Games)
   5x5 grid of numbers. Tap the ones that are multiples of the
   target. Correct tap = green pop animation, wrong = red shake.
   ============================================================ */

.m1-multiples {
    max-width: 480px;
    margin: 0 auto;
    padding: 1rem 0;
}
.m1-multiples-setup h1 {
    text-align: center;
    color: var(--m1-navy);
    margin-bottom: 0.5rem;
}
.m1-multiples-setup > p {
    text-align: center;
    color: var(--m1-grey-600);
    margin-bottom: 1.5rem;
}
.m1-multiples-note {
    text-align: center;
    color: var(--m1-grey-400);
    margin: 0.5rem 0 0;
}

/* Play screen */
.m1-multiples-target {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--m1-navy);
    margin-bottom: 0.75rem;
}
.m1-multiples-target strong {
    color: var(--m1-blue);
    font-size: 1.5rem;
    margin-left: 0.2rem;
}
.m1-multiples-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    color: var(--m1-grey-600);
    font-size: 0.95rem;
    gap: 0.75rem;
}
.m1-multiples-stat-label {
    margin-right: 0.3rem;
    color: var(--m1-grey-400);
}
.m1-multiples-stat {
    font-weight: 700;
    color: var(--m1-navy);
}
.m1-multiples-quit {
    background: none;
    border: none;
    color: var(--m1-grey-400);
    font-size: 1.3rem;
    line-height: 1;
    padding: 0 0.25rem;
    cursor: pointer;
}
.m1-multiples-quit:hover { color: var(--m1-navy); }

/* 5x5 grid */
.m1-multiples-board {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
}
.m1-multiples-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 2px solid var(--m1-grey-200);
    border-radius: 12px;
    font-size: clamp(0.95rem, 3.5vw, 1.3rem);
    font-weight: 700;
    color: var(--m1-navy);
    cursor: pointer;
    transition: transform 0.15s ease, background 0.2s ease, border-color 0.15s ease, opacity 0.35s ease, color 0.15s ease;
    font-family: 'Nunito', sans-serif;
    font-feature-settings: 'tnum';
    padding: 0;
}
@media (hover: hover) {
    .m1-multiples-cell:hover:not(:disabled):not(.popped):not(.wrong) {
        transform: translateY(-2px);
        border-color: var(--m1-blue);
        box-shadow: 0 4px 10px rgba(33, 54, 100, 0.1);
    }
}
.m1-multiples-cell:disabled { cursor: default; }

/* Correct tap - pop + fade */
.m1-multiples-cell.popped {
    background: var(--m1-mint-soft);
    border-color: var(--m1-mint);
    color: var(--m1-mint);
    opacity: 0;
    transform: scale(0.85);
    pointer-events: none;
}

/* Wrong tap - red shake (auto-clears in JS after ~450ms) */
.m1-multiples-cell.wrong {
    background: var(--m1-pink-soft);
    border-color: #D9534F;
    color: #B23A3A;
    animation: m1-multiples-shake 0.4s ease;
}
@keyframes m1-multiples-shake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-5px); }
    40%      { transform: translateX(5px); }
    60%      { transform: translateX(-3px); }
    80%      { transform: translateX(3px); }
}

/* End screen - same shape as Memory Match end */
.m1-multiples-end {
    text-align: center;
    padding: 2rem 1rem;
}
.m1-multiples-end-icon {
    color: var(--m1-yellow);
    margin-bottom: 1rem;
}
.m1-multiples-end-icon svg {
    width: 56px;
    height: 56px;
}
.m1-multiples-end h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--m1-navy);
    margin-bottom: 0.5rem;
}
.m1-multiples-end p {
    color: var(--m1-grey-600);
    margin-bottom: 1.5rem;
}
.m1-multiples-end-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}


/* ============================================================
   MEMORY MATCH (Games)
   Reuses .m1-table-picker / .m1-table-picker-btn for setup.
   ============================================================ */

.m1-memory {
    max-width: 640px;
    margin: 0 auto;
    padding: 1rem 0;
}

.m1-memory-setup { text-align: center; }
.m1-memory-setup h1 {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 700;
    color: var(--m1-navy);
    margin-bottom: 0.5rem;
}
.m1-memory-setup p {
    color: var(--m1-grey-600);
    margin-bottom: 1.5rem;
}

/* Playing top bar */
.m1-memory-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    color: var(--m1-grey-600);
    font-size: 0.95rem;
    font-weight: 500;
    gap: 0.75rem;
}
.m1-memory-stats { display: flex; gap: 1.25rem; }
.m1-memory-stat { color: var(--m1-navy); font-weight: 600; }
.m1-memory-stat-label { color: var(--m1-grey-400); font-weight: 500; margin-right: 0.3rem; }
.m1-memory-quit {
    background: transparent;
    border: 0;
    color: var(--m1-grey-400);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}
.m1-memory-quit:hover { color: var(--m1-navy); }

/* Board: 3 cols mobile, 4 cols >=576px = 12 cards = 6 pairs */
.m1-memory-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
}
@media (min-width: 576px) {
    .m1-memory-board { grid-template-columns: repeat(4, 1fr); gap: 0.85rem; }
}

.m1-memory-card {
    position: relative;
    aspect-ratio: 1;
    border: 2px solid var(--m1-grey-200);
    border-radius: 14px;
    background: var(--m1-sky);
    color: var(--m1-blue-dark);
    font-size: clamp(1.1rem, 3.5vw, 1.55rem);
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    transition: transform 0.1s ease, border-color 0.15s ease, background 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.m1-memory-card:hover { transform: translateY(-2px); border-color: var(--m1-blue); }
.m1-memory-card:disabled { cursor: default; transform: none; }

/* The two faces - one shown at a time */
.m1-memory-back,
.m1-memory-front {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-align: center;
    line-height: 1.1;
    padding: 0.25rem;
}
.m1-memory-card .m1-memory-front { display: none; }
.m1-memory-card.revealed .m1-memory-back { display: none; }
.m1-memory-card.revealed .m1-memory-front { display: flex; }

/* Card-back glyph */
.m1-memory-back::before {
    content: '?';
    font-size: 1.8rem;
    color: var(--m1-blue);
    opacity: 0.55;
}

/* Matched state: green tint, locked */
.m1-memory-card.matched {
    background: var(--m1-mint-soft);
    border-color: var(--m1-mint);
    color: var(--m1-mint);
    cursor: default;
}
.m1-memory-card.matched:hover { transform: none; }

/* Wrong-pair flash before flipping back */
.m1-memory-card.wrong {
    background: var(--m1-pink-soft);
    border-color: #D9534F;
    color: #B23A3A;
}

/* End screen */
.m1-memory-end {
    text-align: center;
    padding: 2rem 1rem;
}
.m1-memory-end-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--m1-yellow-soft);
    color: var(--m1-yellow);
    margin-bottom: 1rem;
}
.m1-memory-end-icon svg { width: 44px; height: 44px; }
.m1-memory-end h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--m1-navy);
    margin-bottom: 0.5rem;
}
.m1-memory-end p { color: var(--m1-grey-600); margin-bottom: 1.5rem; }
.m1-memory-end-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}


/* Glossary list spacing (was inline in glossary.php) */
.list-group-item { padding-top: 12px; padding-bottom: 12px; }


/* ============================================================
   "Powered by Arcynia" credit badge - shown on Quiz / Games /
   Memory Match. Dark neon pill with gradient text + glow on hover.
   Lifted from periodictable.one's pattern.
   ============================================================ */

.arcynia-credit {
    margin: 3rem auto 0.75rem;
    text-align: center;
}
.arcynia-credit-link {
    --arcynia-pink:    #ff2d7b;
    --arcynia-cyan:    #00f0ff;
    --arcynia-purple:  #7b2ff7;
    --arcynia-magenta: #ff00ff;
    --arcynia-void:    #06060f;
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.5rem 1rem 0.5rem 0.8rem;
    border: 1px solid rgba(0, 240, 255, 0.18);
    border-radius: 999px;
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 45, 123, 0.18) 0%, transparent 55%),
        radial-gradient(circle at 80% 70%, rgba(0, 240, 255, 0.18) 0%, transparent 55%),
        var(--arcynia-void);
    color: #f4f4f6;
    text-decoration: none;
    font-size: 0.78rem;
    line-height: 1;
    box-shadow:
        0 4px 14px rgba(6, 6, 15, 0.35),
        0 0 0 0 rgba(255, 45, 123, 0);
    transition: transform 0.18s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    position: relative;
    overflow: hidden;
}
/* Gradient hairline border that fades in on hover - the classic
   CRT-edge glow effect. Implemented via the padding-mask trick so
   we can keep a transparent inner area. */
.arcynia-credit-link::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 999px;
    padding: 1px;
    background: linear-gradient(135deg, var(--arcynia-pink) 0%, var(--arcynia-magenta) 50%, var(--arcynia-cyan) 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}
.arcynia-credit-link:hover,
.arcynia-credit-link:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(255, 45, 123, 0.45);
    box-shadow:
        0 8px 22px rgba(6, 6, 15, 0.55),
        0 0 22px rgba(255, 45, 123, 0.28),
        0 0 36px rgba(0, 240, 255, 0.18);
    text-decoration: none;
    color: #ffffff;
}
.arcynia-credit-link:hover::before,
.arcynia-credit-link:focus-visible::before {
    opacity: 1;
}
.arcynia-credit-mark {
    width: 18px;
    height: 18px;
    color: var(--arcynia-cyan);
    flex-shrink: 0;
    filter: drop-shadow(0 0 4px rgba(0, 240, 255, 0.55));
    transition: transform 0.4s ease, filter 0.25s ease;
}
.arcynia-credit-link:hover .arcynia-credit-mark {
    transform: rotate(30deg) scale(1.08);
    filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.85));
}
.arcynia-credit-text {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    white-space: nowrap;
}
.arcynia-credit-prefix {
    text-transform: uppercase;
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    color: #c8c8d2;
    font-weight: 500;
}
.arcynia-credit-brand {
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--arcynia-pink) 0%, var(--arcynia-magenta) 55%, var(--arcynia-cyan) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    text-shadow: 0 0 12px rgba(255, 45, 123, 0.35);
}
.arcynia-credit-arrow {
    width: 13px;
    height: 13px;
    color: rgba(0, 240, 255, 0.55);
    flex-shrink: 0;
    transition: transform 0.2s ease, color 0.2s ease;
}
.arcynia-credit-link:hover .arcynia-credit-arrow {
    color: var(--arcynia-cyan);
    transform: translate(2px, -2px);
}


/* ============================================================
   PICKER GRID (chart-size + range-size navigation on
   times-tables / chart / times-table pages)
   ============================================================ */

/* Wrap-style chip grid - each chip sizes to its content so "10x10"
   and "1-5" don't get the same width. Centred row, flows naturally. */
.m1-picker-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    margin: 0 auto 1.25rem;
    max-width: 720px;
}

.m1-picker-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0.3rem 0.85rem;
    border: 1px solid var(--m1-grey-200);
    border-radius: 999px;  /* pill */
    background: #fff;
    color: var(--m1-blue);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.1;
    transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.m1-picker-link:hover,
.m1-picker-link:focus {
    border-color: var(--m1-blue);
    background: var(--m1-sky);
    color: var(--m1-blue-dark);
    outline: none;
}
.m1-picker-link.active {
    background: var(--m1-blue);
    border-color: var(--m1-blue);
    color: #fff;
}
.m1-picker-link.active:hover { background: var(--m1-blue-dark); border-color: var(--m1-blue-dark); }

/* Section heading above pickers */
.m1-picker-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--m1-navy);
    text-align: center;
    margin: 1.5rem 0 0.65rem;
}


/* ============================================================
   BUTTONS, CARDS, MISC (updated for Friendly Classroom palette)
   ============================================================ */

.card {
    border: 1px solid var(--m1-grey-200);
    border-radius: 10px;
}

.btn-primary {
    background: var(--m1-blue);
    border-color: var(--m1-blue);
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--m1-blue-dark);
    border-color: var(--m1-blue-dark);
}

.btn-outline-primary {
    color: var(--m1-blue);
    border-color: var(--m1-blue);
}
.btn-outline-primary:hover, .btn-outline-primary:focus {
    background: var(--m1-blue);
    border-color: var(--m1-blue);
    color: #fff;
}

.btn-multi {
    display: block !important;
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.2;
    text-align: center !important;
    padding: 1rem 0.5rem !important;
    border: 1px solid var(--m1-grey-200) !important;
    border-radius: 10px !important;
    color: var(--m1-navy);
    background: var(--m1-sky);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-multi:hover, .btn-multi:focus {
    background: var(--m1-blue);
    color: #fff;
    border-color: var(--m1-blue) !important;
}


/* Breadcrumb */
.breadcrumb {
    padding: 0.25rem 1rem;
    margin: 1rem 0;
    background-color: var(--m1-sky);
    border-radius: 6px;
}


/* Return-to-top */
#return-to-top {
    position: fixed;
    bottom: 14px;
    right: 14px;
    z-index: 99;
    border: none;
    outline: none;
    background-color: var(--m1-blue);
    color: white;
    cursor: pointer;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 18px;
    opacity: 0.85;
    display: none;
}
#return-to-top:hover { background-color: var(--m1-blue-dark); opacity: 1; }


/* Footer social icons */
footer .social a { color: var(--m1-grey-400); }
a.facebook:hover { color: #3b5998 !important; }
a.twitter:hover { color: #55acee !important; }
a.linkedin:hover { color: #007bb5 !important; }

footer .nav-link { padding: 0.35rem 0.75rem; color: var(--m1-grey-600); }
footer .nav-link:hover { color: var(--m1-blue); }
footer .social { font-size: 2.1rem; line-height: 1.1; }

.enjoylife:before, .enjoylife:after {
    content: '\2665';
    margin: 0 5px;
    color: var(--m1-pink-soft);
}


/* Accordion (used on FAQ + times-table) */
.accordion-button:not(.collapsed) {
    color: var(--m1-navy);
    font-weight: 500;
    background-color: var(--m1-sky);
    box-shadow: none;
}
.accordion-body { background-color: var(--m1-sky); padding-bottom: 35px; }


/* ============================================================
   PRESERVED: multiplication table + chart styles (legacy classes)
   These power the existing /times-tables and /chart pages.
   ============================================================ */

/* ============================================================
   PER-TABLE EQUATION LIST
   The table on /times-tables/N-times-table that lists
   N x 1 = N, N x 2 = 2N, etc. Rendered as a soft card with
   sky-stripe zebra, navy bold numbers, blue result column,
   and a yellow highlight on the N x N "square" row (it's the
   easiest fact to anchor a table around).
   ============================================================ */

.table-multi {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border: 1px solid var(--m1-grey-200);
    border-radius: 14px;
    overflow: hidden;
    margin: 0;
    box-shadow: 0 4px 14px rgba(33, 54, 100, 0.06);
    font-family: 'Nunito', sans-serif;
    font-feature-settings: 'tnum';  /* tabular numbers so columns align */
}
.table-multi td {
    text-align: center;
    padding: 0.65rem 0.3rem;
    border-bottom: 1px solid var(--m1-grey-200);
    font-size: clamp(1.05rem, 2.4vw, 1.35rem);
    font-weight: 700;
    color: var(--m1-navy);
    line-height: 1.2;
    background: transparent;
}
.table-multi tr:last-child td { border-bottom: 0; }
.table-multi tr:nth-child(even) td { background: var(--m1-sky); }

/* Title bar - used by the multi-view (12 mini-tables in a grid) where
   each table has a clickable heading linking to its standalone page.
   The whole bar IS the link - flex layout puts the title left and an
   arrow right, hover lightens the background and nudges the arrow so
   the click affordance is obvious without an underline. */
.table-multi thead th {
    padding: 0;
    background: var(--m1-blue-dark);
    border-bottom: 1px solid var(--m1-grey-200);
}
.m1-table-multi-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    color: #fff;
    text-decoration: none;
    transition: background 0.15s ease;
}
.m1-table-multi-link:hover,
.m1-table-multi-link:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    text-decoration: none;
    outline: none;
}
.m1-table-multi-link h2 { color: #fff; margin: 0; line-height: 1.2; }
.m1-table-multi-arrow {
    display: inline-flex;
    align-items: center;
    opacity: 0.85;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.m1-table-multi-arrow svg { width: 18px; height: 18px; }
.m1-table-multi-link:hover .m1-table-multi-arrow,
.m1-table-multi-link:focus-visible .m1-table-multi-arrow {
    transform: translateX(3px);
    opacity: 1;
}

/* Column widths: operands narrow, result wider (3-digit room) */
.table-multi td:nth-child(1) { width: 22%; }
.table-multi td:nth-child(2) { width: 10%; }
.table-multi td:nth-child(3) { width: 22%; }
.table-multi td:nth-child(4) { width: 10%; }
.table-multi td:nth-child(5) { width: 36%; }

.table-multi td.operand {
    color: var(--m1-grey-400);
    font-weight: 600;
    padding: 0 0.1rem;
}
.table-multi td.product {
    color: var(--m1-blue);
    font-weight: 800;
}

/* Hover lift only on devices with a real pointer */
@media (hover: hover) {
    .table-multi tr:hover td { background: rgba(30, 97, 208, 0.08); }
}

.table-chart .equal { font-weight: 500; }
.table-chart .product { background-color: var(--m1-blue) !important; color: #fff; }
.table-chart {
    font-size: 16px;
    width: auto;
    margin: 0 auto;
    border-color: #c7cbcf;
}
.table-chart td, .table-chart th {
    width: 45px;
    min-width: 45px;
    padding: 0.5rem 0.1rem;
}
.table-chart th { background-color: #d1dae8; }

.nobullets { list-style-type: none; }

.card-element { background-color: #e8e9ea !important; }

.bg-header {
    background-color: var(--m1-sky);
}
.border-header {
    border-color: var(--m1-grey-200) !important;
}

/* Sortable-table arrow helpers (kept from original) */
th[role=columnheader] { position: relative; }
th[role=columnheader]:not(.no-sort) { cursor: pointer; }
th[role=columnheader]:not(.no-sort):after {
    content: '';
    position: absolute;
    top: 0;
    right: 5px;
    margin-top: 7px;
    border-width: 0 4px 4px;
    border-style: solid;
    border-color: #404040 transparent;
    visibility: hidden;
    opacity: 0;
    user-select: none;
}
th[aria-sort=ascending]:not(.no-sort):after {
    border-bottom: none;
    border-width: 4px 4px 0;
}
th[aria-sort]:not(.no-sort):after { visibility: visible; opacity: 0.4; }
th[role=columnheader]:not(.no-sort):hover:after { visibility: visible; opacity: 1; }


/* ----- Responsive breakpoints for table-chart sizing ----- */

@media (max-width: 1439px) {
    .table-chart-2 td, .table-chart-2 th {
        width: 40px; min-width: 40px; font-size: 14px; padding: 0.5rem 0.1rem;
    }
}

@media (max-width: 1199px) {
    .table-chart-2 td, .table-chart-2 th {
        width: 35px; min-width: 35px; font-size: 12px; padding: 0.4rem 0.1rem;
    }
}

@media (max-width: 991px) {
    .table-chart-2 td, .table-chart-2 th {
        width: 30px; min-width: 30px; font-size: 12px; padding: 0.3rem 0.1rem;
    }
    .table-chart-1 td, .table-chart-1 th {
        width: 40px; min-width: 40px; font-size: 14px; padding: 0.5rem 0.1rem;
    }
}

@media (max-width: 768px) {
    .m1-brand { font-size: 28px; }
    .table-chart-2 td, .table-chart-2 th {
        width: 25px; min-width: 25px; font-size: 10px; padding: 0.2rem 0.1rem;
    }
    .table-chart-1 td, .table-chart-1 th {
        width: 30px; min-width: 30px; font-size: 12px; padding: 0.5rem 0.1rem;
    }
}

@media (max-width: 576px) {
    .table-chart-1 td, .table-chart-1 th {
        width: 25px; min-width: 25px; font-size: 10px; padding: 0.5rem 0.1rem;
    }
}


/* ============================================================
   PRINT (preserved from original - this works really well)
   ============================================================ */

@media print {
    @page {
        size: A4;
        margin-top: 40pt;
        margin-bottom: 35pt;
    }
    html, body {
        padding-top: 0;
        width: 210mm;
        height: 297mm;
    }
    .m1-topbar, .m1-sidebar, .m1-offcanvas { display: none !important; }
    .m1-main-wrap { margin-left: 0 !important; }

    .mt-print-1 { margin-top: 5px !important; }
    table tr.page-break { break-after: page; }

    /* Reset the screen-only card styling so print shows a plain table */
    .table-multi {
        border-radius: 0;
        box-shadow: none;
        border-color: rgba(0,0,0,.25);
    }
    .table-multi td, .table-multi th { border-color: rgba(0,0,0,.25); }
    .table-multi tr:nth-child(even) td { background: transparent !important; }
    .table-multi td.product { color: inherit !important; }

    .tbody-column {
        display: grid;
        grid-template-rows: repeat(25, auto);
        grid-auto-flow: column dense;
    }
    .tbody-column tr { display: flex; page-break-inside: initial; }
    .tbody-column td { flex: 1 0 0%; }
    .tbody-column-1 { font-size: 16px; }
    .tbody-column-2 { font-size: 14px; }
    .tbody-column-3 { font-size: 12px; }
    .tbody-column-4 { font-size: 10px; }
    .tbody-column-4 td { padding: 0.5rem 0; }
    .tbody-column-4 .operand { flex: 0 0 10px; }

    .col-9 { flex: 0 0 auto; }
    .col-9-print-1 { width: 50% !important; }
    .col-9-print-2 { width: 100% !important; }

    .row-tables-0 .col { flex: 0 0 auto; width: 33.33333%; font-size: 16px; }
    .tbody-tables-0 td { font-size: 16px; padding: 0.15rem 0.1rem; }

    .row-tables-1 .col { flex: 0 0 auto; width: 25%; font-size: 16px; }
    .tbody-tables-1 td { font-size: 16px; padding: 0.15rem 0.1rem; }

    .row-tables-2 .col { flex: 0 0 auto; width: 20%; font-size: 16px; }
    .tbody-tables-2 tr { display: flex; }
    .tbody-tables-2 td { flex: 1 0 0%; font-size: 14px; padding: 0.15rem 0.1rem; }
    .tbody-tables-2 .operand { flex: 0 0 10px; }

    .row-tables-3 .col { flex: 0 0 auto; width: 20%; font-size: 16px; }
    .tbody-tables-3 tr { display: flex; }
    .tbody-tables-3 td { flex: 1 0 0%; font-size: 12px; padding: 0.1rem 0.1rem; }
    .tbody-tables-3 .operand { flex: 0 0 10px; }
}


/* ============================================================
   ICOMOON ICONS (preserved unchanged)
   ============================================================ */

[class^="icon-"], [class*=" icon-"] {
    font-family: 'icomoon' !important;
    speak: none;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    display: inline-block;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.fa-fw { text-align: center; width: 1.25em; }
.fa-sm { font-size: .875em; line-height: .07143em; vertical-align: 0.05357em; }
.fa-xs { font-size: .75em;  line-height: .08333em; vertical-align: 0.125em; }

.icon-vertical-bars:before  { content: "\e900"; }
.icon-twitter-square:before { content: "\f081"; }
.icon-facebook-square:before{ content: "\f082"; }
.icon-linkedin:before       { content: "\f08c"; }
.icon-globe:before          { content: "\f0ac"; }
.icon-ellipsis-h:before     { content: "\f141"; }
.icon-file-alt:before       { content: "\f15c"; }
.icon-th:before             { content: "\f00a"; }
.icon-th-list:before        { content: "\f00b"; }
.icon-power-off:before      { content: "\f011"; }
.icon-home:before           { content: "\f015"; }
.icon-lock:before           { content: "\f023"; }
.icon-flag:before           { content: "\f025"; }
.icon-print:before          { content: "\f02f"; }
.icon-asterisk:before       { content: "\f069"; }
.icon-bars:before           { content: "\f0c9"; }
.icon-angle-double-up:before{ content: "\f102"; }
.icon-angle-left:before     { content: "\f104"; }
.icon-angle-right:before    { content: "\f105"; }
.icon-ellipsis-v:before     { content: "\f142"; }
