.dominoes-stage[hidden],.dom-score-overlay[hidden]{display:none!important}
.dominoes-stage{padding:12px 0;max-width:100%;color:inherit}
.dom-score-row,.dom-nav,.dom-actions,.dom-preset-actions{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}
.dom-score-row button{flex:1 1 110px}.dominoes-stage button{touch-action:manipulation}
.dom-viewport{overflow:auto;overscroll-behavior:contain;touch-action:pan-x pan-y;min-height:270px;max-height:450px;background:#146348;border:3px solid #0d4f39;border-radius:14px;position:relative}
.dom-canvas{width:max-content;min-width:100%;min-height:340px;transform-origin:center center;padding:105px 65px;box-sizing:border-box}
.dom-center{position:relative;display:flex;flex-direction:column;align-items:center;gap:8px}
.dom-axis{display:flex;align-items:center;justify-content:center;gap:3px;min-height:70px}
.dom-branch{display:flex;flex-direction:column;align-items:center;gap:3px;min-height:50px}.dom-top{order:-1}.dom-bottom{order:1}
.dom-tile{display:inline-flex;flex-shrink:0;align-items:stretch;background:#fff8e7;color:#162331;border:2px solid #28384b;border-radius:5px;box-shadow:1px 2px 2px #1127;min-width:60px;height:36px;font-weight:800;font-size:18px}
.dom-half{min-width:30px;display:inline-flex;align-items:center;justify-content:center}.dom-half+.dom-half{border-left:2px solid #344152}
/* A crosswise double occupies a true vertical footprint, rather than only rotating artwork. */
.dom-tile.dom-vertical{flex-direction:column;min-width:36px;width:36px;height:64px}
.dom-tile.dom-vertical .dom-half{min-width:0;min-height:30px;flex:1}
.dom-tile.dom-vertical .dom-half+.dom-half{border-left:0;border-top:2px solid #344152}
.dom-place{min-width:58px!important;height:38px!important;border:2px dashed #fbe357!important;border-radius:5px!important;background:#e1f6ce!important;color:#194d33!important;font-size:24px!important;padding:0!important;animation:dom-pulse 1.4s ease-in-out infinite alternate}
@keyframes dom-pulse{to{background:#ffed8e!important}}
.dom-hand{display:flex;gap:6px;overflow-x:auto;padding:10px 0;min-height:64px;align-items:center}
.dom-hand-tile{padding:4px!important;background:transparent!important;border:2px solid transparent!important;border-radius:8px!important;flex-shrink:0}.dom-hand-tile.selected{border-color:#e7af24!important;background:#ffec98!important}.dom-hand-tile:disabled{opacity:.48}
.dom-help{font-size:.92rem}.dom-score-overlay{position:fixed;z-index:10000;inset:0;background:#132c3fbb;display:flex;align-items:center;justify-content:center;padding:18px}.dom-score-panel{background:white;color:#1e293b;border-radius:12px;padding:20px;max-height:85vh;overflow:auto;width:min(460px,100%)}
.dom-house{display:inline-block;border:2px solid #3476af;padding:8px;font-size:30px;margin:6px;color:#3476af}.dom-partial{font-size:20px;border-style:dashed}
@media(max-width:600px){.dom-canvas{padding:110px 30px}.dominoes-stage button{min-height:38px}.dom-tile{min-width:52px;height:34px}.dom-half{min-width:26px}.dom-score-row{gap:4px}}

/* Anchor side branches to the actual first double, not to the chain midpoint. */
.dom-axis{width:max-content;min-width:100%;height:250px;position:relative}
.dom-spinner-hub{position:relative;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.dom-spinner-hub .dom-branch{position:absolute;left:50%;transform:translateX(-50%);z-index:1;min-height:0}
.dom-spinner-hub .dom-top{bottom:calc(100% + 5px);flex-direction:column-reverse}
.dom-spinner-hub .dom-bottom{top:calc(100% + 5px);flex-direction:column}
.dom-spinner-hub .dom-branch .dom-tile{margin:2px 0}
.dom-viewport{min-height:290px}.dom-canvas{padding:30px 70px;min-height:300px}

@media(max-width:600px){.dom-tile.dom-vertical{min-width:34px;width:34px;height:56px}.dom-tile.dom-vertical .dom-half{min-height:26px}}

/* Public record of the prior scoring announcement; never displays the correct total. */
.dom-call-summary{border:1px solid #a1aab4;border-left:5px solid #427bb3;border-radius:9px;padding:10px 14px;margin:10px 0;background:#eff6ff;color:#1e3651}
.dom-call-summary[hidden]{display:none!important}
.dom-call-summary strong{display:block;font-size:1rem}
.dom-call-summary p{font-weight:700;margin:6px 0}
.dom-call-summary small{display:block;line-height:1.4}

/* Announcements are visible to players and observers, but never lock the table. */
.dom-announcement-overlay{pointer-events:none;background:#132c3f88}
.dom-announcement-overlay .dom-announcement-panel{pointer-events:auto;box-shadow:0 12px 45px #08151b88;text-align:center}
.dom-announcement-values{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0}
.dom-announcement-values>div{padding:14px 8px;background:#edf3fa;border-radius:10px;display:flex;flex-direction:column;gap:7px}
.dom-announcement-values span{font-size:.85rem;color:#52657a}
.dom-announcement-values strong{font-size:2rem;line-height:1.1;color:#172c42}
.dom-announcement-panel #domAnnouncementNote{line-height:1.45;margin:14px 0}
.dom-announcement-panel #domCloseAnnouncement{min-width:110px}
.dom-last-call{margin:6px 0}
.dom-announcement-overlay[hidden],.dom-last-call[hidden]{display:none!important}

/* Move preview is local-only. The server receives a single atomic move + score call. */
.dom-move-overlay{z-index:10005;pointer-events:auto;background:#102536c9}
.dom-move-panel label{display:block;font-weight:700;margin-top:12px}
.dom-move-panel input{width:100%;box-sizing:border-box;font-size:1.3rem;padding:10px;margin:8px 0;border-radius:8px;border:1px solid #94a3b8}
.dom-move-panel #domMoveError{color:#a32626;min-height:1em}
.dom-move-buttons{display:flex;flex-wrap:wrap;gap:9px;margin-top:12px}
.dom-move-buttons button{flex:1 1 130px}
.dom-move-overlay[hidden]{display:none!important}

/* The full chain and spinner branches must contribute to the scrollable area. */
.dom-viewport{overflow:auto;touch-action:pan-x pan-y;scrollbar-gutter:stable;}
.dom-canvas{transform:none!important;transform-origin:initial;}
.dom-axis{height:auto;min-height:250px;box-sizing:border-box;}
.dom-game-over-panel{text-align:center;}
.dom-game-over-panel #domGameOverWinner{font-size:1.55rem;font-weight:800;margin:12px 0;}
.dom-game-over-panel #domGameOverScores{background:#f0f5fa;border-radius:10px;padding:12px;margin:14px 0;text-align:left;}
.dom-game-over-panel #domGameOverScores p{margin:6px 0;}
.dom-game-over-panel .dom-final-winner{font-weight:800;color:#146348;}
.dom-game-over-panel #domCloseGameOver{min-width:120px;}
#domViewResult[hidden],#domGameOverOverlay[hidden]{display:none!important;}
