/* ═══ DOMINOS — Evotic Edge ═══
   Solo vs IA (2-4 joueurs), double-six (28 dominos), variante pioche.
   Réutilise le chrome games-shell (.gs-*). Styles spécifiques ci-dessous. */

.dom-stage { display: flex; flex-direction: column; height: 100%; min-height: 0; }

/* ─── Lobby (choix nb joueurs) ─── */
.dom-lobby { padding: 26px 20px; text-align: center; }
.dom-lobby h2 { font-size: 20px; font-weight: 900; color: var(--gs-txt); margin: 0 0 14px; }
.dom-lobby p { font-size: 13px; color: var(--gs-txt3); margin: 0 0 22px; }
/* Mode segmenté : Ordinateur / Entre amis */
.dom-mode-seg { display: inline-flex; flex-wrap: wrap; justify-content: center; background: var(--gs-card, #f0ede4); border-radius: 999px; padding: 4px; gap: 4px; margin: 0 auto; }
#dom-online-section { display: flex; flex-direction: column; align-items: center; gap: 4px; }
#dom-online-section .gs-btn { min-width: 220px; }
.dom-mode-btn {
  border: none; background: transparent; color: var(--gs-txt3); font-family: inherit;
  font-size: 13px; font-weight: 800; padding: 8px 16px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: background .15s, color .15s;
}
.dom-mode-btn.active { background: #1565C0; color: #fff; }
.dom-mode-hint { font-size: 12.5px; color: var(--gs-txt3); margin: 12px 0 18px; min-height: 16px; }
.dom-count-title { font-size: 14px; font-weight: 800; color: var(--gs-txt); margin: 0 0 12px; }
.dom-count-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.dom-count-btn {
  width: 86px; height: 92px; border: 2px solid var(--gs-border, #e2d9bf);
  border-radius: 16px; background: var(--gs-card, #fff);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; cursor: pointer; font-family: inherit; transition: transform .12s, box-shadow .12s;
}
.dom-count-btn:active { transform: scale(.95); }
.dom-count-btn i { font-size: 26px; color: #1565C0; }
.dom-count-btn span { font-size: 13px; font-weight: 800; color: var(--gs-txt); }

/* ─── Opponents bar ─── */
.dom-players { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding: 10px 8px; }
.dom-player {
  display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px;
  background: var(--gs-card, #fff); border: 1.5px solid transparent;
  font-size: 12px; font-weight: 800; color: var(--gs-txt);
}
.dom-player.active { border-color: #6750A4; box-shadow: 0 0 0 2px rgba(103, 80, 164,.15); }
.dom-player i { color: #1565C0; }
.dom-player .dom-count-badge {
  background: #1565C0; color: #fff; border-radius: 999px; min-width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; padding: 0 5px;
}

/* ─── Board ─── */
.dom-board-wrap { flex: 1; min-height: 130px; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; background: rgba(0,0,0,.03); }
.dom-board {
  /* Une seule ligne continue (pas de wrap) → la chaîne s'étend et on scrolle
     horizontalement pour voir le reste, au lieu de casser en lignes séparées. */
  display: flex; align-items: center; flex-wrap: nowrap; gap: 0;
  padding: 14px; min-height: 100%; box-sizing: border-box; justify-content: flex-start;
  width: max-content; min-width: 100%;
}
.dom-board.empty { justify-content: center; width: 100%; }
/* Tuiles adjacentes : ombre réduite + on évite le double-bord visuel pour un rendu "collé". */
.dom-board .dom-tile { box-shadow: 0 1px 2px rgba(0,0,0,.18); }
.dom-board .dom-tile + .dom-tile { margin-left: -2px; }
.dom-board.empty::after { content: "Pose le premier domino"; color: var(--gs-txt3); font-size: 13px; font-weight: 700; }
/* Animation de pose : le domino "monte" de la main vers le plateau */
@keyframes dom-drop { 0% { opacity: 0; transform: translateY(48px) scale(.6); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
.dom-board .dom-tile.dom-placed { animation: dom-drop .34s cubic-bezier(.34, 1.25, .6, 1); }
@media (prefers-reduced-motion: reduce) { .dom-board .dom-tile.dom-placed { animation: none; } }

/* ─── Tile ─── */
.dom-tile {
  display: inline-flex; background: #fffdf3; border: 2px solid #d8cba0;
  border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,.12); overflow: hidden; flex: 0 0 auto;
}
.dom-tile.v { flex-direction: column; }
.dom-tile.h { flex-direction: row; }
.dom-half { width: 30px; height: 30px; display: grid; grid-template-columns: repeat(3,1fr); grid-template-rows: repeat(3,1fr); padding: 3px; box-sizing: border-box; }
/* Vertical (portrait) tile — halves stacked, divider horizontal (double / main) */
.dom-tile.v .dom-half:first-child { border-bottom: 2px solid #c9bb8d; }
/* Horizontal (landscape) tile — halves side by side, divider vertical */
.dom-tile.h .dom-half:first-child { border-right: 2px solid #c9bb8d; }
.dom-cell { display: flex; align-items: center; justify-content: center; }
.dom-pip { width: 6px; height: 6px; border-radius: 50%; background: #2a2a2a; }

/* hand tiles bigger + interactive */
.dom-hand-wrap { padding: 8px 6px 4px; }
.dom-hand-label { font-size: 11px; font-weight: 800; color: var(--gs-txt3); text-transform: uppercase; letter-spacing: .5px; padding: 0 10px 4px; }
.dom-hand { display: flex; gap: 6px; overflow-x: auto; padding: 4px 10px 12px; -webkit-overflow-scrolling: touch; }
.dom-hand .dom-half { width: 36px; height: 36px; }
.dom-hand .dom-tile { cursor: default; transition: transform .12s, box-shadow .12s, opacity .12s; }
.dom-hand .dom-tile.playable { cursor: pointer; box-shadow: 0 0 0 3px #6750A4, 0 2px 4px rgba(0,0,0,.12); }
.dom-hand .dom-tile.playable:active { transform: scale(.94); }
.dom-hand .dom-tile.dim { opacity: .4; }
.dom-hand .dom-tile.selected { box-shadow: 0 0 0 3px #1565C0, 0 2px 6px rgba(0,0,0,.18); }

/* ─── End drop targets (when a tile is selected & both ends valid) ─── */
.dom-ends { display: flex; gap: 12px; justify-content: center; padding: 6px; }
.dom-end-btn {
  display: none; padding: 10px 18px; border-radius: 12px; border: 2px dashed #6750A4;
  background: rgba(103, 80, 164,.08); color: #6750A4; font-weight: 900; font-size: 13px;
  font-family: inherit; cursor: pointer; align-items: center; gap: 6px;
}
.dom-ends.show .dom-end-btn { display: inline-flex; }
.dom-end-btn:active { transform: scale(.95); }

/* ─── Controls ─── */
.dom-controls { display: flex; gap: 10px; justify-content: center; padding: 8px 10px 14px; flex-wrap: wrap; }
.dom-status { text-align: center; font-size: 13px; font-weight: 800; color: var(--gs-txt); padding: 6px 12px; min-height: 20px; }
.dom-status.my-turn { color: #6750A4; }
.dom-pile-btn .dom-pile-n { background: #1565C0; color: #fff; border-radius: 999px; padding: 1px 7px; margin-left: 6px; font-size: 12px; }

@media (max-width: 360px) {
  .dom-half { width: 26px; height: 26px; }
  .dom-hand .dom-half { width: 32px; height: 32px; }
  .dom-pip { width: 5px; height: 5px; }
}
