/* Sandbox visual: one tile image per color, tiled into shapes */
.cell.filled.c1,
.cell.filled.c2,
.cell.filled.c3,
.cell.filled.c4,
.cell.filled.c5,
.cell.filled.c6,
.cell.filled.c7,
.piece-cell.fill.c1,
.piece-cell.fill.c2,
.piece-cell.fill.c3,
.piece-cell.fill.c4,
.piece-cell.fill.c5,
.piece-cell.fill.c6,
.piece-cell.fill.c7,
.hero-cell.on.c1,
.hero-cell.on.c2,
.hero-cell.on.c3,
.hero-cell.on.c4,
.hero-cell.on.c5,
.hero-cell.on.c6,
.hero-cell.on.c7 {
  background-color: transparent;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  border: none;
  box-shadow: none;
}

.cell.filled.c1,
.piece-cell.fill.c1,
.hero-cell.on.c1 { background-image: url("/images/pieces/c1.png"); }

.cell.filled.c2,
.piece-cell.fill.c2,
.hero-cell.on.c2 { background-image: url("/images/pieces/c2.png"); }

.cell.filled.c3,
.piece-cell.fill.c3,
.hero-cell.on.c3 { background-image: url("/images/pieces/c3.png"); }

.cell.filled.c4,
.piece-cell.fill.c4,
.hero-cell.on.c4 { background-image: url("/images/pieces/c4.png"); }

.cell.filled.c5,
.piece-cell.fill.c5,
.hero-cell.on.c5 { background-image: url("/images/pieces/c5.png"); }

.cell.filled.c6,
.piece-cell.fill.c6,
.hero-cell.on.c6 { background-image: url("/images/pieces/c6.png"); }

.cell.filled.c7,
.piece-cell.fill.c7,
.hero-cell.on.c7,
.drag-ghost .piece-cell.fill.c7 {
  background-image: url("/images/pieces/m2.png");
  box-shadow:
    0 0 10px #ffd36aee,
    0 0 22px #ffb30099,
    inset 0 0 8px #fff6;
}

@keyframes tb-gold-pulse {
  0%,
  100% {
    filter: brightness(1) drop-shadow(0 0 4px #c99200);
    transform: scale(1);
  }
  50% {
    filter: brightness(1.35) drop-shadow(0 0 14px #ffe566);
    transform: scale(1.07);
  }
}

.cell.filled.c7,
.piece-cell.fill.c7 {
  animation: tb-gold-pulse 1.05s ease-in-out infinite;
}

.tray-slot.tb-bonus-slot,
.tray .tray-slot:has(.piece-cell.c7) {
  position: relative;
  overflow: visible !important;
  padding-bottom: 22px;
  box-shadow:
    0 0 0 2px #ffd24a,
    0 0 16px #ffb300cc,
    0 8px 18px #00000055;
  animation: tb-slot-gold 1.15s ease-in-out infinite;
}

@keyframes tb-slot-gold {
  0%,
  100% {
    box-shadow:
      0 0 0 2px #e6b800,
      0 0 10px #ffb30088,
      0 6px 14px #00000055;
  }
  50% {
    box-shadow:
      0 0 0 3px #ffe566,
      0 0 22px #ffd24acc,
      0 8px 18px #00000066;
  }
}

.tray-slot.tb-bonus-slot::after,
.tray .tray-slot:has(.piece-cell.c7)::after {
  content: "BÔNUS";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  z-index: 6;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: #ffe566;
  text-shadow:
    0 0 8px #ffb300,
    0 1px 0 #5a3a00;
  pointer-events: none;
  animation: tb-bonus-label 1.1s ease-in-out infinite;
}

@keyframes tb-bonus-label {
  0%,
  100% { opacity: 0.78; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

body:has(.tb-bonus-pop) .clear-shout,
body:has(.tb-bonus-pop) .gain-float {
  opacity: 0 !important;
  visibility: hidden !important;
  animation: none !important;
}

.tb-bonus-pop {
  position: fixed;
  left: 50%;
  top: 46%;
  z-index: 400;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  animation: tb-bonus-pop-rise 2.2s ease forwards;
}

.tb-bonus-pop-label {
  font-size: clamp(1.15rem, 5vw, 1.55rem);
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: none;
  color: #ffe566;
  text-shadow:
    0 0 12px #ffb300,
    0 2px 0 #5a3a00,
    0 4px 10px #000;
}

.tb-bonus-pop-value {
  margin-top: 4px;
  font-size: clamp(2rem, 9vw, 3.1rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #ffe566;
  paint-order: stroke fill;
  -webkit-text-stroke: 2px #6a4300;
  text-shadow:
    0 0 16px #ffb300,
    0 3px 0 #5a3a00,
    0 8px 16px #000000aa;
}

@keyframes tb-bonus-pop-rise {
  0% {
    opacity: 0;
    transform: translate(-50%, -20%) scale(0.72);
  }
  12% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08);
  }
  72% {
    opacity: 1;
    transform: translate(-50%, -64%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -92%) scale(1.04);
  }
}

/* HUD: score as R$ 0,00/25,00 + chasing border on the goal bar */
.bb-hud {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bb-hud-top {
  display: none !important;
}

.bb-hud-score {
  display: flex;
  justify-content: center;
  align-items: baseline;
  width: 100%;
  font-weight: 900;
  letter-spacing: -0.04em;
  paint-order: stroke fill;
  -webkit-text-stroke: 2.2px #071018;
  text-shadow:
    0 2px 0 #041018,
    0 3px 0 #02080f,
    0 4px 10px #00000099;
}

.bb-hud-score[data-target]::after {
  content: "/" attr(data-target);
  margin-left: 0.06em;
  font-size: 0.45em;
  font-weight: 900;
  letter-spacing: -0.03em;
  paint-order: stroke fill;
  -webkit-text-stroke: 1.6px #071018;
  color: #f2cb4e;
  text-shadow:
    0 1px 0 #8a6208,
    0 2px 0 #5c4200,
    0 3px 8px #00000099;
}

.bb-hud-score.ready,
.bb-hud-score.ready .tutorial-score-focus {
  color: #f2cb4e !important;
  -webkit-text-fill-color: #f2cb4e;
  -webkit-text-stroke: 2.2px #071018;
  paint-order: stroke fill;
  text-shadow:
    0 1px 0 #fff1a8,
    0 2px 0 #a4762c,
    0 3px 0 #5c4200,
    0 5px 10px #00000099 !important;
}

.bb-hud-score.ready[data-target]::after {
  color: #f2cb4e;
  -webkit-text-fill-color: #f2cb4e;
  -webkit-text-stroke: 1.6px #071018;
  text-shadow:
    0 1px 0 #fff1a8,
    0 2px 0 #a4762c,
    0 3px 8px #00000099;
}

@property --meta-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.bb-hud-progress {
  --meta-tile: 24px;
  position: relative;
  background: transparent;
  border: 4px solid #1e6ad6;
  border-radius: 10px;
  width: 100%;
  max-width: none;
  height: calc(var(--meta-tile) + 14px);
  padding: 3px;
  margin: 0;
  overflow: hidden;
  box-shadow: none;
  animation: none;
}

.bb-hud-progress::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 4px;
  box-sizing: border-box;
  background: conic-gradient(
    from var(--meta-angle),
    #ffffff 0deg,
    #b7dcff 28deg,
    #4da3ff 70deg,
    #1e6ad600 110deg,
    #1e6ad600 300deg,
    #ffffff 360deg
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  animation: meta-border-spin 2.4s linear infinite;
  pointer-events: none;
  z-index: 5;
}

@keyframes meta-border-spin {
  to {
    --meta-angle: 360deg;
  }
}

.bb-hud-progress-fill {
  height: var(--meta-tile);
  overflow: hidden;
  background-color: transparent !important;
  background-image: url("/images/pieces/m1.png") !important;
  background-repeat: repeat-x !important;
  background-position: left top !important;
  background-size: var(--meta-tile) var(--meta-tile) !important;
  border-radius: 0;
  box-shadow: none !important;
}

.bb-hud-progress.complete {
  border-color: #1e6ad6;
}

.bb-hud-progress.complete::after {
  content: "";
  display: block;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 42%;
  background: linear-gradient(
    90deg,
    #fff0 0%,
    #ffffff2e 40%,
    #ffffffd9 50%,
    #ffffff2e 60%,
    #fff0 100%
  );
  animation: meta-goal-sweep 3.4s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
  transform: translateX(-120%);
}

@keyframes meta-goal-sweep {
  0% {
    transform: translateX(-130%);
  }
  100% {
    transform: translateX(280%);
  }
}

.bb-hud-progress.complete .bb-hud-progress-fill,
.bb-hud-progress-fill.complete {
  background-image: url("/images/pieces/m2.png") !important;
  background-repeat: repeat-x !important;
  background-position: left top !important;
  background-size: var(--meta-tile) var(--meta-tile) !important;
  box-shadow: none !important;
}
