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

/* ── Visibility toggles used by game JS ── */
.hud-hidden { display: none !important; }
.menu-hidden { display: none !important; }

/* ── Board ── */
.blobv-board {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  min-height: 360px;
  max-height: min(72vh, 620px);
  border-radius: 22px;
  overflow: hidden;
  border: 2px solid rgba(0,255,204,.35);
  background:
    radial-gradient(circle at center, rgba(0,255,204,.06), transparent 52%),
    linear-gradient(180deg, #09111f 0%, #070d18 100%);
  box-shadow: 0 0 36px rgba(0,255,204,.12), inset 0 0 80px rgba(0,0,0,.45);
  touch-action: none;
  overscroll-behavior: contain;
  -webkit-user-select: none;
  user-select: none;
}

.blobv-board::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,.03), transparent 18%),
    repeating-linear-gradient(0deg, transparent, transparent 6px, rgba(0,255,204,.015) 6px, rgba(0,255,204,.015) 12px);
  z-index: 2;
}

#gameCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: none;
  z-index: 1;
}

/* ── In-board overlays ── */
#menuScreen,
#gameOverScreen {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 22px 16px;
  background: rgba(4,10,20,.88);
  backdrop-filter: blur(8px);
  overflow-y: auto;
}

#pauseOverlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(4,10,20,.68);
  backdrop-filter: blur(6px);
}

/* ── Menu screen content ── */
.game-title {
  margin: 0 0 6px;
  font-size: clamp(1.8rem, 8vw, 2.6rem);
  font-weight: 900;
  letter-spacing: .08em;
  color: #00ffcc;
}

.game-subtitle {
  margin: 0 0 14px;
  font-size: 11px;
  color: var(--tx3);
  text-transform: uppercase;
  letter-spacing: .2em;
}

.input-group { margin-bottom: 12px; text-align: left; }

.input-group label {
  display: block;
  margin-bottom: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--tx3);
}

#playerName {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-radius: 10px;
  color: var(--tx);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.dk #playerName { background: var(--cd3); border-color: var(--bd2); }

#playerName:focus {
  border-color: rgba(0,255,204,.65);
  box-shadow: 0 0 0 3px rgba(0,255,204,.12);
}

#playerName::placeholder { color: var(--tx3); }

.controls-info {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--bd);
  font-size: 11px;
  color: var(--tx3);
  line-height: 1.75;
}

.controls-info span { display: inline-block; margin: 0 4px; }

.key {
  background: rgba(0,255,204,.12);
  padding: 3px 7px;
  border-radius: 999px;
  color: #67e8f9;
  font-size: 10px;
}

/* ── Pause overlay text ── */
.pause-text {
  font-size: clamp(2rem, 9vw, 3rem);
  font-weight: 900;
  letter-spacing: .2em;
  color: #facc15;
}

/* ── Game over screen ── */
.gameover-title {
  margin: 0 0 12px;
  font-size: clamp(1.6rem, 7vw, 2.2rem);
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fb7185;
}

.stat-row + .stat-row { margin-top: 10px; }
.stat-label { font-size: 11px; color: var(--tx3); margin-bottom: 2px; }
.stat-value { font-size: 20px; font-weight: 800; font-family: var(--mono); color: var(--tx); }
.stat-value.best { color: #facc15; }

.blobv-restart-btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  font-family: inherit;
  background: linear-gradient(135deg, #fb7185 0%, #fb923c 100%);
  color: #fff;
  transition: transform .18s ease;
}

.blobv-restart-btn:hover { transform: translateY(-1px); }

/* ── Desktop help bar ── */
.blobv-help {
  padding: 8px 14px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 1px solid var(--bd);
  background: var(--sf);
}

.blobv-help span {
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--bg2);
  border: 1px solid var(--bd);
  font-size: 10px;
  color: var(--tx2);
}

.blobv-help b { color: var(--tx); }

/* ── Mobile controls ── */
#mobileControls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 170px;
  pointer-events: none;
  z-index: 6;
  display: none;
}

.mobile-btn {
  position: absolute;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.3);
  background: rgba(10,20,40,.66);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: auto;
  touch-action: manipulation;
  user-select: none;
  box-shadow: 0 12px 30px rgba(0,0,0,.22);
}

#splitBtn { right: 14px; bottom: 88px; background: rgba(0,255,204,.2); border-color: rgba(0,255,204,.5); }
#ejectBtn { right: 14px; bottom: 10px; background: rgba(250,204,21,.18); border-color: rgba(250,204,21,.44); }

#joystickZone {
  position: absolute;
  left: 14px;
  bottom: 10px;
  width: 132px;
  height: 132px;
  pointer-events: auto;
}

#joystickBase {
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: rgba(10,20,40,.6);
  border: 2px solid rgba(255,255,255,.18);
}

#joystickKnob {
  position: absolute;
  width: 46px;
  height: 46px;
  left: 50%; top: 50%;
  transform: translate(-50%,-50%);
  border-radius: 50%;
  background: rgba(0,255,204,.56);
  border: 2px solid rgba(0,255,204,.78);
}

/* ── Custom cursor ── */
.custom-cursor {
  position: fixed;
  width: 20px; height: 20px;
  border: 2px solid #00ffcc;
  border-radius: 50%;
  pointer-events: none;
  z-index: 20;
  transform: translate(-50%,-50%);
  opacity: 0;
  mix-blend-mode: screen;
}

.custom-cursor::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%,-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #00ffcc;
}

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

.jvblobv-overlay.hidden { display: none; }

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

.jvblobv-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; }
  .blobv-board { min-height: 320px; max-height: 68svh; border-radius: 18px; }
  #mobileControls { display: block; }
}

@media (max-width: 460px) {
  #joystickZone { width: 118px; height: 118px; }
  .mobile-btn { width: 62px; height: 62px; font-size: 10px; }
  #splitBtn { bottom: 76px; }
}
