/* =========================================================
   Koi-Koi — interface
   Table indigo (aizome), cartes nettes, carmin pour les actions,
   or pour les lumières et les combinaisons.
   ========================================================= */
:root {
  --indigo: #1d2b4f;
  --indigo-2: #26386a;
  --indigo-3: #34488a;
  --indigo-clair: #c9d2ea;
  --papier: #fbf8f2;
  --papier-2: #f1ebdf;
  --encre: #1b1c22;
  --encre-2: #565a68;
  --carmin: #bb002c;
  --carmin-2: #96001f;
  --or: #d4a017;
  --vert: #2f7a4f;
  --violet: #6a2d91;
  --gris: #6c6f78;

  --f-ui: 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', 'Yu Gothic UI', system-ui, sans-serif;
  --f-titre: 'Shippori Mincho B1', 'Hiragino Mincho ProN', 'Yu Mincho', serif;

  /* Taille des cartes : la main donne l'échelle */
  --h-main: clamp(84px, 20vh, 190px);
  --h-table: calc(var(--h-main) * .86);
  --h-adv: calc(var(--h-main) * .42);
  --h-prise: calc(var(--h-main) * .44);
  --ratio: .61;

  --rayon: 14px;
  --ombre-carte: 0 2px 6px rgba(5, 10, 30, .35);
  --sauf-haut: env(safe-area-inset-top, 0px);
  --sauf-bas: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--f-ui); font-weight: 500; color: var(--papier);
  background: var(--indigo);
  /* Motif de vagues seigaiha, très discret */
  background-image:
    radial-gradient(circle at 50% 100%, transparent 0 9px, rgba(255,255,255,.035) 10px 11.5px, transparent 12.5px 16px, rgba(255,255,255,.035) 17px 18.5px, transparent 19.5px 23px, rgba(255,255,255,.035) 24px 25.5px, transparent 26.5px),
    radial-gradient(circle at 50% 100%, transparent 0 9px, rgba(255,255,255,.035) 10px 11.5px, transparent 12.5px 16px, rgba(255,255,255,.035) 17px 18.5px, transparent 19.5px 23px, rgba(255,255,255,.035) 24px 25.5px, transparent 26.5px);
  background-size: 54px 27px; background-position: 0 0, 27px 13.5px;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; touch-action: manipulation; }
button:focus-visible { outline: 3px solid var(--or); outline-offset: 3px; }
[hidden] { display: none !important; }

/* ---------- Boutons ---------- */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .7em 1.3em; border-radius: 999px; font-weight: 700; font-size: 1rem;
  background: var(--papier); color: var(--encre);
  transition: transform .12s ease, background-color .12s ease;
}
.bouton:active { transform: scale(.97); }
.bouton.principal { background: var(--carmin); color: #fff; }
.bouton.principal:hover { background: var(--carmin-2); }
.bouton.grand { font-size: 1.15rem; padding: .9em 2.2em; }
.bouton.discret { background: rgba(255,255,255,.1); color: var(--papier); padding: .5em 1.1em; }
.bouton.discret:hover { background: rgba(255,255,255,.18); }
.lien { text-decoration: underline; text-underline-offset: 3px; color: var(--encre-2); font-weight: 700; }

/* ================= MENU ================= */
#menu { height: 100%; overflow-y: auto; display: flex; justify-content: center; align-items: flex-start; padding: calc(24px + var(--sauf-haut)) 16px calc(24px + var(--sauf-bas)); }
.menu-carte {
  width: min(720px, 100%); background: var(--papier); color: var(--encre);
  border-radius: 24px; padding: clamp(22px, 4vw, 40px); box-shadow: 0 20px 60px rgba(0,0,0,.35);
  margin: auto 0;
}
.menu-titre { text-align: center; margin-bottom: 26px; }
.menu-kanji { font-family: var(--f-titre); font-weight: 800; font-size: 1.3rem; color: var(--carmin); letter-spacing: .4em; margin-right: -.4em; }
.menu-titre h1 { font-family: var(--f-titre); font-weight: 800; font-size: clamp(2.6rem, 8vw, 3.6rem); line-height: 1; margin: 4px 0 8px; }
.menu-titre p { color: var(--encre-2); }
.menu-bloc { margin-bottom: 22px; }
.menu-bloc h2 { font-size: 1rem; font-weight: 900; margin: 0 0 10px; }
.menu-bloc h2:not(:first-child) { margin-top: 18px; }

.choix-modes { display: grid; gap: 10px; }
@media (min-width: 760px) {
  .menu-carte { width: min(860px, 100%); }
  .choix-modes { grid-template-columns: repeat(3, 1fr); }
  .mode { align-content: start; min-height: 104px; }
  .menu-titre { margin-bottom: 18px; }
}
.mode {
  display: grid; gap: 2px; text-align: left; padding: 14px 18px; border-radius: var(--rayon);
  background: var(--papier-2); border: 2px solid transparent; transition: border-color .12s ease;
}
.mode b { font-size: 1.08rem; font-weight: 900; }
.mode span { color: var(--encre-2); font-size: .92rem; }
.mode[aria-checked="true"] { border-color: var(--carmin); background: #fff; }

.segments { display: flex; flex-wrap: wrap; gap: 6px; }
.segments button {
  flex: 1 1 auto; padding: .65em .9em; border-radius: 12px; background: var(--papier-2);
  font-weight: 700; border: 2px solid transparent; min-width: 4.2em;
}
.segments.court button { flex: 0 1 4.5em; }
.segments button[aria-checked="true"] { background: var(--indigo); color: #fff; }
#commencer { width: 100%; margin-top: 4px; }
.menu-pied { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.asso { display: inline-flex; align-items: center; gap: 8px; color: var(--encre-2); font-size: .85rem; text-decoration: none; border-radius: 8px; }
.asso:hover { color: var(--carmin); text-decoration: underline; text-underline-offset: 3px; }
.asso:focus-visible { outline: 3px solid var(--or); outline-offset: 3px; }
.asso img { width: 28px; height: 28px; }

/* ================= PARTIE ================= */
#jeu {
  height: 100%; display: grid;
  grid-template-rows: auto auto 1fr auto;
  padding: calc(8px + var(--sauf-haut)) 14px calc(10px + var(--sauf-bas));
  gap: 8px;
}

/* Les zones de la partie ne s'élargissent jamais au-delà de l'écran (sinon la barre ne passe pas à la ligne) */
#jeu > * { min-width: 0; }
/* La barre passe à la ligne s'il manque de place : aucun bouton ne sort de l'écran */
.barre { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
@media (max-width: 860px) {
  .barre { gap: 6px 8px; }
  .barre .bouton.discret, .bouton.conseil { padding: .45em .85em; font-size: .92rem; }
  .score { padding: .3em .7em; gap: 6px; }
  .score span { font-size: .8rem; }
}
.barre-centre { color: var(--indigo-clair); font-weight: 700; }
.scores { margin-left: auto; display: flex; gap: 6px; }
.score { display: flex; align-items: baseline; gap: 8px; padding: .35em .9em; border-radius: 999px; background: rgba(255,255,255,.08); }
.score b { font-family: var(--f-titre); font-size: 1.25rem; }
.score span { color: var(--indigo-clair); font-size: .9rem; }
.score.actif { background: rgba(255,255,255,.18); box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.bouton.conseil { background: var(--or); color: var(--encre); padding: .5em 1.1em; }

/* ---------- Cartes ---------- */
.carte {
  position: relative; flex: none; display: block;
  height: var(--h); width: calc(var(--h) * var(--ratio));
  border-radius: calc(var(--h) * .055); box-shadow: var(--ombre-carte);
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}
.carte img { display: block; width: 100%; height: 100%; border-radius: inherit; pointer-events: none; -webkit-user-drag: none; user-select: none; }
.dos {
  background: linear-gradient(160deg, var(--indigo-3), #16224a);
  box-shadow: var(--ombre-carte), inset 0 0 0 calc(var(--h) * .04) rgba(255,255,255,.55);
}
.dos::after { content: "花"; position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-titre); color: rgba(255,255,255,.75); font-size: calc(var(--h) * .32); }

/* Pastilles (mode assisté) */
.pastilles { position: absolute; right: -4px; bottom: 6%; display: flex; flex-direction: column; gap: 2px; pointer-events: none; }
.pastille {
  width: calc(var(--h) * .15); height: calc(var(--h) * .15); min-width: 15px; min-height: 15px;
  border-radius: 50%; background: #fff; display: grid; place-items: center;
  font-weight: 900; font-size: max(9px, calc(var(--h) * .095)); line-height: 1;
  border: 2px solid var(--pc); color: var(--pc); box-shadow: 0 1px 3px rgba(0,0,0,.35);
}
.pastille.lum { --pc: #b07a00; } .pastille.spe { --pc: var(--carmin); }
.pastille.rub { --pc: var(--violet); } .pastille.col { --pc: #555; }

/* ---------- Zones ---------- */
.zone.adversaire { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; min-height: calc(var(--h-adv) + 8px); }
.main-adverse { display: flex; padding-left: 4px; }
.main-adverse .carte { --h: var(--h-adv); margin-left: calc(var(--h-adv) * -.28); }
.main-adverse .carte:first-child { margin-left: 0; }
.main-adverse .carte:not(:last-child)::after { content: none; }

.zone.centre { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; min-height: 0; padding-right: 10px; }
.table {
  display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 10px;
  min-height: calc(var(--h-table) + 24px); padding: 12px; border-radius: 22px;
  background: rgba(255,255,255,.045); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.table .carte { --h: var(--h-table); }
.table .carte.cible { box-shadow: 0 0 0 4px var(--or), 0 6px 18px rgba(0,0,0,.4); transform: translateY(-4px); cursor: pointer; }
.table .carte.estompee { opacity: .45; }
/* Capture : la carte jouée vient se poser sur sa paire avant de partir avec elle */
.table .carte.superpose {
  margin-left: calc(var(--h-table) * var(--ratio) * -.62 - 10px); z-index: 2;
  transform: translate(4px, -10px) rotate(6deg); box-shadow: 0 10px 22px rgba(0,0,0,.45);
}
/* Carte qui attend que le joueur choisisse quoi prendre */
.table .carte.en-attente {
  margin-left: 14px; transform: translateY(-8px) rotate(-3deg);
  box-shadow: 0 0 0 4px var(--papier), 0 12px 24px rgba(0,0,0,.45);
}
/* Carte piochée pendant son retournement : on voit d'abord son dos */
.carte.retourne { background: linear-gradient(160deg, var(--indigo-3), #16224a); }
/* « À vous » / « À l'adversaire » : au centre de l'écran, bref et lisible */
.annonce-tour {
  position: fixed; left: 50%; top: 50%; z-index: 35; pointer-events: none;
  transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: .55em;
  background: var(--papier); color: var(--indigo); font-weight: 900; font-size: clamp(1.2rem, 2.6vw, 1.6rem);
  padding: .55em 1.5em; border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(255,255,255,.18), 0 14px 40px rgba(0,0,0,.45);
  animation: annonce-entree .22s ease-out;
}
.annonce-tour.a-moi::before { content: ""; width: .55em; height: .55em; border-radius: 50%; background: var(--carmin); }
.annonce-tour.sortie { opacity: 0; transform: translate(-50%, -50%) scale(.96); transition: opacity .18s ease, transform .18s ease; }
@keyframes annonce-entree { from { opacity: 0; transform: translate(-50%, -50%) scale(.9); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.table .carte.conseillee { box-shadow: 0 0 0 4px var(--or), 0 0 22px rgba(212,160,23,.7); }
.table .carte.arrivee { animation: arrivee .35s ease; }
@keyframes arrivee { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }

.pioche-zone { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pioche { position: relative; --h: var(--h-table); width: calc(var(--h) * var(--ratio)); height: var(--h); }
.pioche .carte { position: absolute; left: 0; top: 0; }
.pioche .carte:nth-child(2) { transform: translate(3px, -3px); }
.pioche .carte:nth-child(3) { transform: translate(6px, -6px); }
.pioche .compte { position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); z-index: 2; background: var(--papier); color: var(--encre); font-weight: 900; font-size: .82rem; padding: .15em .6em; border-radius: 999px; }
.piochee { min-height: calc(var(--h-table) * .62); display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .78rem; color: var(--indigo-clair); }
.piochee .carte { --h: calc(var(--h-table) * .62); animation: arrivee .35s ease; }

.zone.joueur { display: grid; gap: 8px; }
.main { display: flex; justify-content: center; gap: 10px; min-height: var(--h-main); }
.main .carte { --h: var(--h-main); cursor: pointer; }
.main .carte:hover { transform: translateY(-4px); }
.main .carte.choisie { transform: translateY(-14px); box-shadow: 0 0 0 4px var(--papier), 0 12px 22px rgba(0,0,0,.45); }
/* Mode assisté : cette carte peut prendre une carte de la table (plus discret que le conseil) */
.main .carte.peut-prendre { box-shadow: 0 0 0 3px rgba(251, 248, 242, .85), 0 4px 14px rgba(0,0,0,.35); }
.main .carte.peut-prendre.choisie { box-shadow: 0 0 0 4px var(--papier), 0 12px 22px rgba(0,0,0,.45); }
.main .carte.conseillee { box-shadow: 0 0 0 4px var(--or), 0 0 22px rgba(212,160,23,.7); }
.main.bloquee .carte { cursor: default; }
.main.bloquee .carte:not(.choisie) { opacity: .75; }

/* ---------- Cartes prises, rangées par famille ---------- */
.prises { display: flex; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
#prises-0 { justify-content: center; }
.famille { display: flex; align-items: flex-end; gap: 6px; }
.famille .pile { display: flex; }
.famille .carte { --h: var(--h-prise); margin-left: calc(var(--h-prise) * -.42); box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.famille .carte:first-child { margin-left: 0; }
.famille .carte.nouvelle { animation: arrivee .35s ease; }
.famille { flex-direction: column; align-items: flex-start; gap: 3px; }
.famille .legende { font-size: .74rem; color: var(--indigo-clair); white-space: nowrap; }
.famille .legende b { color: #fff; font-weight: 900; margin-left: 3px; }
.famille.vide { display: none; }

/* ---------- Progression vers les combinaisons (mode assisté) ---------- */
.progression { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.jeton {
  display: inline-flex; align-items: center; gap: 6px; padding: .25em .7em .25em .3em; border-radius: 999px;
  background: rgba(255,255,255,.08); font-size: .85rem; color: var(--indigo-clair);
}
.jeton .pastille { --h: 22px; width: 22px; height: 22px; font-size: 12px; box-shadow: none; }
.jeton b { color: #fff; }
.jeton.proche { background: rgba(212,160,23,.22); color: #fff; }
.jeton.fait { background: var(--or); color: var(--encre); }
.jeton.fait b { color: var(--encre); }
.jeton.alerte { background: rgba(187,0,44,.35); color: #fff; }

/* ---------- Message d'action (ce qui vient de se passer) ---------- */
.bandeau-message {
  position: fixed; left: 50%; top: calc(58px + var(--sauf-haut)); transform: translateX(-50%); z-index: 20;
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px 16px; border-radius: 18px;
  background: var(--papier); color: var(--encre); box-shadow: 0 12px 40px rgba(0,0,0,.4);
  font-weight: 700; pointer-events: none; opacity: 0; transition: opacity .2s ease;
  max-width: calc(100vw - 32px);
}
.bandeau-message.visible { opacity: 1; }
.bandeau-message .carte { --h: 64px; }
.conseil-ligne { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.conseil-raisons { list-style: none; display: grid; gap: 3px; font-weight: 500; }
.conseil-raisons li { padding-left: 16px; position: relative; }
.conseil-raisons li::before { content: "◆"; position: absolute; left: 0; color: var(--or); font-size: .7em; top: .35em; }
.conseil-raisons b { color: var(--carmin); }
.conseil-pied { font-size: .82rem; font-weight: 500; color: var(--encre-2); }
.bandeau-message .fleche { color: var(--carmin); font-weight: 900; }

/* ---------- Fenêtres ---------- */
.voile { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(10, 16, 36, .62); }
.fenetre {
  width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--papier); color: var(--encre); border-radius: 22px; padding: 26px 26px 22px;
  box-shadow: 0 24px 70px rgba(0,0,0,.45);
}
.fenetre h2 { font-family: var(--f-titre); font-weight: 800; font-size: 1.7rem; line-height: 1.15; margin-bottom: 8px; }
.fenetre p { color: var(--encre-2); line-height: 1.5; }
.fenetre .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }
.fenetre .actions .bouton:not(.principal) { background: var(--papier-2); }
.resultat-ligne { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--papier-2); }
.resultat-ligne:last-of-type { border-bottom: 0; }
.resultat-ligne .noms { flex: 1; }
.resultat-ligne .noms b { font-family: var(--f-titre); font-size: 1.15rem; display: block; }
.resultat-ligne .noms small { color: var(--encre-2); }
.resultat-ligne .pts { font-family: var(--f-titre); font-weight: 800; font-size: 1.35rem; color: var(--carmin); }
.mini-cartes { display: flex; gap: 3px; }
.mini-cartes .carte { --h: 46px; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; padding-top: 12px; border-top: 2px solid var(--encre); }
.total b { font-family: var(--f-titre); font-size: 2rem; color: var(--carmin); }
.scores-finaux { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 4px; }
.scores-finaux div { background: var(--papier-2); border-radius: var(--rayon); padding: 14px; text-align: center; }
.scores-finaux b { display: block; font-family: var(--f-titre); font-size: 2.2rem; }
.tirage { display: flex; justify-content: center; gap: 28px; margin: 18px 0 6px; }
.tirage figure { text-align: center; font-weight: 700; }
.tirage .carte { --h: 130px; margin: 0 auto 8px; }
.tirage figcaption small { display: block; color: var(--encre-2); font-weight: 500; }

/* Croix de fermeture : reste visible en haut quand on fait défiler */
.fenetre .fermer {
  position: sticky; top: 0; float: right; z-index: 2; margin: -10px -10px 0 12px;
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--papier-2); color: var(--encre); font-size: 1.7rem; line-height: 1; font-weight: 500;
}
.fenetre .fermer:hover { background: #e4dccd; }
/* Fiche des combinaisons, illustrée */
.fenetre.large { width: min(760px, 100%); }
.groupe-yaku { margin-top: 20px; }
.groupe-yaku h3 { display: flex; align-items: baseline; gap: 10px; font-family: var(--f-titre); font-weight: 800; font-size: 1.15rem; margin-bottom: 8px; }
.groupe-yaku h3 small { font-family: var(--f-ui); font-weight: 500; font-size: .85rem; color: var(--encre-2); }
.carte-yaku {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto 52px; gap: 14px; align-items: center;
  padding: 10px 12px; border-radius: var(--rayon); background: var(--papier-2); margin-bottom: 6px;
}
.carte-yaku .pastille { --h: 34px; width: 34px; height: 34px; font-size: 17px; box-shadow: none; }
.cy-texte b { display: block; font-family: var(--f-titre); font-size: 1.12rem; }
.cy-texte small { display: block; color: var(--encre-2); line-height: 1.35; }
.cy-texte .etat { display: inline-block; margin-top: 4px; font-size: .78rem; font-weight: 900; padding: .1em .6em; border-radius: 999px; background: var(--indigo); color: #fff; }
.cy-texte .etat.fait { background: var(--or); color: var(--encre); }
.cy-texte .etat.impossible { background: transparent; color: var(--encre-2); box-shadow: inset 0 0 0 1px var(--encre-2); }
.cy-cartes { display: flex; align-items: center; gap: 4px; }
.cy-cartes .carte { --h: 58px; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.cy-cartes .etc { font-weight: 900; color: var(--encre-2); padding: 0 2px; }
.carte-yaku .pts { font-family: var(--f-titre); font-weight: 800; font-size: 1.5rem; color: var(--carmin); text-align: right; line-height: 1; }
.carte-yaku .pts small { display: block; font-family: var(--f-ui); font-size: .7rem; color: var(--encre-2); font-weight: 700; }
@media (max-width: 620px) {
  .carte-yaku { grid-template-columns: 34px minmax(0, 1fr) 44px; }
  .cy-cartes { grid-column: 2 / -1; grid-row: 2; }
}

/* Astuce d'installation sur iPad */
.astuce-ipad {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 14px; align-items: center;
  margin-top: 16px; padding: 14px 16px; border-radius: var(--rayon);
  background: #e9eefb; color: var(--indigo);
}
.astuce-ipad svg { width: 30px; height: 30px; color: #1f6fe5; }
.astuce-ipad b { color: var(--encre); }
.astuce-ipad p { color: var(--encre-2); font-size: .92rem; line-height: 1.45; margin-top: 2px; }
.icone-partage { font-weight: 900; color: #1f6fe5; }

/* Règles / combinaisons */
.liste-yaku { display: grid; gap: 2px; margin-top: 12px; }
.ligne-yaku { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--papier-2); }
.ligne-yaku .pastille { --h: 28px; width: 28px; height: 28px; font-size: 14px; box-shadow: none; }
.ligne-yaku b { display: block; }
.ligne-yaku small { color: var(--encre-2); }
.ligne-yaku .pts { font-family: var(--f-titre); font-weight: 800; color: var(--carmin); }

/* ---------- Le moment koi-koi ---------- */
.koikoi {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(ellipse at 50% 35%, #2d3f7a 0%, #141d3a 70%);
  animation: apparait .3s ease;
}
@keyframes apparait { from { opacity: 0; } to { opacity: 1; } }
.kk-contenu { width: min(640px, 100%); text-align: center; }
.kk-kanji { font-family: var(--f-titre); font-weight: 800; font-size: clamp(3.4rem, 13vw, 7rem); line-height: 1; color: #fff; letter-spacing: .08em; text-shadow: 0 6px 30px rgba(0,0,0,.4); }
.kk-question { color: var(--indigo-clair); font-size: 1.15rem; margin: 10px 0 18px; }
.kk-combinaisons { display: grid; gap: 8px; margin-bottom: 26px; }
.kk-comb { display: flex; align-items: center; justify-content: center; gap: 14px; }
.kk-comb .mini-cartes .carte { --h: 58px; }
.kk-comb b { font-family: var(--f-titre); font-size: 1.4rem; color: var(--or); }
.kk-boutons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kk-boutons .bouton { padding: 1.05em 1em; font-size: 1.08rem; border-radius: 18px; }
.kk-stop { background: var(--papier); color: var(--encre); }
.kk-continuer { background: var(--carmin); color: #fff; }
.kk-explication { color: var(--indigo-clair); font-size: .92rem; margin-top: 16px; line-height: 1.5; }
.kk-conseil { margin-top: 12px; display: inline-block; background: rgba(212,160,23,.18); color: #fff; padding: .5em 1em; border-radius: 12px; }

/* Annonce courte (ex. « L'adversaire dit koi-koi ! ») */
.annonce {
  position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; pointer-events: none;
  font-family: var(--f-titre); font-weight: 800; font-size: clamp(2.2rem, 8vw, 4.5rem); color: #fff;
  background: rgba(20, 29, 58, .55); text-align: center; animation: apparait .25s ease;
}
.annonce small { display: block; font-family: var(--f-ui); font-size: 1.1rem; color: var(--indigo-clair); margin-top: 8px; }

/* ---------- Tutoriel ---------- */
.tuto-bulle {
  position: fixed; z-index: 30; left: 50%; top: calc(var(--h-adv) + 70px + var(--sauf-haut)); transform: translateX(-50%);
  width: min(560px, calc(100vw - 32px)); background: var(--papier); color: var(--encre);
  border-radius: 18px; padding: 16px 18px; box-shadow: 0 16px 44px rgba(0,0,0,.45);
  display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center;
  border-left: 6px solid var(--or);
}
.tuto-bulle p { line-height: 1.5; }
/* Pendant le moment koi-koi, la bulle passe devant, en bas de l'écran */
body.kk-ouvert .tuto-bulle { z-index: 60; top: auto; bottom: calc(20px + var(--sauf-bas)); }
.tuto-bulle p b { color: var(--carmin); }

/* ---------- Portrait et petits écrans ---------- */
@media (orientation: portrait) {
  :root { --h-main: clamp(80px, 13vh, 150px); }
  .zone.centre { grid-template-columns: 1fr; align-content: center; gap: 14px; }
  .pioche-zone { flex-direction: row; justify-content: center; }
}
@media (max-width: 700px) {
  .barre-centre { display: none; }
  .main { gap: 4px; }
  .table { gap: 6px; }
  .kk-boutons { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
