/* Lớp layout dành riêng cho runtime data-driven. Level JSON sở hữu grid và slot. */
.board-scroll {
  overflow: auto;
  padding: 8px 4px 14px;
}

.board-tokens-only .modifier-badge.current {
  display: grid !important;
}

.board-grid[data-grid-size] {
  --cell-size: clamp(118px, 13vw, 168px);
  width: max-content;
  min-width: 0;
  margin: 0 auto;
  gap: clamp(6px, 1vw, 12px);
  place-items: stretch;
  isolation: isolate;
}

.board-grid[data-grid-size="4"] {
  --cell-size: clamp(112px, 11.5vw, 148px);
}

.board-grid[data-grid-size] .cup {
  width: var(--cell-size);
  min-width: var(--cell-size);
  height: var(--cell-size);
  min-height: var(--cell-size);
  padding: 8px;
}

.board-grid[data-grid-size="3"] .layout-placeholder {
  pointer-events: none;
}

.board-grid[data-grid-size="3"] .layout-placeholder:hover {
  transform: none;
  filter: none;
}

.board-grid[data-grid-size] .center-lake {
  position: relative;
  z-index: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  min-width: 0;
  min-height: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: url("../../assets/map/flow-rescue-water-elements-v1/sprites/external-lagoon/sprite.png") center / 100% auto no-repeat;
  color: #fffdf1;
  box-shadow: none;
  text-align: center;
  text-shadow: 0 2px 5px rgba(0, 91, 114, .38);
  pointer-events: none;
}

.board-grid[data-grid-size="4"] .center-lake {
  background-size: 82% auto;
}

.center-lake::before,
.center-lake::after {
  display: none;
}

.center-lake > * { position: relative; z-index: 1; }
.center-lake > span { font-size: clamp(28px, 4vw, 54px); line-height: .72; }
.center-lake > strong { margin-top: 8px; font-size: clamp(12px, 1.4vw, 17px); }
.center-lake > small { margin-top: 3px; font-size: clamp(8px, .9vw, 10px); opacity: .82; }

.board-grid[data-grid-size] .sand-cup::before {
  background-image: url("../../assets/map/flow-rescue-water-elements-v1/sprites/pit-dry-a/prop.png");
  opacity: 1;
}

.board-grid[data-grid-size] .wet-pit::before {
  background: url("../../assets/props/wet-rescue-pit-v2/prop.png") center / contain no-repeat;
  opacity: 1;
}

.board-grid[data-grid-size] .tokens {
  width: calc(var(--cell-size) * .86);
  height: calc(var(--cell-size) * .78);
}

.board-grid[data-grid-size="4"] .tokens { --star-size: 54px; }

.runtime-error {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  place-content: center;
  min-height: 240px;
  padding: 28px;
  border: 2px solid rgba(255, 247, 212, .9);
  border-radius: 24px;
  background: rgba(255, 244, 218, .88);
  color: #714a22;
  text-align: center;
}

.rating-result {
  margin: 16px 0;
  color: #f2a614;
  font-size: 28px;
  font-weight: 950;
  letter-spacing: .08em;
}

@media (max-width: 760px) {
  .board-grid[data-grid-size] { --cell-size: 112px; }
  .board-grid[data-grid-size="4"] { --cell-size: 104px; }
  .board-grid[data-grid-size="4"] .tokens { --star-size: 48px; }
  .center-lake > small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .board-grid[data-grid-size] .cup,
  .board-grid[data-grid-size] .token { animation-duration: .01ms !important; }
}
