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

/* ── Variables de jeu ── */
:root {
  --p4-board: #1a1d3a;
  --p4-border: #2d3166;
  --p4-empty: #0d0f24;
  --p4-player: #ff3d6e;
  --p4-player-glow: rgba(255, 61, 110, .5);
  --p4-ai: #ffd23f;
  --p4-ai-glow: rgba(255, 210, 63, .5);
  --cell-size: clamp(36px, 9.5vw, 52px);
  --gap: clamp(5px, 1.3vw, 8px);
  --pad: clamp(10px, 2.6vw, 14px);
}

/* ── Statut de partie ── */
#status {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--tx);
}

#status.thinking { animation: thinking 1.1s ease infinite; }
#status.win-player { color: var(--p4-player); }
#status.win-ai { color: #9a7000; }
.dk #status.win-ai { color: var(--p4-ai); }

/* ── Board shell ── */
.board-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  touch-action: manipulation;
}

/* ── Flèches colonnes ── */
.col-arrows {
  display: flex;
  gap: var(--gap);
  justify-content: center;
}

.col-arrow {
  width: var(--cell-size);
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 10px;
  background: none;
  border: none;
  transition: background .15s ease, transform .15s ease;
  -webkit-tap-highlight-color: transparent;
}

.col-arrow:active { transform: scale(.96); }

.col-arrow .arrow {
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 11px solid var(--p4-player);
  filter: drop-shadow(0 0 6px var(--p4-player-glow));
  animation: pulse 1s ease infinite;
  display: none;
}

.col-arrow.active,
.col-arrow:hover { background: rgba(255, 61, 110, .06); }

.col-arrow.active .arrow,
.col-arrow:hover .arrow { display: block; }

/* ── Plateau ── */
.board {
  background: var(--p4-board);
  border: 2px solid var(--p4-border);
  border-radius: 22px;
  padding: var(--pad);
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  box-shadow: 0 0 40px rgba(108, 99, 255, .12), inset 0 0 22px rgba(0, 0, 0, .3);
}

.board-row {
  display: flex;
  gap: var(--gap);
}

/* ── Cellules ── */
.cell {
  width: var(--cell-size);
  height: var(--cell-size);
  border-radius: 50%;
  background: var(--p4-empty);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .55);
  position: relative;
  overflow: hidden;
  border: none;
  cursor: default;
  transition: background .15s ease, box-shadow .2s ease, transform .12s ease;
}

.cell.clickable { cursor: pointer; }

.cell.clickable:hover,
.cell.clickable:active { background: rgba(255, 61, 110, .1); }

.cell.player {
  background: var(--p4-player);
  box-shadow: 0 0 12px var(--p4-player-glow), inset 0 -4px 8px rgba(0, 0, 0, .3), inset 0 2px 4px rgba(255, 255, 255, .15);
}

.cell.ai {
  background: var(--p4-ai);
  box-shadow: 0 0 12px var(--p4-ai-glow), inset 0 -4px 8px rgba(0, 0, 0, .3), inset 0 2px 4px rgba(255, 255, 255, .15);
}

.cell.win.player,
.cell.win.ai { animation: winPulse 1s ease infinite; }

.cell.win.player {
  box-shadow: 0 0 20px var(--p4-player-glow), 0 0 40px var(--p4-player-glow), inset 0 -4px 8px rgba(0, 0, 0, .3);
}

.cell.win.ai {
  box-shadow: 0 0 20px var(--p4-ai-glow), 0 0 40px var(--p4-ai-glow), inset 0 -4px 8px rgba(0, 0, 0, .3);
}

.cell.drop { animation: dropIn .35s cubic-bezier(.34, 1.56, .64, 1); }

/* ── Brillance jeton ── */
.shine {
  position: absolute;
  top: 8px;
  left: 12px;
  width: 20px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .25);
  filter: blur(4px);
  display: none;
}

.cell.player .shine,
.cell.ai .shine { display: block; }

/* ── Bouton rejouer ── */
.restart-btn {
  display: none;
  font-family: var(--font);
  font-weight: 700;
  font-size: 13px;
  border: none;
  border-radius: 10px;
  padding: 10px 32px;
  color: #fff;
  background: var(--a1);
  box-shadow: 0 2px 8px rgba(109, 92, 255, .18);
  cursor: pointer;
  transition: filter .15s ease, transform .15s ease;
}

.restart-btn.visible { display: block; }

.restart-btn:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

/* ── Animations ── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .4; }
}

@keyframes dropIn {
  0%   { transform: translateY(-350px); opacity: .7; }
  70%  { transform: translateY(8px); }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes winPulse {
  0%, 100% { filter: brightness(1) drop-shadow(0 0 8px rgba(255, 255, 255, .4)); }
  50%       { filter: brightness(1.4) drop-shadow(0 0 18px rgba(255, 255, 255, .8)); }
}

@keyframes thinking {
  0%, 100% { opacity: .55; }
  50%       { opacity: 1; }
}

/* ── HTML page overlays (démarrage / fin) ── */
.jvp4-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  background: var(--cd, #fff);
  overflow: hidden;
}

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

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

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

/* ── Responsive ── */
@media (max-width: 480px) {
  .jeu-v-wrap { max-width: none; }
}
