/* RESET & BASICS */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  width: 100vw;
  font-family: "Nunito", system-ui, sans-serif;
  background-color: #0f1117;
  color: #edf2f4;
}

:root {
  --bg: #0f1117;
  --surface: #1a1d26;
  --surface-hover: #232733;
  --border: #2c3140;
  --text: #edf2f4;
  --muted: #9aa4b2;
  --accent: #f7c16f;
  --accent-dark: #cc7d06;
  --radius: 14px;
  --card-width: 220px;
  --card-height: 180px;
  --topbar-height: 64px;
}

/* TOP BAR */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.logo-area img {
  width: 200px;
}

.topbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.topbar-center input {
  width: 100%;
  max-width: 420px;
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background-color: var(--bg);
  color: var(--text);
}

.topbar-center input::placeholder {
  color: var(--muted);
}

.topbar-right {
  display: flex;
  gap: 1rem;
}

.topbar-right button{
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
  height: 100%;
    background: transparent;
    border: 0px;

}

.topbar-right button:hover {
  color: var(--accent);
}


/* LAYOUT */
.layout {
  display: flex;
  min-height: 100vh;
  padding-top: 64px;
}

/* SIDEBAR */
.sidebar {
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  background: var(--surface);
  border-right: 2px solid var(--border);
  padding: 1rem;
  width: 200px;
}

.game-categories {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.game-categories button {
  background: transparent;
  border: none;
  color: var(--muted);
  text-align: left;
  padding: 0.6rem 0.8rem;
  width: 200%;
  border-radius: 10px;
  font-weight: 900;
  cursor: pointer;
}

.game-categories button:hover {
  background: rgba(255,255,255,0.06);
  transform: translateX(4px);
}

.game-categories button.active {
  background: var(--bg);
    border: 0px solid var(--border);
  color: var(--accent);
}

/* MAIN CONTENT */
.main-content {
  flex: 1;
  padding-left: 1rem;
  overflow: auto;
}

/* CARDS (same size for grid and rows) */
.card {
  width: var(--card-width);
  height: var(--card-height);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: flex-end; /* text at bottom */
  color: var(--text);
  background-color: var(--surface); /* fallback if image fails */
  cursor: pointer;
  transition: transform 0.15s ease;
}

.card-bg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
  transition: transform 0.3s ease;
box-shadow: inset 0 -40px 12px -6px rgba(0, 0, 0, 0.614);
}

.card-overlay {
  position: relative;
  z-index: 1;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.card:hover .card-bg {
  transform: scale(1.05);
}

.game-title {
    position: absolute;
    white-space: nowrap;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text);
    left: 8px;      /* small padding from left */
  bottom: -15px;
}

.game-desc {
  font-size: 0.8rem;
  color: var(--muted);
}


.card:hover {
  transform: translateY(-4px) rotate(-0.4deg);
}

.card:nth-child(3n):hover {
  transform: translateY(-4px) rotate(0.6deg);
}

/* GRID */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--card-width), 1fr));
  gap: 1rem;
}

/* HORIZONTAL ROWS */
.genre-row {
  margin-bottom: 2rem;
}

.genre-row h3 {
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}

.row-wrapper {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 10px 0;
}

.row-games {
  display: flex;
  gap: 0.75rem;
  transition: transform 0.3s ease;
}

/* Arrows for horizontal scroll */
.row-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: calc(100% - 20px);
  width: 75px;
  color: var(--accent);
  font-weight: 900;
  cursor: pointer;
  z-index: 10;
  background-color: rgba(0, 0, 0, 0.781);
  border: 0px;
}

.row-arrow.prev {
  left: 0;
}

.row-arrow.next {
  right: 0;
}

.selected{
  color:var(--accent) !important;
}
/* From Uiverse.io by elijahgummer */ 
.random {
  touch-action: manipulation;
  display: inline-block;
  outline: none;
  font-family: inherit;
  font-size: 1em;
  box-sizing: border-box;
  border: none;
  border-radius: 0.3em;
  height: 2.75em;
  line-height: 2.5em;
  text-transform: uppercase;
  padding: 0 1em;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(110, 80, 20, 0.4),
    inset 0 -2px 5px 1px rgba(139, 66, 8, 1),
    inset 0 -1px 1px 3px rgba(250, 227, 133, 1);
  background-image: linear-gradient(
    160deg,
    #a54e07,
    #b47e11,
    #fef1a2,
    #bc881b,
    #a54e07
  );
  border: 1px solid #a55d07;
  color: rgb(120, 50, 5);
  text-shadow: 0 2px 2px rgba(250, 227, 133, 1);
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  background-size: 100% 100%;
  background-position: center;
}

.random:focus,
.random:hover {
  background-size: 150% 150%;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23),
    inset 0 -2px 5px 1px #b17d10, inset 0 -1px 1px 3px rgba(250, 227, 133, 1);
  border: 1px solid rgba(165, 93, 7, 0.6);
  color: rgba(120, 50, 5, 0.8);
}

.random:active {
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(110, 80, 20, 0.4),
    inset 0 -2px 5px 1px #b17d10, inset 0 -1px 1px 3px rgba(250, 227, 133, 1);
}
