/* Custom Styles for Web Game Library */

/* Reset & Base Styles */
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #0f172a; /* Dark theme background */
  color: #f8fafc;
}

/* Game Grid Container */
#gameGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* Individual Game Cards */
.game-card {
  background-color: #1e293b;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
}

.game-image {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-bottom: 1px solid #334155;
}

.game-info {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.game-info h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.125rem;
  color: #ffffff;
}

.category {
  font-size: 0.75rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.play-btn {
  margin-top: auto;
  padding: 0.5rem 1rem;
  background-color: #3b82f6;
  color: #ffffff;
  border: none;
  border-radius: 0.375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.play-btn:hover {
  background-color: #2563eb;
}

/* Modal Popup Overlay */
#gameModal {
  display: none; /* Controlled by JS */
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

/* Modal Content Box */
.modal-content {
  position: relative;
  width: 90vw;
  max-width: 1100px;
  height: 85vh;
  background-color: #0f172a;
  border-radius: 0.75rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #334155;
}

/* Close Button inside Modal */
#closeModal {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 2rem;
  color: #94a3b8;
  cursor: pointer;
  z-index: 1001;
  line-height: 1;
  transition: color 0.2s ease;
}

#closeModal:hover {
  color: #ffffff;
}

/* Fullscreen Game Frame */
#gameFrame {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0.75rem;
}