/* Île en chute — genere par Evolutus (genre « chute ») */
:root {
  --fond: #0b4f6c;
  --fond-2: #01283a;
  --texte: #ffffff;
  --texte-doux: #d7f2f4;
  --accent: #ffd166;
  --bouton: #0e3a4e;
  --bouton-bord: #7fd6e0;
  --haut-commandes: 88px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--fond-2); color: var(--texte);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
body { display: flex; flex-direction: column; padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); }
.barre { display: flex; align-items: center; gap: 12px; padding: 8px 12px; min-height: 56px;
  background: linear-gradient(180deg, rgba(1, 40, 58, 0.95), rgba(1, 40, 58, 0.6)); z-index: 2; }
.score-bloc { display: flex; flex-direction: column; min-width: 64px; }
.etiquette { font-size: 12px; color: var(--texte-doux); text-transform: uppercase; letter-spacing: 0.06em; }
.score-bloc strong { font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ile-bloc strong { font-size: 16px; color: var(--accent); }
.boutons { margin-left: auto; display: flex; gap: 8px; }
.boutons button { min-width: 44px; min-height: 44px; border-radius: 12px; border: 2px solid var(--bouton-bord);
  background: var(--bouton); color: var(--texte); font-size: 18px; font-weight: 700; cursor: pointer; }
.boutons button:focus-visible, .principal:focus-visible, .commande:focus-visible, canvas:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
main { position: relative; flex: 1; min-height: 0; }
canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* commandes au pouce : 4 gros boutons sous la grille (portrait) */
.commandes { display: flex; justify-content: space-between; align-items: center; gap: 8px; height: var(--haut-commandes);
  padding: 8px max(10px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-bottom)); background: rgba(1, 40, 58, 0.85); z-index: 2; }
.paire { display: flex; gap: 10px; }
.commande { width: 70px; height: 70px; border-radius: 20px; border: 2px solid var(--bouton-bord); background: var(--bouton); color: var(--texte);
  font-size: 30px; font-weight: 800; line-height: 1; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; padding: 0; }
.commande:active, .commande.appuye { background: #1b6a86; transform: scale(0.96); }
#c-tourner { background: #3a2f63; border-color: #c79bff; }
#c-bas { background: #5a4310; border-color: var(--accent); }

.lecteur { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.panneau { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(92vw, 420px); max-height: 92vh; overflow-y: auto;
  background: rgba(1, 40, 58, 0.97); border: 2px solid var(--bouton-bord); border-radius: 20px; padding: 22px; text-align: center; z-index: 5;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.panneau[hidden] { display: none; }
.panneau h2 { margin: 0 0 8px; font-size: 26px; }
.panneau p { color: var(--texte-doux); line-height: 1.45; }
.gros { font-size: 48px; font-weight: 800; color: var(--accent) !important; margin: 4px 0; }
.petit { font-size: 14px; }
.principal { min-height: 48px; padding: 0 28px; border-radius: 14px; border: 0; background: var(--accent); color: #102a33;
  font-size: 18px; font-weight: 800; cursor: pointer; }

@media (max-width: 380px) {
  .barre { gap: 6px; padding: 6px 8px; }
  .score-bloc { min-width: 52px; }
  .score-bloc strong { font-size: 18px; }
  .ile-bloc { display: none; }
  .commande { width: 66px; height: 66px; }
  .paire { gap: 8px; }
}
/* paysage bas (telephone couche) : les boutons passent sur les cotes de la grille */
@media (orientation: landscape) and (max-height: 520px) {
  .commandes { position: fixed; left: 0; right: 0; bottom: 0; height: auto; background: none; pointer-events: none;
    padding: 0 max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  .paire { pointer-events: auto; }
  .commande { width: 62px; height: 62px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } .commande:active, .commande.appuye { transform: none; } }
