:root {
  --bg-1: #120224;
  --bg-2: #26104b;
  --panel: #1b1340;
  --panel-2: #2b1f63;
  --ink: #fff7c2;
  --accent: #ff4fa3;
  --accent-dark: #cb2478;
  --cyan: #3df6ff;
  --yellow: #ffd84d;
  --line: #7b6cff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  font-family: "VT323", monospace;
  color: var(--ink);
  background:
    radial-gradient(circle at top, rgba(61, 246, 255, 0.22), transparent 25%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2));
}

.page-shell {
  width: 100vw;
  height: 100vh;
  padding: 0;
}

.game-card {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(123, 108, 255, 0.16), rgba(61, 246, 255, 0.06)),
    var(--panel);
  border: 6px solid var(--line);
  box-shadow:
    inset 0 0 0 6px rgba(255, 216, 77, 0.2),
    inset 0 0 40px rgba(61, 246, 255, 0.08);
  padding: 16px;
}

.hud {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.hud-item {
  min-width: 120px;
  padding: 10px 14px;
  background: #140d32;
  border: 4px solid var(--cyan);
  box-shadow: inset 0 0 0 3px rgba(255, 216, 77, 0.35);
}

.label {
  display: block;
  font-family: "Press Start 2P", monospace;
  font-size: 0.6rem;
  line-height: 1.6;
  color: var(--cyan);
  text-transform: uppercase;
}

.hud-item strong {
  display: block;
  margin-top: 6px;
  font-size: 2.2rem;
  color: var(--yellow);
  text-shadow: 2px 2px 0 #000;
}

.primary-button {
  border: 4px solid var(--yellow);
  background: var(--accent);
  color: #fff;
  padding: 14px 20px;
  font: inherit;
  font-family: "Press Start 2P", monospace;
  font-size: 0.8rem;
  line-height: 1.4;
  cursor: pointer;
  box-shadow: 6px 6px 0 #000;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--accent-dark);
}

.game-area {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border: 4px solid var(--cyan);
  background:
    linear-gradient(180deg, #4ec7ff 0%, #86e7ff 34%, #1dc7b1 56%, #7de5cb 72%, #f7d66b 72%, #e6b14f 100%);
  touch-action: manipulation;
  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.16),
    inset 0 -20px 60px rgba(255, 100, 180, 0.18);
}

.game-area::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.22) 0 2%, transparent 2.4%),
    radial-gradient(circle at 21% 28%, rgba(255, 255, 255, 0.18) 0 1.4%, transparent 1.8%),
    radial-gradient(circle at 77% 20%, rgba(255, 255, 255, 0.2) 0 1.8%, transparent 2.2%),
    radial-gradient(circle at 83% 12%, rgba(255, 255, 255, 0.14) 0 1.1%, transparent 1.5%),
    linear-gradient(transparent 0 96%, rgba(255, 255, 255, 0.08) 96% 100%),
    linear-gradient(90deg, transparent 0 96%, rgba(255, 255, 255, 0.08) 96% 100%);
  background-size: auto, auto, auto, auto, 100% 24px, 24px 100%;
  pointer-events: none;
}

.game-area::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 28%;
  background:
    radial-gradient(circle at 12% 100%, #ff6db0 0 9%, transparent 10%),
    radial-gradient(circle at 20% 100%, #ff6db0 0 6%, transparent 7%),
    radial-gradient(circle at 78% 100%, #8bff8a 0 8%, transparent 9%),
    radial-gradient(circle at 87% 100%, #8bff8a 0 5%, transparent 6%),
    linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.08) 100%);
  opacity: 0.7;
  pointer-events: none;
}

.cat,
.fish,
.message {
  position: absolute;
  user-select: none;
}

.cat {
  bottom: -70px;
  width: clamp(250px, 38vw, 390px);
  aspect-ratio: 1.45 / 1;
  overflow: visible;
  filter: drop-shadow(0 6px 10px rgba(45, 31, 26, 0.25));
}

.cat.is-catching {
  animation: cat-chomp 180ms steps(2, end) 2;
}

.cat-sprite,
.cat-fallback {
  width: 100%;
  height: 100%;
  display: block;
}

.cat-sprite {
  object-fit: contain;
  transform: scale(1.18);
  transform-origin: bottom center;
}

.cat-fallback {
  display: none;
  border: 2px dashed rgba(45, 31, 26, 0.22);
  border-radius: 22px;
  background: rgba(255, 250, 244, 0.82);
  color: rgba(45, 31, 26, 0.72);
  font-size: 1rem;
  font-weight: 600;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
}

.cat.is-fallback .cat-sprite {
  display: none;
}

.cat.is-fallback .cat-fallback {
  display: flex;
}

.fish {
  top: 0;
  font-size: 2rem;
  will-change: transform;
}

.fish.catch-pop {
  animation: fish-pop 180ms ease-out forwards;
}

.message {
  display: none;
}

@keyframes cat-chomp {
  0% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(8px) scale(1.06);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes fish-pop {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-18px) scale(1.6);
  }
}

@media (max-width: 640px) {
  .game-card {
    padding: 10px;
  }

  .hud {
    gap: 10px;
  }

  .hud-item {
    min-width: 92px;
  }

  .label {
    font-size: 0.5rem;
  }

  .primary-button {
    font-size: 0.65rem;
    padding: 12px 14px;
  }
}
