*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0a0a0f;
  font-family: 'Segoe UI', system-ui, sans-serif;
  overflow: hidden;
}

/* Subtle starfield */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 80% 10%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 50% 70%, rgba(255,255,255,0.35) 0%, transparent 100%),
    radial-gradient(1px 1px at 10% 80%, rgba(255,255,255,0.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 60%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 35% 55%, rgba(255,255,255,0.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 65% 90%, rgba(255,255,255,0.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 75% 40%, rgba(255,255,255,0.3) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

h1 {
  color: rgba(255,255,255,0.85);
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  font-weight: 300;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 3rem;
  position: relative;
  z-index: 1;
}

h1 span {
  font-weight: 700;
  background: linear-gradient(135deg, #a78bfa, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  padding: 1rem;
  position: relative;
  z-index: 1;
}

.tile {
  position: relative;
  width: clamp(260px, 38vw, 480px);
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 1.1rem 1.4rem;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.35s ease;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}

.tile:hover {
  transform: translateY(-8px) scale(1.03);
}

.tile__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.5s ease;
}

.tile:hover .tile__img {
  transform: scale(1.06);
}

/* Bottom gradient so text stays readable over the art */
.tile__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.15) 55%, transparent 100%);
  pointer-events: none;
}

/* Dragon tile */
.tile--dragon {
  box-shadow: 0 8px 40px rgba(200,50,0,0.35);
}
.tile--dragon:hover {
  box-shadow: 0 20px 60px rgba(255,80,0,0.5);
}

/* Aliens tile */
.tile--aliens {
  box-shadow: 0 8px 40px rgba(0,180,80,0.3);
}
.tile--aliens:hover {
  box-shadow: 0 20px 60px rgba(0,255,120,0.45);
}

.tile__label {
  position: relative;
  z-index: 1;
  text-align: left;
}

.tile__title {
  display: block;
  font-size: clamp(0.95rem, 2vw, 1.25rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 0.2rem;
}

.tile__subtitle {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.5;
  color: #fff;
}

/* Shimmer border */
.tile::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  transition: border-color 0.35s ease;
  pointer-events: none;
}

.tile--dragon:hover::after { border-color: rgba(255,120,0,0.4); }
.tile--aliens:hover::after  { border-color: rgba(0,255,120,0.35); }

#mute-btn {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 10;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.6);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  backdrop-filter: blur(6px);
}

#mute-btn:hover {
  background: rgba(255,255,255,0.14);
  color: #fff;
  border-color: rgba(255,255,255,0.35);
}

#mute-btn.muted {
  color: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.08);
}

@media (max-width: 640px) {
  .grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .tile {
    width: min(88vw, 420px);
  }
}
