html {
    background-color: #222;
    color: #efefef;
    font-family: arial;
}

html, body {
  margin: 0;
  padding: 0;
  background: black;
  height: 100vh;
  overflow: hidden;
  font-family: sans-serif;
}

.app-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.stage-wrapper {
  position: relative;
  width: min(100vw, calc(100vh * (16 / 9)));
  aspect-ratio: 16 / 9;
  background: #000;
  /* overflow: hidden; */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.video-layer {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 0, 0.8);
  z-index: 1;
}

#video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  
  object-fit: contain;
  object-position: center;
  background: black;
}

.quiz-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  box-sizing: border-box;
  /* background: rgba(255, 0, 255, 0.3);  */
}

#controls-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
}

#baby-controls {
  position: absolute;
  inset: 0;
  z-index: 1000;
}

.overlay-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
}

.quiz-screen {
  position: absolute;
  inset: 0;
  /* border: 3px solid yellow; */
}

.quiz-background {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom left,
    #003366 30%, /* bleu foncé vers 2/3 haut */
    #3399ff 100% /* bleu clair en bas à gauche */
  );
  z-index: 0;
}

.quiz-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;

  height: 100%;
  padding: 10vh 2rem 2rem 2rem; /* haut responsive, latéral fixe */
  box-sizing: border-box;
  text-align: center;
  overflow-y: auto;


}

.hidden {
  display: none;
}

.doctor-expression { 
  /* border: 2px solid tomato; */
  position: absolute;
  bottom: 0; 
  right: 2vw;
  width: 40vh;
}

/* .question {} */

.question-text {
  font-size: clamp(1.2rem, 2.5vw, 2rem);
  font-weight: 200;
  line-height: 1.4;
  margin-bottom: 1rem;
}

.question-number {
  color: rgba(255,255,255,0.75);
  margin-right: 1rem;
}


.quiz-feedback {
  /* border: 2px solid tomato; */
  padding-left: 5rem;
  text-align: left;
  font-size: clamp(1.2rem, 2.5vw, 2rem);
  color: rgba(255,255,255,0.8);
}

.explanation {
  width: 60vw;
  /* border: 3px dotted tomato; */
}

.media {
  /* border: 2px solid salmon; */
  height: 30vh;
  min-height: 25vh;
  max-height: 35vh;
  min-width: 25vw;
  max-width: 50vw;

  display: flex;     /* Pour centrer éventuellement */
  align-items: left;
  justify-content: left;
}
.media img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;

  box-shadow: 10px 10px 30px rgba(0,0,0,0.5);
  border-radius: 5px;
}

.answer {
  text-transform: uppercase;
}

.quiz-buttons {
  position: absolute;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  width: 100%;
  max-width: 400px; /* optionnel */
}
.answer-button {
  padding: 1rem 2rem;
  font-size: 1.5rem;
  width: 8rem;
  height: 4rem;
  border: none;
  border-radius: 0.5rem;
  color: white;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  border: 2px solid white;

  /* margin: 0.5rem; */
}

.answer-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2);
}

.answer-button:active {
  transform: translateY(0);
  box-shadow: 0 3px 4px rgba(0, 0, 0, 0.2);
}

.answer-button.true {
  background: linear-gradient(to top, #0a8020, #40d97c);
}

.answer-button.false {
  background: linear-gradient(to top, #80200a, #e76916);
}

.next-button {
  position: absolute;
  bottom: 2rem;
  left: 50%; 
  transform: translateX(-50%);
  width: 64px;
  height: 64px;
  background-image: url('/assets/ui/next-button.png');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
}

/*-- Intro window --*/

.modal-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  aspect-ratio: 2 / 3;            /* ratio 2:3 (largeur:hauteur) */
  width: min(90vw, 400px);        /* adaptatif, max 400px large */
  max-height: 80vh;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 6px 32px #0003;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  padding: 0;
  z-index: 10;
}

.modal-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  flex: 1 1 auto;
  display: block;
}

.modal-btn {
  position: absolute;
  left: 50%; bottom: 2rem;
  transform: translateX(-50%);
  padding: 0.5rem 2.5rem;
  font-size: 1.2rem;
  border-radius: .5rem;
  border: 2px solid rgba(255,255,255,0.4);
  background: linear-gradient(to top, #3b56af, #4f93e4);
  /* color: #111; */
  color:rgba(255,255,255, 0.85);
  font-weight: 600;
  box-shadow: 0 2px 8px #0001;
  cursor: pointer;
}

.control-buttons {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: row;
}
.control-btn {
  background: linear-gradient(to top, #3b56af, #4f93e4);
  width: 3rem;
  height: 3rem;
  margin: 0 0.2rem;
  font-size: 1.2rem;
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 1.5rem;
  color:rgba(255,255,255, 0.85);
  font-weight: 600;
  box-shadow: 0 2px 8px #0001;
  cursor: pointer;
}

.control-btn.small-font {
  font-size: 0.8rem;
}

@media (max-width: 500px) {
  .modal-center {
    width: 96vw;
    max-height: 90vh;
  }
  .modal-btn {
    bottom: 1rem;
    font-size: 1rem;
    padding: 0.7rem 1.2rem;
  }
}

/*-- password window --*/

.password-modal {
  position: fixed;
  z-index: 1000;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(to top, #3b56af, #4f93e4);
  border-radius: 1.2rem;
  box-shadow: 0 4px 32px #0004;
  /* padding: 2rem 2rem 1.5rem 2rem; */
  padding: 1rem 2.5rem;
  min-width: 280px;
  min-height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.2rem;
  width: 100%;
}

.password-label {
  font-size: 1.1rem;
  font-weight: 500;
  /* color: #1d2939; */
  color:rgba(255,255,255, 0.85);
  margin-bottom: 0.2rem;
}

.password-input {
  padding: 0.5rem;
  font-size: 1.15rem;
  border: 1px solid #c5ced8;
  border-radius: 0.7rem;
  outline: none;
  transition: border-color 0.15s;
}

.password-input:focus {
  border-color: #449d5d;
}

.password-btn {
  /* padding: 0.85rem 0; */
  background: linear-gradient(to top, #3baf56, #8fe493);
  border: none;
  /* border-radius: 0.5rem; */
  font-size: 1.08rem;
  font-weight: 700;
  /* color: #14231b; */
  box-shadow: 0 2px 6px #0001;
  cursor: pointer;
  transition: background 0.2s;

  padding: 0.5rem 2.5rem;
  /* font-size: 1.2rem; */
  border-radius: .5rem;
  color: rgba(255,255,255,0.8);
}

.password-btn:hover {
  background: linear-gradient(to bottom, #8fe493, #3baf56);
}

/*-- info window --*/

.info-modal {
  position: fixed;
  z-index: 1000;
  inset: 0;
  /* top: 50%; left: 50%; */
  /* transform: translate(-50%, -50%); */
  background: linear-gradient(to top, #3b56af, #4f93e4);
  /* border-radius: 1.2rem; */
  /* box-shadow: 0 4px 32px #0004; */
  /* padding: 2rem 2rem 1.5rem 2rem; */
  padding: 1rem 2.5rem;
  /* min-width: 280px;
  min-height: 170px; */
  display: flex;
  /* align-items: center; */
  justify-content: center;
}

.info-form {
  display: flex;
  flex-direction: column;
  /* align-items: stretch; */
  gap: 1.2rem;
  width: 100%;
}

.info-line {
  display: flex;
  flex-direction: row;
  vertical-align: middle;
}

.info-label {
  font-size: 1.1rem;
  font-weight: 500;
  width: 40vw;
  /* color: #1d2939; */
  color:rgba(255,255,255, 0.85);
  margin-bottom: 0.2rem;
}

.info-input {
  padding: 0.5rem;
  font-size: 1.15rem;
  border: 1px solid #c5ced8;
  border-radius: 0.7rem;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.info-input:focus {
  border-color: #449d5d;
}

.info-btn {
  /* padding: 0.85rem 0; */
  background: linear-gradient(to top, #3baf56, #8fe493);
  border: none;
  /* border-radius: 0.5rem; */
  font-size: 1.08rem;
  font-weight: 700;
  /* color: #14231b; */
  box-shadow: 0 2px 6px #0001;
  cursor: pointer;
  transition: background 0.2s;

  padding: 0.5rem 2.5rem;
  /* font-size: 1.2rem; */
  border-radius: .5rem;
  color: rgba(255,255,255,0.8);

  max-width: 10rem;
  text-align: center;
  margin: 0 auto;
  margin-top: 10rem;
}

.info-btn:hover {
  background: linear-gradient(to bottom, #8fe493, #3baf56);
}

@media (max-height: 500px) {
  .info-input {
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 0.5rem;
  }
}

/*-- IMC window --*/

.imc-modal {
  position: fixed;
  z-index: 1000;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(to top, #3b56af, #4f93e4);
  border-radius: 1.2rem;
  box-shadow: 0 4px 32px #0004;
  /* padding: 2rem 2rem 1.5rem 2rem; */
  padding: 1rem 2.5rem;
  min-width: 280px;
  min-height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.imc-img {
  /* border: 2px dotted yellowgreen; */
  max-width: 40vw;
}
.imc-img img {
  width: 100%;
}

.imc-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.2rem;
  width: 100%;
}

.imc-label {
  font-size: 1.1rem;
  font-weight: 500;
  /* color: #1d2939; */
  color:rgba(255,255,255, 0.85);
  margin-bottom: 0.2rem;
  margin-right: 1rem;
}

.imc-input {
  padding: 0.5rem;
  font-size: 1.15rem;
  border: 1px solid #c5ced8;
  border-radius: 0.7rem;
  outline: none;
  transition: border-color 0.15s;
}

.imc-text {
  font-size: 2rem;
  text-align: center;
}

.imc-input:focus {
  border-color: #449d5d;
}

.imc-btn {
  /* padding: 0.85rem 0; */
  background: linear-gradient(to top, #3baf56, #8fe493);
  border: none;
  /* border-radius: 0.5rem; */
  font-size: 1.08rem;
  font-weight: 700;
  /* color: #14231b; */
  box-shadow: 0 2px 6px #0001;
  cursor: pointer;
  transition: background 0.2s;

  padding: 0.5rem 2.5rem;
  /* font-size: 1.2rem; */
  border-radius: .5rem;
  color: rgba(255,255,255,0.8);
}

.imc-btn:hover {
  background: linear-gradient(to bottom, #8fe493, #3baf56);
}

/*-- certif --*/

.certif-canvas {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: #222;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.certif-bg {
  position: relative;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
  display: block;
  position: absolute;
  left: 0; top: 0;
  z-index: 10;
}

/* Nom et date sont en position absolue rapport au canvas */
.certif-nom, .certif-date {
  position: absolute;
  color: #1a2a1a;
  /* font-family: "Times New Roman", serif; */
  font-size: 2.4vw;  /* ajuste selon le rendu */
  /* font-weight: bold; */
  background: none;
  z-index: 12;
  pointer-events: none;
  white-space: nowrap;
}

/* Exemple : placer à 24% du haut et 50% du large (à ajuster) */
/* .certif-nom {
} */
.certif-date {
  font-size: 1.8vw; 
}


/* Quiz progress */
.progress-container {
  position: absolute;
  top: 0vh;
  left: 2vw;
  right: 2vw;
  z-index: 10;

  /* width: 100%; */
  height: 16px;
  background: rgba(255,255,255,0.85);
  border-radius: 8px;
  overflow: hidden;
  margin: 1em 0;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(to top, #3baf56, #8fe493);
  transition: width 0.3s ease;
}

.progress-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  color: #333;
  pointer-events: none;
}


.sponsors{
  position: relative;
  width: 100vw;
  height: 100vh;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 2;
}

.sponsor-rows {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  height: min(80vh, 560px);
  width: 100%;
  padding: clamp(2rem, 6vh, 3.5rem) 0;
  box-sizing: border-box;
}

.sponsor-row {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  gap: clamp(1.5rem, 5vw, 3rem);
  width: min(80vw, 960px);
  margin: 0 auto;
}

.sponsor-row > * {
  flex: 0 0 auto;
}

.logo {
  flex: 0 0 auto;
  max-width: 200px;
  max-height: 200px;
  /* border: 2px dashed red; */
}

/*-- Paperboards --*/

.paperboard { 
  position: absolute; 
  top: 0; bottom: 0;
  left: 0; 
  right: 0;
  z-index: 1;
  /* max-width: 40%; */
  /* font-family: system-ui, sans-serif;  */
  color: black;
  /* background: rgba(255,0,0,0.3); */
}
.paperboard [data-layer="symptoms"] 
{ 
  position: absolute; right: 2rem; top: 4rem; 
  /* max-width: 40ch;  */
}
.paperboard [data-layer="symptoms"] {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
  max-width: min(28vw, 22rem);
  color: #101624;
  pointer-events: none;
}

.paperboard [data-layer="symptoms"] .pb-card {
  position: relative;
  pointer-events: auto;
  padding: 1.2rem 1.6rem;
  border-radius: 18px;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.92), rgba(234, 243, 255, 0.88));
  border: 1px solid rgba(143, 185, 255, 0.5);
  box-shadow: 0 18px 30px rgba(5, 20, 46, 0.22);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
  isolation: isolate;
}

.paperboard [data-layer="symptoms"] .pb-card::before {
  content: "";
  position: absolute;
  inset: -25% -40% auto auto;
  height: 80%;
  width: 70%;
  background: radial-gradient(circle at top right, rgba(143, 185, 255, 0.7) 0%, rgba(143, 185, 255, 0) 65%);
  opacity: 0.75;
  transform: rotate(-7deg);
  z-index: -1;
}

.paperboard [data-layer="symptoms"] .pb-card::after {
  content: "";
  position: absolute;
  inset: 15% auto -20% -35%;
  width: 65%;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0));
  opacity: 0.8;
  z-index: -1;
}

.paperboard [data-layer="symptoms"] .pb-title {
  font-size: clamp(0.8rem, 1.3vw, 0.95rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #2f4c6f;
  margin-bottom: 0.5rem;
  opacity: 0.85;
}

.paperboard [data-layer="symptoms"] .pb-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
}

.paperboard [data-layer="symptoms"] .pb-list > * {
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  font-weight: 600;
  color: #122135;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}
.pb-card { 
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; 
  /* padding: 12px 16px;  */
  padding: 40px;
  /* box-shadow: 0 6px 20px rgba(0,0,0,.08);  */
  box-shadow: 5px 5px 20px rgba(0, 0, 0, 0.50);
  font-size: 2.0rem;
}
.pb-title { 
  font-weight: 700; margin-bottom: .5rem; 
}
.pb-list { 
  margin: 0; 
  /* padding-left: 1.25rem;  */
  display: flex;
  flex-direction: column;
}
.pb-list > *:not(:first-child) { 
  margin-top: 20px;
}
.pb-figure { 
  position: absolute; 
  left: 2rem; 
  top: 4rem; 
}
.pb-figure img { 
  /* max-width: 24rem;  */
  max-width: 25vw;
  max-height: 60vh;
  
  height: auto; 
  border-radius: 12px; 
  /* box-shadow: 0 6px 20px rgba(0,0,0,.12);  */
  box-shadow: 5px 5px 20px rgba(0, 0, 0, 0.50);
}
.pb-fade-in { animation: pbfade .25s ease-out; }
@keyframes pbfade { from { opacity: 0; transform: translateY(4px) } to { opacity: 1; transform: translateY(0) } }

#title-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transform: translateY(1.5rem) scale(0.97);
  transition:
    opacity 0.55s ease,
    transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

#title-overlay.title-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

#title-overlay.title-visible .title {
  filter: drop-shadow(0 18px 30px rgba(6, 12, 30, 0.28));
}

#title-overlay .title {
  position: absolute;
  bottom: 2rem;
  left: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.75rem;
  font-size: clamp(0.8rem, 1.4vw, 2.1rem);
  font-weight: 600;
  line-height: 1.3;
  color: #f8fbff;
  letter-spacing: 0.03em;
  text-shadow: 0 3px 10px rgba(5, 15, 32, 0.6);
  background: linear-gradient(135deg, rgba(31, 60, 116, 0.92), rgba(20, 33, 62, 0.88));
  border-radius: 22px;
  border-left: 5px solid #6be0ff;
  box-shadow: 0 16px 35px rgba(6, 12, 30, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  max-width: min(80vw, 32rem);
  overflow: hidden;
  z-index: 0;
  isolation: isolate;
  transform-origin: left bottom;
  transition:
    transform 0.65s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.45s ease;
  pointer-events: auto;
}

#title-overlay .title::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, rgba(107, 224, 255, 0.5), rgba(137, 173, 255, 0.35) 55%, rgba(255, 255, 255, 0));
  mix-blend-mode: screen;
  opacity: 0.7;
  transition: opacity 0.3s ease;
  z-index: -1;
}

#title-overlay .title::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -20%;
  width: 8rem;
  height: 8rem;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0) 60%);
  opacity: 0.35;
  transform: rotate(5deg);
  z-index: -1;
}

#title-overlay .title:hover::before {
  opacity: 1;
}

#instance-selector {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
  padding: 2rem;
  color: black;
  z-index: 100;
  overflow: hidden;
}
#instance-selector.hidden {
  display: none;
}

#instance-selector::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url('/assets/warmup.png');
  background-size: cover;
  background-position: center;
  filter: blur(10px);
  transform: scale(1.05);
  z-index: 0;
}

#instance-selector::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.35);
  z-index: 0;
}

#instance-selector .instance {
  position: relative;
  z-index: 1;
  width: 200px;
  height: 200px;
  display: grid;
  place-items: center;
  background: white;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: 8px 8px 20px rgba(0, 0, 0, 0.18);
  font-weight: 600;
  text-transform: capitalize;
  padding: 20px;
  cursor: pointer;
}

#instance-selector .instance img {
  object-fit: contain;
  /* border: 2px solid red; */
  width: 100%;
  height: 100%;
}
