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

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

/* =========================================
   2. DIAMOND BACKGROUND
   ========================================= */
body::before, .stealth-bg::before {
  content: "";
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background-image: url('bg-diamante.svg'); 
  background-size: 1500px auto; 
  background-repeat: repeat;
  opacity: 0.25;
  z-index: -1; 
  pointer-events: none;
}

.stealth-bg {
  background: linear-gradient(135deg, #b8e994 0%, #78e08f 100%) !important;
  background-attachment: fixed !important;
}

/* =========================================
   3. SIDEBAR & MENU TRIGGER
   ========================================= */
.sidebar {
  height: 100%;
  width: 0; 
  position: fixed;
  z-index: 2000;
  top: 0;
  left: 0;
  background-color: #2d342e;
  overflow-x: hidden;
  transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding-top: 80px;
  box-shadow: 10px 0 30px rgba(0,0,0,0.3);
}

.sidebar-header {
  text-align: center;
  color: white;
  margin-bottom: 20px;
}

.sidebar-item {
  padding: 15px 25px;
  text-decoration: none;
  font-size: 1.1rem;
  color: #bdc3c7;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: 0.2s;
  border-left: 5px solid transparent;
}

.sidebar-item:hover {
  color: #b8e994;
  background: rgba(255,255,255,0.05);
  border-left: 5px solid #b8e994;
}

.sidebar-item-auth, .sidebar-item-guest {
    display: none; 
}

.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 10px 25px;
}

.menu-trigger {
  position: fixed;
  top: 22px;
  left: 20px;
  width: 35px;
  height: 30px;
  z-index: 2100;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  backdrop-filter: blur(10px);
}

.menu-trigger span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: #2d3436;
  border-radius: 2px;
  transition: 0.3s;
}

/* =========================================
   4. 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; }

.data-btn {
  padding: 8px 18px;
  border: none;
  border-radius: 20px; /* Pill Shape */
  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;
  white-space: nowrap;
}

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

/* Specific Button Colors */
.export-btn { background: #55efc4; color: #2d3436; }
.import-btn { background: #fab1a0; color: #2d3436; }
.blob-btn { background: #a29bfe; color: #2d3436; }
.cloak-btn { background: #81ecec; color: #2d3436; }
.dmca-btn { background: #ff7675; color: white; }

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

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

/* =========================================
   5. 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-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); }

.size-large { grid-column: span 3; grid-row: span 3; }
.size-medium { grid-column: span 2; grid-row: span 2; }

/* =========================================
   6. PANIC HINT (Bottom Left)
   ========================================= */
.panic-hint {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(45, 52, 46, 0.8);
    color: #bdc3c7;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 1000;
    pointer-events: none;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(184, 233, 148, 0.2);
}

.panic-hint span {
    color: #b8e994;
    font-weight: bold;
    font-size: 14px;
}

/* =========================================
   7. POPUP OVERLAY
   ========================================= */
.overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 3000;
  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: 10px; }
.popup p { margin-bottom: 20px; color: #666; }

.popup .btn {
  display: inline-block;
  padding: 10px 20px;
  background: #0984e3;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
  margin-top: 15px;
}

.close { position: absolute; top: 15px; right: 20px; font-size: 24px; cursor: pointer; color: #aaa; }