 body {
    background-color: black;
    color: #00ff00;
    font-family: 'VT323', monospace;
    padding: 20px;
    font-size: 1em;
}

h2:not(.modal h2) { text-align: center; margin: 20px 0; }

  /* Card container */
 .card {
  width: 160px;
  flex-shrink: 0; /* prevents shrinking */
  text-align: center;
  cursor: pointer;
  border: 1px solid #00ff00;
  border-radius: 5px;
  }
  
  .card-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* evenly space cards in a row */
  gap: 20px; /* space between cards */
  padding: 0 20px; /* outer margins */
}
 /*CSS to prevent a single card from hanging alone on the last row */
.card-container .card:nth-last-child(2):nth-child(odd) {
    /* If the container has an odd number of items, the second-to-last item must span 2 */
    grid-column: span 2;
}

.card-container .card:last-child:nth-child(odd) {
    /* If the container has an odd number of items, the last item must span 2 */
    grid-column: span 2;
}

  /* Cover art container with fixed ratio */
  .card .cover {
    width: 160px;       /* card width */
    height: 240px;      /* 2:3 ratio (matches 600x900) */
    object-fit: contain; /* scales image without clipping */
    background-color: black; /* fills empty space */
    border: 1px solid #00ff00;
    border-radius: 3px;
    display: block;
    margin: 0 auto 5px auto;
  }

  .card .title {
    display: flex; /* <-- NEW: Makes it a flex container */
    align-items: center; /* <-- NEW: Vertically centers content */
    justify-content: center; /* <-- NEW: Horizontally centers content */
    
    /* Set a height to reserve space for two lines */
    height: 2.5em; /* Adjust this value based on your actual line height */
    overflow: hidden; /* Prevents long titles from spilling past the two-line height */
    
    margin-top: 5px;
    font-size: .9em; 
}



  /* Modal overlay */
  .modal {
    display: none;
    position: fixed;
    z-index: 10;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.95);
    color: #00ff00;
    padding: 50px;
    box-sizing: border-box;
    overflow-y: auto;
  }

  .modal-content {
    max-width: 600px;
    margin: 0 auto;
    border: 1px solid #00ff00;
    border-radius: 5px;
    padding: 20px;
  }

  .modal h2 {
    color: #ffff00;
    margin-top: 0;
  }

  .modal p {
    font-family: 'Courier New', monospace;
    margin: 10px 0;
    font-size: .8em;
  }
  
.modal-body {
  display: flex;
  gap: 20px; /* space between image and text */
  align-items: flex-start;
}

.modal-cover {
  width: 150px;
  height: auto;
  border: 1px solid #00ff00;
  border-radius: 3px;
  flex-shrink: 0; /* prevents image from shrinking */
}

.modal-text {
  flex: 1; /* text takes the remaining width */
}

  .close-btn {
    float: right;
    cursor: pointer;
    color: #ff0000;
    font-weight: bold;
    font-size: 1.2em;
  }