@font-face {
  font-family: 'PixelArabic';
  src: url('fonts/ar-pixel.ttf') format('truetype');
}

@keyframes bg-scrolling {
  0% { background-position: 0 0; }
  100% { background-position: 250px 250px; }
}

@keyframes titleFloatAndRotate {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-15px) rotate(3deg); }
}

@keyframes titleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes scroll-infinite {
  0% { transform: translateX(0); }
  100% { transform: translateX(50%); } 
}

img {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}

body {
  margin: 0; padding: 0;
  /* الخلفية مع تعتيم متوسط (0.6) لإبراز المحتوى */
  background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2 )), 
              url('https://img.itch.zone/aW1nLzI0NzQ2NzM3LnBuZw==/original/dzRs3r.png');
  background-repeat: repeat; background-size: 250px; background-attachment: fixed;
  animation: bg-scrolling 10s linear infinite;
  font-family: 'PixelArabic', sans-serif;
  direction: rtl; overflow-x: hidden;
  display: flex; flex-direction: column; min-height: 100vh;
}

.header-section { display: flex; flex-direction: column; align-items: center; padding-top: 150px; padding-bottom: 50px; z-index: 10; }

h1 {
  font-size: 3.2em; color: white; margin: 10px 0;
  text-shadow: 4px 4px 0px #000;
  animation: titleFloatAndRotate 3s ease-in-out infinite;
  display: inline-block;
}

.desc { color: white; text-align: center; margin-bottom: 30px; line-height: 1.6; }

.social-links { display: flex; gap: 15px; margin-bottom: 30px; justify-content: center; }
.social-btn {
  cursor: pointer; height: 55px; width: 55px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px; overflow: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 2px solid #fff;
  animation: titleFloat 4s ease-in-out infinite;
  text-decoration: none; padding: 0 12px; box-sizing: border-box;
}

#discord { background-color: #6367E9; }
#github  { background-color: #16181B; }
#itch    { background-color: #DD6660; }
#instagram { background-color: #E4405F; } /* لون إنستا المميز */

.social-btn:hover { width: 165px; transform: scale(1.05); gap: 15px; justify-content: flex-start; }
.social-btn span { width: 0; opacity: 0; overflow: hidden; transition: 0.4s; font-weight: bold; color: white; white-space: nowrap; }
.social-btn:hover span { width: auto; opacity: 1; }
.social-btn svg, .social-btn img { height: 28px; width: 28px; flex-shrink: 0; }

.top-ground-divider {
  width: 100vw; height: 400px;
  background-image: url('top-ground.png');
  background-size: auto 100%; background-repeat: repeat-x;
  background-position: bottom; image-rendering: pixelated;
  z-index: 5; position: relative;
}

.main-content-area {
  width: 100vw;
  background-image: url('bottom-ground.png');
  background-repeat: repeat;
  background-size: auto; 
  image-rendering: pixelated;
  display: flex; flex-direction: column; align-items: center;
  padding: 60px 0; flex-grow: 1; margin-top: -2px;
}

.section-title {
  width: 90%; max-width: 800px; color: white; text-align: right;
  border-right: 8px solid #ffbf00; padding-right: 20px; margin-bottom: 30px;
}

.portfolio-container { width: 100%; overflow: hidden; padding: 20px 0; }
.portfolio-scroll-track {
  display: flex; gap: 0; width: max-content;
  animation: scroll-infinite 25s linear infinite;
}

.portfolio-item { 
  width: 300px; height: 300px; flex-shrink: 0;
  transition: transform 0.3s ease; cursor: zoom-in;
}
.portfolio-item:hover { transform: scale(1.05); z-index: 10; }
.portfolio-item img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }

/* Lightbox Styling */
.lightbox {
  display: none; position: fixed; z-index: 1000;
  left: 0; top: 0; width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.9);
  justify-content: center; align-items: center;
}
.lightbox-container {
  position: relative; width: 90%; max-width: 900px;
  background: #1a1a1a; border-radius: 12px;
  display: flex; flex-direction: row-reverse; overflow: hidden;
}
.lightbox-img-side { flex: 1.5; background: #000; display: flex; align-items: center; justify-content: center; height: 500px; }
.lightbox-img-side img { max-width: 100%; max-height: 100%; image-rendering: pixelated; }
.lightbox-info-side { flex: 1; padding: 40px; color: white; }
.close-lightbox { position: absolute; top: 20px; left: 20px; color: white; font-size: 30px; cursor: pointer; }

/* Copy Notification */
#copy-modal {
  visibility: hidden; opacity: 0; position: fixed; bottom: 30px; left: 50%;
  transform: translateX(-50%); background: #ffbf00; color: #000; padding: 10px 25px;
  border-radius: 8px; transition: 0.3s; z-index: 100;
}
#copy-modal.show { visibility: visible; opacity: 1; }