@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');

/* ═══ Stack Tower — design system jeux.html ═══ */
.jeu-v-wrap { max-width: 480px; margin: 0 auto; }
#game-content { overflow: hidden; }

/* ── Board ── */
.st-board {
  position: relative;
  width: min(100%, 380px);
  aspect-ratio: 3 / 5;
  max-height: min(62vh, 520px);
  min-height: 280px;
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid rgba(0,255,245,.38);
  background: linear-gradient(180deg, #04060f, #020308);
  box-shadow:
    0 0 0 1px rgba(0,255,245,.08),
    0 0 40px rgba(0,255,245,.18),
    0 0 80px rgba(0,200,255,.08),
    inset 0 0 80px rgba(0,0,0,.5);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

#canvas-container,
#scanlines,
#overlay,
#combo-fx,
#hint,
#slice-bar {
  position: absolute;
}

#canvas-container { inset: 0; }

#canvas-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

#scanlines {
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      rgba(0,0,0,.06) 3px,
      rgba(0,0,0,.06) 4px
    ),
    radial-gradient(ellipse at 50% 0%, rgba(0,255,245,.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 4;
}

#combo-fx {
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(1.2rem, 4vw, 1.9rem);
  letter-spacing: 0.16em;
  pointer-events: none;
  z-index: 6;
  opacity: 0;
  text-transform: uppercase;
  white-space: nowrap;
  transition: none;
}

#hint {
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,.28);
  z-index: 6;
  text-transform: uppercase;
  pointer-events: none;
  white-space: nowrap;
  animation: st-breathe 2.5s ease-in-out infinite;
}

@keyframes st-breathe {
  0%, 100% { opacity: .28; }
  50%       { opacity: .75; }
}

#slice-bar {
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  width: min(62%, 210px);
  height: 6px;
  background: rgba(255,255,255,.1);
  border-radius: 999px;
  z-index: 6;
  overflow: hidden;
  pointer-events: none;
  display: none;
}

#slice-fill {
  width: 100%;
  height: 100%;
  background: #00ffe7;
  border-radius: 999px;
  transition: width .1s, background .3s;
  box-shadow: 0 0 10px #00ffe7;
}

/* ── Overlay (start / game-over) ── */
#overlay {
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(4,8,18,.78);
  backdrop-filter: blur(12px);
  padding: 24px;
  transition: opacity .45s ease;
}

#overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.ov-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(1.7rem, 7vw, 2.8rem);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
}

.ov-sub,
.big-score-lbl {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,.48);
  text-transform: uppercase;
  text-align: center;
}

.big-score {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(2.8rem, 12vw, 4.8rem);
  color: #ffe600;
  text-shadow: 0 0 34px rgba(255,230,0,.42);
  line-height: 1;
}

.btn {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  color: #031017;
  background: #00ffe7;
  border: none;
  padding: 13px 28px;
  border-radius: 999px;
  cursor: pointer;
  text-transform: uppercase;
  box-shadow: 0 0 28px rgba(0,255,231,.36);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.btn:hover {
  background: #ffffff;
  box-shadow: 0 0 44px rgba(0,255,231,.55);
  transform: translateY(-1px);
}

.btn.danger {
  color: #fff;
  background: #ff2d6b;
  box-shadow: 0 0 28px rgba(255,45,107,.34);
}

.btn.danger:hover {
  box-shadow: 0 0 44px rgba(255,45,107,.52);
}

/* ── Overlays HTML écrans démarrage / fin ── */
.jvst-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  background: var(--cd, #fff);
  border-radius: var(--r2, 14px);
  overflow: hidden;
}
.jvst-overlay.hidden { display: none; }

.jvst-overlay > .snk-screen {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.jvst-overlay .snk-screen {
  justify-content: center;
  align-items: center;
  padding-top: 20px;
  padding-bottom: 20px;
  width: 100%;
  min-height: 100%;
  box-sizing: border-box;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .jeu-v-wrap { max-width: none; }
  .st-board { min-height: 240px; border-radius: 14px; }
  #hint { font-size: 0.55rem; letter-spacing: 0.14em; }
  .ov-sub, .big-score-lbl { letter-spacing: 0.14em; }
}
