:root {
  --blue: #0757d9;
  --blue-2: #0b72ff;
  --blue-dark: #031b43;
  --navy: #061329;
  --surface: #0b1930;
  --surface-2: #10213b;
  --line: rgba(255, 255, 255, 0.10);
  --text: #ffffff;
  --muted: #9eb0c9;
  --gold: #f4b83f;
  --gold-dark: #a96a00;
  --success: #65ff4f;
  --max: 560px;
}

* {
  box-sizing: border-box;
}

html {
  background: #020916;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background:
    radial-gradient(circle at 50% -10%, rgba(7, 87, 217, 0.42), transparent 35%),
    linear-gradient(180deg, #061329 0%, #020916 100%);
}

button,
.ball {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 18px 16px 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 26px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  display: block;
}

.brand strong {
  display: block;
  font-size: 14px;
  letter-spacing: 1px;
}

.brand span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.balance {
  text-align: right;
}

.balance span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.balance strong {
  display: block;
  margin-top: 3px;
  font-size: 16px;
}

.hero {
  margin-bottom: 16px;
}

.eyebrow {
  color: #72a8ff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

.hero h1 {
  margin: 7px 0 5px;
  font-size: clamp(30px, 8vw, 42px);
  line-height: 1;
  letter-spacing: -1.5px;
}

.hero p {
  margin: 0;
  max-width: 440px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.game-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(14, 37, 70, 0.98), rgba(5, 17, 35, 0.98));
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.38);
}

.score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 13px;
}

.label {
  display: block;
  color: #7890b0;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.3px;
}

.score-row strong {
  display: block;
  margin-top: 3px;
  font-size: 13px;
}

.instruction-pill {
  border: 1px solid rgba(114, 168, 255, 0.28);
  border-radius: 999px;
  padding: 7px 10px;
  color: #bcd5ff;
  background: rgba(7, 87, 217, 0.14);
  font-size: 10px;
  font-weight: 700;
}

.pitch {
  position: relative;
  height: 530px;
  overflow: hidden;
  background:
    linear-gradient(rgba(7, 87, 217, 0.18), rgba(2, 18, 41, 0.06)),
    repeating-linear-gradient(
      90deg,
      rgba(255,255,255,0.025) 0,
      rgba(255,255,255,0.025) 1px,
      transparent 1px,
      transparent 70px
    ),
    linear-gradient(180deg, #0a438e 0%, #062e67 48%, #0757d9 100%);
}

.pitch::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 210px;
  background:
    linear-gradient(rgba(7, 87, 217, 0), rgba(3, 18, 42, 0.42)),
    repeating-linear-gradient(
      0deg,
      rgba(255,255,255,0.045) 0,
      rgba(255,255,255,0.045) 2px,
      transparent 2px,
      transparent 16px
    );
  pointer-events: none;
}

.goal-frame {
  position: absolute;
  top: 36px;
  left: 50%;
  width: calc(100% - 46px);
  max-width: 470px;
  height: 295px;
  transform: translateX(-50%);
  border: 4px solid rgba(255,255,255,0.88);
  border-bottom-width: 6px;
  border-radius: 8px 8px 0 0;
  box-shadow:
    0 0 0 2px rgba(0,0,0,0.20),
    0 18px 35px rgba(0,0,0,0.18);
}

.goal-net {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background:
    repeating-linear-gradient(90deg, transparent 0 20px, #fff 20px 21px),
    repeating-linear-gradient(0deg, transparent 0 20px, #fff 20px 21px);
}

.tiles {
  position: absolute;
  inset: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 9px;
}

.tile {
  position: relative;
  overflow: hidden;
  min-width: 0;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 12px;
  background: linear-gradient(145deg, #0872d2, #0645a0);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.20),
    0 5px 12px rgba(0,0,0,0.22);
  perspective: 700px;
}

.tile-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 650ms cubic-bezier(.2,.8,.2,1);
}

.tile.revealed .tile-inner {
  transform: rotateY(180deg);
}

.tile-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
}

.tile-front {
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.16), transparent 24%),
    linear-gradient(145deg, #0a79dc, #063e91);
}

.tile-front::after {
  content: "";
  width: 34px;
  height: 34px;
  border: 2px solid rgba(255,255,255,0.34);
  border-radius: 50%;
  box-shadow: inset 0 0 0 7px rgba(255,255,255,0.04);
}

.tile-back {
  transform: rotateY(180deg);
  background:
    radial-gradient(circle at 25% 20%, rgba(255,255,255,0.35), transparent 22%),
    linear-gradient(145deg, #ffd76a, #d78b09);
  color: #2c1b00;
  text-align: center;
}

.tile-back small {
  display: block;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.tile-back strong {
  display: block;
  margin-top: 3px;
  font-size: clamp(15px, 4.2vw, 22px);
}

.tile.hit {
  animation: hitGlow 700ms ease both;
}

@keyframes hitGlow {
  50% { transform: scale(1.035); }
}

.ball-zone {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 30px;
  height: 155px;
  touch-action: none;
}

.ball {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 74px;
  height: 74px;
  transform: translateX(-50%);
  border-radius: 50%;
  cursor: grab;
  user-select: none;
  background:
    radial-gradient(circle at 35% 28%, #fff 0 9%, transparent 10%),
    radial-gradient(circle at 50% 50%, #ffffff 0 42%, #d8e0e8 43% 58%, #aeb8c3 59% 100%);
  box-shadow:
    0 12px 24px rgba(0,0,0,0.38),
    inset -7px -8px 12px rgba(0,0,0,0.13);
  transition: transform 160ms ease, filter 160ms ease;
  z-index: 5;
}

.ball::before {
  content: "";
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  background: #172334;
  clip-path: polygon(50% 0%, 100% 35%, 80% 100%, 20% 100%, 0% 35%);
}

.ball::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 11px;
  left: 15px;
  border-radius: 50%;
  background: rgba(255,255,255,0.65);
  filter: blur(2px);
}

.ball.dragging {
  cursor: grabbing;
  transform: translateX(-50%) scale(1.08);
  filter: drop-shadow(0 0 12px rgba(114,168,255,0.7));
}

.aim-line {
  position: absolute;
  left: 50%;
  bottom: 45px;
  width: 3px;
  height: 0;
  border-radius: 999px;
  transform-origin: bottom center;
  background: linear-gradient(#ffffff, rgba(255,255,255,0));
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

.aim-line.visible {
  opacity: 0.55;
}

.result-panel {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 13px 14px 14px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 15px;
  background: rgba(255,255,255,0.035);
}

.result-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  flex: 0 0 36px;
  border-radius: 11px;
  background: rgba(7,87,217,0.25);
}

.result-panel strong {
  font-size: 12px;
}

.result-panel p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.play-again {
  display: block;
  width: calc(100% - 28px);
  margin: 0 14px 14px;
  border: 0;
  border-radius: 13px;
  padding: 13px 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(7,87,217,0.25);
}

.play-again:active {
  transform: translateY(1px);
}

.how-it-works {
  padding: 32px 3px 10px;
}

.section-heading h2 {
  margin: 7px 0 17px;
  font-size: 22px;
  letter-spacing: -0.6px;
}

.steps {
  display: grid;
  gap: 9px;
}

.steps article {
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  background: rgba(255,255,255,0.025);
}

.steps article > span {
  color: #70a6ff;
  font-size: 10px;
  font-weight: 900;
}

.steps h3 {
  margin: 5px 0 3px;
  font-size: 13px;
}

.steps p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.07);
  color: #647894;
  font-size: 9px;
  text-align: center;
}

footer img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

/* Small phones */
@media (max-width: 370px) {
  .app-shell { padding-inline: 11px; }
  .pitch { height: 500px; }
  .goal-frame { width: calc(100% - 34px); }
  .tiles { inset: 12px; gap: 6px; }
}
