/* Online games at /play/: color by number, spot the difference, numbers 0-20 lessons. */
.play-hero { background: var(--navy); color: #fff; padding: 34px 0 30px; }
.play-hero h1 { color: #fff; font-size: clamp(2rem, 4.6vw, 3.4rem); margin: 0 0 .2em; }
.play-hero p { margin: 0; max-width: 720px; color: #dbe6f7; }
.play-sec { padding: 34px 0 6px; }
.play-sec h2 { margin-bottom: .3em; }
.play-sec > .wrap > p { margin: 0 0 18px; color: var(--muted); max-width: 760px; }
.play-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.play-card { display: block; text-decoration: none; background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 0 0 2px var(--line); transition: transform .15s, box-shadow .15s; }
@media (hover: hover) { .play-card:hover { transform: translateY(-3px); box-shadow: 0 0 0 2px var(--blue), var(--shadow); } }
.play-card img { width: 100%; aspect-ratio: 850/1100; object-fit: cover; object-position: top; background: var(--soft); }
.play-card .spot-thumb { aspect-ratio: 720/340; object-fit: cover; background: #fff; border-bottom: 2px solid var(--line); }
.play-card span { display: block; padding: 8px 12px 10px; font: 700 1rem/1.25 var(--display); color: var(--navy); }
.play-card small { display: block; font: 600 .8rem var(--body); color: var(--muted); }
.play-doors { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-top: 22px; }
.play-door { display: flex; gap: 14px; align-items: center; text-decoration: none; background: #fff; color: var(--navy);
  border-radius: 18px; padding: 14px 16px; box-shadow: 0 5px 0 rgba(0, 0, 0, .18); }
.play-door b { font: 800 1.2rem/1.1 var(--display); display: block; }
.play-door small { color: var(--muted); font-size: .85rem; }
.play-door i { font-style: normal; font-size: 2rem; }
.play-note { font-size: .92rem; color: var(--muted); }

/* game shell */
.game-page { background: var(--soft); padding: 14px 0 28px; }
.game { position: relative; max-width: 980px; margin: 0 auto; background: #fff; border-radius: 22px; box-shadow: var(--shadow);
  padding: 12px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.game:fullscreen { max-width: none; border-radius: 0; overflow: auto; display: flex; flex-direction: column; }
.g-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.g-top .g-progress { flex: 1 1 auto; font-size: 1.05rem; color: var(--navy); }
.game-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; max-width: 980px; margin: 0 auto 10px; }
.game-head h1 { font-size: clamp(1.5rem, 3.6vw, 2.3rem); margin: 0; }
.game-head .crumbs { flex-basis: 100%; margin: 0; }
.game-head .badge { align-self: center; }
.g-btn { border: 0; border-radius: 999px; background: #fff; color: var(--navy); font: 700 .95rem var(--body); padding: 8px 14px;
  min-height: 44px; min-width: 44px; cursor: pointer; box-shadow: 0 3px 0 #cfd7e3, 0 0 0 2px #d4dce8 inset; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.g-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #cfd7e3, 0 0 0 2px #d4dce8 inset; }
.g-btn.big { font-size: 1.15rem; padding: 12px 24px; min-height: 54px; }
.g-btn.go { background: var(--red); color: #fff; box-shadow: 0 4px 0 var(--red-dark); }
.g-btn.blue { background: var(--blue); color: #fff; box-shadow: 0 4px 0 var(--blue-dark); }
.g-btn[aria-pressed="false"] { opacity: .55; }
.g-say { display: flex; align-items: center; gap: 10px; margin: 10px 0; min-height: 56px; }
.g-say svg { width: 58px; height: auto; flex: none; }
.g-bubble { background: var(--soft); border-radius: 16px; padding: 8px 14px; font: 700 clamp(1rem, 2.6vw, 1.25rem)/1.3 var(--display);
  color: var(--navy); position: relative; flex: 1; }
.g-bubble::before { content: ""; position: absolute; left: -9px; top: 18px; border: 9px solid transparent; border-left: 0;
  border-right-color: var(--soft); }
.g-progress { font: 700 .95rem var(--body); color: var(--muted); white-space: nowrap; }
.g-start { position: absolute; inset: 0; z-index: 30; background: rgba(255, 255, 255, .94); border-radius: 22px; display: flex;
  flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 20px; }
.g-start svg { width: 150px; height: auto; }
.g-start p { margin: 0; font: 700 1.2rem var(--display); color: var(--navy); max-width: 460px; }
.g-modes { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.g-modes .g-btn[aria-pressed="true"] { background: var(--navy); color: #fff; box-shadow: 0 3px 0 #000; opacity: 1; }
.g-done { text-align: center; padding: 18px 10px 6px; display: none; }
.g-done.on { display: block; animation: pop .45s ease-out; }
.g-done h2 { margin: 0 0 6px; }
.g-done .g-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.stars { font-size: 2.6rem; letter-spacing: 6px; color: var(--yellow); text-shadow: 0 3px 0 #e0a800; }
.stars .off { color: #dde3ec; text-shadow: none; }
@keyframes pop { 0% { transform: scale(.8); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }
@keyframes pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.shake { animation: shake .3s 2; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; }

/* color by number */
.cbn-view { max-width: min(100%, 76vh); margin: 0 auto; position: relative; overflow: hidden; border-radius: 14px; box-shadow: 0 0 0 3px var(--navy); touch-action: none; background: #fff; }
.cbn-stage { position: relative; transform-origin: 0 0; transition: transform .2s; }
.cbn-stage canvas, .cbn-stage img, .cbn-stage svg { display: block; width: 100%; height: auto; }
.cbn-stage img, .cbn-stage svg { position: absolute; inset: 0; height: 100%; pointer-events: none; }
.cbn-stage text { font-family: var(--body); font-weight: 700; fill: #4a5670; text-anchor: middle; dominant-baseline: central; }
.cbn-stage text.hot { fill: #0b5fd6; font-weight: 800; }
.cbn-stage text.dim { opacity: .5; }
.cbn-stage text.flash { animation: pulse .5s 4; fill: var(--red); }
.cbn-tools { display: flex; gap: 8px; align-items: center; margin: 10px 0 0; flex-wrap: wrap; }
.palette { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.crayon { position: relative; border: 0; background: none; padding: 0 0 6px; cursor: pointer; width: 64px; display: flex; flex-direction: column;
  align-items: center; font: 800 1.2rem var(--display); color: var(--navy); transition: transform .12s; }
.crayon i { display: block; width: 46px; height: 46px; border-radius: 50%; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--line), inset 0 -6px 0 rgba(0, 0, 0, .15);
  display: flex; align-items: center; justify-content: center; font-style: normal; }
.crayon i b { background: rgba(255, 255, 255, .92); border-radius: 50%; width: 28px; height: 28px; line-height: 28px; font-size: 1.05rem; }
.crayon small { font: 600 .7rem var(--body); color: var(--muted); margin-top: 3px; }
.crayon.sel { transform: translateY(-6px) scale(1.12); }
.crayon.sel i { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--navy), inset 0 -6px 0 rgba(0, 0, 0, .15); }
.crayon.done { opacity: .35; }
.crayon.done::after { content: "\2713"; position: absolute; top: 10px; color: #fff; font-size: 1.4rem; text-shadow: 0 1px 2px #000; }

/* spot the difference */
.spot-pics { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .game.spot { max-width: 1240px; } .spot-pics { grid-template-columns: 1fr 1fr; } }
.spot-pic { position: relative; border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 3px var(--navy); cursor: crosshair; touch-action: manipulation; }
.spot-pic img { display: block; width: 100%; height: auto; }
.spot-pic svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.spot-pic .tag { position: absolute; right: 8px; bottom: 8px; opacity: .85; background: var(--navy); color: #fff; border-radius: 999px; padding: 1px 10px;
  font: 700 .8rem var(--body); }
.found-c { fill: none; stroke: var(--red); stroke-width: 5; animation: pop .3s ease-out; transform-box: fill-box; transform-origin: center; }
.miss-x { stroke: #8a94a8; stroke-width: 5; stroke-linecap: round; animation: fadeout 1s forwards; }
.hint-c { fill: rgba(255, 210, 63, .35); stroke: #f0b400; stroke-width: 4; stroke-dasharray: 10 8; animation: pulse .7s 4; }
@keyframes fadeout { 0% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
.spot-tally { display: flex; gap: 6px; flex-wrap: wrap; }
.spot-tally i { width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 3px var(--line); }
.spot-tally i.on { background: var(--red); box-shadow: none; }
.spot-list { margin: 10px 0 0; padding-left: 26px; font-size: 1rem; }
.spot-list li { margin: 2px 0; }

/* numbers 0-20 lessons */
.path { position: relative; max-width: 560px; margin: 10px auto 30px; }
.path svg.trail { position: absolute; inset: 0; width: 100%; height: 100%; }
.path-node { position: relative; display: flex; align-items: center; gap: 14px; text-decoration: none; margin: 0 0 20px; }
.path-node:nth-child(4n+2) { margin-left: 22%; }
.path-node:nth-child(4n+3) { margin-left: 44%; }
.path-node:nth-child(4n) { margin-left: 22%; }
.path-node .dot { flex: none; width: 74px; height: 74px; border-radius: 50%; background: var(--blue); color: #fff; display: flex; align-items: center;
  justify-content: center; font: 800 1.7rem var(--display); box-shadow: 0 6px 0 var(--blue-dark); }
.path-node.done .dot { background: var(--green); box-shadow: 0 6px 0 #168a56; }
.path-node.next .dot { background: var(--red); box-shadow: 0 6px 0 var(--red-dark); animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-5px); } }
.path-node b { display: block; font: 800 1.15rem/1.15 var(--display); color: var(--navy); }
.path-node small { color: var(--muted); font-size: .85rem; }
.path-node .st { color: var(--yellow); letter-spacing: 2px; text-shadow: 0 1px 0 #d39b00; }
.path-node .st .off { color: #d9dfe8; text-shadow: none; }
.q-area { min-height: 300px; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 8px 0 4px; }
.q-pics { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: 640px; }
.q-pics svg { width: clamp(52px, 13vw, 92px); height: auto; transition: transform .2s, opacity .3s; }
.q-pics svg.lit { transform: scale(1.25); filter: drop-shadow(0 0 6px #ffd23f); }
.q-pics svg.gone { opacity: .25; }
.q-pics .sep { font: 800 2.6rem var(--display); color: var(--navy); align-self: center; padding: 0 8px; }
.q-row { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; align-items: center; }
.q-group { border-radius: 18px; padding: 10px; box-shadow: inset 0 0 0 3px var(--line); background: #fff; cursor: pointer; border: 0; min-width: 120px; }
@media (hover: hover) { .q-group:hover { box-shadow: inset 0 0 0 3px var(--blue); } }
.q-big { font: 800 clamp(2.4rem, 8vw, 4rem)/1 var(--display); color: var(--navy); text-align: center; }
.q-big .blank { display: inline-block; min-width: 1.2em; border-bottom: 6px solid var(--blue); color: var(--blue); }
.answers { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.answers button { width: clamp(84px, 22vw, 120px); height: clamp(84px, 22vw, 120px); border-radius: 24px; border: 0; cursor: pointer;
  background: #fff; font: 800 clamp(2.2rem, 7vw, 3.2rem) var(--display); color: var(--navy); box-shadow: 0 6px 0 #c9d3e2, inset 0 0 0 3px #d4dce8; }
.answers button.right { background: var(--green); color: #fff; box-shadow: 0 6px 0 #168a56; }
.answers button.wrong { background: #ffe1de; color: var(--red-dark); }
.answers button.word { width: auto; padding: 0 22px; font-size: clamp(1.3rem, 4vw, 1.8rem); }
.tenframe { display: grid; grid-template-columns: repeat(5, 1fr); border: 4px solid var(--navy); border-radius: 8px; width: clamp(220px, 60vw, 320px);
  background: #fff; }
.tenframe i { aspect-ratio: 1; border: 2px solid #9aa7bd; display: flex; align-items: center; justify-content: center; }
.tenframe i::after { content: ""; width: 72%; height: 72%; border-radius: 50%; }
.tenframe i.r::after { background: #e53935; }
.tenframe i.b::after { background: #1e88e5; }
.tenframe i.lit::after { box-shadow: 0 0 0 5px #ffd23f; }
.numline { width: 100%; max-width: 760px; height: auto; }
.lesson-bar { height: 12px; border-radius: 99px; background: var(--line); overflow: hidden; flex: 1 1 120px; }
.lesson-bar b { display: block; height: 100%; width: 0; background: var(--green); transition: width .3s; }
.game-about { max-width: 980px; margin: 22px auto 0; }
.game-about h2 { font-size: 1.5rem; }
@media (max-width: 600px) { .game { padding: 8px; border-radius: 14px; } .crayon { width: 52px; } .crayon i { width: 40px; height: 40px; }
  .g-say svg { width: 44px; } .path-node:nth-child(n) { margin-left: 0; } }
.play-tile { aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px; font: 800 clamp(1.5rem, 4vw, 2.2rem)/1.1 var(--display); color: #fff; background: var(--blue); }
.play-tile.t1 { background: var(--red); } .play-tile.t2 { background: var(--green); } .play-tile.t3 { background: var(--purple); } .play-tile.t4 { background: #f08c00; }
.play-group { font-size: 1.5rem; margin: 26px 0 12px; }
.play-group:first-child { margin-top: 0; }
.play-card .st, .path-node .st { color: #f0b400; letter-spacing: 1px; }
.play-hero .crumbs, .play-hero .crumbs a { color: #b9c8e2; }
.answers button.hint, .q-group.hint { animation: bob 1s ease-in-out infinite; box-shadow: 0 6px 0 #c9d3e2, inset 0 0 0 4px var(--green); }
