/* =============================================================================
   Jeu de l'Oie : style harmonisé avec la charte Sacripland (Compact sans scroll)
   ============================================================================= */
:root {
  --bg: #F4F5F8;
  --surface: #FFFFFF;
  --fg: #1A1E29;
  --muted: #667085;
  --line: #D6DAE3;
  --accent: #2D5BE3;
  --accent-text: #FFFFFF;
  --ok: #1F8A5B;
  --warn: #E2552B;
  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12151C;
    --surface: #1B2030;
    --fg: #E8EAF0;
    --muted: #98A2B3;
    --line: #2C3345;
    --accent: #7C9BFF;
    --accent-text: #12151C;
    --ok: #5FD3A0;
    --warn: #FF8A65;
  }
}

:root[data-theme="dark"] {
  --bg: #12151C;
  --surface: #1B2030;
  --fg: #E8EAF0;
  --muted: #98A2B3;
  --line: #2C3345;
  --accent: #7C9BFF;
  --accent-text: #12151C;
  --ok: #5FD3A0;
  --warn: #FF8A65;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 15px/1.3 var(--font);
  padding: 8px 12px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.wrap {
  max-width: min(440px, 96vw);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

button, a { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }

.retour {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
}
.retour a { color: var(--muted); text-decoration: none; }
.retour a:hover { color: var(--fg); }
.solde { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ok); }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.top h1 { font-size: 1.15rem; font-weight: 800; }

.carte {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#jeu {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Plateau compact adaptatif : ne dépasse jamais 42vh */
.plateau-oie {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 2px;
  width: 100%;
  max-width: min(360px, 86vw, 44vh);
  aspect-ratio: 1;
  margin: 0 auto 4px;
  padding: 4px;
  background: #235d39;
  border-radius: 10px;
  box-sizing: border-box;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.plateau-oie .case {
  position: relative;
  background: #fdf3d0;
  color: #3b2f12;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(.75rem, 3.2vw, 1.15rem);
  min-width: 0;
}
.plateau-oie .case small {
  position: absolute;
  top: 1px;
  left: 2px;
  font-size: .55em;
  font-weight: 800;
  opacity: .7;
}
.plateau-oie .case .ico { opacity: .9; }
.plateau-oie .case .pions {
  position: absolute;
  bottom: 0px;
  right: 0;
  left: 0;
  text-align: center;
  font-size: .85em;
  line-height: 1;
}
.plateau-oie .case.oie { background: #ffe9a8; }
.plateau-oie .case.piege { background: #f8c9c0; }
.plateau-oie .case.depart, .plateau-oie .case.arrivee { background: #cfe8ff; }
.plateau-oie .case.ici { outline: 2px solid #2563eb; outline-offset: -2px; }

/* Pistes de progression */
.pistes {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.piste-ligne {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.piste-entete {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
}
.piste-barre {
  height: 8px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.piste-remplissage {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.piste-remplissage.ordi {
  background: var(--warn);
}

/* Actions : Bouton combiné dé + lancer */
.actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}

.bouton-lance-de {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 800;
  font-size: 1.05rem;
  width: 100%;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  transition: transform 0.1s ease, filter 0.15s ease;
}
.bouton-lance-de:hover:not(:disabled) {
  filter: brightness(1.08);
}
.bouton-lance-de:active:not(:disabled) {
  transform: scale(0.98);
}
.bouton-lance-de:disabled {
  opacity: 0.6;
  cursor: default;
}
.bouton-lance-de .de-cube {
  font-size: 1.6rem;
  line-height: 1;
  display: inline-block;
  transition: transform 0.2s ease;
}

.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--fg);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
}
.ghost:hover {
  background: var(--surface);
}

#status {
  min-height: 1.4em;
  font-weight: 600;
  font-size: 0.85rem;
  text-align: center;
  color: var(--fg);
  margin: 2px 0;
}
.gainline {
  text-align: center;
  font-weight: 700;
  color: var(--ok);
  font-size: 0.85rem;
}

.note {
  font-size: .75rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.25;
}

.legal {
  border-top: 1px solid var(--line);
  padding-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: .68rem;
  color: var(--muted);
  text-align: center;
}
.legal a { color: var(--muted); text-decoration: none; }
