/* ========================= */
/* RESET */
/* ========================= */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

::selection {
  background: rgba(56, 189, 248, 0.35);
  color: white;
}

/* ========================= */
/* ANIMATIONS */
/* ========================= */

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dropIn {
  from {
    opacity: 0;
    transform: scale(0.3);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes barGrow {
  from {
    width: 0;
  }
  to {
    width: var(--bw, 0%);
  }
}

@keyframes numPop {
  0% {
    transform: scale(1.15);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes glowPulse {
  0% {
    box-shadow: 0 0 0 rgba(56, 189, 248, 0);
  }
  50% {
    box-shadow: 0 0 35px rgba(56, 189, 248, 0.18);
  }
  100% {
    box-shadow: 0 0 0 rgba(56, 189, 248, 0);
  }
}

@keyframes bgMove {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 120px 120px;
  }
}

@keyframes floatGlow {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0px);
  }
}

@keyframes shine {
  from {
    transform: translateX(-120%);
  }
  to {
    transform: translateX(120%);
  }
}

/* ========================= */
/* ROOT */
/* ========================= */

:root {
  --bg: #020617;

  --glass: rgba(15, 23, 42, 0.45);
  --glass2: rgba(30, 41, 59, 0.5);

  --border: rgba(255, 255, 255, 0.06);
  --border2: rgba(56, 189, 248, 0.25);

  --blue: #38bdf8;
  --blue2: #2563eb;
  --blue3: #7dd3fc;

  --amber: #f0b030;

  --text: #f8fafc;
  --text2: #94a3b8;
  --text3: #64748b;
}

/* ========================= */
/* BODY */
/* ========================= */

body {
  background:
    radial-gradient(
      circle at top left,
      rgba(56, 189, 248, 0.15),
      transparent 25%
    ),

    radial-gradient(
      circle at bottom right,
      rgba(37, 99, 235, 0.12),
      transparent 30%
    ),

    linear-gradient(
      135deg,
      #020617,
      #050816 45%,
      #0b1220
    );

  color: var(--text);

  font-family: var(--font-sans, system-ui, sans-serif);

  line-height: 1.5;

  min-height: 100vh;

  overflow-x: hidden;

  position: relative;
}

/* animated grid */

body::before {
  content: "";

  position: fixed;

  inset: 0;

  background-image:
    linear-gradient(
      rgba(255,255,255,0.025) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(255,255,255,0.025) 1px,
      transparent 1px
    );

  background-size: 60px 60px;

  mask-image:
    radial-gradient(circle at center, black 20%, transparent 90%);

  animation: bgMove 14s linear infinite;

  pointer-events: none;
}

/* ========================= */
/* WRAP */
/* ========================= */

.wrap {
  min-height: 100vh;
  padding: 1.75rem 1.25rem 3rem;
  max-width: 650px;
  margin: 0 auto;
  width: 100%;
}

/* ========================= */
/* HEADER */
/* ========================= */

.header {
  display: flex;
  align-items: center;
  gap: 14px;

  margin-bottom: 2rem;

  animation: slideUp 0.45s ease both;
}

.logo {
  width: 48px;
  height: 48px;

  border-radius: 14px;

  background: var(--glass);

  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);

  border:
    1px solid
    rgba(255,255,255,0.08);

  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;

  animation:
    glowPulse 5s infinite,
    floatGlow 4s ease-in-out infinite;

  box-shadow:
    0 8px 25px rgba(0,0,0,0.35),
    inset 0 0 18px rgba(255,255,255,0.03);
}

.title-text {
  font-size: 21px;
  font-weight: 700;
  color: var(--text);

  letter-spacing: -0.3px;
}

.sub-text {
  font-size: 11px;

  color: var(--text3);

  letter-spacing: 0.12em;

  text-transform: uppercase;

  margin-top: 2px;
}

/* ========================= */
/* TABS */
/* ========================= */

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;

  gap: 4px;

  background: var(--glass);

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  border:
    1px solid
    rgba(255,255,255,0.06);

  border-radius: 16px;

  padding: 5px;

  margin-bottom: 1rem;

  box-shadow:
    0 8px 24px rgba(0,0,0,0.25);
}

.tab {
  padding: 10px;

  text-align: center;

  font-size: 13px;
  font-weight: 600;

  color: var(--text3);

  border-radius: 12px;

  cursor: pointer;

  transition:
    all 0.22s ease;

  border:
    1px solid transparent;

  position: relative;

  overflow: hidden;
}

.tab::before {
  content: "";

  position: absolute;

  inset: 0;

  background:
    linear-gradient(
      135deg,
      rgba(56,189,248,0.12),
      transparent 50%
    );

  opacity: 0;

  transition: 0.22s;
}

.tab:hover::before {
  opacity: 1;
}

.tab:hover {
  color: var(--blue3);

  transform: translateY(-1px);
}

.tab.active {
  background:
    rgba(56,189,248,0.08);

  border-color:
    rgba(56,189,248,0.22);

  color: var(--blue);

  box-shadow:
    0 0 25px rgba(56,189,248,0.12);
}

/* ========================= */
/* LABELS */
/* ========================= */

.sec-label,
.card-label,
.slabel {
  font-size: 10px;

  letter-spacing: 0.12em;

  text-transform: uppercase;

  color: var(--text3);
}

/* ========================= */
/* GLASS CARD */
/* ========================= */

.card,
.bomb-picker,
.stat {

  background:
    rgba(15, 23, 42, 0.45);

  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);

  border:
    1px solid
    rgba(255,255,255,0.06);

  border-radius: 18px;

  box-shadow:
    0 10px 35px rgba(0,0,0,0.25),
    inset 0 0 20px rgba(255,255,255,0.02);

  position: relative;

  overflow: hidden;
}

/* shine effect */

.card::before,
.bomb-picker::before,
.stat::before {

  content: "";

  position: absolute;

  inset: 0;

  background:
    linear-gradient(
      120deg,
      transparent 20%,
      rgba(255,255,255,0.05) 50%,
      transparent 80%
    );

  transform: translateX(-120%);
}

.card:hover::before,
.bomb-picker:hover::before,
.stat:hover::before {

  animation: shine 1.2s ease;
}

.card {
  padding: 13px 17px;
  margin-bottom: 9px;

  transition:
    transform 0.22s,
    border-color 0.22s,
    background 0.22s,
    box-shadow 0.22s;
}

.card:hover {
  transform:
    translateY(-4px)
    scale(1.01);

  border-color:
    rgba(56,189,248,0.28);

  box-shadow:
    0 18px 35px rgba(0,0,0,0.35),
    0 0 30px rgba(56,189,248,0.12);
}

.card:focus-within {
  border-color:
    rgba(56,189,248,0.35);

  box-shadow:
    0 0 0 4px rgba(56,189,248,0.08);
}

/* ========================= */
/* GRID */
/* ========================= */

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

/* ========================= */
/* INPUTS */
/* ========================= */

select,
input[type="number"],
input[type="text"] {

  font-size: 17px;
  font-weight: 500;

  border: none;

  background: transparent;

  color: var(--text);

  outline: none;

  width: 100%;

  font-family: inherit;
}

select option {
  background: #111827;
  color: white;
}

/* ========================= */
/* BOMB PICKER */
/* ========================= */

.bomb-picker {
  margin-bottom: 9px;
}

.bp-search {
  display: flex;
  align-items: center;
  gap: 8px;

  padding: 12px 15px;

  border-bottom:
    1px solid
    rgba(255,255,255,0.05);
}

.bp-search input::placeholder {
  color: var(--text3);
}

.bp-search svg {
  opacity: 0.45;
}

.bp-list {
  max-height: 220px;
  overflow-y: auto;

  scrollbar-width: thin;
}

.bp-list::-webkit-scrollbar {
  width: 4px;
}

.bp-list::-webkit-scrollbar-thumb {
  background:
    rgba(56,189,248,0.25);

  border-radius: 999px;
}

.bp-item {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 11px 15px;

  cursor: pointer;

  transition:
    all 0.18s ease;

  border-bottom:
    1px solid
    rgba(255,255,255,0.04);
}

.bp-item:last-child {
  border-bottom: none;
}

.bp-item:hover {
  background:
    rgba(56,189,248,0.06);

  transform:
    translateX(4px);
}

.bp-name {
  font-size: 14px;
  font-weight: 600;
}

.bp-meta {
  display: flex;
  gap: 8px;
  align-items: center;
}

.bp-tag {
  font-size: 10px;

  padding: 3px 8px;

  border-radius: 999px;

  letter-spacing: 0.05em;
}

.bp-tag.nation {
  background:
    rgba(255,255,255,0.03);

  border:
    1px solid
    rgba(255,255,255,0.05);

  color: var(--text3);
}

.bp-tag.dmg {
  background:
    rgba(56,189,248,0.08);

  border:
    1px solid
    rgba(56,189,248,0.2);

  color: var(--blue3);
}

/* ========================= */
/* SELECTED BOMBS */
/* ========================= */

.selected-bombs-list {
  margin-bottom: 12px;
}

.sb-item {
  background:
    rgba(56,189,248,0.06);

  border:
    1px solid
    rgba(56,189,248,0.18);

  border-radius: 16px;

  padding: 10px 15px;

  margin-bottom: 7px;

  display: flex;
  align-items: center;
  gap: 12px;

  animation: slideUp 0.3s ease both;

  border-left:
    4px solid
    var(--bomb-color, var(--blue));

  backdrop-filter: blur(20px);

  transition:
    transform 0.18s,
    box-shadow 0.18s;
}

.sb-item:hover {
  transform: translateY(-2px);

  box-shadow:
    0 0 25px rgba(56,189,248,0.08);
}

.sb-info {
  flex: 1;
}

.sb-name {
  font-size: 14px;
  font-weight: 600;
}

.sb-detail {
  font-size: 10px;
  color: var(--text3);
}

.sb-bpb {
  font-size: 11px;
  color: var(--amber);
  font-weight: 600;
}

.sb-count-input,
.sb-dmg-input {
  width: 68px;

  background:
    rgba(255,255,255,0.03);

  border:
    1px solid
    rgba(56,189,248,0.12);

  border-radius: 10px;

  color: var(--text);

  font-size: 13px;

  padding: 5px 6px;

  text-align: center;
}

.sb-dmg-input {
  width: 82px;
  color: var(--blue);
  font-weight: bold;
}

.sb-remove {
  font-size: 16px;

  color: var(--text3);

  cursor: pointer;

  transition:
    color 0.15s,
    transform 0.15s;
}

.sb-remove:hover {
  color: var(--amber);

  transform: scale(1.15);
}

/* ========================= */
/* STATS */
/* ========================= */

.stat {
  padding: 14px 15px;

  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.stat:hover {
  transform:
    translateY(-2px);

  box-shadow:
    0 0 30px rgba(56,189,248,0.1);
}

.sval {
  font-size: 22px;
  font-weight: 700;

  animation:
    numPop 0.3s ease both;
}

.stat.green {
  background:
    rgba(56,189,248,0.07);

  border-color:
    rgba(56,189,248,0.22);
}

.stat.green .slabel {
  color: var(--blue3);
}

.stat.green .sval {
  color: var(--blue);
}

.stat.amber {
  background:
    rgba(240,176,48,0.06);

  border-color:
    rgba(240,176,48,0.18);
}

.stat.amber .sval {
  color: var(--amber);
}

/* ========================= */
/* BOMB VISUALS */
/* ========================= */

.bomb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;

  align-items: center;

  margin-bottom: 0.9rem;

  min-height: 24px;
}

.bomb {
  width: 20px;
  height: 20px;

  border-radius: 50%;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 9px;
  font-weight: bold;

  color: #000;

  animation:
    dropIn 0.35s ease both;

  position: relative;
}

.bomb.hit {
  box-shadow:
    0 0 12px rgba(56,189,248,0.65);
}

.bomb.miss {
  opacity: 0.6;

  border:
    1px solid
    rgba(255,255,255,0.15);
}

.bsep {
  width: 2px;
  height: 22px;

  background: var(--blue);

  margin: 0 2px;
}

/* ========================= */
/* BARS */
/* ========================= */

.bar-bg {
  height: 5px;

  border-radius: 999px;

  background:
    rgba(255,255,255,0.05);

  margin-top: 5px;

  overflow: hidden;
}

.bar-fill {
  height: 100%;

  border-radius: 999px;

  background:
    linear-gradient(
      90deg,
      #38bdf8,
      #2563eb
    );

  animation:
    barGrow 0.6s ease both;

  box-shadow:
    0 0 12px rgba(56,189,248,0.35);
}

.bar-top {
  display: flex;
  justify-content: space-between;

  font-size: 10px;

  color: var(--text3);

  letter-spacing: 0.06em;
}

/* ========================= */
/* HELPERS */
/* ========================= */

.divider {
  height: 1px;

  background:
    rgba(255,255,255,0.05);

  margin: 13px 0;
}

.hidden {
  display: none;
}

.results-anim {
  animation:
    slideUp 0.4s ease both;
}

.a0 {
  animation:
    slideUp 0.4s 0.05s ease both;
}

.a1 {
  animation:
    slideUp 0.4s 0.1s ease both;
}

.a2 {
  animation:
    slideUp 0.4s 0.15s ease both;
}

/* ========================= */
/* MOBILE */
/* ========================= */

@media (max-width: 480px) {

  .wrap {
    padding: 1rem 0.75rem 2rem;
  }

  .grid2 {
    grid-template-columns: 1fr;
  }

  .sval {
    font-size: 18px;
  }

  .title-text {
    font-size: 18px;
  }
}