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

:root {
  /* Nuova Palette "Rosso Frontale" */
  --bg-app: #F5F5F7;
  /* Grigio molto chiaro, quasi bianco */
  --bg-dark: #1A1A1A;
  /* Nero/Grigio scuro per contrasti */

  --primary-red: #FA2A31;
  --grad-red: linear-gradient(135deg, #FA2A31 0%, #D81A20 100%);
  --grad-dark: linear-gradient(135deg, #2A2A2A 0%, #151515 100%);

  --txt-white: #FFFFFF;
  --txt-dark: #111111;

  --glass-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  --btn-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);

  --r: 20px;
  /* Bordi leggermente meno stondati del precedente, più compatti */
  --r-small: 14px;

  --txt-brand-pink: #D0206E;
  /* Dark Pink for Header Title */

  --glass-border: 1px solid rgba(255, 255, 255, 0.3);
  --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);

  --r: 28px;
  --safe-bottom: env(safe-area-inset-bottom, 20px);
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-app);
  color: var(--txt-dark);
  padding-bottom: calc(var(--safe-bottom) + 20px);
  /* Spazio extra in basso per la nav */
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

.wrap {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 24px 15px !important;
  /* Fixed: 15px side padding */
  box-sizing: border-box;
  overflow-x: hidden;
}

/* --- Header Section --- */
.hero {
  margin-bottom: 16px;
}

.header-block {
  background: transparent;
  padding: 0;
  box-shadow: none;
  margin-bottom: 20px;
}

.brand-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 20px;
  font-weight: 800;
  color: var(--txt-dark);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Nuova campanella notifiche */
.notification-icon-only {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--txt-white);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--txt-dark);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s;
  text-decoration: none;
}

.notification-icon-only:active {
  transform: scale(0.92);
}

.bell-icon-svg {
  width: 20px;
  height: 20px;
}

/* --- Layout Grid base --- */
.wip-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.span-2 {
  width: 100%;
}

.grid-2-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.col-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mt-small {
  margin-top: -6px;
}

/* Modificatori comuni alle card di questo layout */
.wip-card-container {
  display: flex;
  flex-direction: column;
}

.section-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--txt-dark);
  text-transform: uppercase;
  margin-bottom: 6px;
  margin-left: 2px;
}

/* Full Width Items (Banners) */
.banner-card {
  grid-column: span 2;
}


/* --- General Card Styling --- */
.wip-card {
  position: relative;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  /* Spinge il bottone in basso */
  padding: 18px !important;

  border-radius: var(--r);
  border: none;
  box-shadow: var(--glass-shadow);
  text-decoration: none;
  overflow: hidden !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease;

  width: 100% !important;
  height: 100% !important;
  min-height: 140px !important;
  /* Altezza base minore del precedente per le col col-2 */
  box-sizing: border-box !important;
}

.wip-card:active {
  transform: scale(0.98);
}

.wip-card:hover {
  filter: brightness(1.1);
}

.wip-card.glow-red {
  background: linear-gradient(135deg, #0d0d12 40%, #001f3f 100%) !important;
  border-color: rgba(255, 51, 51, 0.4) !important;
}

.wip-card.glow-red:hover {
  box-shadow: 0 8px 30px rgba(255, 51, 51, 0.35) !important;
  border-color: rgba(255, 51, 51, 0.8) !important;
  filter: brightness(1.15);
}

.notification-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #FF3B30;
  color: #FFFFFF;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 0 15px rgba(255, 59, 48, 0.6);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  z-index: 5;
  animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
  }
}

.card-title {
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.2px;
  margin-bottom: 6px;
  line-height: 1.2;
}

.card-title-small {
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 12px;
  color: var(--txt-dark);
}

.card-subtitle {
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
  opacity: 0.9;
  margin-bottom: 14px;
}

.card-date-small {
  font-size: 10px;
  color: #888;
  margin-bottom: 6px;
  font-weight: 600;
}

/* Card Specifiche */

/* 1. Patreon (Rossa Ampia) */
.card-patreon {
  background: var(--grad-red);
  color: var(--txt-white);
  min-height: 160px !important;
  flex-direction: row !important;
  justify-content: flex-start !important;
}

.card-content-left {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  z-index: 2;
  width: 65%;
}

.card-patreon .card-title {
  font-size: 18px;
  color: #FFF;
}

.card-patreon .card-subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
}

/* Box per AVIF Patreon e Ruota */
.card-image-right {
  position: absolute;
  right: -10px;
  bottom: -10px;
  z-index: 1;
}

.card-image-right img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 2. Comunicazioni (Bianca) */
.card-comunicazioni {
  background: var(--txt-white) !important;
  color: var(--txt-dark) !important;
}

.card-comunicazioni .card-title {
  color: var(--txt-dark) !important;
  font-size: 15px;
}

.card-comunicazioni .card-subtitle {
  color: #555 !important;
  font-size: 12px;
}

/* 3. Confessionale (Scura) */
.card-confessionale {
  background: var(--grad-dark) !important;
  color: var(--txt-white) !important;
}

.card-confessionale .card-title {
  color: var(--txt-white);
  font-size: 15px;
}

.icon-bottom-right {
  position: absolute;
  bottom: 18px;
  right: 18px;
  font-size: 20px;
  opacity: 0.4;
}

/* 4. Ruota (Rossa Larga) */
.card-ruota {
  background: var(--primary-red) !important;
  color: var(--txt-white);
  min-height: 120px !important;
  flex-direction: row !important;
}

.card-ruota .card-title {
  font-size: 18px;
  color: #FFF;
  margin-top: 10px;
  margin-bottom: 14px;
}

/* 5. Gadget (Rossa Larga) */
.card-gadget {
  background: var(--grad-red) !important;
  color: var(--txt-white);
  min-height: 120px !important;
  flex-direction: row !important;
  overflow: hidden;
}

.card-gadget .card-title {
  font-size: 16px;
  color: #FFF;
}

/* Placeholders per immagini mancanti */
.img-placeholder-1 {
  width: 120px;
  height: 160px;
  background: rgba(0, 0, 0, 0.1);
  /* Grigio sovrapposto a rosso */
  border-radius: 10px;
  right: 10px !important;
  bottom: 0px !important;
}

.img-placeholder-2 {
  width: 140px;
  height: 120px;
  background: rgba(0, 0, 0, 0.15);
  /* Mezza ruota a dx */
  border-top-left-radius: 60px;
  right: 0px !important;
  bottom: 0px !important;
}

.img-placeholder-3,
.img-placeholder-4 {
  width: 60px;
  height: 60px;
  background: #E5E5E5;
  border-radius: 12px;
  margin: 0 auto 10px;
}

.img-placeholder-5,
.img-placeholder-6 {
  width: 70px;
  height: 70px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  right: 12px !important;
  bottom: 12px !important;
}

.img-placeholder-7 {
  /* Placeholder for Trailer thumbnail styling already mostly handled inline and generic */
  background: #2a2a2a;
}

.img-placeholder-8 {
  width: 120px;
  height: 120px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  right: 10px !important;
  bottom: -20px !important;
}


/* Modificatori Pulsanti */
.btn-cta {
  font-weight: 800;
  text-transform: uppercase;
  font-size: 12px;
  height: 36px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 99px;
  box-shadow: var(--btn-shadow);
  align-self: flex-start;
  width: fit-content !important;
  white-space: nowrap;
}

.btn-white-red {
  background: var(--txt-white);
  color: var(--primary-red);
}

.btn-dark {
  background: var(--txt-dark);
  color: var(--txt-white);
}

.btn-white {
  background: var(--txt-white);
  color: var(--txt-dark);
}

/* Sezione Giochi (Bianca con Mini-Griglia interna) */
.card-giochi-wrapper {
  background: var(--txt-white) !important;
  padding: 16px !important;
  min-height: 200px !important;
}

.mini-games-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  flex-grow: 1;
  margin-top: 4px;
}

.mini-game-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  background: #FAFAFA;
  border-radius: var(--r-small);
  padding: 10px 4px 14px;
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.mini-game-icon {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-game-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mini-game-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--txt-dark);
  line-height: 1.2;
  margin-bottom: 24px;
  height: 26px;
}

.btn-mini {
  background: var(--txt-white);
  color: var(--txt-dark);
  border: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 10px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 12px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.btn-mini.btn-dark {
  background: var(--txt-dark);
  color: var(--txt-white);
  border: none;
}

.btn-mini.btn-red {
  background: var(--primary-red);
  color: #FFF;
  border: none;
}


/* --- External Banners (Patreon/Telegram) --- */
.banner-card {
  background: rgba(255, 255, 255, 0.6) !important;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  min-height: auto;
  padding: 24px;
  /* Fixed: 24px */
  aspect-ratio: auto !important;
  /* Reset aspect ratio for banners */
}

.banner-card img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.banner-content .card-title {
  color: #333;
  /* Dark Gray */
  margin-bottom: 4px;
  font-size: 20px;
  /* Fixed: 20px */
  font-weight: 600;
  /* Fixed: Semi-Bold */
  text-transform: none;
  /* Reset uppercase */
}

.banner-content .card-subtitle {
  color: #666;
  /* Medium Gray */
  font-size: 15px;
  /* Fixed: 15px */
  font-weight: 400;
  opacity: 1;
}


/* Special styles for Telegram Banner */
.banner-telegram {
  padding: 16px !important;
  min-height: 80px !important;
  background: linear-gradient(135deg, #24A1DE 0%, #0088CC 100%) !important;
  justify-content: center !important;
}

.banner-telegram .banner-content {
  text-align: center !important;
  width: 100%;
}

.banner-telegram .banner-content .card-title,
.banner-telegram .banner-content .card-subtitle {
  color: #FFFFFF !important;
}

/* Animations */
@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

/* --- Age Verification Modal --- */
.age-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 10, 20, 0.95);
  /* Deep dark background */
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: none;
  /* Hidden by default, toggled by JS */
  align-items: flex-start;
  justify-content: center;
  padding: 60px 20px 20px;
  transition: opacity 0.3s ease;
}

.age-modal-content {
  background: linear-gradient(135deg, #1c1c2e 0%, #2a1b3d 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  /* Allow scrolling within modal if needed */
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.age-modal-header {
  padding: 32px 24px 8px;
  text-align: center;
  flex-shrink: 0;
}

.age-warning-icon {
  font-family: 'Inter', sans-serif;
  font-size: 80px;
  font-weight: 900;
  line-height: 1;
  color: #FF007F;
  /* Brand Pink */
  text-shadow: 0 0 20px rgba(255, 0, 127, 0.3);
  margin-bottom: 8px;
}

.age-title {
  color: #FF5E62;
  /* Reddish/Orange alert color */
  font-size: 24px;
  font-weight: 800;
  text-transform: uppercase;
  margin: 0 0 16px;
  text-align: center;
  letter-spacing: 1px;
}

.age-modal-body {
  padding: 0 32px;
  overflow-y: auto;
  color: #FFF;
  /* Fixed: All white */
  font-size: 15px;
  line-height: 1.6;
  text-align: center;
  flex-grow: 1;
}

/* Custom Scrollbar for Modal Body */
.age-modal-body::-webkit-scrollbar {
  width: 6px;
}

.age-modal-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.age-modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 99px;
}


.age-text-block {
  margin-bottom: 12px;
  padding: 0 24px;
  /* Fixed: Side padding for spacing */
}

.age-text-block p {
  color: #FFFFFF !important;
  /* Fixed: Force white text */
  margin-top: 0;
  margin-bottom: 8px;
}

.age-text-block strong {
  color: #FFF;
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
}

.age-text-block ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.age-text-block li {
  margin-bottom: 4px;
  color: #FFF;
  /* Fixed: All white */
}

.age-modal-footer {
  padding: 24px 32px 32px;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-shrink: 0;
}

.btn-primary,
.btn-secondary {
  flex: 1;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  /* Slightly squared for serious tone */
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-primary {
  background: transparent;
  /* matches image outline style */
  color: #FFF;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.btn-primary:active {
  background: rgba(255, 255, 255, 0.1);
}

.btn-secondary {
  background: transparent;
  color: #FFF;
  /* Fixed: White text for exit button */
  border: 1px solid rgba(255, 255, 255, 0.2);
}


/* --- Footer --- */
.app-footer {
  margin-top: 40px;
  padding: 20px 0;
  text-align: center;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.footer-disclaimer {
  font-size: 12px;
  color: #888;
  line-height: 1.5;
  margin-bottom: 16px;
  padding: 0 10px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.footer-links a {
  font-size: 12px;
  color: #555;
  text-decoration: none;
  transition: color 0.2s;
}


/* --- Security Protection --- */
/* Disabilita la selezione del testo */
* {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Impedisce il trascinamento delle immagini (drag and drop) */
img {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
  pointer-events: none;
  /* Impedisce il click destro/lungo sulle immagini */
}

/* --- Social Split Row --- */
.social-split-row {
  grid-column: span 2;
  display: flex;
  gap: 12px;
  width: 100%;
}

.social-card {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  border-radius: 20px;
  text-decoration: none;
  background: #FFFFFF;
  color: #111;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.03);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.social-card:active {
  transform: scale(0.96);
}

.social-card svg {
  width: 24px;
  height: 24px;
  z-index: 2;
  flex-shrink: 0;
}

.social-title {
  font-weight: 800;
  font-size: 13px;
  z-index: 2;
  color: #111;
  line-height: 1.2;
  text-transform: uppercase;
  text-align: left;
}

/* Colori Pulsanti Social */
.telegram-white svg {
  fill: #0088cc;
}

.whatsapp-white svg {
  fill: #25D366;
}

/* --- Trailer Nuova Card --- */
.card-trailer {
  background: var(--txt-white) !important;
  padding: 16px !important;
  min-height: 200px !important;
}

.trailer-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: #111 url('/assets/img/trailer_placeholder.jpg') center/cover no-repeat;
  /* Usare un segnaposto o img se lo hai, altrimenti grigio */
  border-radius: var(--r-small);
  margin-bottom: 12px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-icon-center {
  width: 48px;
  height: 48px;
  background: var(--primary-red);
  color: #FFF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  padding-left: 4px;
  /* centra il triangolo play */
  box-shadow: 0 4px 10px rgba(250, 42, 49, 0.4);
}

.trailer-title-strong {
  font-size: 13px;
  font-weight: 800;
  color: var(--txt-dark);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.trailer-meta {
  font-size: 11px;
  color: #888;
}

.trailer-meta strong {
  margin-left: 8px;
  color: var(--txt-dark);
}

/* Ciak Texture Header */
.ciak-texture {
  width: 100%;
  height: 12px;
  background: repeating-linear-gradient(45deg,
      #000,
      #000 10px,
      #fff 10px,
      #fff 20px);
  opacity: 0.8;
}

/* Trailer Content Layout */
.trailer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
}

.trailer-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trailer-tag {
  font-size: 12px;
  font-weight: 700;
  color: #FFF;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.trailer-title {
  font-size: 18px;
  font-weight: 700;
  color: #FFF;
}

.trailer-desc {
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
}

/* Play Icon (CSS Pure) */
/* Bottom Navigation (Floating Pill in fondo) */
.bottom-nav {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 40px);
  /* 20px padding su ogni lato */
  max-width: 560px;
  /* Non più larga del contenitore .wrap */
  height: 64px;
  background: var(--txt-dark);
  border-radius: 32px;
  /* Super stondato */
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 10px;
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #777;
  /* Grigio spento inattivo */
  font-size: 10px;
  font-weight: 600;
  gap: 4px;
  flex: 1;
  transition: color 0.2s;
}

.nav-item svg {
  width: 24px;
  height: 24px;
  opacity: 0.8;
}

.nav-item.active {
  color: var(--txt-white);
}

.nav-item.active svg {
  color: var(--primary-red);
  opacity: 1;
}

.nav-item.disabled {
  pointer-events: none;
  opacity: 0.4;
}

.nav-item:active {
  transform: scale(0.92);
}

/* Modifica stile social (in fondo pagina) per essere più "flat" come richiesto */
.social-card {
  box-shadow: none;
  border: none;
  border-radius: var(--r-small);
}

.social-subtitle {
  display: none;
  /* Rimuoviamo il sottotitolo come da mockup layout nuovo */
}

.social-content {
  padding: 6px 0;
}