/* ═══════════════════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #1a0a2e;
  font-family: 'Montserrat', sans-serif;
}

/* ═══════════════════════════════════════════════════════════
   APP CONTAINER – 1024×768 scaled to viewport (4:3)
═══════════════════════════════════════════════════════════ */
#app-container {
  position: absolute;
  width: 1024px;
  height: 768px;
  top: 50%;
  left: 50%;
  transform-origin: center center;
  transform: translate(-50%, -50%) scale(1);
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════
   SLIDES
═══════════════════════════════════════════════════════════ */
.slide {
  position: absolute;
  inset: 0;
  width: 1024px;
  height: 768px;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  display: none;
  overflow: hidden;
}
.slide.active { display: block; }

/* Individual slide backgrounds */
#slide-1        { background-image: url('img/slide1.png'); cursor: pointer; }
#slide-2        { background-image: url('img/slide2.png'); }
#slide-3        { background-image: url('img/slide3.png'); }
#slide-question { background-image: url('img/bkgQuestions.png'); }
#slide-score    { background-image: url('img/TotalePunteggio.png'); }
#slide-classifica { background-image: url('img/Classifica.png'); }

/* Tap area for slide1 (excludes footer) */
#tap-slide1 {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: calc(100% - 78px);
  cursor: pointer;
  z-index: 1;
}

/* ═══════════════════════════════════════════════════════════
   FOOTER BAR
═══════════════════════════════════════════════════════════ */
.footer-bar {
  --footer-h: 93px;
  position: absolute;
  bottom: 0; left: 0;
  width: 100%;
  height: var(--footer-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  /* transparent overlay – just the HTML buttons are interactive */
  pointer-events: none;
}
.footer-bar > * { pointer-events: all; }

.footer-left, .footer-right {
  flex: 1;
  display: flex;
  align-items: center;
}

.footer-right {
  justify-content: flex-end;
}

.novartis-text {
  color: white;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  opacity: 0.9;
}

.cosentyx-footer-text {
  color: white;
  font-size: 11px;
  font-weight: 700;
  text-align: right;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.footer-center {
  display: flex;
  gap: 26px;
  align-items: center;
}

/* Footer popup-trigger buttons (RCP, CLASSE E PREZZO, BIBLIO) */
.btn-footer {
    border: 1px solid #d60e63;
    color: #d60e63;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    height: calc(var(--footer-h) / 2.7);
    padding: 0 10px;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    line-height: 1;
    white-space: nowrap;
    background-color: #FFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-left: 22px;
    padding-right: 22px;
    padding-top: 15px;
    padding-bottom: 15px;
}
.btn-footer.transparent {
    background-color: transparent;
    border-color: transparent;
    color: transparent
}
/* .btn-footer:hover {
  background: rgba(255,255,255,0.15);
  border-color: white;
} */
.btn-footer--double { font-size: 12px; }

/* ═══════════════════════════════════════════════════════════
   SLIDE 2 – btnInizia
═══════════════════════════════════════════════════════════ */
.slide2-btn-area {
  position: absolute;
  bottom: 160px;
  left: 5.2%;
  /* transform: translateX(-50%); */
  z-index: 10;
}

#btnInizia {
    background-image: url(/img/btnInizia.png);
    background-size: 100%;
    background-repeat: no-repeat;
    background-color: transparent;
    border: none;
    width: 219px;
    height: 80px;
    color: transparent;
    font-size: 0;
    cursor: pointer;
    padding: 0;
    display: block;
}

/* ═══════════════════════════════════════════════════════════
   SLIDE 3 – Nickname input + btnInvia
═══════════════════════════════════════════════════════════ */
.slide3-content {
    position: absolute;
    top: 35%;
    left: 0%;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    z-index: 10;
}

#nickname-input {
    width: 100%;
    max-width: 925px;
    height: 74px;
    background: transparent;
    border: none;
    /* border-radius: 12px; */
    font-family: 'Montserrat', sans-serif;
    font-size: 22px;
    font-weight: 400;
    color: #333;
    padding: 0 24px;
    outline: none;
    transition: border-color 0.2s;
}
#nickname-input:focus { border-color: #e91e8c; }
#nickname-input::placeholder { color: #bbb; }

#btnInvia {
  /* usa l'immagine grafica del bottone */
  background-image: url('/img/btnInvia.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-color: transparent;
  border: none;
  width: 280px;
  height: 80px;
  color: transparent;
  font-size: 0;
  cursor: pointer;
  padding: 0;
  display: block;
}

.nickname-error {
  position: absolute;
  top: 68%;
  left: 50%;
  transform: translateX(-50%);
  color: #ff6b8a;
  font-size: 14px;
  font-weight: 600;
  z-index: 11;
}

/* Pulse animation per bottoni con immagine PNG trasparente.
   Solo scale — niente box-shadow che "riempiva" il rettangolo del PNG. */
@keyframes pulse-btn {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}
.btn-pulse { animation: pulse-btn 2s ease-in-out infinite; }
.btn-pulse:hover { animation-play-state: paused; }

/* ═══════════════════════════════════════════════════════════
   SLIDE DOMANDA
═══════════════════════════════════════════════════════════ */

/* Timer digitale – sovrapposto all'orologio analogico in-image */
#timer-display {
    position: absolute;
    top: 21px;
    right: 35px;
    width: 74px;
    height: 74px;
    /* border-radius: 50%; */
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #444;
    z-index: 20;
    /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); */
    letter-spacing: 0.04em;
}

#question-counter {
  position: absolute;
  top: 16px;
  left: 28px;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  font-weight: 600;
  z-index: 20;
  letter-spacing: 0.05em;
}

/* Domanda: full-width in alto, mai ridimensionata */
#question-text {
  position: absolute;
  top: 8%;
  left: 4%;
  width: 88%;
  color: white;
  font-size: 35px;
  font-weight: 400;
  line-height: 1;
  z-index: 10;
}
#question-text strong, #question-text b { font-weight: 700; }

/* Risposte: full-width finché non appare la spiegazione */
#answers-area {
  position: absolute;
  top: 28%;
  left: 4%;
  width: 88%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Si stringe quando il pannello è visibile */
#slide-question.has-explanation #answers-area {
  width: 58%;
}

.answer-option {
  background: rgba(210, 70, 120, 0.72);
  border: 0px solid rgba(255,255,255,0.22);
  border-radius: 8px;
  color: white;
  font-family: 'Montserrat', sans-serif;
  font-size: 17px;
  font-weight: 500;
  padding: 11px 20px;
  cursor: pointer;
  text-align: left;
  transition: background 0.18s, border-color 0.18s, transform 0.1s;
  line-height: 1.25;
  user-select: none;
}
.answer-option:hover:not(.disabled) {
  background: rgba(220, 50, 105, 0.88);
  border-color: rgba(255,255,255,0.5);
  transform: translateX(2px);
}

/* Stato: risposta selezionata (prima della rivelazione) */
.answer-option.selected {
  background: rgba(215, 30, 88, 0.95);
  border-color: rgba(255,255,255,0.6);
}

/* Stato: risposta corretta (dopo rivelazione) */
.answer-option.correct {
  background: rgb(81 42 91);
  border: 2.5px solid white;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.4);
}

/* Stato: risposta errata selezionata (dopo rivelazione) */
.answer-option.wrong-selected {
  background: rgba(100, 20, 50, 0.75);
  border-color: rgba(255,120,150,0.7);
  opacity: 0.75;
}

/* Stato: altre risposte dopo rivelazione */
.answer-option.dimmed {
  opacity: 0.55;
  cursor: default;
}

.answer-option.disabled {
  cursor: default;
  pointer-events: none;
}

/* Pannello spiegazione – agganciato al bordo destro, stessa top delle risposte */
#explanation-panel {
  position: absolute;
  top: 28%;
  right: 0;
  width: 36%;
  max-width: 400px;
  /* bottom: calc(var(--footer-h, 93px) + 8px); */
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 15;
  border-radius: 12px 0 0 12px;
  overflow: hidden;
  box-shadow: -3px 0 28px rgba(255,255,255,0.45);
}
#explanation-panel.visible {
  transform: translateX(0);
}

#explanation-inner {
  background: #f5d4dd;
  border-radius: 12px 0 0 12px;
  border: 2px solid rgba(255,255,255,0.85);
  border-right: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15);
  padding: 18px 20px 16px;
  height: auto;
  overflow-y: auto;
}

.explanation-label {
  font-size: 13px;
  font-weight: 700;
  color: #6b1a3a;
  margin-bottom: 2px;
  letter-spacing: 0.01em;
}

#explanation-correct-value {
  font-size: 14px;
  font-weight: 700;
  color: #3a0e20;
  margin-bottom: 10px;
  line-height: 1.3;
  display: none;
}

#explanation-body {
  font-size: 12px;
  font-weight: 400;
  color: #2a0a16;
  line-height: 1.55;
}
#explanation-body ul {
  padding-left: 18px;
  margin-top: 4px;
  margin-bottom: 4px;
  list-style-type: disc;
}
#explanation-body ul ul {
  padding-left: 18px;
  list-style-type: disc;
}
#explanation-body li {
  margin-bottom: 3px;
  font-size: 12.5px;
  font-weight: 500;
}
#explanation-body strong { font-weight: 700; }

#explanation-inner .footnote {
  display: block;
  margin-top: 12px;
  font-size: 10px;
  font-style: italic;
  color: #6b1a3a;
  line-height: 1.4;
}

/* Bottone AVANTI */
#btn-avanti {
    position: absolute;
    bottom: 106px;
    left: 52px;
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.08em;
    padding: 10px 36px;
    cursor: pointer;
    z-index: 20;
    transition: background 0.2s, color 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
/* #btn-avanti:hover { background: #f0f0f0; } */

/* ═══════════════════════════════════════════════════════════
   SLIDE TOTALE PUNTEGGIO
═══════════════════════════════════════════════════════════ */
#score-overlay {
  position: absolute;
  top: 18%;
  left: 3%;
  width: 92%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 10;
}

.score-row {
  display: flex;
  align-items: center;
  gap: 18px;
}
.score-row--inline {
  flex-wrap: nowrap;
}

.score-label {
  color: white;
  font-size: 40px;
  font-weight: 300;
  line-height: 1.2;
  white-space: nowrap;
}

.score-value-box {
  background: white;
  border-radius: 6px;
  color: #222;
  font-size: 45px;
  font-weight: 700;
  padding: 6px 20px;
  min-width: 160px;
  text-align: center;
  margin-left: 650px;
}
.score-value-box--inline {
  margin-left: 0;
  min-width: 120px;
}

#val-score
{
  margin-top: -27px;
}

#val-correct
{
   margin-top: 39px;
}

#val-time
{
    margin-top: 23px;
    margin-left: 120px;
}
/* ═══════════════════════════════════════════════════════════
   SLIDE CLASSIFICA
═══════════════════════════════════════════════════════════ */
#classifica-overlay {
  position: absolute;
  top: 60px; left: 0;
  width: 100%;
  height: calc(100% - 78px);
  padding: 54px 52px 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10;
}

.classifica-title {
  color: white;
  font-size: 54px;
  font-weight: 300;
  margin-bottom: 10px;
}

#classifica-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  max-height: 520px;
}

.classifica-row {
  display: flex;
  align-items: center;
  background: white;
  border: 1.5px solid rgba(200,0,90,0.35);
  border-radius: 6px;
  padding: 0;
  height: 58px;
  overflow: hidden;
}

.classifica-rank {
  background: #c2185b;
  color: white;
  font-size: 20px;
  font-weight: 700;
  width: 48px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.classifica-nickname {
  flex: 1;
  font-size: 18px;
  font-weight: 400;
  color: #222;
  padding: 0 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.classifica-punti {
  background: transparent;
  color:#592d5f;
  font-size: 18px;
  font-weight: 700;
  padding: 0 30px;
  white-space: nowrap;
}

/* Evidenzia il giocatore corrente */
.classifica-row.current-player {
  border-color: #c2185b;
  box-shadow: 0 0 0 2px rgba(194,24,91,0.45);
}

/* ═══════════════════════════════════════════════════════════
   POPUPS
═══════════════════════════════════════════════════════════ */
.popup-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 0, 20, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  backdrop-filter: blur(2px);
}

.popup-box {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 50px rgba(0,0,0,0.6);
}

/* RCP popup styled */
.popup-box--rcp {
  background: linear-gradient(160deg, #3d0b5a 0%, #7b1a6a 50%, #c2185b 100%);
  width: 680px;
  padding: 44px 48px 24px;
  color: white;
}

.popup-title {
  font-size: 48px;
  font-weight: 300;
  margin-bottom: 4px;
}
.popup-subtitle {
  font-size: 15px;
  font-weight: 400;
  opacity: 0.8;
  margin-bottom: 28px;
}

.popup-rcp-content p {
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 14px;
}
.popup-ref {
  opacity: 0.7;
  font-size: 12px !important;
}

.popup-footer-bar {
  display: flex;
  gap: 8px;
  margin-top: 28px;
  justify-content: center;
}

/* Image popups (Classe e Prezzo, Biblio) */
.popup-box--image {
  max-width: 940px;
  max-height: 720px;
  background: white;
}
.popup-image {
  display: block;
  max-width: 900px;
  max-height: 680px;
  object-fit: contain;
}

/* Close button */
.popup-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: rgba(255,255,255,0.15);
  border: 1.5px solid rgba(255,255,255,0.5);
  color: white;
  font-size: 20px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  z-index: 10;
  transition: background 0.2s;
}
.popup-close:hover { background: rgba(255,255,255,0.3); }
.popup-box--image .popup-close {
  background: rgba(80,0,40,0.7);
  color: white;
}

/* ═══════════════════════════════════════════════════════════
   LOADING OVERLAY
═══════════════════════════════════════════════════════════ */
#loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10,0,20,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 5px solid rgba(255,255,255,0.25);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════
   UTILITY
═══════════════════════════════════════════════════════════ */
.hidden { display: none !important; }

.novartis-logo{
      width: 240px;
    height: 70px;
    background-image: url(../img/logonovartis.png);
    background-repeat: no-repeat;
    background-size: contain;
    /* opacity: 0.5; */
    margin-left: 20px;
}