/* ══════════════════════════════════════════════
   DEEP FISH — Styles Aquatiques avec Parallaxe
══════════════════════════════════════════════ */

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

body {
  font-family: 'Arial', sans-serif;
  background: #0a1f2e;
  color: #fff;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
}

/* ─── SCREENS ─────────────────────────────────*/
.screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  z-index: 100;
}

.screen.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── ÉCRAN START ────────────────────────────*/
#screen-gameover,
#screen-start {
  /* background: linear-gradient(180deg, #051a2a 0%, #0a3a52 50%, #1a5a7a 100%); */
  background-image: url(assets/parallaxe-layer-3.png),url(assets/background-1.webp);
  background-size: cover;
  position: relative;
  overflow: hidden;

  .titleImg{
    max-width: 12rem;
    transform: rotate(12deg) translateX(40%);
    animation: wave-title 1.4s ease-in-out infinite;
  }
}

/* ─── ÉCRAN GAME OVER ──────────────────────*/
/* #screen-gameover {
  /* background: linear-gradient(180deg, #0a1f2e 0%, #0d3a52 50%, #1a5a7a 100%); 
  position: relative;
  overflow: hidden;
} */

/* Bulles de fond animées */
#screen-start::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(100, 200, 255, 0.1) 10px, transparent 10px),
    radial-gradient(circle at 60% 30%, rgba(100, 200, 255, 0.1) 20px, transparent 20px),
    radial-gradient(circle at 80% 70%, rgba(100, 200, 255, 0.1) 15px, transparent 15px);
  background-size: 200px 200px;
  background-position: 0 0, 50px 50px, 30px 70px;
  animation: drift-bg 20s linear infinite;
  pointer-events: none;
}

@keyframes drift-bg {
  0% { background-position: 0 0, 50px 50px, 30px 70px; }
  100% { background-position: 0 200px, 50px 250px, 30px 270px; }
}

.screen-content {
  text-align: center;
  animation: fadeInDown 0.8s ease-out;
  position: relative;
  z-index: 2;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.game-title {
  font-size: 5rem;
  font-weight: 900;
  letter-spacing: 3px;
  color: #1d82e0;
  text-shadow: 0 0 20px #6999e7, 0 0 40px rgba(105, 131, 173, 0.5);
  margin-bottom: 15px;
  animation: wave-title 2s ease-in-out infinite;
}

@keyframes wave-title {
  0%, 100% { transform: translateY(0); text-shadow: 0 0 20px  #4d9aff, 0 0 40px rgba(77, 184, 255, 0.5); }
  50% { transform: translateY(-5px); text-shadow: 0 0 30px  #4da9ff, 0 0 60px rgba(77, 184, 255, 0.8); }
}

.game-subtitle {
  font-size: 1.3rem;
  color: #438bdd;
  margin-bottom: 40px;
  font-style: italic;
  letter-spacing: 1px;
}

.hint-pills {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 30px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: rgba(77, 187, 255, 0.15);
  border: 1px solid rgba(0, 149, 255, 0.546);
  border-radius: 20px;
  color: #ffffff;
  font-size: 0.95rem;
}

.pill-icon {
  font-size: 1.2rem;
}

/* ─── BUTTONS ──────────────────────────────*/
.btn-main {
  margin-top: 40px;
  padding: 15px 50px;
  font-size: 1.1rem;
  font-weight: bold;
  background: linear-gradient(135deg, #4d6eff 0%, #3bd1ff 100%);
  color: rgb(255, 255, 255);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 2px;
  box-shadow: 0 4px 15px rgba(77, 202, 255, 0.4);
}

.btn-main:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(77, 181, 255, 0.6);
}

.btn-main:active {
  transform: scale(0.98);
}

.btn-large {
  padding: 18px 60px;
  font-size: 1.3rem;
}

/* ─── ÉCRAN GAME ──────────────────────────*/
#screen-game {
  background: #0a1f2e;
  position: relative;
}

#world {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: #0a1f2e;
  overflow: hidden;
}

/* ─── PARALLAX BACKGROUND LAYERS ───────────*/
.parallax-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

/* Fond static */
.parallax-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('assets/background-1.webp');
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  z-index: 1;
}

/* Couche parallaxe 1 (Plus rapide / arrière-plan) */
.parallax-layer-1 {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  
  height: 100%;
  background-image: url('assets/parallaxe-layer-4.png');
  background-size: 100vw auto;
  background-repeat: repeat-x;
  background-position: 0 0vw;
  z-index: 2;
  
  will-change: transform;

  &:after{
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    transform: translate(100%,0);
    background-image: url('assets/parallaxe-layer-4.png');
    background-size: 100vw auto;
    background-repeat: repeat-x;
    background-position: 0 0;
  }
}

/* Couche parallaxe 2 */
.parallax-layer-2 {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('assets/parallaxe-layer-3.png');
  background-size: 100vw auto;
  background-repeat: repeat-x;
  background-position: left bottom;
  z-index: 3;
  
  will-change: transform;

  &:after{
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    transform: translate(100%,0);
    background-image: url('assets/parallaxe-layer-3.png');
    background-size: 100vw auto;
    background-repeat: repeat-x;
    background-position: left bottom;
  }
}

/* Couche parallaxe 3 */
.parallax-layer-3 {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('assets/parallaxe-layer-2.png');
  background-size: 100vw auto;
  background-repeat: repeat-x;
  background-position: left bottom;
  z-index: 4;
  
  will-change: transform;

  &:after{
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    transform: translate(100%,0);
    background-image: url('assets/parallaxe-layer-2.png');
    background-size: 100vw auto;
    background-repeat: repeat-x;
    background-position: left bottom;
  }
}

/* Couche parallaxe 4 (Plus lent / avant-plan) */
.parallax-layer-4 {
  /* display: none; */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  
  background-image: url('assets/parallaxe-layer-1.png');
  background-size: 100vw auto;
  background-position: bottom left;

  background-repeat: repeat-x;
  
  z-index: 5;
  will-change: transform;
  &:after{
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    transform: translate(100%,0);
    background-image: url('assets/parallaxe-layer-1.png');
    background-size: 100vw auto;
    background-repeat: repeat-x;
    background-position: bottom left;
  }
}

/* Particules aquatiques (bulles) */
.parallax-bubbles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(100, 200, 255, 0.08) 1.5px, transparent 1.5px),
    radial-gradient(circle at 85% 40%, rgba(100, 200, 255, 0.06) 1px, transparent 1px),
    radial-gradient(circle at 30% 80%, rgba(100, 200, 255, 0.07) 2px, transparent 2px),
    radial-gradient(circle at 70% 60%, rgba(100, 200, 255, 0.05) 1.5px, transparent 1.5px);
  background-size: 300px 300px;
  animation: bubbles-float 15s linear infinite;
  pointer-events: none;
  z-index: 6;
}

@keyframes bubbles-float {
  0% { background-position: 0 0, 100px 50px, 50px 100px, 150px 30px; }
  100% { background-position: 0 -300px, 100px -250px, 50px -200px, 150px -270px; }
}

/* ─── GAME CONTENT CONTAINER ──────────────*/
.game-content {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 10;
}


 /* ─── HUD (Score, Size) ────────────────────*/
#hud {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  font-size: 1rem;
  font-weight: bold;
  z-index: 50;
  

}

.powerup{
  /* background-color: #ff0; */
  &::before{
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 160%;
    height: 160%;
    transform: translateX(-50%) translateY(-50%);
    /* background-color: #f00; */
    background-image: url(assets/points2.png);
    background-repeat: no-repeat;
    background-size: contain;

  }
}

#score-display {
  color: #0036cc;       /* ✅ bleu plus foncé */
  font-size: 1.6rem;
  animation: pulse-score 0.3s ease-out;
}

#best-display {
  color: #0036cc;          /* ✅ gris plus foncé */
  font-size: 1.3rem;
}

#size-display {
  color: #00ae00;        /* ✅ vert plus foncé */
  font-size: 1.3rem;
  transition: all 0.2s ease;
}



/* ─── ÉCRAN GAME OVER ──────────────────────*/
/* #screen-gameover {
  background: linear-gradient(180deg, #0a1f2e 0%, #0d3a52 50%, #1a5a7a 100%);
  position: relative;
  overflow: hidden;
} */

/* #screen-gameover::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(100, 200, 255, 0.1) 1px, transparent 1px),
    radial-gradient(circle at 60% 30%, rgba(100, 200, 255, 0.1) 2px, transparent 2px),
    radial-gradient(circle at 80% 70%, rgba(100, 200, 255, 0.1) 1.5px, transparent 1.5px);
  background-size: 200px 200px;
  background-position: 0 0, 50px 50px, 30px 70px;
  animation: drift-bg 20s linear infinite;
  pointer-events: none;
} */

.game-over-title {
  font-size: 3.5rem;
  color: #ff6060;
  margin-bottom: 30px;
  text-shadow: 0 0 20px #ff6b6b;
  letter-spacing: 2px;
  position: relative;
  z-index: 2;
}

.score-box {
  margin: 20px 0;
  padding: 20px;
  background: rgba(107, 141, 208, 0.254);
  border: 2px solid rgba(77, 154, 255, 0.469);
  border-radius: 10px;
  position: relative;
  z-index: 2;
  animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.score-label {
  font-size: 1rem;
  color: #6a7f9b;
  margin-bottom: 8px;
}

.score-value {
  font-size: 2.5rem;
  color: #006eff;
  font-weight: bold;
}

/* ─── POISSON (PLAYER) ─────────────────────*/
.player {
  position: absolute;
  width: 60px;
  height: 60px;
  left: 15%;
  transform-origin: center center;
  z-index: 20;
  background-image: url('assets/poisson.gif');
  background-repeat: no-repeat;
  background-size: contain;
  filter: drop-shadow(0 0 10px rgba(77, 184, 255, 0.6));
  will-change: top, transform;
  backface-visibility: hidden;
}

/* Animation de nage fluide */
@keyframes fish-swim {
  0%, 100% {
    transform: scaleX(1);
  }
  50% {
    transform: scaleX(1.05);
  }
}

.player {
  animation: fish-swim 0.8s ease-in-out infinite;
}

/* Animation de powerup collection */
@keyframes shell-collect {
  0% { 
    filter: brightness(1) drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
    transform: scale(1);
  }
  50% { 
    filter: brightness(1.8) drop-shadow(0 0 25px rgba(255, 215, 0, 1));
    transform: scale(1.15);
  }
  100% { 
    filter: brightness(1) drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
    transform: scale(1);
  }
}

.powerup-flash {
  animation: shell-collect 0.5s ease-out !important;
}

/* ─── OBSTACLES MARINS ─────────────────────*/
.obstacle {
  position: absolute;
  background-size: contain;
  background-position: center left;
  background-repeat: no-repeat;
}

.coral-wall {
  position: absolute;
  background: linear-gradient(90deg, #8b4513 0%, #a0522d 50%, #6b3410 100%);
  border-left: 3px solid #d2691e;
  border-right: 3px solid #d2691e;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
  will-change: left;
  backface-visibility: hidden;
}

.rock-obstacle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #555, #222);
  box-shadow: inset -3px -3px 8px rgba(0, 0, 0, 0.8), 0 0 15px rgba(70, 130, 180, 0.3);
  will-change: left;
  backface-visibility: hidden;
}

.seaweed {
  position: absolute;
  background: linear-gradient(90deg, #2d5a2d 0%, #1a3a1a 50%, #0d2d0d 100%);
  border-left: 2px dashed #4a7c4a;
  border-right: 2px dashed #4a7c4a;
  opacity: 0.8;
  will-change: left;
  backface-visibility: hidden;
}

/* ─── COQUILLAGES (POWERUPS) ───────────────*/
.shell-wrap {
  filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.8));
  z-index: 15;
  will-change: left;
  backface-visibility: hidden;
}

@keyframes float-shell {
  0%, 100% { 
    transform: translateY(0px) rotateZ(0deg);
  }
  50% { 
    transform: translateY(-15px) rotateZ(10deg);
  }
}

.shell-wrap {
  animation: float-shell 2.2s ease-in-out infinite !important;
}

/* ─── OBSTACLES ANIMÉS ─────────────────────*/
.shark-obstacle {
  position: absolute;
  will-change: left;
  backface-visibility: hidden;
}

.shark-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.seaweed-obstacle {
  position: absolute;
  will-change: left;
  backface-visibility: hidden;
}

.seaweed-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.coral-bottom-obstacle {
  position: absolute;
  will-change: left;
  backface-visibility: hidden;
}

.coral-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 -2px 6px rgba(0, 0, 0, 0.4));
}

/* ─── RESPONSIVE ────────────────────────────*/
@media (max-width: 1024px) {
  .game-title {
    font-size: 4rem;
  }

  .game-subtitle {
    font-size: 1.1rem;
  }

  #hud {
    font-size: 0.95rem;
  }

  #score-display {
    font-size: 1.2rem;
  }
}

@media (max-width: 768px) {
  .game-title {
    font-size: 3rem;
  }

  .game-subtitle {
    font-size: 1rem;
  }

  #hud {
    flex-direction: column;
    gap: 10px;
    font-size: 0.9rem;
  }

  .hint-pills {
    gap: 10px;
  }

  .pill {
    font-size: 0.85rem;
    padding: 10px 15px;
  }

  .btn-main {
    padding: 12px 40px;
    font-size: 1rem;
  }

  .btn-large {
    padding: 15px 50px;
    font-size: 1.2rem;
  }

  .game-over-title {
    font-size: 2.5rem;
  }

  .score-value {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .game-title {
    font-size: 2rem;
  }

  .game-subtitle {
    font-size: 0.9rem;
  }

  #hud {
    font-size: 0.8rem;
  }

  #score-display {
    font-size: 1rem;
  }

  .pill {
    font-size: 0.75rem;
    padding: 8px 12px;
  }

  .pill-icon {
    font-size: 1rem;
  }

  .hint-pills {
    gap: 8px;
  }

  .btn-main {
    padding: 10px 30px;
    font-size: 0.9rem;
    letter-spacing: 1px;
  }

  .btn-large {
    padding: 12px 40px;
    font-size: 1rem;
  }

  .game-over-title {
    font-size: 1.8rem;
  }

  .score-box {
    padding: 15px;
    margin: 15px 0;
  }

  .score-label {
    font-size: 0.9rem;
  }

  .score-value {
    font-size: 1.5rem;
  }

  .player {
    width: 45px;
    height: 45px;
  }
}

/* ─── OPTIMISATIONS PERFORMANCE ────────────*/
.player,
.obstacle,
.shell-wrap,
.shark-obstacle,
.seaweed-obstacle,
.coral-bottom-obstacle {
  transform: translate3d(0, 0, 0);
}

svg {
  shape-rendering: geometricPrecision;
}
