:root {
  --bg-a: #140826;
  --bg-b: #32125f;
  --bg-c: #4a1f86;
  --panel: rgba(38, 16, 67, 0.82);
  --line: rgba(212, 169, 255, 0.5);
  --text: #f8f2ff;
  --muted: #e1ccff;
  --accent: #ce95ff;
  --glow: rgba(210, 145, 255, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, #7f43de 0%, transparent 28%),
    radial-gradient(circle at 90% 78%, #5f2fb7 0%, transparent 34%),
    linear-gradient(160deg, var(--bg-a), var(--bg-b), var(--bg-c));
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

body::before {
  top: -120px;
  right: -120px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 168, 239, 0.24), transparent 65%);
}

body::after {
  bottom: -140px;
  left: -120px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(150, 224, 255, 0.18), transparent 66%);
}

.gate-wrap,
.hub-wrap {
  width: min(980px, 92vw);
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  z-index: 1;
  padding: 26px 0 28px;
}

.gate-wrap {
  display: grid;
  place-items: center;
}

.hub-wrap {
  display: block;
}

.gate-card {
  width: min(430px, 92vw);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(4px);
}

.gate-card h1 {
  margin: 0 0 8px;
}

.gate-card p {
  margin: 0 0 14px;
  color: var(--muted);
}

.gate-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.gate-form input,
.gate-form button,
.logout {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  font-size: 1rem;
}

.gate-form input {
  background: rgba(43, 18, 77, 0.9);
  color: var(--text);
}

.gate-form button,
.logout {
  color: #2d0b56;
  background: var(--accent);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.message {
  min-height: 1.2em;
  margin-top: 10px;
  color: #ffb6b6;
}

.hub-header {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.hub-header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 2.6vw, 2.4rem);
  text-shadow: 0 0 18px var(--glow);
}

.hub-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.game-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 14px;
  align-items: start;
}

.game-card {
  text-decoration: none;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  min-height: 180px;
  display: block;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.game-card:hover {
  border-color: rgba(228, 196, 255, 0.95);
  transform: translateY(-2px);
}

.card-image {
  display: block;
  width: 100%;
  height: 122px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(217, 174, 255, 0.45);
  margin-bottom: 10px;
}

.preview-image {
  height: 165px;
}

.game-card h2 {
  margin: 0 0 8px;
}

.game-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.game-preview-card {
  min-height: 270px;
}

.coming-soon {
  opacity: 0.82;
}

@media (max-width: 520px) {
  .gate-form {
    grid-template-columns: 1fr;
  }

  .hub-wrap {
    padding-top: 18px;
  }

  .hub-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .card-image {
    height: 108px;
  }

  .preview-image {
    height: 140px;
  }
}
