/* 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); }

/* League + World Cup hubs (/soccer/league/, /soccer/worldcup/) */
.cup-main { max-width: 1180px; margin: 14px auto 0; padding: 0 16px calc(36px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 18px; align-items: start; }
.cup-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
@media (max-width: 860px) { .cup-main { grid-template-columns: minmax(0, 1fr); } }
.cup-next { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.cup-next h2 { margin: 0; font-size: 28px; }
.cup-dots { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.cup-dots i { width: 34px; height: 34px; border-radius: 50%; background: #dde3ea; box-shadow: inset 0 0 0 2px #0002; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 20px; }
.cup-dots i.w { background: #2fb344; } .cup-dots i.d { background: #ffd23f; } .cup-dots i.l { background: #e53935; }
.cup-dots i.now { box-shadow: 0 0 0 4px #1e66f5; }
.cup-vsrow { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; }
.cup-side { text-decoration: none; color: inherit; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 900; font-size: 21px; border: 0; background: none; padding: 0; line-height: 1.15; }
.cup-side span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cup-badge { width: 116px; height: 116px; border-radius: 50%; background: #eef3ee; display: flex; align-items: center; justify-content: center; overflow: hidden; box-shadow: inset 0 0 0 5px var(--kit, #0001); font-size: 72px; line-height: 1; }
.cup-badge svg { width: 100%; height: 100%; display: block; }
.cup-badge img { height: 66px; width: auto; max-width: 92px; border-radius: 8px; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.cup-vsword { font-size: 40px; font-weight: 900; color: var(--red); flex: none; }
.cup-play { font-size: 38px; min-height: 104px; width: min(420px, 100%); border-radius: 30px; animation: cup-pulse 1.1s ease-in-out infinite alternate; }
@keyframes cup-pulse { from { transform: scale(1); } to { transform: scale(1.05); } }
.cup-h { margin: 0 0 6px; font-size: 24px; display: flex; align-items: center; gap: 10px; }
.cup-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; font-size: 22px; font-weight: 800; }
.cup-table th { font-size: 22px; padding: 0 4px; font-weight: 900; }
.cup-table td { background: #f1f5f1; padding: 6px 6px; text-align: center; font-variant-numeric: tabular-nums; }
.cup-table td:first-child { border-radius: 16px 0 0 16px; font-size: 26px; width: 44px; }
.cup-table td:last-child { border-radius: 0 16px 16px 0; }
.cup-table td.nm { text-align: left; max-width: 0; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cup-table td.pts { font-size: 28px; font-weight: 900; background: #fff3c4; }
.cup-table tr.me td { background: #ffe08a; } .cup-table tr.me td.pts { background: #ffd23f; }
.cup-table tr.out td { opacity: .55; }
.cup-mini { display: inline-flex; width: 44px; height: 44px; border-radius: 50%; background: #fff; align-items: center; justify-content: center; overflow: hidden; vertical-align: middle; font-size: 30px; line-height: 1; flex: none; }
.cup-mini svg { width: 100%; height: 100%; display: block; }
.cup-mini img { height: 26px; width: auto; max-width: 40px; border-radius: 4px; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.cup-res { display: flex; flex-direction: column; gap: 8px; }
.cup-res div { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto minmax(0, 1fr) 44px; align-items: center; gap: 8px; background: #f1f5f1; border-radius: 16px; padding: 6px 8px; font-weight: 800; font-size: 18px; }
.cup-res div.me { background: #ffe08a; }
.cup-res .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cup-res .n.r { text-align: right; }
.cup-res b { font-size: 26px; font-variant-numeric: tabular-nums; padding: 0 6px; white-space: nowrap; }
.cup-res small { display: block; font-size: 13px; text-align: center; }
.cup-over { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.45); animation: s-fade .3s; overflow: auto; }
.cup-over .s-panel { width: min(560px, 100%); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.cup-over .big { font-size: 96px; line-height: 1; }
.cup-over h2 { margin: 0; font-size: clamp(30px, 6vw, 44px); }
.cup-over .final { display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 52px; font-weight: 900; font-variant-numeric: tabular-nums; }
.cup-over .final .cup-mini { width: 76px; height: 76px; font-size: 52px; background: #eef3ee; }
.cup-over .final .cup-mini img { height: 46px; max-width: 70px; }
.cup-over .av { width: 170px; } .cup-over .av svg { width: 100%; height: auto; display: block; overflow: visible; }
.cup-over .row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.cup-over .s-btn { font-size: 28px; min-height: 80px; min-width: 200px; }
.cup-trophy { font-size: 130px; line-height: 1; animation: cup-pulse .8s ease-in-out infinite alternate; }
.cup-road { display: flex; align-items: center; justify-content: center; gap: 0; width: 100%; }
.cup-stop { flex: none; width: 74px; height: 74px; border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 900; font-size: 22px; box-shadow: var(--shadow); position: relative; }
.cup-stop small { font-size: 12px; font-weight: 800; }
.cup-stop.done { background: #c9f2d0; } .cup-stop.now { background: var(--sun); outline: 5px solid #fff; transform: scale(1.12); }
.cup-stop.lost { background: #ffc9c2; }
.cup-stop .cup-mini { position: absolute; top: -22px; width: 36px; height: 36px; box-shadow: var(--shadow); }
.cup-stop .cup-mini img { height: 22px; }
.cup-link { flex: 1 1 0; max-width: 60px; height: 8px; background: #ffffffaa; }
.cup-link.done { background: #c9f2d0; }
.cup-bracket { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.cup-round { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cup-rm { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 8px; }
.cup-round h4 { margin: 0; text-align: center; font-size: 18px; }
.cup-bm { background: #f1f5f1; border-radius: 12px; padding: 4px 6px; display: flex; flex-direction: column; gap: 3px; }
.cup-bm.me { background: #ffe08a; }
.cup-bm p { margin: 0; display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 18px; min-height: 30px; }
.cup-bm p.lose { opacity: .45; }
.cup-bm p b { margin-left: auto; font-variant-numeric: tabular-nums; }
.cup-bm .cup-mini { width: 30px; height: 30px; font-size: 22px; background: none; }
.cup-bm .cup-mini img { height: 20px; max-width: 30px; }
.cup-bm .tbd { color: #8a968c; }
@media (max-width: 480px) {
  .cup-stop { width: 58px; height: 58px; font-size: 18px; } .cup-stop small { font-size: 10px; }
  .cup-link { min-width: 6px; }
  .cup-bm { padding: 3px 4px; } .cup-bm p { font-size: 15px; gap: 3px; } .cup-bm p b small { font-size: 10px; }
  .cup-badge { width: 96px; height: 96px; font-size: 60px; }
}
.cup-bm p b { white-space: nowrap; }
.cup-start { max-width: 960px; margin: 18px auto; padding: 0 16px 40px; display: flex; flex-direction: column; gap: 18px; align-items: center; text-align: center; }
.cup-start h2 { margin: 0; font-size: clamp(26px, 4vw, 36px); color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.35); }

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