/* Grade 3 Science animals: Guess What - Animals (.an-) and Animal Memory (.am-). Ported from the approved demos. */
.an-layout { display: grid; gap: 18px; align-items: start; }
@media (min-width: 760px) { .an-layout { grid-template-columns: 300px minmax(0, 1fr); } .an-questions { grid-template-columns: 1fr; } .an-answer { min-height: 96px; } }
.an-screen h2 { margin: .2rem 0 .6rem; font-size: 1.3rem; }
.an-side { padding: 12px; border: 3px solid var(--border); border-radius: 20px; background: var(--paper); }
.an-answer { min-height: 64px; margin-bottom: .8rem; font-size: 1.4rem; font-weight: 800; }
.an-q-text { display: block; color: var(--muted); font-weight: 400; font-size: 1.05rem; }
.an-badge { display: inline-block; padding: .2rem 1rem; border-radius: 12px; margin-right: .5rem; }
.an-badge.Yes { background: var(--lime); } .an-badge.No { background: var(--sky); } .an-badge.Sometimes { background: var(--yellow); }
.an-note { font-size: 1.05rem; font-weight: 700; }
.an-nope { color: var(--ink); }
.an-questions { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .5rem; }
.an-q { font: inherit; font-weight: 800; font-size: 1.05rem; min-height: 56px; padding: .5rem .9rem; background: var(--paper); color: var(--ink); border: 3px solid var(--green-dark); border-radius: 16px; cursor: pointer; text-align: left; touch-action: manipulation; }
.an-q:hover:not(:disabled) { background: var(--lime); }
.an-q:disabled { border-style: dashed; border-color: var(--border); color: var(--muted); cursor: default; background: transparent; }
.an-a { display: block; font-size: .95rem; }
.an-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .7rem; }
.an-card { font: inherit; font-weight: 800; font-size: 1.05rem; min-height: 68px; padding: .4rem .4rem .5rem; background: var(--paper); color: var(--ink); border: 3px solid var(--border); border-radius: 16px; cursor: pointer; text-transform: capitalize; position: relative; touch-action: manipulation; }
.an-card:hover:not(:disabled) { border-color: var(--blue-action); }
.an-card img { display: block; width: 100%; max-width: 110px; height: auto; aspect-ratio: 1; margin: 0 auto .15rem; pointer-events: none; }
.an-card .nm { display: block; overflow-wrap: anywhere; }
.an-card.faded { background: #e4e2dc; color: #8a8f8c; border-color: #d3d0c6; opacity: .55; }
.an-card.faded img { filter: grayscale(1); }
.an-card.wrong { background: #f6e2de; color: var(--muted); text-decoration: line-through; text-decoration-thickness: 3px; border-style: dashed; cursor: default; }
.an-card.wrong::after { content: "✗"; position: absolute; top: 2px; right: 8px; color: var(--ink); text-decoration: none; }
.an-card.correct { background: var(--yellow); border-color: var(--green-dark); }
.an-win { position: fixed; inset: 0; z-index: 20; background: rgba(37, 49, 44, .55); display: flex; align-items: center; justify-content: center; padding: 16px; overflow: auto; }
.an-win[hidden] { display: none; }
.an-win-card { background: var(--paper); border: 4px solid var(--yellow); border-radius: 24px; padding: 1.5rem 2rem; max-width: 560px; width: 100%; text-align: center; }
.an-win-card h2 { font-size: 1.9rem; margin: 0 0 .5rem; }
.an-win-card p { font-size: 1.3rem; margin: 0 0 1rem; }
.an-win-card .button-row { justify-content: center; }
.an-stars { font-size: 2.2rem; color: #c98f00; letter-spacing: .3rem; animation: an-pop .6s ease-out; }
.an-win-body { display: flex; align-items: center; gap: 1rem; text-align: left; }
.an-win-pic { width: 160px; height: 160px; flex: none; }
.an-facts { margin: 1rem 0; padding-left: 1.4rem; font-size: 1.15rem; } .an-facts li { margin: .5rem 0; }
@keyframes an-pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .an-stars { animation: none; } }
@media (max-width: 520px) { .an-win-body { flex-direction: column; } .an-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); } }
/* ---- FIX 6 (Oct 26 2026): points counter, -1 flight, branching pick list, dimmed-but-tappable questions ---- */
/* The big number (48 px) top right, just above the animal cards (Brandie, Oct 23). */
.an-points-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.an-points-head h2 { margin-right: auto; }
.an-points-row { display: flex; align-items: baseline; gap: .45rem; }
.an-points-cap { font-size: 1rem; font-weight: 800; color: var(--muted); }
.an-points { font-size: 48px; font-weight: 900; line-height: 1; color: #B8362A; } /* approved red for counts (rule 9) */
/* The small -1 (12 px) that moves into the big number in about 0.6 s. Reduced motion: JS never spawns it. */
.an-fly { position: fixed; z-index: 60; font-size: 12px; font-weight: 900; color: #B8362A; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .an-fly { animation: an-fly .6s ease-in forwards; }
  @keyframes an-fly { from { transform: translate(0, 0); opacity: 1; } 70% { opacity: 1; } to { transform: translate(var(--dx, 0), var(--dy, 0)); opacity: 0; } }
}
/* Useless questions stay in the list, dimmed but tappable (Brandie's B + C, Oct 26): real button, not disabled. */
.an-q.dim { border-color: var(--border); color: var(--muted); background: #efeeea; opacity: .7; }
.an-q.dim:hover { background: #e5e4df; }
/* The approved "did not help" sentence shows in the same answer area. */
.an-didnothelp { display: block; margin-top: .4rem; font-size: 1.05rem; font-weight: 700; color: #6b4300; }
/* Asked questions stay below with their answers; the pick list scrolls inside its own panel. */
.an-questions, .an-asked { max-height: 42vh; overflow-y: auto; overscroll-behavior: contain; }
.an-asked { margin-top: .8rem; }
.an-q-text2 { display: block; font-weight: 800; }
/* ---- FIX 6 round 2 (Oct 26 2026), decision 10: points on a phone ---- */
/* Phone widths (the game's own narrow breakpoint, paired with .an-layout's min-width: 760px): the big
   number sits in the top-right row beside the "?" (the "?" stays LAST, rule 13), in place of the
   "Questions asked" box, at 32px so the child always sees it (>= 28px required; the approved 48px is
   the desktop/tablet counter). Desktop and tablet keep the 48px counter above the animal cards and the
   "Questions asked" box, exactly as before. The -1 flight targets whichever counter is visible. */
.an-points-top { display: none; }
@media (max-width: 759px) {
  #ga-count { display: none; }
  .an-points-head .an-points-row { display: none; }
  .an-points-top { display: flex; }
  .an-points-top .an-points { font-size: 32px; }
  /* the row is only ~265px wide at 360: the caption would push the "?" onto its own line (rule 13),
     so on phones the number carries the row and the screen reader gets "Points: N" from aria-label */
  .an-points-top .an-points-cap { display: none; }
}
/* Animal Memory */
.am-start { text-align: center; }
.am-start .game-topbar { text-align: left; }
.am-levels { display: flex; gap: 1.2rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }
.am-level { display: flex; flex-direction: column; gap: .2rem; width: 260px; min-height: 130px; justify-content: center; font-size: 1.2rem; }
.am-big { font-size: 2.2rem; }
.am-board { display: grid; gap: 10px; justify-content: center; grid-template-columns: repeat(var(--cols, 4), var(--cw, 100px)); grid-auto-rows: var(--ch, 115px); }
.am-card { position: relative; padding: 0; margin: 0; border: 0; background: transparent; border-radius: 14px; touch-action: manipulation; -webkit-tap-highlight-color: transparent; cursor: pointer; font: inherit; color: var(--ink); }
.am-card .am-back, .am-card .am-face { position: absolute; inset: 0; border-radius: 14px; border: 4px solid var(--ink); }
.am-card .am-back { background: var(--yellow); display: flex; align-items: center; justify-content: center; }
.am-card .am-back::before { content: ""; position: absolute; inset: 7px; border: 5px solid var(--green-dark); border-radius: 9px; background: var(--paper); }
.am-card .am-back span { position: relative; font-size: calc(var(--cw, 100px) * .5); font-weight: 900; color: var(--green-dark); }
.am-card .am-face { display: none; background: var(--cream); flex-direction: column; align-items: center; justify-content: flex-start; padding: 4px; }
.am-card .am-face img { display: block; width: 100%; flex: 1 1 0; min-height: 0; object-fit: contain; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.am-card .am-nm { display: block; height: 1.5em; font-weight: 900; font-size: clamp(.8rem, calc(var(--cw, 100px) * .14), 1.25rem); line-height: 1.5em; white-space: nowrap; }
.am-card.up .am-back, .am-card.matched .am-back { display: none; }
.am-card.up .am-face, .am-card.matched .am-face { display: flex; }
.am-card.up .am-nm { visibility: hidden; }
.am-card.up { outline: 4px solid var(--blue-action); outline-offset: 2px; }
.am-card.matched .am-face { background: #eef8d0; border-color: var(--green-dark); }
.am-card:focus-visible { outline: 4px solid var(--ink); outline-offset: 3px; }
.am-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
