@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
  --bg: #0d0f14;
  --bg2: #12151c;
  --card: #141824;
  --border: #1f2430;
  --text: #f5f5f5;
  --muted: #9aa4b2;
  --accent: #2b78ff;
}

body.light {
  --bg: #f4f6fa;
  --bg2: #ffffff;
  --card: #ffffff;
  --border: #dce1ea;
  --text: #0d0f14;
  --muted: #5f6b7a;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}

h1 {
  font-family: "Inter", sans-serif;
  color: var(--text);
  text-align: center;
}

nav {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  margin-right: 20px;
}

nav a:hover,
nav a[aria-current="page"] {
  color: var(--text);
}

.layout {
  display: flex;
  min-height: calc(100vh - 70px);
}

.sidebar {
  width: 240px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: 20px;
}

.sidebar h2 {
  margin-bottom: 20px;
}

.sidebar ul {
  list-style: none;
}

.sidebar li {
  padding: 10px;
  margin-bottom: 8px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
}

.sidebar li:hover {
  background: var(--card);
  color: var(--text);
}

.page {
  flex: 1;
  padding: 30px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px 60px;
}

.container h1 {
  font-size: 28px;
  margin-bottom: 25px;
}

.controls {
  margin-bottom: 25px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-left: calc(30%);
}

.controls input,
.controls select {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 6px;
}

.controls input::placeholder {
  color: var(--muted);
}

.cards,
.skins-grid {
  display: grid;
  gap: 16px;
}

.cards {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.skins-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  padding: 0 30px;
  align-items: stretch;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  text-align: left;
  padding: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.card img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  border-radius: 10px;
  background: var(--bg);
  margin-bottom: 10px;
}

.card-content {
  padding: 12px;
}

.card h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

.card p {
  font-size: 12px;
  color: var(--muted);
}

.rarity-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 8px;
  font-size: 10px;
  border-radius: 6px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #fff;
  display: inline-block;
  z-index: 5;
}

.rarity-badge.common { background: #7b7b7b; }
.rarity-badge.uncommon { background: #2ecc71; }
.rarity-badge.rare { background: #3498db; }
.rarity-badge.epic { background: #9b59b6; }
.rarity-badge.legendary { background: #f39c12; }
.rarity-badge.mythic { background: #e74c3c; }
.rarity-badge.gaminglegends { background: #ff00ff; }
.rarity-badge.icon { background: #00c8ff; }
.rarity-badge.marvel { background: #ed1d24; }
.rarity-badge.dc { background: #0078f2; }
.rarity-badge.starwars { background: #000; color: #ffe81f; }
.rarity-badge.dark { background: #4b1f6f; }
.rarity-badge.shadow { background: #1c1c1c; }
.rarity-badge.frozen { background: #8fd3f4; }
.rarity-badge.lava { background: #ff6a00; }
.rarity-badge.slurp { background: #00f2ea; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 500px;
  width: 92%;
  padding: 24px;
  text-align: center;
  position: relative;
}

.modal-content img {
  width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: contain;
  margin-bottom: 16px;
}

#closeModal,
.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 22px;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
}

.fade-in {
  animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.skeleton {
  pointer-events: none;
}

.skeleton .sk-img,
.skeleton .sk-line {
  background: linear-gradient(90deg, var(--border) 25%, var(--bg2) 37%, var(--border) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s infinite linear;
}

.skeleton .sk-img { height: 160px; }
.skeleton .sk-line { height: 14px; margin: 10px; border-radius: 4px; }
.skeleton .sk-line.small { width: 60%; margin: 0 auto 10px; }

@keyframes shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.theme-toggle {
  position: fixed;
  top: 8px;
  right: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10%;
  width: 38px;
  height: 38px;
  cursor: pointer;
  z-index: 100;
}
