* { box-sizing: border-box; }
body { margin: 0; background: #eef2f7; color: #172033; font: 1rem system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
header { background: #fff; border-bottom: 1px solid #d8dee8; padding: 18px; text-align: center; }
h1 { margin: 0 0 5px; font-size: clamp(1.375rem, 4vw, 2.125rem); }
header p, .help, .mobile-help { color: #4c586b; line-height: 1.5; }
header p { margin: 0; }
main { max-width: 1555px; margin: auto; padding: 14px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
button { border: 0; border-radius: 9px; min-height: 44px; padding: 10px 14px; font: inherit; font-weight: 700; cursor: pointer; background: #173b70; color: #fff; touch-action: manipulation; }
button.secondary { background: #dfe6f0; color: #172033; }
button:focus-visible, .board-scroll:focus-visible { outline: 3px solid #173b70; outline-offset: 3px; }
#direction[aria-pressed="true"] { background: #173b70; color: #fff; }
#status { margin-left: auto; font-size: .875rem; color: #4c586b; }
.help { margin: 8px 0; font-size: .875rem; }
.mobile-help { display: none; font-size: .875rem; }
.board-scroll { width: 100%; overflow-x: auto; }
/* The image and hit targets share the original image coordinate system. */
.board { position: relative; width: 100%; min-width: 700px; margin: 0 auto; aspect-ratio: 1555 / 1012; overflow: hidden; }
.board-image { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; user-select: none; -webkit-user-drag: none; }
/* Ligne 8 colonne 1 : masque le jaune pour obtenir une case blanche, sans flèche. */
.board::after {
  content: "";
  position: absolute;
  left: 1.9293%;
  top: 76.8775%;
  width: 6.8167%;
  height: 10.5731%;
  background: #fff;
  pointer-events: none;
}
.play-grid { position: absolute; inset: 0; pointer-events: none; }
.cell { position: absolute; min-width: 0; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; outline: none; text-align: center; font: 800 clamp(1rem, 2.5vw, 2rem) / 1 Arial, Helvetica, sans-serif; color: #172033; text-transform: uppercase; cursor: text; pointer-events: auto; touch-action: manipulation; appearance: none; -webkit-appearance: none; caret-color: #173b70; }
.cell.in-word { background: rgba(88, 150, 235, .16); }
.cell.correct {
  /* Le vert est appliqué aux lettres : le fond original, notamment les cases jaunes, reste visible. */
  background: transparent;
  color: #07883f;
  font-weight: 900;
  text-shadow: 0 0 1px rgba(0, 90, 35, .35);
}
.cell.wrong { background: rgba(240, 107, 107, .32); }
/* Selection stays visible after checking answers. */
.cell:focus { z-index: 2; background: rgba(255, 238, 112, .7); box-shadow: inset 0 0 0 3px #173b70; }
/* La case ligne 8, colonne 1 reste blanche dans tous les états. */
.cell[data-r="7"][data-c="0"],
.cell[data-r="7"][data-c="0"].in-word,
.cell[data-r="7"][data-c="0"].correct,
.cell[data-r="7"][data-c="0"].wrong,
.cell[data-r="7"][data-c="0"]:focus {
  background: #fff !important;
}
@media (max-width: 700px) {
  main { padding: 8px; }
  #status { width: 100%; margin-left: 0; }
  .mobile-help { display: block; margin: 8px 0; }
}
@media print {
  header, .toolbar, .help, .mobile-help { display: none; }
  body { background: #fff; }
  main { padding: 0; }
  .board-scroll { overflow: visible; }
  .board { width: 100%; min-width: 0; max-width: none; }
  .cell { display: none; }
}
