/* dominoes.css — shared look for Texas 42 and Dominoes (class prefix dm-). */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@400;500;700&display=swap');
:root { --navy: #0a0f1e; --cyan: #00d4ff; --white: #f0f4ff; --silver: #c8d6e8; --muted: #8aa0c4; --felt: #0f5a3c; --felt-d: #0a3f2a; --gold: #f4c150; }
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.dm { background: var(--navy); color: var(--white); font-family: 'DM Sans', system-ui, sans-serif; overflow-x: hidden; min-height: 100vh; -webkit-text-size-adjust: 100%; }
.dm button, .dm select { font-family: inherit; }
.dm-wrap { max-width: 980px; margin: 0 auto; padding: 8px 8px 24px; }
.dm-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.dm-back { color: var(--cyan); text-decoration: none; font-size: .86rem; font-weight: 500; white-space: nowrap; }
.dm-back:hover { text-decoration: underline; }
.dm-title { text-align: center; line-height: 1; min-width: 0; flex: 1; }
.dm-title h1 { font-family: 'Bebas Neue', sans-serif; font-weight: 400; font-size: 1.8rem; letter-spacing: 1px; margin: 0; }
.dm-title h1 span { color: var(--gold); }
.dm-title p { margin: 2px 0 0; font-size: .68rem; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.dm-tools { display: flex; gap: 5px; }
.dm-ibtn { background: rgba(255,255,255,.08); color: var(--white); border: 1px solid rgba(255,255,255,.15); border-radius: 9px; min-width: 38px; height: 38px; font-size: 1rem; cursor: pointer; padding: 0 8px; }
.dm-ibtn:hover { background: rgba(0,212,255,.18); }
@media (max-width: 440px) { .dm-title { order: 3; flex-basis: 100%; margin-top: 2px; } }

.dm-score { display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.dm-score .sc { flex: 1 1 70px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 10px; padding: 5px 8px; font-size: .74rem; text-align: center; min-width: 0; }
.dm-score .sc b { display: block; font-size: 1.1rem; color: var(--white); }
.dm-score .sc small { color: var(--muted); }
.dm-score .sc.me { border-color: rgba(244,193,80,.6); }

.dm-table { position: relative; border-radius: 18px; padding: 8px 6px 12px; background: radial-gradient(ellipse at 50% 40%, #167a52 0%, var(--felt) 55%, var(--felt-d) 100%); border: 3px solid #3b2a14; box-shadow: inset 0 0 40px rgba(0,0,0,.35), 0 10px 30px rgba(0,0,0,.4); }
.plate { background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.14); border-radius: 12px; padding: 4px 8px; text-align: center; font-size: .72rem; line-height: 1.25; color: var(--white); min-width: 0; transition: box-shadow .2s, border-color .2s; }
.plate .nm { font-weight: 700; font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plate .st { color: var(--silver); }
.plate.turn { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(244,193,80,.5), 0 0 14px rgba(244,193,80,.5); }
.plate .tag { display: inline-block; font-size: .64rem; padding: 0 5px; border-radius: 7px; background: var(--gold); color: #3b2a14; font-weight: 700; margin-left: 3px; }

.dm-tile { display: inline-block; line-height: 0; flex: 0 0 auto; user-select: none; -webkit-user-select: none; }
.dm-svg { display: block; filter: drop-shadow(0 2px 3px rgba(0,0,0,.45)); }

.dm-handbox { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 10px 2px 2px; min-height: 60px; }
.dm-handbox .dm-tile { cursor: pointer; transition: transform .15s, filter .15s; border-radius: 8px; }
.dm-handbox .dm-tile.legal { transform: translateY(-6px); outline: 3px solid rgba(0,212,255,.95); outline-offset: 1px; }
.dm-handbox .dm-tile.sel { transform: translateY(-14px); outline: 3px solid var(--gold); outline-offset: 1px; }
.dm-handbox .dm-tile.dim { filter: brightness(.55) saturate(.6); cursor: not-allowed; }

.dm-status { text-align: center; min-height: 1.5em; margin-top: 8px; font-size: .9rem; font-weight: 500; }
.dm-actions { display: flex; justify-content: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.dm-btn { background: var(--cyan); color: var(--navy); border: 0; border-radius: 10px; padding: 10px 18px; font-weight: 700; font-size: .95rem; cursor: pointer; min-height: 42px; }
.dm-btn:hover { filter: brightness(1.1); }
.dm-btn:disabled { background: #33415a; color: #7e8aa3; cursor: not-allowed; filter: none; }
.dm-btn.alt { background: rgba(255,255,255,.1); color: var(--white); border: 1px solid rgba(255,255,255,.2); }
.dm-btn.gold { background: var(--gold); color: #3b2a14; }

.dm-panel { background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.16); border-radius: 14px; padding: 10px; margin-top: 8px; text-align: center; }
.dm-panel h3 { margin: 0 0 6px; font-size: .95rem; }
.dm-panel .hint { font-size: .78rem; color: var(--silver); margin-bottom: 8px; }
.dm-grid { display: grid; gap: 5px; }
.dm-grid button { background: rgba(255,255,255,.12); color: var(--white); border: 1px solid rgba(255,255,255,.2); border-radius: 9px; padding: 10px 0; font-size: .95rem; font-weight: 700; cursor: pointer; min-height: 42px; }
.dm-grid button:hover:not(:disabled) { background: var(--cyan); color: var(--navy); }
.dm-grid button:disabled { opacity: .35; cursor: not-allowed; }
.dm-grid button.gold { background: rgba(244,193,80,.2); border-color: var(--gold); color: var(--gold); }

.dm-modal { position: fixed; inset: 0; background: rgba(4,8,18,.78); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 10px; }
.dm-modal-card { background: #121b33; border: 1px solid rgba(0,212,255,.25); border-radius: 16px; width: 100%; max-width: 540px; max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.dm-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 8px; border-bottom: 1px solid rgba(255,255,255,.08); }
.dm-modal-head h2 { margin: 0; font-family: 'Bebas Neue', sans-serif; font-weight: 400; letter-spacing: 1px; font-size: 1.5rem; color: var(--gold); }
.dm-x { background: none; border: 0; color: var(--silver); font-size: 1.2rem; cursor: pointer; width: 38px; height: 38px; }
.dm-modal-body { padding: 10px 14px 14px; overflow-y: auto; font-size: .9rem; line-height: 1.5; color: var(--silver); }
.dm-modal-body h4 { color: var(--white); margin: 12px 0 3px; font-size: .95rem; }
.dm-modal-body ul { margin: 4px 0; padding-left: 18px; }
.dm-modal-body p { margin: 4px 0; }
.dm-set { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.07); }
.dm-set label { color: var(--white); font-weight: 500; }
.dm-set select { background: #0a0f1e; color: var(--white); border: 1px solid rgba(255,255,255,.25); border-radius: 8px; padding: 6px 8px; font-size: .9rem; max-width: 55%; }
.dm-set input[type=checkbox] { width: 22px; height: 22px; }
.dm-sheet { width: 100%; border-collapse: collapse; font-size: .82rem; }
.dm-sheet th, .dm-sheet td { padding: 5px 4px; text-align: center; border-bottom: 1px solid rgba(255,255,255,.08); }
.dm-sheet th { color: var(--gold); }
.dm-big { text-align: center; padding: 6px 0; }
.dm-big .hd { font-family: 'Bebas Neue', sans-serif; font-size: 2.2rem; letter-spacing: 1px; color: var(--gold); }
@media (min-width: 700px) { .dm-wrap { padding: 14px; } .dm-title h1 { font-size: 2.3rem; } .plate { font-size: .85rem; } }
@media (prefers-reduced-motion: reduce) { .dm-tile { transition: none !important; } }
