@import url('https://fonts.googleapis.com/css2?family=Bungee&family=Sora:wght@400;600;700&display=swap');

:root {
  --bg-1: #08131f;
  --bg-2: #0b2a2a;
  --bg-3: #123c2b;
  --accent: #f2c94c;
  --accent-2: #ff6b35;
  --ice: #e9f5ff;
  --pitch: #1f7a4e;
  --pitch-dark: #145236;
  --wall: #1f57d6;
  --wall-glow: rgba(67, 132, 255, 0.55);
  --card: rgba(10, 18, 32, 0.85);
  --line: rgba(255, 255, 255, 0.08);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Sora", sans-serif;
  color: #f5fbff;
  background: radial-gradient(circle at top, rgba(242, 201, 76, 0.15), transparent 45%),
    radial-gradient(circle at 20% 20%, rgba(58, 117, 255, 0.18), transparent 50%),
    linear-gradient(130deg, var(--bg-1), var(--bg-2) 50%, var(--bg-3));
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: -20% -10% auto;
  height: 60vh;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.12), transparent 60%),
    radial-gradient(circle at 70% 40%, rgba(255, 107, 53, 0.12), transparent 55%);
  z-index: -2;
  animation: stadiumGlow 8s ease-in-out infinite alternate;
}

body::after {
  inset: auto -10% -20% -10%;
  height: 55vh;
  background: radial-gradient(circle at 60% 70%, rgba(31, 122, 78, 0.45), transparent 60%),
    radial-gradient(circle at 30% 80%, rgba(255, 255, 255, 0.08), transparent 60%);
  animation-delay: 1.5s;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  margin-bottom: 36px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(31, 87, 214, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-size: 12px;
  color: inherit;
  text-decoration: none;
}

.brand h1 {
  font-family: "Bungee", "Sora", sans-serif;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  margin: 16px 0 12px;
  text-shadow: 0 0 20px rgba(67, 132, 255, 0.5);
}

.lead {
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 36ch;
  color: rgba(233, 245, 255, 0.85);
}

.hero-card {
  padding: 22px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  animation: floatIn 0.8s ease both;
}

.hero-card p {
  margin: 0 0 20px;
  line-height: 1.6;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(233, 245, 255, 0.6);
}

.stat-value {
  display: block;
  margin-top: 6px;
  font-weight: 600;
  color: var(--accent);
}

.cta-center {
  display: grid;
  place-items: center;
  text-align: center;
  margin: 10px 0 36px;
}

.ball-cta {
  width: clamp(140px, 20vw, 210px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 2px solid rgba(120, 196, 255, 0.55);
  background: radial-gradient(circle at 30% 28%, #ffffff 0%, #cfe9ff 28%, #4a88ff 58%, #0b1f44 100%);
  color: #e9f5ff;
  font-family: "Bungee", "Sora", sans-serif;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  display: grid;
  place-items: center;
  box-shadow: 0 0 25px rgba(88, 170, 255, 0.55), 0 0 65px rgba(43, 125, 255, 0.35);
  transition: transform 0.2s ease, box-shadow 0.25s ease;
  animation: glowPulse 2.8s ease-in-out infinite;
}

.ball-cta::before {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 2px solid rgba(95, 175, 255, 0.35);
  box-shadow: 0 0 35px rgba(100, 185, 255, 0.6), 0 0 90px rgba(50, 135, 255, 0.45);
}

.ball-cta::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.9), transparent 45%),
    radial-gradient(circle at 70% 65%, rgba(9, 22, 45, 0.55), transparent 60%);
  opacity: 0.7;
}

.ball-cta:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 0 35px rgba(88, 170, 255, 0.75), 0 0 90px rgba(43, 125, 255, 0.45);
}

.ball-cta:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(233, 245, 255, 0.6), 0 0 45px rgba(88, 170, 255, 0.85);
}

.ball-label {
  position: relative;
  z-index: 1;
  font-size: 0.95rem;
  text-shadow: 0 4px 10px rgba(3, 8, 18, 0.6);
}

.cta-caption {
  margin: 16px 0 0;
  font-size: 0.95rem;
  color: rgba(233, 245, 255, 0.75);
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 32px;
}

.game-panel {
  background: rgba(9, 14, 24, 0.75);
  border-radius: 20px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  animation: floatIn 1s ease both;
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.score-item {
  background: rgba(5, 8, 16, 0.75);
  border-radius: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.score-item .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(233, 245, 255, 0.55);
}

.score-item .value {
  display: block;
  margin-top: 6px;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}

.canvas-wrap {
  position: relative;
  padding: 18px;
  background: radial-gradient(circle at top, rgba(31, 122, 78, 0.35), transparent 60%),
    linear-gradient(180deg, rgba(5, 8, 16, 0.85), rgba(10, 18, 32, 0.85));
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.35);
  min-height: 520px;
  display: grid;
  place-items: center;
}

canvas {
  width: 100%;
  height: auto;
  display: block;
  image-rendering: pixelated;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.canvas-wrap::before {
  content: "Ladowanie murawy...";
  color: rgba(233, 245, 255, 0.6);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.canvas-wrap.ready::before {
  content: "";
}

.canvas-wrap.ready canvas {
  opacity: 1;
}

.screen-message {
  position: absolute;
  top: 16px;
  right: 18px;
  font-family: "Bungee", "Sora", sans-serif;
  font-size: 14px;
  color: rgba(233, 245, 255, 0.85);
  text-transform: uppercase;
  letter-spacing: 1px;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 10px;
  border-radius: 999px;
  animation: pulse 1.6s ease-in-out infinite;
}

.controls {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.control-text {
  font-size: 0.9rem;
  color: rgba(233, 245, 255, 0.75);
}

.touch-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.touch-controls button {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(31, 87, 214, 0.25);
  color: var(--ice);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.touch-controls button:active {
  transform: scale(0.95);
  box-shadow: 0 0 10px rgba(67, 132, 255, 0.5);
}

.info-panel {
  padding: 26px;
  border-radius: 20px;
  background: rgba(12, 20, 35, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow);
  animation: floatIn 1.1s ease both;
}

.info-panel h2 {
  font-family: "Bungee", "Sora", sans-serif;
  margin-top: 0;
}

.info-panel p {
  line-height: 1.6;
  color: rgba(233, 245, 255, 0.75);
}

.feature-grid {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.feature-card {
  background: rgba(8, 12, 22, 0.65);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation: rise 0.8s ease both;
}

.feature-card:nth-child(2) {
  animation-delay: 0.1s;
}

.feature-card:nth-child(3) {
  animation-delay: 0.2s;
}

.feature-card h3 {
  margin: 0 0 8px;
  color: var(--accent-2);
}

.feature-card p {
  margin: 0;
  color: rgba(233, 245, 255, 0.75);
}

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(5, 8, 16, 0.78);
  z-index: 20;
  padding: 24px;
}

.overlay.hidden {
  display: none;
}

.overlay-card {
  width: min(520px, 100%);
  background: rgba(10, 18, 32, 0.95);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 28px;
  box-shadow: var(--shadow);
}

.arcade-intro {
  background: rgba(5, 8, 16, 0.9);
  backdrop-filter: blur(6px);
}

.arcade-intro::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.04),
    rgba(255, 255, 255, 0.04) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.2;
  pointer-events: none;
  animation: scanlines 6s linear infinite;
}

.arcade-card {
  width: min(480px, 92vw);
  text-align: center;
  border: 1px solid rgba(88, 170, 255, 0.35);
  box-shadow: 0 0 30px rgba(88, 170, 255, 0.35), 0 0 90px rgba(14, 42, 120, 0.35);
  animation: introPop 0.8s ease both;
}

.intro-tag {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 11px;
  color: rgba(233, 245, 255, 0.7);
  border: 1px solid rgba(88, 170, 255, 0.35);
}

.intro-sub {
  margin: 12px 0 0;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.85rem;
  color: rgba(233, 245, 255, 0.8);
}

.intro-blink {
  animation: introBlink 1.1s steps(2, end) infinite;
}

.intro-hint {
  margin: 14px 0 0;
  font-size: 0.85rem;
  color: rgba(233, 245, 255, 0.6);
}

.start-btn {
  margin-top: 18px;
  padding: 12px 28px;
  font-size: 0.95rem;
  box-shadow: 0 0 20px rgba(242, 201, 76, 0.45);
}

.join-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.join-form label {
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
  color: rgba(233, 245, 255, 0.75);
}

.join-form input,
.join-form select,
.join-form textarea {
  background: rgba(5, 8, 16, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px;
  color: #f5fbff;
  font-family: "Sora", sans-serif;
}

.join-form textarea {
  resize: vertical;
}

.btn {
  border: none;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #0b1325;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(242, 201, 76, 0.35);
}

.btn.ghost {
  background: transparent;
  color: var(--ice);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.overlay-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.thanks {
  margin-top: 16px;
  color: var(--accent);
  font-weight: 600;
}

.thanks.hidden {
  display: none;
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

@keyframes introBlink {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

@keyframes introPop {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes scanlines {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(6px);
  }
}

@keyframes glowPulse {
  0%,
  100% {
    transform: translateY(0) scale(1);
    filter: saturate(1);
  }
  50% {
    transform: translateY(-3px) scale(1.03);
    filter: saturate(1.25);
  }
}

@keyframes stadiumGlow {
  from {
    opacity: 0.65;
  }
  to {
    opacity: 0.9;
  }
}

@media (max-width: 980px) {
  .hero,
  .main-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    text-align: center;
  }

  .hero-card,
  .game-panel,
  .info-panel {
    animation: none;
  }

  .cta-center {
    margin: 6px 0 28px;
  }

  .ball-cta {
    width: 160px;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .scoreboard {
    grid-template-columns: 1fr;
  }

  .canvas-wrap {
    min-height: 360px;
  }

  .overlay-actions {
    justify-content: center;
  }
}
