:root {
  color-scheme: dark;
  --panel: rgba(35, 21, 32, 0.88);
  --text: #fff7ed;
  --muted: #fbcfe8;
  --pink: #fb7185;
  --mint: #5eead4;
  --gold: #fbbf24;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 12%, rgba(251, 113, 133, 0.3), transparent 24rem),
    radial-gradient(circle at 82% 24%, rgba(94, 234, 212, 0.24), transparent 20rem),
    linear-gradient(135deg, #281525, #43203a 45%, #1c2732);
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.game-panel {
  width: min(100%, 820px);
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(255, 247, 237, 0.16);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(16px);
}

.game-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.game-link {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 247, 237, 0.16);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 247, 237, 0.08);
}

.game-link:hover,
.game-link:focus-visible {
  color: #22111e;
  background: linear-gradient(135deg, #fda4af, #5eead4);
}

.game-link strong,
.game-link small {
  display: block;
}

.game-link strong {
  font-size: 1.05rem;
  line-height: 1.1;
}

.game-link small {
  margin-top: 2px;
  color: currentColor;
  opacity: 0.78;
  font-weight: 800;
}

.game-link-icon {
  width: 46px;
  height: 38px;
  position: relative;
  flex: 0 0 auto;
}

.snake-icon::before {
  content: "";
  position: absolute;
  inset: 7px 5px;
  border: 7px solid #22c55e;
  border-right-color: transparent;
  border-radius: 999px;
  transform: rotate(-16deg);
}

.snake-icon::after {
  content: "";
  width: 16px;
  height: 16px;
  position: absolute;
  right: 0;
  top: 2px;
  border-radius: 50%;
  background: #a3e635;
  box-shadow: 5px 5px 0 -3px #07111f;
}

.dino-launch-icon::before {
  content: "";
  width: 31px;
  height: 20px;
  position: absolute;
  left: 4px;
  bottom: 5px;
  border-radius: 14px 10px 12px 12px;
  background: #fbbf24;
}

.dino-launch-icon::after {
  content: "";
  width: 17px;
  height: 17px;
  position: absolute;
  right: 2px;
  top: 3px;
  border-radius: 7px;
  background: #f97316;
  box-shadow: -25px 15px 0 -6px #fbbf24;
}

.cat-launch-icon::before {
  content: "";
  width: 30px;
  height: 24px;
  position: absolute;
  left: 7px;
  bottom: 4px;
  border-radius: 50%;
  background: #f9a8d4;
}

.cat-launch-icon::after {
  content: "";
  width: 31px;
  height: 24px;
  position: absolute;
  left: 10px;
  top: 2px;
  background: #f9a8d4;
  clip-path: polygon(0 100%, 8% 20%, 28% 68%, 72% 68%, 92% 20%, 100% 100%);
}

.topbar,
.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

h1,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 7vw, 4.25rem);
  line-height: 0.95;
}

.topbar p,
.controls p {
  color: var(--muted);
}

.scoreboard {
  min-width: 110px;
  display: grid;
  justify-items: end;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 247, 237, 0.18);
  border-radius: 8px;
  background: rgba(255, 247, 237, 0.08);
}

.scoreboard span {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.scoreboard strong {
  font-size: 2rem;
  line-height: 1;
}

canvas {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  border: 2px solid rgba(255, 247, 237, 0.18);
  border-radius: 8px;
  background: #2d2430;
  touch-action: none;
  user-select: none;
  box-shadow: inset 0 0 50px rgba(10, 8, 14, 0.38);
}

button {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  color: #22111e;
  font-weight: 900;
  cursor: pointer;
  background: linear-gradient(135deg, #fda4af, #fbbf24);
}

button:focus-visible {
  outline: 3px solid rgba(94, 234, 212, 0.85);
  outline-offset: 3px;
}

@media (max-width: 680px) {
  .shell {
    padding: 10px;
  }

  .game-panel {
    padding: 12px;
  }

  .topbar,
  .controls {
    align-items: stretch;
    flex-direction: column;
  }

  .scoreboard {
    justify-items: start;
  }

  .game-nav {
    grid-template-columns: 1fr;
  }
}
