body {
  position: relative;
  margin: 0;
  font-family: Arial, sans-serif;
  background: radial-gradient(circle at top, #1b1b1b 0%, #050505 70%);
  color: white;
}

header,
nav,
main {
  position: relative;
}

nav,
main {
  z-index: 1;
}

header {
  z-index: 1;
  text-align: center;
  padding: 2rem;
  background: linear-gradient(rgba(17,17,17,.75), rgba(0,0,0,.75));
  border-bottom: 3px solid #d6b400;
  text-shadow: 0 0 8px #d6b400;
  overflow: hidden;
}

header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("Images/Backgrounds/Never_Gunna_Give_You_Up.png");
  background-repeat: repeat-x;
  background-position: center;
  background-size: cover;
  opacity: 0.15;
  z-index: 0;
}

header h1,
header p {
  position: relative;
  z-index: 1;
}

header h1 {
  font-family: Georgia, serif;
  letter-spacing: 2px;
}

main {
  padding: 1.5rem;
}

#searchBox {
  width: 100%;
  padding: 1rem;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  border-radius: 4px;
  border: 2px solid #d6b400;
  background: #050505;
  color: white;
  box-sizing: border-box;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}

.card {
  background: linear-gradient(#262626, #111);
  border: 2px solid #6f5b00;
  box-shadow: 0 0 12px rgba(214, 180, 0, 0.4);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}

.card img {
  width: 100%;
  max-width: 230px;
  border-radius: 6px;
  box-shadow: 0 0 10px black;
}

.card h2 {
  font-family: Georgia, serif;
  color: #ffd700;
  text-shadow: 0 0 5px black;
}

.effect-box {
  margin-top: 0.75rem;
  text-align: left;
}

.effect-box summary {
  cursor: pointer;
  font-weight: bold;
  text-align: center;
  color: #ffd700;
}

.effect-box p {
  font-size: 0.9rem;
  line-height: 1.35;
}

.main-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  background: linear-gradient(#1d3b52, #0c1e2a);
  border-top: 2px solid #d6b400;
  border-bottom: 2px solid #d6b400;
}

.main-nav a {
  padding: 1rem 1.5rem;
  color: white;
  text-decoration: none;
  font-family: Georgia, serif;
  font-weight: bold;
  border-right: 1px solid rgba(255,255,255,.15);
  transition: 0.2s;
}

.main-nav a:hover {
  background: rgba(214,180,0,.15);
  color: #ffd700;
}

.discord-link {
  color: #8ea1ff;
}

#background-rotator {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 1200px;
  height: 1200px;
  transform: translate(-50%, -50%);
  background-image: url("Images/Backgrounds/Dark_Magical_Circle.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.10;
  z-index: 0;
  animation: slowSpin 300s linear infinite;
  pointer-events: none;
}

@keyframes slowSpin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}
.search-panel {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: linear-gradient(#1a1a1a, #0a0a0a);
  border: 2px solid #6f5b00;
  box-shadow: 0 0 12px rgba(214, 180, 0, 0.25);
  border-radius: 8px;
}

.search-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

#searchBox {
  margin-bottom: 0;
}

#searchButton,
#clearButton,
.filter-row select {
  padding: 0.85rem;
  border-radius: 4px;
  border: 2px solid #d6b400;
  background: #050505;
  color: white;
  font-size: 1rem;
}

#searchButton,
#clearButton {
  cursor: pointer;
  font-family: Georgia, serif;
  font-weight: bold;
}

#searchButton:hover,
#clearButton:hover {
  background: rgba(214,180,0,.15);
  color: #ffd700;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

@media (max-width: 600px) {
  .search-row {
    flex-direction: column;
  }
}
body {
  --accent: #d6b400;
  --accent-glow: rgba(214, 180, 0, 0.4);
}

body.theme-monster {
  --accent: #d6b400;
  --accent-glow: rgba(214, 180, 0, 0.4);
}

body.theme-spell {
  --accent: #2ecc71;
  --accent-glow: rgba(46, 204, 113, 0.4);
}

body.theme-trap {
  --accent: #9b59b6;
  --accent-glow: rgba(155, 89, 182, 0.5);
}

.main-nav {
  border-top-color: var(--accent);
  border-bottom-color: var(--accent);
}

.main-nav a:hover,
.main-nav .active-tab {
  background: var(--accent-glow);
  color: var(--accent);
}

header {
  border-bottom-color: var(--accent);
  text-shadow: 0 0 8px var(--accent);
}

#searchBox,
#searchButton,
#clearButton,
.filter-row select {
  border-color: var(--accent);
}

.card {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.card h2,
.effect-box summary {
  color: var(--accent);
}

.search-panel {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.no-results {
  font-family: Georgia, serif;
  font-size: 1.3rem;
  color: var(--accent);
}

/* ============================================================
   Additions for the multi-page build (homepage hub, footer,
   PDF viewer, draft page). Existing styles above are unchanged.
   ============================================================ */

/* --- Homepage intro --- */
.home-intro {
  max-width: 760px;
  margin: 0 auto 2rem;
  text-align: center;
  font-size: 1.1rem;
  line-height: 1.5;
}

/* --- Homepage portal grid --- */
.home-hub {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.portal {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  color: white;
  background: linear-gradient(#262626, #111);
  border: 2px solid #6f5b00;
  box-shadow: 0 0 12px rgba(214, 180, 0, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.portal:hover {
  transform: translateY(-4px);
}

.portal-kicker {
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.7;
}

.portal-title {
  font-family: Georgia, serif;
  font-size: 1.6rem;
  font-weight: bold;
  text-shadow: 0 0 6px black;
}

.portal-desc {
  font-size: 0.92rem;
  line-height: 1.35;
  opacity: 0.9;
}

/* Per-portal accent colors mirror the category themes */
.portal-monster { border-color: #d6b400; box-shadow: 0 0 12px rgba(214,180,0,0.4); }
.portal-monster:hover { box-shadow: 0 0 22px rgba(214,180,0,0.7); }
.portal-monster .portal-title { color: #ffd700; }

.portal-spell { border-color: #2ecc71; box-shadow: 0 0 12px rgba(46,204,113,0.35); }
.portal-spell:hover { box-shadow: 0 0 22px rgba(46,204,113,0.65); }
.portal-spell .portal-title { color: #2ecc71; }

.portal-trap { border-color: #9b59b6; box-shadow: 0 0 12px rgba(155,89,182,0.4); }
.portal-trap:hover { box-shadow: 0 0 22px rgba(155,89,182,0.7); }
.portal-trap .portal-title { color: #b07cc6; }

.portal-rules,
.portal-draft { border-color: #d6b400; }
.portal-rules:hover,
.portal-draft:hover { box-shadow: 0 0 22px rgba(214,180,0,0.6); }
.portal-rules .portal-title,
.portal-draft .portal-title { color: #ffd700; }

.portal-discord { border-color: #8ea1ff; box-shadow: 0 0 12px rgba(142,161,255,0.35); }
.portal-discord:hover { box-shadow: 0 0 22px rgba(142,161,255,0.65); }
.portal-discord .portal-title { color: #8ea1ff; }

/* --- Embedded PDF (Rules page) --- */
.pdf-viewer {
  border: 2px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 0 12px var(--accent-glow);
  overflow: hidden;
  background: #050505;
}

.pdf-viewer iframe {
  display: block;
  width: 100%;
  height: 80vh;
  border: 0;
}

.pdf-fallback {
  text-align: center;
  margin-top: 1rem;
  opacity: 0.85;
}

.pdf-fallback a,
.coming-soon a {
  color: var(--accent);
}

/* --- Draft / coming-soon page --- */
.coming-soon {
  max-width: 640px;
  margin: 2rem auto;
  text-align: center;
  padding: 2rem;
  border: 2px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 0 12px var(--accent-glow);
  background: linear-gradient(#1a1a1a, #0a0a0a);
}

.coming-soon h2 {
  font-family: Georgia, serif;
  color: var(--accent);
}

/* --- Shared footer --- */
.site-footer {
  position: relative;
  z-index: 1;
  margin-top: 3rem;
  padding: 1.5rem;
  text-align: center;
  background: linear-gradient(#0c1e2a, #050505);
  border-top: 2px solid var(--accent);
  font-size: 0.9rem;
}

.site-footer .footer-main {
  font-family: Georgia, serif;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.site-footer .footer-sub { margin: 0 0 0.75rem; }

.site-footer .footer-fine {
  font-size: 0.75rem;
  opacity: 0.55;
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.4;
}
