/* Alligator Compare (Level 1: numbers to 30, Level 2: facts to 18) */
:root {
  --sky: #DDF1FA; --card: #FFFFFF; --ink: #1F2A44; --soft-ink: #4A5878;
  --sun: #FFC93C; --grape: #6C4AB6; --grape-ink: #FFFFFF;
  --leaf: #1E7A43; --leaf-bg: #DDF5E6; --berry: #C13560; --berry-bg: #FCE3EA;
  --dot: #B9D7E6; --btn: #FFFFFF; --btn-border: #1F2A44;
  --gator: #3FA34D; --gator-dark: #24683A; --rod: #4D9DE0; --one: #F4A232;
  color-scheme: light;
}
@media (max-width: 0px) /* dark mode off: always light blue */ {
  :root:not([data-theme="light"]) {
    --sky: #14213A; --card: #1E2E4D; --ink: #F1F5FF; --soft-ink: #B8C4E0;
    --grape: #A98BF0; --grape-ink: #14213A;
    --leaf: #5FD68E; --leaf-bg: #173D2A; --berry: #FF7FA0; --berry-bg: #4A1F2C;
    --dot: #34466B; --btn: #263A60; --btn-border: #B8C4E0;
    color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0; min-height: 100%; background: var(--sky); color: var(--ink);
  font-family: "Andika", "Century Gothic", "Trebuchet MS", system-ui, sans-serif;
  display: flex; justify-content: center;
}
main { width: 100%; max-width: 820px; padding: 16px 14px 32px; }
.home-link { display: inline-block; font: inherit; font-weight: 700; color: var(--ink); text-decoration: none; background: var(--btn); border: 2px solid var(--btn-border); border-radius: 999px; padding: 6px 14px; margin-bottom: 10px; min-height: 40px; }
.home-link:focus-visible, button:focus-visible { outline: 4px solid var(--grape); outline-offset: 3px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
h1 { font-size: clamp(1.4rem, 4.5vw, 2rem); margin: 0; }
.tools { display: flex; gap: 8px; align-items: center; }
.streak { font-weight: 700; font-size: 1.05rem; }
.pill { font: inherit; font-size: 1rem; background: var(--btn); color: var(--ink); border: 2px solid var(--btn-border); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.track { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px; }
.track span { width: 13px; height: 13px; border-radius: 50%; background: var(--dot); }
.track span.done { background: var(--leaf); }
.track span.retry { background: var(--sun); }
.track span.now { outline: 3px solid var(--grape); outline-offset: 1px; }

.card { background: var(--card); border-radius: 26px; padding: 18px 14px 20px; }
.prompt { font-size: clamp(1.2rem, 4.4vw, 1.6rem); text-align: center; margin: 0 0 10px; font-weight: 700; }
.hear { font: inherit; font-size: 1.1rem; background: var(--btn); border: 2px solid var(--btn-border); border-radius: 999px; padding: 2px 10px; cursor: pointer; vertical-align: middle; }

/* the comparison: left  [ ? ]  right */
.compare { display: flex; align-items: center; justify-content: center; gap: clamp(10px, 3vw, 24px); font-weight: 700; font-size: clamp(2.2rem, 9vw, 4rem); line-height: 1.1; flex-wrap: wrap; }
.side { min-width: 1.6em; text-align: center; white-space: nowrap; }
.slot { display: inline-grid; place-items: center; width: 1.5em; height: 1.5em; border: 4px dashed var(--soft-ink); border-radius: 18px; color: var(--soft-ink); font-size: .9em; }
.slot.filled { border-style: solid; border-color: var(--leaf); background: var(--leaf-bg); color: var(--leaf); }

/* sign buttons */
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 520px; margin: 18px auto 0; }
.choice { font: inherit; font-weight: 700; background: var(--btn); color: var(--ink); border: 4px solid var(--btn-border); border-radius: 18px; padding: 6px 4px 8px; cursor: pointer; display: grid; justify-items: center; gap: 2px; }
.choice .sym { font-size: clamp(2.2rem, 9vw, 3.2rem); line-height: 1; }
.choice small { font-size: clamp(.85rem, 3vw, 1rem); color: var(--soft-ink); }
.choice.right { background: var(--leaf-bg); border-color: var(--leaf); color: var(--leaf); }
.choice.wrong { background: var(--berry-bg); border-color: var(--berry); color: var(--berry); }
.choice.hint { box-shadow: 0 0 0 5px var(--sun); border-color: var(--sun); }
.choice:disabled { cursor: default; }

/* help: the alligator mouth opens toward the bigger amount */
.help { margin-top: 16px; padding: 12px; border-radius: 20px; border: 3px dashed var(--sun); }
.hrow { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 3vw, 22px); }
.hside { display: grid; justify-items: center; gap: 6px; min-width: 5em; }
.hval { font-size: clamp(1.4rem, 5vw, 2rem); font-weight: 700; white-space: nowrap; }
.hfact { color: var(--soft-ink); font-weight: 700; }
.hmid { display: grid; place-items: center; }
.gator { width: clamp(64px, 16vw, 96px); height: auto; }
.gator .jaw { fill: var(--gator); stroke: var(--gator-dark); stroke-width: 3; stroke-linejoin: round; }
.gator .teeth { fill: none; stroke: #FFFFFF; stroke-width: 3; stroke-linejoin: round; }
.gator .eye { fill: #FFFFFF; stroke: var(--gator-dark); stroke-width: 2; }
.gator .pupil { fill: #1F2A44; }
.gator.eq rect { fill: var(--grape); }
.hsay { text-align: center; font-size: clamp(1.3rem, 4.6vw, 1.8rem); font-weight: 700; margin: 8px 0 4px; }
.hlines { margin: 6px 0 0; padding-left: 1.2em; font-size: clamp(1rem, 3.6vw, 1.15rem); line-height: 1.4; }
.hlines li { margin-bottom: 4px; }
/* tens and ones (Level 1) */
.blocks { display: flex; align-items: flex-end; gap: 3px; min-height: 64px; }
.rod { width: 9px; height: 64px; border-radius: 3px; background: var(--rod); background-image: repeating-linear-gradient(to bottom, transparent 0 5.4px, rgba(255,255,255,.55) 5.4px 6.4px); }
.ones { display: grid; grid-template-columns: repeat(2, 9px); gap: 2px; align-content: end; margin-left: 4px; }
.one { width: 9px; height: 9px; border-radius: 2px; background: var(--one); }

.feedback { min-height: 1.6em; margin-top: 12px; text-align: center; font-size: clamp(1.1rem, 4vw, 1.35rem); }
.feedback.good { color: var(--leaf); font-weight: 700; }
.feedback.try { color: var(--berry); }
.next { font: inherit; font-weight: 700; font-size: 1.4rem; display: block; margin: 10px auto 0; background: var(--grape); color: var(--grape-ink); border: none; border-radius: 999px; padding: 12px 36px; cursor: pointer; }
.hidden { display: none !important; }
.end { text-align: center; padding: 30px 10px; }
.end .big { font-size: clamp(3rem, 14vw, 5rem); margin: 0; }
.end p { font-size: 1.4rem; }

/* laptops with short screens: the problem on the left, the alligator help on the right */
@media (min-width: 900px) and (max-height: 760px) {
  main { max-width: 1100px; }
  #game { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 24px; align-items: start; grid-auto-flow: row dense; }
  #game > .prompt, #game > .compare, #game > .choices { grid-column: 1; }
  #help, #feedback, #nextBtn { grid-column: 2; }
  #help { margin-top: 0; grid-row: 1 / span 3; }
}
