/* ==========================================
   Global Reset & Layout
   ========================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  background-color: var(--main-bg);
  color: var(--text-color);
  height: 100%;
  display: flex;
  flex-direction: column;
  cursor: url('cursor.png') 4 4, auto;
}

/* ==========================================
   Links
   ========================================== */
a, a:visited {
  color: var(--link-color);
  text-decoration: none;
}
a:focus { outline: none; }

/* ==========================================
   Header & Navigation
   ========================================== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--header-bg);
  padding: 10px 20px;
  width: 100%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  z-index: 1000;
}

header a, footer a {
  margin: 0 10px;
  color: var(--link-color);
  font-family: monospace;
  font-weight: bold;
  text-decoration: none;
  transition: color 0.3s, text-decoration 0.3s;
}
header a:hover, footer a:hover {
  color: var(--accent-color);
  text-decoration: underline;
  text-decoration-color: var(--accent-color);
}

header img {
  width: 28px;
  height: 28px;
  object-fit: cover;
}

/* Nav + Pages controls */
.nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================
   Page Controls (Restored to Old Look)
   ========================================== */
.pages-anchor {
  display: inline-flex;       /* keep in row but not block */
  align-items: center;        /* center arrows + number */
  gap: 8px;
  margin-left: 10px;
}

.pages-anchor button {
  background: transparent;    /* no background */
  border: none;               /* remove default border */
  border-radius: 0;           /* sharp edges */
  padding: 0;                 /* no extra spacing */
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pages-anchor button img {
  width: 28px;                /* match old arrow size */
  height: 28px;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.pages-anchor button:hover img {
  transform: scale(1.2);      /* same zoom on hover */
}

.pages-anchor .page-indicator {
  font-weight: bold;
  font-size: 0.9rem;          /* match old link scale */
  color: var(--link-color);   /* same text color */
  font-family: monospace;
  line-height: 1;
  user-select: none;
}

/* ==========================================
   Profile & Dashboard
   ========================================== */
#pfp {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.25s ease;
  object-fit: cover;
}
#pfp:hover { transform: scale(1.1); }

#dashboardBtn {
  width: 36px;
  background: none;
  border: none;
  color: var(--link-color);
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.25s ease;
}
#dashboardBtn:hover { transform: scale(1.1); }

/* Dashboard Menu */
.dashboard-menu {
  position: fixed;
  top: 60px;
  right: 20px;
  background: var(--menu-bg);
  border-radius: 10px;
  display: none;
  flex-direction: column;
  min-width: 200px;
  padding: 10px 0;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.dashboard-menu a {
  padding: 10px 16px;
  color: var(--link-color);
  font-family: monospace;
  text-decoration: none;
  display: block;
  transition: color 0.3s, background 0.3s;
}
.dashboard-menu a:hover {
  color: var(--accent-color);
  background: rgba(255,255,255,0.1);
}

/* ==========================================
   Search Bar
   ========================================== */
.search-box {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--input-bg);
  border-radius: 25px;
  padding: 4px 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  transition: box-shadow 0.2s;
}
.search-box:focus-within { box-shadow: 0 4px 12px rgba(0,0,0,0.25); }

.search-box input {
  padding: 6px;
  border: none;
  background: transparent;
  color: var(--input-text);
  font-family: monospace;
  font-size: 14px;
  flex: 1;
}
.search-box input::placeholder { color: var(--input-placeholder); }

.search-box button {
  padding: 6px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: var(--search-btn-bg);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, filter 0.2s;
}
.search-box button:hover { transform: scale(1.1); filter: brightness(1.2); }
.search-box button img { width: 14px; height: 14px; }

/* Search feedback + error (Restored) */
.search-error {
  display: none;
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #ff4d4d;
  color: #fff;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 14px;
  z-index: 1000;
}
#searchFeedback {
  display: none;
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  text-align: center;
}
#searchFeedback img {
  max-height: 120px;
  border-radius: 8px;
}
/* Remove focus borders from search input */
.search-box input:focus {
  outline: none;
  border: none;
  box-shadow: none;
}

/* ==========================================
   Grid Layout
   ========================================== */

#container,
#container-discov {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  justify-items: center;
  gap: 20px;
  padding: 20px;
  background-color: var(--main-bg);
  min-height: calc(100vh - 120px);
  flex-grow: 1;
}

/* ==========================================
   Game Cards
   ========================================== */
#container div,
#container-discov div {
  width: 220px;
  min-height: 190px;
  background: var(--card-bg);
  text-align: center;
  border-radius: 15%;
  padding: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  transition: transform 0.2s ease;
}

#container div:hover,
#container-discov div:hover {
  transform: scale(1.03);
}

/* Image hover scale reduced (~75% less than before) */
#container div img,
#container-discov div img {
  width: 60%;
  max-width: 144px;
  height: auto;
  display: block;
  margin: 0 auto 8px;
  border-radius: 12%;
  transition: transform 0.3s ease;
}

#container div img:hover,
#container-discov div img:hover {
  transform: scale(1.05); /* smooth zoom only, no shadow */
}

.game-card {
  position: relative;
  display: inline-block;
  overflow: hidden;
}

.status-overlay {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 80px; /* adjust size as you want */
  height: auto;
  z-index: 2;
  pointer-events: none;
}

.status-overlay.fixed {
  top: 5px;
  right: 5px;
  left: auto;
}

/* ==========================================
   Card Text
   ========================================== */
#container div h3,
#container div p,
#container-discov div h3,
#container-discov div p {
  color: var(--link-color);
  font-family: monospace;
  font-size: 0.9rem;
  transition: color 0.3s, text-decoration 0.3s;
}
#container div h3:hover,
#container div p:hover,
#container-discov div h3:hover,
#container-discov div p:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

/* ==========================================
   Status Effects
   ========================================== */
.soon {
  opacity: 0.55;
  pointer-events: none;
  filter: grayscale(100%);
}
.soon::after {
  content: "COMING SOON";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 14px;
  font-weight: bold;
  text-shadow: 0 0 5px #000;
}
.ok:hover {
  border: 2px solid var(--status-ok-border);
  box-shadow: 0 0 8px var(--status-ok-border);
}
.FIX:hover, .soon:hover {
  border: 2px solid var(--status-fix-border);
  box-shadow: 0 0 8px var(--status-fix-border);
}
.FIX img { filter: invert(100%); opacity: 0.7; }
.soon img { filter: grayscale(100%); opacity: 0.7; }
.FIX::after {
  content: url('images/status/progress.jpeg');
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.8;
  width: 48px;
  height: 48px;
  pointer-events: none;
}

/* ==========================================
   Utility Elements
   ========================================== */
embed {
  display: block;
  width: 100%;
  height: 100%;
  border: none;
  position: absolute;
  top: 0;
  left: 0;
}

/* Back to Top */
#toTopBtn {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  padding: 10px 16px;
  font-size: 14px;
  font-family: monospace;
  border: none;
  border-radius: 8px;
  background: var(--header-bg);
  color: var(--link-color);
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,0.5);
  opacity: 0.6;
  transition: opacity 0.3s, color 0.3s;
}
#toTopBtn:hover {
  opacity: 0.8;
  color: var(--accent-color);
  text-decoration: underline;
}

/* Footer */
footer {
  margin-top: auto;
  background: var(--footer-bg);
  text-align: center;
  padding: 30px;
  width: 100%;
  font-family: monospace;
  color: var(--link-color);
  box-shadow: 0 -2px 6px rgba(0,0,0,0.2);
}

/*=========================
Preloader progress visuals 
============================*/
.load-progress-text {
  font-family: monospace;
  color: white;
  text-align: center;
  margin-top: 10px;
}

.load-progress-bar {
  width: 80%;
  height: 8px;
  margin: 10px auto;
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
  overflow: hidden;
}

.load-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #00ffff, #ff00ff);
  transition: width 0.3s ease;
}
/* ============================================================
   SORT MODE TOGGLE STYLES
   ============================================================ */
.theme-buttons-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.theme-btn {
  padding: 10px 16px;
  border: 2px solid var(--accent-color);
  background: var(--header-bg);
  color: var(--text-color);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-btn:hover {
  transform: scale(1.05);
  background: var(--accent-color);
  color: #fff;
}

.theme-btn.active {
  background: var(--accent-color);
  color: #fff;
  box-shadow: 0 0 10px var(--accent-color);
}
