:root {
  --base: #24273a;
  --mantle: #1e2030;
  --crust: #181926;
  --text: #cad3f5;
  --subtext: #a5adcb;
  --surface0: #363a4f;
  --surface1: #494d64;
  --surface2: #5b6078;
  --overlay: #6e738d;
  --lavender: #b7bdf8;
  --red: #ed8796;
  --blue: #8aadf4;
}

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

body {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--base), var(--mantle));
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 70px;
  background: var(--crust);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0;
  gap: 1.2rem;
  border-right: 1px solid var(--surface0);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
}

.sidebar a {
  color: var(--overlay);
  padding: 0.6rem;
  border-radius: 12px;
  transition: 0.2s;
}

.sidebar a:hover {
  background: var(--surface0);
  color: var(--lavender);
}

.sidebar a.active {
  background: linear-gradient(135deg, var(--red), var(--lavender));
  color: white;
}

.content {
  margin-left: 70px;
  width: calc(100% - 70px);
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.grid {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  background: var(--mantle);
  border-bottom: 1px solid var(--surface0);
}

#search {
  flex: 1;
  padding: 10px 14px;
  border-radius: 10px;
  border: none;
  background: var(--surface0);
  color: var(--text);
  outline: none;
  font-size: 14px;
  transition: 0.2s;
}

#search::placeholder {
  color: var(--subtext);
}

#search:focus {
  box-shadow: 0 0 0 2px var(--lavender);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
  padding: 20px;
  transition: opacity 0.25s ease;
}

.game-card {
  background: var(--surface0);
  border-radius: 14px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: 0.25s ease;
  border: 1px solid transparent;
  height: 220px;
}

.game-card:hover {
  transform: translateY(-6px);
  background: var(--surface1);
  border-color: var(--lavender);
  box-shadow: 0 0 15px rgba(183, 189, 248, 0.15);
}

.game-card img {
  width: 100%;
  border-radius: 10px;
  margin-bottom: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.game-card img.loaded {
  opacity: 1;
}

.game-card div {
  font-size: 14px;
  color: var(--text);
}

#gameContainer {
  position: fixed;
  inset: 0;
  background: var(--crust);
  display: none;
  flex-direction: column;
}

#gameHeader {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  border-bottom: 1px solid var(--surface0);
}


#gameContent {
  flex: 1;
}

iframe {
  width: 100%;
  height: 100%;
  border: none;
}