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

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: #fff;
  overflow-x: hidden;
  background: #060d24; /* fallback blu scuro */
}

/* ==== LIVELLI PARALLAX ==== */
.parallax-layer {
  position: fixed;
  inset: -10% 0;
  z-index: -1;
  pointer-events: none;
  will-change: transform;
}

/* Livello 1: gradiente blu (lento) */
#layer-bg {
  background:
    radial-gradient(circle at 20% 25%, rgba(56, 130, 246, .30), transparent 45%),
    radial-gradient(circle at 80% 75%, rgba(139, 92, 246, .25), transparent 45%),
    linear-gradient(165deg, #060d24 0%, #0c1e4e 40%, #123a7a 75%, #0a1636 100%);
}

/* Livello 2: orbs luminosi fluttuanti (velocità media) */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .5;
}
.orb1 { width: 350px; height: 350px; top: 10%; left: 8%;  background: #3b82f6; }
.orb2 { width: 280px; height: 280px; top: 45%; right: 5%; background: #7ae7c7; }
.orb3 { width: 320px; height: 320px; top: 80%; left: 25%; background: #8b5cf6; }
.orb4 { width: 250px; height: 250px; top: 130%; right: 20%; background: #60a5fa; }

/* Livello 3: Gardevoir gigante in filigrana (veloce = effetto profondità) */
#layer-poke {
  background: url('https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/official-artwork/282.png')
              no-repeat center 20% / 75vmin;
  opacity: .13;
}

/* ==== HERO ==== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}
.hero-img {
  width: min(320px, 70vw);
  filter: drop-shadow(0 0 40px rgba(96, 165, 250, .7));
  animation: float 4s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-18px); }
}
.hero h1 {
  font-size: clamp(3rem, 10vw, 5.5rem);
  letter-spacing: .1em;
  text-shadow: 0 4px 30px rgba(0,0,0,.6);
}
.subtitle { font-size: 1.3rem; opacity: .8; margin: .5rem 0 1rem; }
.scroll-hint { margin-top: 3rem; opacity: .6; animation: float 2s ease-in-out infinite; }

/* ==== PANNELLI GLASS ==== */
main { max-width: 900px; margin: 0 auto; padding: 0 1rem; }
.glass {
  background: rgba(30, 64, 175, 0.14);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(147, 197, 253, 0.22);
  border-radius: 24px;
  padding: 2.5rem;
  margin: 3rem 0;
  box-shadow: 0 8px 40px rgba(0, 0, 30, 0.45);
}
.glass h2 { margin-bottom: 1.5rem; font-size: 1.8rem; }

/* ==== POKEDEX GRID ==== */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.data-card {
  background: rgba(147, 197, 253, .08);
  border-radius: 14px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.data-card .label { font-size: .8rem; text-transform: uppercase; opacity: .6; }
.data-card .value { font-size: 1.1rem; font-weight: 600; }
.pokedex-entry { margin-top: 1.5rem; font-style: italic; line-height: 1.6; opacity: .9; }

/* ==== STATISTICHE ==== */
.stats { display: flex; flex-direction: column; gap: .8rem; }
.stat { display: grid; grid-template-columns: 90px 1fr 40px; align-items: center; gap: 1rem; }
.bar { height: 12px; background: rgba(147,197,253,.15); border-radius: 6px; overflow: hidden; }
.fill {
  height: 100%;
  width: calc(var(--w) / 160 * 100%);
  background: linear-gradient(90deg, #60a5fa, #7ae7c7);
  border-radius: 6px;
  animation: grow 1.2s ease-out;
}
@keyframes grow { from { width: 0; } }
.stat.total { border-top: 1px solid rgba(147,197,253,.3); padding-top: .8rem; font-weight: bold; }

/* ==== BADGE TIPI ==== */
.type {
  display: inline-block;
  padding: .35rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .9rem;
  margin: .2rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.3);
}
.psychic  { background: #f85888; }
.fairy    { background: #ee99ac; color: #4a1e2e; }
.ghost    { background: #705898; }
.steel    { background: #b8b8d0; color: #333; }
.poison   { background: #a040a0; }
.fighting { background: #c03028; }
.dragon   { background: #7038f8; }
.dark     { background: #4d4457; }

.type-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; }
.type-grid h3 { font-size: 1rem; margin-bottom: .6rem; opacity: .8; }

/* ==== RECENSIONI ==== */
.rating-summary { font-size: 1.3rem; margin-bottom: 1rem; }
#avg-rating { font-size: 2rem; font-weight: bold; color: #ffd76e; }
.star-input { font-size: 2.5rem; cursor: pointer; user-select: none; margin-bottom: 1rem; }
.star-input span { color: rgba(255,255,255,.25); transition: color .15s, transform .15s; display: inline-block; }
.star-input span.active { color: #ffd76e; }
.star-input span:hover { transform: scale(1.2); }
#review-name, #review-text {
  width: 100%;
  background: rgba(147,197,253,.1);
  border: 1px solid rgba(147,197,253,.25);
  border-radius: 12px;
  color: #fff;
  padding: .8rem 1rem;
  margin-bottom: .8rem;
  font-family: inherit;
  font-size: 1rem;
}
#review-text { min-height: 90px; resize: vertical; }
#review-name::placeholder, #review-text::placeholder { color: rgba(255,255,255,.5); }

/* Honeypot: invisibile per gli umani */
#hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
}

#submit-review {
  background: linear-gradient(90deg, #60a5fa, #7ae7c7);
  border: none;
  border-radius: 999px;
  padding: .8rem 2.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: #060d24;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
#submit-review:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(96,165,250,.5); }
#submit-review:disabled { opacity: .5; cursor: not-allowed; }

#review-msg { margin-top: .8rem; font-size: .95rem; min-height: 1.2em; }
#review-msg.ok    { color: #7ae7c7; }
#review-msg.error { color: #f87171; }

#reviews-list { margin-top: 2rem; display: flex; flex-direction: column; gap: 1rem; }
.review-item {
  background: rgba(147,197,253,.08);
  border-radius: 14px;
  padding: 1rem 1.2rem;
}
.review-item .stars { color: #ffd76e; }
.review-item .name { font-weight: 600; margin-left: .5rem; }
.review-item .date { font-size: .8rem; opacity: .5; float: right; }
.review-item p { margin-top: .4rem; line-height: 1.5; }

/* ==== FOOTER ==== */
.footer { text-align: center; margin-bottom: 2rem; }
.footer p { margin: .3rem 0; }
.credits { font-size: .8rem; opacity: .5; }
