/* Goal Kick: striped pitch, a goal with a net up top, the goalie inside it and Alanna kicking from below. */
.game.soccer { background: #3aa655; }
.soccer .pitch { flex: 1; position: relative; min-height: 0; overflow: hidden; background: repeating-linear-gradient(180deg, #4cbf5f 0 48px, #43b056 48px 96px); }
.soccer .stands {
  position: absolute; top: 0; left: 0; right: 0; height: 64px; z-index: 1;
  background: repeating-linear-gradient(180deg, #8a8fa8 0 16px, #7b8099 16px 32px); border-bottom: 4px solid var(--ink);
  display: flex; justify-content: center; align-items: flex-end; gap: 2px; font-size: 46px; line-height: 1; padding-bottom: 2px; overflow: hidden;
}
.soccer .stands span { display: inline-block; }
.soccer .stands.cheer span { animation: soc-fan .45s ease-out 3; }

.soccer .box-line { position: absolute; top: 84px; left: 50%; transform: translateX(-50%); width: min(920px, 92%); height: calc(44% + 70px); border: 5px solid rgba(255, 255, 255, .7); border-top: none; }
.soccer .pen-spot { position: absolute; left: 50%; bottom: 22px; width: 14px; height: 14px; margin-left: 9px; border-radius: 50%; background: rgba(255, 255, 255, .8); }

.soccer .goal { position: absolute; top: 84px; left: 50%; transform: translateX(-50%); width: min(760px, 78%); height: 44%; min-height: 200px; z-index: 2; }
.soccer .net {
  position: absolute; inset: 0; transform-origin: top center;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .55) 0 2px, transparent 2px 22px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .55) 0 2px, transparent 2px 22px),
    rgba(20, 70, 35, .28);
}
.soccer .goal.ripple .net { animation: soc-net .7s ease-out; }
.soccer .post, .soccer .crossbar { position: absolute; background: #fff; border: 4px solid var(--ink); border-radius: 7px; z-index: 4; }
.soccer .post { top: -14px; bottom: -4px; width: 16px; }
.soccer .post.l { left: -16px; }
.soccer .post.r { right: -16px; }
.soccer .crossbar { top: -16px; left: -16px; right: -16px; height: 16px; }

.soccer .spot { position: absolute; top: 6%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 3; opacity: 0; transition: opacity .3s; }
.soccer .spot.show { opacity: 1; }
.soccer .spot.show.dim { opacity: .35; }
.soccer .word-bubble { background: #fff; color: var(--ink); border: 4px solid var(--ink); border-radius: 18px; padding: 0 14px; font-size: var(--word-size, 40px); font-weight: 800; letter-spacing: 3px; box-shadow: var(--shadow); white-space: nowrap; }
.soccer .spot.aimed .word-bubble { background: #fff8d6; box-shadow: 0 0 0 4px var(--sun), var(--shadow); }
.soccer .word-bubble span.done { color: var(--good); }
.soccer .word-bubble span.now { color: var(--coral-dark); text-decoration: underline 4px var(--coral); text-underline-offset: 6px; }
.soccer .target { width: 58px; height: 58px; border-radius: 50%; border: 4px dashed rgba(255, 255, 255, .9); background: rgba(255, 210, 63, .22); }
.soccer .spot.aimed .target { border-color: var(--sun); animation: soc-target .8s ease-in-out infinite; }
/* long phrases: one row each, top left / middle / bottom right, target beside the words */
.soccer .goal.stagger .spot { flex-direction: row; gap: 8px; transform: none; }
.soccer .goal.stagger .target { width: 40px; height: 40px; flex: none; }
.soccer .goal.stagger [data-spot="0"] { left: 2% !important; top: 2%; }
.soccer .goal.stagger [data-spot="1"] { left: 50% !important; top: 31%; transform: translateX(-50%); }
.soccer .goal.stagger [data-spot="2"] { left: auto !important; right: 2%; top: 60%; flex-direction: row-reverse; }

.soccer .goalie { position: absolute; bottom: -6px; left: 50%; width: 150px; transform: translateX(-50%); z-index: 2; }
.soccer .goalie-svg { display: block; width: 100%; height: auto; animation: soc-bob .9s ease-in-out infinite; transition: transform .2s; transform-origin: bottom center; }
.soccer .goalie.dive .goalie-svg { animation: none; }
.soccer .goalie.dive.left .goalie-svg { transform: rotate(-38deg) translateY(-12px); }
.soccer .goalie.dive.right .goalie-svg { transform: rotate(38deg) translateY(-12px); }
.soccer .goalie.dive.up .goalie-svg { transform: translateY(-26px); }
.soccer .goalie.catch .goalie-svg { animation: soc-catch .5s ease-out; }
.soccer .goalie-alert { position: absolute; top: -18px; right: 20px; font-size: 34px; opacity: 0; transition: opacity .2s; }
.soccer .goalie.alert .goalie-alert { opacity: 1; animation: soc-alert .3s ease-in-out infinite; }

.soccer .kicker { position: absolute; bottom: 4px; left: 50%; width: 110px; transform: translateX(-130%); z-index: 4; }
.soccer .kicker .avatar-svg { width: 110px; height: 176px; display: block; }
.soccer .kicker.kick { animation: soc-kick .5s ease-out; }
.soccer .ball { position: absolute; left: 50%; bottom: 16px; margin-left: -12px; font-size: 54px; line-height: 1; z-index: 5; will-change: transform; }

.soccer .hint-bubble {
  position: absolute; left: 50%; bottom: 196px; transform: translateX(-50%); z-index: 6;
  background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 16px; padding: 4px 14px;
  font-weight: 800; font-size: 18px; white-space: nowrap; opacity: 0; transition: opacity .2s; pointer-events: none;
}
.soccer .hint-bubble.show { opacity: 1; }
.soccer .banner {
  position: absolute; left: 0; right: 0; top: 34%; z-index: 6; text-align: center; pointer-events: none; opacity: 0;
  font-size: 96px; font-weight: 800; color: var(--sun); text-shadow: 0 6px 0 var(--coral-dark), 0 11px 0 var(--ink);
}
.soccer .banner.save { color: #fff; font-size: 72px; text-shadow: 0 6px 0 #1d7fd0, 0 11px 0 var(--ink); }
.soccer .banner.show { animation: soc-banner 1.6s ease-out forwards; }

@media (max-height: 700px) {
  .soccer .stands { height: 48px; font-size: 36px; }
  .soccer .goal, .soccer .box-line { top: 64px; }
  .soccer .word-bubble { font-size: min(var(--word-size, 40px), 30px); }
  .soccer .target { width: 44px; height: 44px; }
  .soccer .goalie { width: 110px; }
  .soccer .kicker { width: 80px; }
  .soccer .kicker .avatar-svg { width: 80px; height: 128px; }
  .soccer .ball { font-size: 40px; }
  .soccer .hint-bubble { bottom: 140px; font-size: 15px; }
  .soccer .banner { font-size: 64px; }
}

@keyframes soc-fan { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes soc-net { 0% { transform: none; } 30% { transform: scale(1.04, 1.08) skewX(2deg); } 60% { transform: scale(.98, .96) skewX(-2deg); } 100% { transform: none; } }
@keyframes soc-target { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }
@keyframes soc-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes soc-catch { 0% { transform: scale(1); } 40% { transform: scale(1.15) translateY(-14px); } 100% { transform: scale(1); } }
@keyframes soc-alert { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(10deg); } }
@keyframes soc-kick { 0% { transform: translateX(-130%); } 40% { transform: translateX(-100%) rotate(-10deg); } 100% { transform: translateX(-130%); } }
@keyframes soc-banner { 0% { opacity: 0; transform: scale(.3) rotate(-8deg); } 20% { opacity: 1; transform: scale(1.15) rotate(-4deg); } 75% { opacity: 1; transform: scale(1) rotate(-4deg); } 100% { opacity: 0; transform: scale(1.05) translateY(-30px) rotate(-4deg); } }

/* the timer bar under the goal: drains fast; when it's empty the goalie saves */
.soccer .kick-timer { position: absolute; top: calc(84px + 44% + 12px); left: 50%; transform: translateX(-50%); width: min(420px, 52%); height: 20px; border: 3px solid var(--ink); border-radius: 999px; background: #fff; overflow: hidden; z-index: 3; box-shadow: 0 3px 0 rgba(0, 0, 0, .2); }
.soccer .kick-timer i { display: block; height: 100%; width: 100%; background: #3ccf7a; border-radius: 999px; transition: background .2s; }

/* short screens (a small laptop, and the taller keyboard from level 6): the timer bar moves up into
   the stands and Alanna kicks from the side, so the goal can use the whole pitch for the words */
@media (max-height: 700px) {
  .soccer .stands { height: 30px; font-size: 24px; }
  .soccer .goal, .soccer .box-line { top: 42px; }
  .soccer .goal { height: calc(100% - 42px - 26px); min-height: 0; width: min(760px, 74%); }
  .soccer .box-line { height: calc(100% - 50px); }
  .soccer .kick-timer { top: 6px; height: 18px; }
  .soccer .word-bubble { font-size: min(var(--word-size, 40px), 30px); border-width: 3px; border-radius: 14px; }
  .soccer .goal.stagger .word-bubble { font-size: min(var(--word-size, 40px), 26px); }
  .soccer .target { width: 38px; height: 38px; }
  .soccer .goal.stagger .target { width: 32px; height: 32px; }
  .soccer .goalie { width: 84px; }
  .soccer .goalie-alert { top: -12px; right: 8px; font-size: 26px; }
  .soccer .kicker { left: 2%; bottom: 2px; width: 64px; transform: none; }
  .soccer .kicker .avatar-svg { width: 64px; height: 102px; }
  .soccer .kicker.kick { animation-name: soc-kick-side; }
  .soccer .ball { left: calc(2% + 60px); margin-left: 0; bottom: 6px; font-size: 32px; }
  .soccer .pen-spot { display: none; }
  .soccer .banner { font-size: 56px; top: 30%; }
  .soccer .banner.save { font-size: 48px; }
}
@keyframes soc-kick-side { 0% { transform: none; } 40% { transform: translateX(20%) rotate(-10deg); } 100% { transform: none; } }
