/* components.css — shared UI chrome: overlay panels, buttons, confetti */
.confetti {
  position: fixed;
  z-index: 8;
  font-size: 26px;
  pointer-events: none;
  animation: confettiFall 1.6s ease-in forwards;
}

@keyframes confettiFall {
  0%   { opacity: 1; transform: translateY(0) rotate(0deg); }
  100% { opacity: 0; transform: translateY(50vh) rotate(360deg); }
}

/* ---------- Minigame overlay ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 26, 0.82);
  backdrop-filter: blur(6px);
  padding: 20px;
}

.overlay.open { display: flex; }

.panel {
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #1a2260, #10163f);
  border: 4px solid #b64bff;
  border-radius: 26px;
  padding: 28px 26px 26px;
  text-align: center;
  box-shadow: 0 0 60px rgba(182, 75, 255, 0.55);
  position: relative;
  animation: panelIn 0.35s cubic-bezier(0.2, 1.5, 0.4, 1);
}

@keyframes panelIn {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.panel .close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 3px solid rgba(0,0,0,0.35);
  background: var(--brick-red);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,0.25);
}
.panel .close:hover { transform: scale(1.1); }

.panel h2 {
  font-size: 28px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #e6c2ff;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.5);
}

.panel .sub { font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.75); margin: 6px 0 24px; }

.result-msg {
  min-height: 26px;
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 18px;
  color: var(--brick-yellow);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
}

.roll-btn {
  font-family: inherit;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
  background: linear-gradient(180deg, #2fbb4f, #1c8a37);
  border: 3px solid rgba(0,0,0,0.35);
  border-radius: 14px;
  padding: 14px 40px;
  cursor: pointer;
  box-shadow: inset 0 -6px 0 rgba(0,0,0,0.25);
  margin-bottom: 24px;
}

.roll-btn:hover:not(:disabled) { transform: scale(1.05); }
.roll-btn:active:not(:disabled) { transform: scale(0.95); }
.roll-btn:disabled { opacity: 0.5; cursor: default; }


.buy-btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #fff;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.35);
  background: linear-gradient(180deg, #2fbb4f, #1c8a37);
  border: 3px solid rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.22);
  white-space: nowrap;
}

.buy-btn canvas { image-rendering: pixelated; display: block; }
.buy-btn:hover:not(:disabled) { transform: scale(1.05); }
.buy-btn:disabled { opacity: 0.45; cursor: default; }
.buy-btn.owned-tag { background: rgba(255, 255, 255, 0.12); box-shadow: none; cursor: default; }

.hud-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 900;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  padding: 7px 12px;
  cursor: pointer;
}

.hud-btn:hover { background: rgba(255, 255, 255, 0.22); }
