:root {
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;

  color-scheme: light dark;
  background-color: #fff;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;

  /* light theme variables */
  --color-text-light: #242424;
  --color-background-light: #fff;
  --color-background-icon-light: #f4f4f4;

  /* dark theme variables */
  --color-text-dark: #fff;
  --color-background-dark: #242424;
  --color-background-icon-dark: #454545;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.light-theme {
  --color-text: var(--color-text-light);
  --color-background: var(--color-background-light);
  --color-background-icon: var(--color-background-icon-light);
}

.dark-theme {
  --color-text: var(--color-text-dark);
  --color-background: var(--color-background-dark);
  --color-background-icon: var(--color-background-icon-dark);
}

.experience {
  position: fixed;
  width: 100vw;
  height: 100vh;
  z-index: -1;
}

.experience-canavas {
  width: 100%;
  height: 100%;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  padding: 10px 14px;
  z-index: 2;
}

.main-nav {
  display: flex;
  justify-content: flex-end; /* Posisi kanan */
  align-items: center;
}

.main-nav {
  flex-grow: 1;
  text-align: right;
}

.dark-theme #logo img {
  filter: brightness(0) invert(1);
}

.main-nav ul,
.side-nav ul {
  margin: 0;
  padding: 0;
}

.main-nav li,
.side-nav li {
  display: inline-block;
}

.side-nav li + li {
  margin-top: 10px;
}

.main-nav li a {
  color: var(--color-text);
  display: flex;
  text-decoration: none;
  padding: 8px 16px;
}

.main-nav2 a {
  color: var(--color-text);
  display: flex;
  text-decoration: none;
  padding: 8px 16px;
}

.main-nav li a svg {
  margin-right: 5px;
  fill: #ff0000;
}

.main-nav2 a svg {
  margin-right: 5px;
  fill: black;
}

.side-nav {
  position: fixed;
  bottom: 40px;
  right: 30px;
  writing-mode: vertical-rl;
  font-size: 14px;
  z-index: 2;
}

.side-nav li a,
.play-game-link {
  padding: 10px 8px;
  color: var(--color-text);
  display: inline-block;
  text-decoration: none;
  background-color: var(--color-background);
  position: relative;
}

.side-nav li > a::after,
.play-game-link ::after {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  width: calc(100% + 6px);
  height: calc(100% + 6px);
  border: 1px solid var(--color-background);
}

.side-nav li a svg {
  fill: var(--color-text);
}

.play-game-link {
  position: fixed;
  bottom: 50px;
  left: 30px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.play-game-link svg {
  transform: rotate(90deg);
  fill: var(--color-text);
}

.side-nav li:hover > a,
.side-nav li a:focus,
.play-game-link:hover,
.play-game-link:focus {
  opacity: 0.75;
}

.contact-menu {
  position: relative;
  margin-top: 24px;
}

.contact-menu__dropdown {
  position: absolute;
  bottom: 0;
  right: 56px;
  background-color: var(--color-background);
  border-radius: 8px;
  writing-mode: lr-tb;
  color: var(--color-text);
  padding: 20px;
  width: 300px;
  text-align: center;
  display: none;
  box-shadow: -2px 0 40px rgba(0, 0, 0, 0.1);
}

.contact-menu__dropdown--open {
  display: block;
}

.contact-menu__dropdown::before {
  content: '';
  position: absolute;
  bottom: 24px;
  left: 100%;
  border: 10px solid transparent;
  border-left-color: var(--color-background);
}

.contact-menu__dropdown > svg {
  fill: var(--color-text);
}

.side-nav .contact-menu__dropdown a {
  padding: 0;
  transition: all ease 0.2s;
}

.side-nav .contact-menu__dropdown a:hover {
  opacity: 0.8;
}

.contact-menu__dropdown .seperator {
  display: flex;
  align-items: center;
  padding: 16px 0;
}

#contact-email {
  display: flex;
  justify-content: center;
  align-items: center;
}

#contact-email span {
  margin-right: 4px;
}

.seperator .line {
  flex-grow: 1;
  border-bottom: 1px solid #eee;
}

.seperator .text {
  padding: 0 8px;
}

.social-icons li + li {
  margin-left: 8px;
}

.social-icons li a {
  background-color: var(--color-background-icon);
  border-radius: 50%;
  width: 35px;
  height: 35px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.social-icons li a svg {
  fill: var(--color-text);
}

.section--about {
  display: none;
}

#close-btn {
  position: fixed;
  bottom: 5%;
  left: calc(50% - 24px);
  fill: var(--color-text);
}

footer {
  position: fixed;
  bottom: 5px;
  left: 0;
  width: 100%;
  text-align: center;
  color: var(--color-text);
  font-size: 12px;
}

.cursor {
  width: 30px;
  height: 30px;
  margin-left: -15px;
  margin-top: -15px;
  border: 1px solid #fff;
  border-radius: 50%;
  z-index: 300;
  display: flex;
  justify-content: center;
  align-items: center;
}

.cursor-circle {
  width: 18px;
  height: 18px;
  background-color: #000;
  border-radius: 50%;
}

@media (max-width: 992px) {
  header {
    padding: 6px 12px;
  }

  #logo img {
    width: 50px;
    height: 50px;
  }

  .main-nav li a {
    padding: 6px 10px;
  }

  .side-nav {
    right: 22px;
  }

  footer {
    font-size: 10px;
  }
}

/* @media (prefers-color-scheme: light) {
  :root {
    color: #213547;
    background-color: #ffffff;
  }
  a:hover {
    color: #747bff;
  }
  button {
    background-color: #f9f9f9;
  }
} */

.dg.ac {
  z-index: 100 !important;
}

/* Loader */
#loader-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 200;
  background-color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader {
  width: 48px;
  height: 48px;
  margin: auto;
  position: relative;
}

.loader:before {
  content: '';
  width: 48px;
  height: 5px;
  background: #f0808050;
  position: absolute;
  top: 60px;
  left: 0;
  border-radius: 50%;
  animation: shadow324 0.5s linear infinite;
}

.loader:after {
  content: '';
  width: 100%;
  height: 100%;
  background: #f08080;
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 4px;
  animation: jump7456 0.5s linear infinite;
}

@keyframes jump7456 {
  15% {
    border-bottom-right-radius: 3px;
  }

  25% {
    transform: translateY(9px) rotate(22.5deg);
  }

  50% {
    transform: translateY(18px) scale(1, 0.9) rotate(45deg);
    border-bottom-right-radius: 40px;
  }

  75% {
    transform: translateY(9px) rotate(67.5deg);
  }

  100% {
    transform: translateY(0) rotate(90deg);
  }
}

@keyframes shadow324 {
  0%,
  100% {
    transform: scale(1, 1);
  }

  50% {
    transform: scale(1.2, 1);
  }
}

.social-links {
  display: flex;
  gap: 16px; /* Jarak antar ikon */
  list-style: none;
  padding: 0;
  margin: 0;
}

.social-links li {
  display: flex;
  align-items: center;
}

.social-links a {
  display: flex;
  align-items: center;
  text-decoration: none;
  font-size: 14px;
  color: inherit; /* Warna teks mengikuti tema */
}

.social-links svg {
  margin-right: 8px; /* Jarak antara ikon dan teks */
}

.social-links li a svg {
  fill: black; /* Pastikan warna logo GitHub hitam */
}

.social-links li:first-child a svg {
  fill: red; /* Pastikan warna logo Instagram merah */
}

/* Consistent Color Scheme Game Modal Styles */
.modal {
  position: fixed;
  z-index: 1000;
  inset: 0;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
  margin: 0;
  padding: 40px;
  border: 2px solid #ffffff;
  inline-size: 90%;
  max-inline-size: 800px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  color: #ffffff;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-content h2 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 2.2em;
  color: #ffffff;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.close {
  color: #ffffff;
  float: inline-end;
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  position: absolute;
  top: 15px;
  right: 20px;
}

.close:hover,
.close:focus {
  color: #ff0000;
  transform: scale(1.2);
  text-decoration: none;
}

.game-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.game-item {
  background: #000000;
  border: 1px solid #ffffff;
  border-radius: 10px;
  padding: 25px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.game-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, #ffffff20, transparent);
  transition: left 0.5s;
}

.game-item:hover::before {
  left: 100%;
}

.game-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(255, 0, 0, 0.3);
  border-color: #ff0000;
}

.game-item h3 {
  margin: 0 0 10px 0;
  font-size: 1.3em;
  color: #ffffff;
}

.game-item p {
  margin: 0;
  color: #cccccc;
  font-size: 0.9em;
}

.game-item .genre-tag {
  display: inline-block;
  background: #0066ff;
  color: #ffffff;
  padding: 5px 12px;
  border-radius: 15px;
  font-size: 0.8em;
  margin-top: 10px;
}

.game-item:hover .genre-tag {
  background: #00cc00;
}

/* Enhanced animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

/* Loading and error states with consistent color scheme */
.loading-games,
.no-games,
.error-message {
  text-align: center;
  padding: 40px;
  color: #ffffff;
}

.loading-games {
  position: relative;
  overflow: hidden;
  color: #ffffff;
  font-size: 1.2em;
}

.loading-games::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, #ffffff30, transparent);
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
}

.error-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  color: #ffffff;
}

.retry-btn {
  background: #ff0000;
  color: #ffffff;
  border: 1px solid #ffffff;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.retry-btn:hover {
  background: #00cc00;
  transform: scale(1.05);
  border-color: #00cc00;
}

@media (max-width: 768px) {
  .modal-content {
    padding: 20px;
    inline-size: 95%;
  }
  
  .game-list {
    grid-template-columns: 1fr;
  }
  
  .modal-content h2 {
    font-size: 2em;
  }
}

/* Search Button Styles */
.search-btn {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: var(--color-background);
  border: 1px solid var(--color-text);
  border-radius: 50%;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-btn:hover {
  transform: translateX(-50%) scale(1.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.search-btn svg {
  fill: var(--color-text);
}

/* Music Toggle Button - repositioned next to play game */
.music-toggle-bottom {
  position: fixed;
  bottom: 50px;
  left: 30px;
  z-index: 100;
  background: var(--color-background);
  border: 1px solid var(--color-text);
  border-radius: 50%;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-left: 60px; /* Space from play game button */
}

.music-toggle-bottom:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.music-toggle-bottom svg {
  fill: var(--color-text);
  transition: all 0.3s ease;
}

.music-toggle-bottom.playing {
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
  border-color: transparent;
}

.music-toggle-bottom.playing svg {
  fill: white;
}

@media (max-width: 768px) {
  .search-btn {
    top: 15px;
    width: 40px;
    height: 40px;
  }
  
  .music-toggle-bottom {
    bottom: 45px;
    left: 25px;
    width: 40px;
    height: 40px;
    margin-left: 50px;
  }
  
  .music-toggle-bottom svg {
    width: 18px;
    height: 18px;
  }
}
