
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Lora:ital,wght@0,400;0,500;1,400&family=DM+Mono:wght@400;500&display=swap');

/* ── Variables ─────────────────────────────── */
:root {
  --cream:       #F5EFE0;
  --cream-dark:  #EDE4CE;
  --green:       #2B3D2C;
  --green-light: #3D5C3E;
  --amber:       #C4843A;
  --amber-light: #E5A455;
  --text:        #1C1C18;
  --text-muted:  #7A7060;
  --card:        #FDFAF3;
  --border:      #D9CEB8;
  --shadow:      rgba(44, 61, 44, 0.12);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Lora', Georgia, serif;
  --font-mono:    'DM Mono', monospace;
}

/* ── Reset ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent;}
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background-color: var(--cream);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

/* ── Noise texture overlay ──────────────────── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

/* ── Nav ────────────────────────────────────── */
nav {
  background: var(--green);
  padding: 0 2rem;
  position: sticky; top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  box-shadow: 0 2px 20px var(--shadow);
}
.nav-brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-style: italic;
  color: var(--cream);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.nav-links { display: flex; gap: 0.25rem; }
.nav-links a {
  color: var(--cream);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background 0.2s;
  opacity: 0.8;
}
.nav-links a:hover, .nav-links a.active { background: rgba(255,255,255,0.12); opacity: 1; }

/* ── Page header ────────────────────────────── */
.page-header {
  text-align: center;
  padding: 4rem 2rem 2.5rem;
  position: relative;
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 600;
  color: var(--green);
  line-height: 1.15;
}
.page-header p {
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  font-size: 1.05rem;
}
.page-header .divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
}
.page-header .divider::before,
.page-header .divider::after {
  content: '';
  height: 1px;
  width: 80px;
  background: var(--amber);
}
.page-header .divider span { color: var(--amber); font-size: 1.1rem; }

/* ── Main content wrapper ───────────────────── */
main { max-width: 1600px; margin: 0 auto; padding: 2rem 2rem 5rem; position: relative; z-index: 1; }

/* ── Cards ──────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
  box-shadow: 0 2px 8px var(--shadow);
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px var(--shadow); }

/* ── Buttons ────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.4rem;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  letter-spacing: 0.03em;
}
.btn-primary { background: var(--amber); color: white; }
.btn-primary:hover { background: var(--amber-light); }
.btn-danger { background: #C0392B; color: white; }
.btn-danger:hover { background: #E74C3C; }
.btn-outline { background: transparent; border: 1.5px solid var(--green); color: var(--green); }
.btn-outline:hover { background: var(--green); color: var(--cream); }

/* ── Category pill ──────────────────────────── */
.pill {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  padding: 0.2rem 0.7rem;
  border-radius: 100px;
  background: var(--cream-dark);
  color: var(--text-muted);
}

/* ── Grid layouts ───────────────────────────── */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 1.5rem; }

/* ── Loading / empty states ─────────────────── */
.state-center {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
  font-style: italic;
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast notification ─────────────────────── */
.toast {
  position: fixed;
  bottom: 2rem; right: 2rem;
  padding: 0.9rem 1.5rem;
  border-radius: 8px;
  color: white;
  font-size: 0.9rem;
  z-index: 999;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: var(--green-light); }
.toast.error   { background: #C0392B; }

/* ── Form styles ────────────────────────────── */
.form-group { margin-bottom: 1.2rem; }
.form-group label {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--cream);
  color: var(--text);
  transition: border-color 0.2s;
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--amber); }

/* ── Page fade-in ───────────────────────────── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.fade-up { animation: fadeUp 0.5s ease both; }

/* ── Menu & Diet Icons ──────────────────────── */
.menu-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--cream-dark);
  border-bottom: 1px solid var(--border);
}
.menu-img img { width: 100%; height: 100%; object-fit: cover; }
.diet-icon {
  font-size: 1.1em;
  margin-left: 0.3rem;
  vertical-align: middle;
}

/* ── Responsive ─────────────────────────────── */
@media (max-width: 640px) {
  nav { padding: 0 1rem; }
  .nav-links a { padding: 0.4rem 0.6rem; font-size: 0.75rem; }
  main { padding: 1rem 1rem 4rem; }
  
  /* 2 items per row on mobile */
  .grid-2, .grid-3 { grid-template-columns: 1fr 1fr; gap: 1rem; }
  
  /* Adjust cards for smaller columns */
  .game-body { padding: 0.8rem; }
  .game-name, .menu-card-name { font-size: 0.95rem; }
  .game-desc { display: none !important; }
  
  .menu-card { flex-direction: column; padding: 0rem; gap: 0.8rem; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --cream:       #1A1A14;
    --cream-dark:  #222219;
    --card:        #1F1F18;
    --border:      #3A3528;
    --text:        #EDE4CE;
    --text-muted:  #9A8E78;
    --shadow:      rgba(0, 0, 0, 0.35);
    --green:       #63B07A;
    --green-light: #459451;
    /* --green and --amber stay the same — they work fine on dark */
  }
}
