/* Spell Shot (reading): an ice rink seen from out by the blue line. The arena scoreboard at the top has
   the period clock, the word being spelled (one slot per puck) and the goals; under it the net with the
   animal goalie; the letter pucks slide around the middle of the ice; the player and stick at the bottom.
   Sizes are CSS variables so it fits a phone, an iPad either way up and a laptop. */
.game.spellshot { background: #26304f; }
.spellshot button { -webkit-tap-highlight-color: transparent; }
.spellshot .ss-rink {
  --slot: clamp(44px, 10.5vw, 62px); --board-h: calc(var(--slot) + 24px); --net-w: clamp(170px, min(30vw, 34vh), 260px);
  --puck: clamp(84px, min(19vw, 14vh), 112px); --me-w: clamp(76px, min(14vw, 13vh), 120px);
  flex: 1; position: relative; min-height: 0; overflow: hidden; margin: 0 8px 8px;
  touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  border: 6px solid #f4f7fb; border-radius: 38px; box-shadow: 0 0 0 4px var(--ink), inset 0 0 0 3px #ffd23f;
  background: radial-gradient(ellipse at 50% 38%, #ffffff 0%, #eaf5fc 62%, #d3e8f5 100%);
}
.spellshot .ss-line { position: absolute; left: 0; right: 0; pointer-events: none; }
.spellshot .ss-line.blue { top: 54%; height: 12px; background: rgba(59, 111, 216, .45); }
.spellshot .ss-line.red { top: 90%; height: 8px; background: rgba(224, 38, 47, .35); }
.spellshot .ss-dot { position: absolute; top: 62%; width: clamp(96px, 22vw, 180px); aspect-ratio: 1; border: 4px solid rgba(224, 38, 47, .3); border-radius: 50%; pointer-events: none; transform: translateY(-50%); }
.spellshot .ss-dot::after { content: ''; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px; border-radius: 50%; background: rgba(224, 38, 47, .35); }
.spellshot .ss-dot.l { left: 6%; }
.spellshot .ss-dot.r { right: 6%; }

/* ---------- the scoreboard: period clock, the word, goals ---------- */
.spellshot .ss-board {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 4;
  display: grid; grid-template-columns: auto auto auto; grid-template-areas: 'clock slots goals'; align-items: center; column-gap: 14px;
  background: #1d1a2e; border: 4px solid var(--ink); border-radius: 16px; padding: 6px 14px; box-shadow: 0 0 0 3px #4f5a86, var(--shadow);
  color: #ffd23f; font-weight: 800; white-space: nowrap; text-align: center;
}
.spellshot .ss-board small { display: block; font-size: 11px; letter-spacing: 1px; color: #b9b3d9; line-height: 1.1; }
.spellshot .ss-board b { display: block; font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; }
.spellshot .ss-clock { grid-area: clock; }
.spellshot .ss-goals { grid-area: goals; }
.spellshot .ss-goals b { color: #7dff8a; }
.spellshot .ss-clock.low b { color: #ff7b7b; animation: ss-blink 1s steps(2) infinite; }
.spellshot .ss-board.lit { animation: ss-board-lit .9s ease-out; }
.spellshot .ss-slots:empty { display: none; }
.spellshot .ss-slots { grid-area: slots; display: flex; justify-content: center; gap: 6px; cursor: pointer; min-height: var(--slot); }
.spellshot .ss-slot {
  height: var(--slot); min-width: calc(var(--slot) * (0.5 + 0.32 * var(--n))); padding: 0 4px; box-sizing: border-box;
  display: grid; place-items: center; background: #fff; color: var(--ink); border: 3px solid #8d86b5; border-radius: 10px;
  font-size: calc(var(--slot) * .64); font-weight: 700; line-height: 1;
}
.spellshot .ss-slot b { display: block; font-size: inherit; font-weight: 700; color: var(--ink); margin-top: -8%; }
.spellshot .ss-slot.silent { background: #efeaf7; border-style: dashed; }
.spellshot .ss-slot.silent b { color: #8d86b5; }
.spellshot .ss-slot.next { border-color: #ffd23f; box-shadow: 0 0 0 3px rgba(255, 210, 63, .45); }
.spellshot .ss-slot.want { animation: ss-want .45s ease-in-out 3; }
.spellshot .ss-slot.in b { animation: ss-pop .35s ease-out; }
.spellshot .ss-slot.lit { background: #ffd23f; border-color: #fff; animation: ss-lit .5s ease-out both; }
.spellshot .ss-slot.lit b { color: var(--ink); }

/* ---------- the net and the goalie ---------- */
.spellshot .ss-net { position: absolute; left: 50%; top: calc(var(--board-h) + 18px); width: var(--net-w); margin-left: calc(var(--net-w) / -2); aspect-ratio: 240 / 130; z-index: 2; }
.spellshot .ss-net-art { display: block; width: 100%; height: 100%; overflow: visible; }
.spellshot .ss-net.ripple .ss-net-art { animation: ss-ripple .45s ease-out; }
.spellshot .ss-net.post-l .ss-net-art { animation: ss-post-l .35s ease-out; }
.spellshot .ss-net.post-r .ss-net-art { animation: ss-post-r .35s ease-out; }
.spellshot .ss-goalie { position: absolute; left: 50%; bottom: 2%; width: 44%; height: 76%; margin-left: -22%; display: flex; align-items: flex-end; justify-content: center; }
.spellshot .ss-goalie .critter-svg { width: 100%; height: 100%; --amp: 16%; animation: ss-sway 2.6s ease-in-out infinite; }
.spellshot .ss-goalie.lvl-1 .critter-svg { --amp: 24%; animation-duration: 1.8s; }
.spellshot .ss-goalie.lvl-2 .critter-svg { --amp: 30%; animation: ss-hop 1.3s ease-in-out infinite; }
.spellshot .ss-goalie.lvl-3 .critter-svg { --amp: 34%; animation: ss-hop .9s ease-in-out infinite; }
.spellshot .ss-goalie.lvl-4 .critter-svg { --amp: 38%; animation: ss-hop .6s ease-in-out infinite; }
.spellshot .ss-goalie.dive-l { animation: ss-dive-l .7s ease-out; }
.spellshot .ss-goalie.dive-r { animation: ss-dive-r .7s ease-out; }

/* ---------- the pucks ---------- */
.spellshot .ss-ice { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.spellshot .ss-puck {
  position: absolute; left: 0; top: 0; width: var(--puck); height: var(--puck); padding: 0; border: 0; border-radius: 50%;
  pointer-events: auto; cursor: pointer; touch-action: manipulation; will-change: transform;
  display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 50% 38%, #50505f 0%, #26262f 58%, #121218 100%);
  box-shadow: 0 7px 0 #07070a, 0 13px 10px rgba(20, 40, 80, .22);
}
.spellshot .ss-puck::before { content: ''; position: absolute; inset: 9%; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .14); pointer-events: none; }
.spellshot .ss-puck .rd-word { font-size: calc(var(--puck) * .54); font-weight: 700; line-height: 1; margin-top: -10%; pointer-events: none; }
.spellshot .ss-puck .rd-word.two { font-size: calc(var(--puck) * .44); }
.spellshot .ss-puck.hint { animation: ss-hint .8s ease-in-out infinite; }
.spellshot .ss-puck.flying { z-index: 6; pointer-events: none; }
.spellshot .ss-puck.off { pointer-events: none; animation: ss-off .45s ease-in forwards; }

/* ---------- the player ---------- */
.spellshot .ss-me { position: absolute; left: 50%; bottom: 0; width: var(--me-w); height: calc(var(--me-w) * 1.6); margin-left: calc(var(--me-w) / -2); z-index: 4; pointer-events: none; }
.spellshot .ss-me-body, .spellshot .ss-me-body .avatar-svg { width: 100%; height: 100%; display: block; }
.spellshot .ss-stick { position: absolute; width: 74%; left: -40%; top: 42%; transform-origin: 94% 5%; }
.spellshot .ss-me.swing .ss-stick { animation: ss-swing .32s ease-out; }
.spellshot .ss-blade { position: absolute; left: -36%; bottom: 3%; width: 8px; height: 8px; }
.spellshot .ss-hear {
  position: absolute; right: 12px; bottom: 12px; z-index: 5; width: 68px; height: 68px; border-radius: 50%;
  border: 4px solid var(--ink); background: #fff; font-size: 32px; box-shadow: var(--shadow); cursor: pointer; touch-action: manipulation;
}

/* ---------- banner and the start card ---------- */
.spellshot .ss-banner {
  position: absolute; left: 50%; top: 56%; z-index: 8; transform: translate(-50%, -50%) scale(.6); opacity: 0; pointer-events: none;
  font-size: clamp(40px, 9vw, 84px); font-weight: 800; color: #fff; white-space: nowrap;
  -webkit-text-stroke: 2px var(--ink); text-shadow: 0 5px 0 var(--ink); transition: opacity .2s, transform .25s cubic-bezier(.3, 1.6, .5, 1);
}
.spellshot .ss-banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.spellshot .ss-banner.goal { color: #ffd23f; font-size: clamp(56px, 13vw, 120px); }
.spellshot .ss-start { position: absolute; inset: 0; z-index: 12; display: none; place-items: center; background: rgba(20, 30, 60, .4); padding: 16px; }
.spellshot .ss-start.show { display: grid; }
.spellshot .ss-card { background: #fff; border: 4px solid var(--ink); border-radius: 26px; padding: 16px 22px; box-shadow: var(--shadow); text-align: center; max-width: 560px; }
.spellshot .ss-demo { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; font-size: 26px; font-weight: 800; color: var(--ink); }
.spellshot .ss-say .rd-word { display: inline-block; background: #fff8d6; border: 3px solid var(--ink); border-radius: 12px; padding: 0 10px; font-weight: 700; }
.spellshot .ss-arrow { color: var(--ink-soft); }
.spellshot .ss-mini { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 26px; font-weight: 700; background: radial-gradient(circle at 50% 38%, #50505f 0%, #26262f 58%, #121218 100%); box-shadow: 0 4px 0 #07070a; }
.spellshot .ss-goal-ico { font-size: 40px; }
.spellshot .ss-how { margin: 12px 0 6px; font-size: 20px; font-weight: 800; color: var(--ink); }
.spellshot .ss-off { font-weight: 700; color: var(--coral-dark); }
.spellshot .ss-go { font-size: 30px; padding: 8px 36px; margin-top: 6px; }
.spellshot .ss-vs { margin: 10px 0 0; font-weight: 800; color: var(--ink-soft); display: flex; align-items: center; justify-content: center; gap: 6px; }
.spellshot .ss-vs-pic .critter-svg { width: 40px; height: 40px; vertical-align: middle; }

@media (max-width: 560px) {
  .spellshot .ss-rink { --board-h: calc(var(--slot) + 46px); margin: 0 4px 4px; border-width: 5px; border-radius: 28px; }
  .spellshot .ss-board { grid-template-columns: auto auto; grid-template-areas: 'clock goals' 'slots slots'; row-gap: 4px; padding: 3px 10px 8px; column-gap: 26px; }
  .spellshot .ss-clock, .spellshot .ss-goals { display: flex; align-items: baseline; justify-content: center; gap: 6px; }
  .spellshot .ss-board b { font-size: 22px; }
  .spellshot .ss-hear { width: 58px; height: 58px; font-size: 26px; right: 8px; bottom: 8px; }
  .spellshot .ss-mini { width: 46px; height: 46px; font-size: 22px; }
  .spellshot .ss-demo { font-size: 22px; gap: 6px; }
}

@keyframes ss-blink { 50% { opacity: .35; } }
@keyframes ss-board-lit { 0% { box-shadow: 0 0 0 3px #4f5a86, var(--shadow); } 30% { box-shadow: 0 0 0 6px #ffd23f, 0 0 30px 10px rgba(255, 210, 63, .7); } 100% { box-shadow: 0 0 0 3px #4f5a86, var(--shadow); } }
@keyframes ss-want { 50% { border-color: #ff9f1c; box-shadow: 0 0 0 6px rgba(255, 159, 28, .7), 0 0 18px 4px rgba(255, 159, 28, .6); } }
@keyframes ss-pop { 0% { transform: scale(.2); opacity: 0; } 70% { transform: scale(1.25); } 100% { transform: none; opacity: 1; } }
@keyframes ss-lit { 0% { transform: none; } 40% { transform: translateY(-8px) scale(1.12); } 100% { transform: none; } }
@keyframes ss-ripple { 0% { transform: none; } 35% { transform: scaleY(1.05) scaleX(.97); } 70% { transform: scaleY(.98) scaleX(1.02); } 100% { transform: none; } }
@keyframes ss-post-l { 0%, 100% { transform: none; } 30% { transform: rotate(-2.5deg); } 65% { transform: rotate(1.5deg); } }
@keyframes ss-post-r { 0%, 100% { transform: none; } 30% { transform: rotate(2.5deg); } 65% { transform: rotate(-1.5deg); } }
@keyframes ss-sway { 0%, 100% { transform: translateX(calc(var(--amp) * -1)); } 50% { transform: translateX(var(--amp)); } }
@keyframes ss-hop { 0%, 100% { transform: translate(calc(var(--amp) * -1), 0); } 25% { transform: translate(0, -12%); } 50% { transform: translate(var(--amp), 0); } 75% { transform: translate(0, -12%); } }
@keyframes ss-dive-l { 0%, 100% { transform: none; } 30%, 60% { transform: translate(-70%, 8%) rotate(-55deg); } }
@keyframes ss-dive-r { 0%, 100% { transform: none; } 30%, 60% { transform: translate(70%, 8%) rotate(55deg); } }
@keyframes ss-hint { 0%, 100% { box-shadow: 0 7px 0 #07070a, 0 0 0 5px #ffd23f, 0 0 14px 4px rgba(255, 210, 63, .6); } 50% { box-shadow: 0 7px 0 #07070a, 0 0 0 9px #ffd23f, 0 0 30px 12px rgba(255, 210, 63, .9); } }
@keyframes ss-off { to { opacity: 0; scale: .3; } }
@keyframes ss-swing { 0% { transform: none; } 35% { transform: rotate(30deg); } 65% { transform: rotate(-10deg); } 100% { transform: none; } }
