/* In-phone Dominoes — midnight room, teal felt table, ivory tiles with black pips and a brass pin */

.wondalife-phone-screen.is-app:has(.dm-app) {
  background: #060d17;
}
.wondalife-phone-screen.is-app:has(.dm-app) .wondalife-phone-status {
  color: #eef4fb;
}
.wondalife-phone-screen.is-app:has(.dm-app) .wondalife-phone-signal::before {
  background: #eef4fb;
  box-shadow: 4px 0 0 #eef4fb, 8px -2px 0 #eef4fb, 12px -4px 0 #eef4fb;
}
.wondalife-phone-screen.is-app:has(.dm-app) .wondalife-phone-battery {
  border-color: #eef4fb;
}
.wondalife-phone-screen.is-app:has(.dm-app) .wondalife-phone-battery::before,
.wondalife-phone-screen.is-app:has(.dm-app) .wondalife-phone-battery::after {
  background: #eef4fb;
}
.wondalife-phone-screen.is-app:has(.dm-app) .wondalife-phone-homebar {
  background: rgba(238, 244, 251, 0.35);
}
.wondalife-phone-screen.is-app .wondalife-phone-body:has(.dm-app) {
  padding: 0 0 22px;
  overflow: hidden;
  height: 100%;
}

.dm-app {
  --gold: #f5c84c;
  --fit: #fcd34d;
  --ivory-1: #fffdf6;
  --ivory-2: #ece2cc;
  --ivory-edge: #b8a682;
  --felt: #0f3b4f;
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: 24px;
  background: radial-gradient(130% 75% at 50% 0%, #16324a 0%, #0b1a2b 55%, #060d17 100%);
  color: #eef4fb;
  font-family: Poppins, "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
  z-index: 4;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* Header */
.dm-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 4px;
  flex-shrink: 0;
}
.dm-head__title {
  min-width: 0;
}
.dm-head h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-top: 0.4em;
  margin-top: -0.4em;
}
.dm-head h1 span {
  font-size: 11px;
  font-weight: 500;
  color: rgba(238, 244, 251, 0.55);
}
.dm-head__icon {
  display: inline-block;
  width: 0.84em;
  height: 1.4em;
  margin: -0.35em 0.15em 0 0.05em;
  vertical-align: -0.32em;
  transform: rotate(-12deg);
  filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.5));
}
.dm-head p {
  margin: 1px 0 0;
  font-size: 10.5px;
  color: rgba(238, 244, 251, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dm-head__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.dm-x {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.dm-hold {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 7px 11px;
  font: 600 10.5px/1 Poppins, "Segoe UI", sans-serif;
  color: #e9f0f8;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  touch-action: none;
}
.dm-hold span {
  position: relative;
}
.dm-hold::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #c62f3d, #e5484d);
  transform: scaleX(0);
  transform-origin: left center;
}
.dm-hold.is-holding::before {
  animation: dm-hold 1.2s linear both;
  animation-delay: var(--hold-delay, 0ms);
}
@keyframes dm-hold {
  to { transform: scaleX(1); }
}
.dm-live {
  font-size: 10.5px;
  font-weight: 600;
  color: #ff8a8a;
}

/* Round bar */
.dm-roundbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px 6px;
  flex-shrink: 0;
  min-width: 0;
}
.dm-round {
  font-size: 10.5px;
  font-weight: 600;
  color: rgba(238, 244, 251, 0.75);
  white-space: nowrap;
}
.dm-market {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 5px;
  border-radius: 999px;
  background: rgba(245, 200, 76, 0.12);
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.dm-market.is-empty {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(238, 244, 251, 0.5);
}
.dm-market .dm-back {
  width: 7px;
  height: 12px;
}
.dm-roundbar__gap {
  flex: 1;
}
.dm-pill {
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(255, 255, 255, 0.07);
  color: #e9f0f8;
  font: 600 10.5px/1 Poppins, "Segoe UI", sans-serif;
  cursor: pointer;
}

/* Tile backs: opponents' hands and the market */
.dm-back {
  display: inline-block;
  flex-shrink: 0;
  width: 9px;
  height: 15px;
  border-radius: 2px;
  background:
    radial-gradient(circle at 50% 50%, var(--gold) 0 1.3px, transparent 1.6px),
    linear-gradient(160deg, #7a1d2b, #4a0f19);
  box-shadow: inset 0 0 0 1px rgba(255, 220, 160, 0.35), 0 1px 0 rgba(0, 0, 0, 0.5);
}

/* Opponents */
.dm-opps {
  display: grid;
  grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr));
  gap: 6px;
  padding: 0 10px 6px;
  flex-shrink: 0;
}
.dm-opps--2 { --cols: 2; }
.dm-opps--3 { --cols: 3; }
.dm-opps--4 { --cols: 4; }
.dm-seat {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  padding: 6px 4px 5px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid transparent;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.dm-opps--1 .dm-seat {
  flex-direction: row;
  justify-content: center;
  gap: 10px;
  padding: 5px 10px;
}
.dm-seat.is-turn {
  border-color: rgba(245, 200, 76, 0.85);
  background: rgba(245, 200, 76, 0.08);
  box-shadow: 0 0 14px rgba(245, 200, 76, 0.18);
}
.dm-seat.is-champ {
  border-color: rgba(74, 222, 128, 0.8);
  background: rgba(74, 222, 128, 0.08);
}
.dm-seat.is-last:not(.is-turn) {
  border-color: rgba(248, 113, 113, 0.55);
}
.dm-seat > strong {
  max-width: 100%;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dm-seat__av {
  --pct: 0;
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}
.dm-seat__av.is-turn {
  background: conic-gradient(var(--gold) calc(var(--pct) * 1%), rgba(255, 255, 255, 0.14) 0);
}
.dm-seat__av img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: cover;
  object-position: center top;
  background: linear-gradient(180deg, #dbe7f3, #9fb6cc);
  border: 2px solid #0b1a2b;
}
.dm-seat.is-last .dm-seat__av:not(.is-turn) {
  background: rgba(248, 113, 113, 0.75);
  animation: dm-last 1.2s ease-in-out infinite;
}
@keyframes dm-last {
  50% { box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.25); }
}
.dm-crown {
  position: absolute;
  top: -13px;
  left: 50%;
  z-index: 2;
  font-style: normal;
  font-size: 17px;
  line-height: 1;
  transform: translateX(-50%) rotate(-8deg);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5));
}
.dm-bubble {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  font-size: 24px;
  line-height: 1;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.45));
  animation: dm-bubble 2.6s ease-out both;
  pointer-events: none;
}
@keyframes dm-bubble {
  0% { opacity: 0; transform: scale(0.3); }
  12% { opacity: 1; transform: scale(1.25); }
  20% { transform: scale(1); }
  80% { opacity: 1; transform: translateY(-4px); }
  100% { opacity: 0; transform: translateY(-12px) scale(0.9); }
}
.dm-opps--1 .dm-seat > strong,
.dm-opps--1 .dm-seat__meta,
.dm-opps--1 .dm-note {
  align-self: center;
}
.dm-seat__meta {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  font-size: 10.5px;
  line-height: 1.2;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.dm-seat__meta b {
  font-weight: 700;
}
.dm-seat__meta em {
  font-style: normal;
  font-weight: 700;
  color: var(--gold);
}
.dm-backs {
  display: inline-flex;
  padding-right: 4px;
}
.dm-backs .dm-back {
  width: 7px;
  height: 12px;
  margin-right: -3px;
}
.dm-opps--3 .dm-backs,
.dm-opps--4 .dm-backs {
  display: none;
}
.dm-note {
  min-height: 1.35em;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.35;
  color: rgba(238, 244, 251, 0.6);
  white-space: nowrap;
}
.dm-note.is-win {
  color: #4ade80;
  font-size: 11px;
}
.dm-note.is-knock {
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(251, 146, 60, 0.18);
  color: #fdba74;
  animation: dm-knock 0.5s ease-out both;
}
@keyframes dm-knock {
  0% { transform: scale(0.6); opacity: 0; }
  25% { transform: scale(1.18) rotate(-4deg); opacity: 1; }
  45% { transform: scale(0.96) rotate(3deg); }
  100% { transform: none; }
}
.dm-note.is-market {
  color: var(--gold);
}
.dm-note.is-last {
  color: #fca5a5;
}
.dm-dots {
  display: inline-flex;
  gap: 3px;
  margin-left: 4px;
  vertical-align: middle;
}
.dm-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(238, 244, 251, 0.7);
  animation: dm-dot 1s ease-in-out infinite;
}
.dm-dots i:nth-child(2) { animation-delay: 0.15s; }
.dm-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dm-dot {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

/* Table: a felt with a wooden rail; the line of play is laid out as a snake inside it */
.dm-table {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  margin: 0 10px 8px;
  border-radius: 22px;
  background:
    radial-gradient(90% 70% at 50% 45%, #165068 0%, var(--felt) 60%, #0a2a39 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 0 40px rgba(0, 0, 0, 0.45),
    0 0 0 4px #2b1a0e,
    0 0 0 5px #4a2f18,
    0 12px 26px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.dm-table::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 4px 4px;
  pointer-events: none;
}
.dm-line {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  margin: 10px;
  container-type: size;
  display: grid;
  place-items: center;
}
.dm-line__empty {
  max-width: 240px;
  margin: 0;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  color: rgba(238, 244, 251, 0.82);
}
.dm-snake {
  --u: min(calc(100cqw / var(--bw)), calc(100cqh / var(--bh)), 34px);
  position: relative;
  width: calc(var(--bw) * var(--u));
  height: calc(var(--bh) * var(--u));
}
.dm-snake .dm-line__tile,
.dm-snake .dm-slot {
  position: absolute;
  left: calc(var(--x) * var(--u));
  top: calc(var(--y) * var(--u));
}
.dm-line__tile.is-new {
  z-index: 2;
  animation: dm-place 340ms cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
}
.dm-line__tile.is-from-me {
  animation-name: dm-place-me;
}
@keyframes dm-place {
  0% { opacity: 0; transform: translateY(-160%) rotate(-18deg) scale(1.25); }
  70% { opacity: 1; transform: translateY(4%) rotate(2deg) scale(1.02); }
  100% { transform: none; }
}
@keyframes dm-place-me {
  0% { opacity: 0; transform: translateY(220%) rotate(14deg) scale(1.3); }
  70% { opacity: 1; transform: translateY(-4%) rotate(-2deg) scale(1.02); }
  100% { transform: none; }
}
.dm-slot {
  z-index: 3;
  width: calc(var(--w) * var(--u));
  height: calc(var(--h) * var(--u));
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.dm-slot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: calc(var(--u) * 0.22);
  border: 2px dashed var(--fit);
  box-shadow: 0 0 12px rgba(252, 211, 77, 0.55);
  animation: dm-slot 1s ease-in-out infinite;
  pointer-events: none;
}
@keyframes dm-slot {
  50% { opacity: 0.45; transform: scale(1.06); }
}

/* Tile faces: sized by --u (one half is u × u). */
.dm-tile {
  --u: 20px;
  position: relative;
  display: grid;
  flex-shrink: 0;
  box-sizing: border-box;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: calc(var(--u) * 0.16);
  background: linear-gradient(150deg, var(--ivory-1) 0%, #f6efdf 45%, var(--ivory-2) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(80, 60, 30, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 calc(var(--u) * 0.07) 0 var(--ivory-edge),
    0 calc(var(--u) * 0.1) calc(var(--u) * 0.16) rgba(0, 0, 0, 0.45);
  font: inherit;
  color: inherit;
}
.dm-line .dm-tile,
.dm-hand .dm-tile {
  --u: inherit;
}
.dm-tile--v {
  width: var(--u);
  height: calc(var(--u) * 2);
  grid-template-rows: 1fr 1fr;
}
.dm-tile--h {
  width: calc(var(--u) * 2);
  height: var(--u);
  grid-template-columns: 1fr 1fr;
}
.dm-half {
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  padding: calc(var(--u) * 0.13);
  min-width: 0;
  min-height: 0;
}
.dm-tile--v .dm-half + .dm-half {
  box-shadow: inset 0 1px 0 rgba(60, 45, 20, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.7);
}
.dm-tile--h .dm-half + .dm-half {
  box-shadow: inset 1px 0 0 rgba(60, 45, 20, 0.45), inset 2px 0 0 rgba(255, 255, 255, 0.7);
}
.dm-tile::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--u) * 0.15);
  height: calc(var(--u) * 0.15);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 35% 30%, #fff3c4 0%, #d4a72c 55%, #8a6512 100%);
  box-shadow: 0 0 0 0.5px rgba(80, 55, 10, 0.6);
}
.dm-pip {
  place-self: center;
  width: 74%;
  height: 74%;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #4a4a4a 0%, #121212 60%, #000 100%);
  box-shadow: inset 0 0.5px 0 rgba(0, 0, 0, 0.6), 0 0.5px 0 rgba(255, 255, 255, 0.8);
}
.dm-pip.p0 { grid-area: 1 / 1; }
.dm-pip.p1 { grid-area: 1 / 2; }
.dm-pip.p2 { grid-area: 1 / 3; }
.dm-pip.p3 { grid-area: 2 / 1; }
.dm-pip.p4 { grid-area: 2 / 2; }
.dm-pip.p5 { grid-area: 2 / 3; }
.dm-pip.p6 { grid-area: 3 / 1; }
.dm-pip.p7 { grid-area: 3 / 2; }
.dm-pip.p8 { grid-area: 3 / 3; }
.dm-tile.is-ghost {
  width: 100%;
  height: 100%;
  opacity: 0.55;
  box-shadow: inset 0 0 0 1px rgba(80, 60, 30, 0.3);
}

/* Round end: the Domino / Blocked stamp, then the round summary */
.dm-table.is-over .dm-line {
  filter: saturate(0.7) brightness(0.8);
  transition: filter 0.4s ease;
}
.dm-flash {
  position: absolute;
  left: 50%;
  top: 46%;
  z-index: 6;
  padding: 6px 20px 8px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fde68a, #f59e0b);
  color: #3b1d02;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0.04em;
  white-space: nowrap;
  box-shadow: 0 0 0 3px #3b1d02, 0 0 0 5px #fde68a, 0 14px 30px rgba(0, 0, 0, 0.55);
  animation: dm-flash 1.3s cubic-bezier(0.2, 0.9, 0.3, 1.1) both;
  pointer-events: none;
}
.dm-flash.is-block {
  background: linear-gradient(180deg, #e2e8f0, #94a3b8);
  color: #0f172a;
  box-shadow: 0 0 0 3px #0f172a, 0 0 0 5px #e2e8f0, 0 14px 30px rgba(0, 0, 0, 0.55);
}
@keyframes dm-flash {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(2.6) rotate(-14deg); }
  22% { opacity: 1; transform: translate(-50%, -50%) scale(0.92) rotate(-6deg); }
  32% { transform: translate(-50%, -50%) scale(1.05) rotate(-6deg); }
  78% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-6deg); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.9) rotate(-6deg); }
}
.dm-roundend {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 50%;
  z-index: 5;
  max-height: calc(100% - 20px);
  overflow-y: auto;
  padding: 12px 12px 10px;
  border-radius: 18px;
  background: rgba(6, 13, 23, 0.92);
  border: 1px solid rgba(245, 200, 76, 0.35);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55);
  text-align: center;
  transform: translateY(-50%);
  animation: dm-roundend 0.3s ease-out both;
  scrollbar-width: thin;
}
.dm-roundend.is-block {
  border-color: rgba(203, 213, 225, 0.35);
}
@keyframes dm-roundend {
  from { opacity: 0; transform: translateY(-46%) scale(0.94); }
  to { opacity: 1; transform: translateY(-50%); }
}
.dm-roundend > strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dm-roundend > p {
  margin: 2px 0 8px;
  font-size: 11px;
  color: rgba(238, 244, 251, 0.7);
}
.dm-roundend ul {
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 3px;
}
.dm-roundend li {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.5fr) 36px 34px;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 11px;
  text-align: left;
  font-variant-numeric: tabular-nums;
}
.dm-roundend li.is-win {
  background: rgba(74, 222, 128, 0.14);
}
.dm-roundend li > b {
  min-width: 0;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dm-roundend li.dm-roundend__head {
  padding-top: 0;
  padding-bottom: 0;
  background: none;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(238, 244, 251, 0.45);
}
.dm-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  min-width: 0;
}
.dm-mini .dm-tile {
  --u: 8px;
}
.dm-mini em {
  font-style: normal;
  font-size: 10.5px;
  color: #4ade80;
}
.dm-roundend__pips,
.dm-roundend__score {
  text-align: right;
}
li.is-win .dm-roundend__pips {
  color: #4ade80;
  font-weight: 700;
}
.dm-roundend__score {
  font-weight: 700;
  color: var(--gold);
}
.dm-roundend__head .dm-roundend__score,
.dm-roundend__head span {
  color: inherit;
  font-weight: inherit;
}
.dm-roundend__next {
  margin: 0;
  font-size: 11.5px;
  color: rgba(238, 244, 251, 0.75);
}
.dm-roundend__next b {
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.dm-roundend__next.is-champ {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
}

/* Your seat and hand */
.dm-me {
  position: relative;
  flex-shrink: 0;
  margin: 0 8px;
  padding: 6px 8px 8px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid transparent;
  container-type: inline-size;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.dm-me.is-turn {
  border-color: rgba(245, 200, 76, 0.7);
  box-shadow: 0 0 18px rgba(245, 200, 76, 0.15);
}
.dm-me__row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.dm-me__av {
  width: 36px;
  height: 36px;
}
.dm-me__txt {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}
.dm-me__txt strong {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.dm-prompt {
  min-height: 1.35em;
  font-size: 11px;
  line-height: 1.35;
  color: rgba(238, 244, 251, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dm-prompt.is-you {
  color: #fff;
  font-weight: 600;
}
.dm-prompt.is-warn {
  color: #fdba74;
  font-weight: 600;
}
.dm-secs {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.dm-secs.is-low {
  color: #ff7a7a;
}
.dm-me__cue {
  flex-shrink: 0;
  white-space: nowrap;
}
.dm-react {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 17px;
  cursor: pointer;
}
.dm-reacts {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 12;
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: #13263a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  animation: dm-pop 0.18s ease-out both;
}
.dm-reacts button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 19px;
  cursor: pointer;
}
@keyframes dm-pop {
  from { opacity: 0; transform: translateY(4px) scale(0.92); }
  to { opacity: 1; transform: none; }
}

.dm-hand {
  --u: clamp(17px, calc((100cqw - 8px - (var(--n) - 1) * 6px) / var(--n)), 32px);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: flex-end;
  gap: 8px 6px;
  min-height: calc(var(--u) * 2 + 14px);
  padding: 14px 0 2px;
}
.dm-hand__tile {
  cursor: default;
  transition: transform 0.18s ease, opacity 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}
.dm-hand__tile.is-fits {
  cursor: pointer;
  transform: translateY(-7px);
  box-shadow:
    inset 0 0 0 1px rgba(80, 60, 30, 0.22),
    0 calc(var(--u) * 0.07) 0 var(--ivory-edge),
    0 0 0 2px var(--fit),
    0 0 14px rgba(252, 211, 77, 0.7);
  animation: dm-fits 1.4s ease-in-out infinite;
}
@keyframes dm-fits {
  50% { transform: translateY(-9px); }
}
.dm-hand__tile.is-dim {
  opacity: 0.42;
  filter: saturate(0.4);
}
.dm-hand__tile.is-selected {
  transform: translateY(-14px) scale(1.06);
  box-shadow:
    inset 0 0 0 1px rgba(80, 60, 30, 0.22),
    0 calc(var(--u) * 0.07) 0 var(--ivory-edge),
    0 0 0 2.5px #fff,
    0 0 18px rgba(252, 211, 77, 0.9);
  animation: none;
}
.dm-hand__tile.is-nope {
  animation: dm-nope 0.42s ease-in-out both;
  box-shadow: 0 0 0 2px #ef4444, 0 0 12px rgba(239, 68, 68, 0.6);
}
@keyframes dm-nope {
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}
.dm-hand__tile.is-drawn {
  animation: dm-drawn 420ms cubic-bezier(0.2, 0.9, 0.3, 1.1) both;
}
.dm-hand__tile.is-drawn.is-fits {
  animation: dm-drawn 420ms cubic-bezier(0.2, 0.9, 0.3, 1.1) both, dm-fits 1.4s ease-in-out 420ms infinite;
}
@keyframes dm-drawn {
  0% { opacity: 0; transform: translate(60%, -240%) rotate(40deg) scale(0.6); }
  100% { opacity: 1; transform: translateY(-7px); }
}
.dm-hand__empty {
  margin: 0;
  font-size: 12px;
  color: rgba(238, 244, 251, 0.6);
}
.dm-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding-top: 6px;
}
.dm-act {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 7px 13px;
  background: rgba(255, 255, 255, 0.07);
  color: #e9f0f8;
  font: 600 11.5px/1.2 Poppins, "Segoe UI", sans-serif;
  cursor: pointer;
}
.dm-act--go {
  background: #1fb36a;
  border-color: transparent;
  color: #fff;
}
.dm-me .dm-act--go {
  animation: dm-go 1.2s ease-in-out infinite;
}
@keyframes dm-go {
  50% { box-shadow: 0 0 0 5px rgba(31, 179, 106, 0.25); }
}

/* Footer once the game ends */
.dm-foot {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 12px 0;
}
.dm-foot p {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

/* Sheets: scores, rules */
.dm-sheet {
  position: absolute;
  inset: 0;
  z-index: 16;
  display: flex;
  align-items: flex-end;
  background: rgba(0, 0, 0, 0.45);
}
.dm-sheet__panel {
  width: 100%;
  max-height: 74%;
  display: flex;
  flex-direction: column;
  padding: 10px 14px 28px;
  border-radius: 20px 20px 0 0;
  background: #0f2136;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  animation: dm-sheet 0.22s ease-out both;
}
@keyframes dm-sheet {
  from { transform: translateY(40%); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.dm-sheet__panel header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.dm-sheet__panel h2 {
  margin: 0;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dm-sheet__note {
  margin: 0 0 8px;
  font-size: 11px;
  line-height: 1.4;
  color: rgba(238, 244, 251, 0.6);
}
.dm-scores-wrap {
  overflow: auto;
  scrollbar-width: thin;
}
.dm-scores {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.dm-scores th,
.dm-scores td {
  padding: 5px 4px;
  text-align: center;
  white-space: nowrap;
}
.dm-scores th {
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10px;
  font-weight: 600;
  color: rgba(238, 244, 251, 0.6);
}
.dm-scores th:first-child,
.dm-scores td:first-child {
  text-align: left;
}
.dm-scores tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.04);
}
.dm-scores td.is-win {
  color: #4ade80;
  font-weight: 700;
}
.dm-scores small {
  font-size: 9.5px;
  color: rgba(238, 244, 251, 0.5);
}
.dm-scores__total td {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-weight: 800;
  color: var(--gold);
}
.dm-rules {
  overflow-y: auto;
  padding-right: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(238, 244, 251, 0.25) transparent;
}
.dm-rules__tiles {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 0 2px;
}
.dm-rules__tiles .dm-tile {
  --u: 18px;
}
.dm-rules ol {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(238, 244, 251, 0.85);
}
.dm-rules b {
  color: #fff;
}
.dm-rules h3 {
  margin: 14px 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(238, 244, 251, 0.6);
}
.dm-legend {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  font-size: 12px;
  color: rgba(238, 244, 251, 0.85);
}
.dm-legend li {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dm-legend__tile {
  flex-shrink: 0;
  width: 13px;
  height: 24px;
  margin-left: 4px;
  border-radius: 3px;
  background: linear-gradient(150deg, var(--ivory-1), var(--ivory-2));
}
.dm-legend__tile.is-fits {
  box-shadow: 0 0 0 2px var(--fit), 0 0 10px rgba(252, 211, 77, 0.7);
}
.dm-legend__tile.is-ghost {
  background: rgba(255, 253, 246, 0.35);
  outline: 2px dashed var(--fit);
  outline-offset: 2px;
}
.dm-legend__tile.is-last {
  width: 22px;
  height: 22px;
  margin-left: 0;
  border-radius: 50%;
  background: rgba(248, 113, 113, 0.75);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.25);
}

/* Result */
.dm-modal {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}
.dm-modal__panel {
  width: min(100%, 290px);
  padding: 18px 16px 14px;
  border-radius: 24px;
  background: linear-gradient(180deg, #16324a, #0b1a2b);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  text-align: center;
  animation: dm-pop 0.25s ease-out both;
}
.dm-modal__panel.is-win {
  border-color: rgba(245, 200, 76, 0.5);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), 0 0 30px rgba(245, 200, 76, 0.18);
}
.dm-modal__icon {
  display: block;
  width: 36px;
  height: 60px;
  margin: -4px auto 6px;
  transform: rotate(-12deg);
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45));
}
.dm-modal__panel h2 {
  margin: 0 0 4px;
  font-size: 21px;
  font-weight: 700;
}
.dm-modal__panel > p {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.4;
  color: rgba(238, 244, 251, 0.72);
}
.dm-standings {
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 3px;
}
.dm-standings li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 12px;
  text-align: left;
}
.dm-standings li.is-you {
  background: rgba(245, 200, 76, 0.12);
  box-shadow: inset 0 0 0 1px rgba(245, 200, 76, 0.35);
}
.dm-standings span {
  font-size: 14px;
  text-align: center;
}
.dm-standings b {
  min-width: 0;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dm-standings em {
  font-style: normal;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.dm-modal__money {
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 15px;
  font-weight: 600;
}
.dm-modal__money.is-loss {
  background: rgba(150, 50, 50, 0.35);
  color: #ffc9c9;
}
.dm-modal__money.is-win {
  background: rgba(31, 179, 106, 0.22);
  color: #9ff0c4;
}
.dm-btn {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 11px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: 600 12.5px/1.2 Poppins, "Segoe UI", sans-serif;
  cursor: pointer;
}
.dm-btn--go {
  margin-bottom: 8px;
  background: #1fb36a;
  font-size: 13.5px;
}
.dm-modal__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.dm-empty {
  padding: 24px;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .dm-bubble,
  .dm-line__tile.is-new,
  .dm-slot::after,
  .dm-flash,
  .dm-roundend,
  .dm-hand__tile,
  .dm-note.is-knock,
  .dm-seat__av,
  .dm-me .dm-act--go,
  .dm-sheet__panel,
  .dm-modal__panel {
    animation: none !important;
  }
}
