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

/* ===================== DESIGN TOKENS ===================== */
:root {
  --gold: #c9a84c;
  --gold-light: #f0d080;
  --gold-dim: #7a6230;
  --bg-deep: #0a0a12;
  --bg-card: #10101e;
  --bg-card-hover: #161628;
  --bg-surface: #0d0d1a;
  --glass: rgba(16,16,30,0.85);
  --border: rgba(201,168,76,0.18);
  --border-glow: rgba(201,168,76,0.55);
  --text-primary: #e8e0cc;
  --text-secondary: #9a8f7a;
  --text-muted: #5a5448;
  --accent-blue: #4a8fff;
  --accent-purple: #9b59b6;
  --accent-red: #c0392b;
  --accent-green: #27ae60;
  --accent-cyan: #1abc9c;
  --family-sea: #1a6fa8;
  --family-bird: #7a5fa8;
  --family-turtle: #6b8e4e;
  --family-plant: #3a8a3a;
  --family-rodent: #b8860b;
  --family-bug: #8b4513;
  --family-humanoid: #4a4a8a;
  --family-dark: #2a0a3a;
  --family-dragon: #8b1a1a;
  --family-special: #1a5a7a;
  --shadow-gold: 0 0 20px rgba(201,168,76,0.15);
  --shadow-card: 0 4px 24px rgba(0,0,0,0.6);
  --radius: 12px;
  --radius-sm: 8px;
}

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

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Starfield background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(74,143,255,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(155,89,182,0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(201,168,76,0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ===================== SCROLLBAR ===================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ===================== TYPOGRAPHY ===================== */
h1, h2, h3 { font-family: 'Cinzel', serif; letter-spacing: 0.04em; }

.gold-text {
  background: linear-gradient(135deg, var(--gold-light), var(--gold), #8a6820);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===================== NAV ===================== */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,18,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  gap: 1rem;
}

.nav-logo {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 0.4rem 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--gold);
  background: rgba(201,168,76,0.08);
}

/* ===================== HERO SECTION ===================== */
#hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(201,168,76,0.07) 0%, transparent 60%),
    radial-gradient(ellipse at 0% 100%, rgba(74,143,255,0.06) 0%, transparent 40%),
    radial-gradient(ellipse at 100% 0%, rgba(155,89,182,0.07) 0%, transparent 40%);
  z-index: 0;
}

/* Animated gold lines */
.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, transparent 49.5%, rgba(201,168,76,0.06) 50%, transparent 50.5%),
    linear-gradient(0deg, transparent 49.5%, rgba(201,168,76,0.04) 50%, transparent 50.5%);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.hero-badge {
  display: inline-block;
  padding: 0.35rem 1rem;
  border: 1px solid var(--gold-dim);
  border-radius: 999px;
  font-size: 0.7rem;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.15em;
  color: var(--gold);
  margin-bottom: 1.5rem;
  background: rgba(201,168,76,0.05);
}

.hero-title {
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  font-family: 'Cinzel', serif;
  font-size: clamp(0.9rem, 2vw, 1.2rem);
  color: var(--gold);
  margin-bottom: 1.5rem;
  letter-spacing: 0.1em;
}

.hero-desc {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

.hero-stats {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.hero-stat {
  text-align: center;
}

.hero-stat-num {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  display: block;
  line-height: 1;
}

.hero-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 0.25rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary {
  padding: 0.75rem 2rem;
  background: linear-gradient(135deg, var(--gold), #8a6820);
  color: #0a0a12;
  font-weight: 700;
  font-size: 0.85rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.05em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s;
  font-family: 'Cinzel', serif;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(201,168,76,0.4);
}

.btn-outline {
  padding: 0.75rem 2rem;
  background: transparent;
  color: var(--gold);
  font-weight: 600;
  font-size: 0.85rem;
  border: 1px solid var(--gold-dim);
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.05em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s;
  font-family: 'Cinzel', serif;
}

.btn-outline:hover {
  border-color: var(--gold);
  background: rgba(201,168,76,0.08);
  transform: translateY(-2px);
}

/* Scroll chevron */
.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  animation: bounce 2s ease-in-out infinite;
  color: var(--gold-dim);
  font-size: 1.5rem;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ===================== SECTION COMMON ===================== */
.section {
  position: relative;
  z-index: 1;
  padding: 5rem 1.5rem;
}

.section-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-tag {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  background: rgba(201,168,76,0.08);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
  font-family: 'Cinzel', serif;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  margin-bottom: 0.75rem;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
  max-width: 560px;
  margin: 0 auto;
}

.divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 1.2rem auto 0;
}

/* ===================== GUIDE SECTION ===================== */
#guide {
  background: linear-gradient(180deg, transparent, rgba(201,168,76,0.02) 50%, transparent);
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.guide-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.3s, transform 0.3s;
}

.guide-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-3px);
}

.guide-card-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  display: block;
}

.guide-card h3 {
  font-size: 0.95rem;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.guide-card p, .guide-card li {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.guide-card ul { list-style: none; }
.guide-card ul li { padding: 0.2rem 0; }
.guide-card ul li::before { content: '▸ '; color: var(--gold); }

/* RPS Table */
.rps-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

.rps-table th, .rps-table td {
  padding: 0.4rem 0.6rem;
  text-align: center;
  border: 1px solid var(--border);
}

.rps-table th {
  background: rgba(201,168,76,0.1);
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
}

.rps-table td { color: var(--text-secondary); }
.rps-result { color: var(--gold-light) !important; font-weight: 600; }

/* Starter Grid */
.starter-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
}

.starter-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
}

.starter-card:hover {
  border-color: var(--gold);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-gold);
}

.starter-card img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  display: block;
  margin: 0 auto 0.5rem;
}

.starter-card .starter-no {
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  color: var(--gold);
  display: block;
}

.starter-card .starter-name {
  font-size: 0.65rem;
  color: var(--text-secondary);
  display: block;
  margin-top: 0.2rem;
}

/* Family Table */
.family-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.family-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  background: rgba(201,168,76,0.08);
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  border-bottom: 1px solid var(--border);
}

.family-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(201,168,76,0.06);
  color: var(--text-secondary);
  vertical-align: top;
}

.family-table tr:hover td { background: rgba(255,255,255,0.02); }

.family-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ===================== ZOO SECTION ===================== */
#zoo { padding-top: 4rem; }

.zoo-controls {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  align-items: center;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}

#search-input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.3rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

#search-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.1);
}

#search-input::placeholder { color: var(--text-muted); }

.filter-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.5rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
}

.filter-btn:hover { border-color: var(--gold-dim); color: var(--gold); }
.filter-btn.active {
  background: linear-gradient(135deg, rgba(201,168,76,0.2), rgba(201,168,76,0.05));
  border-color: var(--gold);
  color: var(--gold);
}

.zoo-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.zoo-count span { color: var(--gold); font-weight: 600; }

/* Monster Grid */
.monster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.monster-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
}

.monster-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-4px);
  box-shadow: 0 12px 35px rgba(0,0,0,0.5), var(--shadow-gold);
}

.monster-card-img-wrap {
  position: relative;
  background: linear-gradient(135deg, #0d0d1e, #141428);
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 130px;
  overflow: hidden;
}

.monster-card-img-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(201,168,76,0.06), transparent 65%);
}

.monster-card img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  position: relative;
  z-index: 1;
  transition: transform 0.3s;
  image-rendering: pixelated;
}

.monster-card:hover img { transform: scale(1.08); }

.monster-card-no {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  color: var(--gold);
  background: rgba(10,10,18,0.85);
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  border: 1px solid rgba(201,168,76,0.3);
  z-index: 2;
}

.monster-card-starter {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 0.65rem;
  background: rgba(201,168,76,0.15);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  z-index: 2;
}

.monster-card-body {
  padding: 0.75rem;
  border-top: 1px solid var(--border);
}

.monster-card-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.monster-card-name-en {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.02em;
}

.monster-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.family-tag {
  font-size: 0.62rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
}

.has-recipe-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
}

/* No results */
.no-results {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
  grid-column: 1 / -1;
}

.no-results .icon { font-size: 3rem; display: block; margin-bottom: 1rem; }

/* ===================== FAMILY COLORS ===================== */
.fam-Biển { background: rgba(26,111,168,0.2); color: #5aaddd; }
.fam-Chim { background: rgba(122,95,168,0.2); color: #b08fd8; }
.fam-Họ { background: rgba(107,142,78,0.2); color: #88b86a; }
.fam-Cây { background: rgba(58,138,58,0.2); color: #6acf6a; }
.fam-Chuột, .fam-Rodent { background: rgba(184,134,11,0.2); color: #e0b844; }
.fam-Bọ { background: rgba(139,69,19,0.2); color: #c8834a; }
.fam-Humanoid { background: rgba(74,74,138,0.2); color: #8080cc; }
.fam-Bóng { background: rgba(100,20,120,0.2); color: #cc6aee; }
.fam-Rồng { background: rgba(139,26,26,0.2); color: #e06a6a; }
.fam-Đặc { background: rgba(26,90,122,0.2); color: #6ab8d8; }

/* ===================== MODAL ===================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,5,12,0.88);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 16px;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.92) translateY(20px);
  transition: transform 0.3s;
  box-shadow: 0 30px 80px rgba(0,0,0,0.7), 0 0 60px rgba(201,168,76,0.08);
}

.modal-overlay.active .modal { transform: scale(1) translateY(0); }

.modal-header {
  position: relative;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #0d0d1e 0%, rgba(13,13,30,0.95) 100%);
  overflow: hidden;
}

/* Gold shimmer line top */
.modal-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  z-index: 2;
}

/* Layout split */
.modal-top-split {
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
}

.modal-img-column {
  flex: 0 0 45%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2.5rem 1rem 2.5rem 1.5rem;
  position: relative;
}

/* Glow behind image */
.modal-img-column::before {
  content: '';
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,168,76,0.15) 0%, transparent 65%);
  pointer-events: none;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(10,10,18,0.7);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10;
}

.modal-close:hover {
  background: rgba(201,168,76,0.15);
  color: var(--gold);
  border-color: var(--gold-dim);
}

.modal-info-column {
  flex: 1 1 55%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 2.5rem 2.5rem 2.5rem 1rem;
  text-align: left;
  min-width: 0;
}

.modal-img-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(201,168,76,0.4);
  border-radius: var(--radius);
  background: rgba(10,10,18,0.5);
  padding: 0.75rem;
  box-shadow:
    0 0 0 6px rgba(201,168,76,0.06),
    0 12px 40px rgba(0,0,0,0.6);
}

.modal-img-wrap img {
  width: 280px;
  height: 280px;
  object-fit: contain;
  image-rendering: pixelated;
  display: block;
  transition: transform 0.3s;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,0.6));
}

.modal-img-wrap img:hover {
  transform: scale(1.04);
}

.modal-info { width: 100%; }

.modal-no {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  color: var(--gold);
  letter-spacing: 0.15em;
  margin-bottom: 0.4rem;
  text-align: left;
}

.modal-name {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.2rem;
  text-align: left;
  word-wrap: break-word;
  word-break: break-word;
}

.modal-body { padding: 1.25rem 1.5rem 1.5rem; }

.modal-section { margin-bottom: 1.25rem; }

.modal-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.modal-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.source-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.65rem;
  background: rgba(74,143,255,0.1);
  border: 1px solid rgba(74,143,255,0.25);
  border-radius: 999px;
  font-size: 0.75rem;
  color: #7ab8f5;
  margin: 0.2rem 0.2rem 0.2rem 0;
}

/* Recipe */
.recipe-list { display: flex; flex-direction: column; gap: 0.5rem; }

.recipe-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.recipe-plus {
  font-size: 1rem;
  color: var(--gold);
  font-weight: 700;
  flex-shrink: 0;
}

.recipe-arrow {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0.25rem;
}

.recipe-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.75rem;
  background: rgba(201,168,76,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.recipe-chip:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201,168,76,0.12);
}

.recipe-chip .chip-no {
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  color: var(--gold);
  font-weight: 700;
}

.recipe-note {
  font-size: 0.73rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 0.5rem 0.75rem;
  background: rgba(255,255,255,0.02);
  border-left: 2px solid var(--gold-dim);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 0.25rem;
}

.modal-notes {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.65;
  padding: 0.65rem 0.85rem;
  background: rgba(201,168,76,0.04);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* Modal nav */
.modal-nav {
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.modal-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-nav-btn:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
}

.modal-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ===================== FOOTER ===================== */
footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.5rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-logo {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.footer-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.footer-text a {
  color: var(--gold-dim);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-text a:hover { color: var(--gold); }

/* ===================== LIGHTBOX ===================== */
#modal-img { cursor: zoom-in; }

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.lightbox-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  image-rendering: pixelated;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lightbox-overlay.active .lightbox-img {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 2010;
}

.lightbox-close:hover {
  background: rgba(201,168,76,0.2);
  color: var(--gold);
  border-color: var(--gold-dim);
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 768px) {
  .starter-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .monster-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
  }

  .nav-links { display: none; }

  .hero-stats { gap: 1.25rem; }

  .guide-grid {
    grid-template-columns: 1fr;
  }

  .modal-top-split {
    flex-direction: column;
  }
  
  .modal-img-column {
    padding: 2rem 1.5rem 1rem;
  }
  
  .modal-info-column {
    padding: 1rem 1.5rem 1.5rem;
    align-items: center;
    text-align: center;
  }
  
  .modal-no, .modal-name {
    text-align: center;
  }
  
  .modal-img-wrap img { width: 180px; height: 180px; }

  .family-table { font-size: 0.72rem; }
}

@media (max-width: 480px) {
  .starter-grid { grid-template-columns: repeat(3, 1fr); }
  .monster-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-title { font-size: 1.6rem; }
  .zoo-controls { gap: 0.5rem; }
  .filter-group { gap: 0.35rem; }
  .filter-btn { padding: 0.4rem 0.65rem; font-size: 0.7rem; }
}

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

.monster-card {
  animation: fadeInUp 0.3s ease both;
}

/* Image fallback */
img.img-error {
  opacity: 0.3;
  filter: grayscale(1);
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, rgba(201,168,76,0.04) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Tooltip for recipe chips */
.recipe-chip[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10,10,18,0.95);
  border: 1px solid var(--border);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.7rem;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}
