/* ============================================================
   FATEFELICI - Stylesheet principale
   Font: Comfortaa (titoli/menù), Quicksand (corpo testo)
   Palette: Blu Notte #050b14 | Celeste #b2ebf2 | Giallo #fff176
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@300;400;600;700&family=Quicksand:wght@400;500;600&display=swap');

/* ─── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-deep:      #050b14;
  --bg-mid:       #0b132b;
  --bg-card:      #0d1b2a;
  --celeste:      #b2ebf2;
  --celeste-glow: rgba(0, 210, 255, 0.5);
  --giallo:       #fff176;
  --giallo-glow:  rgba(255, 241, 118, 0.5);
  --white:        #e0f7fa;
  --border:       rgba(0, 210, 255, 0.18);
  --radius-card:  20px;
  --radius-btn:   30px;
  --transition:   all 0.3s ease;
  --font-magic:   'Comfortaa', sans-serif;
  --font-body:    'Quicksand', sans-serif;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-deep);
  color: var(--celeste);
  font-family: var(--font-body);
  line-height: 1.7;
  overflow-x: hidden;
}

/* ─── Tipografia ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-magic);
  color: var(--white);
  line-height: 1.3;
}

h1 { font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 3vw, 2.2rem); font-weight: 600; margin-bottom: 1rem; }
h3 { font-size: clamp(1.1rem, 2vw, 1.6rem); font-weight: 600; }

p {
  color: var(--celeste);
  line-height: 1.8;
  margin-bottom: 1rem;
}

a {
  color: var(--celeste);
  text-decoration: none;
  transition: var(--transition);
}

a:hover { color: var(--white); }

/* ─── Layout ───────────────────────────────────────────────── */
.container {
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}

.section {
  padding: 5rem 0;
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 2px;
  background: linear-gradient(to right, var(--giallo), var(--celeste));
  margin: 0.8rem auto 0;
  border-radius: 2px;
}

/* ─── INTRO SPLASH ─────────────────────────────────────────── */
#intro-screen {
  position: fixed;
  inset: 0;
  background-color: var(--bg-deep);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  text-align: center;
  padding: 2rem;
}

#intro-screen.fade-out {
  animation: introFadeOut 1s ease-in-out forwards;
}

.intro-squarcio {
  width: 80px;
  height: 120px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fadeIn 1.5s ease-out forwards 0.5s;
}

.intro-fiammella {
  width: 28px;
  height: 44px;
  background: linear-gradient(to bottom, #fff700, #00d2ff);
  border-radius: 0 50% 50% 50%;
  transform: rotate(-45deg);
  box-shadow: 0 0 20px #00d2ff, 0 0 40px #fff700, 0 0 60px rgba(0,210,255,0.3);
  animation: tremolio 0.12s ease-in-out infinite alternate;
}

.intro-testo {
  font-family: var(--font-magic);
  color: var(--white);
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  line-height: 1.9;
  font-weight: 700;
  text-shadow: 0 0 12px var(--celeste-glow);
}

.intro-riga {
  display: block;
  opacity: 0;
}

.intro-riga-1 { animation: appearLine 0.5s ease-out forwards 2s; }
.intro-riga-2 { animation: appearLine 0.5s ease-out forwards 3.5s; }
.intro-riga-3 { animation: appearLine 0.5s ease-out forwards 5s; }

.intro-question {
  margin-top: 1.7rem;
  margin-bottom: 0.9rem;
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  color: var(--celeste);
  opacity: 0;
  animation: appearLine 0.5s ease-out forwards 5.5s;
}

.intro-paths {
  display: grid;
  gap: 0.55rem;
  width: min(94vw, 520px);
  margin: 0 auto;
  opacity: 0;
  animation: appearLine 0.5s ease-out forwards 5.7s;
}

.intro-path {
  display: block;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(178, 235, 242, 0.24);
  background: rgba(13, 27, 42, 0.62);
  color: var(--white);
  font-family: var(--font-magic);
  font-weight: 600;
  font-size: clamp(0.78rem, 2vw, 0.95rem);
  line-height: 1.35;
  transition: var(--transition);
}

.intro-path::before {
  content: '';
  display: inline-block;
  width: 0.56rem;
  height: 0.56rem;
  border-radius: 50%;
  margin-right: 0.55rem;
  box-shadow: 0 0 10px currentColor;
}

.intro-path:hover {
  transform: translateY(-2px);
  border-color: rgba(178, 235, 242, 0.45);
}

.intro-path.p-red::before { color: #ff5b5b; background: #ff5b5b; }
.intro-path.p-orange::before { color: #ff9f43; background: #ff9f43; }
.intro-path.p-yellow::before { color: #ffe66d; background: #ffe66d; }
.intro-path.p-green::before { color: #7bed9f; background: #7bed9f; }
.intro-path.p-blue::before { color: #70a1ff; background: #70a1ff; }
.intro-path.p-violet::before { color: #c8a2ff; background: #c8a2ff; }
.intro-path.p-purple::before { color: #9b59b6; background: #9b59b6; }

#btn-skip-intro {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  font-family: var(--font-magic);
  font-size: 0.8rem;
  color: rgba(178, 235, 242, 0.5);
  border: 1px solid rgba(178, 235, 242, 0.2);
  border-radius: var(--radius-btn);
  padding: 0.4rem 1rem;
  cursor: pointer;
  background: transparent;
  transition: var(--transition);
  z-index: 10000;
}

#btn-skip-intro:hover {
  color: var(--celeste);
  border-color: var(--celeste);
}

/* ─── NAVIGAZIONE ──────────────────────────────────────────── */
#main-nav {
  position: sticky;
  top: 0;
  width: 100%;
  background: rgba(5, 11, 20, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  padding: 0;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.8rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.nav-logo {
  font-family: var(--font-magic);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.nav-logo .fiamma-icon {
  display: inline-block;
  animation: flicker 1.5s ease-in-out infinite alternate;
}

.kingdom-map {
  position: relative;
}

.map-toggle {
  font-family: var(--font-magic);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--celeste);
  padding: 0.42rem 0.9rem;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border);
  background: rgba(0, 210, 255, 0.06);
  cursor: pointer;
  transition: var(--transition);
}

.map-toggle:hover,
.kingdom-map.map-expanded .map-toggle {
  color: #fff;
  background: rgba(0, 210, 255, 0.14);
  text-shadow: 0 0 8px var(--celeste-glow);
}

.map-list {
  position: absolute;
  top: calc(100% + 0.55rem);
  left: 0;
  min-width: 290px;
  list-style: none;
  padding: 0.35rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(5, 11, 20, 0.96);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.35);
  display: none;
}

.kingdom-map.map-expanded .map-list {
  display: block;
}

.map-list a {
  display: block;
  font-family: var(--font-magic);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--celeste);
  padding: 0.46rem 0.65rem;
  border-radius: 10px;
  transition: var(--transition);
}

.map-list a:hover,
.map-list a.active {
  color: #fff;
  background: rgba(0, 210, 255, 0.1);
  text-shadow: 0 0 8px var(--celeste-glow);
}

.map-list a.nav-shop {
  color: var(--giallo);
}

.map-list a.nav-shop:hover,
.map-list a.nav-shop.active {
  background: rgba(255, 241, 118, 0.1);
  text-shadow: 0 0 12px var(--giallo-glow);
  color: #fff;
}

/* Selettore lingua */
.lang-switcher {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

.lang-switcher a {
  font-family: var(--font-magic);
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(178, 235, 242, 0.5);
  padding: 0.2rem 0.45rem;
  border-radius: 50%;
  border: 1px solid transparent;
  transition: var(--transition);
}

.lang-switcher a:hover,
.lang-switcher a.active {
  color: var(--celeste);
  border-color: var(--border);
  background: rgba(0, 210, 255, 0.08);
}

/* Hamburger mobile */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--celeste);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  font-size: 1.2rem;
}

/* ─── CARD GENERICA ────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0, 210, 255, 0.15);
  border-color: rgba(0, 210, 255, 0.35);
}

/* ─── CARTA FATE (mazzo) ───────────────────────────────────── */
.fate-card {
  width: 160px;
  aspect-ratio: 2/3;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.fate-card:hover {
  transform: translateY(-10px) scale(1.03);
  box-shadow: 0 18px 35px rgba(0, 210, 255, 0.25);
}

.fate-card .card-image {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 210, 255, 0.04);
  border-radius: 12px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.fate-card .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.fate-card .card-keyword {
  font-family: var(--font-magic);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--giallo);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.fate-card.coming-soon {
  opacity: 0.55;
  cursor: default;
}

.fate-card.coming-soon::after {
  content: attr(data-coming-soon);
  position: absolute;
  inset: 0;
  background: rgba(5, 11, 20, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-magic);
  font-size: 0.8rem;
  color: var(--celeste);
  font-style: italic;
  border-radius: var(--radius-card);
}

/* ─── GRIGLIA CARTE ────────────────────────────────────────── */
.cards-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  justify-content: center;
}

/* ─── ELEMENTI FATA TABS ───────────────────────────────────── */
.fata-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.fata-tab {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: var(--font-magic);
  font-size: 2rem;
  font-weight: 700;
  transition: var(--transition);
  background: var(--bg-card);
  color: var(--white);
}

.fata-tab[data-el="F"]  { border-color: #ff6b35; }
.fata-tab[data-el="A"]  { border-color: #b2ebf2; }
.fata-tab[data-el="T"]  { border-color: #a5d6a7; }
.fata-tab[data-el="A2"] { border-color: #00d2ff; }

.fata-tab:hover,
.fata-tab.active {
  transform: scale(1.1);
}

.fata-tab[data-el="F"].active  { background: rgba(255,107,53,0.15); box-shadow: 0 0 20px rgba(255,107,53,0.4); }
.fata-tab[data-el="A"].active  { background: rgba(178,235,242,0.12); box-shadow: 0 0 20px rgba(178,235,242,0.35); }
.fata-tab[data-el="T"].active  { background: rgba(165,214,167,0.12); box-shadow: 0 0 20px rgba(165,214,167,0.35); }
.fata-tab[data-el="A2"].active { background: rgba(0,210,255,0.12); box-shadow: 0 0 20px rgba(0,210,255,0.4); }

.fata-tab .tab-name {
  font-size: 0.6rem;
  font-weight: 600;
  margin-top: 0.15rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ─── BOTTONI ──────────────────────────────────────────────── */
.btn {
  display: inline-block;
  font-family: var(--font-magic);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.7rem 1.6rem;
  border-radius: var(--radius-btn);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  text-align: center;
}

.btn-celeste {
  background: transparent;
  color: var(--celeste);
  border: 1.5px solid var(--celeste);
}

.btn-celeste:hover {
  background: rgba(0, 210, 255, 0.1);
  box-shadow: 0 0 18px var(--celeste-glow);
  color: #fff;
  transform: translateY(-2px);
}

.btn-giallo {
  background: transparent;
  color: var(--giallo);
  border: 1.5px solid var(--giallo);
}

.btn-giallo:hover {
  background: rgba(255, 241, 118, 0.1);
  box-shadow: 0 0 18px var(--giallo-glow);
  color: #fff;
  transform: translateY(-2px);
}

.btn-solid {
  background: rgba(0, 210, 255, 0.15);
  color: var(--white);
  border: 1.5px solid var(--celeste);
}

.btn-solid:hover {
  background: rgba(0, 210, 255, 0.25);
  box-shadow: 0 0 22px var(--celeste-glow);
  transform: translateY(-2px);
}

/* ─── FORM ─────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-family: var(--font-magic);
  font-size: 0.88rem;
  color: var(--celeste);
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: rgba(13, 27, 42, 0.8);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.7rem 1rem;
  transition: var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: rgba(0, 210, 255, 0.6);
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.15);
}

.form-group select option {
  background: var(--bg-mid);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-msg {
  display: none;
  padding: 0.8rem 1.2rem;
  border-radius: 12px;
  font-family: var(--font-magic);
  font-size: 0.9rem;
  margin-top: 1rem;
}

.form-msg.success { background: rgba(165,214,167,0.12); border: 1px solid rgba(165,214,167,0.4); color: #a5d6a7; }
.form-msg.error   { background: rgba(255,107,53,0.12);  border: 1px solid rgba(255,107,53,0.4);  color: #ff8a65; }

/* ─── GALLERY (Masonry simulata) ───────────────────────────── */
.gallery-grid {
  columns: 3;
  column-gap: 1rem;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 1rem;
  border-radius: var(--radius-card);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}

.gallery-item img {
  width: 100%;
  display: block;
  border-radius: var(--radius-card);
  transition: var(--transition);
}

.gallery-item:hover img {
  transform: scale(1.03);
  filter: brightness(1.1);
}

/* ─── HERO SECTION ─────────────────────────────────────────── */
.hero {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem;
  position: relative;
}

.hero-subtitle {
  font-family: var(--font-magic);
  color: var(--celeste);
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  margin-top: 1rem;
  opacity: 0.85;
}

/* ─── SHOP PRODOTTI ────────────────────────────────────────── */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.shop-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: var(--transition);
}

.shop-card:hover {
  border-color: rgba(0, 210, 255, 0.35);
  box-shadow: 0 10px 30px rgba(0, 210, 255, 0.1);
  transform: translateY(-4px);
}

.shop-card .shop-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-family: var(--font-magic);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  background: rgba(0,210,255,0.1);
  color: var(--celeste);
  border: 1px solid var(--border);
  width: fit-content;
}

.shop-card.unique .shop-tag {
  background: rgba(255,241,118,0.1);
  color: var(--giallo);
  border-color: rgba(255,241,118,0.3);
}

.shop-card h3 { font-size: 1.1rem; margin-bottom: 0; }
.shop-card p  { font-size: 0.9rem; flex: 1; }
.shop-card .btn { align-self: flex-start; }

/* ─── PATTO FIAMMELLA ──────────────────────────────────────── */
.patto-fiammella {
  background: linear-gradient(135deg, rgba(0,210,255,0.05), rgba(255,241,118,0.05));
  border: 1px solid rgba(255,241,118,0.25);
  border-radius: var(--radius-card);
  padding: 2rem 2.5rem;
  text-align: center;
  margin-top: 3rem;
}

.patto-fiammella h3 {
  color: var(--giallo);
  margin-bottom: 1rem;
  text-shadow: 0 0 10px var(--giallo-glow);
}

/* ─── FOOTER ───────────────────────────────────────────────── */
footer {
  background: var(--bg-deep);
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(178, 235, 242, 0.5);
}

footer a { color: rgba(178, 235, 242, 0.7); }
footer a:hover { color: var(--celeste); }

/* ─── MESSAGGI / ALERT ─────────────────────────────────────── */
.alert {
  padding: 1rem 1.4rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-family: var(--font-magic);
  font-size: 0.9rem;
}
.alert-success { background: rgba(165,214,167,0.12); border: 1px solid rgba(165,214,167,0.4); color: #a5d6a7; }
.alert-error   { background: rgba(255,107,53,0.12);  border: 1px solid rgba(255,107,53,0.4);  color: #ff8a65; }

/* ─── KEYFRAMES ────────────────────────────────────────────── */
@keyframes tremolio {
  0%   { transform: rotate(-45deg) scale(0.94); }
  100% { transform: rotate(-45deg) scale(1.06) skewX(5deg); }
}

@keyframes flicker {
  0%   { opacity: 1; filter: brightness(1); }
  50%  { opacity: 0.85; filter: brightness(1.2); }
  100% { opacity: 1; filter: brightness(0.9); }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

@keyframes appearLine {
  0%   { opacity: 0; transform: scale(0.88) translateY(8px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes introFadeOut {
  0%   { opacity: 1; visibility: visible; }
  100% { opacity: 0; visibility: hidden; pointer-events: none; }
}

/* ─── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-toggle { display: block; }

  .kingdom-map {
    display: none;
    width: 100%;
    order: 4;
  }

  .kingdom-map.open {
    display: block;
  }

  .map-toggle {
    width: 100%;
    text-align: left;
  }

  .map-list {
    position: static;
    margin-top: 0.5rem;
    min-width: 100%;
  }

  .map-list a {
    display: block;
    padding: 0.5rem 1rem;
  }

  .lang-switcher {
    width: 100%;
    justify-content: flex-end;
  }

  .intro-paths {
    width: min(94vw, 460px);
  }

  .gallery-grid { columns: 2; }

  .fata-tab { width: 65px; height: 65px; font-size: 1.6rem; }
}

@media (max-width: 480px) {
  .gallery-grid { columns: 1; }
  .fate-card { width: 140px; }
  .intro-testo { font-size: 1.15rem; }
  .intro-path { font-size: 0.78rem; }
}
