/* Pipline Dominoes: ivory tiles with coloured pips on a deep felt table. Two themes on .dm[data-theme]. */
.dm {
  --dm-text: #dfe9ff; --dm-muted: #8aa3c4; --dm-strong: #fff; --dm-panel: #0b1328; --dm-line: #1c2b4a; --dm-btn: #0b1328; --dm-btn-text: #dfe9ff;
  --dm-accent: #55d6ff; --dm-hot: #ffd166;
  --dm-felt-1: #10645a; --dm-felt-2: #0a3f3b; --dm-felt-3: #062a2a; --dm-rim: rgba(85, 214, 255, .35);
  --dm-ivory-1: #fffdf6; --dm-ivory-2: #ece5d3; --dm-edge: #b8ae96;
  --dm-th: 380px;
  max-width: 1000px; margin: 0 auto; padding: 10px 8px 14px; user-select: none; -webkit-user-select: none; color: var(--dm-text); border-radius: 12px; position: relative;
  font-variant-numeric: tabular-nums;
}
.dm[data-theme="light"] {
  --dm-text: #2b2a26; --dm-muted: #6b6457; --dm-strong: #17150f; --dm-panel: #fffdf8; --dm-line: #e0d6c3; --dm-btn: #fffdf8; --dm-btn-text: #2b2a26;
  --dm-accent: #0a86ad; --dm-hot: #a35f00;
  --dm-felt-1: #5fb59a; --dm-felt-2: #3f9a7f; --dm-felt-3: #2c7c64; --dm-rim: rgba(10, 134, 173, .25);
  background: linear-gradient(180deg, #f6f1e7, #ece3d2); box-shadow: inset 0 0 0 1px #e0d6c3;
}
.dm [hidden] { display: none !important; }
.dm-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 8px; }
.dm-opts { display: flex; gap: 8px 10px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--dm-muted); flex: 1 1 340px; min-width: 0; }
.dm-opts label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.dm-sel { display: inline-flex; gap: 6px 8px; flex-wrap: wrap; align-items: center; }
.dm-lt { display: none; }
.dm-opts select { background: var(--dm-btn); color: var(--dm-btn-text); border: 1px solid var(--dm-line); border-radius: 8px; padding: 0 6px; min-height: 36px; font-size: 13.5px; }
.dm-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.dm-btn { background: var(--dm-btn); color: var(--dm-btn-text); border: 1px solid var(--dm-line); border-radius: 9px; padding: 0 13px; min-height: 38px; font-weight: 700; font-size: 13.5px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; -webkit-tap-highlight-color: transparent; font-family: inherit; }
@media (hover: hover) { .dm-btn:hover:not(:disabled) { border-color: var(--dm-accent); } }
.dm-btn:disabled { opacity: .42; cursor: default; }
.dm-btn:active:not(:disabled) { transform: translateY(1px); }
.dm-btn-primary { background: #ffd166; color: #1a1200; border-color: #ffd166; }
@media (hover: hover) { .dm-btn-primary:hover:not(:disabled) { background: #ffe08a; border-color: #ffe08a; } }
.dm-icon { width: 38px; padding: 0; }
.dm-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
#dm-sound[aria-pressed="false"] .on, #dm-sound[aria-pressed="true"] .off { display: none; }
.dm[data-theme="dark"] #dm-theme .moon, .dm[data-theme="light"] #dm-theme .sun { display: none; }
.dm-btn:focus-visible, .dm select:focus-visible, .dm-ht:focus-visible, .dm-target:focus-visible, .dm-bone:focus-visible { outline: 2px solid var(--dm-accent); outline-offset: 2px; }

/* the score */
.dm-score { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 8px; margin: 0 0 8px; }
.dm-game { width: 100%; text-align: center; font-size: 12px; font-weight: 700; color: var(--dm-muted); letter-spacing: .03em; }
.dm-sc { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 10px; background: var(--dm-panel); border: 1px solid var(--dm-line); min-width: 0; }
.dm-sc.me { border-color: color-mix(in srgb, var(--dm-accent) 60%, transparent); }
.dm-sc.cur { box-shadow: 0 0 0 1px var(--dm-accent), 0 0 12px var(--dm-rim); }
.dm-sn { font-weight: 700; font-size: 13px; max-width: 11em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dm-strong); }
.dm-sc > b { font-size: 18px; font-weight: 800; color: var(--dm-strong); }
.dm-bar2 { width: 44px; height: 6px; border-radius: 9px; background: rgba(255, 255, 255, .1); overflow: hidden; display: block; }
.dm-bar2 > i { display: block; height: 100%; background: linear-gradient(90deg, #ffd166, #ff9f43); border-radius: 9px; transition: width .5s; }

/* the table: the other players around the felt */
.dm-table { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "top top top" "left felt right"; gap: 6px; height: var(--dm-th); }
.dm-at-top { grid-area: top; justify-self: center; }
.dm-at-left { grid-area: left; align-self: center; }
.dm-at-right { grid-area: right; align-self: center; }
.dm-seat { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 5px 8px; border-radius: 12px; background: var(--dm-panel); border: 1px solid var(--dm-line); min-width: 0; max-width: 140px; transition: box-shadow .25s, border-color .25s; position: relative; }
.dm-at-top.dm-seat { flex-direction: row; max-width: none; gap: 10px; }
.dm-seat.cur { border-color: var(--dm-accent); box-shadow: 0 0 0 1px var(--dm-accent), 0 0 16px var(--dm-rim); }
.dm-seat.partner { border-color: rgba(255, 209, 102, .55); }
.dm-who { display: flex; align-items: center; gap: 5px; font-size: 13px; min-width: 0; flex-wrap: wrap; justify-content: center; }
.dm-nm { font-weight: 800; color: var(--dm-strong); max-width: 8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-who em { font-style: normal; font-size: 11px; color: var(--dm-muted); font-weight: 600; }
.dm-backs { display: flex; align-items: center; gap: 2px; }
.dm-at-left .dm-backs, .dm-at-right .dm-backs { flex-wrap: wrap; justify-content: center; max-width: 64px; }
.dm-backs > i { width: 9px; height: 17px; border-radius: 2.5px; background: linear-gradient(160deg, #3a4f86, #1a2650); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .4); }
.dm-backs > b { font-size: 11px; color: var(--dm-muted); margin-left: 2px; }
.dm-cnt { font-size: 12px; font-weight: 800; color: var(--dm-strong); margin-left: 6px; min-width: 1.2em; }
.dm-last { font-size: 11px; color: var(--dm-muted); white-space: nowrap; }

.dm-felt { grid-area: felt; position: relative; border-radius: 22px; overflow: hidden; min-height: 0;
  background: radial-gradient(120% 90% at 50% 30%, var(--dm-felt-1), var(--dm-felt-2) 60%, var(--dm-felt-3));
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .3), inset 0 10px 30px rgba(0, 0, 0, .35), 0 0 0 1px var(--dm-rim), 0 0 24px var(--dm-rim); }
.dm-felt::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .3; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E"); }
.dm-line { position: absolute; inset: 0; }
.dm-placed { position: absolute; display: block; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .45)); }
.dm-placed .dm-tile { width: 100%; height: 100%; }
.dm-placed.fresh .dm-tile { box-shadow: 0 0 0 2px #ffd166, 0 0 14px rgba(255, 209, 102, .8); }
.dm-target { position: absolute; padding: 0; border: 2px dashed rgba(150, 236, 255, .95); border-radius: 8px; background: rgba(85, 214, 255, .18); cursor: pointer; animation: dm-pulse 1.1s ease-in-out infinite; box-shadow: 0 0 14px rgba(85, 214, 255, .55); }
.dm-target.hint { border-color: #ffd166; background: rgba(255, 209, 102, .2); box-shadow: 0 0 16px rgba(255, 209, 102, .6); }
.dm-target.over { background: rgba(85, 214, 255, .45); border-style: solid; }
@keyframes dm-pulse { 50% { opacity: .55; } }
.dm-info { position: absolute; left: 10px; bottom: 8px; display: flex; gap: 8px; align-items: center; z-index: 3; }
.dm-bone { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px 4px 6px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(0, 0, 0, .3); color: #fff; font: 800 13px/1 system-ui, sans-serif; cursor: default; }
.dm-bone:disabled { opacity: 1; }
.dm-bone.go { cursor: pointer; border-color: #ffd166; box-shadow: 0 0 0 1px #ffd166, 0 0 14px rgba(255, 209, 102, .6); animation: dm-pulse 1.1s ease-in-out infinite; }
.dm-bone-pile { position: relative; width: 22px; height: 18px; }
.dm-bone-pile i { position: absolute; width: 10px; height: 17px; border-radius: 2.5px; background: linear-gradient(160deg, #3a4f86, #1a2650); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }
.dm-bone-pile i:nth-child(1) { left: 0; transform: rotate(-12deg); } .dm-bone-pile i:nth-child(2) { left: 6px; } .dm-bone-pile i:nth-child(3) { left: 12px; transform: rotate(10deg); }
.dm-count { padding: 4px 9px; border-radius: 10px; background: rgba(0, 0, 0, .3); color: #fff; font-size: 13px; border: 1px solid rgba(255, 255, 255, .18); }
.dm-count b { font-size: 15px; }
.dm-count.five { border-color: #ffd166; color: #ffd166; }
.dm-bubble { position: absolute; z-index: 4; padding: 5px 11px; border-radius: 99px; background: rgba(8, 16, 36, .88); color: #fff; font-weight: 800; font-size: 13.5px; box-shadow: 0 0 0 1px rgba(85, 214, 255, .5); opacity: 0; transition: opacity .2s; pointer-events: none; white-space: nowrap; left: 50%; transform: translateX(-50%); top: 10px; }
.dm-bubble.show { opacity: 1; }
.dm-bubble.at-left { left: 12px; transform: none; top: 45%; } .dm-bubble.at-right { left: auto; right: 12px; transform: none; top: 45%; } .dm-bubble.at-bottom { top: auto; bottom: 10px; }
.dm-pop { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 5; font-weight: 900; font-size: 34px; color: #ffd166; text-shadow: 0 0 18px rgba(255, 209, 102, .8), 0 2px 4px rgba(0, 0, 0, .6); pointer-events: none; animation: dm-rise 1.2s ease-out forwards; }
@keyframes dm-rise { from { opacity: 0; transform: translate(-50%, -20%) scale(.6); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } to { opacity: 0; transform: translate(-50%, -140%) scale(1); } }

/* tiles: two halves, pips on a 3x3 grid, a bar across the middle and a brass rivet */
.dm-tile { position: relative; display: flex; box-sizing: border-box; border-radius: 12%; overflow: hidden; background: linear-gradient(150deg, var(--dm-ivory-1), var(--dm-ivory-2)); box-shadow: inset 0 0 0 1px var(--dm-edge), inset 0 -2px 3px rgba(0, 0, 0, .12), inset 0 2px 2px rgba(255, 255, 255, .8); }
.dm-tile.v { flex-direction: column; border-radius: 12% / 6%; }
.dm-tile.h { flex-direction: row; border-radius: 6% / 12%; }
.dm-half { position: relative; flex: 1 1 0; }
.dm-bar { position: absolute; background: rgba(60, 50, 30, .55); }
.dm-tile.v .dm-bar { left: 12%; right: 12%; top: calc(50% - .5px); height: 1.5px; }
.dm-tile.h .dm-bar { top: 12%; bottom: 12%; left: calc(50% - .5px); width: 1.5px; }
.dm-rivet { position: absolute; left: 50%; top: 50%; width: 9%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%); background: radial-gradient(circle at 35% 30%, #fff3c4, #c99a2e 60%, #7a5a10); }
.dm-tile.h .dm-rivet { width: auto; height: 9%; }
.dm-pip { position: absolute; width: 19%; height: 19%; border-radius: 50%; transform: translate(-50%, -50%); background: radial-gradient(circle at 40% 35%, color-mix(in srgb, var(--pc) 70%, #fff), var(--pc) 70%); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .35); }
.p0 { left: 25%; top: 25%; } .p1 { left: 50%; top: 25%; } .p2 { left: 75%; top: 25%; }
.p3 { left: 25%; top: 50%; } .p4 { left: 50%; top: 50%; } .p5 { left: 75%; top: 50%; }
.p6 { left: 25%; top: 75%; } .p7 { left: 50%; top: 75%; } .p8 { left: 75%; top: 75%; }
.v1 { --pc: #e03131; } .v2 { --pc: #e8590c; } .v3 { --pc: #2f9e44; } .v4 { --pc: #1971c2; } .v5 { --pc: #7048e8; } .v6 { --pc: #0b7285; }
.dm-tile.mini { width: 28px; height: 14px; margin: 1px; }

/* status and your tray */
.dm-status { text-align: center; font-weight: 700; font-size: 15px; min-height: 1.5em; margin: 8px 0 4px; color: var(--dm-strong); }
.dm-status.hot { color: var(--dm-hot); }
.dm-status[data-clock]::after { content: ' · ' attr(data-clock); color: #ff8fa0; }
.dm-dots { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: middle; }
.dm-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--dm-accent); animation: dm-blink 1s infinite ease-in-out; }
.dm-dots i:nth-child(2) { animation-delay: .15s; } .dm-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dm-blink { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
.dm-me { background: var(--dm-panel); border: 1px solid var(--dm-line); border-radius: 14px; padding: 8px 10px 10px; }
.my-turn .dm-me { border-color: color-mix(in srgb, var(--dm-accent) 70%, transparent); box-shadow: 0 0 16px var(--dm-rim); }
.dm-me-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--dm-muted); margin: 0 2px 6px; }
.dm-me-pips { letter-spacing: .02em; text-transform: none; font-weight: 700; }
.dm-hand { --tw: 52px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; min-height: calc(var(--tw) * 2 + 10px); outline: none; padding-top: 8px; }
.dm-ht { padding: 0; border: 0; background: none; cursor: default; border-radius: 8px; transition: transform .15s, opacity .15s; -webkit-tap-highlight-color: transparent; touch-action: none; }
.dm-ht .dm-tile { width: var(--tw); height: calc(var(--tw) * 2); filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .45)); }
.my-turn .dm-ht { opacity: .55; }
.my-turn .dm-ht.can { opacity: 1; cursor: pointer; transform: translateY(-7px); }
.my-turn .dm-ht.can .dm-tile { box-shadow: inset 0 0 0 1px var(--dm-edge), 0 0 0 2px rgba(85, 214, 255, .7), 0 0 14px rgba(85, 214, 255, .5); }
.dm-ht.sel { transform: translateY(-13px) !important; }
.dm-ht.sel .dm-tile { box-shadow: inset 0 0 0 1px var(--dm-edge), 0 0 0 3px #55d6ff, 0 0 18px rgba(85, 214, 255, .8) !important; }
.dm-ht.hint .dm-tile { box-shadow: inset 0 0 0 1px var(--dm-edge), 0 0 0 3px #ffd166, 0 0 18px rgba(255, 209, 102, .8) !important; }
.dm-ht.lifted { opacity: .25 !important; }
.dm-drag { position: fixed; z-index: 3000; pointer-events: none; padding: 0; border: 0; background: none; }
.dm-drag .dm-tile { width: 100%; height: 100%; box-shadow: 0 12px 26px rgba(0, 0, 0, .55), 0 0 0 2px #55d6ff; }
.dm-empty { color: var(--dm-muted); font-size: 13px; align-self: center; }
.dm-side { margin-top: 8px; }
.dm-record { font-size: 12.5px; color: var(--dm-muted); line-height: 1.5; text-align: center; }
.dm-record b { color: var(--dm-text); }
.dm .bt-strip { margin: 0 0 8px; }

/* same screen: the curtain between turns */
.dm-curtain { position: absolute; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgba(4, 8, 20, .9); border-radius: 12px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.dm-curtain-in { text-align: center; padding: 20px; }
.dm-curtain-in p { font-size: 22px; font-weight: 800; color: #fff; margin: 0 0 14px; }

/* dialogs and toast */
.dm-overlay { position: fixed; inset: 0; background: rgba(2, 5, 14, .72); display: flex; align-items: center; justify-content: center; z-index: 2000; padding: 16px; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.dm-overlay:not([hidden]) .dm-dialog { animation: dm-pop .22s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes dm-pop { from { transform: scale(.92); opacity: 0; } }
.dm-dialog { background: #0b1328; color: #dfe9ff; border: 1px solid #244b6b; border-radius: 16px; padding: 20px; width: min(100%, 460px); max-height: calc(100% - 16px); overflow: auto; text-align: center; box-shadow: 0 24px 60px rgba(0, 0, 0, .55); }
.dm[data-theme="light"] .dm-dialog { background: #fffdf8; color: #2b2a26; border-color: #e0d6c3; }
.dm-dialog h3 { margin: 0 0 10px; color: inherit; font-size: 22px; }
.dm-dialog p { margin: 0 0 12px; color: inherit; opacity: .85; }
.dm-sub { font-size: 14px; }
.dm-rules-text { text-align: left; font-size: 14.5px; line-height: 1.5; }
.dm-reveal { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 4px; text-align: left; }
.dm-reveal li { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 8px; background: rgba(255, 255, 255, .04); }
.dm-reveal li.out { background: rgba(255, 209, 102, .14); }
.dm-rn { width: 5.5em; font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: none; }
.dm-rt { flex: 1; display: flex; flex-wrap: wrap; align-items: center; min-width: 0; } .dm-rt em { font-style: normal; opacity: .7; font-size: 13px; }
.dm-reveal b { font-size: 14px; }
.dm-pts b { color: #ffd166; font-size: 18px; }
.dm-scores { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.dm-sc2 { display: inline-flex; gap: 6px; align-items: baseline; padding: 4px 10px; border-radius: 9px; background: rgba(255, 255, 255, .05); font-size: 13px; } .dm-sc2 b { font-size: 18px; } .dm-sc2.me { box-shadow: 0 0 0 1px var(--dm-accent); }
.dm-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; align-items: center; }
.dm-wait { font-size: 13px; opacity: .8; }
.dm-toast { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 2100; max-width: min(440px, calc(100% - 24px)); padding: 10px 16px; border-radius: 12px;
  background: #13224a; border: 1px solid #2c4478; color: #fff; font-weight: 600; font-size: 14px; line-height: 1.35; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); pointer-events: none; text-align: center; }

.dm[data-theme="light"] .rg-modes-in { background: #e8dfcf; border-color: #d4c8b2; }
.dm[data-theme="light"] .rg-mode { color: #5d564a; }
.dm[data-theme="light"] .rg-mode[aria-pressed="true"] { background: #fffdf8; color: #17150f; box-shadow: inset 0 0 0 1.5px #0a86ad, 0 2px 10px rgba(10, 134, 173, .18); }
.dm[data-theme="light"] .rg-mode[aria-pressed="true"] svg { color: #0a86ad; }
.dm[data-theme="light"] .bt-strip { background: #fffdf8; border-color: #e0d6c3; color: #2b2a26; }
.dm[data-theme="light"] .ol-btn { background: #fffdf8; color: #2b2a26; border-color: #d4c8b2; }

@media (prefers-reduced-motion: reduce) { .dm-target, .dm-bone.go, .dm-dots i { animation: none; } .dm-pop { animation-duration: .01s; } .dm-ht { transition: none; } }

@media (max-width: 700px) {
  .dm { padding: 6px 4px 12px; }
  .dm-top { margin-bottom: 6px; gap: 6px; }
  .dm-opts { flex-basis: 100%; justify-content: center; }
  .dm-sel { width: 100%; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .dm-sel label { min-width: 0; } .dm-sel select { width: 100%; min-width: 0; font-size: 13px; }
  .dm-tools { width: 100%; justify-content: center; flex-wrap: nowrap; gap: 5px; }
  .dm-tools .dm-btn { min-height: 36px; }
  .dm-tools .dm-btn:not(.dm-icon) { flex: 1 1 auto; padding: 0 6px; font-size: 13px; min-width: 0; }
  .dm-icon { width: 36px; flex: none; }
  .dm-seat { padding: 4px 5px; max-width: 74px; }
  .dm-at-top.dm-seat { max-width: none; }
  .dm-nm { max-width: 5.5em; font-size: 12px; }
  .dm-backs > i { width: 7px; height: 13px; }
  .dm-at-left .dm-backs, .dm-at-right .dm-backs { max-width: 44px; }
  .dm-last { display: none; }
  .dm-sc { padding: 3px 8px; gap: 5px; } .dm-sn { font-size: 12px; max-width: 7em; } .dm-sc > b { font-size: 16px; } .dm-bar2 { width: 30px; }
  .dm-me { padding: 6px 6px 8px; }
}
@media (min-width: 701px) { .dm-sel select { min-width: 92px; } }
/* full screen */
.dm.dm-fit { max-width: none; height: 100%; margin: 0; padding: 6px 8px 8px; display: flex; flex-direction: column; overflow: hidden; border-radius: 0; }
.dm-fit .dm-top { flex: none; justify-content: center; }
.dm-fit .dm-side { display: none; }
.dm-fit .dm-side:has(.bt-strip:not([hidden])) { display: block; }
.dm.dm-short { display: grid; grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr) auto; column-gap: 10px; row-gap: 4px; align-content: start; }
.dm-short .dm-top { grid-column: 1; grid-row: 1; flex-direction: column; align-items: stretch; gap: 5px; margin: 0; }
.dm-short .dm-opts { flex-direction: column; align-items: stretch; flex: none; gap: 5px; }
.dm-short .rg-modes { max-width: none; }
.dm-short .rg-mode { min-height: 36px; flex-direction: row; gap: 5px; font-size: 12.5px; padding: 3px 4px; }
.dm-short .rg-mode svg { width: 15px; height: 15px; }
.dm-short .dm-sel { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.dm-short .dm-sel label { min-width: 0; } .dm-short .dm-sel select { width: 100%; min-height: 30px; font-size: 12px; min-width: 0; padding: 0 4px; }
.dm-short .dm-tools { flex-wrap: nowrap; gap: 4px; } .dm-short .dm-tools .dm-btn:not(.dm-icon) { flex: 1 1 auto; min-width: 0; }
.dm-short .dm-btn { min-height: 32px; font-size: 12px; padding: 0 6px; } .dm-short .dm-icon { width: 32px; padding: 0; flex: none; }
.dm-short .dm-score { grid-column: 1; grid-row: 2; margin: 0; gap: 4px; } .dm-short .dm-game { display: none; }
.dm-short .dm-sc { padding: 2px 7px; } .dm-short .dm-sc > b { font-size: 15px; } .dm-short .dm-bar2 { width: 26px; }
.dm-short .dm-status { grid-column: 1; grid-row: 3; margin: 0; font-size: 13px; min-height: 0; }
.dm-short .dm-side { grid-column: 1; grid-row: 4; margin: 0; overflow: auto; }
.dm-short .dm-table { grid-column: 2; grid-row: 1 / 5; }
.dm-short .dm-me { grid-column: 2; grid-row: 5; padding: 3px 6px 5px; }
.dm-short .dm-hand { padding-top: 6px; min-height: calc(var(--tw) * 2 + 8px); }
.dm-short .dm-me-head { display: none; }
.dm-short .dm-seat { padding: 2px 6px; } .dm-short .dm-at-top.dm-seat { gap: 6px; }
/* narrow phones: everyone else sits in a row above the table, so the felt gets the full width */
@media (max-width: 560px) {
  .dm-table { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-areas: "left top right" "felt felt felt"; }
  .dm-at-left { justify-self: start; align-self: stretch; } .dm-at-right { justify-self: end; align-self: stretch; } .dm-at-top { justify-self: center; align-self: stretch; }
  .dm-seat, .dm-at-top.dm-seat { max-width: 112px; flex-direction: column; gap: 2px; justify-content: center; }
  .dm-at-left .dm-backs, .dm-at-right .dm-backs { max-width: none; flex-wrap: nowrap; }
}
