/* -------------------------------- */
/* BASIS STYLING                    */
/* -------------------------------- */

:root {
  --bg: #050816;
  --card: #0f172a;
  --accent: #facc15;
  --text: #f5f5f5;
  --muted: #9ca3af;
  --radius: 16px;
}

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: radial-gradient(circle at top, #1f2937, #050816);
  color: var(--text);
}

/* -------------------------------- */
/* HEADER                           */
/* -------------------------------- */

.header {
  text-align: center;
  padding: 40px 20px 20px;
}

.header h1 {
  font-size: 2.8rem;
  margin: 0;
}

.header p {
  color: var(--muted);
  margin-top: 8px;
}

/* -------------------------------- */
/* GAME GRID                        */
/* -------------------------------- */

.games-grid {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.game-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform .2s ease, box-shadow .2s ease;
}

.game-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(0,0,0,0.45);
}

.game-thumb {
  width: 100%;
  height: 150px;
  border-radius: var(--radius);
  background-size: cover;
  background-position: center;
  margin-bottom: 12px;
}

/* Thumbnails */
.game-thumb.gd { background-image: url("images/gddash.png"); }
.game-thumb.poly { background-image: url("images/polytrack.png"); }
.game-thumb.space { background-image: url("images/spacewaves.png"); }
.game-thumb.slow { background-image: url("images/slowroads.png"); }
.game-thumb.wl { background-image: url("images/wheelielife.png"); }
.game-thumb.ss { background-image: url("images/ssthumb.png"); }
.game-thumb.rg { background-image: url("images/rocketgoal.png"); }
.game-thumb.s3 { background-image: url("images/slope3.png"); }
.game-thumb.mc { background-image: url("images/mcc.png"); }
.game-thumb.gc { background-image: url("images/gc.png"); }

/* -------------------------------- */
/* FOOTER                           */
/* -------------------------------- */

.footer {
  text-align: center;
  padding: 20px;
  color: var(--muted);
}

/* -------------------------------- */
/* LOADER                           */
/* -------------------------------- */

#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0d0d0d;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: fadeOut 1s ease forwards;
  animation-delay: 2.5s;
}

#loader-box h1 {
  color: white;
  font-size: 2.5rem;
  opacity: 0;
  animation: fadeIn 1s ease forwards;
}

/* Animaties */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
  to { opacity: 0; visibility: hidden; }
}

/* -------------------------------- */
/* CHAT SYSTEM                      */
/* -------------------------------- */

/* Chat container */
#chatSidebar {
  position: fixed;
  right: 0;
  bottom: 0;
  width: 320px;
  height: 420px;
  background: #111;
  color: white;
  padding: 10px;
  border-radius: 12px 0 0 0;
  border: 2px solid #333;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: transform 0.3s ease;
  z-index: 9998;
}

/* Chat dicht */
#chatSidebar.closed {
  transform: translateX(100%);
}

/* Toggle knop vast aan chat */
#chatToggle {
  position: fixed;
  right: 320px;
  bottom: 0;
  padding: 12px 18px;
  background: #333;
  color: white;
  border: none;
  border-radius: 12px 0 0 0;
  cursor: pointer;
  z-index: 9999;
  transition: 0.3s ease;
}

/* Als chat dicht is → knop schuift mee */
#chatSidebar.closed + #chatToggle {
  right: 0;
}

/* Chat header */
#chatHeader {
  font-size: 20px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 10px;
}

/* Berichten */
#messages {
  flex: 1;
  overflow-y: auto;
  background: #222;
  padding: 10px;
  border-radius: 6px;
}

#messages div {
  background: #333;
  padding: 6px;
  border-radius: 4px;
  margin-bottom: 8px;
}

/* Inputs */
#msgInput,
#nameInput {
  width: 100%;
  padding: 8px;
  margin-top: 10px;
  border: none;
  border-radius: 6px;
}

/* -------------------------------- */
/* RESPONSIVE                       */
/* -------------------------------- */

@media (max-width: 1100px) {
  #chatSidebar {
    width: 260px;
    height: 380px;
  }
  #chatToggle {
    right: 260px;
  }
}

@media (max-width: 700px) {
  #chatSidebar {
    width: 100%;
    height: 260px;
    border-radius: 0;
  }
  #chatToggle {
    right: 0;
    bottom: 260px;
    border-radius: 0;
  }
}

