/* ----- 🎮 Game Arcade home page ----- */

:root {
  --sky-top: #1d1240;
  --sky-bottom: #07040f;
  --card: #1a1430;
  --card-edge: #34295c;
  --text: #f4efff;
  --text-soft: #b9addb;
  --gold: #ffd34d;
  --pink: #ff5fa2;
  --cyan: #4de3ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Nunito", sans-serif;
  color: var(--text);
  background: radial-gradient(ellipse at 50% -10%, var(--sky-top) 0%, #0f0a24 50%, var(--sky-bottom) 100%) fixed;
  overflow-x: hidden;
}

/* ----- Twinkly stars ----- */
.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 8% 12%, #fff, transparent),
    radial-gradient(1px 1px at 22% 30%, #fff, transparent),
    radial-gradient(2px 2px at 38% 8%, #fff, transparent),
    radial-gradient(1px 1px at 55% 22%, #fff, transparent),
    radial-gradient(2px 2px at 71% 14%, #fff, transparent),
    radial-gradient(1px 1px at 86% 34%, #fff, transparent),
    radial-gradient(1px 1px at 93% 6%, #fff, transparent),
    radial-gradient(2px 2px at 14% 62%, #fff, transparent),
    radial-gradient(1px 1px at 47% 48%, #fff, transparent),
    radial-gradient(2px 2px at 79% 66%, #fff, transparent),
    radial-gradient(1px 1px at 63% 88%, #fff, transparent),
    radial-gradient(1px 1px at 30% 84%, #fff, transparent);
  animation: twinkle 4s ease-in-out infinite alternate;
}

.stars-2 {
  transform: translate(3%, 5%) scale(1.1);
  animation-delay: -2s;
}

@keyframes twinkle {
  from { opacity: 0.35; }
  to { opacity: 1; }
}

/* ----- The top: logo and tagline ----- */
.top {
  text-align: center;
  padding: 48px 16px 8px;
}

.logo {
  margin: 0;
  display: flex;
  flex-wrap: wrap; /* on a phone, the 🎮 goes on top */
  align-items: center;
  justify-content: center;
  gap: 4px 14px;
  font-family: "Luckiest Guy", "Nunito", sans-serif;
  font-weight: normal;
  font-size: clamp(42px, 9vw, 84px);
  letter-spacing: 3px;
  line-height: 1;
}

.logo-words {
  padding-top: 0.12em; /* Luckiest Guy sits a bit high */
  background: linear-gradient(180deg, #fff6c2 0%, var(--gold) 45%, var(--pink) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 0 #3a1e6b) drop-shadow(0 0 24px rgba(255, 95, 162, 0.45));
}

.logo-icon {
  display: inline-block;
  animation: bob 2.4s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-8px) rotate(6deg); }
}

.tagline {
  margin: 14px 0 0;
  font-size: clamp(16px, 3vw, 20px);
  font-weight: 800;
  color: var(--text-soft);
}

/* ----- The tiles ----- */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  max-width: 1080px;
  margin: 36px auto 0;
  padding: 0 16px;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  background: var(--card);
  border: 3px solid var(--card-edge);
  border-radius: 24px;
  box-shadow: 0 10px 0 #0a0618, 0 18px 40px rgba(0, 0, 0, 0.5);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  animation: pop-in 0.5s ease-out backwards;
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
}

/* Hovering a game lifts it up and makes it glow */
a.tile:hover,
a.tile:focus-visible {
  transform: translateY(-6px) rotate(-0.6deg);
  border-color: var(--tile-color, var(--gold));
  box-shadow: 0 16px 0 #0a0618, 0 0 0 4px rgba(255, 255, 255, 0.06), 0 0 44px var(--tile-glow, rgba(255, 211, 77, 0.35));
  outline: none;
}

/* Clicking pushes it down, like a real button */
a.tile:active {
  transform: translateY(4px);
  box-shadow: 0 4px 0 #0a0618;
}

/* The FIRST game is the big featured one: it's 2 tiles wide */
.tile.featured {
  grid-column: span 2;
}

/* ----- The picture part ----- */
.tile-art {
  position: relative;
  height: 170px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.featured .tile-art {
  height: 230px;
}

.art-glow,
.art-ground {
  position: absolute;
  inset: 0;
}

.art-ground {
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: 100% auto;
}

.tile-icon {
  position: relative;
  font-size: 78px;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.6));
  transition: transform 0.25s ease;
}

.featured .tile-icon {
  font-size: 104px;
}

a.tile:hover .tile-icon {
  transform: scale(1.15) rotate(-6deg);
}

.ribbon {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 6px 12px;
  font-weight: 900;
  font-size: 14px;
  color: #3a1e00;
  background: var(--gold);
  border-radius: 999px;
  box-shadow: 0 3px 0 #b8860b;
  animation: wiggle 2.5s ease-in-out infinite;
}

@keyframes wiggle {
  0%, 80%, 100% { transform: rotate(0); }
  85% { transform: rotate(-8deg); }
  90% { transform: rotate(8deg); }
  95% { transform: rotate(-4deg); }
}

/* ----- The words part ----- */
.tile-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  padding: 18px 20px 20px;
}

.tile-info h2 {
  margin: 0;
  font-family: "Luckiest Guy", "Nunito", sans-serif;
  font-weight: normal;
  font-size: 28px;
  letter-spacing: 1px;
  color: var(--tile-color, var(--text));
}

.featured .tile-info h2 {
  font-size: 36px;
}

.tile-info p {
  margin: 0;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-soft);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tags span {
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
}

.stats {
  font-size: 14px;
  font-weight: 800;
  color: var(--gold);
}

.play {
  align-self: flex-start;
  margin-top: auto;
  padding: 10px 22px;
  font-weight: 900;
  font-size: 18px;
  color: #1a0f00;
  background: var(--tile-color, var(--gold));
  border-radius: 999px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.45);
}

/* ----- Each game's colors and picture ----- */

/* 🏰 Shadow Castle: a purple night with a castle */
.tile-castle {
  --tile-color: #c69bff;
  --tile-glow: rgba(160, 100, 255, 0.55);
}

.tile-castle .art-glow {
  background:
    radial-gradient(circle at 78% 26%, #fff8d6 0 22px, rgba(255, 240, 180, 0.35) 24px, transparent 60px),
    radial-gradient(ellipse at 50% 100%, #ff8a3d 0%, #7a2fb0 35%, transparent 70%),
    linear-gradient(180deg, #120a2c 0%, #3a1a66 100%);
}

.tile-castle .art-ground {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 160'%3E%3Cg fill='%2307050c'%3E%3Crect x='90' y='60' width='70' height='100'/%3E%3Cpath d='M80 62 L125 0 L170 62Z'/%3E%3Crect x='160' y='100' width='140' height='60'/%3E%3Crect x='300' y='40' width='200' height='120'/%3E%3Cpath d='M290 42 L400 -40 L510 42Z'/%3E%3Crect x='500' y='100' width='140' height='60'/%3E%3Crect x='640' y='70' width='70' height='90'/%3E%3Cpath d='M630 72 L675 10 L720 72Z'/%3E%3Crect x='0' y='145' width='800' height='15'/%3E%3C/g%3E%3Cg fill='%23ffc44d'%3E%3Crect x='115' y='85' width='18' height='24' rx='9'/%3E%3Crect x='370' y='70' width='22' height='30' rx='11'/%3E%3Crect x='410' y='70' width='22' height='30' rx='11'/%3E%3Crect x='665' y='95' width='16' height='22' rx='8'/%3E%3C/g%3E%3C/svg%3E");
}

.tile-castle .tile-icon {
  display: none; /* the castle picture is the star here */
}

.tile-castle .tile-art::after {
  content: "🦇";
  position: absolute;
  top: 30%;
  left: -10%;
  font-size: 28px;
  animation: fly-across 7s linear infinite;
}

@keyframes fly-across {
  0% { left: -10%; transform: translateY(0); }
  25% { transform: translateY(-14px); }
  50% { transform: translateY(8px); }
  75% { transform: translateY(-10px); }
  100% { left: 110%; transform: translateY(0); }
}

/* 🐤 Flap Quest: a sunny sky with green pipes */
.tile-flap {
  --tile-color: #7fe07f;
  --tile-glow: rgba(127, 224, 127, 0.45);
}

.tile-flap .art-glow {
  background:
    radial-gradient(ellipse 40px 18px at 22% 28%, #fff 60%, transparent 62%),
    radial-gradient(ellipse 30px 14px at 70% 18%, #fff 60%, transparent 62%),
    linear-gradient(180deg, #4fb3ff 0%, #bfe8ff 75%, #fff1c4 100%);
}

/* Two pipes (one from the top, one from the bottom) and the grass */
.tile-flap .art-ground {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 170'%3E%3Cg fill='%235ed15e' stroke='%231b5e20' stroke-width='3'%3E%3Crect x='250' y='-5' width='50' height='60'/%3E%3Crect x='244' y='45' width='62' height='18'/%3E%3Crect x='250' y='118' width='50' height='40'/%3E%3Crect x='244' y='110' width='62' height='18'/%3E%3C/g%3E%3Crect x='0' y='150' width='400' height='20' fill='%23a8763e'/%3E%3Crect x='0' y='148' width='400' height='8' fill='%234caf50'/%3E%3C/svg%3E");
  background-size: cover;
}

/* The chick flaps up and down (it's flipped so it faces the pipes!) */
.tile-flap .tile-icon {
  margin-right: 30%;
  animation: tile-flap 0.8s ease-in-out infinite;
}

@keyframes tile-flap {
  0%, 100% { transform: scaleX(-1) translateY(6px) rotate(8deg); }
  50% { transform: scaleX(-1) translateY(-10px) rotate(-8deg); }
}

a.tile-flap:hover .tile-icon {
  animation-duration: 0.4s; /* flaps faster when you hover! */
}

/* 🤖 Robo Buddy: a pastel house seen from above */
.tile-robo {
  --tile-color: #7cc4ff;
  --tile-glow: rgba(124, 196, 255, 0.5);
}

.tile-robo .art-glow {
  background:
    linear-gradient(90deg, transparent 49%, #3d4a5c 49%, #3d4a5c 51%, transparent 51%),
    linear-gradient(180deg, transparent 55%, #3d4a5c 55%, #3d4a5c 58%, transparent 58%),
    linear-gradient(90deg, #cfe8ff 50%, #fff0bf 50%) top / 100% 56% no-repeat,
    linear-gradient(90deg, #ffd9e8 50%, #e7dcff 50%) bottom / 100% 44% no-repeat;
  border: 8px solid #3d4a5c;
}

/* The robot drives back and forth across the house */
.tile-robo .tile-icon {
  animation: robo-drive 4s ease-in-out infinite;
}

@keyframes robo-drive {
  0%, 100% { transform: translateX(-60px) rotate(-8deg); }
  50% { transform: translateX(60px) rotate(8deg); }
}

/* 🐸 Jump Kingdom: a sunny sky, platforms, and a hopping frog */
.tile-jump {
  --tile-color: #ffd34d;
  --tile-glow: rgba(255, 211, 77, 0.5);
}

.tile-jump .art-glow {
  background:
    radial-gradient(circle at 85% 22%, #ffe066 0 18px, transparent 20px),
    linear-gradient(180deg, #5ec8ff 0%, #c6f0ff 80%, #fff6c9 100%);
}

/* Grass, a floating platform and a ? block */
.tile-jump .art-ground {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 170'%3E%3Crect x='250' y='70' width='90' height='14' fill='%23c98a4b' stroke='%237a4a1e' stroke-width='2'/%3E%3Crect x='120' y='40' width='30' height='30' fill='%23ffc531' stroke='%23b8730a' stroke-width='3'/%3E%3Ctext x='135' y='63' font-size='22' font-family='sans-serif' font-weight='bold' text-anchor='middle' fill='%23fff'%3E%3F%3C/text%3E%3Crect x='0' y='140' width='400' height='30' fill='%23b8743c'/%3E%3Crect x='0' y='136' width='400' height='10' fill='%234cc94c'/%3E%3C/svg%3E");
  background-size: cover;
}

.tile-jump .tile-icon {
  margin-right: 35%;
  animation: tile-jump 1s ease-in-out infinite;
}

@keyframes tile-jump {
  0%, 100% { transform: translateY(30px) scaleY(0.9); }
  50% { transform: translateY(-25px) scaleY(1.05); }
}

a.tile-jump:hover .tile-icon {
  animation-duration: 0.5s;
}

/* 🕵️ Case of the Day: a dark room, and a magnifying glass searching for clues */
.tile-case {
  --tile-color: #b48cff;
  --tile-glow: rgba(180, 140, 255, 0.5);
}

.tile-case .art-glow {
  background:
    radial-gradient(circle 46px at var(--spot-x, 30%) 45%, rgba(255, 240, 180, 0.55), transparent 70%),
    repeating-linear-gradient(90deg, #3b2a5c 0 28px, #34254f 28px 56px);
  animation: case-search 5s ease-in-out infinite;
}

@property --spot-x {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 30%;
}

@keyframes case-search {
  0%, 100% { --spot-x: 22%; }
  50% { --spot-x: 78%; }
}

/* A wooden floor */
.tile-case .art-ground {
  background: linear-gradient(180deg, transparent 72%, #6b4226 72%, #4e2f1a 100%);
}

/* The detective tiptoes back and forth */
.tile-case .tile-icon {
  animation: case-tiptoe 2.4s ease-in-out infinite;
}

@keyframes case-tiptoe {
  0%, 100% { transform: translateX(-50px) rotate(-6deg); }
  25% { transform: translateX(0) translateY(-8px); }
  50% { transform: translateX(50px) rotate(6deg); }
  75% { transform: translateX(0) translateY(-8px); }
}

a.tile-case:hover .tile-icon {
  animation-duration: 1.2s;
}

/* ❓ Coming soon: dashed and a little see-through */
.tile-soon {
  --tile-color: #8c7fb5;
  border-style: dashed;
  opacity: 0.75;
  box-shadow: none;
}

.tile-soon .art-glow {
  background: repeating-linear-gradient(45deg, #1e1838 0 18px, #241d42 18px 36px);
}

.tile-soon .tile-icon {
  animation: bob 3s ease-in-out infinite;
}

.tile-soon .play {
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

/* ----- The bottom ----- */
.bottom {
  padding: 48px 16px 32px;
  text-align: center;
  font-weight: 800;
  color: #6f6496;
}

/* ----- Small screens (like phones): every tile is 1 wide ----- */
@media (max-width: 600px) {
  .tiles {
    grid-template-columns: 1fr;
  }

  .tile.featured {
    grid-column: auto;
  }

  .featured .tile-art {
    height: 180px;
  }
}

/* People who don't like moving things can turn animations off in their computer settings */
@media (prefers-reduced-motion: reduce) {
  *,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
