:root {
  --bg: #0a1628;
  --panel: #132337;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --barca: #a50044;
  --barca-2: #004d98;
  --madrid: #ffffff;
  --madrid-2: #febe10;
  --grass: #1a6b3c;
  --grass-2: #218a4d;
  --frame: #e2e8f0;
  --ink: #0f172a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background:
    radial-gradient(ellipse at 30% 0%, rgba(165, 0, 68, 0.22), transparent 45%),
    radial-gradient(ellipse at 70% 10%, rgba(254, 190, 16, 0.14), transparent 40%),
    linear-gradient(180deg, #0a1628, #111827 70%);
}

.hidden {
  display: none !important;
}

.header {
  text-align: center;
  padding: 1.5rem 1rem 0.5rem;
}

.header h1 {
  margin: 0.35rem 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--text);
  text-shadow: none;
}

.header p {
  margin: 0;
  color: var(--muted);
  text-shadow: none;
}

.back {
  color: var(--muted);
  text-decoration: none;
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  text-shadow: none;
}

.back:hover {
  color: var(--text);
  text-decoration: none;
}

.panel {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2.5rem;
  text-align: center;
}

.panel h2 {
  margin: 0 0 1.25rem;
  text-shadow: none;
}

.team-pick {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.team {
  width: 160px;
  padding: 1.4rem 1rem;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-family: Georgia, serif;
  font-size: 1.15rem;
  display: grid;
  gap: 0.6rem;
  justify-items: center;
  transition: transform 0.15s ease;
  box-shadow: none;
}

.team:hover {
  transform: translateY(-3px);
}

.team--barca {
  background: linear-gradient(145deg, var(--barca), var(--barca-2));
  color: #fff;
}

.team--madrid {
  background: linear-gradient(145deg, #f8fafc, var(--madrid-2));
  color: #111;
}

.team__crest {
  font-family: system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: 0.06em;
}

.hint {
  margin-top: 1.5rem;
  color: var(--muted);
  font-family: system-ui, sans-serif;
  font-size: 0.95rem;
  line-height: 1.45;
  text-shadow: none;
}

.scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  align-items: start;
  background: var(--panel);
  border: none;
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1.25rem;
  backdrop-filter: none;
}

.score__name {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.score__num {
  font-size: 2.4rem;
  font-weight: bold;
  font-family: system-ui, sans-serif;
  color: var(--text);
}

.score--barca .score__num {
  color: #f472b6;
}

.score--madrid .score__num {
  color: var(--madrid-2);
}

.score-mid {
  padding-top: 1.6rem;
  font-family: system-ui, sans-serif;
  color: var(--muted);
  font-size: 0.85rem;
}

.dots {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
  margin-top: 0.55rem;
  min-height: 12px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #334155;
  box-shadow: none;
}

.dot--goal {
  background: #22c55e;
}

.dot--miss {
  background: #ef4444;
}

.role {
  font-family: system-ui, sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--text);
  text-shadow: none;
}

.scene {
  position: relative;
  margin: 0 auto 1.25rem;
  max-width: 420px;
}

.goal {
  position: relative;
  margin: 0 auto;
  max-width: 360px;
}

.goal__frame {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 4px solid var(--frame);
  border-bottom: none;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.55), rgba(15, 23, 42, 0.35)),
    repeating-linear-gradient(
      0deg,
      transparent 0 10px,
      rgba(255, 255, 255, 0.08) 10px 11px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0 10px,
      rgba(255, 255, 255, 0.08) 10px 11px
    );
  height: 130px;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2);
}

.zone {
  border-right: 1px dashed rgba(255, 255, 255, 0.45);
}

.zone:last-child {
  border-right: none;
}

.goal__pitch {
  height: 48px;
  background: #1e293b;
  border-radius: 0 0 8px 8px;
}

.keeper {
  position: absolute;
  left: 50%;
  bottom: 42px;
  width: 100px;
  height: auto;
  z-index: 3;
  transform: translateX(-50%);
  transform-origin: center bottom;
  transition: left 0.55s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.keeper.dive-left {
  left: 18%;
  transform: translateX(-50%) rotate(-55deg);
}

.keeper.dive-center {
  left: 50%;
  transform: translateX(-50%) translateY(8px) scale(1.05);
}

.keeper.dive-right {
  left: 82%;
  transform: translateX(-50%) rotate(55deg);
}

.ball {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 30px;
  height: 30px;
  z-index: 4;
  border-radius: 50%;
  transform: translate(-50%, 120px);
  transition:
    left 0.7s cubic-bezier(0.15, 0.85, 0.25, 1),
    transform 0.7s cubic-bezier(0.15, 0.85, 0.25, 1);
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.7), transparent 42%),
    radial-gradient(circle at 50% 55%, var(--ball-fill, #f8fafc), var(--ball-dark, #64748b));
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.4),
    0 0 12px var(--ball-glow, #e2e8f0);
  border: 1.5px solid rgba(15, 23, 42, 0.35);
}

.ball::before {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  border: 1.5px solid rgba(15, 23, 42, 0.35);
  opacity: 0.55;
}

.ball[data-skin="gold"] {
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.35),
    0 0 16px #fbbf24,
    0 0 28px rgba(251, 191, 36, 0.55);
}

.ball[data-skin="neon"] {
  box-shadow:
    0 0 10px #22d3ee,
    0 0 22px #a855f7,
    inset 0 0 8px rgba(255, 255, 255, 0.35);
  border-color: rgba(34, 211, 238, 0.6);
}

.ball[data-skin="dragon"] {
  box-shadow:
    0 0 12px #f97316,
    0 0 26px #ef4444,
    inset 0 -4px 10px rgba(127, 29, 29, 0.45);
}

.ball[data-skin="void"] {
  box-shadow:
    0 0 14px #a78bfa,
    0 0 28px #6366f1,
    inset 0 0 12px #020617;
  border-color: #c084fc;
}

.ball.shot-left {
  left: 16%;
  transform: translate(-50%, -100px) scale(0.85) rotate(-220deg);
}

.ball.shot-center {
  left: 50%;
  transform: translate(-50%, -110px) scale(0.85) rotate(180deg);
}

.ball.shot-right {
  left: 84%;
  transform: translate(-50%, -100px) scale(0.85) rotate(220deg);
}

.ball.saved {
  box-shadow:
    0 0 14px #fff,
    0 0 8px var(--ball-glow, #e2e8f0);
}

.ball.goal-in {
  box-shadow:
    0 0 16px #fde047,
    0 0 10px var(--ball-glow, #fbbf24);
}

.equipped-now {
  margin: 0 0 0.85rem;
  font-family: system-ui, sans-serif;
  color: #cbd5e1;
  font-size: 0.92rem;
}

.equipped-now strong {
  color: #fbbf24;
}

.shooter-wrap {
  margin-top: 0.35rem;
  display: flex;
  justify-content: center;
  min-height: 150px;
}

.shooter {
  width: 110px;
  height: auto;
  transform-origin: 60% 85%;
  transition: transform 0.2s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.shooter.kicking {
  animation: kick 0.45s ease-out;
}

@keyframes kick {
  0% { transform: rotate(0deg); }
  40% { transform: rotate(-18deg) translateX(-6px); }
  70% { transform: rotate(12deg) translateX(8px); }
  100% { transform: rotate(0deg); }
}

.flash {
  position: absolute;
  left: 0;
  right: 0;
  top: 35%;
  margin: 0;
  font-family: system-ui, sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
  transition: opacity 0.2s ease;
  z-index: 5;
}

.flash.show-goal {
  opacity: 1;
  color: #fde047;
}

.flash.show-save {
  opacity: 1;
  color: #ffffff;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.actions button {
  font-family: system-ui, sans-serif;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.1rem;
  cursor: pointer;
  background: #e2e8f0;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: none;
}

.actions button:hover:not(:disabled) {
  filter: brightness(1.05);
}

.actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.log {
  min-height: 1.4rem;
  color: var(--muted);
  font-family: system-ui, sans-serif;
  margin: 0 0 1.25rem;
  text-shadow: none;
}

.reset {
  font-family: system-ui, sans-serif;
  border: none;
  border-radius: 8px;
  padding: 0.7rem 1.2rem;
  cursor: pointer;
  background: #64748b;
  color: #fff;
  box-shadow: none;
}

.reset:hover {
  filter: brightness(1.08);
}

.final-score {
  font-size: 2.5rem;
  font-family: system-ui, sans-serif;
  font-weight: 700;
  margin: 0.5rem 0 1rem;
  color: var(--text);
  text-shadow: none;
}
