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

:root {
  --bg: #0d0d1a;
  --card-radius: 20px;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* ── Animated starfield background ── */
.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.stars span {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  animation: twinkle var(--d) ease-in-out infinite var(--delay);
}

@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(0.5); }
  50%       { opacity: var(--op); transform: scale(1); }
}

/* ── Floating gradient blobs ── */
.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
  animation: drift 14s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}
.blob1 { width: 500px; height: 500px; background: #e94560; top: -150px; left: -150px; animation-duration: 16s; }
.blob2 { width: 400px; height: 400px; background: #4361ee; bottom: -120px; right: -120px; animation-duration: 12s; animation-delay: -5s; }
.blob3 { width: 300px; height: 300px; background: #7209b7; top: 50%; left: 50%; transform: translate(-50%,-50%); animation-duration: 18s; animation-delay: -9s; }

@keyframes drift {
  from { transform: translate(0, 0) rotate(0deg); }
  to   { transform: translate(40px, 30px) rotate(15deg); }
}

/* ── Main content ── */
.container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
  padding: 32px 16px;
}

.title {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-align: center;
  background: linear-gradient(135deg, #f72585, #4cc9f0, #7209b7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 20px rgba(247,37,133,0.4));
  animation: titlePulse 4s ease-in-out infinite alternate;
}

@keyframes titlePulse {
  from { filter: drop-shadow(0 0 20px rgba(247,37,133,0.4)); }
  to   { filter: drop-shadow(0 0 35px rgba(76,201,240,0.6)); }
}

.subtitle {
  margin-top: -36px;
  font-size: 1rem;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
}

/* ── Tile grid ── */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
  width: min(1040px, 100%);
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 300px;
  border-radius: var(--card-radius);
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(.34,1.56,.64,1),
              box-shadow 0.35s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad);
  transition: opacity 0.35s;
}

.tile::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: calc(var(--card-radius) + 2px);
  background: var(--grad);
  z-index: -1;
  filter: blur(16px);
  opacity: 0.6;
  transition: opacity 0.35s, filter 0.35s;
}

.tile:hover {
  transform: translateY(-10px) scale(1.03);
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}

.tile:hover::after {
  opacity: 1;
  filter: blur(24px);
}

/* ── Tile: Pokemon ── */
.tile-pokemon {
  --grad: linear-gradient(160deg, #e63946 0%, #f9c74f 100%);
}

/* ── Tile: Narozeniny ── */
.tile-bday {
  --grad: linear-gradient(160deg, #7209b7 0%, #4cc9f0 100%);
}

/* ── Tile: Memo ── */
.tile-memo {
  --grad: linear-gradient(160deg, #43aa8b 0%, #f9c74f 100%);
}

/* ── Tile: Chalupy ── */
.tile-cottage {
  --grad: linear-gradient(160deg, #2f7d5b 0%, #4cc9f0 100%);
}

/* Tile icon */
.tile-icon {
  font-size: 72px;
  position: absolute;
  top: calc(50% - 64px);
  left: 50%;
  transform: translateX(-50%);
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
  transition: transform 0.4s cubic-bezier(.34,1.56,.64,1);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile:hover .tile-icon {
  transform: translateX(-50%) scale(1.15) rotate(-5deg);
}

/* CSS Pokéball inside the tile */
.tile-pokeball {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(to bottom, #e63946 50%, #fff 50%);
  border: 4px solid #111;
  position: relative;
  animation: pb-spin 3s linear infinite;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.45));
}
.tile-pokeball::before {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 4px;
  background: #111;
}
.tile-pokeball::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid #111;
}
@keyframes pb-spin { to { transform: rotate(360deg); } }
.tile:hover .tile-pokeball { animation-duration: 0.5s; }

/* Mini TCG card icon for memo tile */
.tile-tcgcard {
  width: 48px;
  height: 68px;
  border-radius: 5px;
  border: 3px solid #c8a020;
  background: linear-gradient(to bottom, #e63946 28%, #f5f5f5 28%);
  position: relative;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.35), 8px 8px 0 rgba(0,0,0,0.18);
  transition: transform 0.4s cubic-bezier(.34,1.56,.64,1);
}
/* sprite placeholder dots */
.tile-tcgcard::before {
  content: '';
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #f9c74f 30%, transparent 31%),
              radial-gradient(circle at 30% 60%, #e63946 20%, transparent 21%),
              radial-gradient(circle at 70% 65%, #3a86ff 18%, transparent 19%);
  opacity: 0.85;
}
/* gold footer bar */
.tile-tcgcard::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 22%;
  background: #e63946;
  border-radius: 0 0 3px 3px;
  border-top: 2px solid rgba(200,160,32,0.5);
}
.tile:hover .tile-tcgcard {
  transform: rotate(8deg) scale(1.15);
}

/* Tile label panel */
.tile-label {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 18px 20px 22px;
  background: rgba(0,0,0,0.35);
  border-top: 1px solid rgba(255,255,255,0.15);
  text-align: center;
}

.tile-label strong {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.tile-label span {
  display: block;
  font-size: 0.78rem;
  opacity: 0.7;
  margin-top: 3px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Shimmer sweep on hover */
.tile-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255,255,255,0.18) 50%,
    transparent 70%
  );
  transform: translateX(-100%);
  transition: none;
  pointer-events: none;
}

.tile:hover .tile-shimmer {
  animation: shimmerSweep 0.6s ease forwards;
}

@keyframes shimmerSweep {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

/* ── Footer ── */
footer {
  position: relative;
  z-index: 1;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.2);
  letter-spacing: 0.1em;
}
