.tetris-drop-row {
  display: none;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(4px, 1vw, 8px);
  width: 100%;
  max-width: var(--game-size);
  margin-bottom: 8px;
}

.tetris-drop-row.is-active {
  display: grid;
}

.tetris-tools-row {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 10px 0 auto;
  flex-shrink: 0;
}

.tetris-tools-row.is-active {
  display: flex;
}

.tetris-bomb-strip {
  width: 100%;
  max-width: var(--game-size);
  margin-top: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: visible;
}

.tetris-bomb-strip::before {
  content: '';
  position: absolute;
  left: -26px;
  right: -26px;
  top: -12px;
  bottom: -12px;
  border-radius: 16px;
  pointer-events: none;
  opacity: 0;
}

.tetris-bomb-strip.is-topup-blast::before {
  animation: tetrisBombStripBlast 0.76s ease-out;
}

.tetris-bomb-indicator {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.tetris-bomb-indicator.is-topup-flash {
  animation: tetrisBombStripFlash 0.62s ease-out;
}

@media (max-width: 1024px) {
  .tetris-bomb-strip {
    margin-top: 4px;
  }

  .tetris-bomb-indicator {
    gap: 8px;
  }

  .tetris-bomb-icon {
    width: 20px;
    height: 24px;
  }
}

.tetris-bomb-icon {
  width: 22px;
  height: 26px;
  display: inline-block;
  position: relative;
  border-radius: 50% 50% 46% 46%;
  background: radial-gradient(circle at 34% 30%, #595959 0 12%, #1a1a1a 13% 65%, #050505 66% 100%);
  box-shadow:
    inset 2px 2px 3px rgba(255,255,255,0.07),
    0 2px 4px rgba(0,0,0,0.34);
}

.tetris-bomb-icon::after {
  content: '';
  position: absolute;
  left: 50%;
  top: -6px;
  width: 9px;
  height: 9px;
  border-top: 2px solid #d6c28d;
  border-right: 2px solid #d6c28d;
  border-radius: 0 100% 0 0;
  transform: translateX(-12%) rotate(-14deg);
}

.tetris-bomb-icon.is-spent {
  opacity: 0.22;
  filter: grayscale(1);
}

.tetris-bomb-icon.is-refill-flash {
  filter: brightness(1.55) saturate(1.25);
}

.tetris-bomb-icon.is-refilled {
  animation: tetrisBombPop 0.55s cubic-bezier(0.2, 0.85, 0.22, 1.2);
}

.tetris-bomb-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  border: 3px solid rgba(255, 214, 102, 0.82);
  border-radius: 999px;
  transform: translate(-50%, -50%);
  transform-origin: center;
  pointer-events: none;
  animation: tetrisBombRingExpand 1.05s ease-out forwards;
}

.tetris-bomb-topup-text {
  position: absolute;
  left: 50%;
  top: -34px;
  transform: translateX(-50%);
  color: #fff3b0;
  font-family: Arial, sans-serif;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-shadow:
    0 1px 1px rgba(0, 0, 0, 0.45),
    0 0 16px rgba(255, 209, 102, 0.8),
    0 0 30px rgba(255, 209, 102, 0.55);
  pointer-events: none;
  white-space: nowrap;
  animation: tetrisBombTextRise 1.35s ease-out forwards;
}

.drop-slot {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 0;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.05);
  border-bottom: 4px solid rgba(255,255,255,0.12);
  background-color: rgba(0, 0, 0, 0.15);
  box-shadow: inset 2px 2px 6px rgba(0,0,0,0.4);
  color: #eef6ff;
  font-family: Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: filter 0.15s ease, background-color 0.15s ease, transform 0.15s ease, border-bottom-color 0.2s ease;
}

/* Double downward chevron marker - rendered from SVG for consistent shape */
.drop-slot::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: clamp(34px, calc(var(--game-size) * 0.14), 66px);
  height: clamp(40px, calc(var(--game-size) * 0.165), 78px);
  z-index: 2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 140'%3E%3Cg fill='none' stroke='%23eef5ff' stroke-width='16' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 22 L60 66 L104 22'/%3E%3Cpath d='M16 74 L60 118 L104 74'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3)) drop-shadow(0 0 6px rgba(160, 188, 226, 0.22));
  opacity: 1;
  transition: filter 0.15s ease, opacity 0.15s ease;
}

/* Sweep highlight: subtle border-bottom color cycle only */
.drop-slot.is-sweep-active {
  border-bottom-color: rgba(255, 255, 255, 0.3);
}

.drop-slot.is-sweep-active.is-tone-green {
  border-bottom-color: #2f9d47;
}

.drop-slot.is-sweep-active.is-tone-amber {
  border-bottom-color: #d98b00;
}

.drop-slot.is-sweep-active.is-tone-red {
  border-bottom-color: #c41f2f;
}

.drop-slot.is-engaged::before {
  opacity: 0;
}

.drop-slot::after {
  content: '';
  position: absolute;
  inset: 0;
}

.drop-slot:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.drop-slot:active {
  filter: brightness(0.95);
  transform: translateY(0);
}

.drop-slot.impact-rattle {
  animation: tetrisSlotRattle 0.36s ease-out;
}

.drop-slot.is-blocked {
  background: rgba(120, 132, 150, 0.38);
  border-color: rgba(140, 150, 165, 0.6);
  color: rgba(220, 228, 240, 0.55);
  cursor: not-allowed;
}

.drop-slot.is-blocked::before {
  content: 'FULL';
  left: 0;
  top: 0;
  transform: none;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  font-size: clamp(16px, calc(var(--game-size) * 0.06), 30px);
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1;
  color: #ffffff;
  background: linear-gradient(180deg, #ff8a8a 0%, #ef4444 62%, #c71d2f 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.22),
    inset 0 -4px 10px rgba(120, 0, 0, 0.24);
  opacity: 1;
}

.drop-slot.is-blocked::after {
  content: '';
}

.tetris-falling-tile {
  position: fixed;
  z-index: 9999;
  width: clamp(34px, calc(var(--game-size) * 0.14), 72px);
  height: clamp(34px, calc(var(--game-size) * 0.14), 72px);
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: Arial, sans-serif;
  font-weight: bold;
  font-size: clamp(20px, calc(var(--game-size) * 0.09), 46px);
  background-color: #fdf6e3;
  color: #1a1a1a;
  border-radius: 8px;
  box-shadow:
    inset 3px 3px 5px rgba(255, 255, 255, 1),
    inset -3px -3px 5px rgba(0, 0, 0, 0.15),
    2px 3px 5px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation-fill-mode: forwards;
}

.tetris-falling-tile.is-tone-green {
  background-color: #16a34a;
  color: #ffffff;
}

.tetris-falling-tile.is-tone-amber {
  background-color: #d98b00;
  color: #ffffff;
}

.tetris-falling-tile.is-tone-red {
  background-color: #c41f2f;
  color: #ffffff;
}

.tetris-falling-tile.is-drop {
  animation-name: tetrisDropTile;
  animation-timing-function: cubic-bezier(0.18, 0.7, 0.22, 1);
}

.grid-cell.tetris-clear-preview {
  animation: tetrisMatchedPulse 0.24s ease-in-out infinite alternate;
}

.grid-cell.tetris-column-impact {
  animation: tetrisColumnImpact 0.36s ease-out;
}

.grid-cell.tetris-impact-hit {
  box-shadow:
    inset 3px 3px 5px rgba(255, 255, 255, 1),
    inset -4px -4px 6px rgba(0, 0, 0, 0.15),
    0 0 18px rgba(168, 194, 234, 0.42),
    0 8px 18px rgba(0, 0, 0, 0.32);
}

.grid-cell.tetris-bomb-hit {
  animation: tetrisBombFlash 0.18s ease-out;
}

.tetris-combo-banner {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #1e4a7a;
  font-family: Arial, sans-serif;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.08em;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  pointer-events: none;
  animation: tetrisComboRise 0.9s ease-out forwards;
}

.tetris-score-banner {
  position: absolute;
  top: 48px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(253, 246, 227, 0.96);
  color: #1a1a1a;
  font-family: Arial, sans-serif;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  pointer-events: none;
  animation: tetrisScoreRise 0.95s ease-out forwards;
}

.tetris-bomb-banner {
  position: absolute;
  top: 82px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 246, 223, 0.96);
  color: #2b2b2b;
  font-family: Arial, sans-serif;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.05em;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  pointer-events: none;
  animation: tetrisBombBannerRise 1.2s ease-out forwards;
}

@keyframes tetrisSlotRattle {
  0% { transform: translateY(0); }
  18% { transform: translateY(1px) translateX(-1px); }
  36% { transform: translateY(0) translateX(1px); }
  54% { transform: translateY(1px) translateX(-1px); }
  72% { transform: translateY(0) translateX(1px); }
  100% { transform: translateY(0) translateX(0); }
}

@keyframes tetrisDropTile {
  0% { transform: translate(-50%, -50%); }
  58% { transform: translate(calc(-50% + var(--drop-x)), calc(-50% + var(--drop-y))) rotate(0deg); }
  72% { transform: translate(calc(-50% + var(--drop-x)), calc(-50% + var(--drop-y) - 12px)) rotate(-5deg); }
  84% { transform: translate(calc(-50% + var(--drop-x)), calc(-50% + var(--drop-y))) rotate(4deg); }
  92% { transform: translate(calc(-50% + var(--drop-x)), calc(-50% + var(--drop-y) - 5px)) rotate(-2deg); }
  100% { transform: translate(calc(-50% + var(--drop-x)), calc(-50% + var(--drop-y))); }
}

@keyframes tetrisColumnImpact {
  0% { transform: translateX(0); }
  18% { transform: translateX(-2px); }
  36% { transform: translateX(2px); }
  54% { transform: translateX(-1px); }
  72% { transform: translateX(1px); }
  100% { transform: translateX(0); }
}

@keyframes tetrisBombFlash {
  0% {
    transform: scale(1);
    box-shadow:
      inset 3px 3px 5px rgba(255, 255, 255, 1),
      inset -4px -4px 6px rgba(0, 0, 0, 0.15),
      0 0 0 rgba(248, 113, 113, 0);
  }
  100% {
    transform: scale(1.05);
    box-shadow:
      inset 3px 3px 5px rgba(255, 255, 255, 1),
      inset -4px -4px 6px rgba(0, 0, 0, 0.15),
      0 0 18px rgba(248, 113, 113, 0.8);
  }
}

@keyframes tetrisBombPop {
  0% {
    transform: translateY(0) scale(1);
    filter: brightness(1.3) saturate(1.15);
  }
  45% {
    transform: translateY(-3px) scale(1.34);
    filter: brightness(1.5) saturate(1.3);
  }
  75% {
    transform: translateY(0) scale(0.98);
    filter: brightness(1.15) saturate(1.06);
  }
  100% {
    transform: translateY(0) scale(1);
    filter: none;
  }
}

@keyframes tetrisBombRingExpand {
  0% {
    opacity: 0.85;
    transform: translate(-50%, -50%) scale(0.25);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2.85);
  }
}

@keyframes tetrisBombTextRise {
  0% {
    opacity: 0;
    transform: translate(-50%, 12px) scale(0.88);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1.04);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -20px) scale(1.06);
  }
}

@keyframes tetrisBombStripFlash {
  0% {
    filter: brightness(1);
    box-shadow: 0 0 0 rgba(255, 214, 102, 0);
  }
  50% {
    filter: brightness(1.35) saturate(1.25);
    box-shadow: 0 0 18px rgba(255, 214, 102, 0.72);
  }
  100% {
    filter: brightness(1);
    box-shadow: 0 0 0 rgba(255, 214, 102, 0);
  }
}

@keyframes tetrisBombStripBlast {
  0% {
    opacity: 0;
    background: radial-gradient(ellipse at center, rgba(255, 209, 102, 0.75) 0%, rgba(255, 209, 102, 0.3) 35%, rgba(255, 209, 102, 0) 72%);
    transform: scale(0.7);
  }
  28% {
    opacity: 1;
    background: radial-gradient(ellipse at center, rgba(255, 222, 135, 0.95) 0%, rgba(255, 209, 102, 0.55) 40%, rgba(255, 209, 102, 0) 78%);
    transform: scale(1);
  }
  100% {
    opacity: 0;
    background: radial-gradient(ellipse at center, rgba(255, 209, 102, 0.35) 0%, rgba(255, 209, 102, 0.18) 42%, rgba(255, 209, 102, 0) 82%);
    transform: scale(1.06);
  }
}

@keyframes tetrisMatchedPulse {
  from {
    box-shadow:
      inset 3px 3px 5px rgba(255, 255, 255, 0.45),
      inset -4px -4px 6px rgba(0, 0, 0, 0.2),
      0 0 0 rgba(255, 255, 255, 0);
  }
  to {
    box-shadow:
      inset 3px 3px 5px rgba(255, 255, 255, 0.65),
      inset -4px -4px 6px rgba(0, 0, 0, 0.15),
      0 0 14px rgba(255, 255, 255, 0.45);
  }
}

@keyframes tetrisComboRise {
  0% { opacity: 0; transform: translate(-50%, 8px) scale(0.92); }
  20% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -20px) scale(1.02); }
}

@keyframes tetrisScoreRise {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(0.9); }
  18% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -26px) scale(1.04); }
}

@keyframes tetrisBombBannerRise {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(0.9); }
  20% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -18px) scale(1.02); }
}

@keyframes tetrisBalloonPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.tetris-active-tile.is-pulsing {
  animation: tetrisBalloonPulse 0.5s ease-in-out;
}

@media (max-width: 700px) {
  .tetris-drop-row {
    margin-bottom: 6px;
  }

  .tetris-tools-row {
    gap: 10px;
    margin: 0 6px 0 auto;
  }

  .drop-slot {
    font-size: 10px;
  }

  .drop-slot::before {
    width: clamp(30px, calc(var(--game-size) * 0.13), 54px);
    height: clamp(36px, calc(var(--game-size) * 0.15), 66px);
  }

  .tetris-bomb-icon {
    width: 19px;
    height: 23px;
  }

  .tetris-combo-banner {
    font-size: 13px;
    padding: 7px 12px;
  }

  .tetris-score-banner {
    top: 42px;
    font-size: 15px;
    padding: 5px 10px;
  }

  .tetris-bomb-banner {
    top: 72px;
    font-size: 12px;
    padding: 5px 9px;
  }

  .tetris-bomb-topup-text {
    top: -28px;
    font-size: 15px;
  }

  .tetris-bomb-strip::before {
    left: -14px;
    right: -14px;
    top: -9px;
    bottom: -9px;
  }
}