.domino-page {
  color: #f6f0df;
  background: radial-gradient(ellipse at 85% 2%, #223d23, #101b12 48%, #0c160f);
  min-height: 100vh;
}
.domino-page [hidden] { display: none !important; }
.domino-main { max-width: 70rem; padding-block: clamp(1.25rem, 3vw, 2.4rem); }
.domino-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: clamp(1.35rem, 3vw, 2rem);
}
.domino-intro h1 { font-size: clamp(2.75rem, 6.2vw, 5.4rem); }
.domino-intro p { color: #d6dfcd; margin-top: .7rem; font-size: 1.05rem; }
.domino-quiet {
  background: #1c3121;
  color: #f6f0df;
  border-color: #728460;
  padding-inline: .95rem;
}
.domino-quiet:hover { background: #345036; }
.domino-page a:focus-visible, .domino-page button:focus-visible { outline-color: var(--gold); }
.game {
  overflow: hidden;
  border-radius: 1.3rem;
  border: 1px solid #728052;
  background: #17261a;
  box-shadow: 0 1.2rem 2.8rem #060a069a;
}
.opponent {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(.45rem, 2.5vw, 1.4rem);
  padding: .9rem clamp(.75rem, 3vw, 1.55rem);
  font-size: .9rem;
}
.opponent strong, .hand-title h2 { font-weight: 700; }
.opponent > div:not(.cpu-tiles) { display: flex; align-items: center; gap: .45rem; }
.opponent [id$="-count"], .hand-title span {
  min-width: 1.5rem;
  padding: .1rem .32rem;
  border-radius: .28rem;
  color: #f8df82;
  text-align: center;
  background: #30432c;
  font-variant-numeric: tabular-nums;
}
.cpu-tiles { display: flex; align-items: center; justify-content: center; gap: 3px; }
.cpu-tiles span {
  width: clamp(.52rem, 2.6vw, 1rem);
  height: clamp(.92rem, 4vw, 1.7rem);
  border: 1px solid #c8ae5e;
  border-radius: 3px;
  background: repeating-linear-gradient(140deg, #e3bb44 0 2px, #233c28 2px 7px);
  box-shadow: 0 2px #0b150d;
}
.tabletop {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: clamp(13rem, 27vw, 19rem);
  align-items: start;
  padding: clamp(.5rem, 2vw, 1rem);
  border-block: .32rem solid #846530;
  background:
    radial-gradient(ellipse at center, #20523b 0%, #153c2a 54%, #102c1e 100%);
  box-shadow: inset 0 0 2.7rem #071810a3, inset 0 0 0 2px #bf9d51;
}
.tabletop::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  opacity: .13;
  background: repeating-linear-gradient(125deg, transparent 0 13px, #d1bc7b 13px 14px);
}
.table-topline {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .35rem;
}
.table-brand {
  justify-self: center;
  width: clamp(6.7rem, 18vw, 10.25rem);
  padding: .48rem .6rem;
  border: 1px solid #c1a76a;
  border-radius: .5rem;
  background: linear-gradient(155deg, #fff7dc, #ebd7a7);
  box-shadow: 0 2px #816331, 0 6px 12px #08160e8f;
}
.table-brand img { width: 100%; height: auto; }
.drop-zone {
  justify-self: start;
  display: flex;
  min-height: 2.8rem;
  align-items: center;
  padding: .26rem;
  border: 2px dashed transparent;
  border-radius: .65rem;
}
.drop-zone:last-child { justify-self: end; }
.end {
  display: inline-block;
  white-space: nowrap;
  padding: .3rem .5rem;
  border-radius: .35rem;
  color: #faf1d6;
  background: #0d271b;
  box-shadow: inset 0 0 0 1px #6d8150;
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
}
.drop-zone.can-drop, .empty-table.can-drop {
  border-color: var(--gold);
  background: #f9d54624;
}
.drop-zone.drop-over, .empty-table.drop-over {
  color: #192219;
  background: var(--gold);
}
.domino-line {
  position: relative;
  align-self: center;
  display: flex;
  flex-wrap: wrap;
  gap: .6rem .32rem;
  align-items: center;
  justify-content: center;
  list-style: none;
  padding: 1.15rem 0;
}
.empty-table {
  position: absolute;
  place-self: center;
  padding: .9rem 1.25rem;
  color: #eee7c8;
  border: 1px dashed #9fa876;
  border-radius: .6rem;
}
.domino {
  --tile-width: clamp(2.8rem, 8vw, 4.25rem);
  position: relative;
  flex: 0 0 var(--tile-width);
  width: var(--tile-width);
  aspect-ratio: 2 / 1;
  display: flex;
  padding: 3px;
  border-radius: .34rem;
  border: 1px solid #e1ca9b;
  background: linear-gradient(150deg, #fffdf1 4%, #f3e8cb 67%, #d6bf8c);
  box-shadow: 0 3px #b89c67, 0 5px 7px #0a1a12ad, inset 0 1px 2px #fff;
  color: #17271b;
}
.tile-half {
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  width: 50%;
  padding: 1px 2px;
}
.tile-half + .tile-half { border-inline-start: 1px solid #a68e61; }
.pip {
  justify-self: center;
  align-self: center;
  width: 66%;
  max-width: .34rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #1b2a1d;
  box-shadow: inset 0 1px 1px #0009, 0 1px #fff9;
}
.place-actions {
  position: relative;
  justify-self: center;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .25rem;
}
.place-actions .button { min-height: 2.75rem; }
.turn-panel {
  min-height: 4.45rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  padding: .8rem clamp(.75rem, 3vw, 1.55rem);
  border-bottom: 1px solid #475a3b;
}
.game-status { font-weight: 700; line-height: 1.4; }
.turn-panel .button { min-height: 2.75rem; }
.your-hand { padding: 1rem clamp(.75rem, 3vw, 1.55rem) 1.45rem; }
.hand-title { display: flex; gap: .55rem; align-items: center; margin-bottom: .85rem; }
.hand-title h2 { font-size: 1.1rem; letter-spacing: 0; line-height: 1.3; }
.hand { display: flex; flex-wrap: wrap; gap: .8rem .58rem; }
.hand .domino {
  --tile-width: clamp(3.4rem, 10vw, 5rem);
  min-height: 2.75rem;
  cursor: pointer;
  transition: transform .16s ease;
}
.hand .domino:enabled { outline: 2px solid #f7d449; outline-offset: 1px; }
@media (pointer: fine) {
  .hand .domino:enabled { cursor: grab; }
  .hand .domino:enabled:active { cursor: grabbing; }
}
.tile-half, .pip { pointer-events: none; }
.tile-drag-ghost {
  position: fixed;
  z-index: 5;
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(-7deg);
  outline: 2px solid var(--gold);
}
.tile-landed { animation: land-tile .25s cubic-bezier(.18,.76,.34,1.19) both; }
@keyframes land-tile {
  from { transform: translateY(-.65rem) scale(1.08); opacity: .55; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.hand .domino:enabled:hover { transform: translateY(-3px); }
.hand .domino[aria-pressed="true"], .hand .domino:focus-visible { outline: 3px solid #f8e579; outline-offset: 3px; }
.hand .domino:disabled { opacity: .66; cursor: default; }
.domino-rules {
  margin-top: 1.35rem;
  border: 1px solid #566c44;
  border-radius: .65rem;
  padding: .82rem 1rem;
  background: #1a2c1e;
}
.domino-rules summary { cursor: pointer; font-weight: 700; color: #f8df82; }
.domino-rules ol { padding-inline-start: 1.2rem; line-height: 1.5; }
.domino-rules li + li { margin-top: .35rem; }
.no-script { padding: .8rem; }
@media (max-width: 390px) {
  .opponent { font-size: .75rem; }
  .opponent > div:not(.cpu-tiles) { gap: .22rem; }
}
@media (prefers-reduced-motion: reduce) {
  .tile-landed { animation: none; }
  .hand .domino { transition: none; }
  .hand .domino:enabled:hover { transform: none; }
}
