/* =========================
   RESET
========================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* =========================
   PAGE / BEACH BACKGROUND
========================= */

body {
  min-height: 100vh;

  background:
    linear-gradient(rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.18)),
    url("images/beach-background.png");

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;

  color: #1f2733;

  font-family: Arial, Helvetica, sans-serif;
}

/* =========================
   MAIN CONTAINER
========================= */

.container {
  width: 90%;
  max-width: 1150px;

  margin: auto;

  padding: 60px 0 80px;
}

/* =========================
   TITLE
========================= */

h1 {
  text-align: center;

  font-size: 48px;
  font-weight: 900;

  letter-spacing: 0.5px;

  color: #ffffff;

  margin-bottom: 10px;

  text-shadow:
    0 3px 0 #146eb4,
    0 5px 15px rgba(0, 0, 0, 0.25);
}

.subtitle {
  width: fit-content;

  margin: 0 auto 45px;

  padding: 8px 16px;

  text-align: center;

  color: #31536b;

  font-size: 17px;
  font-weight: 600;

  background: rgba(255, 255, 255, 0.82);

  border-radius: 20px;

  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* =========================
   GENERATOR PANEL
========================= */

.generator-box {
  background: rgba(255, 255, 255, 0.9);

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  border: 2px solid rgba(255, 255, 255, 0.85);

  border-radius: 24px;

  padding: 34px;

  box-shadow: 0 15px 45px rgba(20, 74, 110, 0.2);
}

.generator-box h2 {
  margin: 24px 0 16px;

  font-size: 20px;
  font-weight: 800;

  color: #1d2a38;
}

/* =========================
   RARITY FILTERS
========================= */

.rarity-filters {
  display: flex;

  flex-wrap: wrap;

  gap: 12px;
}

.rarity-btn {
  background: #edf7fd;

  color: #25648f;

  border: 2px solid #c9e3f2;

  border-radius: 12px;

  padding: 11px 19px;

  font-size: 14px;
  font-weight: 700;

  cursor: pointer;

  transition:
    transform 0.18s,
    box-shadow 0.18s,
    background 0.18s,
    color 0.18s,
    border-color 0.18s;
}

/* Hover */

.rarity-btn:hover {
  transform: translateY(-2px);

  background: #dff3ff;

  border-color: #5bb6e8;

  box-shadow: 0 6px 16px rgba(74, 163, 217, 0.2);
}

/* Selected rarity */

.rarity-btn.active {
  background: linear-gradient(180deg, #55c3f3, #1679bc);

  color: #ffffff;

  border-color: #0f6cae;

  box-shadow: 0 6px 15px rgba(20, 110, 180, 0.28);
}

/* =========================
   BUILD GRID
========================= */

.build-grid {
  display: grid;

  grid-template-columns: repeat(5, 1fr);

  gap: 16px;
}

/* =========================
   BUILD CARDS
========================= */

.build-card {
  min-height: 160px;

  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98),
    rgba(235, 247, 253, 0.98)
  );

  border: 2px solid #d2e8f4;

  border-radius: 18px;

  display: flex;

  flex-direction: column;

  justify-content: center;
  align-items: center;

  padding: 18px;

  position: relative;

  overflow: hidden;

  box-shadow: 0 5px 15px rgba(42, 112, 155, 0.06);

  transition:
    transform 0.2s,
    border-color 0.2s,
    box-shadow 0.2s;
}

/* Blue strip */

.build-card::before {
  content: "";

  position: absolute;

  top: 0;
  left: 0;

  width: 100%;
  height: 6px;

  background: linear-gradient(90deg, #1679bc, #55c3f3, #9de4ff);
}

/* Card hover */

.build-card:hover {
  transform: translateY(-5px);

  border-color: #80c9ef;

  box-shadow: 0 12px 25px rgba(41, 122, 175, 0.15);
}

/* Category */

.build-card span {
  color: #66869c;

  font-size: 12px;

  text-transform: uppercase;

  letter-spacing: 1.4px;

  margin-bottom: 12px;
}

/* Generated item */

.build-card h3 {
  color: #1e2b38;

  font-size: 22px;
  font-weight: 800;

  text-align: center;
}

/* =========================
   GENERATE BUTTON
========================= */

#generateBtn {
  display: block;

  margin: 36px auto 0;

  padding: 15px 44px;

  background: linear-gradient(180deg, #55c3f3, #1679bc);

  color: #ffffff;

  border: 2px solid #0f6cae;

  border-radius: 14px;

  font-size: 16px;
  font-weight: 800;

  cursor: pointer;

  box-shadow:
    0 7px 0 #0f5f99,
    0 12px 20px rgba(21, 108, 169, 0.2);

  transition:
    transform 0.15s,
    box-shadow 0.15s,
    filter 0.15s;
}

/* Hover */

#generateBtn:hover {
  transform: translateY(-2px);

  filter: brightness(1.05);

  box-shadow:
    0 9px 0 #0f5f99,
    0 16px 26px rgba(21, 108, 169, 0.25);
}

/* Click */

#generateBtn:active {
  transform: translateY(4px);

  box-shadow:
    0 3px 0 #0f5f99,
    0 7px 12px rgba(21, 108, 169, 0.18);
}

/* =========================
   ERROR MESSAGE
========================= */

#errorMessage {
  text-align: center;

  margin-top: 16px;

  color: #e15656;

  font-size: 14px;
  font-weight: 700;

  min-height: 18px;
}

/* =========================
   TABLET
========================= */

@media (max-width: 800px) {
  .container {
    width: 92%;

    padding: 38px 0 55px;
  }

  h1 {
    font-size: 34px;
  }

  .generator-box {
    padding: 22px;
  }

  .build-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =========================
   PHONE
========================= */

@media (max-width: 480px) {
  body {
    background-attachment: scroll;
  }

  h1 {
    font-size: 29px;
  }

  .subtitle {
    font-size: 14px;
  }

  .build-grid {
    grid-template-columns: 1fr;
  }

  .rarity-btn {
    flex: 1;

    min-width: 120px;
  }

  #generateBtn {
    width: 100%;
  }
}
