/* Skip Stones (js/arcade/skipstones.js). Every class starts with .sk- */

.sk-wrap {
  --pond: color-mix(in srgb, var(--sky) 30%, white);
  --deep: color-mix(in srgb, var(--sky-d) 70%, var(--ink));
  position: relative; display: grid; gap: 8px; width: min(100%, 600px); margin: 0 auto; padding-bottom: 14px;
}

/* ---------- HUD: the question she is on, the stars she can win, the score ---------- */
.sk-hud { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 14px; font: 700 14px var(--font-ui); color: var(--muted); }
.sk-hud b { color: var(--ink); font-size: 19px; }
.sk-stars { display: inline-flex; gap: 3px; }
.sk-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));
}
.sk-star.sk-half { --f: 50%; }
.sk-star.sk-full { --f: 100%; animation: sk-pop 0.45s; }
@keyframes sk-pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.25); } 100% { transform: none; } }

/* ---------- the question she reads ---------- */
.sk-ask { display: grid; place-items: center; min-height: 76px; padding: 8px 14px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-soft); text-align: center; }
.sk-q { margin: 0; font: 800 23px/1.25 var(--font-read); color: var(--grape-d); text-wrap: balance; }

/* ---------- the pond: tap it to skip the stone ---------- */
.sk-pond {
  display: block; width: 100%; padding: 0; border: 0; border-radius: var(--radius); cursor: pointer; touch-action: manipulation; overflow: hidden;
  background: linear-gradient(var(--pond), color-mix(in srgb, var(--sky) 46%, white)); box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--sky) 70%, white), var(--shadow-soft);
}
.sk-water { display: block; width: 100%; height: auto; }
.sk-wrap.sk-right .sk-pond { box-shadow: inset 0 0 0 4px var(--green-d), var(--shadow-soft); }
.sk-bank { fill: color-mix(in srgb, var(--lime) 60%, white); stroke: var(--lime-d); stroke-width: 2; }
.sk-line { fill: none; stroke: var(--deep); stroke-width: 3; stroke-linecap: round; }
.sk-tick { fill: none; stroke: var(--deep); stroke-width: 1.2; opacity: 0.6; }
.sk-tick-big { stroke-width: 2; opacity: 1; }
.sk-num { font: 700 11px var(--font-ui); fill: var(--deep); text-anchor: middle; }
.sk-pad-leaf { fill: var(--green); stroke: var(--green-d); stroke-width: 2; }
.sk-pad-notch { fill: none; stroke: var(--pond); stroke-width: 3; stroke-linecap: round; }
.sk-goal-box { fill: var(--card); stroke: var(--grape); stroke-width: 2; }
.sk-goal { font: 900 15px var(--font-ui); fill: var(--grape-d); text-anchor: middle; dominant-baseline: central; }
.sk-pad-on .sk-goal-box { fill: var(--green); stroke: var(--green-d); }
.sk-pad-on .sk-goal { fill: var(--card); }
.sk-arc { fill: none; stroke: var(--card); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 5 5; }
.sk-ring { fill: none; stroke: var(--card); stroke-width: 2; transform-box: fill-box; transform-origin: center; }
.sk-ring-new { animation: sk-ripple 0.6s ease-out 0.3s backwards; }
.sk-ring-gone { opacity: 0; animation: sk-fade 0.9s ease-out 0.2s backwards; }
@keyframes sk-ripple { 0% { transform: scale(0.2); opacity: 0; } 50% { transform: scale(1.9); opacity: 1; } 100% { transform: none; } }
@keyframes sk-fade { 0% { transform: scale(0.2); opacity: 0; } 40% { transform: scale(1.6); opacity: 1; } 100% { transform: scale(2.2); opacity: 0; } }
.sk-landed { font: 900 14px var(--font-ui); fill: var(--ink); text-anchor: middle; dominant-baseline: central; }
/* which skip it was: shown when she needs help counting, and with the answer */
.sk-nth { display: none; font: 900 13px var(--font-ui); fill: var(--grape-d); text-anchor: middle; }
.sk-numbered .sk-nth { display: block; }
.sk-stone-body { fill: color-mix(in srgb, var(--ink) 45%, white); stroke: var(--ink); stroke-width: 1.8; }
.sk-stone-shine { fill: var(--card); opacity: 0.7; }

/* ---------- the trail: the numbers the stone has landed on ---------- */
.sk-trail { display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 2px 10px; min-height: 44px; margin: 0; padding: 4px 12px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow-soft); }
.sk-trail-name { font: 700 14px var(--font-ui); color: var(--muted); }
.sk-trail b { font: 900 25px/1.3 var(--font-ui); color: var(--green-d); }
.sk-trail b.sk-none { font: 700 16px/1.9 var(--font-read); color: var(--muted); }

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

/* ---------- the buttons: the size of the skip, Skip, and how many skips ---------- */
.sk-panel { display: grid; gap: 8px; }
.sk-panel[hidden] { display: none; }
.sk-pick { display: flex; align-items: center; justify-content: center; gap: 10px; }
.sk-label { text-align: center; font: 800 17px/1.2 var(--font-read); color: var(--grape-d); }
.sk-sizes { display: flex; gap: 8px; }
.sk-size { min-width: 58px; min-height: 52px; padding: 6px 10px; color: var(--ink); font: 900 26px/1 var(--font-ui); touch-action: manipulation; }
.sk-size.sk-on { background: var(--grape); box-shadow: 0 5px 0 var(--grape-d); color: var(--card); }
.sk-size:disabled { opacity: 1; cursor: default; }
.sk-size.sk-gone, .sk-choice.sk-gone { opacity: 0.35; }
.sk-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.sk-back { padding: 10px 6px; font-size: 17px; white-space: nowrap; touch-action: manipulation; }
.sk-go { min-height: 56px; font-size: 24px; touch-action: manipulation; }
.sk-off { opacity: 0.45; }
.sk-choices { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sk-choice { min-height: 56px; padding: 8px 4px; color: var(--ink); font: 900 30px/1 var(--font-ui); touch-action: manipulation; }
.sk-choice.sk-yes { background: var(--green); box-shadow: 0 5px 0 var(--green-d); color: var(--card); }

/* a skip that can't be made, and a wrong try: a little shake */
.sk-no { animation: sk-no 0.32s; }
@keyframes sk-no { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* iPad: more room */
@media (min-width: 700px) {
  .sk-wrap { gap: 12px; }
  .sk-q { font-size: 30px; }
  .sk-ask { min-height: 96px; }
  .sk-trail b { font-size: 32px; }
  .sk-msg { font-size: 19px; }
  .sk-label { font-size: 20px; }
  .sk-size { min-width: 72px; min-height: 60px; font-size: 30px; }
  .sk-choice { min-height: 66px; font-size: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .sk-star.sk-full, .sk-no, .sk-ring-new, .sk-ring-gone { animation: none; }
}
