/* Spike & Suzy Games — maths-farm wave look (colours and header match the other farm games).
   Copied into each maths-farm game folder so every folder stands alone. Band A: 64px+ taps; bands B/C: 48px+. */
:root {
  --sky: #8fd3ff; --sky-2: #dff3ff; --grass: #6dbb5a; --grass-2: #3e8e3a;
  --barn: #c43d2c; --barn-2: #a8321f; --straw: #ffcf4a; --straw-2: #fff3c7;
  --ink: #1d2733; --ink-2: #4a5663; --paper: #fffdf7; --line: #e4dccb;
  --spike: #2b2622; --suzy: #7a4a1e; --green: #2e8b3e; --focus: #0b5fff; --wood: #9c6b3a; --hay: #e8c15a;
  --radius: 20px;
  --shadow: 0 5px 0 rgba(29, 39, 51, .12), 0 8px 20px rgba(29, 39, 51, .10);
  --tap: 48px;
}
body.band-A { --tap: 64px; }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ink);
  font-family: ui-rounded, "Nunito", "Quicksand", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 18px; line-height: 1.4;
  background:
    radial-gradient(120% 40% at 20% 104%, var(--grass) 0 60%, transparent 61%),
    radial-gradient(120% 36% at 90% 106%, var(--grass-2) 0 60%, transparent 61%),
    linear-gradient(180deg, var(--sky) 0%, var(--sky-2) 45%, #eaf8e3 100%);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
}
body.band-A { font-size: 19px; }
:focus-visible { outline: 4px solid var(--focus); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }
h1, h2, h3, p, ol, ul { margin: 0; }
button { font: inherit; color: inherit; }
button:disabled { cursor: default; }

/* shell + header */
.ssg-shell { max-width: 820px; margin: 0 auto; padding: 0 12px 48px; }
.ssg-top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 0 12px; background: linear-gradient(180deg, rgba(143, 211, 255, .97) 72%, rgba(143, 211, 255, 0));
}
.ssg-back {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 16px; border-radius: 999px;
  background: var(--paper); border: 3px solid #fff; box-shadow: 0 3px 0 rgba(29, 39, 51, .15);
  color: var(--ink); font-weight: 900; font-size: 16px; text-decoration: none; line-height: 1.1;
}
.ssg-top__right { display: flex; align-items: center; gap: 8px; }
.ssg-brand { text-align: right; line-height: 1.05; font-weight: 900; color: var(--barn); font-size: 18px; letter-spacing: .03em; text-shadow: 0 2px 0 #fff; }
.ssg-brand small { display: block; font-size: 11px; color: var(--ink); letter-spacing: .1em; text-shadow: none; text-transform: uppercase; }
.mf-mute {
  width: var(--tap); height: var(--tap); flex: none; border-radius: 50%; border: 3px solid #fff; background: var(--paper);
  box-shadow: 0 3px 0 rgba(29, 39, 51, .15); font-size: 24px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.mf-mute[aria-pressed="true"] { background: #eee7da; }
@media (max-width: 400px) { .ssg-brand small { display: none; } .ssg-brand { font-size: 14px; } .ssg-back { padding: 0 12px; font-size: 15px; } }
.ssg-main { display: flex; flex-direction: column; gap: 14px; outline: none; }
.ssg-footer { margin-top: 24px; text-align: center; font-size: 14px; color: var(--ink-2); font-weight: 700; }

/* screens */
.mf-screen > div { display: flex; flex-direction: column; gap: 14px; animation: mf-in .25s ease-out; }
@keyframes mf-in { from { opacity: 0; transform: translateY(6px); } }
.mf-card { background: var(--paper); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.mf-eyebrow {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: #7a4a12;
  background: var(--straw); border-radius: 999px; padding: 6px 14px; border: 2px solid #fff;
}
.mf-h1 { font-size: clamp(30px, 8vw, 48px); font-weight: 900; line-height: 1.05; text-shadow: 0 3px 0 #fff; outline: none; }
.mf-lead { font-size: 19px; font-weight: 700; color: var(--ink-2); }
.mf-text { font-size: 18px; }
.mf-small { font-size: 15px; color: var(--ink-2); }
.mf-kicker { font-size: 14px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--barn); }
.mf-hero { display: flex; justify-content: center; align-items: center; font-size: clamp(64px, 20vw, 110px); line-height: 1; }
.mf-hero svg { width: 100%; max-width: 520px; height: auto; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--sky-2); }
.mf-how { padding-left: 22px; display: grid; gap: 6px; }

/* hosts (Spike and Suzy, kelpie pups) */
.mf-host { display: flex; align-items: center; gap: 12px; }
.mf-host__pup { flex: none; width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 36px; border: 4px solid #fff; box-shadow: var(--shadow); }
.mf-host--spike .mf-host__pup { background: var(--spike); }
.mf-host__pup { overflow: hidden; }
.mf-host__img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.mf-host--suzy .mf-host__pup { background: var(--suzy); }
.mf-host__bubble { flex: 1; background: #fff; border-radius: 18px; padding: 10px 14px; box-shadow: var(--shadow); font-weight: 800; font-size: 18px; }
.band-A .mf-host__bubble { font-size: 21px; }
.mf-host__who { display: block; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 900; }
.mf-host--spike .mf-host__who { color: var(--spike); }
.mf-host--suzy .mf-host__who { color: var(--suzy); }

/* buttons */
.mf-btn {
  min-height: var(--tap); min-width: var(--tap); display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; text-align: center;
  border-radius: 999px; border: 3px solid rgba(0, 0, 0, .06); padding: 8px 22px; cursor: pointer;
  font: inherit; font-weight: 900; font-size: 19px; color: var(--ink); background: #fff; box-shadow: var(--shadow); line-height: 1.1; touch-action: manipulation;
}
.band-A .mf-btn { font-size: 22px; }
.mf-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(29, 39, 51, .15); }
.mf-btn--go { background: linear-gradient(180deg, #ffd84d, #f4b400); color: #3b2500; border-color: #fff; }
.band-A .mf-btn--go { min-height: 76px; font-size: 26px; }
.mf-btn--primary { background: var(--barn); color: #fff; }
.mf-btn--ghost { background: rgba(255, 255, 255, .7); }
.mf-btn--small { padding: 4px 14px; font-size: 16px; }
.mf-btn--wide { width: 100%; }
.mf-btn__emoji { font-size: 1.3em; line-height: 1; }
.mf-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; width: 100%; }
.mf-actions > * { flex: 1 1 200px; }
.mf-hear {
  flex: none; min-width: var(--tap); min-height: var(--tap); border-radius: 999px; border: 3px solid #fff; cursor: pointer;
  background: linear-gradient(180deg, #ffd84d, #f4b400); color: #3b2500; font-size: 24px; box-shadow: var(--shadow);
  display: inline-flex; align-items: center; justify-content: center; padding: 0 10px;
}

/* level pickers */
.mf-levels { display: grid; gap: 10px; }
.mf-level {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; min-height: 72px; padding: 10px 12px; cursor: pointer;
  background: #fff; border: 3px solid var(--line); border-radius: 18px; box-shadow: 0 3px 0 rgba(29, 39, 51, .08);
}
.mf-level.is-done { border-color: #bfe3b6; background: #f4fbf1; }
.mf-level__num { flex: none; width: 52px; height: 52px; border-radius: 14px; background: var(--straw-2); display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 900; }
.mf-level__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mf-level__name { font-weight: 900; font-size: 18px; }
.mf-level__desc { font-size: 15px; color: var(--ink-2); }
.mf-level__stars { font-size: 14px; font-weight: 800; color: #8a5a00; }
.mf-lvsA { display: grid; grid-template-columns: repeat(var(--lv, 3), minmax(0, 1fr)); gap: 10px; }
.mf-lvA {
  min-height: 110px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer;
  background: #fff; border: 4px solid #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px;
}
.mf-lvA.is-done { background: #f4fbf1; border-color: #bfe3b6; }
.mf-lvA__emoji { font-size: 40px; line-height: 1; }
.mf-lvA__num { font-size: 22px; font-weight: 900; }
.mf-lvA__stars { font-size: 14px; letter-spacing: 1px; }

/* progress */
.mf-progress { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.mf-pill { background: rgba(255, 255, 255, .85); border-radius: 999px; padding: 6px 12px; font-weight: 800; font-size: 15px; }
.mf-chip { background: #fff; border-radius: 999px; padding: 4px 12px; font-weight: 900; font-size: 16px; }

/* round screen */
.mf-hud { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.mf-hud__count { font-weight: 900; font-size: 17px; background: var(--straw); border: 2px solid #fff; border-radius: 999px; padding: 6px 14px; }
.band-A .mf-hud__count { font-size: 22px; }
.mf-dots { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 4px; }
.mf-dot { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .8); }
.mf-dot.is-done { background: var(--green); }
.mf-dot.is-now { background: var(--straw); box-shadow: 0 0 0 2px #fff; }
.mf-prompt { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: var(--radius); padding: 10px 12px; box-shadow: var(--shadow); }
.mf-prompt__text { flex: 1; font-size: clamp(19px, 5vw, 26px); font-weight: 900; line-height: 1.2; outline: none; min-width: 0; overflow-wrap: anywhere; }
.band-A .mf-prompt__text { font-size: clamp(24px, 6.6vw, 34px); }
.mf-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.mf-feedback { min-height: 28px; text-align: center; font-weight: 900; font-size: 20px; color: var(--ink-2); }
.mf-feedback.is-good { color: var(--green); }
.mf-feedback.is-miss { color: #9a4a00; }
.mf-feedback.is-reveal { color: var(--barn-2); }
.mf-fact { background: #fff8dc; border: 3px solid var(--straw); border-radius: 16px; padding: 10px 14px; display: grid; gap: 4px; font-size: 17px; }
.mf-fact__title { font-weight: 900; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: #7a4a12; }
.mf-panel { background: #fff; border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.mf-scene { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.mf-scene svg { display: block; width: 100%; height: auto; }
.mf-svg { display: block; }
.mf-big { font-size: clamp(40px, 12vw, 64px); font-weight: 900; text-align: center; line-height: 1.1; }
.mf-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.mf-emoji-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; font-size: clamp(30px, 9vw, 44px); line-height: 1.15; }

/* choices */
.mf-choices { display: grid; gap: 10px; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
.mf-choice {
  position: relative; min-height: var(--tap); min-width: var(--tap); border-radius: 18px; border: 4px solid #fff; background: linear-gradient(180deg, #fff, #fff3c7);
  box-shadow: var(--shadow); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px;
  font-size: 22px; font-weight: 900; line-height: 1.15; touch-action: manipulation; overflow-wrap: anywhere;
}
.band-A .mf-choice { min-height: 96px; font-size: clamp(34px, 10vw, 56px); }
.mf-choices--text .mf-choice { font-size: 18px; text-align: center; }
.mf-choices--big .mf-choice { font-size: clamp(30px, 9vw, 48px); }
.mf-choice:active { transform: translateY(3px); }
.mf-choice.is-right { border-color: var(--green); background: #eaf7e6; box-shadow: 0 0 0 4px rgba(46, 139, 62, .3), var(--shadow); animation: mf-bounce .5s ease; }
.mf-choice.is-tried { opacity: .45; box-shadow: none; }
.mf-choice.is-faded { opacity: .6; }
@keyframes mf-bounce { 40% { transform: scale(1.07); } }
@keyframes mf-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.is-shake { animation: mf-shake .4s ease; }
.is-wiggle { animation: mf-shake .4s ease; }

/* keypad */
.mf-kp { display: grid; gap: 10px; max-width: 420px; width: 100%; margin: 0 auto; }
.mf-kp__display { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 64px; background: #fff; border: 4px solid var(--line); border-radius: 16px; font-size: 34px; font-weight: 900; }
.mf-kp__display.is-right { border-color: var(--green); background: #eaf7e6; }
.mf-kp__unit { font-size: 22px; color: var(--ink-2); }
.mf-kp__keys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mf-kp__key { min-height: 52px; border-radius: 14px; border: 3px solid #fff; background: #fff; box-shadow: 0 3px 0 rgba(29, 39, 51, .15); font-size: 24px; font-weight: 900; cursor: pointer; touch-action: manipulation; }
.mf-kp__key:active { transform: translateY(2px); }
.mf-kp__key.is-del { background: #f3ece0; }

/* sorter */
.mf-sorter { display: grid; gap: 12px; }
.mf-tray { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; min-height: var(--tap); }
.mf-item {
  min-width: var(--tap); min-height: var(--tap); padding: 6px 10px; border-radius: 16px; border: 4px solid #fff; background: #fff; box-shadow: var(--shadow);
  font-size: 22px; font-weight: 900; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; touch-action: manipulation; line-height: 1.1;
}
.band-A .mf-item { font-size: 44px; min-width: 76px; min-height: 76px; }
.mf-item[aria-pressed="true"] { border-color: var(--focus); background: #e8f0ff; transform: translateY(-3px); }
.mf-item.is-placed { visibility: hidden; }
.mf-bins { display: grid; gap: 8px; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
.mf-bin {
  min-height: 120px; border-radius: 18px; border: 4px dashed var(--wood); background: #f7ecd6; cursor: pointer; padding: 6px;
  display: flex; flex-direction: column; align-items: center; gap: 4px; touch-action: manipulation; min-width: 0;
}
.mf-bin__label { font-weight: 900; font-size: 16px; line-height: 1.1; text-align: center; }
.band-A .mf-bin__label { font-size: 40px; }
.mf-bin__in { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; font-size: 22px; line-height: 1; min-height: 24px; }
.mf-bin__in .mf-svg { width: 26px; height: 26px; }
.mf-bin__count { font-weight: 900; font-size: 18px; background: #fff; border-radius: 999px; min-width: 32px; padding: 0 8px; }

/* ordering */
.mf-order { display: grid; gap: 12px; }
.mf-order__row { list-style: none; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.mf-order__slot { min-width: 64px; min-height: 64px; border-radius: 14px; border: 3px dashed var(--wood); background: rgba(255, 255, 255, .7); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2px 4px; }
.mf-order__slot.is-filled { border-style: solid; border-color: var(--green); background: #eaf7e6; }
.mf-order__num { font-size: 12px; font-weight: 900; color: var(--ink-2); }
.mf-order__chip { font-size: 24px; font-weight: 900; line-height: 1.1; display: flex; align-items: flex-end; }
.mf-order__tray { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

/* memory */
.mf-memory { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 8px; }
.mf-card-flip {
  min-height: 84px; min-width: var(--tap); border-radius: 16px; border: 4px solid #fff; cursor: pointer; padding: 4px; position: relative;
  background: linear-gradient(135deg, var(--grass), var(--grass-2)); box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; touch-action: manipulation;
}
.mf-card-flip__back { font-size: 34px; }
.mf-card-flip__face { display: none; font-size: 30px; font-weight: 900; line-height: 1.05; text-align: center; }
.mf-card-flip.is-open, .mf-card-flip.is-matched { background: #fff; }
.mf-card-flip.is-open .mf-card-flip__back, .mf-card-flip.is-matched .mf-card-flip__back { display: none; }
.mf-card-flip.is-open .mf-card-flip__face, .mf-card-flip.is-matched .mf-card-flip__face { display: block; }
.mf-card-flip.is-matched { border-color: var(--green); background: #eaf7e6; }

/* stepper */
.mf-step { display: grid; gap: 10px; max-width: 420px; width: 100%; margin: 0 auto; }
.mf-step__row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.mf-step__btn { width: 64px; height: 64px; border-radius: 50%; border: 4px solid #fff; background: var(--straw); font-size: 34px; font-weight: 900; cursor: pointer; box-shadow: var(--shadow); touch-action: manipulation; }
.mf-step__box { background: #fff; border-radius: 16px; min-height: 64px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 30px; font-weight: 900; border: 4px solid var(--line); }
.mf-step__unit { font-size: 20px; color: var(--ink-2); }

/* celebration */
.mf-party { position: relative; overflow: hidden; text-align: center; align-items: center; background: #fff8dc; border: 4px solid var(--straw); }
.mf-party__burst { font-size: clamp(60px, 18vw, 100px); line-height: 1; animation: mf-bounce 1s ease 2; }
.mf-party__title { font-size: clamp(30px, 8vw, 46px); font-weight: 900; color: var(--barn); line-height: 1.05; outline: none; }
.mf-party__stars { font-size: 34px; letter-spacing: 4px; }
.mf-reward { font-weight: 900; color: var(--green); }
.mf-confetti { position: absolute; inset: 0; pointer-events: none; }
.mf-confetti span { position: absolute; top: -30px; font-size: 22px; animation: mf-fall 2.4s linear 1 forwards; }
@keyframes mf-fall { to { transform: translateY(520px) rotate(300deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
