@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Space+Grotesk:wght@500;700&display=swap');

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

:root {
  --sky-top:    #5558c8;
  --sky-mid:    #7b7ee8;
  --sky-bot:    #b8baff;
  --accent:     #ffc575;   /* Wild West gold */
  --accent2:    #ffd900;   /* Hot Dog yellow */
  --card-bg:    rgba(255, 255, 255, 0.12);
  --card-border: rgba(255, 255, 255, 0.3);
  --text:       #ffffff;
  --muted:      rgba(255, 255, 255, 0.6);
  --shadow:     rgba(60, 55, 150, 0.4);
}

html { scroll-behavior: smooth; }

/* ── Sky Background ── */
body {
  font-family: 'Inter', sans-serif;
  color: var(--text);
  min-height: 100vh;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 45%, var(--sky-bot) 100%);
  background-attachment: fixed;
  position: relative;
  overflow-x: hidden;
}

/* Cloud layer container */
.sky {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 50px;
  filter: blur(2px);
}

.cloud::before,
.cloud::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 50%;
}

/* Cloud 1 */
.cloud-1 {
  width: 180px; height: 40px;
  top: 10%;
  animation: drift1 55s linear infinite;
}
.cloud-1::before { width: 80px; height: 65px; top: -35px; left: 25px; }
.cloud-1::after  { width: 55px; height: 50px; top: -25px; left: 80px; }

/* Cloud 2 */
.cloud-2 {
  width: 130px; height: 30px;
  top: 22%;
  opacity: 0.55;
  animation: drift2 80s linear infinite;
}
.cloud-2::before { width: 60px; height: 50px; top: -28px; left: 15px; }
.cloud-2::after  { width: 45px; height: 38px; top: -18px; left: 60px; }

/* Cloud 3 */
.cloud-3 {
  width: 220px; height: 50px;
  top: 38%;
  opacity: 0.45;
  animation: drift3 95s linear infinite;
}
.cloud-3::before { width: 90px; height: 75px; top: -42px; left: 30px; }
.cloud-3::after  { width: 70px; height: 58px; top: -30px; left: 110px; }

/* Cloud 4 */
.cloud-4 {
  width: 100px; height: 25px;
  top: 55%;
  opacity: 0.35;
  animation: drift1 70s linear infinite reverse;
  animation-delay: -20s;
}
.cloud-4::before { width: 45px; height: 40px; top: -22px; left: 12px; }
.cloud-4::after  { width: 35px; height: 30px; top: -14px; left: 48px; }

/* Cloud 5 */
.cloud-5 {
  width: 160px; height: 35px;
  top: 68%;
  opacity: 0.3;
  animation: drift2 110s linear infinite;
  animation-delay: -35s;
}
.cloud-5::before { width: 70px; height: 58px; top: -32px; left: 20px; }
.cloud-5::after  { width: 52px; height: 44px; top: -22px; left: 78px; }

@keyframes drift1 {
  from { transform: translateX(-300px); }
  to   { transform: translateX(110vw);  }
}
@keyframes drift2 {
  from { transform: translateX(110vw);  }
  to   { transform: translateX(-300px); }
}
@keyframes drift3 {
  from { transform: translateX(-400px); }
  to   { transform: translateX(110vw);  }
}

/* Everything above z-index 0 sits above the sky */
header, .hero, main, footer, .resources-hero {
  position: relative;
  z-index: 1;
}

/* ── Header ── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2.5rem;
  background: rgba(85, 88, 200, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.2);
}

.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.logo span {
  color: var(--accent);
}

nav {
  display: flex;
  gap: 0.25rem;
}

nav a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

nav a:hover {
  color: #fff;
  background: rgba(255,255,255,0.15);
}

nav a.active {
  color: #fff;
  background: rgba(255,255,255,0.22);
}

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 4.5rem 1.5rem 3rem;
}

.hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #fff;
  text-shadow: 0 2px 20px rgba(60,55,150,0.5);
  margin-bottom: 0.75rem;
}

.hero h1 span {
  color: var(--accent);
}

.hero p {
  color: rgba(255,255,255,0.75);
  font-size: 1rem;
  max-width: 440px;
  margin: 0 auto;
}

/* ── Games Grid ── */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.75rem;
}

.game-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

.game-card:hover {
  border-color: rgba(255, 197, 117, 0.6);
  box-shadow: 0 0 36px rgba(255,197,117,0.2), 0 12px 32px var(--shadow);
  transform: translateY(-4px);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.1rem;
  background: rgba(0,0,0,0.15);
  border-bottom: 1px solid rgba(255,255,255,0.15);
  cursor: pointer;
}

.card-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  flex-shrink: 0;
}

.card-header h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
}

.expand-hint {
  margin-left: auto;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
  opacity: 0;
  transition: opacity 0.2s;
}

.game-card:hover .expand-hint {
  opacity: 1;
}

.embed-wrapper {
  position: relative;
}

.embed-shield {
  position: absolute;
  inset: 0;
  cursor: pointer;
}

.game-embed {
  width: 100%;
  height: 460px;
  border: none;
  display: block;
  background: #05050f;
}

.embed-placeholder {
  width: 100%;
  height: 460px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.2);
  color: rgba(255,255,255,0.4);
  font-size: 0.85rem;
  gap: 0.75rem;
}

.embed-placeholder .icon {
  font-size: 2.5rem;
  opacity: 0.4;
}

/* ── Modal ── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal.open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(40, 38, 120, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease;
}

.modal-content {
  position: relative;
  z-index: 1;
  width: min(92vw, 1000px);
  height: min(88vh, 700px);
  background: rgba(100, 103, 220, 0.25);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 60px rgba(255,197,117,0.15), 0 24px 64px rgba(40,38,120,0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: popIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(0,0,0,0.2);
  border-bottom: 1px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
}

.modal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}

.modal-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}

.modal-close:hover {
  color: #fff;
  background: rgba(255,255,255,0.12);
}

.modal-embed {
  width: 100%;
  flex: 1;
  border: none;
  display: block;
}

/* ── Resources page ── */
.resources-hero {
  text-align: center;
  padding: 4.5rem 1.5rem 3rem;
}

.resources-hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
  text-shadow: 0 2px 20px rgba(60,55,150,0.5);
  margin-bottom: 0.75rem;
}

.resources-hero p {
  color: rgba(255,255,255,0.75);
  font-size: 1rem;
  max-width: 480px;
  margin: 0 auto;
}

.resources-empty {
  max-width: 480px;
  margin: 0 auto;
  background: var(--card-bg);
  border: 1px dashed rgba(255,255,255,0.3);
  border-radius: 14px;
  padding: 3.5rem 2rem;
  text-align: center;
  color: rgba(255,255,255,0.5);
  backdrop-filter: blur(8px);
}

.resources-empty .icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 1rem;
  opacity: 0.6;
}

.resources-empty p {
  font-size: 0.9rem;
  line-height: 1.6;
}

.resources-list {
  max-width: 700px;
  margin: 0 auto;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.resources-list a {
  color: #fff;
  text-decoration: none;
  padding: 0.85rem 1.1rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  backdrop-filter: blur(8px);
  transition: border-color 0.2s, background 0.2s;
}

.resources-list a:hover {
  border-color: rgba(255,197,117,0.6);
  background: rgba(255,255,255,0.18);
}

/* ── Footer ── */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  color: rgba(255,255,255,0.35);
  font-size: 0.8rem;
  border-top: 1px solid rgba(255,255,255,0.15);
}

/* ── Animations ── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.93); }
  to   { opacity: 1; transform: scale(1); }
}
