:root {
  --blue: #104070;
  --dark-blue: #0b2f55;
  --red: #d71920;
  --light: #f3f6fb;
  --white: #ffffff;
  --text: #1d2733;
  --muted: #607089;
  --shadow: 0 18px 45px rgba(11, 47, 85, 0.14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background: radial-gradient(circle at top, #ffffff 0%, var(--light) 52%, #e5edf8 100%);
  color: var(--text);
}

.home-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.home-card,
.page-wrap {
  width: min(960px, 100%);
  margin: 24px auto;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 30px;
}

.page-wrap.narrow { width: min(760px, 100%); }

.event-logo {
  width: min(280px, 76vw);
  display: block;
  margin: 0 auto 18px;
}

.page-logo {
  width: min(180px, 55vw);
  display: block;
  margin: 0 auto 14px;
}

h1 {
  margin: 0;
  text-align: center;
  color: var(--blue);
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -0.04em;
}

h2 {
  color: var(--dark-blue);
  font-size: clamp(1.25rem, 3vw, 1.7rem);
  margin: 30px 0 16px;
}

h3 {
  margin: 8px 0 16px;
  color: var(--dark-blue);
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
}

.subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 1.12rem;
  margin: 10px 0 24px;
}

.home-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 24px 0;
}

.main-button,
.magazine-button,
.back-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  border-radius: 999px;
  font-weight: 700;
}

.main-button {
  background: var(--blue);
  color: var(--white);
  padding: 17px 18px;
  box-shadow: 0 10px 24px rgba(16, 64, 112, 0.18);
}

.main-button.red { background: var(--red); }
.main-button.dark { background: var(--dark-blue); }

.magazine-button {
  color: var(--blue);
  border: 2px solid rgba(16, 64, 112, 0.18);
  background: #f7fbff;
  padding: 14px 18px;
  margin: 18px 0;
}

.social-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 22px 0 6px;
}

.social-row a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 800;
}

.page-header { text-align: center; }

.back-link {
  width: fit-content;
  margin: 0 auto 24px;
  color: var(--blue);
  background: #eef5fc;
  padding: 10px 16px;
}

.venue-box,
.match-card,
.honor-card {
  background: var(--white);
  border: 1px solid rgba(16, 64, 112, 0.12);
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 10px 24px rgba(11, 47, 85, 0.08);
}

.venue-box {
  color: var(--dark-blue);
  line-height: 1.55;
}

.match-card { margin: 16px 0; }

.match-meta {
  color: var(--red);
  font-weight: 800;
  font-size: 0.95rem;
}

.live-box {
  min-height: 180px;
  border-radius: 18px;
  overflow: hidden;
  background: #f7fbff;
  border: 1px solid rgba(16, 64, 112, 0.1);
}

.live-box iframe {
  display: block;
  width: 100%;
  height: 360px;
  border: 0;
}

.stay-tuned {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  color: var(--blue);
  text-align: center;
  font-weight: 800;
  background: linear-gradient(135deg, #f8fbff, #eef5fc);
}

.honor-card { margin: 18px 0; }
.honor-card h2 { margin-top: 0; }
.honor-card span {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 400;
  margin-top: 4px;
}

/* Classe pronta per futuri pulsanti streaming */
.streaming-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 18px;
  border: 2px solid var(--red);
  border-radius: 999px;
  background: var(--white);
  color: var(--red);
  text-decoration: none;
  font-weight: 900;
}

.streaming-led {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--red);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.75); }
}

footer {
  text-align: center;
  margin-top: 28px;
  color: var(--blue);
  font-size: 0.78rem;
}

@media (max-width: 760px) {
  .home-page { padding: 14px; align-items: flex-start; }
  .home-card, .page-wrap { margin: 12px auto; padding: 20px; border-radius: 22px; }
  .home-buttons { grid-template-columns: 1fr; }
  .live-box iframe { height: 330px; }
}


/* Override responsive live score - versione verificata */
body {
  overflow-x: hidden;
}

.match-card {
  overflow: hidden;
}

.live-box {
  width: 100%;
  max-width: 100%;
  height: clamp(230px, 34vw, 315px);
  min-height: 0;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
}

.live-box iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  border: 0;
  overflow: hidden;
}

.streaming-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  margin-top: 14px;
  padding: 12px 18px;
  border: 2px solid var(--red);
  border-radius: 999px;
  background: var(--white);
  color: var(--red);
  text-decoration: none;
  font-weight: 900;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 18px rgba(215, 25, 32, 0.12);
}

.streaming-button:hover {
  background: #fff6f6;
}

.streaming-led {
  flex: 0 0 auto;
}

@media (max-width: 760px) {
  .live-box {
    height: 255px;
  }

  .streaming-button {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .home-card,
  .page-wrap {
    padding: 16px;
  }

  .match-card,
  .venue-box,
  .honor-card {
    padding: 16px;
    border-radius: 18px;
  }

  .live-box {
    height: 235px;
    border-radius: 14px;
  }
}


/* DYNAMIC FIT - ScoreTV dentro il box, senza tagli laterali */
body {
  overflow-x: hidden;
}

.match-card {
  overflow: hidden;
}

.live-box.scoretv-fit {
  width: 100%;
  max-width: 100%;
  min-height: 0;
  height: auto;
  overflow: hidden;
  border-radius: 18px;
  background: #f7fbff;
  border: 1px solid rgba(16, 64, 112, 0.1);
  position: relative;
}

.live-box.scoretv-fit iframe.scoretv-frame {
  display: block;
  max-width: none !important;
  border: 0 !important;
}

@media (max-width: 760px) {
  .streaming-button {
    width: 100%;
  }
}


/* READABLE FIT - ScoreTV più leggibile su smartphone */
.live-box.scoretv-fit {
  min-height: 250px;
}

@media (max-width: 760px) {
  .live-box.scoretv-fit {
    min-height: 245px;
  }
}

@media (max-width: 430px) {
  .live-box.scoretv-fit {
    min-height: 240px;
  }
}


/* COMPACT LIVEBOX - taglia il bianco inutile sotto ScoreTV */
.live-box,
.live-box.scoretv-fit {
  width: 100%;
  max-width: 100%;
  height: 175px !important;
  min-height: 0 !important;
  overflow: hidden !important;
  border-radius: 18px;
  background: #f7fbff;
  border: 1px solid rgba(16, 64, 112, 0.1);
  position: relative;
}

.live-box.scoretv-fit iframe.scoretv-frame {
  display: block;
  width: 950px !important;
  height: 420px !important;
  max-width: none !important;
  border: 0 !important;
  transform-origin: top left;
}

/* riduco margine tra live score e pulsante */
.live-box + .streaming-button {
  margin-top: 12px;
}

@media (min-width: 761px) {
  .live-box,
  .live-box.scoretv-fit {
    height: 190px !important;
  }
}

@media (max-width: 760px) {
  .live-box,
  .live-box.scoretv-fit {
    height: 165px !important;
  }

  .streaming-button {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .live-box,
  .live-box.scoretv-fit {
    height: 150px !important;
    border-radius: 14px;
  }
}

@media (max-width: 370px) {
  .live-box,
  .live-box.scoretv-fit {
    height: 140px !important;
  }
}

/* Stay tuned compatto */
.stay-tuned {
  min-height: 0 !important;
  height: 100%;
}


/* SETS FIT - ScoreTV completo: risultato + 5 set dentro il box */
.live-box,
.live-box.scoretv-fit {
  width: 100%;
  max-width: 100%;
  height: 165px !important;
  min-height: 0 !important;
  overflow: hidden !important;
  border-radius: 18px;
  background: #f7fbff;
  border: 1px solid rgba(16, 64, 112, 0.1);
  position: relative;
}

.live-box.scoretv-fit iframe.scoretv-frame {
  display: block;
  width: 1220px !important;
  height: 430px !important;
  max-width: none !important;
  border: 0 !important;
  transform-origin: top left;
}

@media (min-width: 761px) {
  .live-box,
  .live-box.scoretv-fit {
    height: 185px !important;
  }
}

@media (max-width: 760px) {
  .live-box,
  .live-box.scoretv-fit {
    height: 150px !important;
  }

  .streaming-button {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .live-box,
  .live-box.scoretv-fit {
    height: 142px !important;
    border-radius: 14px;
  }
}

@media (max-width: 370px) {
  .live-box,
  .live-box.scoretv-fit {
    height: 134px !important;
  }
}

.stay-tuned {
  min-height: 0 !important;
  height: 100%;
}


.final-label {
  display: block;
  margin-top: 4px;
  color: var(--red);
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
}
