/* ==========================================================================
   Silly Geese Game Studio - Warm Terrazzo & Gold Design System
   ========================================================================== */

/* Custom Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  /* Dark Mode (Default Theme - Warm Terrazzo & Gold) */
  --bg-primary: #120f0d;        /* Deep obsidian chocolate */
  --bg-secondary: #1d1815;      /* Lighter charcoal chocolate */
  --bg-card: #28211d;           /* Rich card background */
  --text-primary: #f7f4f0;      /* Warm white */
  --text-secondary: #beb3a8;    /* Warm beige-grey */
  --text-muted: #8c7d70;       /* Muted brown-grey */
  --accent: #e87151;            /* Soft coral / Terracotta */
  --accent-rgb: 232, 113, 81;
  --highlight: #f1b24a;         /* Vibrant gold */
  --highlight-rgb: 241, 178, 74;
  --border: rgba(241, 178, 74, 0.12);
  --border-hover: rgba(232, 113, 81, 0.3);
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.5);
  --glass-bg: rgba(29, 24, 21, 0.75);
  --glass-border: rgba(255, 255, 255, 0.05);

  /* Specific Green Placeholder Color */
  --placeholder-green: #3d7a5a; /* Sleek organic green */
}

[data-theme="light"] {
  /* Light Mode (Warm Terrazzo & Gold Light) */
  --bg-primary: #f4f0e6;        /* Cozy warm sand background (less bright) */
  --bg-secondary: #e8dfd0;      /* Slightly deeper cozy sand */
  --bg-card: #ffffff;           /* Crisp white for cards */
  --text-primary: #2d221c;      /* Warm charcoal */
  --text-secondary: #66544a;    /* Warm grey-brown */
  --text-muted: #99877d;       /* Muted sand-grey */
  --accent: #d95c3b;            /* Terracotta */
  --accent-rgb: 217, 92, 59;
  --highlight: #d99c2b;         /* Amber gold */
  --highlight-rgb: 217, 156, 43;
  --border: rgba(102, 84, 74, 0.2);
  --border-hover: rgba(217, 92, 59, 0.3);
  --shadow-sm: 0 4px 6px rgba(45, 34, 28, 0.05);
  --shadow-md: 0 10px 20px rgba(45, 34, 28, 0.1);
  --shadow-lg: 0 20px 40px rgba(45, 34, 28, 0.15);
  --glass-bg: rgba(252, 251, 248, 0.85);
  --glass-border: rgba(45, 34, 28, 0.05);

  --placeholder-green: #488a66; /* Slightly brighter green for light contrast */
}

/* Reset & Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.25s ease, opacity 0.25s ease;
}

a:hover {
  color: var(--highlight);
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Navigation Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  padding: 1.25rem 0;
  transition: background-color 0.4s ease;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.logo-text-group {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.logo-title {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.1;
}

.logo-tagline {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-top: 0.15rem;
}

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

.logo-highlight {
  color: var(--highlight);
}

/* Theme Toggle Switch */
.theme-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.2);
}

.theme-toggle-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.theme-toggle-btn .sun-icon {
  display: none;
}

[data-theme="light"] .theme-toggle-btn .moon-icon {
  display: none;
}

[data-theme="light"] .theme-toggle-btn .sun-icon {
  display: block;
}

/* Hero Section */
.hero {
  padding: 5rem 0 3rem 0;
  text-align: center;
}

.hero-logo-img {
  max-width: 100%;
  height: 200px;
  width: auto;
}

@media (min-width: 768px) {
  .hero-logo-img {
    height: 380px;
  }
}

.hero-subtitle {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 1rem;
  display: inline-block;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.hero-description {
  max-width: 600px;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: 1.15rem;
}

/* Games Section */
.games-section {
  padding: 3rem 0 6rem 0;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 3.5rem;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -0.75rem;
  width: 40px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 2.5rem;
  justify-content: center;
  align-items: stretch;
}

/* Game Cards */
.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  position: relative;
}

/* Blank Green Placeholder Box */
.image-placeholder-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background-color: var(--placeholder-green);
  transition: background-color 0.4s ease;
}

#card-shamboro .image-placeholder-container {
  background-color: #2a3439; /* Match logo border color exactly to make it seamless */
  border-bottom: 1px dashed var(--border);
}

.game-card-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  box-sizing: border-box;
  padding: 1.25rem; /* Padding for the logo badge */
}

.game-card:hover .game-card-image {
  transform: scale(1.05);
}

.green-placeholder {
  width: 100%;
  height: 100%;
  background-color: var(--placeholder-green);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Decorative visual styling to keep the green box feeling premium without using AI art */
.green-placeholder::before {
  content: '';
  position: absolute;
  top: 15px;
  left: 15px;
  right: 15px;
  bottom: 15px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  pointer-events: none;
}

.green-placeholder-label {
  font-family: 'Outfit', sans-serif;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  user-select: none;
}

.game-card-link {
  display: block;
  height: 100%;
  width: 100%;
  color: inherit;
}

.game-card-content {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.game-card-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
  transition: color 0.3s ease;
}

.game-card-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 1rem;
}

.game-card-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.game-card-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--highlight);
  transition: transform 0.3s ease;
}

.game-card-footer svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  transition: transform 0.3s ease;
}

/* Card Hover States */
.game-card:hover {
  transform: translateY(-8px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg), 0 0 25px rgba(var(--accent-rgb), 0.15);
}

.game-card:hover .game-card-title {
  color: var(--accent);
}

.game-card:hover .green-placeholder {
  transform: scale(1.03);
  background-color: #4b8f6a; /* subtle color shifts on hover */
}

.game-card:hover .game-card-footer {
  color: var(--accent);
}

.game-card:hover .game-card-footer svg {
  transform: translateX(4px);
}

/* In Development / TBD Card (Locked card matching mockup structure) */
.game-card.tbd-card {
  border-style: dashed;
  background: rgba(var(--accent-rgb), 0.02);
  cursor: not-allowed;
  opacity: 0.85;
}

.game-card.tbd-card:hover {
  transform: none;
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.tbd-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(var(--accent-rgb), 0.04);
  border-bottom: 1px dashed var(--border);
  color: var(--text-muted);
}

.tbd-placeholder svg {
  width: 36px;
  height: 36px;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.tbd-badge {
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
  padding: 0.4rem 1rem;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Game Play Page Layout */
.play-page-container {
  padding: 2.5rem 0 6rem 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.back-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--bg-card);
  transform: translateX(-4px);
}

.back-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  transform: rotate(180deg);
}

/* Game Embed Container - Essential for Godot Embeds */
.game-play-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.game-screen-container {
  background: #000;
  border-radius: 20px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
  /* Fit screen height on desktop, matching mobile vertical aspect ratio */
  height: calc(100vh - 180px);
  aspect-ratio: 9 / 16;
  max-width: 100%;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .game-screen-container {
    height: calc(100vh - 140px); /* Allocate more vertical room on mobile */
    border-radius: 12px;
  }
}

.game-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Info Sidebar & Instructions */
.game-info-panel {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.game-header-section {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.5rem;
}

.game-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.game-genre {
  font-family: 'Outfit', sans-serif;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.info-block-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--highlight);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.game-description {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
}

.controls-list {
  list-style: none;
}

.controls-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .controls-list li {
  border-bottom-color: rgba(45, 34, 28, 0.04);
}

.control-key {
  font-family: monospace;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: bold;
}

.control-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.compatibility-alert {
  background: rgba(var(--accent-rgb), 0.05);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  gap: 0.75rem;
}

.compatibility-alert svg {
  width: 20px;
  height: 20px;
  fill: var(--accent);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.compatibility-text h4 {
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.compatibility-text p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Footer Section */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 4rem 0 3rem 0;
  background-color: var(--bg-secondary);
  transition: background-color 0.4s ease;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
  text-align: center;
}

@media (min-width: 768px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
    align-items: flex-start;
  }
}

.footer-brand {
  max-width: 360px;
}

.footer-logo {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.footer-tagline {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.footer-copyright {
  margin-top: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.social-links {
  display: flex;
  gap: 1.5rem;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.social-icon:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--bg-card);
  transform: translateY(-3px);
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.15);
}

.social-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Elements Entry Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeInUp 0.8s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

.delay-1 { animation-delay: 0.15s; }
.delay-2 { animation-delay: 0.3s; }
.delay-3 { animation-delay: 0.45s; }

/* Responsive Media Queries */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
  
  .container {
    padding: 0 1.5rem;
  }
  
  .game-title {
    font-size: 2rem;
  }
}

/* Custom Itch Link Button */
.itch-link {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border);
  padding: 0.6rem 1.5rem;
  border-radius: 30px;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.itch-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--bg-card);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.15);
}
