/* Styles volontairement simples, avec préfixes -webkit- pour les vieux mobiles
   (flexbox et animations d'anciennes versions de Chrome/Safari). */

* {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: #fff;
  color: #111;
  font-family: sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* --- écrans --- */
.screen {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100vh;
  height: 100dvh;
  width: 100%;
}

.screen.active {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
}

/* --- salle de réunion --- */
#meetingPlace {
  text-align: center;
}

#meetingPlace .header {
  width: 100%;
  padding: 0.2em 0;
  font-size: 3em;
  font-weight: bold;
  line-height: 1.3;
  background-color: #f2f2f2;
  word-break: break-word;
}

.pointer {
  font-size: 0.7em;
}

#meetingPlace .content {
  -webkit-flex: 1;
  flex: 1;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
}

#points {
  font-size: 6em;
  color: #888;
  margin-bottom: 0.2em;
}

#status {
  margin-top: 1.5em;
  color: #888;
  font-size: 1.1em;
}

#status.error {
  color: #c0392b;
}

/* --- URL + QR code pour rejoindre (page d'attente) --- */
#joinInfo {
  margin-top: 1.5em;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-align-items: center;
  align-items: center;
}

#gameUrl {
  margin-bottom: 0.6em;
  color: #4a90e2;
  font-size: 1.1em;
  text-decoration: none;
  word-break: break-all;
}

#qrCanvas {
  width: 220px;
  height: 220px;
  max-width: 60vw;
  max-height: 60vw;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: pixelated;
  border: 8px solid #fff;
  background: #fff;
}

/* identité colorée d'un joueur (lettre + couleur) */
span.coolId {
  display: inline-block;
  padding: 0 0.35em;
  margin: 0 0.05em;
  border-radius: 0.15em;
}

/* --- boutons --- */
button {
  border: none;
  border-radius: 0.15em;
  padding: 0.5em 1em;
  font-size: 2.2em;
  color: #fff;
  background: #4a90e2;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

button:disabled {
  opacity: 0.5;
}

button#yes {
  background: #2e9e4f;
}

button#no {
  background: #c0392b;
}

/* --- écran de dessin --- */
#drawPlace {
  background: #f2f2f2;
}

#timer {
  width: 100%;
  height: 0.8em;
  background: #fff;
}

#timer span {
  display: block;
  width: 100%;
  height: 100%;
  background: #2e9e4f;
}

#timer span.warning {
  background: #c0392b;
}

#myCanvasContainer {
  -webkit-flex: 1;
  flex: 1;
  border: 1px solid #999;
  background: #fff;
  overflow: hidden;
}

#myCanvas {
  display: block;
  width: 100%;
  height: 100%;
  -ms-touch-action: none;
  touch-action: none;
}

#gameMessage {
  margin: 0;
  padding: 0.4em 0.6em;
  text-align: center;
  font-size: 1.2em;
  min-height: 1.4em;
}

#actions {
  text-align: center;
  padding-bottom: 0.6em;
}

#actions button {
  margin: 0.15em;
}

/* --- avertissement paysage --- */
#landscapeMessage {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  text-align: center;
  padding: 1em;
  font-size: 1.6em;
  background: #fff;
  color: #111;
}

@media (orientation: landscape) {
  #landscapeMessage {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
  }
}

/* --- animation pouce haut / bas --- */
#logoAnim {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  pointer-events: none;
  overflow: hidden;
}

#logoAnim .emoji {
  position: absolute;
  top: 40%;
  left: 50%;
  font-size: 30vh;
  -webkit-animation: gwys-pop 1.2s ease-out forwards;
  animation: gwys-pop 1.2s ease-out forwards;
}

@-webkit-keyframes gwys-pop {
  0%   { -webkit-transform: translate(-50%, 20%) scale(0.2); opacity: 1; }
  40%  { -webkit-transform: translate(-50%, -30%) scale(1.2); opacity: 1; }
  100% { -webkit-transform: translate(-50%, -50%) scale(0.6); opacity: 0; }
}

@keyframes gwys-pop {
  0%   { transform: translate(-50%, 20%) scale(0.2); opacity: 1; }
  40%  { transform: translate(-50%, -30%) scale(1.2); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(0.6); opacity: 0; }
}
