/* =========================================
   1. RESET & CORE BASICS
   ========================================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Roboto', sans-serif;
}

body {
  /* The base DuckMath Green Gradient */
  background: linear-gradient(135deg, #b8e994 0%, #78e08f 100%);
  background-attachment: fixed;
  min-height: 100vh;
  padding: 20px;
  color: #333;
  position: relative;
  overflow-x: hidden;
}

/* =========================================
   2. FULL SIZE DIAMOND BACKGROUND (UPDATED)
   ========================================= */
body::before, .stealth-bg::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  
  /* Large scale (1500px) results in huge, clean diamonds */
  background-image: url('bg-diamante.svg'); 
  background-size: 1500px auto; 
  background-repeat: repeat;
  
  /* Sharper and more visible */
  opacity: 0.25;      /* Increased from 0.12 for more visibility */
  filter: none;       /* Removed blur to make them full-strength sharp */
  
  z-index: -1; 
  pointer-events: none;
}

/* Fix for game pages sitting in subfolders (/class/folder/index.html) */
.stealth-bg::before {
  background-image: url('../../bg-diamante.svg');
}

/* Forces the green gradient onto game pages via the JS Auto-Patcher */
.stealth-bg {
  background: linear-gradient(135deg, #b8e994 0%, #78e08f 100%) !important;
  background-attachment: fixed !important;
}

/* =========================================
   3. NAVIGATION & UI
   ========================================= */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(15px);
  border-radius: 15px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.4rem;
  color: #2d3436;
}

.logo img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.data-controls {
  display: flex;
  gap: 8px;
}

/* PILL BUTTONS */
.data-btn {
  padding: 8px 18px;
  border: none;
  border-radius: 20px;
  background: white;
  color: #333;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
}

.data-btn:hover {
  background: #2d3436;
  color: white;
  transform: translateY(-2px);
}

/* BUTTON COLORS */
.blob-btn { background: #a29bfe; color: #2d3436; }
.blob-btn:hover { background: #6c5ce7; color: white; }

.cloak-btn { background: #81ecec; color: #2d3436; }
.cloak-btn:hover { background: #00cec9; color: white; }

.dmca-btn { background: #ff7675; color: white; }
.dmca-btn:hover { background: #d63031; }

/* SEARCH BOX */
.search-container input {
  padding: 10px 20px;
  border-radius: 25px;
  border: none;
  width: 250px;
  outline: none;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: width 0.3s ease;
}

.search-container input:focus {
  width: 300px;
}

/* =========================================
   4. BENTO GRID & CARDS
   ========================================= */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  grid-auto-rows: 140px; 
  gap: 20px;
  grid-auto-flow: dense; 
  padding-bottom: 50px;
  max-width: 1400px;
  margin: 0 auto;
}

.game-card {
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}

.game-card:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 20px rgba(0,0,0,0.15);
  z-index: 10;
}

.game-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* CARD HOVER OVERLAY */
.card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
  color: white;
  padding: 25px 10px 10px 10px;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.game-card:hover .card-overlay {
  opacity: 1;
  transform: translateY(0);
}

/* BENTO SIZES */
.size-large { grid-column: span 3; grid-row: span 3; }
.size-medium { grid-column: span 2; grid-row: span 2; }
.size-wide { grid-column: span 2; grid-row: span 1; }

/* =========================================
   5. POPUP OVERLAY
   ========================================= */
.overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  backdrop-filter: blur(3px);
}

.popup {
  background: white;
  width: 90%;
  max-width: 400px;
  margin: 15% auto;
  padding: 30px;
  border-radius: 20px;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 25px rgba(0,0,0,0.2);
}

.popup h2 { margin-bottom: 15px; font-size: 1.2rem; }
.popup .btn {
  display: inline-block;
  padding: 10px 20px;
  background: #0984e3;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
}
.close {
  position: absolute;
  top: 15px; right: 20px;
  font-size: 24px;
  cursor: pointer;
  color: #aaa;
}
