/* Volontairement conservateur : ces regles doivent tenir sur le navigateur
   d'une TV de plusieurs annees (pas de grid, pas de variables CSS). */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #0b0d10;
  color: #f2f4f7;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.screen {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: none;
  text-align: center;
}
.screen.active { display: block; }

.center {
  position: absolute;
  top: 50%; left: 50%;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 560px;
}

/* --- TV : ecran d'attente --- */
.tv-label {
  font-size: 2.2vw;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: #8a93a6;
  margin: 0 0 3vh 0;
}
.tv-code {
  font-size: 18vw;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0;
  color: #fff;
}
.tv-hint {
  font-size: 2vw;
  color: #6a7385;
  margin-top: 4vh;
}
.tv-hint strong { color: #9aa4b8; font-weight: 600; }

/* --- TV : diaporama ---
   Deux couches superposees en fondu croise. Une image de fond plutot qu'un
   <img> : object-fit manque a beaucoup de navigateurs de TV, background-size
   non. */
body.live { background: #000; cursor: none; }

.layer {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0;
  -webkit-transition: opacity 0.8s ease-in-out;
  transition: opacity 0.8s ease-in-out;
}
.layer.on { opacity: 1; }

/* Le code reste lisible depuis le canape sans manger l'image. */
.badge {
  position: absolute;
  right: 2.2vw; bottom: 2.2vw;
  font-size: 1.4vw;
  letter-spacing: 0.2em;
  color: #fff;
  opacity: 0.28;
  background: rgba(0, 0, 0, 0.45);
  padding: 0.5vw 1vw;
  border-radius: 6px;
}
.pager {
  position: absolute;
  left: 2.2vw; bottom: 2.2vw;
  font-size: 1.4vw;
  color: #fff;
  opacity: 0.28;
  background: rgba(0, 0, 0, 0.45);
  padding: 0.5vw 1vw;
  border-radius: 6px;
}
.paused-mark {
  position: absolute;
  left: 50%; top: 2.2vw;
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  font-size: 1.4vw;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fff;
  opacity: 0.5;
  background: rgba(0, 0, 0, 0.5);
  padding: 0.5vw 1.2vw;
  border-radius: 6px;
  display: none;
}
body.paused .paused-mark { display: block; }

/* --- PC --- */
.card {
  background: #14181e;
  border: 1px solid #232a34;
  border-radius: 14px;
  padding: 34px 30px;
  text-align: left;
}
h1 { font-size: 20px; margin: 0 0 4px 0; font-weight: 600; }
.sub { color: #8a93a6; font-size: 14px; margin: 0 0 26px 0; }
label { display: block; font-size: 13px; color: #8a93a6; margin-bottom: 8px; }

/* input#code et pas #code : la TV a elle aussi un element #code (le gros code
   a l'ecran), et un selecteur d'id l'emporterait sur sa classe .tv-code. */
input#code {
  width: 100%;
  font-size: 38px;
  letter-spacing: 0.35em;
  text-align: center;
  padding: 14px 10px;
  border-radius: 10px;
  border: 1px solid #2a3240;
  background: #0d1117;
  color: #fff;
  font-family: inherit;
}
input#code:focus { outline: none; border-color: #3d7dff; }

button {
  width: 100%;
  margin-top: 18px;
  padding: 15px;
  font-size: 16px;
  font-weight: 600;
  border: 0;
  border-radius: 10px;
  background: #3d7dff;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
}
button:disabled { background: #232a34; color: #6a7385; cursor: default; }
button.ghost { background: #2a3240; }

.status { margin-top: 14px; font-size: 13px; min-height: 18px; color: #8a93a6; }
.status.ok { color: #4ade80; }
.status.err { color: #f87171; }

.muted { color: #6a7385; font-size: 13px; }
a { color: #6d9bff; }

/* --- zone de depot --- */
.drop {
  margin-top: 4px;
  border: 2px dashed #2a3240;
  border-radius: 12px;
  background: #0d1117;
  padding: 34px 18px;
  text-align: center;
  cursor: pointer;
}
.drop.over { border-color: #3d7dff; background: #101b2e; }
.drop-title { font-size: 15px; font-weight: 600; margin: 0 0 6px 0; }
.drop-sub { color: #6a7385; font-size: 12px; margin: 0; }

.bar {
  margin-top: 14px;
  height: 6px;
  border-radius: 3px;
  background: #232a34;
  overflow: hidden;
  display: none;
}
.bar.on { display: block; }
.bar i {
  display: block;
  height: 100%;
  width: 0;
  background: #3d7dff;
  -webkit-transition: width 0.2s linear;
  transition: width 0.2s linear;
}

/* --- telecommande --- */
.deck-name { font-size: 15px; font-weight: 600; margin: 0 0 4px 0; }
.row { display: flex; gap: 10px; }
.row button { margin-top: 0; }
.row button.small { padding: 12px 8px; font-size: 14px; background: #2a3240; }

.dur { margin-top: 22px; }
.dur input[type=range] { width: 100%; accent-color: #3d7dff; }
.dur output { color: #f2f4f7; font-size: 13px; }

hr { border: 0; border-top: 1px solid #232a34; margin: 24px 0; }
