.lynk-block-blast {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 16px 10px 22px;
  margin-bottom: 28px;
  color: #f6f8ff;
  font-family: "Quicksand", system-ui, sans-serif;
}

.lynk-bb-shell {
  position: relative;
  border-radius: 20px;
  background: linear-gradient(180deg, var(--bb-shell-top, #c7c9cc) 0%, var(--bb-shell-bottom, #b6b9be) 100%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 10px 28px rgba(0, 0, 0, 0.22);
  padding: 10px 12px 18px;
}

.lynk-bb-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.lynk-bb-head-meta {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.lynk-bb-head-center {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.lynk-bb-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: end;
}

.lynk-bb-best-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #113a7b;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.6);
}

.lynk-bb-best-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.lynk-bb-best-chip strong {
  font-size: clamp(1rem, 3.8vw, 1.5rem);
  font-weight: 700;
}

.lynk-bb-notes-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #184d36;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.6);
}

.lynk-bb-notes-chip strong {
  font-size: clamp(1rem, 3.6vw, 1.4rem);
  font-weight: 700;
}

.lynk-bb-notes-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.lynk-bb-score-wrap {
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

.lynk-bb-score-label {
  display: block;
  opacity: 0.78;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lynk-bb-score-wrap strong {
  display: block;
  font-size: clamp(2.25rem, 9vw, 4.4rem);
  letter-spacing: -0.03em;
  line-height: 1;
}

.lynk-bb-score-wrap.is-bump strong {
  animation: lynk-bb-score-bump 180ms ease-out;
}

.lynk-bb-restart {
  border: 1px solid rgba(23, 32, 55, 0.25);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.45);
  color: #1d2438;
  font-weight: 700;
  cursor: pointer;
}

.lynk-bb-restart--mini {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1.08rem;
}

.lynk-bb-fullscreen-btn.is-active {
  background: rgba(20, 32, 62, 0.78);
  color: #f4f8ff;
}

.lynk-bb-fullscreen-btn {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.42rem;
  font-weight: 700;
  line-height: 1;
}

.lynk-bb-grid {
  width: min(100%, 560px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  padding: 9px;
  border-radius: 10px;
  background: var(--bb-grid-bg, #3f4348);
  border: 4px solid #dadcdf;
  box-shadow: inset 0 0 0 2px rgba(17, 20, 27, 0.55), 0 7px 12px rgba(0, 0, 0, 0.2);
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  touch-action: none;
}

.lynk-bb-cell {
  --bb-cell-color: #2f3237;
  border-radius: 3px;
  background: var(--bb-cell-empty, #2f3237);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  transition: transform 0.12s ease, opacity 0.18s ease, background-color 0.18s ease;
}

.lynk-bb-cell.is-filled {
  background:
    linear-gradient(148deg, rgba(255, 255, 255, 0.38) 0%, rgba(255, 255, 255, 0) 45%),
    linear-gradient(330deg, rgba(0, 0, 0, 0.24) 0%, rgba(0, 0, 0, 0) 62%),
    var(--bb-cell-color);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38), inset 0 -2px 0 rgba(0, 0, 0, 0.25), 0 1px 0 rgba(0, 0, 0, 0.25);
}

.lynk-bb-cell.is-hover {
  opacity: 0.55;
}

.lynk-bb-cell.is-clearing {
  animation: lynk-bb-pop 0.24s ease-out forwards;
}

.lynk-bb-tray {
  margin: 16px auto 0;
  width: min(100%, 560px);
  min-height: 106px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.lynk-bb-slot {
  min-height: 102px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bb-slot-bg, transparent);
  border-radius: 12px;
}

.lynk-bb-piece {
  position: relative;
  touch-action: none;
  cursor: grab;
  user-select: none;
}

.lynk-bb-piece:active {
  cursor: grabbing;
}

.lynk-bb-piece-cell {
  --bb-cell-color: #8cb8ff;
  position: absolute;
  border-radius: 3px;
  background:
    linear-gradient(148deg, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0) 45%),
    linear-gradient(330deg, rgba(0, 0, 0, 0.22) 0%, rgba(0, 0, 0, 0) 62%),
    var(--bb-cell-color);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -2px 0 rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.36);
}

.lynk-bb-floating {
  position: fixed;
  pointer-events: none;
  z-index: 99;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.38));
}

.lynk-bb-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.lynk-bb-overlay.is-hidden {
  display: none;
}

.lynk-bb-overlay-card {
  width: min(92vw, 380px);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(180deg, #394155, #262c3d);
  padding: 20px;
  text-align: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.lynk-bb-overlay-title {
  margin: 0;
  font-size: 1.7rem;
}

.lynk-bb-overlay-score {
  margin: 8px 0 18px;
  color: rgba(245, 248, 255, 0.86);
}

.lynk-bb-overlay-notes {
  margin-top: -8px;
  margin-bottom: 18px;
}

.lynk-no-scroll {
  overflow: hidden !important;
  overscroll-behavior: none;
}

.lynk-block-blast.is-fullscreen,
.lynk-block-blast.is-pseudo-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: max(12px, env(safe-area-inset-top, 0px)) 10px max(12px, env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f1115;
  overflow-y: auto;
}

.lynk-block-blast.is-fullscreen .lynk-bb-shell,
.lynk-block-blast.is-pseudo-fullscreen .lynk-bb-shell {
  width: min(100%, 840px);
  margin: 0;
}

.lynk-bb-overlay-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.lynk-bb-overlay-actions .lynk-bb-restart {
  min-width: 110px;
  padding: 9px 16px;
}

.lynk-bb-restart--ghost {
  background: rgba(255, 255, 255, 0.2);
}

@keyframes lynk-bb-pop {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.18); opacity: 0; }
}

@keyframes lynk-bb-score-bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* ── Mobile ≤ 680px ──────────────────────────────────── */
@media (max-width: 680px) {
  .lynk-bb-head {
    grid-template-columns: auto 1fr auto;
  }

  /* Full-bleed + min-height để đẩy footer xuống dưới màn hình */
  .lynk-block-blast {
    width: 100%;
    padding-inline: 0;
    padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
    margin-bottom: 0;
    min-height: calc(100dvh - var(--lynk-header-h, 5rem));
  }

  /* Shell: không border-radius, margin-bottom để thở */
  .lynk-bb-shell {
    border-radius: 0;
    padding: 8px 8px 20px;
    margin-bottom: 32px;
  }

  /* Grid: full width */
  .lynk-bb-grid {
    width: 100%;
    padding: 6px;
    gap: 2px;
    border-width: 3px;
  }

  /* Score lớn hơn tẹo cho dễ nhìn */
  .lynk-bb-score-wrap strong {
    font-size: clamp(2rem, 11vw, 3.5rem);
  }

  /* HUD chips nhỏ gọn */
  .lynk-bb-best-chip strong { font-size: clamp(0.95rem, 4.5vw, 1.3rem); }
  .lynk-bb-notes-chip strong { font-size: clamp(0.95rem, 4vw, 1.2rem); }
  .lynk-bb-best-icon,
  .lynk-bb-notes-icon { font-size: 1.2rem; }

  /* Tray pieces: đủ lớn để tap bằng ngón tay */
  .lynk-bb-tray {
    gap: 8px;
    margin-top: 12px;
    margin-bottom: 16px;
    min-height: 96px;
  }

  .lynk-bb-slot {
    min-height: 90px;
    border-radius: 10px;
  }

  /* Overlay card: chiếm full width mobile */
  .lynk-bb-overlay-card {
    width: min(96vw, 360px);
    padding: 18px 16px;
    border-radius: 16px;
  }
  .lynk-bb-overlay-title { font-size: 1.5rem; }
  .lynk-bb-overlay-score { font-size: 0.95rem; }
  .lynk-bb-overlay-actions .lynk-bb-restart {
    min-width: 100px;
    padding: 10px 14px;
    font-size: 0.9rem;
  }

  /* Fullscreen mobile: shell fill edge-to-edge, không padding ngang */
  .lynk-block-blast.is-fullscreen,
  .lynk-block-blast.is-pseudo-fullscreen {
    padding-inline: 0;
    align-items: flex-start;
    overflow-y: auto;
  }

  .lynk-block-blast.is-fullscreen .lynk-bb-shell,
  .lynk-block-blast.is-pseudo-fullscreen .lynk-bb-shell {
    width: 100%;
    border-radius: 0;
    margin: 0;
    min-height: calc(100dvh - max(12px, env(safe-area-inset-top, 0px)) - max(12px, env(safe-area-inset-bottom, 0px)));
  }
}

/* ── Mobile nhỏ ≤ 400px ──────────────────────────────── */
@media (max-width: 400px) {
  .lynk-bb-grid {
    gap: 1px;
    padding: 5px;
  }
  .lynk-bb-tray { gap: 6px; }
  .lynk-bb-slot { min-height: 80px; }
  .lynk-bb-restart--mini {
    width: 30px;
    height: 30px;
    font-size: 0.95rem;
  }
}
