/* =========================================================
   ŠKODA GRAND SLAM PING PONG CHAMPIONSHIP — styles
   ========================================================= */

/* ── Custom Properties ──────────────────────────────────── */
:root {
  --green-vivid:   #00D67F;
  --green-dark:    #007A47;
  --orange-rally:  #FF6B2B;
  --yellow-bounce: #FFD93D;
  --navy-arena:    #0D1B2A;
  --white-pure:    #FFFFFF;
  --grey-light:    #F4F6F8;

  --font-display: 'Barlow Condensed', sans-serif;
  --font-body:    'Inter', sans-serif;

  --radius-card:  16px;
  --transition:   0.3s ease;
}

/* ── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--grey-light);
  color: var(--navy-arena);
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }

/* ── Typography ─────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  font-style: italic;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

h1 { font-size: clamp(2.4rem, 7vw, 6rem); line-height: 1; }
h2 { font-size: clamp(2rem, 5vw, 3.5rem); }
h3 { font-size: clamp(1.4rem, 3vw, 2rem); }

/* ── Keyframe Animations ────────────────────────────────── */

/* heroEntrance */
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-60px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ctaPulse */
@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0,214,127,.6); }
  50%       { transform: scale(1.05); box-shadow: 0 0 0 14px rgba(0,214,127,0); }
}

/* cardHover — applied on element, not :hover, so JS can toggle */
@keyframes cardBounceIn {
  0%   { transform: scale(0.96) rotate(0deg); }
  60%  { transform: scale(1.07) rotate(-1.5deg); }
  100% { transform: scale(1.06) rotate(-1deg); }
}

/* statFill — width animated via JS setting --fill */
@keyframes fillBar {
  from { width: 0; }
  to   { width: var(--fill, 0%); }
}

/* tileSlideIn */
@keyframes slideInUp {
  from { opacity: 0; transform: translateY(60px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* carouselScroll */
@keyframes scrollX {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* netWobble */
@keyframes wobble {
  0%, 100% { transform: scaleY(1) rotate(0deg); }
  20%       { transform: scaleY(1.08) rotate(1deg); }
  40%       { transform: scaleY(0.94) rotate(-1deg); }
  60%       { transform: scaleY(1.05) rotate(.5deg); }
  80%       { transform: scaleY(0.97) rotate(-.5deg); }
}

/* scorePop */
@keyframes scalePop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.5); color: var(--yellow-bounce); }
  100% { transform: scale(1); color: var(--orange-rally); }
}

/* trophy jiggle */
@keyframes jiggle {
  0%, 100% { transform: rotate(0deg); }
  25%       { transform: rotate(-12deg); }
  75%       { transform: rotate(12deg); }
}

/* heroBall float/bounce */
@keyframes bounceBall {
  0%, 100% { transform: translateY(0)    scale(1); }
  30%       { transform: translateY(-22px) scale(1.05); }
  50%       { transform: translateY(-36px) scale(1.08); }
  70%       { transform: translateY(-22px) scale(1.05); }
}

/* ── SECTION: #hero ─────────────────────────────────────── */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background: var(--navy-arena);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('assets/hero-arena.png');
  background-size: cover;
  background-position: center;
  filter: brightness(0.55) saturate(1.2);
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 2rem 1.5rem;
  max-width: 960px;
}

.hero-eyebrow {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.25em;
  color: var(--green-vivid);
  text-transform: uppercase;
  margin-bottom: 1rem;
  opacity: 0;
  animation: fadeSlideDown 0.7s 0.2s ease forwards;
}

.hero-title {
  color: var(--white-pure);
  text-shadow: 0 4px 30px rgba(0,0,0,.7);
  opacity: 0;
  animation: fadeSlideDown 0.8s 0.5s ease forwards;
}

.hero-title span {
  color: var(--green-vivid);
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: rgba(255,255,255,.85);
  margin: 1.2rem 0 2.4rem;
  opacity: 0;
  animation: fadeSlideDown 0.8s 0.8s ease forwards;
}

.cta-btn {
  display: inline-block;
  background: var(--green-vivid);
  color: var(--navy-arena);
  font-family: var(--font-display);
  font-weight: 800;
  font-style: italic;
  font-size: 1.4rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 1rem 2.8rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  opacity: 0;
  animation: fadeSlideDown 0.8s 1.1s ease forwards, pulse 2.4s 2s ease infinite;
}

.cta-btn:hover {
  background: var(--yellow-bounce);
  color: var(--navy-arena);
}

/* bouncing hero ball */
#hero-ball {
  position: absolute;
  z-index: 3;
  width: 52px;
  height: 52px;
  pointer-events: none;
  animation: bounceBall 1.8s ease-in-out infinite;
}

/* ── SECTION: #models ───────────────────────────────────── */
#models {
  background: var(--grey-light);
  padding: 6rem 2rem;
  text-align: center;
}

.section-header {
  margin-bottom: 3.5rem;
}

.section-header h2 {
  color: var(--navy-arena);
}

.section-header p {
  font-size: 1.1rem;
  color: #556;
  margin-top: .6rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.player-card {
  background: var(--white-pure);
  border-radius: var(--radius-card);
  padding: 2rem 1.6rem 2.2rem;
  box-shadow: 0 4px 24px rgba(13,27,42,.09);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.player-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--green-vivid), var(--yellow-bounce));
}

.player-card:hover {
  transform: scale(1.06) rotate(-1deg);
  box-shadow: 0 16px 48px rgba(0,214,127,.2);
}

.player-card:hover .trophy-icon {
  animation: jiggle 0.5s ease infinite;
}

.card-img-wrap {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 1.4rem;
  border: 4px solid var(--green-vivid);
  background: var(--grey-light);
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-model-name {
  font-size: 1.8rem;
  color: var(--navy-arena);
  margin-bottom: .2rem;
}

.card-style {
  font-family: var(--font-body);
  font-size: .85rem;
  color: var(--green-dark);
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 1.4rem;
}

.trophy-icon {
  font-size: 1.6rem;
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  display: inline-block;
}

.stats {
  width: 100%;
}

.stat-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: .65rem;
}

.stat-label {
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #556;
  min-width: 68px;
  text-align: left;
}

.stat-track {
  flex: 1;
  height: 10px;
  background: var(--grey-light);
  border-radius: 99px;
  overflow: hidden;
}

.stat-fill {
  height: 100%;
  border-radius: 99px;
  width: 0;
  transition: width 1s cubic-bezier(.22,1,.36,1);
}

.stat-fill.speed   { background: linear-gradient(90deg, var(--green-vivid), #00ffaa); }
.stat-fill.spin    { background: linear-gradient(90deg, var(--yellow-bounce), var(--orange-rally)); }
.stat-fill.stamina { background: linear-gradient(90deg, var(--orange-rally), #ff3e80); }

.stat-val {
  font-size: .78rem;
  font-weight: 700;
  color: var(--navy-arena);
  min-width: 30px;
  text-align: right;
}

/* ── SECTION: #arena ────────────────────────────────────── */
#arena {
  background: var(--navy-arena);
  padding: 5rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

#arena .section-header h2 {
  color: var(--white-pure);
}

#arena .section-header p {
  color: rgba(255,255,255,.65);
}

.arena-stage {
  max-width: 900px;
  margin: 0 auto 2rem;
  position: relative;
}

.arena-table {
  width: 100%;
  height: 200px;
  background: linear-gradient(180deg, #1a4a2e 0%, #0f6b3a 50%, #1a4a2e 100%);
  border-radius: 12px;
  border: 3px solid #2a7a4e;
  position: relative;
  overflow: visible;
  box-shadow: 0 20px 60px rgba(0,0,0,.5), inset 0 0 40px rgba(0,0,0,.3);
}

.table-line {
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  height: 2px;
  background: rgba(255,255,255,.3);
  transform: translateY(-50%);
}

.net {
  position: absolute;
  top: -28px;
  left: 50%;
  margin-left: -4px;
  width: 8px;
  height: 60px;
  background: #eee;
  border-radius: 4px;
  transform-origin: bottom center;
}

.net.wobble {
  animation: wobble 0.4s ease;
}

.net-post {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 8px;
  background: #ccc;
  border-radius: 4px;
}

.arena-car {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100px;
  height: 80px;
  object-fit: contain;
}

.arena-car.left  { left:  8px; }
.arena-car.right { right: 8px; transform: translateY(-50%) scaleX(-1); }

#arena-ball {
  position: absolute;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffaa60, var(--orange-rally));
  box-shadow: 0 4px 16px rgba(255,107,43,.7);
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 10;
}

.score-board {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.score-item {
  text-align: center;
}

.score-label {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
  margin-bottom: .3rem;
}

.score-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 4rem;
  color: var(--orange-rally);
  line-height: 1;
  display: inline-block;
}

.score-num.pop {
  animation: scalePop 0.35s ease forwards;
}

.score-sep {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 3rem;
  color: rgba(255,255,255,.25);
}

.arena-controls {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-control {
  background: transparent;
  border: 2px solid var(--green-vivid);
  color: var(--green-vivid);
  font-family: var(--font-display);
  font-weight: 800;
  font-style: italic;
  font-size: 1.1rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .65rem 1.8rem;
  border-radius: 50px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.btn-control:hover {
  background: var(--green-vivid);
  color: var(--navy-arena);
}

/* ── SECTION: #features ─────────────────────────────────── */
#features {
  background: var(--white-pure);
  padding: 6rem 2rem;
  text-align: center;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.feature-tile {
  background: var(--grey-light);
  border-radius: var(--radius-card);
  padding: 2.2rem 1.8rem;
  opacity: 0;
  transform: translateY(60px);
  transition: transform var(--transition), box-shadow var(--transition);
  border-top: 4px solid var(--green-vivid);
}

.feature-tile.visible {
  animation: slideInUp 0.6s cubic-bezier(.22,1,.36,1) forwards;
}

.feature-tile:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0,214,127,.15);
}

.tile-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.tile-title {
  font-size: 1.3rem;
  color: var(--navy-arena);
  margin-bottom: .5rem;
}

.tile-desc {
  font-size: .95rem;
  color: #556;
  line-height: 1.6;
}

.tile-tag {
  display: inline-block;
  margin-top: 1rem;
  background: var(--green-vivid);
  color: var(--navy-arena);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .25rem .8rem;
  border-radius: 99px;
}

/* ── SECTION: #gallery ──────────────────────────────────── */
#gallery {
  background: var(--navy-arena);
  padding: 5rem 0;
  overflow: hidden;
}

#gallery .section-header {
  padding: 0 2rem;
  margin-bottom: 2.5rem;
}

#gallery .section-header h2 {
  color: var(--white-pure);
}

#gallery .section-header p {
  color: rgba(255,255,255,.6);
}

.carousel-track-outer {
  overflow: hidden;
  width: 100%;
  cursor: grab;
}

.carousel-track-outer:active {
  cursor: grabbing;
}

.carousel-track {
  display: flex;
  gap: 1.5rem;
  width: max-content;
  animation: scrollX 28s linear infinite;
  padding: 0 1rem;
}

.carousel-track:hover,
.carousel-track.paused {
  animation-play-state: paused;
}

.carousel-item {
  flex: 0 0 auto;
  width: 380px;
  height: 230px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,.4);
  transition: transform 0.25s ease;
}

.carousel-item:hover {
  transform: scale(1.03);
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── SECTION: #footer ───────────────────────────────────── */
#footer {
  background: var(--navy-arena);
  padding: 5rem 2rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-top: 1px solid rgba(255,255,255,.07);
}

#confetti-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.footer-content {
  position: relative;
  z-index: 2;
}

.footer-wordmark {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 800;
  font-style: italic;
  color: var(--white-pure);
  letter-spacing: .06em;
}

.footer-wordmark span {
  color: var(--green-vivid);
}

.footer-tagline {
  font-size: 1.15rem;
  color: rgba(255,255,255,.7);
  margin: .8rem 0 2rem;
  font-style: italic;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  margin-bottom: 2.5rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--white-pure);
  transition: background var(--transition), transform var(--transition);
}

.social-link:hover {
  background: var(--green-vivid);
  transform: translateY(-3px);
}

.social-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.footer-copy {
  font-size: .8rem;
  color: rgba(255,255,255,.3);
}

/* ── Responsive tweaks ──────────────────────────────────── */
@media (max-width: 640px) {
  .cards-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .carousel-item { width: 280px; height: 170px; }
  .arena-table  { height: 140px; }
  .arena-car    { width: 70px; height: 55px; }
}
