:root {
  --bg-color: #ffffff;
  --card-bg: rgba(255, 255, 255, 0.85);
  --card-border: rgba(0, 0, 0, 0.15);
  --card-shadow: rgba(0, 0, 0, 0.15);
  --text-title: #161616;
  --text-sub: #555555;
  --border-sub: #dddddd;
  --icon-filter: brightness(0.7);
  --icon-hover-filter: brightness(1);
  --subbar-bg: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] {
  --bg-color: #0f0f10;
  --card-bg: rgba(24, 24, 27, 0.75);
  --card-border: rgba(255, 255, 255, 0.15);
  --card-shadow: rgba(0, 0, 0, 0.5);
  --text-title: #f4f4f5;
  --text-sub: #a1a1aa;
  --border-sub: rgba(255, 255, 255, 0.1);
  --icon-filter: invert(0.9) brightness(0.8);
  --icon-hover-filter: invert(1) brightness(1.2);
  --subbar-bg: rgba(15, 15, 16, 0.9);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  background-color: var(--bg-color); 
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  color: var(--text-title);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  /* حيدنا transition من الـ body لتفادي ثقل وتلصاق السكرول */
}

main {
  flex: 1 0 auto;
  padding-top: 70px;
}

/* الشريط العلوي */
.dark-light-bremb {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 99;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: var(--subbar-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-sub);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
}

.dark-light-bremb.nav-hidden {
  transform: translateY(-100%);
}
.game-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px 30px;
  max-width: 800px;
  margin: 20px auto 0 auto;
  padding: 0 10px;
}

@media (min-width: 768px) {
  .game-list {
    grid-template-columns: repeat(4, 1fr);
    max-width: 800px;
  }
}

a.game-card {
  text-decoration: none;
  color: inherit;
  display: block;
}

.game-card {
  background: var(--card-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 10px;
  box-shadow: 0 0 10px var(--card-shadow);
  border: 1px solid var(--card-border);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  /* تحسين الـ transition باش تكون خفيفة جداً وما تثقلش السكرول */
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.game-card:hover {
  transform: translateY(-6px);
}

.game-image {
  width: 100%;
  height: 240px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.game-info {
  padding: 12px 15px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.game-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 6px;
  text-align: center;
  font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
  color: var(--text-title);
}

.game-platform {
  font-size: 0.85rem;
  color: var(--text-sub);
  margin-bottom: 12px;
  text-align: center;
  font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
}

.game-stats {
  display: flex;
  justify-content: space-around;
  border-top: 1px solid var(--border-sub);
  padding-top: 10px;
  font-size: 0.85rem;
  color: var(--text-sub);
  font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
}

.game-stats div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.game-stats img {
  width: 16px;
  height: 16px;
  filter: var(--icon-filter);
  transition: filter 0.2s ease, transform 0.2s ease;
}

.game-stats div:hover img {
  filter: var(--icon-hover-filter);
  transform: scale(1.1);
}

/* لضمان التصاق الفوتر في الأسفل تماماً بدون أي فراغ */
app-footer {
  margin-top: auto;
  width: 100%;
  display: block;
}

@media (min-width: 768px) {
  .game-image {
    height: 240px;
  }
  .game-title {
    font-size: 1.2rem;
  }
  .game-platform {
    font-size: 1rem;
  }
  .game-stats {
    font-size: 0.9rem;
  }
  .game-stats img {
    width: 18px;
    height: 18px;
  }
}