:root {
  --bg: #0d1117;
  --bg-2: #161b22;
  --bg-3: #1c2330;
  --line: #2a3240;
  --text: #e6edf3;
  --muted: #9aa7b6;
  --accent: #58a6ff;
  --gold: #f5c451;
  --green: #3fb950;
  --red: #f85149;
  --purple: #bc8cff;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 50% -200px, #1b2740, var(--bg)) no-repeat, var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.wrap { width: min(1180px, 92vw); margin: 0 auto; }

.site-header {
  padding: 48px 0 28px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(88,166,255,.08), transparent);
}
.site-header h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: .5px; }
.subtitle { margin: 10px auto 0; color: var(--muted); max-width: 620px; }

.book-btn {
  display: inline-block;
  margin-top: 18px;
  padding: 11px 22px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  color: #2a1a08;
  background: linear-gradient(135deg, #f5c451, #e0972f);
  border: 1px solid #f5d98a;
  box-shadow: 0 6px 18px rgba(245, 196, 81, .25);
  transition: transform .12s ease, box-shadow .12s ease;
}
.book-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(245, 196, 81, .4); }

.notice {
  margin: 22px auto;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: .9rem;
  color: var(--muted);
}
.notice strong { color: var(--gold); }
.notice code { background: var(--bg-3); padding: 1px 6px; border-radius: 5px; color: var(--accent); }

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 18px auto 4px;
}
#search {
  flex: 1 1 280px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 1rem;
  outline: none;
}
#search:focus { border-color: var(--accent); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: .85rem;
  transition: all .15s ease;
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #06122a; font-weight: 600; }

.toggle { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .9rem; cursor: pointer; user-select: none; }
.toggle input { width: 16px; height: 16px; accent-color: var(--accent); }

.stats { margin: 14px auto 6px; color: var(--muted); font-size: .85rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
  margin: 18px auto 40px;
}

.card {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform .12s ease, border-color .12s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); }

.kit-img {
  position: relative;
  width: 100%;
  height: 150px;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--bg-3), var(--bg));
}
/* Themed gradient per source for the fallback avatar */
.kit-img.src-Shop        { background: linear-gradient(135deg, #1d3a66, #0d1117); }
.kit-img.src-BattlePass  { background: linear-gradient(135deg, #3a2a5e, #0d1117); }
.kit-img.src-Level       { background: linear-gradient(135deg, #1e4a2c, #0d1117); }
.kit-img.src-Bundle      { background: linear-gradient(135deg, #5e4a1d, #0d1117); }
.kit-img.src-Default     { background: linear-gradient(135deg, #2a3240, #0d1117); }

.kit-initials {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, .82);
  text-shadow: 0 2px 8px rgba(0, 0, 0, .45);
  user-select: none;
}
.kit-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card-name { margin: 0; font-size: 1.25rem; }
.source-tag {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 4px 9px;
  border-radius: 6px;
  white-space: nowrap;
  font-weight: 600;
}
.src-Shop { background: rgba(88,166,255,.15); color: var(--accent); }
.src-BattlePass { background: rgba(188,140,255,.15); color: var(--purple); }
.src-Level { background: rgba(63,185,80,.15); color: var(--green); }
.src-Bundle { background: rgba(245,196,81,.15); color: var(--gold); }
.src-Default { background: rgba(154,167,182,.15); color: var(--muted); }

.card-desc { margin: 0; color: var(--text); font-size: .92rem; flex: 1; }

.card-foot { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .85rem; }
.row .label { color: var(--muted); }
.row .value { text-align: right; font-weight: 600; }

.cost { color: var(--gold); }
.badge {
  font-size: .72rem;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.badge.obtainable { background: rgba(63,185,80,.15); color: var(--green); }
.badge.unobtainable { background: rgba(248,81,73,.15); color: var(--red); }
.rent-yes { color: var(--green); }
.rent-no { color: var(--muted); }

/* ---- Cold-themed kits: soft breezes drifting in from the edges ---- */
.card.frost {
  overflow: hidden;
  border-color: rgba(150, 215, 255, .65);
}
.card.frost::after {
  /* icy glow hugging the card edges */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  box-shadow: inset 0 0 40px rgba(150, 215, 255, .5);
  pointer-events: none;
  z-index: 4;
}
.frost-fx {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  overflow: hidden;
  pointer-events: none;
  z-index: 3;
}
.frost-fx span {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(16px);
  opacity: 0;
  background: radial-gradient(circle, rgba(214, 242, 255, .95), rgba(190, 230, 255, 0) 70%);
  will-change: transform, opacity;
}
/* each wisp enters from a different edge */
.frost-fx span:nth-child(1) { width: 190px; height: 120px; top: -40px;   left: -60px;  animation: breezeTL 6.5s ease-in-out infinite; }
.frost-fx span:nth-child(2) { width: 170px; height: 110px; top: 32%;    right: -70px; animation: breezeR  8s   ease-in-out infinite 1s; }
.frost-fx span:nth-child(3) { width: 210px; height: 110px; bottom: -50px; left: 22%;  animation: breezeB  7.5s ease-in-out infinite .5s; }
.frost-fx span:nth-child(4) { width: 150px; height: 100px; top: -35px;   right: 12%;  animation: breezeTR 9s   ease-in-out infinite 1.8s; }

@keyframes breezeTL { 0% { opacity: 0; transform: translate(-30px,-20px) scale(.9); } 45% { opacity: .95; } 100% { opacity: 0; transform: translate(120px,70px) scale(1.3); } }
@keyframes breezeR  { 0% { opacity: 0; transform: translate(40px,0)   scale(.9); } 45% { opacity: .9;  } 100% { opacity: 0; transform: translate(-160px,-30px) scale(1.35); } }
@keyframes breezeB  { 0% { opacity: 0; transform: translate(0,30px)   scale(.9); } 45% { opacity: .9;  } 100% { opacity: 0; transform: translate(-60px,-140px) scale(1.3); } }
@keyframes breezeTR { 0% { opacity: 0; transform: translate(20px,-25px) scale(.9); } 45% { opacity: .85; } 100% { opacity: 0; transform: translate(-90px,120px) scale(1.35); } }

@media (prefers-reduced-motion: reduce) {
  .frost-fx span { animation: none; opacity: .6; }
}

/* ---- Fire-themed kits: little flames rising from the kit box ---- */
.card.fire {
  overflow: hidden;
  border-color: rgba(255, 150, 70, .6);
}
.card.fire::after {
  /* warm ember glow hugging the card edges */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  box-shadow: inset 0 0 40px rgba(255, 130, 40, .45);
  pointer-events: none;
  z-index: 4;
}
.fire-fx {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  overflow: hidden;
  pointer-events: none;
  z-index: 3;
}
.fire-fx span {
  position: absolute;
  bottom: -24px;
  display: block;
  width: 60px;
  height: 80px;
  border-radius: 50% 50% 48% 48%;
  filter: blur(8px);
  opacity: 0;
  background: radial-gradient(circle at 50% 75%, rgba(255, 240, 150, .98), rgba(255, 140, 30, .75) 45%, rgba(255, 50, 0, 0) 75%);
  will-change: transform, opacity;
}
/* flames spread across the bottom, each flickering on its own rhythm */
.fire-fx span:nth-child(1) { left: 6%;  width: 56px; animation: flame 2s   ease-in-out infinite;     }
.fire-fx span:nth-child(2) { left: 22%; width: 70px; animation: flame 1.7s ease-in-out infinite .4s;  }
.fire-fx span:nth-child(3) { left: 40%; width: 60px; animation: flame 2.3s ease-in-out infinite .15s; }
.fire-fx span:nth-child(4) { left: 56%; width: 74px; animation: flame 1.8s ease-in-out infinite .6s;  }
.fire-fx span:nth-child(5) { left: 73%; width: 58px; animation: flame 2.1s ease-in-out infinite .3s;  }
.fire-fx span:nth-child(6) { left: 88%; width: 66px; animation: flame 1.6s ease-in-out infinite .5s;  }

@keyframes flame {
  0%   { opacity: 0;   transform: translateY(20px)  scaleY(.6)  scaleX(1);   }
  20%  { opacity: .95; transform: translateY(-10px) scaleY(1.1) scaleX(.9);  }
  55%  { opacity: .85; transform: translateY(-55px) scaleY(1.3) scaleX(1.05);}
  80%  { opacity: .4;  transform: translateY(-90px) scaleY(1.5) scaleX(.85); }
  100% { opacity: 0;   transform: translateY(-120px) scaleY(1.7) scaleX(.7); }
}

@media (prefers-reduced-motion: reduce) {
  .fire-fx span { animation: none; opacity: .55; bottom: 0; }
}

/* ---- Void-themed kits: dark night-time shadows seeping in from the edges ---- */
.card.void {
  overflow: hidden;
  border-color: rgba(150, 120, 220, .5);
}
.card.void::after {
  /* dark vignette with a faint purple aura on the edges */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  box-shadow: inset 0 0 55px rgba(8, 4, 20, .8), inset 0 0 26px rgba(130, 90, 210, .4);
  pointer-events: none;
  z-index: 4;
}
.void-fx {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  overflow: hidden;
  pointer-events: none;
  z-index: 3;
}
/* dark mist wisps creeping in from each edge */
.void-fx span {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(20px);
  opacity: 0;
  background: radial-gradient(circle, rgba(70, 35, 115, .9), rgba(30, 12, 55, 0) 70%);
  will-change: transform, opacity;
}
.void-fx span:nth-of-type(1) { width: 200px; height: 130px; top: -50px;   left: -60px;  animation: breezeTL 8s   ease-in-out infinite; }
.void-fx span:nth-of-type(2) { width: 180px; height: 120px; top: 30%;    right: -70px; animation: breezeR  9.5s ease-in-out infinite 1s; }
.void-fx span:nth-of-type(3) { width: 220px; height: 120px; bottom: -55px; left: 20%;  animation: breezeB  9s   ease-in-out infinite .6s; }
.void-fx span:nth-of-type(4) { width: 160px; height: 110px; top: -40px;   right: 10%;  animation: breezeTR 10.5s ease-in-out infinite 1.8s; }

/* twinkling night stars */
.void-fx i {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px 1px rgba(205, 185, 255, .9);
  opacity: 0;
  animation: twinkle 3s ease-in-out infinite;
}
.void-fx i:nth-of-type(1) { top: 16%; left: 14%; animation-delay: .2s;  }
.void-fx i:nth-of-type(2) { top: 28%; left: 80%; animation-delay: 1.1s; }
.void-fx i:nth-of-type(3) { top: 60%; left: 28%; animation-delay: .7s;  }
.void-fx i:nth-of-type(4) { top: 46%; left: 62%; animation-delay: 1.7s; }
.void-fx i:nth-of-type(5) { top: 74%; left: 86%; animation-delay: 2.2s; }
.void-fx i:nth-of-type(6) { top: 12%; left: 50%; animation-delay: 1.4s; }

@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.4); } 50% { opacity: 1; transform: scale(1.3); } }

@media (prefers-reduced-motion: reduce) {
  .void-fx span { animation: none; opacity: .45; }
  .void-fx i { animation: none; opacity: .7; }
}

.empty { text-align: center; color: var(--muted); padding: 40px 0; }

footer { color: var(--muted); font-size: .8rem; text-align: center; padding: 24px 0 48px; border-top: 1px solid var(--line); }

@media (max-width: 520px) {
  .grid { grid-template-columns: 1fr; }
}
