/* tv/tv.css — Stile cinematico 16:9 per la sezione TV RC88.
 * Sfondo scuro (#0f0f12) con accenti oro/crema, tipografia grande leggibile
 * da distanza TV, animazioni CSS smooth, QR persistente in basso a destra.
 * Funziona sia in 16:9 (1920x1080) sia in forma responsiva dentro iframe.
 */

.tv-root {
  --tv-bg: #0f0f12;
  --tv-bg2: #17171d;
  --tv-gold: #e8c26a;
  --tv-cream: #f6efe2;
  --tv-ink: #1c1a1f;
  --tv-line: rgba(232, 194, 106, 0.28);
  --tv-rad: 22px;
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(120% 90% at 50% 0%, #1c1a24 0%, var(--tv-bg) 55%, #0a0a0e 100%);
  color: var(--tv-cream);
  font-family: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  isolation: isolate;
}

/* ---- Cornice TV (letterbox) ---- */
.tv-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0a0a12 0%, #17141f 100%);
  color: var(--tv-gold);
  font-size: clamp(0.9rem, 2vw, 1.3rem);
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tv-loading::after {
  content: '…';
  animation: tvLoadDots 1s ease-in-out infinite;
}
@keyframes tvLoadDots {
  0% { opacity: 0.2; }
  50% { opacity: 1; }
  100% { opacity: 0.2; }
}
.tv-frame {
  position: relative;
  width: min(1600px, 92vw, calc((100vh - 32px) * 16 / 9));
  margin: 0 auto;
  padding: clamp(10px, 1.5vw, 22px);
  aspect-ratio: 16 / 9;
  max-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 720px) {
  .tv-frame { aspect-ratio: auto; max-height: none; padding: 0; }
}

/* ---- Palette a 16:9 reale ---- */
.tv-stage {
  position: relative;
  width: 100%;
  height: 100%;
  max-height: 78vh;
  border-radius: var(--tv-rad);
  overflow: hidden;
  background: #000;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(232, 194, 106, 0.18);
}
@media (max-width: 720px) {
  .tv-stage { max-height: none; min-height: 62vh; border-radius: 0; }
}

/* ---- Foto di sfondo ---- */
.tv-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
  animation: tvKenburns 18s ease-in-out infinite alternate;
  filter: saturate(1.08) contrast(1.04);
}
@keyframes tvKenburns {
  0%   { transform: scale(1.06) translate(0, 0); }
  100% { transform: scale(1.16) translate(-1.5%, -1%); }
}
.tv-bg-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease;
}

/* ---- Velo cinematografico ---- */
.tv-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(12, 10, 16, 0.82) 0%, rgba(12, 10, 16, 0.28) 48%, rgba(12, 10, 16, 0) 72%),
    linear-gradient(0deg, rgba(8, 8, 12, 0.88) 0%, rgba(8, 8, 12, 0.2) 34%, rgba(8, 8, 12, 0.35) 100%);
  pointer-events: none;
}

/* ---- Contenuto della slide ---- */
.tv-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding: clamp(16px, 2.6vw, 40px);
  padding-bottom: clamp(44px, 4.4vw, 64px); /* libera spazio dal footer di chiusura */
  max-width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.tv-content::-webkit-scrollbar { display: none; }

/* ---- Parte alta: brand + tipo ---- */
.tv-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  animation: tvFadeDown 0.7s ease both;
}
.tv-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--tv-cream);
  font-weight: 900;
  letter-spacing: 0.02em;
  font-size: clamp(0.9rem, 1.6vw, 1.15rem);
}
.tv-brand-mark {
  display: grid;
  width: clamp(30px, 2.4vw, 40px);
  height: clamp(30px, 2.4vw, 40px);
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--tv-gold), #b8943c);
  color: var(--tv-ink);
  font-weight: 950;
}
.tv-type {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--tv-line);
  border-radius: 999px;
  background: rgba(20, 18, 26, 0.5);
  color: var(--tv-gold);
  font-size: clamp(0.7rem, 1.1vw, 0.85rem);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
}
.tv-type::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tv-gold);
  box-shadow: 0 0 10px var(--tv-gold);
}

/* ---- Punto vita: titolo + regione ---- */
.tv-hero {
  margin-top: auto;
  max-width: 46ch;
  animation: tvFadeUp 0.8s 0.1s ease both;
}
.tv-kicker {
  margin-bottom: 8px;
  color: var(--tv-gold);
  font-size: clamp(0.7rem, 1.2vw, 0.9rem);
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.tv-title {
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 3.4vw, 2.9rem);
  line-height: 1;
  font-weight: 950;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.tv-title .accent {
  color: var(--tv-gold);
}
.tv-subtitle {
  max-width: 52ch;
  margin: 0 0 6px;
  color: rgba(246, 239, 226, 0.86);
  font-size: clamp(0.9rem, 1.5vw, 1.08rem);
  line-height: 1.34;
}
.tv-region {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  color: rgba(246, 239, 226, 0.66);
  font-size: clamp(0.74rem, 1.2vw, 0.92rem);
  font-weight: 650;
}
.tv-region::before {
  content: '⌖';
  color: var(--tv-gold);
  font-size: 1.1em;
}
.tv-monument-where {
  margin: 2px 0 8px;
  color: rgba(246, 239, 226, 0.78);
  font-size: clamp(0.78rem, 1.3vw, 0.98rem);
  font-weight: 650;
  letter-spacing: 0.01em;
}
.tv-monument-type {
  color: var(--tv-gold);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---- Card informativa (capsule) ---- */
.tv-capsules {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.tv-capsule {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(232, 194, 106, 0.3);
  background: rgba(20, 18, 26, 0.55);
  color: var(--tv-cream);
  font-size: clamp(0.75rem, 1.2vw, 0.9rem);
  font-weight: 700;
  backdrop-filter: blur(8px);
}

/* ---- Riquadro didascalia / consiglio / curiosità ---- */
.tv-card {
  margin-top: 10px;
  max-width: 56ch;
  padding: clamp(9px, 1.2vw, 14px);
  border-radius: 16px;
  border: 1px solid var(--tv-line);
  background: linear-gradient(180deg, rgba(28, 26, 34, 0.78), rgba(18, 16, 24, 0.86));
  backdrop-filter: blur(10px);
  animation: tvFadeUp 0.7s 0.25s ease both;
}
.tv-card > p {
  margin: 0;
  color: rgba(246, 239, 226, 0.92);
  font-size: clamp(0.9rem, 1.56vw, 1.14rem);
  line-height: 1.34;
}
.tv-card-label {
  display: block;
  margin-bottom: 6px;
  color: var(--tv-gold);
  font-size: clamp(0.64rem, 1vw, 0.76rem);
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.tv-place-context {
  max-width: 58ch;
  margin: 10px 0 12px;
  padding: 9px 12px;
  border-left: 3px solid var(--tv-gold);
  background: rgba(12, 11, 17, 0.48);
  border-radius: 0 12px 12px 0;
}
.tv-place-context strong {
  display: block;
  color: var(--tv-cream);
  font-size: clamp(0.98rem, 1.8vw, 1.24rem);
  line-height: 1.12;
}
.tv-place-context p {
  margin: 5px 0 0;
  color: rgba(246, 239, 226, 0.86);
  font-size: clamp(0.78rem, 1.2vw, 0.94rem);
  line-height: 1.28;
}

/* ---- Indicatore di sottoslide (testo lungo spezzato) ---- */
.tv-page-ind {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--tv-line);
  background: rgba(20, 18, 26, 0.55);
  color: var(--tv-cream);
  font-size: clamp(0.7rem, 1.1vw, 0.82rem);
  font-weight: 800;
  letter-spacing: 0.08em;
}
.tv-page-ind::before {
  content: '·';
  color: var(--tv-gold);
  font-size: 1.15em;
  line-height: 1;
}
.tv-page-label {
  display: block;
  margin: 10px 0 4px;
  color: var(--tv-gold);
  font-size: clamp(0.62rem, 0.95vw, 0.76rem);
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---- Galleria mini (Top 3 monumenti) ---- */
.tv-monuments {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(8px, 1.2vw, 16px);
  margin-top: 22px;
}
.tv-monument {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(232, 194, 106, 0.2);
  background: rgba(20, 18, 26, 0.6);
  animation: tvFadeUp 0.6s ease both;
}
.tv-monument img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.tv-monument span {
  display: block;
  padding: 10px 12px;
  color: var(--tv-cream);
  font-size: clamp(0.8rem, 1.3vw, 1rem);
  font-weight: 700;
}

/* ---- Cartolina (spot fotografico) ---- */
.tv-postcard {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  background: #000;
}
.tv-postcard img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: tvPostcard 14s ease-in-out infinite alternate;
}
@keyframes tvPostcard {
  0%   { transform: scale(1.02); }
  100% { transform: scale(1.16); }
}
.tv-postcard-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 8, 12, 0.18) 0%, rgba(8, 8, 12, 0.66) 100%);
}
.tv-postcard-copy {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 clamp(18px, 4vw, 60px);
  animation: tvFadeUp 0.8s ease both;
}
.tv-postcard-flag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid rgba(232, 194, 106, 0.4);
  background: rgba(12, 10, 16, 0.5);
  color: var(--tv-gold);
  font-size: clamp(0.7rem, 1.1vw, 0.85rem);
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.tv-postcard-title {
  margin: 0 0 12px;
  font-size: clamp(2.2rem, 6.4vw, 5.4rem);
  font-weight: 950;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 0.98;
  text-wrap: balance;
}
.tv-postcard-line {
  margin: 0 auto;
  max-width: 34ch;
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(0.92rem, 1.9vw, 1.4rem);
  font-weight: 700;
  line-height: 1.32;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

/* ---- Percorso (itinerario animato) ---- */
.tv-route {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  padding: clamp(18px, 3vw, 44px);
  padding-top: clamp(14px, 2vw, 28px);
  overflow: hidden;
  background: linear-gradient(120deg, rgba(12, 10, 16, 0.86), rgba(24, 22, 32, 0.94));
}
.tv-route-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.tv-route-title {
  margin: 0;
  font-size: clamp(1.3rem, 3.2vw, 2.7rem);
  font-weight: 950;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.tv-route-subtitle {
  margin: 7px 0 0;
  color: rgba(246, 239, 226, 0.68);
  font-size: clamp(0.76rem, 1.2vw, 0.98rem);
  line-height: 1.25;
}
.tv-route-map {
  position: relative;
  flex: 0 0 clamp(120px, 20vh, 210px);
  margin: 16px 0 12px;
  overflow: hidden;
  border: 1px solid rgba(232, 194, 106, 0.3);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(232, 194, 106, 0.08), transparent 48%),
    repeating-linear-gradient(0deg, rgba(246, 239, 226, 0.045) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(90deg, rgba(246, 239, 226, 0.045) 0 1px, transparent 1px 22px),
    #181923;
}
.tv-route-map::before,
.tv-route-map::after {
  position: absolute;
  color: rgba(246, 239, 226, 0.42);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.tv-route-map::before { content: 'PERCORSO'; top: 10px; left: 12px; }
.tv-route-map::after { content: '3 TAPPE'; right: 12px; bottom: 10px; color: var(--tv-gold); }
.tv-route-map svg { display: block; width: 100%; height: 100%; }
.tv-route-map-line {
  fill: none;
  stroke: rgba(246, 239, 226, 0.13);
  stroke-width: 8;
  stroke-linecap: round;
}
.tv-route-path {
  fill: none;
  stroke: var(--tv-gold);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 4 2;
  filter: drop-shadow(0 0 3px rgba(232, 194, 106, 0.45));
}
.tv-route-marker circle {
  fill: var(--tv-gold);
  stroke: #17141f;
  stroke-width: 1.8;
}
.tv-route-marker text {
  fill: var(--tv-cream);
  font-size: 4px;
  font-weight: 900;
}
.tv-route-marker-label {
  fill: var(--tv-cream);
  font-size: 3.2px !important;
  font-weight: 750 !important;
  letter-spacing: 0;
}
.tv-route-stops {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(6px, 1vw, 14px);
  min-height: 0;
  padding: 0 0 12px;
}
.tv-stop {
  min-width: 0;
  padding: 13px;
  border-radius: 13px;
  border: 1px solid rgba(232, 194, 106, 0.24);
  background: rgba(20, 18, 26, 0.6);
  animation: tvRouteIn 0.5s ease both;
}
.tv-stop.active {
  border-color: var(--tv-gold);
  box-shadow: 0 0 0 2px rgba(232, 194, 106, 0.24), 0 12px 28px rgba(0, 0, 0, 0.4);
}
.tv-stop-num {
  color: var(--tv-gold);
  font-size: clamp(0.66rem, 1vw, 0.82rem);
  font-weight: 850;
  letter-spacing: 0.12em;
}
.tv-stop-name {
  margin: 6px 0 4px;
  color: var(--tv-cream);
  font-size: clamp(0.92rem, 1.6vw, 1.32rem);
  font-weight: 900;
}
.tv-stop-desc {
  color: rgba(246, 239, 226, 0.66);
  font-size: clamp(0.66rem, 1vw, 0.85rem);
  line-height: 1.32;
}
.tv-stop-desc b {
  display: block;
  margin-bottom: 3px;
  color: var(--tv-gold);
  font-size: 0.72em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tv-route-progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.tv-route-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--tv-gold), #f3ddA4);
  border-radius: 999px;
  transition: width 0.4s linear;
}
@keyframes tvRouteIn {
  0%   { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ---- Tradizione (infografica viva) ---- */
.tv-tradition {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(12px, 2.2vw, 30px);
  padding: clamp(18px, 3vw, 44px);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(12, 10, 16, 0.9), rgba(26, 22, 32, 0.94));
}
.tv-tradition-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}
.tv-tradition-left::-webkit-scrollbar { display: none; }
.tv-tradition-icon {
  display: grid;
  width: clamp(48px, 4.4vw, 72px);
  height: clamp(48px, 4.4vw, 72px);
  place-items: center;
  margin-bottom: 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--tv-gold), #b8943c);
  color: var(--tv-ink);
  font-size: clamp(1.2rem, 2.2vw, 1.9rem);
  box-shadow: 0 12px 30px rgba(232, 194, 106, 0.3);
}
.tv-tradition-title {
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 3.4vw, 2.8rem);
  font-weight: 950;
  letter-spacing: -0.02em;
  line-height: 1.04;
}
.tv-tradition-sub {
  max-width: 40ch;
  color: rgba(246, 239, 226, 0.86);
  font-size: clamp(0.98rem, 1.8vw, 1.3rem);
  line-height: 1.42;
}
.tv-tradition-facts {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  max-width: 46ch;
}
.tv-tradition-facts .tv-card {
  margin-top: 0;
  padding: 9px 12px;
  border-radius: 12px;
}
.tv-tradition-facts .tv-card > p {
  font-size: clamp(0.94rem, 1.56vw, 1.14rem);
  line-height: 1.4;
}
.tv-tradition-facts .tv-card-label {
  margin-bottom: 5px;
  font-size: clamp(0.62rem, 0.95vw, 0.72rem);
}
.tv-tradition-right {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  min-height: 100%;
}
.tv-tradition-right img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: tvKenburns 16s ease-in-out infinite alternate;
}
@media (max-width: 720px) {
  .tv-tradition { grid-template-columns: 1fr; }
  .tv-tradition-right { min-height: 220px; order: -1; }
}

/* ---- Quiz / curiosità ---- */
.tv-quiz {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: clamp(20px, 4vw, 60px);
  background: linear-gradient(135deg, rgba(12, 10, 16, 0.88), rgba(30, 24, 36, 0.92));
  text-align: center;
}
.tv-quiz-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(232, 194, 106, 0.4);
  background: rgba(232, 194, 106, 0.12);
  color: var(--tv-gold);
  font-size: clamp(0.72rem, 1.1vw, 0.9rem);
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.tv-quiz-q {
  margin: 0 auto 18px;
  max-width: 18ch;
  font-size: clamp(1.8rem, 5.4vw, 4.6rem);
  font-weight: 950;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.tv-quiz-reveal {
  margin: 0 auto;
  max-width: 40ch;
  padding: 16px 22px;
  border-radius: 16px;
  border: 1px solid var(--tv-line);
  background: rgba(20, 18, 26, 0.6);
  color: var(--tv-cream);
  font-size: clamp(0.95rem, 1.8vw, 1.3rem);
  font-weight: 750;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.tv-quiz.reveal .tv-quiz-reveal {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Statistiche ---- */
.tv-stats {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(20px, 4vw, 60px);
  background: linear-gradient(135deg, rgba(12, 10, 16, 0.88), rgba(22, 20, 30, 0.94));
  text-align: center;
}
.tv-stats-big {
  margin: 0 0 16px;
  color: var(--tv-gold);
  font-size: clamp(2.6rem, 9vw, 8rem);
  font-weight: 950;
  letter-spacing: -0.04em;
}
.tv-stats-line {
  margin: 0;
  max-width: 28ch;
  color: var(--tv-cream);
  font-size: clamp(1.1rem, 2.6vw, 1.9rem);
  font-weight: 800;
  line-height: 1.3;
}
.tv-stats-region {
  margin-top: 16px;
  color: rgba(246, 239, 226, 0.62);
  font-size: clamp(0.8rem, 1.3vw, 1rem);
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---- QR persistente in basso a destra ---- */
.tv-qr {
  position: absolute;
  right: clamp(14px, 2vw, 26px);
  bottom: clamp(14px, 2vw, 26px);
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(232, 194, 106, 0.34);
  background: rgba(12, 10, 16, 0.6);
  backdrop-filter: blur(8px);
  animation: tvFadeUp 0.8s 0.4s ease both;
}
.tv-qr img {
  display: block;
  width: clamp(65px, 6vw, 106px);
  height: clamp(65px, 6vw, 106px);
  border-radius: 8px;
  background: #fff;
  padding: 4px;
}
.tv-qr span {
  max-width: 90px;
  color: rgba(246, 239, 226, 0.8);
  font-size: clamp(0.58rem, 0.9vw, 0.72rem);
  font-weight: 750;
  text-align: center;
  line-height: 1.25;
}
@media (max-width: 720px) {
  .tv-qr { right: 12px; bottom: 12px; }
  .tv-qr img { width: 55px; height: 55px; }
}

/* ---- Footer chiusura "Scopri su rc88.it" ---- */
.tv-outro {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: clamp(10px, 1.3vw, 15px);
  border-top: 1px solid rgba(232, 194, 106, 0.2);
  background: linear-gradient(0deg, rgba(8, 8, 12, 0.85), rgba(8, 8, 12, 0));
  color: rgba(246, 239, 226, 0.75);
  font-size: clamp(0.72rem, 1.15vw, 0.9rem);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.tv-outro b {
  color: var(--tv-gold);
  font-weight: 900;
}

/* ---- Animazioni generali ---- */
@keyframes tvFadeUp {
  0%   { opacity: 0; transform: translateY(18px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes tvFadeDown {
  0%   { opacity: 0; transform: translateY(-14px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ---- Slide incoming/outgoing (transizione tra segmenti) ---- */
.tv-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease, transform 0.7s ease;
  transform: scale(1.02);
}
.tv-slide.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}
.tv-slide.leaving {
  opacity: 0;
  transform: scale(0.98);
}

/* ---- Controlli (play/pausa, progress) ---- */
.tv-controls {
  position: absolute;
  left: 50%;
  bottom: clamp(10px, 1.4vw, 18px);
  transform: translateX(-50%);
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(232, 194, 106, 0.24);
  background: rgba(12, 10, 16, 0.62);
  backdrop-filter: blur(8px);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease, visibility 0.35s ease, transform 0.35s ease;
}
.tv-root.controls-hidden .tv-controls {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(10px);
}

/* ---- Auto-hide dei pulsanti di pagina (Torna alla Home + selettore formato)
   dopo 2 secondi di inattività: solo nella pagina TV, non in embed. ---- */
#tvPage.controls-hidden .tv-page-head,
#tvPage.controls-hidden .tv-format-picker {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
#tvPage .tv-page-head,
#tvPage .tv-format-picker {
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

/* ---- Vista standalone (URL univoco ?view=tv) ---- */
html.is-tv-embed,
html.is-tv-embed body {
  margin: 0;
  padding: 0;
  background: #0a0a0e;
}
html.is-tv-embed .site-header,
html.is-tv-embed #siteFooter,
html.is-tv-embed .section-home-control {
  display: none !important;
}
html.is-tv-embed #tvPage {
  margin: 0;
  padding: 0;
}
html.is-tv-embed #tvPage .tv-page-shell {
  padding: 0;
}
html.is-tv-embed #tvPage .tv-page-head,
html.is-tv-embed #tvPage .tv-page-note {
  display: none;
}
html.is-tv-embed .tv-format-picker {
  display: none;
}
html.is-tv-embed .tv-root {
  min-height: 100vh;
}
html.is-tv-embed .tv-frame {
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  padding: 0;
}
html.is-tv-embed .tv-stage {
  max-height: 100vh;
  border-radius: 0;
}
.tv-controls button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--tv-cream);
  cursor: pointer;
  font-size: 1.22rem;
  line-height: 1;
  padding: 7px 10px;
}
.tv-controls button:hover {
  color: var(--tv-gold);
}
/* Tooltip "Copia link" per il pulsante di condivisione. */
.tv-controls [data-tv-share] {
  position: relative;
}
.tv-share-tip {
  position: absolute;
  top: 50%;
  left: calc(100% + 10px);
  transform: translateY(-50%);
  padding: 5px 9px;
  border-radius: 8px;
  background: #0c0a10;
  border: 1px solid rgba(232, 194, 106, 0.32);
  color: var(--tv-cream);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.tv-controls [data-tv-share]:hover .tv-share-tip,
.tv-controls [data-tv-share]:focus-visible .tv-share-tip {
  opacity: 1;
}
.tv-controls [data-tv-share] .tv-share-tip {
  top: auto;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
}
.tv-progress-dots {
  display: flex;
  align-items: center;
  gap: 5px;
}
.tv-progress-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(246, 239, 226, 0.3);
  transition: background 0.3s ease, transform 0.3s ease;
}
.tv-progress-dots i.on {
  background: var(--tv-gold);
  transform: scale(1.25);
}

/* ---- Pulsante schermo intero (modalità bordo/distinzione) ---- */
.tv-root .tv-controls [data-tv-full] {
  border-left: 1px solid rgba(232, 194, 106, 0.24);
  margin-left: 2px;
  padding-left: 12px;
  font-size: 1.1rem;
}

/* ---- Stage a schermo intero --- */
.tv-stage:fullscreen {
  max-height: 100vh;
  border-radius: 0;
  box-shadow: none;
  background: #000;
}
.tv-stage:fullscreen .tv-content,
.tv-stage:fullscreen .tv-tradition,
.tv-stage:fullscreen .tv-route,
.tv-stage:fullscreen .tv-postcard,
.tv-stage:fullscreen .tv-quiz,
.tv-stage:fullscreen .tv-stats {
  padding: clamp(24px, 4vw, 64px);
}

/* ---- Stato di caricamento ---- */
.tv-loading {
  display: grid;
  place-items: center;
  min-height: 60vh;
  color: var(--tv-gold);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

/* ---- Accessibilità: preferenza riduzione movimento ---- */
@media (prefers-reduced-motion: reduce) {
  .tv-bg, .tv-postcard img, .tv-tradition-right img,
  .tv-slide, .tv-card, .tv-hero, .tv-topbar { animation: none !important; }
}

/* ---- Selettore formato 16:9 / 9:16 nella pagina TV ---- */
.tv-format-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin: 6px auto 2px;
  flex-wrap: wrap;
}
.tv-format-btn {
  appearance: none;
  border: 1px solid rgba(232, 194, 106, 0.34);
  border-radius: 999px;
  background: rgba(20, 18, 26, 0.5);
  color: var(--tv-cream);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 9px 18px;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
.tv-format-btn:hover {
  border-color: var(--tv-gold);
}
.tv-format-btn.is-active {
  background: linear-gradient(135deg, var(--tv-gold), #b8943c);
  border-color: transparent;
  color: var(--tv-ink);
}

/* Le regole di formato 9:16 (portrait) vivono in tv/tv-portrait.css. */
