/* Dominó: fichas (domino-ui.js), mesa, mano y marcador. Usa la disposición y los botones de chess.css. */

.dm-tile rect { fill: #f6f1e3; stroke: #6b5a3a; stroke-width: 2; }
.dm-tile line { stroke: #8b7a55; stroke-width: 2; }
.dm-tile circle { fill: #1c1712; }
.dm-tile.back rect { fill: #4a3320; stroke: #2a1d10; }
.dm-tile.back circle { fill: #c99a3f; }
.dm-tile.h { width: calc(var(--dm-u, 30px) * 2); height: var(--dm-u, 30px); }
.dm-tile.v { width: var(--dm-u, 30px); height: calc(var(--dm-u, 30px) * 2); }

/* Mesa */
.dm-table {
  position: relative;
  min-height: 300px;
  padding: 14px 8px;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 40%, #2f5a32 0%, #1f3d22 70%);
  box-shadow: inset 0 0 0 3px #4a3320, inset 0 0 30px rgba(0, 0, 0, .45);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  overflow: hidden;
}
.dm-row { display: flex; align-items: center; gap: 3px; }
.dm-row.rev { flex-direction: row-reverse; }
.dm-row:nth-child(odd) { justify-content: flex-start; }
.dm-row.rev { justify-content: flex-start; }
.dm-table.single .dm-row { justify-content: center; }
.dm-cell { display: inline-flex; border-radius: 8px; line-height: 0; }
.dm-cell svg { display: block; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .4)); }
.dm-last svg rect { fill: #fff4cc; }
.dm-end-ok { cursor: pointer; outline: 3px solid var(--accent); outline-offset: 2px; animation: dm-pulse 1.2s ease-in-out infinite; }
@keyframes dm-pulse { 50% { outline-color: rgba(201, 154, 63, .35); } }
.dm-empty {
  margin: auto;
  color: rgba(255, 255, 255, .6);
  border: 2px dashed rgba(255, 255, 255, .25);
  border-radius: 12px;
  padding: 26px 34px;
}
.dm-empty.dm-end-ok { color: var(--text); }

/* Jugadores, mano y fichas del rival */
.dm-player { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 6px 2px; flex-wrap: wrap; }
.dm-player .cp-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dm-player .cp-av {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  font-size: 18px;
}
.dm-player .cp-name { font-weight: 700; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-player a.cp-name:hover { text-decoration: underline; }
.dm-score { font: 700 22px/1 ui-monospace, Consolas, monospace; color: var(--accent); min-width: 44px; text-align: right; }
.dm-backs { display: flex; gap: 2px; --dm-u: 13px; }
.dm-backs .dm-tile { width: 13px; height: 26px; }

.dm-hand { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 10px 4px; --dm-u: 34px; }
.dm-hand-tile { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 8px; line-height: 0; transition: transform .12s ease; }
.dm-hand-tile.ok { transform: translateY(-4px); }
.dm-hand-tile.ok svg rect { stroke: var(--accent-2); stroke-width: 3; }
.dm-hand-tile.no { opacity: .45; cursor: default; }
.dm-hand-tile.sel { transform: translateY(-10px); }
.dm-hand-tile.sel svg rect { stroke: var(--accent); stroke-width: 4; }
.dm-hand-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dm-hand-tile:disabled { cursor: default; }

.dm-timer { height: 6px; border-radius: 3px; background: var(--bg-elevated); overflow: hidden; }
.dm-timer > span { display: block; height: 100%; background: var(--accent-2); transition: width .2s linear; }
.dm-timer.low > span { background: #c1503a; }

.dm-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.dm-pool { color: var(--text-dim); font-size: 14px; }
.dm-sides { display: flex; gap: 8px; justify-content: center; }
.dm-banner {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: rgba(201, 154, 63, .12);
  font-weight: 600;
}
.dm-reveal { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; font-weight: 400; color: var(--text-dim); font-size: 13px; }
.dm-reveal .dm-mini { display: flex; flex-wrap: wrap; gap: 2px; --dm-u: 12px; align-items: center; }
.dm-reveal .dm-tile.v { width: 12px; height: 24px; }

.dm-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 860px) {
  .dm-layout { grid-template-columns: 1fr; }
  .dm-table { min-height: 220px; }
}

@media (prefers-reduced-motion: reduce) {
  .dm-end-ok { animation: none; }
  .dm-hand-tile { transition: none; }
}
