/* ============================================================
   RPG Map System — Global Styles (Dark Fantasy)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Crimson+Pro:ital,wght@0,300;0,400;0,600;1,300;1,400&display=swap');

/* ── Variables ── */
:root {
  --bg-deep:        #0f0d0a;
  --bg-panel:       #1a1612;
  --bg-card:        #161310;
  --border:         #4a3728;
  --border-hover:   #7a5c3e;
  --gold:           #c9a84c;
  --gold-dim:       #8a6f32;
  --text-primary:   #e8d5b0;
  --text-muted:     #8a7060;
  --text-faint:     #4a3d30;
  --danger:         #8b2020;
  --danger-hover:   #b03030;
}

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

/* ── Base ── */
html { scroll-behavior: smooth; }

body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

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

/* ── Typography ── */
h1, h2, h3, h4 {
  font-family: 'Cinzel', serif;
  color: var(--text-primary);
  line-height: 1.3;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--text-primary); }

/* ── Layout ── */
.container {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.page-content {
  position: relative;
  z-index: 1;
}

/* ── Header ── */
header.site-header {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

header.site-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-logo {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-shadow: 0 0 30px rgba(201,168,76,0.2);
  text-decoration: none;
}
.site-logo:hover { color: var(--gold); }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb .sep { color: var(--text-faint); }

/* ── Page Hero ── */
.page-hero {
  text-align: center;
  padding: 3rem 2rem 2rem;
  border-bottom: 1px solid var(--border);
}

.hero-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  color: var(--gold-dim);
  font-size: 18px;
}
.ornament-line {
  flex: 1;
  max-width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim));
}
.ornament-line.right {
  background: linear-gradient(90deg, var(--gold-dim), transparent);
}

.page-hero h1 {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-shadow: 0 0 40px rgba(201,168,76,0.2);
  margin-bottom: 0.4rem;
}
.page-hero .hero-sub {
  font-size: 1rem;
  color: var(--text-muted);
  font-style: italic;
  letter-spacing: 0.04em;
}

/* ── Section ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.section-title {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.55rem 1.2rem;
  border: 1px solid var(--gold-dim);
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gold);
  opacity: 0;
  transition: opacity 0.2s;
}
.btn:hover {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(201,168,76,0.15);
  color: var(--gold);
  text-decoration: none;
}
.btn:hover::before { opacity: 0.07; }
.btn > * { position: relative; }

.btn-ghost {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-ghost:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.btn-primary {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  padding: 0.5rem 1.2rem;
  background: transparent;
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary:hover {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(201,168,76,0.1);
}

.btn-danger {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-danger:hover {
  border-color: var(--danger-hover);
  color: var(--danger-hover);
}

/* ── Cards ── */
.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 1.5rem;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid var(--gold);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.card:hover {
  background: #1f1a14;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.5), 0 0 20px rgba(201,168,76,0.05);
}
.card:hover::after { opacity: 0.3; }
.card.clickable { cursor: pointer; }

/* ── Campaign Cards ── */
.campaign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.2rem;
}

.campaign-card { cursor: pointer; }

.card-cover {
  width: 100%;
  height: 100px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.cover-1 { background: linear-gradient(135deg, #1a1208 0%, #2d1a0e 50%, #0f0d0a 100%); }
.cover-2 { background: linear-gradient(135deg, #0a1020 0%, #162030 50%, #0f0d0a 100%); }
.cover-3 { background: linear-gradient(135deg, #120a1a 0%, #1e0f2a 50%, #0f0d0a 100%); }
.cover-4 { background: linear-gradient(135deg, #0a1a10 0%, #102a18 50%, #0f0d0a 100%); }

.card-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  padding: 2px 7px;
  border: 1px solid var(--gold-dim);
  color: var(--gold-dim);
  background: rgba(15,13,10,0.85);
}

.card-name {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
  line-height: 1.3;
}
.card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.5;
  margin-bottom: 1rem;
}
.card-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.78rem;
  color: var(--text-faint);
  font-family: 'Cinzel', serif;
  letter-spacing: 0.05em;
}
.card-meta span { color: var(--text-muted); }

/* New card */
.card-new {
  border-style: dashed;
  border-color: var(--text-faint);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 200px;
  background: transparent;
  cursor: pointer;
}
.card-new:hover {
  border-color: var(--gold-dim);
  background: rgba(201,168,76,0.02);
  transform: translateY(-2px);
}
.card-new:hover::after { opacity: 0 !important; }
.card-new-icon {
  width: 36px;
  height: 36px;
  border: 1px solid var(--text-faint);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 1.2rem;
  transition: all 0.2s;
}
.card-new:hover .card-new-icon {
  border-color: var(--gold-dim);
  color: var(--gold-dim);
}
.card-new-label {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  transition: color 0.2s;
}
.card-new:hover .card-new-label { color: var(--gold-dim); }

/* ── Scene Cards ── */
.scene-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.scene-card { cursor: pointer; }

.scene-thumb {
  width: 100%;
  height: 80px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 1.5rem;
  position: relative;
}
.scene-name {
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}
.scene-meta {
  font-size: 0.78rem;
  color: var(--text-faint);
  font-family: 'Cinzel', serif;
  letter-spacing: 0.04em;
}

/* ── Divider ── */
.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2.5rem 0;
  color: var(--text-faint);
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 2rem;
  width: 100%;
  max-width: 440px;
  position: relative;
  margin: 1rem;
}
.modal::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid var(--gold);
  opacity: 0.15;
  pointer-events: none;
}
.modal-title {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 1.5rem;
  text-align: center;
  letter-spacing: 0.08em;
}
.modal-actions {
  display: flex;
  gap: 0.8rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* ── Forms ── */
.form-group { margin-bottom: 1.2rem; }
.form-label {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.form-input,
.form-textarea,
.form-select {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  padding: 0.6rem 0.8rem;
  outline: none;
  transition: border-color 0.2s;
  appearance: none;
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--gold-dim);
}
.form-textarea { resize: vertical; min-height: 80px; }

/* ── Footer ── */
footer.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-faint);
  font-family: 'Cinzel', serif;
  letter-spacing: 0.08em;
  margin-top: 4rem;
}

/* ── Utility ── */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-gold { color: var(--gold); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--border); }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }
