/* layout-v3.css */

/* Global and Resets */
body, html {
  padding: 0;
  margin: 0;
  font-family: "Lilita One", sans-serif;
  scroll-behavior: smooth;
}
.g-body {
  background: #11121a !important;
  width: 100% !important;
  height: 100% !important;
  color: #fff;
}
.frame, div, section, main {
  box-sizing: border-box;
}

/* Base structural layout for Desktop */
.game-page-layout {
  display: grid;
  grid-template-columns: 72fr 28fr;
  gap: 25px;
  /* Leaves room for the left sidebar on desktop */
  margin-left: 60px;
  /* Header is usually ~60px fixed */
  padding: 85px 25px 30px 25px;
  text-align: left;
  max-width: 1600px;
}

/* --- Left Column: Main Game Area --- */
.game-main {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
  min-width: 0;
}

/* Game Container & Bar */
#game-container {
  width: 100%;
  height: 600px;
  background-color: var(--highlight, #1a1a24);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.frame {
  border: none;
  background: #000;
}
.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--highlight, #1a1a24);
  height: 50px;
  padding: 0 15px;
  border-radius: 0 0 8px 8px;
}
.bar h1 {
  margin: 0;
  font-family: Oswald, serif;
  font-size: 22px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fullscreen-btn {
  border: 0;
  background: 0 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  border-radius: 7px;
  transition: background 0.3s;
}
.fullscreen-btn img {
  width: 28px;
  height: 28px;
  transition: transform 0.3s ease-in-out;
  border-radius: 5px !important;
}
.fullscreen-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}
.fullscreen-btn:hover img {
  transform: scale(1.1);
}

/* Ads alignment */
/* Hide side-small entirely as requested, and reset pc_ad so it stays safely in the grid column instead of absolutely positioned. */
.pc_ad {
  position: relative !important;
  margin: 0 auto !important;
  right: auto !important;
  left: auto !important;
  width: 100% !important;
  height: auto !important;
  min-height: 300px !important;
  display: flow-root !important;
  min-height: 250px !important;
  justify-content: center !important;
  align-items: center !important;
}
.side-small {
  display: none !important;
}
.ad-holder, .pc_ad {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}
.line-ad{
  margin-top: 10px !important;
}

#container-c31c44129ce2f44307c8f10da3ad4f8d{
  display: flex !important;
}

/* Description Box */
.game-desc {
  background-color: var(--highlight, #1a1a24);
  border: 1px solid #424242;
  border-radius: 8px;
  padding: 20px;
  font-family: Montserrat, sans-serif;
  line-height: 1.6;
  position: relative;
}
.tools {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 15px;
}
#plays {
  font-size: 14px;
  padding: 6px 12px;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  font-weight: bold;
}
.full-desc h1 {
  margin-top: 0;
  font-family: Oswald, serif;
  font-size: 24px;
  text-align: center;
}
.game-desc .line {
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  margin: 20px 0;
}

/* Fullscreen overlay */
.rotate {
    position: fixed;
    inset: 0; /* أقوى من top/left/width/height */
    
    background: rgba(0, 0, 0, 0.85);

    display: flow-root;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;

    z-index: 999999;

    /* هذا أهم شيء */
    min-height: 100vh;
}
.rotate #rotate-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.rotate #rotate-message {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
}
/* اظهار العناصر */
#rotate-icon,
#rotate-message {
    display: block !important;
    text-align: center;
}

/* الايقونة */
#rotate-icon img {
    width: 80px;
    height: auto;
    margin-bottom: 30px !important;
    filter: invert(1) !important; /* تحويل اللون من اسود لابيض */

    animation: rotateSwing 1.5s ease-in-out infinite;
}

/* النص */
#rotate-message {
    margin-top: 15px;
    font-size: 18px;
    color: #fff;
}

/* انيميشن يمين يسار */
@keyframes rotateSwing {
    0% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(20deg);
    }
    50% {
        transform: rotate(0deg);
    }
    75% {
        transform: rotate(-20deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

/* Optional rotation warning overlay */
.rotate {
  display: none;
}
/* Hide mobile-specific items on desktop */
.mobile {
  display: none;
}
.mobile-ads {
  display: none;
}


/* --- Right Column: PC Ads & Recommendations --- */
.down {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
  min-width: 0;
}
.recomanded {
  background-color: var(--highlight, #1a1a24);
  border: 1px solid #424242;
  border-radius: 8px;
  padding: 20px;
}
.rec-games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 15px;
  justify-content: center;
}
.games-box {
  display: flex;
  justify-content: center;
}
/* Override external CSS constraints to prevent distortion */
.game-card, .games-box, .Gimg, .inner-card {
  width: 100% !important;
  height: 100% !important;
  min-height: unset !important;
  max-height: unset !important;
}

.game-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease;
  cursor: pointer;
}
.game-card:hover {
  transform: translateY(-4px);
}
.game-card .Gimg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 12px !important;
}
.inner-card {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.game-card:hover .inner-card {
  opacity: 1;
}
.play-btn img {
  width: 32px;
  height: 32px;
  transition: transform 0.3s;
}
.game-card:hover .play-btn img {
  transform: scale(1.15);
}


/* Read More Button (Mobile only, but base styles here) */
.desc-read-more-btn {
  display: none;
}


/* ========================================================
   RESPONSIVE DESIGN
======================================================== */


/* Tablet & Smaller Desktop (977px to 1200px) */
/* We keep a 2-column layout to prevent massive PC Ads dropping to the bottom */
@media (max-width: 1200px) and (min-width: 977px) {
  .game-page-layout {
    grid-template-columns: 73fr 27fr;
    gap: 15px;
    margin-left: 60px; /* Keep sidebar space since sidebar doesn't slide until 976px */
    padding: 80px 15px 20px 15px;
  }
}

/* Mobile (≤ 976px) */
@media (max-width: 976px) {
  .g-body {
    background: #1f202e !important;
  }
  .frame {
    border-radius: 0px;
  }
  
  .game-page-layout {
    display: flex;
    flex-direction: column;
    padding: 0;
    margin-left: 0;
    margin-top: 0;
    gap: 15px;
  }

  /* Game Container Modifications for Mobile */
  #game-container {
    border-radius: 0; 
    margin: 0;
    border: none;
    display: flow-root;
    margin-top: 60px;
  }

  /* Bar logic for mobile */
  .bar {
    padding: 10px;
    flex-direction: row-reverse;
    justify-content: space-between;
    background: #4000ff !important;
    border-radius: 0 12px 12px 0 !important;
  }
  .bar h1 {
    font-size: 18px;
  }
  
  /* Mobile Ads showing */
  .mobile-ads {
    display: flex;
    justify-content: center;
    margin: 5px 0;
  }
  
  /* Line Ad explicitly forced to 320x50 and placed under title */
  .line-ad {
    width: 100%;
    display: flex !important;
    justify-content: center;
    min-height: 50px;
    margin: 0px !important;
    padding: 0px !important;
    background: transparent !important;
    border: none !important;
    height: fit-content;
    box-shadow: none;
  }

  /* Hide huge PC ads only on literal mobile */
  .pc_ad {
    display: none !important;
  }
  .side-small {
    display: none !important; /* Always hide side-small */
  }

  /* Description Box Mobile Constraints - Collapsed by default */
  .game-desc {
    padding: 15px;
    border: none;
    background: #1a1a24;
    position: relative;
    border-radius: 12px;
    margin: 10px;
  }
  .game-desc .tools {
    padding-right: 40px; /* Space for the toggle button */
  }
  
  /* The class applied by JS to clip the content */
  .desc-collapsed .full-desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }


  /* The polished toggle arrow button */
  .desc-toggle-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
  }
  .desc-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.15);
  }
  .desc-toggle-btn svg {
    fill: #fff;
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
  }
  .desc-toggle-btn.open svg {
    transform: rotate(180deg);
  }

  /* Recomanded grid for mobile (2 columns) */
  .recomanded {
    background: transparent;
    border: none;
    background-color: #1a1a24;
    border-radius: 12px;
    padding: 15px;
    margin: 10px;
  }
  .rec-games {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;

  }
}
@media (max-width: 1315px) {
    .game-desc {
        margin-top: 0px !important;
    }
}