/*
--- 01 TYPOGRAPHY SYSTEM

- Font sizes (px)
10 / 12 / 14 / 16 / 18 / 20 / 24 / 30 / 36 / 44 / 52 / 62 / 74 / 86 / 98

- Font weights
Default: 400


- Line heights
Default: 1


--- 02 COLORS

- Primary:  #fcc419
- Tints: #ffd43b- 
- Shades:
 #654e0a, 
 #fab005

- Accents:
#087f5b

Tints:
#c3fae8
#e6fcf5


#22b8cf

Tints:
#99e9f2
#c5f6fa

#FA5252

- Greys: #555


--- 05 SHADOWS

0 3rem 5rem rgba(0, 0, 0, 0.3);


--- 06 BORDER-RADIUS
Small: 4px


--- 07 WHITESPACE

- Spacing system (px)
2 / 4 / 8 / 12 / 16 / 24 / 32 / 48 / 64 / 80 / 96 / 128
*/

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

html {
  /* font-size: 10px; */

  /* 10px / 16px = 0.625 = 62.5% */
  /* Percentage of user's browser font-size setting */
  font-size: 62.5%;
}

body {
  font-family: "Rubik", sans-serif;
  line-height: 1;
  font-weight: 400;
  color: #555;
  background-color: #fff9e8;
}

/**************************/
/* GRID AND CONTAINERS */
/**************************/

.container {
  max-width: 335rem;
  /* overflow: hidden; */
  /* min-width: 210rem; */
  /* padding: 2.4rem; */
  margin: 8rem auto;
}

.sea-container {
  position: relative;
}

.sea {
  border-radius: 4px;
  border-right: 7px solid #087f5b;
  border-bottom: 7px solid #087f5b;
  border-left: 3.6rem solid #087f5b;
}

.grid {
  display: grid;
  column-gap: 2rem;
  row-gap: 4.8rem;
  margin-bottom: 4.8rem;
}

.grid--2-cols {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr;

  align-self: center;
  justify-self: center;
  margin-top: 12.8rem;
}

.grid--3-cols {
  grid-template-columns: 49.9fr 0.2fr 49.9fr;
}

.grid-helper {
  background-color: #fcc419;
}

/**************************/
/* TABLE ELEMENTS */
/**************************/

table {
  margin: 0 auto;
  border-collapse: collapse;
  display: block;
  transition: all 0.3s ease-in;
  position: relative;
}

th,
thead tr {
  background-color: #087f5b;
  color: #fff;
  cursor: auto;
}

th {
  cursor: auto;
  user-select: none;
  overflow: hidden;
}

.row-number {
  position: absolute;
  left: -27;
  color: #fff;
  user-select: none;
  font-weight: 500;
}

.row-number-1 {
  left: -26;
  top: 50;
}
.row-number-2 {
  top: 90;
}
.row-number-3 {
  top: 133;
}
.row-number-4 {
  top: 173;
}
.row-number-5 {
  top: 213;
}
.row-number-6 {
  top: 253;
}
.row-number-7 {
  top: 294;
}
.row-number-8 {
  top: 334;
}
.row-number-9 {
  top: 374;
}
.row-number-10 {
  left: -33;
  top: 414;
}

td,
th {
  height: 3.6rem;
  width: 3.6rem;
  font-size: 1.6rem;
  text-align: center;
  user-select: none;
}

td {
  font-size: 2.4rem;
  background-color: #e6fcf5;
  overflow: hidden;
}

td:hover {
  background-color: #c5f6fa;
}

/* Class of td */
.dropzone {
  border: 1px solid #fff;
  /* border-color: rgba(255, 255, 255, 0.5); */
}

/**************************/
/* GENERAL */
/**************************/

h1 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
}

p {
  font-size: 1.8rem;
  margin-bottom: 1.6rem;
}

label {
  font-size: 1.6rem;
}

button,
input {
  padding: 0.6rem 1.2rem;
  border-radius: 4px;
  border: none;

  transition: all 0.3s;
}

ion-icon {
  width: 24px;
  height: 24px;
  color: #22b8cf;
}

button:disabled {
  opacity: 0.6;
}

/**************************/
/* REUSABLE PROPERTIES */
/**************************/
.ship,
.miss,
.cell-around {
  width: 100%;
  height: 100%;
}

.ship,
.cell-around,
.ship.injure {
  align-items: center;
  justify-content: center;
}

/**************************/
/* FLEET ENVIRONMENT */
/**************************/

.ship {
  user-select: none;
  color: #654e0a;
  display: flex;
  font-size: 2.4rem !important;
  overflow: hidden;
}

.ship-color {
  background-color: #fcc419;
  transition: all 0.3s;
}

.ship:hover {
  background-color: #fab005;
}

.hide {
  display: none;
}
.my-side--enemy-fleet,
.enemy-side--my-fleet {
  cursor: url(../icons/gun-target.png), auto;
}

.my-side--my-fleet .ship,
.enemy-side--enemy-fleet .ship {
  cursor: grab;
}

.my-side--enemy-fleet .ship,
.enemy-side--my-fleet .ship {
  background-color: #e6fcf5;
}

.my-side--enemy-fleet .ship.injure:hover,
.enemy-side--my-fleet .ship.injure:hover {
  background-color: #e6fcf5;
}

.my-side--enemy-fleet.binoculars .ship:hover,
.enemy-side--my-fleet.binoculars .ship:hover {
  background-color: #e6fcf5;
}

.my-side--enemy-fleet .ship:hover,
.enemy-side--my-fleet .ship:hover {
  background-color: #c5f6fa;
}

.binoculars-reward-label,
.timer-label {
  position: absolute;
  left: 8%;
  transform: translate(0, 180%);
  transition: all 0.5s;
  opacity: 0;
}

.timer-label {
  left: 14%;
  transform: translate(0, 40%);
}

.opponent-timer {
  left: 6%;
}

.injure {
  color: #fa5252;
  /* transform: scale(1.2); */
  /* transition: all 1s ease;  */

  &::after {
    content: url("../icons/icons8-close.svg");
    display: flex;
    height: 3.2rem;
    width: 3.2rem;
  }
}

.miss {
  color: #22b8cf;
  font-size: 2.4rem;
  background-color: #e6fcf5;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 1s ease-in;

  /* &::after {
    content: url("../icons/water-icon.svg");
    display: flex;
    height: 3.2rem;
    width: 3.2rem;
  } */
}

.cell-around {
  color: #99e9f2;
  background-color: #e6fcf5;
  display: flex;
  font-size: 2.4rem;
  justify-content: center;
  align-items: center;
}

.ship.injure {
  opacity: 100%;
  display: flex;

  /* box-shadow: inset 0 0 0 3px #22b8cf; */
}

.last-shot {
  background-color: #c5f6fa;
}

.dropzone .ship.injure {
  font-size: 3.2rem !important;
  background-color: #e6fcf5;
}

.dropzone .ship.injure.last-shot {
  background-color: #c5f6fa !important;
}

.dropzone .ship.injure .dragover {
  background-color: #c5f6fa;
}

/* .border-0.75px {
  border-color: rgba(255, 255, 255, 0.75);
} */

/**************************/
/* ANIMATED ATTACK */
/**************************/
/* Bomb projectile */
.bomb {
  position: absolute;
  width: 24px;
  height: 24px;
  background: radial-gradient(circle, #333 40%, #111 70% #000 100%);
  border-radius: 50%;
  border: 3px solid #666;
  pointer-events: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5),
    inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

/* Bomb fuse trail */
.bomb:before {
  content: "";
  position: absolute;
  top: -8px;
  left: 8px;
  width: 4px;
  height: 16px;
  background: #ff4400;
  border-radius: 2px;
  box-shadow: 0 0 4px #ff8800;
  animation: fuse-burn 0.3s infinite alternate;
}

@keyframes fuse-burn {
  0% {
    height: 16px;
    background: #ff8800;
  }
  100% {
    height: 20px;
    background: #ff4400;
    box-shadow: 0 0 8px #ff0000;
  }
}

/* Explosion */
.explosion {
  position: absolute;
  width: 140px;
  height: 140px;
  pointer-events: none;
  transform: translate(-50%, -50%);
  left: 0;
  top: 0;
}

.explosion::before,
.explosion::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  animation: blast 0.9s forwards;
}

.explosion::before {
  background: radial-gradient(
    circle at center,
    #ffffff 5%,
    #ffdd00 15%,
    #ff8800 35%,
    #ff4400 55%,
    transparent 70%
  );
  filter: blur(3px);
  animation-delay: 0s;
}

.explosion::after {
  background: radial-gradient(
    circle at center,
    #ffaa00 10% #ff6600 30%,
    transparent 60%
  );
  animation-delay: 0.12s;
  animation-duration: 1s;
}

@keyframes blast {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  40% {
    transform: scale(1.3);
    opacity: 0.95;
  }
  100% {
    transform: scale(2.8);
    opacity: 0;
  }
}

.explosion.smoke::before,
.explosion.smoke::after {
  animation: smoke-rise 1.4s forwards;
  background: radial-gradient(circle, #666 15%, #999 45%, transparent 80%);
}

@keyframes smoke-rise {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  100% {
    transform: scale(3.5) translateY(-50px);
    opacity: 0;
  }
}

/* Water splash */

.plunge {
  position: absolute;
  pointer-events: none;
  z-index: 100;
}

/* Vertical water jet */
.jet {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28px;
  height: 0;
  background: linear-gradient(to top, #ffffff, #80deea 40%, #26c6da);
  border-radius: 14px;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 30px rgba(68, 170, 255, 0.9);
  animation: jet-burst 1.2s ease-out forwards;
}

@keyframes jet-burst {
  0% {
    height: 0;
  }

  45% {
    height: 220px;
    transform: translate(-50%, -100%);
  }

  100% {
    height: 160px;
    transform: translate(-50%, -80%);
    opacity: 0;
  }
}

/* White foam crown at the base */

.crown {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 80px;
  height: 40px;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(230, 252, 245, 0.9) 45%,
    rgba(179, 229, 252, 0.4) 70%,
    transparent 90%
  );
  border-radius: 50%;
  transform: translate(-50%, -50%);
  filter: blur(3px);
  animation: crown-expand 1.1s ease-out forwards;
}

@keyframes crown-expand {
  0% {
    transform: translate(-50%, -50%), scale(0);
    opacity: 0.9;
  }
  60% {
    transform: translate(-50%, -50%), scale(1.4);
    opacity: 0.8;
  }
  100% {
    transform: translate(-50%, -50%), scale(2);
    opacity: 0;
  }
}

/* Chunky falling water chunks */
.chunk {
  position: absolute;
  background: #80deea;
  border-radius: 40%;
  box-shadow: 0 0 15px #26c6da;
  animation: chunk-fall 1.4s ease-in forwards;
}

@keyframes chunk-fall {
  0% {
    transform: translateY(-80%), scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(100%), scale(0.4);
    opacity: 0;
  }
}

/* Deep shockwave rings */
.shockwave {
  position: absolute;
  border: 6px solid rgba(38, 198, 218, 0.55);
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  animation: shock 1.6s ease-out forwards;
}

@keyframes shock {
  0% {
    width: 0;
    height: 0;
    opacity: 0.8;
  }

  100% {
    width: 300px;
    height: 300px;
    opacity: 0;
  }
}

/* ONLY ONE ELEMENT — the vertical splash column */
.vsplash {
  position: absolute;
  width: 20px;
  height: 0; /* starts at 0 height */
  left: 50%;
  top: 50%;
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0.95),
    #80deea 50%,
    #26c6da
  );
  border-radius: 10px;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 20px rgba(38, 198, 218, 0.7);
  pointer-events: none;
  animation: verticalSplash 1s ease-out forwards;
}

@keyframes verticalSplash {
  0% {
    height: 0;
  }
  40% {
    height: 180px;
    transform: translate(-50%, -100%);
  }
  100% {
    height: 120px;
    transform: translate(-50%, -80%);
    opacity: 0;
  }
}

/* Water splash from lottie */
.lottie-water-splash {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 1000;
  width: 100px;
  height: 100px;
}

.water-splash-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/**************************/
/* NOTIFICATION WINDOW */
/**************************/

.notification-window {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-50%, 50%);
  width: 150%;
  height: 50%;
  background-color: #fff;
  padding: 6rem;
  border-radius: 5px;
  box-shadow: 0 3rem 5rem rgba(0, 0, 0, 0.3);
  z-index: 10;
}

.show-notification-window {
  font-size: 2rem;
  font-weight: 600;
  padding: 1.75rem 3.5rem;
  margin: 5rem 2rem;
  border: none;
  background-color: #fff;
  color: #444;
  border-radius: 10rem;
  cursor: pointer;
}

.close-notification-window,
.close-notification-window-2 {
  position: absolute;
  top: 1.2rem;
  right: 2rem;
  font-size: 5rem;
  color: #333;
  cursor: pointer;
  border: none;
  background: none;
}

.hidden {
  display: none;
}

/**************************/
/* INPUT DATA, BUTTONS, LABELS */
/**************************/

.player-username-1,
.player-username-2,
.submit-username--fleet-1,
.submit-username--fleet-2 {
  display: flex;
  align-items: center;
  justify-content: center;
}

.username-1,
.player-1--pronoun,
.username-2,
.player-2--pronoun {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -150%);
}

.menu-btns--container-1 {
  grid-column: 1/-1;
}

.data .change-username-btn-1,
.data .change-username-btn-2 {
  grid-column: 2;
}

.data.player-username-1,
.data.player-username-2 {
  grid-template-columns: 45fr 50fr;
}

.start-game.fleet-1,
.start-game.fleet-2,
.submit-username--fleet-2,
.submit-username--fleet-1,
.new-game-btn.player-2,
.new-game-btn.player-1,
.change-username-btn-1,
.change-username-btn-2 {
  font-size: 1.8rem;
  background-color: #fcc419;
  color: #654e0a;
  border: none;
  border-radius: 4px;
  z-index: 1000;
  transition: all 0.3s;
}

.new-game-btn.player-1 {
  display: flex;
}

.player-username-1 input,
.player-username-2 input {
  height: 100%;
  display: none;
}

.change-username-btn-1,
.change-username-btn-2 {
  grid-column: 3/-1;
  justify-self: start;
}

.start-game.fleet-1,
.start-game.fleet-2 {
  font-size: 1.8rem;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-42%, -55%);
  padding: 1.2rem 2.4rem;
}

.your-name-1,
.your-name-2 {
  justify-self: end;
  display: none;
}

.start-game.fleet-1:hover,
.start-game.fleet-2:hover,
.submit-username--fleet-2:hover,
.submit-username--fleet-1:hover,
.change-username-btn-1:hover:enabled,
.change-username-btn-2:hover:enabled,
.new-game-btn.player-2:hover:enabled,
.new-game-btn.player-1:hover:enabled {
  background-color: #fab005;
}

.waiting-opponent-1,
.waiting-opponent-2,
.error-message-1,
.error-message-2 {
  transform: translate(24%, 50%);
  opacity: 0;
}

.error-message-1,
.error-message-2 {
  position: absolute;
}

/**************************/
/* GAME DESCRIPTION */
/**************************/

.game-description-container {
  grid-column: 1/2;
  display: grid;
  width: 80%;
  justify-self: center;
}

.game-description-container-2 {
  grid-column: 3/-1;
  display: none;
  width: 80%;
  justify-self: center;
}

.ship-description {
  display: flex;
  align-items: center;
}

.ship-description-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 45rem;
}

.ship-name {
  color: inherit;
}

.rules-caption {
  text-align: center;
  margin-bottom: 2.4rem;
  font-size: 2.4rem;
}

.ship-types {
  font-size: 1.6rem;
  margin-bottom: 1.6rem;
  display: grid;
  list-style: none;
  gap: 0.8rem;
}

.show-ship {
  height: 4rem;
}
