/* Block Stack — game styles */

.block-stack-page {
  --bs-frame-width: 860px;
}

.block-stack-page .tool-frame {
  max-width: var(--bs-frame-width);
}

.block-stack-page .tool-header-block {
  max-width: 620px;
}

.block-stack-page .page-title {
  max-width: 12ch;
  font-size: clamp(2rem, 4vw, 2.9rem);
  line-height: 0.98;
}

.block-stack-page .page-subtitle {
  max-width: 42ch;
}

/* ── Arcade ──────────────────────────────────────────────── */
.bs-arcade {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

/* ── HUD ─────────────────────────────────────────────────── */
.bs-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 400px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.bs-hud__left,
.bs-hud__right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 52px;
}

.bs-hud__label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.bs-hud__value-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.bs-hud__value {
  font-size: 1.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-family: monospace;
  color: var(--color-text);
  line-height: 1;
}

.bs-hud__combo {
  font-size: 0.72rem;
  font-weight: 700;
  color: #ffd700;
  font-family: monospace;
}

.bs-hud__combo[hidden] {
  display: none;
}

.bs-hud__center {
  flex: 1;
  text-align: center;
  padding: 0 8px;
}

.bs-hud__shift {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-text);
}

/* ── Canvas ──────────────────────────────────────────────── */
.bs-canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 400px;
  height: 600px;
  border-radius: 12px;
  overflow: hidden;
  background: #0f1923;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  user-select: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.bs-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ── Controls hint ───────────────────────────────────────── */
.bs-controls-hint {
  font-size: 0.74rem;
  color: var(--color-text-muted);
  text-align: center;
  margin: 0;
}

.bs-controls-hint kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  font-size: 0.68rem;
  background: rgba(255, 255, 255, 0.07);
}

/* ── Death screen ────────────────────────────────────────── */
.bs-death {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.82);
  z-index: 10;
  padding: 16px;
}

.bs-death[hidden] {
  display: none;
}

.bs-death__clipboard {
  position: relative;
  background: #f5f0e8;
  color: #1a1a1a;
  border-radius: 6px;
  padding: 30px 20px 18px;
  max-width: 280px;
  width: 100%;
  transform: rotate(2deg);
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.6),
    0 2px 8px rgba(0, 0, 0, 0.4);
  font-family: 'Courier New', monospace;
  letter-spacing: 0.5px;
}

.bs-death__clip {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 20px;
  border: 2px solid #a0a0a0;
  border-radius: 10px 10px 0 0;
  background: transparent;
}

.bs-death__clip::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 5px;
  right: 5px;
  height: 8px;
  border: 2px solid #a0a0a0;
  border-top: none;
  border-radius: 0 0 4px 4px;
  background: transparent;
}

.bs-death__title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #1a1a1a;
  margin: 0 0 1px;
}

.bs-death__sub {
  font-size: 0.6rem;
  color: #666;
  margin: 0 0 8px;
  letter-spacing: 0.06em;
}

.bs-death__rule {
  border: none;
  border-top: 1px solid #ddd;
  margin: 0 0 8px;
}

.bs-death__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  font-size: 0.68rem;
  padding: 3px 0;
  border-bottom: 1px dotted #ccc;
}

.bs-death__row:last-of-type {
  border-bottom: none;
  margin-bottom: 6px;
}

.bs-death__row-label {
  font-weight: 600;
  color: #555;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
}

.bs-death__row-value {
  font-weight: 700;
  color: #1a1a1a;
  font-size: 0.7rem;
}

.bs-death__note-label {
  font-size: 0.58rem;
  font-weight: 700;
  color: #555;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 8px 0 2px;
}

.bs-death__note {
  margin: 0 0 4px;
  font-size: 0.66rem;
  color: #c0392b;
  font-style: italic;
  padding: 6px 8px;
  background: rgba(192, 57, 43, 0.06);
  border-left: 3px solid #c0392b;
  border-radius: 0 2px 2px 0;
  line-height: 1.4;
}

.bs-death__stamp {
  position: absolute;
  bottom: 48px;
  right: 14px;
  font-size: 0.6rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #c0392b;
  border: 2px solid #c0392b;
  padding: 2px 6px;
  transform: rotate(8deg);
  opacity: 0.5;
  border-radius: 2px;
}

.bs-death__actions {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

/* Amber retry button (spec: #e8a020) */
.bs-death__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 28px;
  background: #e8a020;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  min-height: 0;
  font-family: 'Courier New', monospace;
  transition: background 0.15s;
}

.bs-death__btn:hover {
  background: #f0b040;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
  .bs-canvas-wrap {
    max-width: 100%;
    height: min(80vh, 600px);
  }

  .bs-hud {
    max-width: 100%;
  }

  .bs-hud__value {
    font-size: 1.2rem;
  }

  .bs-hud__shift {
    font-size: 0.66rem;
  }

  .bs-death__clipboard {
    max-width: 250px;
    padding: 24px 14px 14px;
  }
}

@media (max-width: 720px) {
  .block-stack-page .tool-header-block {
    max-width: none;
  }

  .block-stack-page .page-title {
    max-width: none;
    font-size: clamp(2rem, 10vw, 2.8rem);
  }
}
