@import url('https://fonts.googleapis.com/css2?family=Merriweather+Sans:wght@300;400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');

/* 1. Base Variables (Default Theme) */
:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --accent-color: #007bff;
    --font-main: 'Arial', sans-serif;
    --button-radius: 8px;
}

/* 2. Structural Layout */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    margin: 0;
    padding: 0;
}

.game-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
}

.game-info p {
  font-size: 1.125rem;
  line-height: 1.6;
  margin-bottom: 24px;
}

.cover-image {
    width: 100%;
    border-radius: 12px;
}

/* Update the grid container */
.gallery {
    display: grid;
    /* Base columns of roughly 250px */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    /* Allow rows to size themselves automatically based on content */
    grid-auto-rows: auto; 
    gap: 16px;
    margin-top: 40px;
    /* Optional: helps pack uneven grid items tightly without blank gaps */
    grid-auto-flow: dense; 
}

/* Default standard item (16:9 look) */
.gallery-item {
    margin: 0;
    border-radius: var(--button-radius);
    overflow: hidden;
    /* Makes standard cells always perfect 16:9 rectangles */
    aspect-ratio: 16 / 9; 
}

/* Span modifier for ultrawide screenshots */
.gallery-item.wide {
    grid-column: span 2;
    aspect-ratio: 32 / 9; /* Twice as wide */
}

/* Span modifier for vertical portraits */
.gallery-item.tall43 {
    grid-row: span 2;
    /* Overrides the 16:9 ratio to a tall portrait ratio */
    aspect-ratio: 4 / 3; 
}

/* Span modifier for vertical portraits */
.gallery-item.tall45 {
    grid-row: span 2;
    /* Overrides the 16:9 ratio to a tall portrait ratio */
    aspect-ratio: 4 / 5; 
}

/* Ensure all images perfectly fill their designated containers */
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Crops cleanly to fit the container's ratio */
    transition: transform 0.3s ease; /* Smooth hover transition */
}

.gallery-item.no-crop img {
    object-fit: contain;
    background-color: #000; /* Fills the empty letterboxing space */
}

.gallery-video {
    width: 100%;
    height: 100%;
    object-fit: cover;   /* same behavior as images */
    display: block;
    border-radius: inherit;
}

/* Optional: Slight zoom effect when a user hovers over a screenshot */
.gallery-item:hover img {
    transform: scale(1.05);
}

/* Lightbox Background Overlay */
.lightbox {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center; /* Centers the image vertically */
    justify-content: center; /* Centers the image horizontally */
}

/* Shows the lightbox when the active class is added */
.lightbox.active {
    display: flex; 
}

/* The popup image */
.lightbox-content {
    max-width: 90%;
    max-height: 90vh; /* Limits height to 90% of the viewport */
    border-radius: var(--button-radius); /* Keeps the image matching your game theme */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

/* Close button 'X' */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #ffffff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.lightbox-close:hover {
    color: var(--accent-color); /* Matches the X hover to your current theme */
}

/* Change cursor on gallery images to indicate they are clickable */
.gallery-item img {
    cursor: zoom-in;
}


/* Layout for the links area */
.links-wrapper {
    display: flex;
    align-items: center;
    gap: 30px; /* Creates a large space between the Demo button and Store links */
    flex-wrap: wrap; /* Allows wrapping on small screens */
    margin-top: 20px;
}

.store-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap; /* Stack on mobile */
}


/* Shared button base styles */
.btn {
    text-decoration: none;
    border-radius: var(--button-radius);
    display: inline-block;
    transition: all 0.3s ease;
    font-family: var(--font-main);
}

/* The Demo Button (Solid background) */
.btn-primary {
    background-color: var(--accent-color);
    color: #fff; /* or another contrasting color */
    padding: 12px 24px;
    font-weight: bold;
    font-size: 1.1em;
}

/* The Store Buttons (Outlined background) */
.btn-secondary {
    background-color: transparent;
    color: var(--text-color);
    border: 2px solid var(--accent-color);
    padding: 10px 20px;
}

/* Optional hover effects */
.btn-primary:hover {
    opacity: 0.8;
}

.btn-secondary:hover {
    background-color: var(--accent-color);
    color: #fff;
}

.store-btn {
  justify-content: center; /* Centers icon + text */
  width: 100px;        /* Fixed width */
  height: 36px;        /* Fixed height */
  overflow: hidden;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.9rem;
  border-radius: var(--button-radius);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}

/* Icon styling */
.store-btn i {
  font-size: 1.1em;
  width: 1.2em;
}

/* Brand colors */
.store-btn.steam {
  background: linear-gradient(135deg, #1b2838, #66c0f4);
  color: white;
}

.store-btn.itch {
  background: #fa5c5c;
  color: white;
}

.store-btn.play {
  background: #00c853;
  color: white;
}

.store-btn.apple {
  background: #000;
  color: #fff;
}

.store-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}



/* Sci-Fi Theme */
.theme-scifi {
  /* Neon blue on dark space background */
  --bg-color: #020314;           /* Near-black, slight blue tint */
  --text-color: #e5f5ff;         /* Soft icy text */
  --accent-color: #04d9ff;       /* Neon blue (#04D9FF) [web:238][web:246] */
  --font-main: 'Orbitron', 'Merriweather Sans', system-ui, sans-serif;
  --button-radius: 0px;          /* Sharp, techy buttons */

  /* NEW: Wide letter spacing for sci-fi feel */
  letter-spacing: 0.04em;
}

/* Extra wide for headings */
.theme-scifi h1, .theme-scifi h2, .theme-scifi h3 {
  letter-spacing: 0.08em;
}

/* Normal spacing for body text readability */
.theme-scifi p {
    letter-spacing: 0.04em;
    font-size: 1.3em; /* Readable body text */
}


/* Western Theme */
.theme-western {
    --bg-color: #eaddcf;
    --text-color: #3e2723;
    --accent-color: #bf360c;
    --font-main: 'Georgia', serif;
    --button-radius: 4px;
}

/* Horror Theme */
.theme-horror {
    --bg-color: #111111;
    --text-color: #b0bec5;
    --accent-color: #880000;
    --font-main: 'Impact', sans-serif;
    --button-radius: 2px;
}

.theme-fantasy {
    /* Mystical dark purple backdrop */
    --bg-color: #1a0f2e; 
    /* Soft parchment/starlight text */
    --text-color: #e6dcd8; 
    /* Glowing magical purple-pink for buttons and links */
    --accent-color: #bf5af2; 
    /* Classic, elegant serif font */
    --font-main: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
    /* Softly rounded buttons */
    --button-radius: 12px;
}


.theme-crime {
    /* Pitch black shadows */
    --bg-color: #0b0b0b; 
    /* Harsh, stark white text */
    --text-color: #f5f5f5; 
    /* Dramatic blood-red accent */
    --accent-color: #d94d2c; 
    --font-main: 'Merriweather Sans', system-ui, sans-serif;
    /* Sharp, rigid edges */
    --button-radius: 0px; 
}

.theme-crime h1, .theme-crime h2 {
  font-weight: 400; /* Stark and minimalist */
}

.theme-retro {
    /* Dark console gray */
    --bg-color: #2b2b2b; 
    /* Bright coin-yellow text */
    --text-color: #ffd60a; 
    /* Arcade machine warp-blue accent */
    --accent-color: #0096ff; 
    --font-main: 'VT323', monospace;
    /* Slightly bevelled look for buttons */
    --button-radius: 4px;
}

/* Fine-tune specific elements */
.theme-retro p, .theme-retro .game-info p {
    font-size: 1.3em; /* Readable body text */
    line-height: 1.25;    
}


/* On screens wider than 600px, let the featured image take up more space */
@media (min-width: 600px) {
    .gallery-item.featured {
        grid-column: span 2;
        grid-row: span 2; /* Also makes it twice as tall */
    }
}

/* Global Strand theme (soft dark, bookish) */
.theme-strand {
  --bg-color: #0e1016;
  --text-color: #f5f1e8;
  --accent-color: #f0b35c;
  --font-main: 'Merriweather Sans', system-ui, sans-serif;
  --button-radius: 10px;
}
 
body.theme-strand {
  background: radial-gradient(circle at top, #222638 0, #0e1016 55%);
  color: var(--text-color);
  font-family: var(--font-main);
  margin: 0;
}


.game-header {
  padding: 16px 20px;
}

.home-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  background: rgba(0, 0, 0, 0.35);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.home-button:hover {
  background: var(--accent-color);
  color: #050509;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.home-icon {
  width: 20px;
  height: 20px;
  line-height: 1;
}


/* Make header split: logo left, contact right */
.site-header {
  padding: 24px 32px;
  border-bottom: 1px solid rgba(240, 179, 92, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Discord contact button */
.header-contact {
  text-decoration: none;
  font-size: 0.9rem;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  background: rgba(0, 0, 0, 0.3);
  transition: background 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.header-contact:hover {
  background: var(--accent-color);
  color: #0e1016;
  transform: translateY(-1px);
}


.logo-image {
  width: 56px;      /* keep it square */
  height: 56px;
  border-radius: 8px;  /* optional, if you want slightly rounded corners */
  object-fit: cover;   /* ensures the logo fills the square nicely */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); /* optional, similar depth */
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-text h1 {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.logo-text p {
  margin: 2px 0 0;
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Layout */
.home-main {
  max-width: 1100px;
  margin: 32px auto 48px;
  padding: 0 16px;
}

.intro {
  margin-bottom: 32px;
}

.intro h2 {
  margin: 0 0 8px;
  font-size: 1.6rem;
}

.intro p {
  max-width: 620px;
  opacity: 0.9;
}

/* Game cards grid */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.game-card {
  background: rgba(11, 12, 18, 0.96);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(240, 179, 92, 0.14);
}

.game-card-link {
  color: inherit;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Cover image squares the top, keeps covers neat */
.game-card-cover {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

/* Card body */
.game-card-body {
  padding: 14px 16px 18px;
}

.game-card-body h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.game-card-body p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Hover state: slight lift + accent border */
.game-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  border-color: rgba(240, 179, 92, 0.6);
  transition: all 0.18s ease-out;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 16px 0 24px;
  font-size: 0.8rem;
  opacity: 0.75;
}

/* Light body text (300 or 400) */
body, p, .game-card-body p, .intro p {
  font-weight: 300; /* Light and readable */
}

/* Medium headings (600) */
h1, h2, h3, .logo-text h1, .game-card-body h3 {
  font-weight: 600; /* Medium-bold for emphasis */
}

/* Heavy headings (700) */
h1 {
  font-weight: 700; /* Extra bold for main titles */
}

/* Button text stays medium */
.btn, .header-contact {
  font-weight: 500; /* Medium weight for buttons */
}


/* Mobile-first: already good, but tighten spacing */
@media (max-width: 480px) {
  .home-main {
    padding: 0 12px; /* Reduce side padding */
    margin: 20px auto 32px; /* Less top/bottom */
  }
  
  .games-grid {
    gap: 16px; /* Tighter card spacing */
  }
  
  .logo-text h1 {
    font-size: 1.2rem; /* Smaller logo text */
  }
  
  /* Stack logo + Discord vertically */
  .site-header {
    flex-direction: column;
    gap: 12px;
    padding: 16px 20px;
  }
  
  .header-contact {
    width: 100%;
    text-align: center;
    padding: 10px 16px;
  }
}

/* Tablet: single column gallery */
@media (max-width: 768px) {
  .games-grid {
    grid-template-columns: 1fr; /* One card per row */
  }
  
  /* Game page: larger home button */
  .home-button {
    width: 48px;
    height: 48px;
  }
}

/* Game page mobile gallery tweaks */
@media (max-width: 768px) {
  .gallery {
    grid-template-columns: 1fr; /* Single column screenshots */
    gap: 12px;
  }
  
  /* Reset spans on mobile */
  .gallery-item.featured,
  .gallery-item.wide,
  .gallery-item.tall {
    grid-column: span 1;
    grid-row: span 1;
  }
}

/* Mobile lightbox optimizations */
@media (max-width: 768px) {
  /* Larger, touch-friendly close button */
  .lightbox-close {
    top: 12px;
    right: 12px;
    font-size: 32px;
    line-height: 1;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
  }
  
  /* Bigger image with more breathing room */
  .lightbox-content {
    max-width: 95vw;      /* 95% viewport width */
    max-height: 85vh;     /* 85% viewport height */
  }
  
  /* Touch-friendly gallery images */
  .gallery-item {
    min-height: 160px;    /* Minimum tap target size */
  }
  
  /* Prevent zoom on iOS Safari */
  .lightbox {
    touch-action: pan-y pinch-zoom;
  }
}
