/* How Many Tens? (js/arcade/howmanytens.js). Every class starts with .ht- */

.ht-wrap { position: relative; display: grid; gap: 10px; width: min(100%, 560px); margin: 0 auto; padding-bottom: 14px; }

/* ---------- HUD: the card she is on, the stars she can win, the score ---------- */
.ht-hud { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 14px; font: 700 14px var(--font-ui); color: var(--muted); }
.ht-hud b { color: var(--ink); font-size: 19px; }
/* the stars have a line to themselves: a game has five or six of them */
.ht-stars { display: flex; justify-content: center; gap: 3px; flex-basis: 100%; order: 2; }
.ht-star {
  --f: 0%; width: 24px; height: 24px;
  clip-path: polygon(50% 2%, 62% 36%, 98% 37%, 69% 59%, 80% 94%, 50% 73%, 20% 94%, 31% 59%, 2% 37%, 38% 36%);
  background: linear-gradient(90deg, var(--sun) var(--f), var(--tile-shadow) var(--f));
}
.ht-star.ht-half { --f: 50%; }
.ht-star.ht-full { --f: 100%; animation: ht-pop 0.45s; }
@keyframes ht-pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.25); } 100% { transform: none; } }

/* ---------- the card: a picture, the question, and (after the answer) the real number ---------- */
.ht-card { display: grid; justify-items: center; gap: 6px; padding: 14px 16px 12px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-soft); }
.ht-card.ht-in { animation: ht-in 0.3s ease-out; }
@keyframes ht-in { 0% { opacity: 0; transform: translateY(10px) scale(0.96); } 100% { opacity: 1; transform: none; } }
.ht-art { display: grid; place-items: center; width: 108px; height: 108px; border-radius: 50%; background: color-mix(in srgb, var(--sky) 16%, white); }
.ht-pic { display: block; width: 78px; height: 78px; overflow: visible; }
.ht-what { margin: 0; min-height: 2.6em; display: grid; place-items: center; text-align: center; text-wrap: balance; font: 700 23px/1.3 var(--font-read); color: var(--ink); }
/* the real number: in its own tile, big, once she has it right */
.ht-real { margin: 0; min-width: 150px; min-height: 52px; padding: 4px 18px; display: grid; place-items: center; border-radius: 16px; font: 900 32px/1.2 var(--font-ui); color: var(--tile-shadow); background: color-mix(in srgb, var(--tile-shadow) 30%, white); white-space: nowrap; }
.ht-done .ht-real { color: var(--green-d); background: color-mix(in srgb, var(--green) 20%, white); animation: ht-pop 0.45s; }

/* the drawings: an ink outline on every shape, fills from the tokens */
.ht-pic * { stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; fill: none; }
.ht-pic .ht-n { stroke: none; }
.ht-pic .ht-sun { fill: var(--sun); }
.ht-pic .ht-sky { fill: var(--sky); }
.ht-pic .ht-green { fill: var(--green); }
.ht-pic .ht-grape { fill: var(--grape); }
.ht-pic .ht-rose { fill: var(--rose); }
.ht-pic .ht-teal { fill: var(--teal); }
.ht-pic .ht-lime { fill: var(--lime); }
.ht-pic .ht-w { fill: var(--card); }
.ht-pic .ht-k { fill: var(--ink); }
.ht-pic .ht-m { fill: var(--tile-shadow); }

/* ---------- the bins ---------- */
.ht-ask { margin: 2px 0 0; text-align: center; font: 700 18px/1.2 var(--font-read); color: var(--muted); }
.ht-bins { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 10px; }
.ht-b3 .ht-bins, .ht-b6 .ht-bins { grid-template-columns: repeat(3, 1fr); }
.ht-c-sun { --k: var(--sun); --k-d: var(--sun-d); }
.ht-c-sky { --k: var(--sky); --k-d: var(--sky-d); }
.ht-c-green { --k: var(--green); --k-d: var(--green-d); }
.ht-c-grape { --k: color-mix(in srgb, var(--grape) 55%, white); --k-d: var(--grape); }
.ht-c-rose { --k: var(--rose); --k-d: var(--rose-d); }
.ht-c-teal { --k: color-mix(in srgb, var(--teal) 70%, white); --k-d: var(--teal-d); }
.ht-bin {
  min-width: 0; min-height: 72px; padding: 8px 4px; border: 0; border-radius: 18px; background: var(--k); box-shadow: 0 5px 0 var(--k-d);
  color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: opacity 0.2s, transform 0.08s;
}
.ht-bin b { font: 900 30px/1 var(--font-ui); white-space: nowrap; }
.ht-b3 .ht-bin b { font-size: 26px; }
.ht-b6 .ht-bin b { font-size: 21px; letter-spacing: -0.3px; }
.ht-b6 .ht-bin { min-height: 64px; }
.ht-bin:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--k-d); }
.ht-bin.ht-out { opacity: 0.3; box-shadow: none; cursor: default; }
.ht-bin.ht-rest { opacity: 0.45; cursor: default; }
.ht-bin.ht-yes { box-shadow: 0 0 0 4px var(--card), 0 0 0 8px var(--green-d); animation: ht-pop 0.45s; cursor: default; }

.ht-msg { min-height: 44px; margin: 0; display: grid; place-items: center; text-align: center; font: 700 16px/1.35 var(--font-read); color: var(--ink); }

/* a wrong bin: a little shake */
.ht-no { animation: ht-no 0.32s; }
@keyframes ht-no { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* iPad: more room */
@media (min-width: 700px) {
  .ht-wrap { gap: 14px; }
  .ht-art { width: 150px; height: 150px; }
  .ht-pic { width: 108px; height: 108px; }
  .ht-what { font-size: 30px; }
  .ht-real { font-size: 42px; min-height: 66px; }
  .ht-bin { min-height: 92px; }
  .ht-bin b { font-size: 38px; }
  .ht-b3 .ht-bin b { font-size: 34px; }
  .ht-b6 .ht-bin b { font-size: 30px; }
  .ht-msg { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  .ht-star.ht-full, .ht-card.ht-in, .ht-done .ht-real, .ht-bin.ht-yes, .ht-no { animation: none; }
}
