/* =========================
   Questforge Corewright Interface
   Full CSS Drop-In (3.4 Clean Pass)
   ========================= */

/* =========================
   Root / Theme
   ========================= */

:root {
  --bg: #e8dcc3;
  --panel: #fdf6e3;
  --panel-alt: #f3e7d0;
  --ink: #2f2418;
  --muted: #5a4a32;
  --border: #8b7355;
  --border-soft: rgba(139, 115, 85, 0.35);
  --nav: #5a4a32;
  --nav-ink: #f8f1e4;
  --accent: #7b5f3b;
  --accent-soft: rgba(123, 95, 59, 0.12);
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --max-width: 1400px;
}

/* =========================
   Reset / Base
   ========================= */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(232, 220, 195, 0.88), rgba(232, 220, 195, 0.88)),
    url("../images/parchment-bg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.45;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

/* =========================
   Navigation
   ========================= */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  gap: 24px;
  align-items: center;
  padding: 12px 20px;
  background: var(--nav);
  border-bottom: 1px solid var(--border);
}

.nav a {
  color: var(--nav-ink);
  font-weight: 700;
}

.nav a:hover {
  text-decoration: underline;
}

/* =========================
   Splash Screen
   ========================= */

#splash {
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(rgba(32, 24, 16, 0.55), rgba(32, 24, 16, 0.55)),
    url("../images/hero-workshop.jpg");
  background-size: cover;
}

#splash::before,
#splash::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#splash::before {
  background:
    radial-gradient(circle at center, rgba(255, 220, 140, 0.08), transparent 55%);
}

#splash::after {
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 210, 120, 0.10), transparent 28%),
    radial-gradient(circle at 50% 42%, rgba(255, 170, 80, 0.06), transparent 42%);
  animation: splashGlowPulse 8s ease-in-out infinite;
}

#splash > * {
  position: relative;
  z-index: 1;
}

#splash h1 {
  margin: 0 0 20px;
  font-size: clamp(2rem, 4vw, 3.25rem);
  color: #f8e7cc;
}

#splash button {
  border: 1px solid var(--border);
  background: rgba(253, 246, 227, 0.92);
  border-radius: 10px;
  padding: 12px 20px;
  font-weight: 700;
  cursor: pointer;
}

/* =========================
   Layout
   ========================= */

.builder-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 20px;
}

.builder-panel,
.summary-card,
.statblock-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* =========================
   Cards / Selection
   ========================= */

.select-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fffaf0;
  padding: 12px;
  cursor: pointer;
  transition: 0.12s ease;
}

.select-card:hover {
  transform: translateY(-1px);
}

.select-card.selected {
  border-color: var(--accent);
  background: #fff7ea;
}

.tag {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #efe4cf;
  font-size: 0.78rem;
}

/* =========================
   Infusions
   ========================= */

.infusion-group {
  display: grid;
  gap: 10px;
}

.infusion-pill {
  display: inline-flex;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #efe4cf;
}

/* =========================
   Stat Block
   ========================= */

.stat-block {
  background: #fffaf0;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.stat-block .ability-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

/* =========================
   Buttons
   ========================= */

.action-button {
  border: 1px solid var(--border);
  background: var(--nav);
  color: var(--nav-ink);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
}

/* =========================
   Example Builds
   ========================= */

.example-build-toolbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}

.example-build-toolbar .control-group {
  width: 100%;
}

.example-build-toolbar .control-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  color: var(--muted);
}

.example-build-toolbar .control-group input,
.example-build-toolbar .control-group select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fffaf0;
  color: var(--ink);
  padding: 10px 12px;
}

.example-build-toolbar > .control-group:first-child {
  width: min(100%, 720px);
}

.example-build-toolbar > .control-group:first-child input {
  font-size: 1rem;
  padding: 12px 14px;
}

.example-build-toolbar > .control-group:not(:first-child) {
  max-width: 220px;
}

.example-build-toolbar {
  position: relative;
}

.example-build-toolbar::after {
  content: "";
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.example-build-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 220px));
  justify-content: center;
}

.example-build-toolbar > .control-group:first-child {
  grid-column: 1 / -1;
  justify-self: center;
}

.example-build-toolbar > .control-group:not(:first-child) {
  width: 100%;
}

.section-note {
  text-align: center;
  color: var(--muted);
  margin-top: 14px;
}

#exampleBuilds {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.example-build-card {
  height: 100%;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.example-build-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Hide result count / shown count text if present */
#resultsCount,
.results-count,
.results-meta,
.build-count,
.example-build-count {
  display: none !important;
}

@media (max-width: 800px) {
  .example-build-toolbar {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .example-build-toolbar > .control-group:first-child,
  .example-build-toolbar > .control-group:not(:first-child) {
    width: 100%;
    max-width: 100%;
  }
}
/* =========================
   Animations
   ========================= */

@keyframes splashGlowPulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* =========================
   Mobile
   ========================= */

@media (max-width: 1080px) {
  .builder-layout {
    grid-template-columns: 1fr;
  }

  #exampleBuilds {
    grid-template-columns: 1fr;
  }
}

/* =========================
   Print
   ========================= */

@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }

  .nav,
  .builder-panel,
  .summary-card {
    display: none !important;
  }

  .stat-block {
    border: 1px solid #000;
    background: #fff;
  }
}