/* Dominoes — shares arcade.css theme. Bones are pale ivory with black pips, like the classic set. */
.game-body { overflow: hidden; height: 100svh; }
#stage { position: fixed; inset: 0; overflow: hidden; background: radial-gradient(120% 90% at 50% 40%, #14532d, #0c2a1a 60%, #0c0418 100%); }
.hidden { display: none !important; }

.topbar { position: absolute; top: 0; left: 0; right: 0; z-index: 30; display: flex; justify-content: space-between; align-items: center;
  padding: max(10px, env(safe-area-inset-top)) 14px 0; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.dom-title { font-weight: 900; font-size: 1.2rem; letter-spacing: -.5px; }
.dom-title span { color: #fde68a; }
.icon-btn { cursor: pointer; font: inherit; font-size: 1.2rem; line-height: 1; width: 44px; height: 44px; display: inline-flex;
  align-items: center; justify-content: center; color: var(--ink); background: rgba(32,16,64,0.6);
  border: 1.5px solid rgba(253,230,138,0.4); border-radius: 50%; text-decoration: none; }
.icon-btn:active { transform: scale(0.92); }

.screen { position: absolute; inset: 0; z-index: 25; display: none; align-items: center; justify-content: center; padding: 20px;
  padding-top: max(20px, calc(env(safe-area-inset-top) + 60px)); overflow-y: auto; }
.screen.on { display: flex; }
.screen[data-screen="table"] { align-items: stretch; padding-top: max(52px, calc(env(safe-area-inset-top) + 46px)); padding-bottom: 10px; }

.title-card { text-align: center; max-width: 420px; }
.title { font-size: clamp(2.8rem, 15vw, 5rem); font-weight: 900; letter-spacing: -2px; margin: 0; line-height: .9; }
.title span { display: block; color: #fde68a; }
.tag { color: var(--ink-dim); margin: 14px auto 22px; max-width: 34ch; }
.menu-btns { display: flex; flex-direction: column; gap: 12px; }
.how { color: var(--ink-mut); font-size: .85rem; margin-top: 18px; }

.panel.setup-card, .panel.lobby-card, .panel.over-card, .panel.picker-card { width: 100%; max-width: 380px; padding: 24px; text-align: center; }
.setup-card h2, .over-card h2, .picker-card h2 { font-size: 1.4rem; }
.setup-card .btn.big { width: 100%; }
.lbl, .lobby-label { display: block; text-align: left; color: var(--ink-dim); font-size: .8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; margin: 0 0 6px; }
.lobby-label { text-align: center; }
.nick-row, .join-row { display: flex; gap: 8px; align-items: stretch; }
.nick-row .field, .join-row .field { flex: 1; }
.nick-row .icon-btn { flex: none; border-radius: 12px; }
.join-row { margin-bottom: 8px; } .join-row .btn { flex: none; }
.nick-hint { color: var(--ink-mut); font-size: .78rem; margin: 6px 0 16px; text-align: left; }
.or { color: var(--ink-mut); font-size: .8rem; margin: 16px 0 10px; }
.err { color: var(--pink); font-weight: 700; font-size: .85rem; margin: 10px 0 0; min-height: 1em; }
.btn.small { font-size: .85rem; padding: .55em 1.1em; }
.setup-card .small { margin-top: 16px; }
.code-big { font-size: 2.8rem; font-weight: 900; letter-spacing: 6px; color: #fff; text-shadow: 0 0 26px rgba(253,230,138,0.6); margin: 4px 0 10px; }
.player-list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.player-list li { display: flex; align-items: center; gap: 8px; font-weight: 700; background: rgba(11,4,23,0.4);
  border: 1px solid rgba(253,230,138,0.25); border-radius: 10px; padding: .5em .8em; text-align: left; }
.player-list li .tag { margin-left: auto; font-size: .72rem; font-weight: 800; color: #fde68a; }
.wait { color: var(--ink-dim); font-weight: 700; font-style: italic; }
.over-note { color: var(--ink-dim); margin: 6px 0 10px; }
.results-score { font-size: 2.2rem; font-weight: 900; color: #fff; margin: 4px 0 12px; }
.over-card .btn.big { width: 100%; margin-bottom: 10px; }

/* table layout */
.table { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 560px; margin: 0 auto; flex: 1; min-height: 0; }
.scorebar { display: flex; justify-content: space-between; align-items: center; font-weight: 900; font-size: .9rem; padding: 0 4px; }
.team-a { color: #fdba74; } .team-b { color: #c4b5fd; }
.scorebar .to { color: var(--ink-mut); font-size: .75rem; font-weight: 700; }

.seat { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .78rem; font-weight: 800; }
.seat-top { align-self: center; }
.seat .chip { padding: .3em .7em; border-radius: 999px; background: rgba(32,16,64,0.7); border: 1.5px solid rgba(253,230,138,0.25); white-space: nowrap; }
.seat .chip.turn { border-color: #fde68a; box-shadow: 0 0 14px rgba(253,230,138,0.6); }
.seat .chip.team-a-chip { border-color: rgba(253,186,116,0.6); }
.seat .chip.team-b-chip { border-color: rgba(196,181,253,0.6); }
.seat .backs { display: flex; }
.seat .back-mini { width: 14px; height: 24px; border-radius: 4px; background: repeating-linear-gradient(45deg, #365314 0 3px, #1a2e05 3px 6px);
  border: 1px solid #ecfccb; margin-left: -6px; }
.seat-side { width: 72px; }
.seat-side .backs { flex-direction: column; align-items: center; }
.seat-side .back-mini { width: 24px; height: 14px; margin: -5px 0 0 0; }

.mid { display: flex; align-items: center; gap: 6px; flex: 1; min-height: 0; }
.board-wrap { flex: 1; display: flex; align-items: center; gap: 4px; min-width: 0; min-height: 120px; }
.board { display: flex; align-items: center; gap: 4px; overflow-x: auto; flex: 1; padding: 6px 2px; scrollbar-width: none; }
.board::-webkit-scrollbar { display: none; }
.board::before, .board::after { content: ''; margin: auto; }
.end-label { font-weight: 900; font-size: 1.1rem; color: #fde68a; min-width: 18px; text-align: center; }

/* bones */
.bone { display: flex; flex: none; background: #f8f5ef; border: 2px solid #1f2937; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  overflow: hidden; }
.bone.v { flex-direction: column; width: 46px; height: 88px; }
.bone.h { flex-direction: row; width: 52px; height: 26px; }
.bone .half { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 3px; flex: 1; }
.bone.v .half + .half { border-top: 2px solid #1f2937; }
.bone.h .half + .half { border-left: 2px solid #1f2937; }
.bone .half i { display: block; }
.bone .half i.p { background: #111827; border-radius: 50%; margin: 1px; }
.bone.slap { animation: slap .32s ease-out; }
@keyframes slap { 0% { transform: translateY(-40px) scale(1.2); } 60% { transform: translateY(4px) scale(.96); } 100% { transform: none; } }
.bone.h.slap { animation-name: slapH; }
@keyframes slapH { 0% { transform: translateX(40px) scale(1.2); } 60% { transform: translateX(-3px) scale(.96); } 100% { transform: none; } }

.turn-msg { text-align: center; font-weight: 800; margin: 0; min-height: 1.2em; font-size: .95rem; }
.log { text-align: center; color: var(--ink-mut); font-size: .78rem; margin: 0; min-height: 1.1em; }

.hand { display: flex; gap: 6px; overflow-x: auto; padding: 16px 10px 12px; justify-content: safe center; }
.hand .bone.v { transition: transform .15s; cursor: default; }
.hand .bone.v.playable { transform: translateY(-12px); outline: 3px solid #fde68a; outline-offset: 2px; cursor: pointer; }
.hand .bone.v.dim { opacity: .55; }

.actions { display: flex; gap: 8px; justify-content: center; }

.overlay { position: absolute; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(8,3,18,0.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.picker { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 16px; }

@media (orientation: landscape) and (max-height: 520px) {
  .seat-top { display: none; }
  .table { gap: 3px; }
}

.toast { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 16px); transform: translateX(-50%); z-index: 60;
  background: rgba(32,16,64,0.94); border: 1px solid rgba(253,230,138,0.45); color: var(--ink); padding: .6em 1.1em; border-radius: 999px;
  font-weight: 700; font-size: .85rem; max-width: 90vw; text-align: center; }

.title { white-space: nowrap; font-size: clamp(2.2rem, 13vw, 4.4rem); }
.title span { display: inline; }

.board { scroll-behavior: auto; }
.tally { display: flex; flex-wrap: wrap; gap: 4px 8px; justify-content: center; align-items: center; font-size: .72rem; font-weight: 800;
  color: var(--ink-dim); padding: 5px 8px; background: rgba(0,0,0,.25); border-radius: 10px; }
.tally .tl-title { color: #fde68a; text-transform: uppercase; letter-spacing: .5px; }
.tally .tl i { font-style: normal; color: #fff; font-size: .85rem; }
.tally .tl-ends b { color: #fde68a; }
.bone.h.dbl { flex-direction: column; width: 26px; height: 52px; }
.bone.h.dbl .half + .half { border-left: none; border-top: 2px solid #1f2937; }
.zoom { position: absolute; inset: 0; z-index: 55; display: flex; flex-direction: column; background: rgba(8,3,18,.96); }
.zoom-head { display: flex; flex-direction: column; gap: 8px; padding: max(12px, env(safe-area-inset-top)) 14px 10px; align-items: center; }
.zoom-head .tally { width: 100%; font-size: .8rem; }
.zoom-head .btn { width: 100%; }
.zoom-board { flex: 1; overflow: auto; display: flex; flex-wrap: wrap; align-content: flex-start; align-items: center; gap: 10px;
  padding: 14px; -webkit-overflow-scrolling: touch; }
.zoom .bone.h { width: 104px; height: 52px; }
.zoom .bone.h.dbl { width: 52px; height: 104px; }
.zoom .bone.h.dbl .half + .half { border-top: 3px solid #1f2937; }
.zoom .bone.h .half + .half { border-left-width: 3px; }
.zoom .bone { border-width: 3px; }
.scorebar { flex-wrap: wrap; justify-content: center; gap: 4px 12px; font-size: .75rem; }
.sc-seat { color: var(--ink-dim); font-weight: 800; }
.sc-seat b { color: #fde68a; font-size: .95rem; }
.sc-seat.me { color: #fff; }
.sc-line { display: inline-block; margin: 3px 8px; font-weight: 800; color: var(--ink-dim); }
.sc-line b { color: #fde68a; }
