/* =============================================
   NEON DRIFT — Style Cyberpunk Néon v2
   ============================================= */

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

:root {
  --cyan:    #00f5ff;
  --magenta: #ff00ff;
  --green:   #39ff14;
  --orange:  #ff6a00;
  --yellow:  #ffe600;
  --red:     #ff2200;
  --dark:    #03000f;
  --panel:   rgba(0,245,255,0.04);
  --border:  rgba(0,245,255,0.25);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: 'Orbitron', sans-serif;
  overflow: hidden;
  user-select: none;
}

/* ── CONTENEUR ── */
#game-container {
  position: relative;
  width: 800px;
  height: 600px;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid var(--border);
  box-shadow:
    0 0 0 1px rgba(0,245,255,.08),
    0 0 40px rgba(0,245,255,.15),
    0 0 80px rgba(0,245,255,.06);
}

/* ── HUD SUPÉRIEUR ── */
#hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 22px 0;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,.65) 0%, transparent 100%);
}

.hud-block { text-align: center; min-width: 90px; }

.hud-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  letter-spacing: 4px;
  color: rgba(0,245,255,.55);
  margin-bottom: 2px;
}

#score, #level-display {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--cyan);
  text-shadow: 0 0 8px var(--cyan), 0 0 20px rgba(0,245,255,.4);
}

#lives-display {
  display: flex;
  gap: 5px;
  justify-content: center;
  margin-top: 4px;
}

.life-ship {
  width: 14px;
  height: 14px;
  clip-path: polygon(50% 0%, 100% 100%, 50% 70%, 0% 100%);
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  transition: opacity .3s;
}

/* ── BARRE BASSE ── */
#bottom-bar {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  pointer-events: none;
  font-size: 11px;
}

.bb-block { display: flex; align-items: center; gap: 7px; }

.bb-sep {
  color: rgba(0,245,255,.2);
  font-size: 14px;
}

#high-score { color: var(--magenta); text-shadow: 0 0 8px var(--magenta); }

#coins-hud {
  color: var(--yellow);
  font-weight: 700;
  text-shadow: 0 0 8px var(--yellow);
  font-size: 12px;
}

/* ── OVERLAYS ── */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(3,0,15,.90);
  backdrop-filter: blur(6px);
  z-index: 20;
}
.overlay.hidden { display: none; }

.overlay-content { text-align: center; position: relative; z-index: 1; }

/* ── TITRE ACCUEIL ── */
.title-block { line-height: 1; margin-bottom: 6px; }

.title-neon {
  display: block;
  font-size: 80px;
  font-weight: 900;
  letter-spacing: 18px;
  color: var(--cyan);
  text-shadow: 0 0 10px var(--cyan), 0 0 30px rgba(0,245,255,.6), 0 0 70px rgba(0,245,255,.25);
  animation: flicker 5s infinite;
}

.title-drift {
  display: block;
  font-size: 48px;
  font-weight: 700;
  letter-spacing: 26px;
  color: var(--magenta);
  text-shadow: 0 0 12px var(--magenta), 0 0 35px rgba(255,0,255,.5);
}

.subtitle {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 7px;
  color: rgba(255,255,255,.35);
  margin-bottom: 22px;
}

/* ── CONTRÔLES ── */
.controls-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  margin-bottom: 24px;
}

.ctrl-row {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  color: rgba(255,255,255,.50);
}

kbd {
  background: rgba(0,245,255,.08);
  border: 1px solid rgba(0,245,255,.35);
  border-bottom: 2px solid rgba(0,245,255,.35);
  border-radius: 5px;
  padding: 4px 10px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: var(--cyan);
  min-width: 80px;
  text-align: center;
}

/* ── SÉLECTION DIFFICULTÉ ── */
.diff-section { margin-bottom: 22px; }

.diff-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  letter-spacing: 5px;
  color: rgba(255,255,255,.3);
  margin-bottom: 12px;
}

.diff-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.diff-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.6);
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 12px 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 120px;
  transition: all .22s ease;
  position: relative;
  overflow: hidden;
}

.diff-btn .diff-sub {
  font-family: 'Share Tech Mono', monospace;
  font-size: 8px;
  letter-spacing: 1px;
  opacity: 0.6;
  font-weight: 400;
}

.diff-btn.easy   { border-color: rgba(57,255,20,.35);   color: var(--green); }
.diff-btn.normal { border-color: rgba(0,245,255,.35);   color: var(--cyan); }
.diff-btn.hard   { border-color: rgba(255,0,255,.35);   color: var(--magenta); }

.diff-btn.easy:hover   { background: rgba(57,255,20,.08);   box-shadow: 0 0 20px rgba(57,255,20,.25);  transform: translateY(-2px); }
.diff-btn.normal:hover { background: rgba(0,245,255,.08);   box-shadow: 0 0 20px rgba(0,245,255,.25); transform: translateY(-2px); }
.diff-btn.hard:hover   { background: rgba(255,0,255,.08);   box-shadow: 0 0 20px rgba(255,0,255,.25); transform: translateY(-2px); }

/* ── BOUTON BOUTIQUE (accueil) ── */
.shop-link {
  background: transparent;
  border: none;
  color: rgba(255,230,0,.6);
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 3px;
  cursor: pointer;
  margin-top: 6px;
  padding: 8px 20px;
  border-bottom: 1px solid rgba(255,230,0,.2);
  transition: all .2s;
}
.shop-link:hover { color: var(--yellow); border-color: rgba(255,230,0,.5); text-shadow: 0 0 10px var(--yellow); }

/* ── BOUTON NÉON ── */
.neon-btn {
  background: transparent;
  border: 2px solid var(--cyan);
  color: var(--cyan);
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 5px;
  padding: 13px 38px;
  cursor: pointer;
  text-shadow: 0 0 10px var(--cyan);
  box-shadow: 0 0 20px rgba(0,245,255,.25), inset 0 0 20px rgba(0,245,255,.04);
  transition: all .25s ease;
  position: relative;
  overflow: hidden;
}
.neon-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(0,245,255,.12) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .5s ease;
}
.neon-btn:hover { background: rgba(0,245,255,.08); box-shadow: 0 0 35px rgba(0,245,255,.45), inset 0 0 25px rgba(0,245,255,.08); transform: scale(1.04); }
.neon-btn:hover::after { transform: translateX(120%); }
.neon-btn:active { transform: scale(.97); }

.secondary-btn {
  border-color: rgba(0,245,255,.35);
  color: rgba(0,245,255,.55);
  text-shadow: none;
  box-shadow: none;
}
.secondary-btn:hover { border-color: var(--cyan); color: var(--cyan); }

/* ── GAME OVER ── */
.go-title {
  font-size: 64px;
  font-weight: 900;
  letter-spacing: 8px;
  color: var(--magenta);
  text-shadow: 0 0 18px var(--magenta), 0 0 55px rgba(255,0,255,.3);
  animation: pulse-magenta 1.6s ease-in-out infinite;
  margin-bottom: 22px;
}

.final-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  letter-spacing: 5px;
  color: rgba(255,255,255,.35);
  margin-bottom: 4px;
}

#final-score {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--cyan);
  text-shadow: 0 0 14px var(--cyan);
  margin-bottom: 12px;
}

#new-record-msg {
  color: var(--yellow);
  font-size: 13px;
  letter-spacing: 3px;
  margin-bottom: 10px;
  text-shadow: 0 0 10px var(--yellow);
  animation: blink-record 1.2s ease-in-out infinite;
}
#new-record-msg.hidden { display: none; }

.final-coins-row {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  color: var(--yellow);
  letter-spacing: 2px;
  margin-bottom: 22px;
  text-shadow: 0 0 8px var(--yellow);
}

.go-buttons { display: flex; gap: 12px; justify-content: center; }

/* ── PAUSE ── */
.pause-title {
  font-size: 56px;
  font-weight: 900;
  letter-spacing: 10px;
  color: #fff;
  text-shadow: 0 0 18px rgba(255,255,255,.6);
  margin-bottom: 28px;
}

/* ══ BOUTIQUE ══ */
.shop-content { width: 700px; }

.shop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(0,245,255,.15);
}

.shop-title {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 6px;
  color: var(--yellow);
  text-shadow: 0 0 14px var(--yellow);
}

.shop-wallet {
  font-family: 'Share Tech Mono', monospace;
  font-size: 14px;
  color: var(--yellow);
  text-shadow: 0 0 8px var(--yellow);
}

#skin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}

.skin-card {
  border: 1px solid rgba(255,255,255,.12);
  padding: 16px 12px 14px;
  text-align: center;
  transition: all .22s ease;
  position: relative;
  background: rgba(255,255,255,.02);
}
.skin-card:hover { border-color: rgba(0,245,255,.35); background: rgba(0,245,255,.04); transform: translateY(-2px); }
.skin-card.equipped { border-color: var(--cyan); box-shadow: 0 0 16px rgba(0,245,255,.2); background: rgba(0,245,255,.06); }
.skin-card.cant-afford { opacity: 0.45; }

.skin-preview {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  position: relative;
}

/* Icône vaisseau en CSS clip-path */
.ship-icon-css {
  width: 50px;
  height: 44px;
  clip-path: polygon(100% 50%, 0% 8%, 30% 50%, 0% 92%);
  transition: transform .2s;
}
.skin-card:hover .ship-icon-css { transform: scale(1.1); }

.rainbow-badge {
  position: absolute;
  top: 2px;
  right: 6px;
  font-size: 8px;
  letter-spacing: 2px;
  color: #fff;
  background: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f);
  padding: 2px 5px;
  font-family: 'Share Tech Mono', monospace;
}

.skin-name {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: rgba(255,255,255,.75);
  margin-bottom: 10px;
}

.skin-action button {
  font-family: 'Orbitron', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 7px 14px;
  cursor: pointer;
  transition: all .2s;
}

.btn-equip {
  background: transparent;
  border: 1px solid rgba(0,245,255,.5);
  color: var(--cyan);
}
.btn-equip:hover { background: rgba(0,245,255,.1); box-shadow: 0 0 12px rgba(0,245,255,.3); }

.btn-buy {
  background: transparent;
  border: 1px solid rgba(255,230,0,.5);
  color: var(--yellow);
}
.btn-buy:hover { background: rgba(255,230,0,.1); box-shadow: 0 0 12px rgba(255,230,0,.3); }
.btn-buy.locked { border-color: rgba(255,255,255,.15); color: rgba(255,255,255,.3); cursor: not-allowed; }

.badge-equipped {
  display: inline-block;
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--cyan);
  text-shadow: 0 0 8px var(--cyan);
}

/* ── NOTIFICATIONS ── */
#level-up-notif {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 8px;
  color: var(--green);
  text-shadow: 0 0 18px var(--green), 0 0 45px rgba(57,255,20,.45);
  pointer-events: none;
  z-index: 15;
}
#level-up-notif.hidden { display: none; }
#level-up-notif.anim { animation: lvlup 2.2s ease forwards; }

#powerup-notif {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 5px;
  pointer-events: none;
  z-index: 15;
  white-space: nowrap;
}
#powerup-notif.hidden { display: none; }
#powerup-notif.anim { animation: pwup 2.2s ease forwards; }

/* ── SCANLINES ── */
.scanlines-overlay {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0,0,0,.1) 3px, rgba(0,0,0,.1) 4px);
  pointer-events: none;
}

/* ══ ANIMATIONS ══ */
@keyframes flicker {
  0%, 92%, 100% { opacity: 1; }
  93%  { opacity: .8; }
  94%  { opacity: 1; }
  96%  { opacity: .5; }
  97%  { opacity: 1; }
}
@keyframes pulse-magenta {
  0%, 100% { text-shadow: 0 0 18px var(--magenta), 0 0 55px rgba(255,0,255,.3); }
  50%       { text-shadow: 0 0 28px var(--magenta), 0 0 80px rgba(255,0,255,.55), 0 0 120px rgba(255,0,255,.18); }
}
@keyframes blink-record {
  0%, 100% { opacity: 1; } 50% { opacity: .5; }
}
@keyframes lvlup {
  0%   { opacity: 0; transform: translate(-50%,-50%) scale(.5); }
  18%  { opacity: 1; transform: translate(-50%,-50%) scale(1.15); }
  35%  { opacity: 1; transform: translate(-50%,-50%) scale(1); }
  70%  { opacity: 1; transform: translate(-50%,-50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%,-60%) scale(1); }
}
@keyframes pwup {
  0%   { opacity: 0; transform: translateX(-50%) translateY(0); }
  18%  { opacity: 1; transform: translateX(-50%) translateY(-12px); }
  70%  { opacity: 1; transform: translateX(-50%) translateY(-12px); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-35px); }
}
@keyframes rainbow-cycle {
  0%   { background: hsl(0,100%,60%);   box-shadow: 0 0 12px hsl(0,100%,60%); }
  33%  { background: hsl(120,100%,60%); box-shadow: 0 0 12px hsl(120,100%,60%); }
  66%  { background: hsl(240,100%,60%); box-shadow: 0 0 12px hsl(240,100%,60%); }
  100% { background: hsl(360,100%,60%); box-shadow: 0 0 12px hsl(360,100%,60%); }
}
.rainbow-ship { animation: rainbow-cycle 2s linear infinite; }
