/* ============ Velo Blocks on the painted plate (design/v2/blocks.webp) ============
   Sizes use var(--u) = one plate pixel, so everything scales with the painting. */

.game-blocks .vg-stage { touch-action: none; }

/* Score / best, drawn under the painted SCORE and BEST labels */
.game-blocks .bk-score,
.game-blocks .bk-best {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  font-family: var(--font);
}
.game-blocks .bk-score {
  font-size: calc(77 * var(--u));
  font-weight: 600;
  color: #F4C866;
  background: linear-gradient(180deg, #FFF4BE 0%, #FBDD8C 38%, #E9B255 72%, #C98A2E 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 calc(3 * var(--u)) calc(2 * var(--u)) rgba(0, 0, 0, 0.75));
}
.game-blocks .bk-best {
  font-size: calc(42 * var(--u));
  font-weight: 600;
  color: #E9CF9E;
  text-shadow: 0 calc(2 * var(--u)) calc(3 * var(--u)) rgba(0, 0, 0, 0.7);
}

/* Painted UNDO button: transparent button on top, dark overlay when disabled */
.game-blocks .bk-undo { z-index: 3; }
.game-blocks .bk-undo i { position: absolute; pointer-events: none; transition: background 0.15s; }
.game-blocks .bk-undo-ring { left: calc(6 * var(--u)); top: calc(6 * var(--u)); width: calc(100 * var(--u)); height: calc(100 * var(--u)); border-radius: 50%; }
.game-blocks .bk-undo-label { left: calc(20 * var(--u)); top: calc(113 * var(--u)); width: calc(72 * var(--u)); height: calc(22 * var(--u)); border-radius: calc(8 * var(--u)); }
.game-blocks .bk-undo:not(:disabled):active .bk-undo-ring { background: rgba(255, 240, 200, 0.18); }
.game-blocks .bk-undo:disabled i { background: rgba(10, 4, 20, 0.55); }

/* Board: one box per painted cell; a filled cell shows the painted gem */
.game-blocks .bk-board { z-index: 1; pointer-events: none; }
.game-blocks .bk-cell { position: absolute; display: grid; place-items: center; }
.game-blocks .bk-cell img {
  width: 93.5%;
  height: 93.5%;
  object-fit: fill;
  opacity: 0;
  filter: var(--gf);
}
.game-blocks .bk-cell.full img { opacity: 1; }
.game-blocks .bk-cell.drop img { animation: bk-drop 0.2s ease-out; }
@keyframes bk-drop { from { transform: scale(1.14); filter: brightness(1.5); } }
.game-blocks .bk-cell.clear img { animation: bk-clear 0.33s ease-in forwards; }
@keyframes bk-clear { 30% { filter: brightness(2.2); } to { transform: scale(0.2); opacity: 0; } }
/* placement preview + the lines it would clear */
.game-blocks .bk-cell.ghost img { opacity: 0.5; }
.game-blocks .bk-cell.hot img { filter: saturate(1.3) brightness(1.4) drop-shadow(0 0 calc(10 * var(--u)) rgba(255, 236, 160, 0.95)); }
.game-blocks .bk-cell.hot.ghost img { opacity: 0.85; }
.game-blocks .bk-cell.hot::after {
  content: "";
  position: absolute;
  inset: calc(1 * var(--u));
  border-radius: calc(10 * var(--u));
  background: rgba(255, 236, 170, 0.16);
  box-shadow: inset 0 0 0 calc(4 * var(--u)) rgba(255, 224, 130, 0.95), 0 0 calc(14 * var(--u)) rgba(255, 210, 90, 0.7);
  animation: bk-hot 0.6s ease-in-out infinite alternate;
}
@keyframes bk-hot { from { opacity: 0.55; } }

/* Gem art is a little paler than the mockup: boost it and add its neon glow */
.game-blocks [data-c] { --gf: saturate(1.3) contrast(1.05) drop-shadow(0 0 calc(7 * var(--u)) var(--gc)); }
.game-blocks [data-c="cyan"] { --gc: rgba(30, 190, 255, 0.55); }
.game-blocks [data-c="yellow"] { --gc: rgba(255, 200, 30, 0.5); }
.game-blocks [data-c="purple"] { --gc: rgba(210, 60, 255, 0.55); }
.game-blocks [data-c="orange"] { --gc: rgba(255, 120, 20, 0.5); }
.game-blocks [data-c="green"] { --gc: rgba(60, 230, 60, 0.5); }
.game-blocks [data-c="red"] { --gc: rgba(255, 40, 50, 0.55); }
.game-blocks [data-c="blue"] { --gc: rgba(40, 110, 255, 0.55); }

/* Pieces: painted gems on a grid (--p = pitch in plate px, set inline) */
.game-blocks .bk-piece { position: relative; pointer-events: none; }
.game-blocks .bk-g {
  position: absolute;
  width: calc(var(--p) * 0.935 * var(--u));
  height: calc(var(--p) * 0.935 * var(--u));
  margin: calc(var(--p) * 0.0325 * var(--u));
  filter: var(--gf);
}

/* Tray: pieces centred in the three painted boxes */
.game-blocks .bk-slot { z-index: 2; display: grid; place-items: center; cursor: grab; touch-action: none; }
.game-blocks .bk-slot.deal .bk-piece { animation: bk-deal 0.3s cubic-bezier(.2,1.5,.4,1); }
@keyframes bk-deal { from { transform: scale(0.3); opacity: 0; } }
.game-blocks .bk-slot.lifted .bk-piece { opacity: 0.25; }
.game-blocks .bk-slot.dead .bk-piece { filter: grayscale(0.85) brightness(0.55); }

/* Piece following the finger, at board size */
.game-blocks .bk-drag { position: absolute; left: 0; top: 0; z-index: 30; pointer-events: none; filter: drop-shadow(0 calc(16 * var(--u)) calc(16 * var(--u)) rgba(0, 0, 0, 0.6)); }
.game-blocks .bk-drag[hidden] { display: none; }

.game-blocks .bk-float {
  position: absolute;
  z-index: 5;
  transform: translate(-50%, -50%);
  pointer-events: none;
  white-space: nowrap;
  font-family: var(--serif);
  font-weight: 900;
  font-size: calc(54 * var(--u));
  color: #FFE7A0;
  text-shadow: 0 calc(4 * var(--u)) 0 #6A4310, 0 0 calc(24 * var(--u)) rgba(255, 200, 80, 0.8);
  animation: bk-float 0.9s ease-out forwards;
}
@keyframes bk-float { to { transform: translate(-50%, -150%); opacity: 0; } }

/* Footer line: the mockup uses a lighter, smaller face than the shared plate footer */
.game-blocks .vg-plate-fine {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: calc(23 * var(--u));
  font-weight: 400;
  letter-spacing: calc(-0.9 * var(--u));
  color: #D9CFE8;
}
