/* =====================================================================
 *  Bourg-Pixel — styles
 *  Palette tirée du jeu : herbe, toit rouge, tunique bleue, cheveux blonds
 * ===================================================================== */
:root {
  --ink: #23203a;
  --paper: #fffdf6;
  --paper-edge: #d9d3c0;
  --grass: #86cf5a;
  --grass-dark: #62ad3e;
  --grass-light: #a8e07a;
  --roof: #d9534a;
  --roof-dark: #a8362f;
  --tunic: #3b6fd8;
  --hair: #f8d65c;
  --forest: #17240f;
  --error: #b8322a;
  --ok: #2d7d46;
  --pixel: 'Pixelify Sans', 'Trebuchet MS', system-ui, sans-serif;
  --text: system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--text); color: var(--ink); line-height: 1.5; }

:focus-visible { outline: 3px solid var(--hair); outline-offset: 2px; }

/* ---------------------------------------------------------------------
 *  Pages d'authentification : la carte est une boîte de dialogue de jeu
 * ------------------------------------------------------------------- */
body.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--grass);
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
body.auth-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 14px 18px, var(--grass-dark) 2px, transparent 2.5px),
    radial-gradient(circle at 46px 40px, var(--grass-dark) 2px, transparent 2.5px),
    radial-gradient(circle at 30px 8px, var(--grass-light) 1.5px, transparent 2px),
    var(--grass);
  background-size: 64px 56px;
  image-rendering: pixelated;
}

.auth { width: 100%; max-width: 440px; }

.auth-card {
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 10px;
  box-shadow:
    inset 0 0 0 3px var(--paper),
    inset 0 0 0 6px var(--tunic),
    0 8px 0 rgba(23, 36, 15, 0.35);
  padding: 14px 26px 26px;
}

.scene {
  display: block;
  width: calc(100% + 24px);
  margin: 0 -12px 14px;
  aspect-ratio: 240 / 96;
  height: auto;
  image-rendering: pixelated;
  border: 3px solid var(--ink);
  border-radius: 4px;
  background: var(--grass);
}

.game-name {
  font-family: var(--pixel);
  font-weight: 700;
  font-size: 1rem;
  color: var(--roof);
  margin: 0;
  letter-spacing: 0.02em;
}

.auth-card h1 {
  font-family: var(--pixel);
  font-weight: 600;
  font-size: 2rem;
  line-height: 1.1;
  margin: 0 0 18px;
}

.intro { margin: 0 0 16px; }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-family: var(--pixel);
  font-size: 1.05rem;
  margin-bottom: 4px;
}
.field input {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 6px;
  transition: border-color 0.1s;
}
.field input:focus { outline: none; border-color: var(--tunic); box-shadow: 0 0 0 3px rgba(59, 111, 216, 0.25); }
.field.has-error input { border-color: var(--error); }

.hint, .field-error { margin: 5px 0 0; font-size: 0.875rem; }
.hint { color: #625d78; }
.field-error { color: var(--error); font-weight: 600; }

.btn {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 16px;
  font-family: var(--pixel);
  font-weight: 600;
  font-size: 1.2rem;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background: var(--roof);
  border: 3px solid var(--ink);
  border-radius: 6px;
  box-shadow: inset 0 -4px 0 var(--roof-dark), 0 4px 0 var(--ink);
  cursor: pointer;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(3px); box-shadow: inset 0 -2px 0 var(--roof-dark), 0 1px 0 var(--ink); }

.alert {
  border: 3px solid;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 16px;
  font-size: 0.95rem;
}
.alert p { margin: 0; }
.alert p + p { margin-top: 4px; }
.alert-error { border-color: var(--error); background: #fdeeea; }
.alert-success { border-color: var(--ok); background: #eaf7ee; }
.alert-info { border-color: var(--tunic); background: #edf2fd; }

.links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 22px;
  font-size: 0.95rem;
}
.links a { color: var(--tunic); font-weight: 600; }

/* ---------------------------------------------------------------------
 *  Utilitaires
 * ------------------------------------------------------------------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }

/* ---------------------------------------------------------------------
 *  Sélecteur d'apparence (inscription + menu du jeu)
 * ------------------------------------------------------------------- */
.look {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px 12px 4px;
  background: #f3eedd;
  border: 3px solid var(--ink);
  border-radius: 8px;
}
.look-preview {
  width: 228px;
  max-width: 100%;
  aspect-ratio: 76 / 20;
  height: auto;
  image-rendering: pixelated;
}
.look-groups { width: 100%; }
.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  border: 0;
  margin: 0 0 10px;
  padding: 0;
}
.swatches legend {
  font-family: var(--pixel);
  font-size: 1.05rem;
  margin-bottom: 5px;
  padding: 0;
}
.swatches legend span { color: #625d78; }
.swatch-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatch {
  width: 30px;
  height: 30px;
  border: 3px solid var(--ink);
  border-radius: 6px;
  background: linear-gradient(135deg, var(--c) 58%, var(--d) 58%);
  cursor: pointer;
}
.swatch-input:checked + .swatch { box-shadow: 0 0 0 3px #f3eedd, 0 0 0 6px var(--ink); }
.swatch-input:focus-visible + .swatch { outline: 3px solid var(--tunic); outline-offset: 5px; }

/* ---------------------------------------------------------------------
 *  Page du jeu : plein écran
 * ------------------------------------------------------------------- */
body.game-page {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--forest);
  color: var(--ink);
  -webkit-user-select: none;
  user-select: none;
}

#game {
  position: fixed;
  top: 0;
  left: 0;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
}

/* Pseudos au-dessus des autres joueurs */
.tags { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.tag {
  position: absolute;
  left: 0;
  top: 0;
  padding: 2px 7px 3px;
  font-family: var(--pixel);
  font-size: 14px;
  line-height: 1.1;
  white-space: nowrap;
  color: #fff;
  background: rgba(23, 32, 15, 0.72);
  border-radius: 4px;
}

/* Bouton d'ouverture du menu */
.menu-btn {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  font-family: var(--pixel);
  font-size: 1.1rem;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 8px;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
}
.menu-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.menu-btn kbd {
  font-family: var(--pixel);
  font-size: 0.8rem;
  padding: 0 5px;
  background: #ece6d3;
  border: 2px solid var(--ink);
  border-radius: 4px;
}
body.menu-open .menu-btn { visibility: hidden; }

/* Notification « Tu as trouvé… » */
.toast {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  font-family: var(--pixel);
  font-size: 1.15rem;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 8px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
  pointer-events: none;
  width: max-content;
  max-width: min(92vw, 560px);
  text-align: center;
}
/* Sur la patinoire, le tableau des scores occupe le haut : les messages se placent dessous */
body.has-rink-hud .toast { top: calc(var(--rink-hud-bottom, 66px) + 10px); }
.toast.show { animation: toast-in 0.25s ease-out; }
@keyframes toast-in { from { transform: translate(-50%, -14px); opacity: 0; } }

/* Fondu entre deux cartes */
.fade {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.26s ease;
}
.fade.on { opacity: 1; }

/* Nom du lieu à l'arrivée sur une carte */
.place {
  position: fixed;
  top: calc(max(14px, env(safe-area-inset-top)) + 40px);   /* sous les cœurs */
  left: max(14px, env(safe-area-inset-left));
  padding: 6px 14px;
  font-family: var(--pixel);
  font-size: 1.25rem;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 8px;
  box-shadow: inset 0 0 0 2px var(--paper), inset 0 0 0 4px var(--grass-dark), 0 4px 0 rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.place.show { animation: place-in 2.4s ease both; }
@keyframes place-in {
  0% { transform: translateY(-16px); opacity: 0; }
  10%, 80% { transform: none; opacity: 1; }
  100% { transform: translateY(-8px); opacity: 0; }
}

/* Boîte de dialogue (panneaux, portes, villageois) */
.dialog {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(92vw, 680px);
  min-height: 96px;
  padding: 16px 44px 16px 20px;
  background: var(--paper);
  color: var(--ink);
  border: 4px solid var(--ink);
  border-radius: 10px;
  box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 6px var(--tunic), 0 6px 0 rgba(0, 0, 0, 0.4);
  font-family: var(--pixel);
  font-size: 1.3rem;
  line-height: 1.45;
}
.dialog p { margin: 0; }
.dialog .dialog-name {
  position: absolute;
  top: -20px;
  left: 16px;
  padding: 2px 12px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  background: var(--tunic);
  border: 3px solid var(--ink);
  border-radius: 6px;
}
.dialog-next {
  position: absolute;
  right: 16px;
  bottom: 10px;
  color: var(--roof);
  font-size: 1rem;
  visibility: hidden;
}
.dialog.done .dialog-next { visibility: visible; animation: nudge 0.8s steps(2) infinite; }
@keyframes nudge { 50% { transform: translateY(3px); } }

/* ---------------------------------------------------------------------
 *  Menu (façon menu « Start »)
 * ------------------------------------------------------------------- */
.menu {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 16px;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 12px 12px;
  background: rgba(15, 24, 9, 0.45);
}

.menu-box, .panel {
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 10px;
  box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 6px var(--tunic), 0 6px 0 rgba(0, 0, 0, 0.4);
}

.menu-box { width: 270px; padding: 14px 12px 12px; flex-shrink: 0; }

.menu-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px 10px;
  margin-bottom: 8px;
  border-bottom: 3px dotted var(--paper-edge);
}
.menu-card canvas { width: 60px; height: 60px; margin: -6px -4px; image-rendering: pixelated; }
.menu-card p {
  margin: 0;
  font-family: var(--pixel);
  font-weight: 600;
  font-size: 1.3rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-list { display: flex; flex-direction: column; }
.menu-list button {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  padding: 6px 10px 6px 30px;
  font-family: var(--pixel);
  font-size: 1.35rem;
  text-align: left;
  color: var(--ink);
  background: none;
  border: 0;
  border-radius: 6px;
  white-space: nowrap;
  cursor: pointer;
}
/* Le curseur ▶ des vieux RPG */
.menu-list button:hover::before,
.menu-list button:focus-visible::before,
.menu-list button.active::before {
  content: "▶";
  position: absolute;
  left: 9px;
  font-size: 0.85rem;
  color: var(--roof);
}
.menu-list button:hover, .menu-list button:focus-visible, .menu-list button.active { background: #eef1fb; outline: none; }
.menu-list [data-action="logout"] { margin-top: 6px; border-top: 3px dotted var(--paper-edge); border-radius: 0 0 6px 6px; }
.count {
  margin-left: auto;
  min-width: 26px;
  padding: 0 6px;
  font-size: 1rem;
  text-align: center;
  background: var(--grass);
  border: 2px solid var(--ink);
  border-radius: 10px;
}

/* Fenêtres du menu */
.panel {
  order: -1;
  width: min(560px, calc(100vw - 330px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 18px 22px 22px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.panel h2 { margin: 0; font-family: var(--pixel); font-weight: 600; font-size: 1.8rem; }
.panel-empty { margin: 0 0 8px; color: #625d78; }

.btn-small {
  font-family: var(--pixel);
  font-size: 1rem;
  padding: 5px 12px;
  color: var(--ink);
  background: #f3eedd;
  border: 3px solid var(--ink);
  border-radius: 6px;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
}
.btn-small:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.panel-back {
  font-family: var(--pixel);
  font-size: 1rem;
  padding: 5px 12px;
  color: var(--ink);
  background: #f3eedd;
  border: 3px solid var(--ink);
  border-radius: 6px;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
}

/* Sac */
.bag { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 10px; }
.slot {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: #f3eedd;
  border: 3px solid var(--ink);
  border-radius: 8px;
  cursor: pointer;
}
.slot canvas { width: 48px; height: 48px; image-rendering: pixelated; }
.slot .qty { position: absolute; right: 5px; bottom: 1px; font-family: var(--pixel); font-size: 1rem; }
.slot.selected { background: #eaf0ff; border-color: var(--tunic); box-shadow: 0 0 0 3px rgba(59, 111, 216, 0.3); }
.slot:focus-visible { outline: 3px solid var(--hair); outline-offset: 2px; }
.bag-detail {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 3px dotted var(--paper-edge);
}
.bag-detail canvas { width: 64px; height: 64px; flex-shrink: 0; image-rendering: pixelated; }
.bag-detail h3 { margin: 0 0 4px; font-family: var(--pixel); font-size: 1.35rem; }
.bag-detail p { margin: 0; }

/* Équipement */
.equip { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.equip-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: #eaf0ff;
  border: 3px solid var(--tunic);
  border-radius: 8px;
}
.equip-slot.empty { background: #f3eedd; border-color: var(--paper-edge); border-style: dashed; }
.equip-slot canvas { width: 40px; height: 40px; flex-shrink: 0; image-rendering: pixelated; }
.equip-slot span { display: flex; flex-direction: column; line-height: 1.2; }
.equip-slot strong { font-family: var(--pixel); font-size: 1.05rem; }
.equip-slot.empty span span { color: #625d78; }
.slot .worn {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0 5px;
  font-family: var(--pixel);
  font-size: 0.8rem;
  color: #fff;
  background: var(--tunic);
  border: 2px solid var(--ink);
  border-radius: 5px;
}
.bag-equip { margin-top: 10px; }
.bag-equip:disabled { opacity: 0.6; }

/* Apparence */
.look-form .look { margin-bottom: 14px; }
.look-actions { display: flex; flex-direction: column; gap: 8px; }
.look-status { margin: 0; min-height: 1.5em; font-size: 0.95rem; color: var(--ok); }

/* Joueurs */
.players { list-style: none; margin: 0 0 8px; padding: 0; }
.players li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 4px;
  font-family: var(--pixel);
  font-size: 1.25rem;
  border-bottom: 2px dotted var(--paper-edge);
}
.players canvas { width: 44px; height: 44px; margin: -4px; image-rendering: pixelated; }
.players .who { display: flex; flex-direction: column; line-height: 1.15; }
.players .who small { font-family: var(--text); font-size: 0.85rem; color: #625d78; }
.players em {
  font-style: normal;
  font-size: 0.9rem;
  padding: 0 7px;
  background: var(--hair);
  border: 2px solid var(--ink);
  border-radius: 6px;
}

/* Paramètres */
.setting { border: 0; padding: 0; margin: 0 0 18px; }
.setting legend, .setting-title { font-family: var(--pixel); font-size: 1.15rem; margin: 0 0 6px; padding: 0; }
.setting-title { margin-top: 6px; font-weight: 600; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.segmented { display: flex; border: 3px solid var(--ink); border-radius: 8px; overflow: hidden; }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented label {
  flex: 1;
  padding: 7px 6px;
  font-family: var(--pixel);
  font-size: 1.05rem;
  text-align: center;
  cursor: pointer;
  background: #fff;
}
.segmented label + input + label { border-left: 3px solid var(--ink); }
.segmented input:checked + label { background: var(--tunic); color: #fff; }
.segmented input:focus-visible + label { outline: 3px solid var(--hair); outline-offset: -5px; }
.toggle {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex-shrink: 0;
  width: 52px;
  height: 30px;
  margin: 0;
  background: #d9d3c0;
  border: 3px solid var(--ink);
  border-radius: 15px;
  cursor: pointer;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 50%;
  transition: transform 0.12s;
}
.toggle:checked { background: var(--grass); }
.toggle:checked::after { transform: translateX(22px); }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 0; }
.keys dt { font-family: var(--pixel); font-size: 1.05rem; }
.keys dd { margin: 0; }

/* ---------------------------------------------------------------------
 *  Contrôles tactiles (écran tactile uniquement)
 * ------------------------------------------------------------------- */
.touch { display: none; }

@media (pointer: coarse) {
  .menu-btn kbd { display: none; }
  .touch {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 22px max(18px, env(safe-area-inset-bottom));
    pointer-events: none;
  }
  .dpad, .btn-a, .btn-b { pointer-events: auto; }
  .touch-btns { display: flex; align-items: flex-end; gap: 14px; }
  .dpad { display: grid; grid-template: repeat(3, 54px) / repeat(3, 54px); }
  .dpad button, .btn-a, .btn-b {
    font-family: var(--pixel);
    color: #fff;
    background: rgba(23, 32, 15, 0.55);
    border: 3px solid rgba(0, 0, 0, 0.7);
    touch-action: none;
  }
  .dpad button { font-size: 1.1rem; border-radius: 8px; }
  .dpad button:active { background: rgba(23, 32, 15, 0.8); }
  .dpad .up { grid-area: 1 / 2; }
  .dpad .left { grid-area: 2 / 1; }
  .dpad .right { grid-area: 2 / 3; }
  .dpad .down { grid-area: 3 / 2; }
  .btn-a {
    width: 76px;
    height: 76px;
    margin-bottom: 20px;
    font-size: 1.8rem;
    font-weight: 700;
    border-radius: 50%;
    background: rgba(217, 83, 74, 0.85);
  }
  .btn-a:active { background: var(--roof-dark); }
  /* B : frapper, visible seulement avec une arme équipée */
  .btn-b {
    display: none;
    width: 62px;
    height: 62px;
    margin-bottom: 4px;
    font-size: 1.5rem;
    font-weight: 700;
    border-radius: 50%;
    background: rgba(59, 111, 216, 0.85);
  }
  body.has-weapon .btn-b { display: block; }
  .btn-b:active { background: #2a4c9e; }
  body.menu-open .touch { display: none; }
  .dialog { bottom: calc(190px + env(safe-area-inset-bottom)); }
}

/* Petits écrans : la fenêtre ouverte recouvre le menu */
@media (max-width: 760px) {
  .panel {
    position: fixed;
    inset: max(10px, env(safe-area-inset-top)) 10px 10px;
    width: auto;
    max-height: none;
  }
  .auth-card { padding: 12px 18px 22px; }
  .auth-card h1 { font-size: 1.7rem; }
  .dialog { font-size: 1.1rem; }
  .toast { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .dialog.done .dialog-next, .toast.show, .place.show { animation: none; }
  .fade { transition: none; }
  .toggle::after { transition: none; }
}

/* Joueur dont l'onglet est en arrière-plan */
.tag.away { opacity: 0.6; }
.tag.away::after { content: ' · absent'; font-size: 0.8em; }

/* Cœurs (points de vie) */
.hearts {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  height: 30px;
  image-rendering: pixelated;
  pointer-events: none;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.45));
}
.hearts.hit { animation: hearts-hit 0.4s ease; }
@keyframes hearts-hit {
  0%, 100% { transform: none; }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}
body.menu-open .hearts { display: none; }
@media (prefers-reduced-motion: reduce) {
  .hearts.hit { animation: none; }
}

/* Patinoire : tableau des scores et annonce des buts */
.rink-hud {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px 16px;
  font-family: var(--pixel);
  font-size: 1.15rem;
  color: #fff;
  background: rgba(23, 32, 15, 0.82);
  border: 3px solid #fff;
  border-radius: 10px;
  pointer-events: none;
}
.rink-hud b { font-size: 1.4rem; margin: 0 2px; }
.rink-hud { white-space: nowrap; }
@media (max-width: 520px) { .rink-hud { top: calc(max(14px, env(safe-area-inset-top)) + 50px); font-size: 0.95rem; padding: 4px 10px; gap: 6px; } .rink-hud b { font-size: 1.15rem; } }   /* sous les cœurs et le menu */
.rink-hud .blue b { color: #9cc0ff; }
.rink-hud .red b { color: #ff9a92; }
.goal-banner {
  position: fixed;
  left: 50%;
  top: 34%;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 14px 28px 16px;
  font-family: var(--pixel);
  color: #fff;
  border: 4px solid #fff;
  border-radius: 14px;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35);
  pointer-events: none;
  animation: goal-pop 0.45s cubic-bezier(.2, 1.6, .4, 1);
}
.goal-banner strong { font-size: clamp(2.4rem, 8vw, 4rem); line-height: 1; letter-spacing: 0.04em; }
.goal-banner span { font-size: 1.1rem; }
.goal-banner.blue { background: #2a4c9e; }
.goal-banner.red { background: #b8322a; }
@keyframes goal-pop { from { transform: translate(-50%, -50%) scale(0.4); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .goal-banner { animation: none; } }
body.menu-open .rink-hud { display: none; }
