.play-page {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 95% 90%, #dff0e9, transparent 52%),
    radial-gradient(ellipse at 5% 12%, #e9ddf7, transparent 56%),
    #f8f5fb;
}

.play-layout {
  display: grid;
  grid-template-columns: minmax(0, 31rem) minmax(0, 21rem);
  align-items: start;
  justify-content: center;
  gap: clamp(1.25rem, 4vw, 3.25rem);
  padding-block: clamp(1.2rem, 4vw, 2.6rem) 3.2rem;
}

.match-card, .play-rules {
  min-width: 0;
  border: 1px solid #fff;
  border-radius: 1.5rem;
  background: #fcfaffed;
  box-shadow: 0 0.6rem 2rem #34235312;
}

.match-card { padding: clamp(0.8rem, 3vw, 1.45rem); }

.match-card h1 {
  margin-bottom: 0.8rem;
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 900;
  letter-spacing: -0.045em;
}

.match-opponent, .match-player {
  display: flex;
  align-items: center;
  gap: 0.68rem;
}

.match-opponent { margin-bottom: 0.82rem; }
.match-player { min-height: 3.45rem; margin-block: 0.8rem 0.65rem; }

.seat-symbol {
  display: grid;
  flex: 0 0 2.55rem;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 0.7rem;
}

.seat-x { background: var(--mint); }
.seat-o { background: var(--lavender); }
.seat-symbol .mark { --stroke: 3.5px; }
.seat-details { min-width: 0; }
.seat-details strong { font-size: 1rem; font-weight: 850; }

.seat-details p, .turn-number, .mine-detail {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 620;
  line-height: 1.45;
}

.turn-number { margin-inline-start: auto; white-space: nowrap; }
.match-board { gap: clamp(5px, 1vw, 8px); }
.match-tile { --stroke: clamp(4px, 1.25vw, 7px); }
.match-tile:enabled { cursor: pointer; }
.match-tile:enabled:hover { border-color: #aa86d3; background: #f4eafd; }
.match-tile:focus-visible { outline-offset: 1px; z-index: 1; }
.match-tile[data-effect="blast"] { z-index: 1; }

.board-mine {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 78%;
  height: auto;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.match-tile[data-effect="plant"] .board-mine { animation: bury 260ms ease-out; }
.match-tile[data-center="true"] .board-mine { animation: rise 480ms ease-out both; }
.match-tile[data-center="true"]::after { inset: 5%; }

@keyframes bury {
  from { transform: translate(-50%, -84%); }
  to { transform: translate(-50%, -50%); }
}

@keyframes rise {
  0% { transform: translate(-50%, -35%) scale(0.52); }
  46% { transform: translate(-50%, -77%) scale(1.06); opacity: 1; }
  100% { transform: translate(-50%, -84%) scale(0.84); opacity: 0; }
}

.match-rack {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(4px, 1vw, 8px);
}

.rack-mine {
  display: grid;
  min-width: 0;
  justify-items: center;
  align-content: center;
  gap: 0.08rem;
  min-height: 3.8rem;
  padding: 0.22rem 0.2rem 0.3rem;
  border: 1px solid #e8dfef;
  border-radius: 0.78rem;
  background: #fff;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 750;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.rack-mine img { width: clamp(2.35rem, 6vw, 3.55rem); height: auto; }
.rack-mine:enabled { cursor: pointer; }
.rack-mine:enabled:hover { border-color: #9f7dc8; }
.rack-mine[data-spent="true"] { opacity: 0.42; }
.rack-mine[aria-pressed="true"] {
  border-color: #9f7dc8;
  background: var(--lavender);
  box-shadow: inset 0 0 0 1px #9f7dc8;
}

.mine-detail { min-height: 1.4rem; margin-top: 0.55rem; }
.match-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.72rem;
}

.match-actions .button { min-height: 44px; padding: 0.55rem 0.82rem; font-size: 0.9rem; }

.play-sidebar { display: flex; flex-direction: column; gap: 1rem; }
.play-rules { padding: clamp(1rem, 3vw, 1.6rem); scroll-margin-top: 1rem; }
.play-rules h2 { font-size: 1.35rem; font-weight: 850; }
.play-rules ol { padding-inline-start: 1.3rem; margin: 0.72rem 0; }
.play-rules li, .play-rules p { color: var(--muted); line-height: 1.65; }
.play-rules li + li { margin-top: 0.55rem; }
.play-rules p { margin-top: 0.9rem; font-size: 0.9rem; }

.ad-slot {
  display: grid;
  min-height: 9rem;
  place-items: center;
  padding: 1rem;
  border: 1px dashed #bdb0cf;
  border-radius: 1rem;
  background: #fcfaffdb;
  color: var(--muted);
  font-size: 0.87rem;
  text-align: center;
}

@media (max-width: 47rem) {
  .play-layout { grid-template-columns: minmax(0, 1fr); max-width: 31rem; }
  .play-sidebar .ad-slot { min-height: 5rem; order: -1; }
}
