/* game.css : page de jeu, hors cases des grilles (grid.css) : mise en page, barre de jeu, clavier,
   message, chronomètre, fenêtre « nombre de lettres », panneau animateur et fenêtre publique. */


/* ========================================================================
   Mise en page de la page de jeu
   Colonne flex : barre haute, zone de grille qui prend toute la place libre, puis clavier.
   La grille se dimensionne d'après cette zone (#game_grid, unités cq* dans grid.css), moins la place
   du score et de l'indicateur de frappe (--grid_reserve, mesurée par observeGridReserve() dans game.js) :
   grille et score restent groupés au centre, sans vide entre eux ni passage sous la barre haute.
   ======================================================================== */
div#game_page {
  display: flex;
  flex-direction: column;
  background-color: var(--motus_blue);
  background: linear-gradient(0turn, var(--motus_blue), #50abfb);
}

div#game_page.style_1990 {
  background-color: #80dedf;
  background: #80dedf;
}

div#game_page.style_2000 {
  background-color: #fcfba9;
  background: #fcfba9;
  background: linear-gradient(180deg, #efa17c, #fcfba9);
}

div#game_page > .topbar, div#game_page #user_actions { flex-shrink: 0; }

div#game {
  position: relative;
  box-sizing: border-box;  /* la marge du panneau animateur reste dans la largeur de l'écran */
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
}

div#game_grid {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  justify-content: center;
  align-items: center;
  min-height: 0;
  container-type: size;
}

div#letter_grid_section {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  min-height: 0;
  width: 100%;
}

div#letter_grid_placeholder {
  flex: 0 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

div#number_grids {
  display: flex;
  flex: 0 1 auto;
  min-height: 0;
  width: 100%;
  justify-content: center;
  align-items: center;
}

.number_grid_placeholder {
  width: 0;
  opacity: 0;
}

.number_grid_placeholder.active {
  width: unset;
  opacity: 1;
}


/* ========================================================================
   Barre de jeu et actions
   ======================================================================== */
div.topbar_game_buttons { display: flex; }

div.topbar_game_buttons > .topbar_button_group { margin: 0 10px; }

/* Actions d'animateur : cachées de la barre sauf réglage (Paramètres > Expérimental > Barre de jeu) */
body:not(.topbar_animator_actions) #topbar_button_bonus_letter,
body:not(.topbar_animator_actions) #topbar_button_display_solution,
body:not(.topbar_animator_actions) #topbar_button_word_reinit {
  display: none !important;
}

/* Ordinateur : libellé à côté de l'icône, barre moins haute (environ 56 px au lieu de 87) */
@media (min-width: 1025px) and (min-height: 561px) {
  #game_page .topbar { padding: 0.35rem 0.75rem; }

  #game_page .topbar_button_group {
    flex-direction: row;
    gap: 0.3rem;
  }

  #game_page .topbar img {
    height: 2.25rem;
    padding: 0.35rem;
  }
}

#user_actions {
  display: inline-flex;
  width: 200%;
  flex-direction: row;
  flex-wrap: nowrap;
  overflow-x: clip;
}

div.flex_section {
  display: flex;
  padding: 0px 10vw;
  justify-content: center;
  flex-wrap: wrap;
  align-content: center;
}

div#number_grid_interactions {
  display: flex;
  padding: 5px 0;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

div#number_grid_actions {
  width: 100vw;
  display: flex;
  align-items: center;
  justify-content: center;
}

div#number_grid_post_action {
  display: flex;
  align-items: center;    /* boutons à leur hauteur, même à côté de la vasque */
}

div#number_grid_random_selection_mode_section,
#number_grid_purgatory_placeholder {
  padding: 5px;
  border: 1px solid white;
  background-color: #ffffff61;
  border-radius: 5px;
  margin: 5px;
}

/* Purgatoire vide : rien à montrer (sinon un petit cadre vide reste visible sous les boutons) */
#number_grid_purgatory_placeholder:not(:has(.purgatory_number)) { display: none; }

span#number_grid_random_selection_left_indicator {
  text-wrap-mode: nowrap;
  font-weight: bold;
}

/* Téléphone : barre de jeu en icônes seules sur une ligne (libellés lus par les lecteurs d'écran),
   actions de la grille de numéros empilées */
@media (max-width: 480px) {
  #game_page .topbar { padding: 0.3rem 0.4rem; }

  #game_page .topbar img {
    height: 1.75rem;
    padding: 0.25rem;
  }

  #game_page .topbar_label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  div.topbar_game_buttons > .topbar_button_group { margin: 0 2px; }

  div#number_grid_interactions,
  div#number_grid_actions,
  div#number_grid_post_action {
    flex-direction: column;
    justify-content: center;
  }
}

/* Fenêtres peu hautes (téléphone à l'horizontale, petit portable) : barre haute et score compacts
   pour laisser la place à la grille. Les libellés restent lus par les lecteurs d'écran. */
@media (max-height: 560px) {
  #game_page .topbar { padding: 0.2rem 0.5rem; }

  #game_page .topbar img {
    height: 1.75rem;
    padding: 0.2rem;
  }

  #game_page .topbar_label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  #game_page .score {
    height: 2.5rem;
    font-size: 1.75rem;
  }

  #game_page #score_placeholder { margin-top: 4px; }
}


/* ========================================================================
   Vasque (mode de tirage « Vasque ») : canvas et boutons, sous la grille de numéros
   Couleurs des boules : grid.css. La zone d'actions est hors des conteneurs de grille :
   la grille de numéros garde sa taille (cq*) et rétrécit seulement selon la place restante.
   ======================================================================== */
.number_grid_vasque_section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 5px;
  margin: 5px;
  border: 1px solid white;
  border-radius: 5px;
  background-color: #ffffff61;
}

.vasque_container {
  width: clamp(9rem, 30vh, 20rem);
  aspect-ratio: 1 / 1;
}

.vasque_canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: manipulation;
}

.vasque_buttons {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
}

.vasque_left_indicator {
  font-weight: bold;
  text-align: center;
  white-space: nowrap;
}

/* Téléphone : boutons sous la vasque */
@media (max-width: 480px) {
  .number_grid_vasque_section { flex-direction: column; }

  .vasque_buttons { flex-direction: row; }
}

/* Écran peu haut : vasque plus petite pour laisser la place à la grille */
@media (max-height: 560px) {
  .vasque_container { width: clamp(7rem, 38vh, 12rem); }
}

/* Écran peu haut et large (téléphone à l'horizontale) : vasque à gauche de la grille, sur toute la hauteur
   de la zone de jeu, au lieu de dessous. Le panneau animateur reste à droite. */
@media (max-height: 560px) and (min-aspect-ratio: 3/2) {
  :root { --vasque_side_width: min(38vw, calc(100vh - 8rem)); }

  div#game:has(.number_grid_vasque_section:not(.d-none)) { padding-left: var(--vasque_side_width); }

  #game .number_grid_vasque_section {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--vasque_side_width);
    box-sizing: border-box;
    padding: 0.5rem;
    flex-direction: column;
    justify-content: center;
    gap: 0.4rem;
  }

  #game .vasque_container { width: 100%; }

  .vasque_buttons {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
  }
}


/* ========================================================================
   Indicateur de frappe
   ======================================================================== */
#word_typing_indicator {
  font-size: 2rem;
  color: white;
  background: black;
  font-family: monospace;
  letter-spacing: 5px;
  align-items: center;
}

div#word_typing_indicator_placeholder {
  display: flex;
  justify-content: center;
  margin-bottom: 5px;
  align-items: center;
}

/* Téléphone : progression plus petite (elle passe sous les scores si la largeur manque) */
@media (max-width: 480px) {
  #word_typing_indicator { font-size: 1.4rem; letter-spacing: 3px; }
}

/* Rangé à côté du score : caché pendant la grille de numéros (rien à taper) */
#game_grid:has(#letter_grid_section.d-none) #word_typing_indicator_placeholder { display: none; }


/* ========================================================================
   Clavier visuel
   ======================================================================== */
#keyboard {
  flex: 0 0 50%;  /* #user_actions fait 200 % : le clavier occupe exactement la largeur de la zone de jeu */
  margin: clamp(2px, 1vh, 10px) 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  transition: .125s;
  justify-content: center;
  align-items: center;
  border: none;
}

/* Aides à la saisie au-dessus du clavier : petits interrupteurs en pastille, distincts des icônes de la barre
   haute (allumé : fond blanc, éteint : contour seul) */
.keyboard_toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  width: min(100%, 44rem);
  box-sizing: border-box;
  padding: 0 0.4rem;
  margin-bottom: 0.3rem;
}

.keyboard_toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.6rem;
  border: 1px solid #ffffffb3;
  border-radius: 999px;
  background: #00000026;
  color: #fff;
  font: inherit;
  font-size: 0.8rem;
  font-weight: bold;
  cursor: pointer;
}

.keyboard_toggle:hover { background: #00000040; }

.keyboard_toggle[aria-pressed="true"] {
  background: #fff;
  border-color: #fff;
  color: #1a1f2b;
}

.keyboard_toggle[aria-pressed="true"]::after { content: "✓"; }

.keyboard_toggle_icon {
  font-family: monospace;
  letter-spacing: 1px;
}

.keyboard_toggle_colors { display: inline-flex; gap: 2px; }

.keyboard_toggle_colors i {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  background: var(--key_correct);
}

.keyboard_toggle_colors i:nth-child(2) { background: var(--key_wrong); border-radius: 50%; }

.keyboard_toggle_colors i:nth-child(3) { background: var(--key_missing); }

/* Le clavier prend la largeur disponible (plafonnée), touches de largeur égale :
   il se resserre quand le panneau animateur est ouvert au lieu de passer dessous */
#keyboard_placeholder { width: min(100%, 44rem); }

.keyboard_layer {
  width: 100%;
  font-size: 1.5rem;
  border-radius: .3rem;
  justify-content: center;
  align-items: center;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
}

.keyboard_key {
  background-color: white;
  border: none;
  color: inherit;
  cursor: pointer;
  /* Hauteur et police réduites sur les écrans peu hauts, pour laisser la place à la grille */
  min-width: 0;
  padding: clamp(0.2rem, 1.8vh, 1rem) 0;
  font-size: min(clamp(9px, 4vw, 25px), 3.5vh);
  border-radius: .3rem;
  font-weight: bold;
  font-family: monospace;
}

.keyboard_key:hover {
  /* Contour intérieur net au survol : pas de bordure, la taille de la touche ne change pas */
  border: none;
  box-shadow: inset 0 0 0 2px #000, 0 3px 2px 0 rgb(0 0 0 / 20%);
}

.keyboard_key_submit, .keyboard_key_remove {
  background-color: #b6deff;
  font-size: min(clamp(14px, 6vw, 32px), 4.5vh);  /* « ← » et « ↲ » lisibles */
  line-height: 1;
}

/* Téléphone à la verticale : la hauteur libérée par la grille (limitée par la largeur) va au clavier,
   touches d'au moins 44 px de haut, plus faciles à toucher */
@media (max-width: 480px) and (orientation: portrait) {
  .keyboard_layer { gap: 3px 0; }

  .keyboard_key {
    padding: clamp(0.65rem, 2.3vh, 1.25rem) 0;
    font-size: clamp(16px, 5vw, 22px);
  }
}

/* Clavier coloré (réglage « Clavier coloré selon les lettres », keyinput.js) : couleurs des cases de la grille,
   déclinées par style. Une lettre absente est aussi barrée : l'état ne repose pas que sur la couleur. */
#game_page {
  --key_correct: #e0242a;
  --key_correct_text: #fff;
  --key_wrong: #f7ce05;
  --key_wrong_text: #000;
  --key_missing: #8e9aa6;
  --key_missing_text: #2b3138;
}

#game_page.style_1990 { --key_correct: #d60063; --key_wrong: #ebd000; }

#game_page.style_2000 { --key_correct: #de562e; --key_wrong: #e0d50e; }

#game_page.style_2019 { --key_correct: #dd131a; --key_wrong: #ffd000; }

.keyboard_key.key_correct {
  background-color: var(--key_correct);
  color: var(--key_correct_text);
}

.keyboard_key.key_wrong {
  background: radial-gradient(circle, var(--key_wrong) 0 58%, #fff 60%);
  color: var(--key_wrong_text);
}

.keyboard_key.key_missing {
  background-color: var(--key_missing);
  color: var(--key_missing_text);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

/* Contraste renforcé : motif en plus de la couleur (contour plein, pointillé, barré) */
.high_contrast .keyboard_key.key_correct { box-shadow: inset 0 0 0 3px #000; }

.high_contrast .keyboard_key.key_wrong { box-shadow: inset 0 0 0 3px #000; outline: 2px dashed #000; outline-offset: -7px; }

.high_contrast .keyboard_key.key_missing { background-color: #3a3f45; color: #fff; }

/* Écran peu haut et large (téléphone à l'horizontale) : clavier visuel à droite de la grille, sur toute la
   hauteur de la zone de jeu, au lieu de dessous. Panneau animateur ouvert (à droite) : clavier à gauche.
   Le volet des numéros, voisin du clavier dans #user_actions, reste caché tant que le clavier est affiché. */
@media (max-height: 560px) and (min-aspect-ratio: 3/2) {
  :root { --keyboard_side_width: min(45vw, 26rem); }

  div#game:has(#keyboard:not(.hided)) { padding-right: var(--keyboard_side_width); }

  div#game.animator_open { --keyboard_side_width: min(30vw, 18rem); }

  div#game.animator_open:has(#keyboard:not(.hided)) {
    padding-left: var(--keyboard_side_width);
    padding-right: var(--animator_panel_width);
  }

  #user_actions:has(> #keyboard:not(.hided)) > #number_grid_interactions { display: none; }

  #game #keyboard:not(.hided) {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: var(--keyboard_side_width);
    margin: 0;
    padding: 0.4rem;
    box-sizing: border-box;
  }

  #game.animator_open #keyboard:not(.hided) { right: auto; left: 0; }

  #game #keyboard:not(.hided) .keyboard_toolbar { width: 100%; justify-content: center; }

  #game #keyboard:not(.hided) #keyboard_placeholder {
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.3rem;
  }

  #game #keyboard:not(.hided) .keyboard_layer { flex: 1 1 0; max-height: 5rem; }

  #game #keyboard:not(.hided) .keyboard_key {
    padding: 0;
    height: calc(100% - 4px);
    font-size: clamp(13px, 2.4vw, 20px);
  }
}

#keyboard.hided {
  transform: translate(-50vh, 0);
  flex-basis: 0;
  width: 0;
  padding: 0;
  height: 0;
  margin: 0;
  overflow: hidden;
  visibility: hidden;
}


/* ========================================================================
   Message de jeu et chronomètre
   ======================================================================== */
/* Bandeau des messages de jeu : ancre sans hauteur entre les grilles et le score,
   le bandeau s'affiche par-dessus le bas de la grille sans décaler la mise en page */
#game_message_anchor {
  position: relative;
  height: 0;
  width: 100%;
  z-index: 5;
}

.game_message {
  position: absolute;
  bottom: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90vw;
  padding: 0.5rem 1rem;
  border-radius: 0.4rem;
  background-color: #000000d9;
  color: #fff;
  font-weight: bold;
  font-size: clamp(0.9rem, 2.2vh, 1.25rem);
  text-align: center;
  box-shadow: 0 2px 8px #00000066;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.game_message.visible {
  opacity: 1;
  visibility: visible;
}

/* Chronomètre (compte à rebours d'une proposition), à côté du score */
.proposal_timer {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 3.5rem;
  margin: 0 1vw;
  padding: 0 0.5rem;
  border-radius: 0.4rem;
  background-color: #000000b3;
  color: #fff;
  font-weight: bold;
  font-size: clamp(1.5rem, 4vh, 2.5rem);
  font-variant-numeric: tabular-nums;
}

.proposal_timer.urgent { background-color: #c0001a; }


/* ========================================================================
   Fenêtre « Nombre de lettres du prochain mot »
   ======================================================================== */
/* Fenêtre « Nombre de lettres du prochain mot » */
.word_length_dialog {
  border: none;
  border-radius: 0.5rem;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 3px 12px #0000004d;
}

.word_length_dialog::backdrop { background-color: #00000080; }

.word_length_dialog h2 { margin-top: 0; }

.word_length_choices {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.word_length_choices button {
  min-width: 3.5rem;
  font-size: 1.5rem;
  font-weight: bold;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

/* Touche du clavier sous chaque nombre */
.word_length_choices button kbd {
  font-size: 0.85rem;
  font-weight: normal;
  padding: 0 0.35rem;
  border-radius: 3px;
  background-color: #ffffff33;
  border: 1px solid #ffffff80;
}


/* ========================================================================
   Panneau animateur
   ======================================================================== */
:root { --animator_panel_width: min(24rem, 40vw); }

/* Panneau ouvert : la grille et le clavier se recentrent sur la place restante (grilles en cq*) */
div#game.animator_open { padding-right: var(--animator_panel_width); }

.animator_panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--animator_panel_width);
  box-sizing: border-box;
  overflow-y: auto;
  padding: 0.75rem 1rem 1rem;
  background-color: #fff;
  color: #1a1a1a;
  box-shadow: -3px 0 10px #0000004d;
  font-size: 0.95rem;
  z-index: 10;
}

.animator_panel_header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.animator_panel h2 {
  margin: 0;
  font-size: 1.25rem;
}

.animator_panel h3 {
  margin: 0.9rem 0 0.25rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #555;
}

.animator_panel p { margin: 0.2rem 0; }

.animator_word {
  font-family: monospace;
  font-size: 2rem;
  font-weight: bold;
  letter-spacing: 0.15em;
  color: #A52A2E;
  word-break: break-all;
}

.animator_close {
  background: none;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  color: inherit;
}

.animator_actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.animator_actions button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
  text-align: left;
  color: inherit;
  background-color: #f2f2f2;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
}

.animator_actions button:hover:not(:disabled) { background-color: #e4e4e4; }

.animator_actions button:disabled {
  opacity: 0.5;
  cursor: default;
}

.animator_actions kbd {
  font-size: 0.75rem;
  line-height: 1.4;
}

/* Panneau animateur : grille de numéros cliquable */
.animator_ball_grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.3rem;
  max-width: 16rem;
  margin: 0.4rem 0;
}

.animator_ball {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: none;
  font-weight: bold;
  font-size: 1rem;
  font-family: inherit;
  padding: 0;
}

button.animator_ball {
  cursor: pointer;
  box-shadow: inset 0 -3px 0 #00000033;
}

button.animator_ball:hover:not(:disabled) { box-shadow: inset 0 0 0 3px #000; }

button.animator_ball:disabled {
  cursor: default;
  opacity: 0.55;
}

.animator_ball_yellow {
  background-color: #FBC800;
  color: #000;
}

.animator_ball_blue {
  background-color: #1681C7;
  color: #fff;
}

/* Boule magique : anneau violet en pointillés */
.animator_ball_saving {
  outline: 3px dashed #7b2fbf;
  outline-offset: 2px;
}

.animator_ball_drawn {
  color: #999;
  border: 2px dashed #bbb;
  text-decoration: line-through;
  font-size: 0.85rem;
}

.animator_ball_placed { background-color: #e6e6e6; }

/* Grille de l'équipe qui n'a pas la main : plus petite, en lecture seule */
.animator_ball_grid_small { max-width: 11rem; gap: 0.2rem; }

.animator_ball_grid_small .animator_ball { font-size: 0.8rem; }

.animator_ball_actions {
  display: flex;
  gap: 0.35rem;
  margin: 0.25rem 0;
}

.animator_ball_actions button {
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #f2f2f2;
  color: inherit;
  cursor: pointer;
}

.animator_ball_actions button.animator_black_ball {
  background-color: #1a1a1a;
  border-color: #1a1a1a;
  color: #fff;
}

.animator_ball_actions button:disabled {
  opacity: 0.5;
  cursor: default;
}

.animator_hint {
  color: #666;
  font-style: italic;
}

.animator_unlock_button {
  margin: 0.25rem 0;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  font-weight: bold;
  color: #fff;
  background-color: #7b2fbf;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.animator_unlock_button:hover { background-color: #5f2196; }

/* Grand écran : panneau un peu plus large */
@media (min-width: 1440px) {
  :root { --animator_panel_width: 28rem; }
}

/* Grand téléphone ou tablette à la verticale : le panneau occupe le bas de l'écran par-dessus le jeu.
   À l'horizontale il reste sur le côté, la grille garde ainsi toute la hauteur. */
@media (max-width: 768px) and (orientation: portrait) {
  div#game.animator_open { padding-right: 0; }

  .animator_panel {
    top: auto;
    width: 100%;
    height: 55%;
    box-shadow: 0 -3px 10px #0000004d;
  }
}

/* Téléphone à la verticale : panneau sur toute la zone de jeu (sous la barre haute, qui reste utilisable),
   au lieu de masquer le clavier à moitié ; la croix ou la touche 7 le referme */
@media (max-width: 480px) and (orientation: portrait) {
  .animator_panel {
    top: 0;
    height: 100%;
    box-shadow: none;
  }
}


/* ========================================================================
   Fenêtre publique (?vue=public)
   ======================================================================== */
body.public_view .page:not(#game_page),
body.public_view #game_page > .topbar,
body.public_view #user_actions,
body.public_view #animator_panel {
  display: none !important;
}

body.public_view #game_page { display: flex !important; }

/* Score décollé du bas de l'écran (pas de clavier sous la grille dans la fenêtre publique) */
body.public_view #score_placeholder { margin-bottom: clamp(0.5rem, 2vh, 1.5rem); }

/* Vasque recopiée (mode de tirage « Vasque ») : à droite de la grille, aussi haute que possible */
.public_vasque_section { display: none; }

body.public_view .public_vasque_section:not(.d-none) {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

body.public_view #game.public_vasque_open { flex-direction: row; }

body.public_view #game.public_vasque_open #game_grid { min-width: 0; }

body.public_view .public_vasque_section .vasque_container { width: min(85vh, 42vw); }

/* Écran public à la verticale : vasque sous la grille */
@media (orientation: portrait) {
  body.public_view #game.public_vasque_open { flex-direction: column; }

  body.public_view .public_vasque_section .vasque_container { width: min(40vh, 80vw); }
}

.public_sound_notice {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 0.4rem;
  background-color: #000000d9;
  color: #fff;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
}
