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

:root {
  --primary: #0d9488;
  --primary-dark: #0f766e;
  --primary-light: #14b8a6;
  --primary-bg: #f0fdfa;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --white: #ffffff;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow: 0 4px 12px rgba(0,0,0,.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.12);
  --transition: .25s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--slate-800);
  background: var(--slate-50);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--slate-200);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--slate-900);
}

.brand-icon { font-size: 1.5rem; }

.brand-highlight { color: var(--primary); }

.navbar-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  text-decoration: none;
  color: var(--slate-600);
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active { color: var(--primary); background: var(--primary-bg); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--slate-700);
  border-radius: 2px;
  transition: var(--transition);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-weight: 600;
  font-size: .9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
  text-decoration: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.btn-secondary {
  background: var(--white);
  color: var(--primary);
  border-color: var(--slate-200);
}

.btn-secondary:hover { border-color: var(--primary); background: var(--primary-bg); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover { background: var(--primary); color: var(--white); }

.btn-sm { padding: 8px 16px; font-size: .85rem; }

.btn-full { width: 100%; }

.link-btn {
  background: none;
  border: none;
  color: var(--slate-400);
  cursor: pointer;
  font-family: inherit;
  font-size: .9rem;
  padding: 4px 0;
  transition: var(--transition);
}

.link-btn:hover { color: var(--primary); }

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(13,148,136,.15), transparent),
    radial-gradient(ellipse 40% 50% at 80% 80%, rgba(245,158,11,.08), transparent),
    radial-gradient(ellipse 50% 60% at 20% 90%, rgba(6,182,212,.08), transparent);
  pointer-events: none;
}

.hero-content {
  position: relative;
  display: flex;
  align-items: center;
  gap: 60px;
  flex-wrap: wrap;
}

.hero-text { flex: 1; min-width: 300px; }

.hero-text h1 {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  color: var(--slate-900);
}

.hero-text p {
  font-size: 1.125rem;
  color: var(--slate-500);
  max-width: 540px;
  margin-bottom: 32px;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-stats {
  display: flex;
  gap: 16px;
  flex-shrink: 0;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px 28px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--slate-100);
  min-width: 120px;
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.stat-label { font-size: .85rem; color: var(--slate-500); font-weight: 500; }

/* ===== Games Section ===== */
.games-section {
  padding: 80px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 40px;
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 8px;
}

.section-header p { color: var(--slate-500); }

/* ===== Filter Bar ===== */
.filter-bar {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.search-wrapper {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate-400);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border: 2px solid var(--slate-200);
  border-radius: var(--radius-full);
  font-size: .95rem;
  font-family: inherit;
  background: var(--white);
  transition: var(--transition);
  outline: none;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13,148,136,.15);
}

.category-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 18px;
  border: 2px solid var(--slate-200);
  background: var(--white);
  color: var(--slate-600);
  border-radius: var(--radius-full);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

/* ===== Game Grid ===== */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.game-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--slate-100);
  transition: var(--transition);
  cursor: pointer;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.game-card-thumb {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--slate-100);
}

.game-card-thumb-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  transition: var(--transition);
}

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

.game-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: .75rem;
  font-weight: 600;
  text-transform: capitalize;
  background: rgba(0,0,0,.6);
  color: white;
  backdrop-filter: blur(4px);
}

.game-card-plays {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: .75rem;
  font-weight: 500;
  background: rgba(0,0,0,.6);
  color: white;
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  gap: 4px;
}

.game-card-body {
  padding: 16px 20px 20px;
}

.game-card-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--slate-900);
}

.game-card-author {
  font-size: .85rem;
  color: var(--slate-400);
  margin-bottom: 8px;
}

.game-card-author span { color: var(--slate-500); font-weight: 500; }

.author-link {
  color: var(--primary) !important;
  cursor: pointer;
  transition: var(--transition);
}

.author-link:hover { color: var(--primary-dark) !important; text-decoration: underline; }

.game-card-desc {
  font-size: .875rem;
  color: var(--slate-500);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.game-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--slate-100);
  font-size: .8rem;
  color: var(--slate-400);
}

.game-card-play {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: var(--white);
  font-weight: 600;
  font-size: .8rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  text-decoration: none;
}

.game-card-play:hover { background: var(--primary-dark); }

.loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--slate-400);
  font-size: 1.1rem;
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--slate-400);
}

.empty-state svg { margin-bottom: 16px; }

.empty-state h3 { color: var(--slate-600); margin-bottom: 8px; }

/* ===== Modal ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn .2s ease;
}

.modal-overlay.open { display: flex; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal {
  background: var(--white);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  box-shadow: var(--shadow-lg);
  animation: slideUp .25s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-header h2 { font-size: 1.5rem; color: var(--slate-900); }

.modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--slate-500);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: var(--transition);
}

.modal-close:hover { color: var(--slate-800); }

/* ===== Form ===== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: .9rem;
  color: var(--slate-700);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--slate-200);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-family: inherit;
  background: var(--white);
  transition: var(--transition);
  outline: none;
  color: var(--slate-800);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13,148,136,.12);
}

.form-group textarea { resize: vertical; min-height: 80px; }

.form-hint {
  display: block;
  font-size: .8rem;
  color: var(--slate-400);
  margin-top: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.submit-success {
  text-align: center;
  padding: 32px 0;
}

.submit-success svg { margin-bottom: 16px; }

.submit-success h3 { color: #16a34a; margin-bottom: 8px; }

.submit-success p { color: var(--slate-500); margin-bottom: 24px; }

.like-icon-card {
  font-size: .85rem;
  display: inline-block;
  margin-right: 2px;
}

/* ===== Game Jam ===== */
.jam-section {
  padding: 0 0 60px;
}

.jam-card {
  display: flex;
  align-items: center;
  gap: 32px;
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 50%, #14b8a6 100%);
  border-radius: var(--radius);
  padding: 40px 48px;
  color: var(--white);
  box-shadow: 0 8px 32px rgba(13,148,136,.25);
  position: relative;
  overflow: hidden;
}

.jam-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 30% 50%, rgba(255,255,255,.08), transparent);
  pointer-events: none;
}

.jam-info { flex: 1; position: relative; }

.jam-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  font-size: .78rem;
  font-weight: 700;
  background: rgba(255,255,255,.2);
  backdrop-filter: blur(4px);
  margin-bottom: 12px;
}

.jam-info h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.jam-info p {
  font-size: .95rem;
  opacity: .85;
  line-height: 1.6;
  max-width: 520px;
  margin-bottom: 16px;
}

.jam-meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-size: .88rem;
  opacity: .8;
  margin-bottom: 20px;
}

.jam-meta strong { color: var(--white); font-weight: 700; }

.jam-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.jam-actions .btn-primary {
  background: var(--white);
  color: var(--primary-dark);
  border-color: var(--white);
}

.jam-actions .btn-primary:hover { background: var(--slate-100); border-color: var(--slate-100); }

.jam-actions .btn-secondary {
  background: rgba(255,255,255,.15);
  color: var(--white);
  border-color: rgba(255,255,255,.3);
}

.jam-actions .btn-secondary:hover { background: rgba(255,255,255,.25); border-color: rgba(255,255,255,.5); }

.jam-icon {
  font-size: 5rem;
  line-height: 1;
  flex-shrink: 0;
  position: relative;
}

@media (max-width: 640px) {
  .jam-card { flex-direction: column; text-align: center; padding: 32px 24px; }
  .jam-info p { max-width: 100%; }
  .jam-meta { justify-content: center; }
  .jam-actions { justify-content: center; }
  .jam-icon { font-size: 3.5rem; }
}

/* ===== Footer ===== */
.footer {
  background: var(--slate-900);
  color: var(--slate-400);
  padding: 48px 0 0;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  margin-bottom: 32px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--white);
}

.footer-links {
  display: flex;
  gap: 24px;
  align-items: center;
}

.footer-links a {
  color: var(--slate-400);
  text-decoration: none;
  font-size: .9rem;
  transition: var(--transition);
}

.footer-links a:hover { color: var(--primary-light); }

.footer-bottom {
  border-top: 1px solid var(--slate-700);
  padding: 20px 0;
  text-align: center;
  font-size: .85rem;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero-content { flex-direction: column; text-align: center; }
  .hero-text p { max-width: 100%; }
  .hero-actions { justify-content: center; }
  .hero-stats { width: 100%; justify-content: center; }
}

@media (max-width: 768px) {
  .navbar-links { display: none; }
  .navbar-links.open {
    display: flex;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--white);
    border-bottom: 1px solid var(--slate-200);
    padding: 16px 24px;
    gap: 12px;
    box-shadow: var(--shadow);
  }
  .hamburger { display: flex; }
  .hero { min-height: auto; padding: 100px 0 60px; }
  .hero-stats { flex-wrap: wrap; }
  .game-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .form-row { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .search-wrapper { max-width: none; }
}

@media (max-width: 480px) {
  .game-grid { grid-template-columns: 1fr; }
  .modal { padding: 20px; }
  .stat-card { min-width: 100px; padding: 16px 20px; }
  .stat-number { font-size: 1.5rem; }
}
