* {
  box-sizing: border-box;
}

body {
    /* background-image: url("img/background.jpg"); */
  margin: 0;
  font-family: sans-serif;
  background: #111;
  color: #eee;
}

/* Page grid */
.page {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: #858585;       /* dark gray */
  color: #eee;
  min-width: 220px;
  height: 100vh;             /* full viewport height */
  padding: 2rem 1rem;
  position: fixed;           /* stays on screen while scrolling */
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  border-right: 1px solid #333;
  z-index: 100;
}


/* Main content area */
.content {
  margin-left: 220px;    /* same as sidebar width */
  padding: 2rem;
  display: flex;
  justify-content: center;
}

/* Width constraint */
.content-inner {
  width: 90%;
  max-width: 1200px;
}

#card-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.character-card {
  background: #1a1a1a;
  padding: 1rem;
  border: 1px solid #333;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.card-image {
  width: 100%;
  height: 160px;
  object-fit: fit;
  margin-bottom: 0.5rem;
  border: 1px solid #333;
}

/* Wobble animation */
@keyframes wobble {
  0%   { transform: rotate(0deg); }
  25%  { transform: rotate(1deg); }
  50%  { transform: rotate(-1deg); }
  75%  { transform: rotate(0.5deg); }
  100% { transform: rotate(0deg); }
}

.character-card:hover {
  animation: wobble 0.3s ease-in-out;
}

.tag-list {
  display: flex;
  gap: 0.5rem;
  padding: 0;
  list-style: none;
}

.tag-list li {
  font-size: 0.75rem;
  opacity: 0.7;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.overlay.hidden {
  display: none;
}

.overlay-content {
  background: #111;
  border: 1px solid #444;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  position: relative;
}

#close-overlay {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  color: #eee;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
}
