/* Block Stack — scoped to .cc-block-stack-* to avoid clashing with host page */

.cc-block-stack-root {
  --ccbs-bg: #FFF0F4;
  --ccbs-panel: #FBF4EE;
  --ccbs-coral: #D4715A;
  --ccbs-pink: #FF6B8A;
  --ccbs-sage: #7A9B8A;
  --ccbs-gold: #FFB800;
  --ccbs-dark: #243B45;

  position: relative;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px;
  background: var(--ccbs-bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ccbs-dark);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  box-sizing: border-box;
}

.cc-block-stack-root * {
  box-sizing: border-box;
}

.cc-block-stack-hud {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 8px;
}

.cc-block-stack-stat {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 2px solid var(--ccbs-coral);
  border-radius: 16px;
  padding: 6px 8px;
  min-width: 0;
}

.cc-block-stack-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ccbs-coral);
  opacity: 0.85;
}

.cc-block-stack-value {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--ccbs-dark);
}

.cc-block-stack-next-box {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 2px solid var(--ccbs-sage);
  border-radius: 16px;
  padding: 4px 10px;
  gap: 2px;
}

.cc-block-stack-next-box .cc-block-stack-label {
  color: var(--ccbs-sage);
}

.cc-block-stack-next-canvas {
  width: 46px;
  height: 46px;
  display: block;
}

.cc-block-stack-board-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cc-block-stack-canvas {
  display: block;
  border-radius: 18px;
  background: var(--ccbs-panel);
  box-shadow: inset 0 0 0 3px rgba(212, 113, 90, 0.35), 0 6px 14px rgba(36, 59, 69, 0.12);
  touch-action: none;
}

.cc-block-stack-hint {
  position: absolute;
  left: 0;
  right: 0;
  top: 8px;
  text-align: center;
  pointer-events: none;
  font-size: 11px;
  font-weight: 700;
  color: rgba(36, 59, 69, 0.45);
  transition: opacity 0.4s ease;
}

.cc-block-stack-hint--hidden {
  opacity: 0;
}

.cc-block-stack-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(36, 59, 69, 0.45);
  border-radius: 18px;
  padding: 16px;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 10;
}

.cc-block-stack-overlay[hidden] {
  display: none;
}

.cc-block-stack-overlay-card {
  width: 100%;
  max-width: 300px;
  background: #ffffff;
  border-radius: 24px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(36, 59, 69, 0.25);
}

.cc-block-stack-overlay-emoji {
  font-size: 34px;
  line-height: 1;
  margin-bottom: 6px;
}

.cc-block-stack-overlay-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--ccbs-coral);
  margin-bottom: 8px;
}

.cc-block-stack-overlay-sub {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ccbs-dark);
  opacity: 0.85;
  margin-bottom: 14px;
}

.cc-block-stack-overlay-score {
  font-size: 15px;
  font-weight: 700;
  color: var(--ccbs-dark);
  margin-bottom: 14px;
}

.cc-block-stack-overlay-score .cc-block-stack-final-num {
  display: block;
  font-size: 34px;
  font-weight: 800;
  color: var(--ccbs-gold);
  margin-top: 2px;
}

.cc-block-stack-btn {
  appearance: none;
  border: none;
  outline: none;
  cursor: pointer;
  width: 100%;
  padding: 14px 20px;
  border-radius: 26px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #ffffff;
  background: linear-gradient(135deg, var(--ccbs-coral), var(--ccbs-pink));
  box-shadow: 0 6px 16px rgba(212, 113, 90, 0.4);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.cc-block-stack-btn:active {
  transform: scale(0.96);
  box-shadow: 0 3px 8px rgba(212, 113, 90, 0.4);
}

@media (max-height: 520px) {
  .cc-block-stack-hint {
    display: none;
  }
}
