/* =============================================================
   GAME: Dominoes
   ============================================================= */
.board-dominoes { --dm-glow: #ffe7b0; width: 100%; max-width: 1000px; }
.dm-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.dm-table {
  --u: 24px; --hw: 40px;
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 18px;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(255, 231, 176, .07), transparent 60%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .012) 0 2px, transparent 2px 6px),
    radial-gradient(ellipse at 50% 30%, #42183d, #1c0a1e 75%);
  box-shadow: 0 0 0 2px var(--dm-glow), 0 0 28px rgba(255, 231, 176, .25), inset 0 0 40px rgba(0, 0, 0, .45);
}

/* opponents */
.dm-opps { display: flex; justify-content: center; gap: 10px; }
.dm-seat {
  position: relative; flex: 1 1 0; min-width: 0; max-width: 320px;
  display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "ava name cnt" "mini mini mini"; align-items: center; gap: 4px 8px;
  padding: 8px 10px; border-radius: 14px; background: rgba(0, 0, 0, .28); box-shadow: inset 0 0 0 1px rgba(255, 231, 176, .18);
  transition: box-shadow .2s;
}
.dm-seat.is-turn { box-shadow: 0 0 0 2px var(--seat), 0 0 18px color-mix(in srgb, var(--seat) 45%, transparent); }
.dm-ava { grid-area: ava; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(0, 0, 0, .35); color: var(--seat); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--seat) 60%, transparent); }
.dm-ava svg { width: 20px; height: 20px; }
.dm-sname { grid-area: name; font-weight: 800; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-cnt { grid-area: cnt; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; display: grid; place-items: center; background: var(--seat); color: #160a18; font-weight: 800; font-size: .8rem; }
.dm-mini { grid-area: mini; display: flex; flex-wrap: wrap; gap: 3px; min-height: 22px; }
.dm-mt { display: block; width: 11px; height: 22px; flex: none; }
.dm-mt svg { width: 100%; height: 100%; display: block; }
.dm-mini.open .dm-mt { width: 15px; height: 30px; }
.dm-say {
  position: absolute; top: -10px; right: 10px; z-index: 2; padding: 2px 9px; border-radius: 10px;
  background: var(--dm-glow); color: #24101f; font-weight: 800; font-size: .76rem; white-space: nowrap;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .4); animation: dm-pop .25s cubic-bezier(.3, 1.6, .5, 1);
}
.dm-say:empty { display: none; }
@keyframes dm-pop { from { transform: scale(.5); opacity: 0; } }

/* round info + boneyard */
.dm-info { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; }
.dm-round { color: var(--muted); font-weight: 700; font-size: .85rem; }
.dm-bone {
  display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 12px; padding: 6px 12px; min-height: 40px;
  background: rgba(0, 0, 0, .32); box-shadow: inset 0 0 0 1px rgba(255, 231, 176, .25); color: var(--ink); font: 800 .95rem var(--font-body); cursor: default;
}
.dm-bone[hidden] { display: none; }
.dm-bone.hot { cursor: pointer; box-shadow: 0 0 0 2px var(--dm-glow), 0 0 18px rgba(255, 231, 176, .55); animation: dm-hot 1.2s ease-in-out infinite alternate; }
@keyframes dm-hot { to { box-shadow: 0 0 0 2px var(--dm-glow), 0 0 28px rgba(255, 231, 176, .8); } }
.dm-bone:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.dm-bone.sleep { opacity: .7; }
.dm-bone-stack { display: flex; flex-direction: column; }
.dm-bone-stack span { display: block; width: 36px; height: 18px; }
.dm-bone-stack span + span { margin-top: -12px; }
.dm-bone-stack svg { width: 100%; height: 100%; display: block; }

/* line of play */
.dm-linewrap { display: flex; justify-content: center; padding: 6px 0; min-height: calc(var(--u) * 4); }
.dm-line { position: relative; flex: none; }
.dm-lt { position: absolute; display: block; padding: 1px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); }
.dm-lt svg { width: 100%; height: 100%; display: block; }
.dm-lt.new svg { animation: dm-land .9s ease-out; }
@keyframes dm-land { from { filter: drop-shadow(0 0 8px var(--dm-glow)) brightness(1.1); } }
.dm-ghost {
  position: absolute; padding: 0; margin: 0; border: 2px dashed rgba(255, 231, 176, .85); border-radius: 8px; cursor: pointer;
  background: rgba(255, 231, 176, .12); animation: dm-ghost 1s ease-in-out infinite alternate;
}
.dm-ghost:hover, .dm-ghost.over, .dm-ghost:focus-visible { background: rgba(255, 231, 176, .4); outline: none; box-shadow: 0 0 16px rgba(255, 231, 176, .7); }
@keyframes dm-ghost { to { background: rgba(255, 231, 176, .26); } }
.dm-note { margin: 0; min-height: 1.4em; text-align: center; color: var(--muted); font-weight: 600; font-size: .9rem; }

/* you */
.dm-me { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; min-height: 38px; }
.dm-you { --seat: #ffe7b0; }
.dm-mename { font-weight: 800; }
.dm-me.is-turn .dm-mename { color: var(--dm-glow); text-shadow: 0 0 10px rgba(255, 231, 176, .6); }
.dm-acts { display: inline-flex; gap: 8px; }
.dm-say-me { position: static; animation: dm-pop .25s cubic-bezier(.3, 1.6, .5, 1); }
.dm-hand { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 10px 0 2px; min-height: calc(var(--hw) * 2 + 14px); }
.dm-ht {
  position: relative; width: var(--hw); height: calc(var(--hw) * 2); padding: 0; margin: 0; border: 0; background: transparent; cursor: pointer;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .5)); transition: transform .15s, filter .15s, opacity .15s; -webkit-tap-highlight-color: transparent;
}
.dm-ht svg { width: 100%; height: 100%; display: block; }
.dm-ht.can { transform: translateY(-6px); filter: drop-shadow(0 6px 4px rgba(0, 0, 0, .5)) drop-shadow(0 0 5px rgba(255, 231, 176, .75)); touch-action: none; }
.dm-ht.can:hover { transform: translateY(-10px); }
.dm-ht.cant { opacity: .55; cursor: default; }
.dm-ht.picked { transform: translateY(-14px); filter: drop-shadow(0 8px 5px rgba(0, 0, 0, .5)) drop-shadow(0 0 8px #fff3c8) drop-shadow(0 0 3px #fff3c8); }
.dm-ht.dragging { z-index: 10; transition: none; opacity: .92; cursor: grabbing; }
.dm-ht:focus { outline: none; }
.dm-ht:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 8px; }

/* round summary (over the table) */
.dm-summary { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; padding: 10px; border-radius: 18px; background: rgba(10, 4, 14, .72); backdrop-filter: blur(2px); overflow: auto; }
.dm-summary[hidden] { display: none; }
.dm-sum-card {
  width: 100%; max-width: 520px; padding: 16px; border-radius: 16px; text-align: center; background: var(--surface-2);
  box-shadow: inset 0 0 0 1px rgba(255, 231, 176, .5), 0 0 40px rgba(255, 231, 176, .25); animation: dm-pop .25s ease;
}
.dm-sum-t { margin: 0 0 10px; font: 800 1.05rem var(--font-head); color: var(--dm-glow); }
.dm-sum-list { list-style: none; margin: 0 0 10px; padding: 0; text-align: left; }
.dm-sum-list li { display: grid; grid-template-columns: 70px 1fr auto 34px; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.dm-sum-list li.win { background: rgba(255, 231, 176, .08); border-radius: 8px; }
.dm-sn { font-weight: 800; color: var(--seat); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-st { display: flex; flex-wrap: wrap; gap: 2px; color: var(--muted); }
.dm-st .dm-mt { width: 13px; height: 26px; }
.dm-sp { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.dm-ss { text-align: right; font-size: 1.05rem; }
.dm-sum-sub { margin: 0 0 10px; color: var(--muted); font-size: .88rem; }
.dm-sum-sub:empty { display: none; }

@media (max-width: 600px) {
  .dm-table { padding: 8px; gap: 8px; border-radius: 14px; }
  .dm-opps { gap: 6px; }
  .dm-seat { padding: 6px 7px; gap: 3px 5px; grid-template-columns: auto 1fr auto; }
  .dm-opps[data-n="3"] .dm-ava { display: none; }
  .dm-opps[data-n="3"] .dm-seat { grid-template-areas: "name name cnt" "mini mini mini"; }
  .dm-sname { font-size: .8rem; }
  .dm-mt { width: 8px; height: 16px; }
  .dm-mini { gap: 2px; min-height: 16px; }
  .dm-mini.open .dm-mt { width: 11px; height: 22px; }
  .dm-sum-list li { grid-template-columns: 54px 1fr auto 28px; gap: 6px; }
  .dm-st .dm-mt { width: 10px; height: 20px; }
}
/* empty table: a faint spot where the first tile goes */
.dm-slot { position: absolute; border-radius: 8px; border: 2px dashed rgba(255, 231, 176, .22); background: rgba(255, 231, 176, .04); }
