body {
  background: radial-gradient(circle at top, #111 0%, #000 60%);
  margin: 0;
  padding-top: 80px;
  color: #00ffcc;
  font-family: 'Pixelify Sans', sans-serif;
  transition: background 0.4s ease, color 0.4s ease;
}

body[data-theme="light"] {
  background: radial-gradient(circle at top, #f0f4f8 0%, #dbe4ee 60%);
  color: #0a7e6a;
}

body[data-theme="light"] #header {
  background: rgba(255,255,255,0.85);
  border-bottom: 1px solid rgba(10,126,106,0.15);
}

body[data-theme="light"] .left > a {
  color: #333;
}

body[data-theme="light"] .left > a:nth-child(1) {
  background-image: linear-gradient(to left, #0a7e6a, #12b89a);
}

body[data-theme="light"] .left > a::after {
  background-color: #0a7e6a;
}

body[data-theme="light"] #search {
  background: #e8ecf1;
  color: #222;
  border: 1px solid #ccc;
}

body[data-theme="light"] #search:focus {
  border-color: #0a7e6a;
  box-shadow: 0 0 10px rgba(10,126,106,0.25);
}

body[data-theme="light"] #sidebar {
  background-color: #fff;
  box-shadow: 2px 0 12px rgba(0,0,0,0.06);
}

body[data-theme="light"] #sidebar .nav-link {
  color: #444;
}

body[data-theme="light"] #sidebar .nav-link:hover {
  background-color: #f0f0f0;
  color: #222;
}

body[data-theme="light"] #sidebar .nav-link.active {
  background-color: #e0f5f0;
  color: #0a7e6a;
}

body[data-theme="light"] #sidebar .nav-heading {
  color: #222;
}

body[data-theme="light"] #sidebar .nav-heading > a {
  color: #0a7e6a;
}



body[data-theme="light"] #filter {
  background: #dbe4ee;
}

body[data-theme="light"] .filter-buttons {
  background-color: #e8ecf1;
}

body[data-theme="light"] .filter-buttons > select,
body[data-theme="light"] .filter-buttons > label {
  color: #333;
}

body[data-theme="light"] .game-card {
  background: #fff;
  border-color: #b3e6da;
}

body[data-theme="light"] .game-card:hover {
  box-shadow: 0 20px 50px rgba(10,126,106,0.15);
}

body[data-theme="light"] .game-card > p,
body[data-theme="light"] .game-card > h3 {
  color: #333;
}

body[data-theme="light"] .game-card::after {
  background: linear-gradient(to top, rgba(255,255,255,0.5), transparent);
}

body[data-theme="light"] #loadMore {
  background: linear-gradient(135deg, #0a7e6a, #12b89a);
  color: #fff;
}

body[data-theme="light"] #loadMore:hover {
  box-shadow: 0 8px 25px rgba(10,126,106,0.25);
}

body[data-theme="light"] .action-btn {
  background: #e8ecf1;
  color: #666;
  border-color: #d0d5dc;
}

body[data-theme="light"] .action-btn:hover {
  background: #d5dce6;
}

body[data-theme="light"] .like-btn.active {
  background: #e3f0ff;
  color: #2979ff;
  border-color: #90bfff;
}

body[data-theme="light"] .fav-btn.active {
  background: #ffeaea;
  color: #e53935;
  border-color: #ffaaaa;
}

body[data-theme="light"] #theme-toggle {
  background: #e8ecf1;
  color: #f5a623;
  border-color: #ccc;
}

body[data-theme="light"] #sort-direction {
  background: transparent;
  color: #333;
  border-color: #aaa;
}

body[data-theme="light"] #overlay.active {
  background: rgba(0,0,0,0.2);
}

* {
  scroll-behavior: smooth;
}

#title {
  font-size: 3.5rem;
}

#intro {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

#bg-video {
  position: fixed;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}

#intro-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#press {
  align-items: center;
  margin-top: 20px;
  animation: blink 1s infinite;
  font-size:1.5rem;
}

@keyframes blink {
  50% { opacity: 0; }
}

.fastblink{
  margin-top: 20px;
  font-size: 1.5rem;
  animation: fast 0.1s 9;
}

@keyframes fast {
  50% { opacity: 0; }
}

.opening-animation {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background-color: black;
  z-index: 999;
  transition: transform 1s ease-in-out;
}

.opening-animation.expand {
  transform: translate(-50%, -50%) scale(30);
}

.fade-out {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

#header {
  background: rgba(26, 26, 26, 0.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,255,204,0.1);
  position: fixed;
  top:0;
  width: 100%;
  grid-area: header;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 15px 40px;
  background: #1a1a1a;
  gap: 15px;
  z-index: 1;
}

.left {
  font-size: 20px;
  display: flex;
  gap: 15px;
  flex-shrink: 0;
}

.left >a:nth-child(1){
  color:transparent;
  background-image: linear-gradient(to left, #00ffcc,#8efde7);
  background-size: cover;
  background-clip: text;
}

.left > a {
  text-decoration: none;
  color: white;
  position: relative;
}

.left > a::after{
  content: "";
  position: absolute;
  left:0;
  width: 0%;
  bottom: -4px;
  height: 2px;
  background-color:#00ffcc;
  transition: width 0.3s ease;

}

.left > a:hover::after{
  width: 100%;
}

.right {
  flex: 0 1 400px;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

#theme-toggle {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(0,255,204,0.25);
  color: #00ffcc;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

#theme-toggle:hover {
  background: rgba(0,255,204,0.15);
  transform: rotate(20deg) scale(1.1);
  box-shadow: 0 0 15px rgba(0,255,204,0.3);
}

#search {
  width: 100%;
  max-width: 400px;
  min-width: 120px;
  border-radius: 25px;
  padding: 10px 15px;
  color: white;
  background: #2a2a2a;
  border: 1px solid transparent;
  transition: 0.3s;
}

#search:focus {
  outline: none;
  border: 1px solid #00ffcc;
  box-shadow: 0 0 10px rgba(0,255,204,0.3);
}

#mainlayout {
  display: grid;
  grid-template-columns: 220px 1fr;
  row-gap: 10px;
  column-gap: 20px;
  grid-template-areas:
    "sidebar filter"
    "sidebar games";
  align-items: start;
}

#sidebar {
  grid-area: sidebar;
  width: 220px;
  background-color: transparent;
  padding: 10px 15px;
  height: fit-content;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 80px;
  overflow-y: auto;
  max-height: calc(100vh - 90px);
}

#sidebar::-webkit-scrollbar {
  width: 4px;
}

#sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.nav-heading {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin: 12px 0 4px 0;
  padding: 0 8px;
  letter-spacing: 0.3px;
}

.nav-heading:first-child {
  margin-top: 0;
}

.nav-heading > a {
  color: #fff;
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-heading > a:hover {
  color: #00ffcc;
}

.nav-link {
  color: #bbb;
  text-decoration: none;
  font-size: 16px;
  padding: 7px 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.nav-link i {
  width: 20px;
  text-align: center;
  font-size: 15px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #fff;
  transform: translateX(3px);
}

.nav-link:hover i {
  opacity: 1;
}

.nav-link.active {
  background-color: rgba(0, 255, 204, 0.1);
  color: #00ffcc;
}

.nav-link.active i {
  opacity: 1;
  color: #00ffcc;
}

#filter {
  grid-area: filter;
  padding: 5px 40px;
  display: flex;
  gap: 15px;
  align-items: center;
  top: 80px;
  background: black;
  z-index: 2;
  margin-bottom: 25px;
  flex-wrap: nowrap;
  overflow-x: auto;
  top: 80px;
  background: black;
  z-index: 2;
}

#filter > .filter-buttons{
  background-color: #2a2a2a;
  padding: 10px;
  border-radius: 5px;
}

.filter-buttons > select[id = "order-by"]{
  background-color: transparent;
  border: none;
  color: white;
}

.filter-buttons > select:hover{
  cursor: pointer;
}

.filter-buttons > select:hover{
  opacity: 0.5;
  transition: opacity 0.5s;
}

#sort-direction {
  background: transparent;
  border: 1px solid rgba(0,255,204,0.3);
  color: #00ffcc;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Pixelify Sans', sans-serif;
  font-size: 14px;
  transition: all 0.3s ease;
}

#sort-direction:hover {
  background: rgba(0,255,204,0.1);
  border-color: #00ffcc;
  box-shadow: 0 0 10px rgba(0,255,204,0.15);
}

#sort-direction i {
  transition: transform 0.3s ease;
}

#sort-direction:active i {
  transform: scaleY(-1);
}

#games {
  grid-area: games;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding: 0 40px;
}

.game-card {
  border-radius: 16px;
  border: 1px solid #64e1fa;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  width: 250px;
  border-radius: 12px;
  background: #111;
  transition: transform 0.2s ease;
  
}

.game-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.game-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 50px rgba(0,255,204,0.2);
}

.bgimg {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.bgimg {
  transition: transform 0.4s ease;
}

.game-card:hover .bgimg {
  transform: scale(1.1);
}

.game-card > p,
.game-card > h3 {
  padding: 0 12px;
  font-size: 0.95rem;
  color: white;
  font-weight: 500;
}

.game-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 2;
  pointer-events: none;
}

.game-card:hover::after {
  opacity: 1;
}

.card-actions {
  display: flex;
  gap: 8px;
  padding: 8px 12px 12px;
  position: relative;
  z-index: 3;
}

.action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 0;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: #aaa;
  cursor: pointer;
  font-family: 'Pixelify Sans', sans-serif;
  font-size: 13px;
  transition: all 0.25s ease;
}

.action-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
  transform: translateY(-1px);
}

.action-btn:active {
  transform: scale(0.95);
}

.like-btn.active {
  background: rgba(41,121,255,0.15);
  color: #64b5f6;
  border-color: rgba(41,121,255,0.3);
}

.like-btn.active i {
  animation: popIn 0.3s ease;
}

.fav-btn.active {
  background: rgba(229,57,53,0.15);
  color: #ef5350;
  border-color: rgba(229,57,53,0.3);
}

.fav-btn.active i {
  animation: heartBeat 0.4s ease;
}

@keyframes popIn {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

@keyframes heartBeat {
  0% { transform: scale(1); }
  25% { transform: scale(1.3); }
  50% { transform: scale(1); }
  75% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.load-more{
  grid-column: 2;
  display: flex;
  justify-content: center;
  margin: 30px 0;
}

#loadMore {
  width: 300px;
  max-width: 80%;
  padding: 14px 20px;
  background: linear-gradient(135deg, #00ffcc, #00ddb3);
  color: black;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#loadMore:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,255,204,0.3);
}

#overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  z-index: 998;
}

#overlay.active {
  display: block;
}

#menu-toggle {
  display: none;
}

@media (max-width: 600px) {

  #header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    gap: 10px;
    min-width: 0;
  }

  .left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    
  }

  .left a {
    font-size: 13px;
  }
  #menu-toggle {
    display: block;
    font-size: 18px;
    cursor: pointer;
  }
  .right {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: flex-end;
  }

  #search {
    width: 100%;
    max-width: 140px;
    min-width: 0;
    padding: 6px 8px;
    font-size: 12px;
  }
  #mainlayout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "filter"
      "games";
  }
  #sidebar {
    position: fixed;
    top: 80px;
    left: -100%;
    width: 220px;
    height: calc(100vh - 80px);
    background-color: #1a1a1a;
    transition: left 0.3s ease;
    z-index: 999;
  }

  #sidebar.active {
    left: 0;
  }

  #filter {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
  }
  #games {
    padding: 0 15px;
    justify-content: center;
  }

  .game-card {
    width: 100%;
    max-width: 320px;
  }

  .bgimg {
    height: 160px;
  }

  .load-more {
    grid-column: 1;
  }

  #loadMore {
    width: 100%;
  }
}

/* ── Profile Menu ── */
#profile-menu {
  position: relative;
  flex-shrink: 0;
}

#profile-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(0,255,204,0.25);
  color: #00ffcc;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

#profile-btn:hover {
  background: rgba(0,255,204,0.15);
  box-shadow: 0 0 15px rgba(0,255,204,0.3);
  transform: scale(1.08);
}

#profile-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 240px;
  background: #1a1a1a;
  border: 1px solid rgba(0,255,204,0.15);
  border-radius: 14px;
  padding: 8px 0;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,255,204,0.05);
  opacity: 0;
  transform: translateY(-8px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 2000;
}

#profile-dropdown.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.profile-avatar-lg {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00ffcc, #0097a7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-size: 18px;
  flex-shrink: 0;
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.profile-tag {
  font-size: 12px;
  color: #00ffcc;
  opacity: 0.7;
}

.profile-divider {
  height: 1px;
  background: rgba(255,255,255,0.07);
  margin: 4px 0;
}

.profile-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  color: #bbb;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease;
}

.profile-item i {
  width: 18px;
  text-align: center;
  opacity: 0.7;
}

.profile-item:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

.profile-item:hover i {
  opacity: 1;
}

.profile-badge {
  margin-left: auto;
  background: rgba(0,255,204,0.15);
  color: #00ffcc;
  border: 1px solid rgba(0,255,204,0.25);
  border-radius: 20px;
  padding: 1px 9px;
  font-size: 12px;
  font-weight: 700;
}

.profile-item-danger {
  color: #ef5350;
}

.profile-item-danger i {
  color: #ef5350;
  opacity: 1;
}

.profile-item-danger:hover {
  background: rgba(229,57,53,0.1);
  color: #ff6b6b;
}

/* Light theme overrides for profile */
body[data-theme="light"] #profile-btn {
  background: #e8ecf1;
  color: #0a7e6a;
  border-color: #ccc;
}

body[data-theme="light"] #profile-dropdown {
  background: #fff;
  border-color: rgba(0,0,0,0.1);
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

body[data-theme="light"] .profile-name {
  color: #222;
}

body[data-theme="light"] .profile-item {
  color: #555;
}

body[data-theme="light"] .profile-item:hover {
  background: #f0f0f0;
  color: #111;
}

body[data-theme="light"] .profile-divider {
  background: rgba(0,0,0,0.08);
}

body[data-theme="light"] .profile-badge {
  background: rgba(10,126,106,0.1);
  color: #0a7e6a;
  border-color: rgba(10,126,106,0.2);
}