.block-page {
  --block-blue: #2f7f79;
  --block-blue-deep: #175d65;
  --block-green: #56a66f;
  --block-pink: #d95a83;
  --block-violet: #7c63c7;
  --block-orange: #d9793d;
  --block-yellow: #f0b84a;
}

.block-hero .site-hero-copy {
  background:
    radial-gradient(circle at 82% 18%, rgba(47, 127, 121, 0.18), transparent 28%),
    radial-gradient(circle at 18% 82%, rgba(240, 184, 74, 0.2), transparent 30%),
    rgba(255, 247, 238, 0.88);
}

.block-feature img {
  background: #f7eadf;
}

.block-game-section {
  background:
    linear-gradient(135deg, rgba(47, 127, 121, 0.1), rgba(240, 184, 74, 0.12)),
    rgba(255, 247, 238, 0.86);
}

.block-game-shell {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.score-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.score-panel div {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(72, 31, 19, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
}

.score-panel span {
  display: block;
  color: rgba(45, 29, 23, 0.64);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.score-panel strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(300px, 520px) minmax(240px, 1fr);
  gap: 20px;
  align-items: start;
  min-width: 0;
}

.board-wrap {
  position: relative;
  width: min(100%, 520px);
  max-width: 100%;
  justify-self: center;
}

.block-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: clamp(4px, 1vw, 7px);
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: clamp(8px, 2vw, 12px);
  border: 1px solid rgba(23, 93, 101, 0.24);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(23, 93, 101, 0.88), rgba(53, 42, 84, 0.88)),
    #175d65;
  box-shadow: 0 18px 44px rgba(23, 93, 101, 0.22);
  touch-action: manipulation;
  transition: transform 120ms ease;
  overflow: hidden;
}

.block-board.is-shaking {
  animation: boardShake 180ms ease-in-out;
}

.block-board.is-line-clear {
  animation: boardPulse 360ms ease-out;
}

.board-cell {
  aspect-ratio: 1 / 1;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition:
    background 110ms ease,
    box-shadow 110ms ease,
    transform 110ms ease;
}

.board-cell:hover,
.board-cell:focus-visible {
  outline: none;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.42),
    0 0 0 2px rgba(240, 184, 74, 0.26);
}

.board-cell.is-filled {
  background: var(--cell-color, var(--block-blue));
  box-shadow:
    inset 0 -4px 0 rgba(0, 0, 0, 0.16),
    inset 0 2px 0 rgba(255, 255, 255, 0.24);
  cursor: default;
}

.board-cell.is-preview-valid {
  background: color-mix(in srgb, var(--preview-color, var(--block-yellow)) 72%, white);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.72),
    0 0 14px rgba(240, 184, 74, 0.24);
  transform: translateY(-1px);
}

.board-cell.is-preview-invalid {
  background: rgba(217, 72, 72, 0.52);
  box-shadow: inset 0 0 0 2px rgba(255, 215, 215, 0.72);
}

.board-cell.is-placing {
  animation: cellPlace 260ms cubic-bezier(0.2, 1.55, 0.35, 1);
}

.board-cell.is-clearing {
  background: linear-gradient(135deg, #fff9d6, #f0b84a 58%, #ffffff);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.86),
    0 0 18px rgba(240, 184, 74, 0.72);
  animation: cellClear 520ms ease-out forwards;
}

.clear-pop {
  position: absolute;
  left: 50%;
  top: 46%;
  z-index: 4;
  transform: translate(-50%, -50%);
  padding: 8px 13px;
  border-radius: 999px;
  color: #fff8ee;
  background: linear-gradient(180deg, var(--block-orange), var(--accent-deep));
  font-size: clamp(18px, 4vw, 28px);
  font-weight: 900;
  pointer-events: none;
  box-shadow: 0 14px 28px rgba(72, 31, 19, 0.24);
  animation: clearPop 760ms ease-out forwards;
}

.clear-spark {
  position: absolute;
  left: var(--spark-x);
  top: var(--spark-y);
  z-index: 3;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--spark-color, #f0b84a);
  pointer-events: none;
  box-shadow: 0 0 14px var(--spark-color, #f0b84a);
  animation: sparkFly 620ms ease-out forwards;
}

.game-over-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  border-radius: 18px;
  background: rgba(45, 29, 23, 0.66);
  backdrop-filter: blur(5px);
}

.game-over-overlay[hidden] {
  display: none;
}

.game-over-overlay div {
  width: min(320px, 100%);
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 16px;
  background: rgba(255, 248, 239, 0.96);
  text-align: center;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.22);
}

.game-over-overlay h2,
.game-over-overlay p {
  margin: 0 0 12px;
}

.game-side {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.pieces-tray {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.piece-button {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 132px;
  padding: 10px;
  border: 2px solid rgba(72, 31, 19, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 10px 24px rgba(72, 31, 19, 0.08);
  cursor: pointer;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.piece-button:hover,
.piece-button:focus-visible {
  outline: none;
  border-color: rgba(47, 127, 121, 0.46);
  transform: translateY(-1px);
}

.piece-button.is-selected {
  border-color: var(--piece-color, var(--block-blue));
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--piece-color, var(--block-blue)) 18%, transparent),
    0 14px 28px rgba(72, 31, 19, 0.12);
}

.piece-button.is-used {
  opacity: 0.42;
  cursor: default;
}

.piece-grid {
  display: grid;
  grid-template-columns: repeat(var(--piece-cols), 22px);
  grid-template-rows: repeat(var(--piece-rows), 22px);
  gap: 5px;
}

.piece-cell {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

.piece-cell.is-on {
  background: var(--piece-color, var(--block-blue));
  box-shadow:
    inset 0 -3px 0 rgba(0, 0, 0, 0.14),
    inset 0 2px 0 rgba(255, 255, 255, 0.26);
}

.piece-cell.is-off {
  opacity: 0;
}

.game-actions {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(72, 31, 19, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.48);
}

.audio-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.audio-toggle {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(47, 127, 121, 0.28);
  border-radius: 12px;
  color: var(--block-blue-deep);
  background: rgba(255, 255, 255, 0.66);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.audio-toggle[aria-pressed="false"] {
  color: rgba(45, 29, 23, 0.56);
  border-color: rgba(72, 31, 19, 0.14);
  background: rgba(255, 255, 255, 0.36);
}

.audio-toggle:focus-visible {
  outline: 3px solid rgba(240, 184, 74, 0.58);
  outline-offset: 2px;
}

.block-button {
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  color: #fff8ee;
  background: linear-gradient(180deg, var(--block-blue), var(--block-blue-deep));
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.block-button:focus-visible {
  outline: 3px solid rgba(240, 184, 74, 0.58);
  outline-offset: 2px;
}

.status-text {
  min-height: 52px;
  margin: 0;
  color: rgba(45, 29, 23, 0.74);
  font-weight: 800;
  line-height: 1.45;
}

.status-text.is-error {
  color: #b83232;
}

.status-text.is-success {
  color: #24745e;
}

@keyframes boardShake {
  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  75% {
    transform: translateX(5px);
  }
}

@keyframes boardPulse {
  0% {
    box-shadow: 0 18px 44px rgba(23, 93, 101, 0.22);
  }

  45% {
    box-shadow:
      0 18px 44px rgba(23, 93, 101, 0.22),
      0 0 0 7px rgba(240, 184, 74, 0.2);
  }

  100% {
    box-shadow: 0 18px 44px rgba(23, 93, 101, 0.22);
  }
}

@keyframes cellPlace {
  0% {
    transform: scale(0.62);
    filter: brightness(1.28);
  }

  70% {
    transform: scale(1.08);
    filter: brightness(1.18);
  }

  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

@keyframes cellClear {
  0% {
    opacity: 1;
    transform: scale(1);
  }

  55% {
    opacity: 1;
    transform: scale(1.08);
  }

  100% {
    opacity: 0.18;
    transform: scale(0.72);
  }
}

@keyframes clearPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -35%) scale(0.82);
  }

  18% {
    opacity: 1;
    transform: translate(-50%, -55%) scale(1.08);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -105%) scale(0.96);
  }
}

@keyframes sparkFly {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--spark-dx)), calc(-50% + var(--spark-dy))) scale(0.35);
  }
}

@media (max-width: 900px) {
  .game-layout {
    grid-template-columns: 1fr;
  }

  .game-side {
    justify-self: center;
    width: min(100%, 520px);
  }
}

@media (max-width: 680px) {
  .block-game-section {
    margin-right: 0;
    margin-left: 0;
    padding: 8px;
  }

  .board-wrap,
  .game-side {
    width: min(100%, 520px);
  }

  .score-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pieces-tray {
    gap: 8px;
  }

  .piece-button {
    min-height: 108px;
    padding: 8px;
  }

  .piece-grid {
    grid-template-columns: repeat(var(--piece-cols), 18px);
    grid-template-rows: repeat(var(--piece-rows), 18px);
    gap: 4px;
  }

  .piece-cell {
    width: 18px;
    height: 18px;
    border-radius: 5px;
  }

  .board-cell {
    border-radius: 6px;
  }
}

@media (max-width: 430px) {
  .block-page,
  .block-page .site-main,
  .block-page .site-section,
  .block-page .block-game-section,
  .block-page .block-game-shell,
  .block-page .game-layout {
    max-width: 100%;
    overflow-x: hidden;
  }

  .block-game-section {
    padding-inline: 8px;
  }
}

@media (max-width: 430px) {
  .piece-button {
    min-height: 92px;
  }

  .piece-grid {
    grid-template-columns: repeat(var(--piece-cols), 15px);
    grid-template-rows: repeat(var(--piece-rows), 15px);
  }

  .piece-cell {
    width: 15px;
    height: 15px;
  }
}

/* Bitesize visual refresh */
.block-page {
  --block-blue: #10877f;
  --block-blue-deep: #0a5d59;
  --block-green: #75c96d;
  --block-pink: #d94d76;
  --block-violet: #6f57cf;
  --block-orange: #e84d2a;
  --block-yellow: #ffc857;
}

.block-hero .site-hero-copy::before {
  background:
    radial-gradient(circle at 80% 18%, rgba(117, 201, 164, 0.28), transparent 28%),
    radial-gradient(circle at 20% 82%, rgba(255, 200, 87, 0.3), transparent 30%),
    linear-gradient(135deg, rgba(34, 20, 16, 0.94), rgba(12, 93, 89, 0.82));
}

.block-game-section {
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(16, 135, 127, 0.11), rgba(255, 200, 87, 0.14)),
    rgba(255, 248, 234, 0.9);
}

.score-panel div,
.piece-button,
.game-actions,
.game-over-overlay div {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
}

.block-board {
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(10, 93, 89, 0.95), rgba(42, 29, 72, 0.92)),
    #0a5d59;
  box-shadow:
    0 20px 56px rgba(10, 93, 89, 0.24),
    inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.board-cell {
  border-radius: 6px;
}

.piece-cell {
  border-radius: 5px;
}

.piece-button.is-selected {
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--piece-color, var(--block-blue)) 20%, transparent),
    0 16px 32px rgba(96, 45, 21, 0.13);
}

.audio-toggle,
.block-button {
  border-radius: 8px;
}

.block-button {
  background: linear-gradient(180deg, var(--block-orange), #a9261b);
}

/* 2026 playable polish: premium block puzzle cabinet. */
.block-page {
  --block-blue: #55d7ff;
  --block-blue-deep: #177b9a;
  --block-green: #69e68f;
  --block-pink: #ff6f9f;
  --block-violet: #9d7cff;
  --block-orange: #ff934d;
  --block-yellow: #ffd76a;
}

.block-game-section {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 247, 218, 0.14);
  border-radius: 18px;
  padding: clamp(14px, 2.4vw, 26px);
  background:
    radial-gradient(circle at 14% 10%, rgba(85, 215, 255, 0.18), transparent 30%),
    radial-gradient(circle at 88% 12%, rgba(255, 215, 106, 0.16), transparent 28%),
    linear-gradient(180deg, #07111b 0%, #10192a 55%, #180f20 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 247, 218, 0.08),
    0 30px 90px rgba(0, 0, 0, 0.36);
}

.score-panel div,
.game-actions,
.piece-button,
.game-over-overlay div {
  border: 1px solid rgba(255, 247, 218, 0.13);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 247, 218, 0.1), rgba(255, 247, 218, 0.04)),
    rgba(5, 14, 22, 0.66);
  box-shadow:
    inset 0 1px 0 rgba(255, 247, 218, 0.08),
    0 18px 42px rgba(0, 0, 0, 0.22);
}

.score-panel span,
.status-text,
.game-side .site-kicker {
  color: rgba(255, 247, 218, 0.72);
}

.score-panel strong {
  color: #fff7da;
}

.block-board {
  border: 1px solid rgba(85, 215, 255, 0.2);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(9, 29, 50, 0.96), rgba(35, 24, 64, 0.94)),
    #091d32;
  box-shadow:
    0 24px 76px rgba(0, 0, 0, 0.34),
    0 0 0 8px rgba(85, 215, 255, 0.04),
    inset 0 1px 0 rgba(255, 247, 218, 0.1);
}

.board-cell {
  border-radius: 9px;
  background: rgba(255, 247, 218, 0.075);
  box-shadow: inset 0 0 0 1px rgba(255, 247, 218, 0.07);
}

.board-cell.is-filled {
  box-shadow:
    inset 0 -5px 0 rgba(0, 0, 0, 0.18),
    inset 0 2px 0 rgba(255, 255, 255, 0.26),
    0 8px 18px rgba(0, 0, 0, 0.18);
}

.piece-button {
  min-height: 142px;
}

.piece-button.is-selected {
  border-color: var(--piece-color, var(--block-yellow));
  background:
    radial-gradient(circle at 50% 28%, color-mix(in srgb, var(--piece-color, var(--block-yellow)) 22%, transparent), transparent 46%),
    rgba(5, 14, 22, 0.72);
}

.game-side h2,
.game-side strong {
  color: #fff7da;
}

.audio-toggle,
.block-button {
  border-radius: 999px;
}

.audio-toggle {
  border-color: rgba(255, 247, 218, 0.14);
  color: #fff7da;
  background: rgba(255, 247, 218, 0.08);
}

.block-button {
  color: #1a1008;
  background: linear-gradient(180deg, #ffd76a, #ff934d);
  box-shadow: 0 14px 30px rgba(255, 147, 77, 0.24);
}

.status-text.is-error {
  color: #ff9b8d;
}

.status-text.is-success {
  color: #8cffb9;
}
