* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 100%;
  height: 100%;
  background: #0a1028;
  overflow: hidden;
  font-family: "Avenir Next", "Segoe UI", "PingFang SC", system-ui, sans-serif;
}
body {
  display: flex;
  align-items: center;
  justify-content: center;
}
canvas#cv {
  display: block;
  touch-action: none;
  pointer-events: none;
  z-index: 3;
}
/* Full-bleed playfield — match shell canvas inset:0 (partial band desynced hits) */
.gf-shell-wrap canvas#three-cv,
.ag-shell-wrap canvas#three-cv,
canvas#three-cv {
  touch-action: none;
  pointer-events: auto !important;
  z-index: 5;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
}
/* Title/pause/over sit above full-bleed three (shell overlays default z:auto) */
.gf-shell-wrap > .gf-overlay,
.ag-shell-wrap > .ag-overlay {
  z-index: 30;
}
.gf-shell-wrap > .gf-coach-scrim,
.ag-shell-wrap > .ag-coach-scrim,
.gf-shell-wrap > .gf-coach-tip,
.ag-shell-wrap > .ag-coach-tip {
  z-index: 32;
}

/* Level-clear celebration (above three-cv, below shell title overlays) */
.cb-clear-overlay {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, rgba(30, 80, 140, 0.55), rgba(5, 10, 28, 0.82));
  pointer-events: auto;
  animation: cb-clear-in 0.28s ease-out;
}
.cb-clear-overlay[hidden] {
  display: none !important;
}
.cb-clear-card {
  text-align: center;
  padding: 28px 36px 24px;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(28, 48, 96, 0.95), rgba(12, 20, 48, 0.96));
  border: 1px solid rgba(125, 200, 255, 0.35);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  min-width: 220px;
}
.cb-clear-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #7cff3a;
  text-shadow: 0 0 18px rgba(124, 255, 58, 0.45);
}
.cb-clear-level {
  margin-top: 10px;
  font-size: 16px;
  font-weight: 700;
  color: #e8f0ff;
}
.cb-clear-bar {
  margin: 18px auto 10px;
  width: 160px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.cb-clear-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7cff3a, #4da3ff);
  transition: width 0.05s linear;
}
.cb-clear-sub {
  font-size: 13px;
  color: #9ab0d8;
}
@keyframes cb-clear-in {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
/* Lock three canvas while clear overlay is up */
.cb-input-locked canvas#three-cv,
.cb-input-locked .gf-shell-wrap canvas#three-cv,
.cb-input-locked .ag-shell-wrap canvas#three-cv {
  pointer-events: none !important;
}
