/* Soccer — shared look for every /soccer/ page. Tablet-first, big touch targets. */
:root {
  --grass: #2fa84f; --grass2: #279546; --grass-dark: #1d7a38; --line: #ffffffd9;
  --ink: #1b2a1f; --paper: #ffffff; --sun: #ffd23f; --sky: #5bc0f8; --red: #e53935; --blue: #1e66f5;
  --card: #ffffff; --shadow: 0 6px 0 rgba(0,0,0,.18);
  --font: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: var(--font); color: var(--ink); min-height: 100vh; min-height: 100dvh;
  background: repeating-linear-gradient(90deg, var(--grass) 0 80px, var(--grass2) 80px 160px);
  -webkit-user-select: none; user-select: none; overscroll-behavior: none;
}
button { font-family: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }

/* top bar */
.s-bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: calc(8px + env(safe-area-inset-top)) 14px 8px; background: rgba(15, 60, 28, .55);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #fff;
}
.s-back {
  flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 64px; height: 52px;
  padding: 0 14px; border-radius: 16px; background: #ffffffee; color: var(--ink); font-size: 24px; font-weight: 800;
  text-decoration: none; box-shadow: var(--shadow);
}
.s-title { flex: 1; margin: 0; font-size: clamp(20px, 3.6vw, 32px); font-weight: 900; text-align: center; text-shadow: 0 2px 0 rgba(0,0,0,.3); }
.s-badge { flex: none; width: 58px; height: 58px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); overflow: hidden; display: block; }
.s-badge svg { width: 100%; height: 100%; display: block; }

/* big friendly buttons */
.s-btn {
  border: 0; border-radius: 20px; padding: 14px 24px; min-height: 60px; font-size: 22px; font-weight: 900;
  background: var(--sun); color: var(--ink); box-shadow: var(--shadow); transition: transform .08s;
}
.s-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.s-btn.blue { background: var(--blue); color: #fff; }
.s-btn.red { background: var(--red); color: #fff; }
.s-btn.white { background: #fff; }

.s-panel { background: #fffffff2; border-radius: 28px; box-shadow: 0 10px 0 rgba(0,0,0,.15); padding: 20px; }

/* level picker */
.s-levels { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.s-level {
  width: 170px; height: 150px; border: 0; border-radius: 26px; background: #fff; box-shadow: var(--shadow);
  font-size: 28px; font-weight: 900; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.s-level span { font-size: 54px; }
.s-level:nth-child(1) { background: #c9f2d0; }
.s-level:nth-child(2) { background: #ffe9a8; }
.s-level:nth-child(3) { background: #ffc9c2; }
.s-level.last { outline: 5px solid #fff; outline-offset: 3px; }
.s-level:active { transform: translateY(4px); }

/* toast */
.s-toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 160%); z-index: 60;
  background: #fff; border-radius: 22px; padding: 12px 22px; font-size: 24px; box-shadow: 0 8px 30px rgba(0,0,0,.3);
  display: flex; align-items: center; gap: 12px; transition: transform .35s cubic-bezier(.3,1.5,.6,1); max-width: 92vw;
}
.s-toast.show { transform: translate(-50%, 0); }
.toast-flag { height: 40px; width: auto; border-radius: 6px; box-shadow: 0 0 0 1px rgba(0,0,0,.15); font-size: 36px; line-height: 40px; }

/* GOAL overlay */
.s-goal {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle, rgba(255,210,63,.55), rgba(0,0,0,.45)); overflow: hidden; animation: s-fade .25s;
}
.s-goal.them { background: rgba(0,0,0,.35); }
.s-goal-word { font-size: clamp(70px, 16vw, 170px); font-weight: 900; color: #fff; letter-spacing: 4px; -webkit-text-stroke: 4px #1b2a1f; paint-order: stroke; }
.s-goal-word span { display: inline-block; animation: s-letter .6s cubic-bezier(.3,1.6,.5,1) both; }
.s-goal-av { width: min(36vh, 260px); }
.s-goal-av svg { width: 100%; height: auto; display: block; overflow: visible; }
.s-confetti { position: absolute; top: -20px; width: 12px; height: 18px; border-radius: 3px; animation: s-fall linear forwards; }
@keyframes s-fade { from { opacity: 0; } }
@keyframes s-letter { from { transform: translateY(-120px) scale(.3); opacity: 0; } }
@keyframes s-fall { to { transform: translateY(110vh) rotate(720deg); } }

/* celebrations (also used by the avatar maker's preview) */
.cel-jump { animation: cel-jump .55s ease-in-out infinite alternate; }
.cel-spin { animation: cel-spin .9s linear infinite; }
.cel-backflip { animation: cel-backflip 1.2s ease-in-out infinite; }
.cel-airplane { animation: cel-airplane 1.4s ease-in-out infinite; }
.cel-dance { animation: cel-dance .5s ease-in-out infinite alternate; }
.cel-slide { animation: cel-slide 1.6s ease-out infinite; }
@keyframes cel-jump { from { transform: translateY(20px) scaleY(.92); } to { transform: translateY(-70px); } }
@keyframes cel-spin { to { transform: rotateY(360deg); } }
@keyframes cel-backflip { 0% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-90px) rotate(-180deg); } 100% { transform: translateY(0) rotate(-360deg); } }
@keyframes cel-airplane { 0%, 100% { transform: translateX(-60px) rotate(-12deg); } 50% { transform: translateX(60px) rotate(12deg); } }
@keyframes cel-dance { from { transform: rotate(-12deg) translateX(-14px); } to { transform: rotate(12deg) translateX(14px) translateY(-14px); } }
@keyframes cel-slide { 0% { transform: translateX(-60vw) skewX(-10deg); } 55% { transform: translateX(0) skewX(-10deg); } 75%, 100% { transform: translateX(0) translateY(10px); } }

/* setup screens */
.s-setup { max-width: 900px; margin: 18px auto; padding: 0 16px 40px; display: flex; flex-direction: column; gap: 18px; align-items: center; text-align: center; }
.s-setup h2 { margin: 0; font-size: 30px; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.35); }
.s-teampick { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; width: 100%; }
.s-teampick button { border: 0; border-radius: 16px; background: #fff; padding: 10px 4px 8px; box-shadow: var(--shadow); font-size: 15px; font-weight: 800; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.s-teampick img, .s-teampick .flag-emoji { height: 40px; width: auto; max-width: 64px; border-radius: 5px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); font-size: 38px; line-height: 40px; box-shadow: none; }
.s-teampick img { box-shadow: 0 0 0 1px rgba(0,0,0,.12); }

@media (prefers-reduced-motion: reduce) {
  .cel-jump, .cel-spin, .cel-backflip, .cel-airplane, .cel-dance, .cel-slide { animation-duration: 3s; }
}
