/* Table de chkobba. Mêmes couleurs que le site ; cartes en HTML/CSS.
   Compatibilité : pas de flex gap, pas d'aspect-ratio, pas de inset (vieux Safari / Android). */

.ck-page .page-tete {
  padding-bottom: 14px;
}

.ck-racine {
  position: relative;
  background: var(--tapis);
  color: var(--papier);
  min-height: 560px;
  border-top: var(--trait);
  border-bottom: var(--trait);
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.ck-racine.ck-repos {
  min-height: 0;
}

.ck-cadre {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 12px 18px;
}

.ck-vieux,
.ck-racine noscript p {
  padding: 40px 18px;
  text-align: center;
}

/* ---------- boutons ---------- */

.ck-principal,
.ck-secondaire,
.ck-option,
.ck-quitter {
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  -webkit-appearance: none;
  appearance: none;
}

.ck-principal {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 14px 18px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 19px;
  color: var(--encre);
  background: var(--jasmin);
  border: 1.5px solid var(--encre);
}

.ck-secondaire {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 12px 18px;
  font-weight: 600;
  font-size: 16px;
  color: var(--papier);
  background: transparent;
  border: 1.5px solid var(--papier);
}

.ck-secondaire small {
  display: block;
  font-weight: 400;
  font-size: 13.5px;
  opacity: 0.8;
}

.ck-bilan .ck-secondaire {
  color: var(--encre);
  border-color: var(--encre);
}

.ck-principal:focus-visible,
.ck-secondaire:focus-visible,
.ck-option:focus-visible,
.ck-quitter:focus-visible,
button.ck-carte:focus-visible {
  outline: 3px solid var(--jasmin);
  outline-offset: 2px;
}

/* ---------- accueil ---------- */

.ck-accueil {
  max-width: 460px;
  margin: 0 auto;
  padding: 8px 0 10px;
}

.ck-groupe {
  border: 0;
  margin: 16px 0 0;
  padding: 0;
  min-width: 0;
}

.ck-groupe legend {
  padding: 0;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--jasmin);
}

[lang^='ar'] .ck-groupe legend {
  letter-spacing: 0;
  font-size: 15px;
}

.ck-options {
  display: flex;
  flex-wrap: wrap;
  margin: -4px;
}

.ck-option {
  flex: 1 1 0;
  min-width: 96px;
  margin: 4px;
  padding: 11px 12px;
  font-weight: 600;
  font-size: 16px;
  color: var(--papier);
  background: var(--tapis-2);
  border: 1.5px solid rgba(245, 239, 227, 0.45);
}

.ck-option small {
  display: block;
  font-weight: 400;
  font-size: 12.5px;
  opacity: 0.75;
}

.ck-option[aria-pressed='true'] {
  color: var(--encre);
  background: var(--papier);
  border-color: var(--papier);
}

/* ---------- barre de score ---------- */

.ck-barre {
  display: flex;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1.5px solid rgba(245, 239, 227, 0.3);
  font-size: 15px;
}

.ck-score {
  white-space: nowrap;
}

.ck-score b {
  font-family: var(--display);
  font-weight: 800;
  font-size: 24px;
  color: var(--jasmin);
  vertical-align: -2px;
}

.ck-manche {
  flex: 1 1 auto;
  text-align: center;
  font-size: 13px;
  opacity: 0.8;
  padding: 0 8px;
}

.ck-quitter {
  margin-inline-start: 10px;
  padding: 5px 11px;
  font-size: 13px;
  color: var(--papier);
  background: transparent;
  border: 1.5px solid rgba(245, 239, 227, 0.5);
}

/* ---------- plateau ---------- */

/* La géométrie reste la même en arabe : le joueur suivant est toujours à droite. */
.ck-plateau {
  direction: ltr;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    'haut haut haut'
    'gauche table droite'
    'messages messages messages'
    'main main main'
    'actions actions actions';
  align-items: center;
}

.ck-haut {
  grid-area: haut;
}

.ck-gauche {
  grid-area: gauche;
}

.ck-droite {
  grid-area: droite;
}

.ck-table {
  grid-area: table;
}

.ck-messages {
  grid-area: messages;
}

.ck-main {
  grid-area: main;
}

.ck-actions {
  grid-area: actions;
}

.ck-siege {
  padding: 10px 4px 8px;
  text-align: center;
  font-size: 13.5px;
}

.ck-nom {
  display: block;
  font-weight: 700;
  font-size: 15px;
}

.ck-nom small {
  font-weight: 400;
  opacity: 0.75;
}

.ck-siege.actif .ck-nom {
  color: var(--jasmin);
}

.ck-siege.actif .ck-nom::after {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 6px;
  border-radius: 50%;
  background: var(--jasmin);
  vertical-align: middle;
  animation: ck-pouls 1s ease-in-out infinite alternate;
}

.ck-infos {
  display: block;
  font-size: 12.5px;
  opacity: 0.75;
}

.ck-dos-pile {
  display: block;
  height: 34px;
  margin: 5px 0 3px;
  padding-left: 10px;
}

.ck-dos {
  display: inline-block;
  width: 24px;
  height: 34px;
  margin-left: -10px;
  border: 1.5px solid var(--papier);
  border-radius: 4px;
  background-color: var(--brique);
  background-image: repeating-linear-gradient(45deg, transparent 0, transparent 4px, rgba(23, 32, 27, 0.25) 4px, rgba(23, 32, 27, 0.25) 8px);
  vertical-align: top;
}

.ck-gauche,
.ck-droite {
  width: 64px;
}

.ck-gauche .ck-dos-pile,
.ck-droite .ck-dos-pile {
  height: auto;
  padding-left: 0;
  padding-top: 12px;
}

.ck-gauche .ck-dos,
.ck-droite .ck-dos {
  display: block;
  margin: -12px auto 0;
  width: 34px;
  height: 24px;
}

/* ---------- cartes ---------- */

.ck-carte {
  --l: 56px;
  position: relative;
  display: inline-block;
  width: var(--l);
  height: calc(var(--l) * 1.4);
  margin: 4px;
  padding: 0;
  font: inherit;
  color: var(--encre);
  background: #fffdf8;
  border: 1.5px solid var(--encre);
  border-radius: calc(var(--l) * 0.12);
  vertical-align: top;
  direction: ltr;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button.ck-carte {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

button.ck-carte[disabled] {
  cursor: default;
}

.ck-carte.rouge {
  color: var(--brique);
}

.ck-coin {
  position: absolute;
  top: 5%;
  left: 8%;
  font-family: var(--display);
  font-weight: 800;
  font-size: calc(var(--l) * 0.24);
  line-height: 1;
}

.ck-coin svg {
  display: block;
  width: calc(var(--l) * 0.17);
  height: calc(var(--l) * 0.17);
  margin: 2px auto 0;
  fill: currentColor;
}

.ck-centre {
  position: absolute;
  left: 0;
  right: 0;
  top: 52%;
  transform: translateY(-50%);
  text-align: center;
}

.ck-centre b {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: calc(var(--l) * 0.5);
  line-height: 1;
}

.ck-centre svg {
  display: block;
  width: calc(var(--l) * 0.28);
  height: calc(var(--l) * 0.28);
  margin: 3px auto 0;
  fill: currentColor;
}

.ck-val {
  position: absolute;
  right: 8%;
  bottom: 5%;
  font-weight: 700;
  font-size: calc(var(--l) * 0.17);
  line-height: 1;
  opacity: 0.65;
}

/* La table */

.ck-table {
  padding: 8px 0 4px;
  text-align: center;
  min-height: 190px;
}

.ck-cartes-table {
  min-height: 90px;
}

.ck-talon {
  display: inline-block;
  margin-top: 4px;
  font-size: 12.5px;
  opacity: 0.7;
}

.ck-cible,
.ck-prise {
  box-shadow: 0 0 0 3px var(--jasmin);
  transform: translateY(-4px);
}

.ck-possible {
  box-shadow: 0 0 0 2px rgba(240, 193, 75, 0.55);
}

.ck-pose {
  animation: ck-pose 0.28s ease-out;
}

/* Les messages */

.ck-messages {
  min-height: 62px;
  padding: 4px 6px;
  text-align: center;
  font-size: 15px;
  line-height: 1.4;
}

.ck-dernier {
  opacity: 0.8;
  font-size: 14px;
}

.ck-consigne {
  font-weight: 600;
}

/* Ma main */

.ck-main {
  padding-top: 18px;
  text-align: center;
  min-height: 150px;
}

.ck-main .ck-carte {
  --l: 80px;
  margin: 0 5px;
}

.ck-choisie {
  transform: translateY(-16px);
  box-shadow: 0 0 0 3px var(--jasmin);
}

.ck-attente {
  opacity: 0.85;
}

.ck-actions {
  min-height: 62px;
  max-width: 340px;
  width: 100%;
  margin: 0 auto;
}

@media (min-width: 620px) {
  .ck-carte {
    --l: 66px;
  }
  .ck-main .ck-carte {
    --l: 96px;
  }
  .ck-gauche,
  .ck-droite {
    width: 96px;
  }
}

@media (max-width: 359px) {
  .ck-carte {
    --l: 50px;
  }
  .ck-main .ck-carte {
    --l: 72px;
  }
}

/* ---------- « Chkobba ! » ---------- */

.ck-flash {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.ck-flash span {
  padding: 10px 26px 14px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 54px;
  font-size: clamp(44px, 13vw, 86px);
  line-height: 1;
  color: var(--encre);
  background: var(--jasmin);
  border: 2px solid var(--encre);
  border-radius: 18px;
  transform: rotate(-4deg);
  animation: ck-flash 0.35s ease-out;
}

/* ---------- bilan de manche ---------- */

.ck-voile {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 16px 12px;
  overflow-y: auto;
  background: rgba(10, 44, 35, 0.86);
}

.ck-bilan {
  width: 100%;
  max-width: 440px;
  padding: 18px 18px 20px;
  color: var(--encre);
  background: var(--papier);
  border: var(--trait);
  border-radius: 14px;
  animation: ck-monte 0.25s ease-out;
}

.ck-bilan h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

[lang^='ar'] .ck-bilan h2 {
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0;
}

.ck-sous {
  margin-top: 2px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  color: var(--brique);
}

.ck-tableau {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
  font-size: 15px;
}

.ck-tableau th,
.ck-tableau td {
  padding: 7px 4px;
  border-bottom: 1px solid rgba(23, 32, 27, 0.16);
  text-align: center;
  vertical-align: top;
}

.ck-tableau th[scope='row'] {
  text-align: start;
  font-weight: 600;
}

.ck-tableau thead th {
  font-size: 13px;
  font-weight: 700;
  border-bottom: var(--trait);
}

.ck-tableau td b {
  font-family: var(--display);
  font-weight: 800;
  font-size: 19px;
}

.ck-tableau td small {
  display: block;
  font-size: 12px;
  color: var(--encre-2);
}

.ck-total th,
.ck-total td {
  border-bottom: 0;
}

.ck-total td b {
  color: var(--brique);
}

.ck-note {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--encre-2);
}

/* ---------- règles sous le jeu ---------- */

.ck-regles ol {
  list-style: decimal;
  padding-inline-start: 1.3em;
  padding-left: 1.3em;
  max-width: 44em;
}

[dir='rtl'] .ck-regles ol {
  padding-left: 0;
  padding-right: 1.3em;
}

.ck-regles li {
  padding: 6px 0;
}

/* ---------- animations ---------- */

@keyframes ck-pose {
  from {
    opacity: 0;
    transform: translateY(26px) scale(0.92);
  }
}

@keyframes ck-flash {
  from {
    opacity: 0;
    transform: rotate(-4deg) scale(0.6);
  }
}

@keyframes ck-monte {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@keyframes ck-pouls {
  to {
    opacity: 0.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ck-carte,
  .ck-pose,
  .ck-flash span,
  .ck-bilan,
  .ck-siege.actif .ck-nom::after {
    animation: none;
    transition: none;
  }
}

.ck-moi {
  margin-top: 10px;
}

/* ---------- accueil : les deux façons de jouer ---------- */

.ck-mode {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1.5px solid rgba(245, 239, 227, 0.3);
}

.ck-mode h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 24px;
  line-height: 1.2;
}

[lang^='ar'] .ck-mode h2 {
  font-weight: 700;
}

.ck-champ {
  display: block;
  margin-top: 14px;
}

.ck-champ span {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--jasmin);
}

[lang^='ar'] .ck-champ span {
  letter-spacing: 0;
  font-size: 15px;
}

.ck-champ input,
.ck-lien {
  display: block;
  width: 100%;
  padding: 11px 14px;
  font: inherit;
  font-size: 17px; /* au moins 16 px : sinon Safari iOS zoome */
  color: var(--encre);
  background: var(--papier);
  border: 1.5px solid var(--encre);
  border-radius: 12px;
}

.ck-champ input:focus,
.ck-lien:focus {
  outline: 3px solid var(--jasmin);
  outline-offset: 1px;
}

#ck-code {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-family: var(--display);
  font-weight: 700;
}

.ck-rejoindre-code {
  margin-top: 6px;
}

.ck-erreur {
  margin-top: 12px;
  padding: 10px 14px;
  color: var(--encre);
  background: #f6d7cf;
  border: 1.5px solid var(--brique);
  border-radius: 12px;
  font-weight: 600;
}

/* ---------- salon ---------- */

.ck-salon {
  max-width: 460px;
  margin: 0 auto;
  padding: 10px 0 14px;
}

.ck-salon h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 28px;
  line-height: 1.2;
  margin-bottom: 14px;
}

.ck-etiquette {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--jasmin);
}

[lang^='ar'] .ck-etiquette {
  letter-spacing: 0;
  font-size: 15px;
}

.ck-code {
  margin: 2px 0 14px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 44px;
  line-height: 1;
  letter-spacing: 0.12em;
  color: var(--papier);
}

[dir='rtl'] .ck-code {
  text-align: right;
}

.ck-lien {
  margin-top: 8px;
  font-size: 14px;
}

.ck-partage {
  display: flex;
  margin: 4px -5px 0;
}

.ck-partage > * {
  flex: 1 1 0;
  margin: 6px 5px 0;
  text-align: center;
  text-decoration: none;
}

.ck-whatsapp {
  color: var(--encre);
  background: var(--papier);
  border-color: var(--papier);
  font-weight: 700;
}

.ck-places {
  margin-top: 18px;
}

.ck-places li {
  padding: 11px 14px;
  margin-top: 8px;
  border: 1.5px solid rgba(245, 239, 227, 0.55);
  border-radius: 12px;
  font-weight: 600;
}

.ck-places li.libre {
  border-style: dashed;
  font-weight: 400;
  opacity: 0.7;
}

.ck-equipes {
  display: flex;
  margin: 18px -6px 0;
}

.ck-equipes > div {
  flex: 1 1 0;
  margin: 0 6px;
}

.ck-equipes .ck-places {
  margin-top: 4px;
}

.ck-note-claire,
.ck-attente-hote {
  margin-top: 10px;
  font-size: 14.5px;
  opacity: 0.85;
  text-align: center;
}

.ck-attente-hote {
  margin-top: 20px;
  font-size: 16px;
  font-weight: 600;
  opacity: 1;
}

.ck-lien-discret {
  display: block;
  margin: 18px auto 0;
  padding: 8px 12px;
  font: inherit;
  font-size: 14px;
  color: var(--papier);
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.ck-principal[disabled] {
  opacity: 0.45;
  cursor: default;
}

/* ---------- en jeu : présence et réactions ---------- */

.ck-siege {
  position: relative;
}

.ck-siege.absent .ck-nom {
  opacity: 0.55;
}

.ck-main {
  position: relative;
}

.ck-bulle {
  position: absolute;
  z-index: 3;
  top: -6px;
  left: 50%;
  transform: translate(-50%, -100%);
  padding: 6px 12px 7px;
  white-space: nowrap;
  font-weight: 700;
  font-size: 15px;
  color: var(--encre);
  background: var(--papier);
  border: 1.5px solid var(--encre);
  border-radius: 14px;
  animation: ck-monte 0.2s ease-out;
}

.ck-gauche .ck-bulle,
.ck-droite .ck-bulle {
  top: 0;
}

.ck-main .ck-bulle {
  top: 6px;
}

.ck-reactions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 10px -3px 0;
}

.ck-reaction {
  margin: 3px;
  padding: 6px 11px;
  font: inherit;
  font-size: 13.5px;
  color: var(--papier);
  background: transparent;
  border: 1px solid rgba(245, 239, 227, 0.4);
  border-radius: 999px;
  cursor: pointer;
}

.ck-reaction:active {
  background: var(--tapis-2);
}

/* « S'asseoir ici » sur une place libre du salon */
.ck-places li.libre {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  opacity: 1;
}

.ck-places li.libre > span {
  opacity: 0.7;
}

.ck-asseoir {
  display: inline-block;
  margin: 0;
  padding: 4px 0;
  font-weight: 600;
  color: var(--jasmin);
}
