/*
 * Poker Master — problème du jour et calculateur de cotes.
 * Se charge après le socle de jeu et css/jeu.css, dont ces deux pages
 * reprennent les boutons et les blocs.
 */

#app.page-outil { max-width: 800px; }
.page-outil h1 { margin: 14px 0 8px; }

/* ================= PROBLÈME DU JOUR ================= */

.probleme {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: var(--surface-2);
}

.probleme-table {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 32px;
  justify-content: center;
  padding: 18px 12px;
  border-radius: 14px;
  border: 4px solid #4a2c17;
  background: radial-gradient(120% 90% at 50% 30%, #1a6b3a 0%, #14532d 55%, #0b3a1f 100%);
}

.probleme-zone { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.probleme-label { font-size: 0.78rem; font-weight: 600; color: var(--texte-doux); }
.probleme-table .probleme-label { color: #d1fae5; }
.probleme-main { font-size: 0.85rem; font-weight: 600; color: #86efac; }

.probleme-enonce { margin: 16px 0; font-size: 1rem; line-height: 1.6; color: var(--texte); text-align: center; }

.probleme-choix { display: flex; flex-wrap: wrap; gap: 8px; }
.probleme-choix .btn { flex: 1 1 140px; min-height: 48px; }
.probleme-choix.envoi { opacity: 0.5; pointer-events: none; }
.probleme-choix[hidden], .probleme-bilan[hidden], .setup-actions[hidden] { display: none; }

.probleme-bilan {
  border-left: 4px solid var(--line-forte);
  padding: 4px 0 4px 14px;
  margin-top: 4px;
}
.probleme-bilan.juste { border-left-color: #4ade80; }
.probleme-bilan.faux { border-left-color: #f0a0a0; }
.probleme-bilan h2 { margin: 0 0 6px; font-size: 1.1rem; color: #f0f3f6; }
.probleme-bilan p { margin: 0 0 8px; line-height: 1.6; color: var(--texte); }
.probleme-bilan .probleme-parts, .probleme-bilan .probleme-serie { color: var(--texte-doux); font-size: 0.88rem; }
.probleme-note { margin: 14px 0 0; font-size: 0.8rem; color: var(--texte-faible); line-height: 1.5; }

/* ================= CALCULATEUR ================= */

.calc {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: var(--surface-2);
}

.calc-emplacements { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: flex-end; }
.calc-zone { display: flex; flex-direction: column; gap: 6px; }
.calc-slots { display: flex; gap: 6px; }

.calc-slot {
  width: 48px;
  height: 66px;
  padding: 0;
  border: 2px dashed var(--line-forte);
  border-radius: 7px;
  background: var(--surface-0);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.calc-slot:hover { border-color: var(--pm-or); }
.calc-slot .carte { --carte-l: 44px; }

.calc-select {
  padding: 9px 10px;
  border-radius: 6px;
  border: 1px solid var(--line-forte);
  background: var(--surface-0);
  color: var(--texte);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 700;
}

.calc-consigne { margin: 14px 0 8px; font-size: 0.88rem; color: var(--texte-doux); min-height: 1.3em; }

.calc-paquet { display: flex; flex-direction: column; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
.calc-rangee { display: flex; gap: 4px; }
.calc-carte { padding: 0; border: none; background: none; cursor: pointer; border-radius: 4px; flex: none; }
.calc-carte .carte { --carte-l: 34px; }
.calc-carte:hover .carte { outline: 2px solid var(--pm-or); }
.calc-carte:disabled { cursor: default; opacity: 0.22; }
.calc-carte:disabled:hover .carte { outline: none; }

.calc-resultat { margin-top: 16px; }
.calc-resultat[hidden] { display: none; }
.calc-pourcent { margin: 0 0 6px; font-size: 1rem; color: var(--texte); }
.calc-pourcent strong { font-size: 1.8rem; color: var(--pm-or-clair); font-variant-numeric: tabular-nums; }
.calc-barre { height: 10px; border-radius: 5px; background: var(--surface-0); border: 1px solid var(--line); overflow: hidden; }
.calc-barre span { display: block; height: 100%; width: 0; background: var(--pm-or); transition: width 0.3s; }
.calc-detail { margin: 8px 0 0; font-size: 0.88rem; color: var(--texte-doux); line-height: 1.55; }

.calc-cote { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.calc-cote h2 { margin: 0 0 8px; font-size: 1rem; color: var(--pm-or-clair); }
.calc-cote-saisie { display: flex; flex-wrap: wrap; gap: 10px 20px; margin: 0; font-size: 0.88rem; color: var(--texte-doux); }
.calc-cote-saisie label { display: flex; flex-direction: column; gap: 4px; }
.calc-cote-saisie .champ-relance { width: 130px; }

@media (max-width: 720px) {
  /* Treize cartes ne tiennent pas sur une ligne de téléphone : chaque enseigne
     passe sur deux lignes plutôt que de sortir de l'écran. */
  .calc-carte .carte { --carte-l: 34px; }
  .calc-rangee { flex-wrap: wrap; margin-bottom: 6px; }
  .calc-rangee, .calc-paquet { gap: 4px; }
  .calc-slot { width: 44px; height: 60px; }
  .calc-slot .carte { --carte-l: 40px; }
}
