/* ===== CONFIGURACIÓN GLOBAL ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  overflow-x: clip;
  height: auto;
}

body {
  background-image: url("images/fondo1.png");
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  font-family: 'Inter', sans-serif;
  color: #333;
}

:root {
  --bg-color: rgb(214, 214, 214);
  --navbar-color: color-mix(in srgb, var(--bg-color) 70%, black);
  --accent-color: #195cec;
}

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

.no-scroll {
  overflow: hidden !important;
}

/* ===== NAVBAR ===== */
.navbar {
  display: flex;
  justify-content: center;
  align-items: center;
  background: 
    url("./texturaNav.png"), 
    linear-gradient(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.15));
  background-blend-mode: multiply;
  background-size: cover;
  background-position: center;
  padding: 0 25px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
  height: 200px;
  position: sticky;
  top: 0;
  z-index: 999;
  transition: height 0.3s ease;
}

.logo {
  display: none;
}

/* ===== LAYOUT PRINCIPAL ===== */
.layout {
  display: grid;
  grid-template-columns: 250px 1fr 250px;
  gap: 20px;
  padding: 20px;
  align-items: start;
  max-width: 1600px;
  margin: 0 auto;
}

.content {
  min-width: 0;
}

/* ===== SIDEBARS ===== */
.sidebar {
  background: #fff;
  border-radius: 12px;
  padding: 15px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  margin-bottom: 20px;
  box-sizing: border-box;
  overflow: hidden;
}

.left-sidebar {
  position: -webkit-sticky;
  position: sticky;
  top: 220px;
  z-index: 100;
  height: fit-content;
}

.right-sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ===== PUBLICIDAD ===== */
.publi-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  transition: 0.3s;
}

.publi-img:hover {
  filter: brightness(1.1);
}

/* ===== GRID DE JUEGOS ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

/* ===== TARJETAS ===== */
.card {
  background: #fff;
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.1);
  text-align: center;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
  border-color: var(--accent-color);
}

.card-image-container {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
  border-radius: 8px;
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card-description {
  color: white;
  font-size: 0.85rem;
  margin: 0;
  text-align: center;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.card:hover .card-overlay { opacity: 1; }
.card:hover .card-description { transform: translateY(0); }
.card:hover img { transform: scale(1.1); }

.card .title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-top: 10px;
  transition: color 0.3s;
}

.card:hover .title { color: var(--accent-color); }

.section-title {
  margin: 40px 0 20px;
  font-size: 1.8rem;
  color: #333;
  scroll-margin-top: 220px;
  padding-left: 10px;
}

/* ===== MODAL OPTIMIZADO ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  align-items: center;
  justify-content: center;
}

.modal-content {
  position: relative;
  background-color: #111;
  width: 95%;
  max-width: 800px;
  height: auto;
  max-height: 90vh;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 15px;
  color: #fff;
  font-size: 35px;
  z-index: 10001;
  cursor: pointer;
}

#canvas-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

#canvas-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.modal-footer {
  display: flex;
  justify-content: center;
  gap: 15px;
  padding: 15px;
  background: #1a1a1a;
}

.btn-control {
  background: #333;
  color: white;
  border: 1px solid #444;
  padding: 8px 15px;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.3s;
}

.btn-control:hover {
  background: var(--accent-color);
  border-color: var(--accent-color);
}

/* ===== BOTÓN VOLVER ARRIBA ===== */
.back-to-top {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 55px;
  height: 55px;
  background-color: var(--accent-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

/* ===== FOOTER ===== */
.main-footer {
  background-color: #1a1a1a;
  color: #fff;
  padding: 40px 0 20px 0;
  margin-top: 50px;
  border-top: 4px solid var(--accent-color);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  padding: 0 40px;
}

.footer-section h3 { color: var(--accent-color); margin-bottom: 15px; }
.footer-section ul { list-style: none; }
.footer-section ul li a { color: #bbb; text-decoration: none; }

.contact-info span, .copy-text {
  color: var(--accent-color);
  cursor: pointer;
  user-select: all;
  transition: 0.3s;
}

.copy-text:hover { background: rgba(25, 92, 236, 0.1); text-decoration: underline; }

.social-icons { display: none !important; }

.footer-bottom {
  text-align: center;
  margin-top: 40px;
  padding: 20px 0;
  border-top: 1px solid #333;
}

/* ===== CATEGORY MENU ===== */
.category-menu { display: flex; flex-direction: column; gap: 12px; margin-top: 15px; }

.category-link {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px 18px;
  background-color: #f9f9f9;
  border-radius: 10px;
  text-decoration: none;
  color: #333;
  font-weight: 600;
  transition: 0.3s;
}

.category-link:hover { transform: translateX(5px); background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 250px 1fr; }
  .right-sidebar { display: none; }
}

@media (max-width: 768px) {
  .navbar { height: 120px; }
  .layout { grid-template-columns: 1fr; padding: 10px; }
  .left-sidebar { position: static; width: 100%; }
  .footer-content { flex-direction: column; text-align: center; gap: 30px; }
  .section-title { scroll-margin-top: 140px; }
}