/* Base layout */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: repeating-linear-gradient(
    -45deg,
    #121212,
    #121212 10px,
    #111 10px,
    #111 20px
  );
  background-attachment: fixed;
  background-size: cover;
  color: white;
  font-family: 'Outfit', sans-serif;
}


body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #161616;
  padding: 20px 40px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
}

.logo img {
  height: 40px;
  margin-right: 10px;
  border-radius: 50%;
}

nav {
  display: flex;
  flex-wrap: wrap;
  margin-top: 10px;
}

nav a {
  color: #aaa;
  text-decoration: none;
  margin-left: 20px;
  font-weight: 500;
  transition: 0.2s ease;
}

nav a:hover {
  color: #fff;
}

nav a.active {
  color: #ffffff;
  font-weight: 600;
  border-bottom: 2px solid #8a64ff;
}

/* Home and shared containers */
.main, .container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
}

.container h1 {
  font-size: 48px;
  margin-bottom: 30px;
  font-weight: 800;
  background: linear-gradient(to right, #8a64ff, #7cf4f4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Discord login button */
.discord-login-btn {
  background-color: #5865f2;
  border: none;
  color: white;
  font-size: 18px;
  padding: 14px 28px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 20px rgba(88, 101, 242, 0.5);
  min-width: 260px;
  height: 48px;
}

.discord-login-btn:hover {
  background-color: #4752c4;
  box-shadow: 0 0 30px rgba(88, 101, 242, 0.8);
}

.discord-icon {
  width: 28px;
  height: 28px;
}

/* Shared button + username */
.username {
  margin-top: 40px;
  font-size: 16px;
  color: #777;
}

.signout-btn {
  margin-top: 15px;
  font-size: 14px;
  background: none;
  border: 1px solid #8a64ff;
  color: #8a64ff;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s ease;
}

.signout-btn:hover {
  background: #8a64ff;
  color: white;
}

/* === Avatar Catalog Styles === */
.catalog-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
}

.catalog-page h1 {
  text-align: center;
  margin-bottom: 20px;
  font-weight: 800;
}

.form-container {
  width: 100%;
  max-width: 500px;
  background: #161616;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 40px;
}

label {
  display: block;
  margin-top: 15px;
  font-weight: 600;
}

input {
  width: 100%;
  padding: 10px;
  margin-top: 5px;
  background: #2a2a2a;
  color: white;
  border: none;
  border-radius: 6px;
}

button {
  margin-top: 20px;
  padding: 12px 20px;
  background: #8a64ff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s;
}

button:hover {
  background: #a57cff;
}

.avatars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  width: 100%;
  max-width: 1000px;
}

.avatar-card {
  background: #1b1b1b;
  border-radius: 10px;
  padding: 15px;
  text-align: center;
}

.avatar-card img {
  width: 140px;
  height: 140px;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 10px;
  background: #000;
}

.platform {
  font-weight: 600;
  font-size: 14px;
  color: #8a64ff;
}

.username {
  font-size: 14px;
  margin-top: 4px;
  color: #ccc;
}

.submitted {
  font-size: 12px;
  color: #777;
  margin-top: 6px;
}

/* === Game Wheel Styles === */
.wheel-page {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
}

.wheel-page h1 {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 30px;
  background: linear-gradient(to right, #8a64ff, #7cf4f4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.input-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

#gameInput {
  width: 260px;
  max-width: 90vw;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 16px;
  background: #1e1e1e;
  border: 1px solid #888;
  color: white;
  outline: none;
}

.wheel-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-top: 30px;
}

#wheel-canvas {
  border-radius: 50%;
  background: #222;
  box-shadow: 0 0 30px rgba(138, 100, 255, 0.4);
  cursor: pointer;
}

.selected-game {
  margin-top: 20px;
  font-size: 18px;
  color: #ccc;
  font-weight: 600;
}

.keep-remove {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

/* Responsive */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
  }

  nav {
    margin-top: 10px;
    flex-direction: column;
  }

  nav a {
    margin: 10px 0 0 0;
  }

  .main h1,
  .container h1,
  .wheel-page h1 {
    font-size: 32px;
  }

  .main p {
    font-size: 18px;
  }

  .form-container {
    max-width: 90%;
  }

  #wheel-canvas {
    width: 280px;
    height: 280px;
  }

  .input-row {
    flex-direction: column;
    gap: 10px;
  }

  #gameInput {
    width: 100%;
  }

  button {
    width: 100%;
  }

  .combined-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #1c1c1c;
    border-radius: 10px;
    max-width: 300px;
    margin: auto;
  }

  .avatar-platform {
    text-align: center;
  }

  .avatar-platform img {
    width: 120px;
    height: auto;
    border-radius: 8px;
  }

  .loader {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 40px 0;
  }

  .loader .spinner {
    border: 6px solid rgba(255, 255, 255, 0.1);
    border-top: 6px solid #9a6bff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 0.9s linear infinite;
  }

  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }

}
