/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #e0d6c2;
  background: #1a1410;
  background-image: radial-gradient(ellipse at 50% 0%, #2a1f18 0%, #1a1410 60%);
  min-height: 100vh;
}
a { color: #d4a853; text-decoration: none; }
a:hover { text-decoration: underline; color: #e8c97a; }
img, svg { display: block; max-width: 100%; }

/* === Skip Link === */
.skip-link {
  position: absolute; top: -100px; left: 8px;
  background: #d4a853; color: #1a1410; padding: 8px 16px;
  z-index: 100; border-radius: 0 0 4px 4px; font-weight: 600;
}
.skip-link:focus { top: 0; }

/* === Header === */
.site-header {
  background: rgba(20, 14, 8, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #3a2a1a;
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  max-width: 1200px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.25rem; font-weight: 700; color: #e8c97a;
  letter-spacing: 0.02em;
}
.logo-icon { color: #d4a853; }
.nav-list { display: flex; gap: 20px; list-style: none; }
.nav-list a { font-weight: 500; font-size: 0.95rem; }

/* === Hero === */
.hero { padding: 40px 20px 24px; text-align: center; }
.hero-inner { max-width: 640px; margin: 0 auto; }
.hero h1 { font-size: 2rem; color: #f5e6c8; margin-bottom: 12px; }
.hero-sub { font-size: 1.1rem; color: #b8a68a; }

/* === Forge Panel === */
.forge-panel { max-width: 1200px; margin: 0 auto; padding: 0 20px 40px; }
.forge-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.panel-card {
  background: rgba(30, 22, 14, 0.85);
  border: 1px solid #3a2a1a;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
}
.card-title {
  font-size: 1.1rem; font-weight: 600; color: #d4a853;
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 1px solid #2a1f14;
}
.card-icon { flex-shrink: 0; }

.field-group { margin-bottom: 14px; }
.field-group label { display: block; font-size: 0.85rem; color: #a89470; margin-bottom: 4px; font-weight: 500; }
.field-group-inline {
  display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 8px; align-items: end;
}
.field-group-inline label { margin-bottom: 2px; }

input[type="number"], input[type="text"], select {
  width: 100%; padding: 8px 10px;
  background: #1a1410; border: 1px solid #4a3828; border-radius: 6px;
  color: #e0d6c2; font-size: 0.95rem; font-family: inherit;
}
input[type="number"]:focus, input[type="text"]:focus, select:focus {
  outline: 2px solid #d4a853; outline-offset: 1px; border-color: #d4a853;
}
.input-with-stepper { display: flex; align-items: stretch; }
.input-with-stepper input { text-align: center; border-radius: 0; }
.input-with-stepper input::-webkit-outer-spin-button,
.input-with-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input-with-stepper input[type="number"] { -moz-appearance: textfield; }
.stepper-btn {
  background: #2a1f14; border: 1px solid #4a3828; color: #d4a853;
  padding: 8px 14px; font-size: 1.1rem; cursor: pointer; font-weight: 700;
}
.stepper-btn:first-of-type { border-radius: 6px 0 0 6px; }
.stepper-btn:last-of-type { border-radius: 0 6px 6px 0; }
.stepper-btn:hover { background: #3a2a1a; }

.thresholds-box {
  background: #1a1410; border-radius: 6px; padding: 10px 14px;
  font-size: 0.85rem;
}
.threshold-row {
  display: flex; justify-content: space-between;
  padding: 3px 0; border-bottom: 1px solid #2a1f14;
}
.threshold-row:last-child { border-bottom: none; }
.threshold-row span:first-child { color: #a89470; }
.threshold-row span:last-child { font-weight: 600; }
.threshold-row.easy span:last-child { color: #7a9a5a; }
.threshold-row.medium span:last-child { color: #c9a84c; }
.threshold-row.hard span:last-child { color: #c97a3a; }
.threshold-row.deadly span:last-child { color: #c94a4a; }

.btn {
  background: #d4a853; color: #1a1410; border: none;
  padding: 10px 20px; border-radius: 6px; font-weight: 600;
  font-size: 0.9rem; cursor: pointer; font-family: inherit;
  transition: background 0.15s;
}
.btn:hover { background: #e8c97a; }
.btn-small { padding: 6px 14px; font-size: 0.85rem; }
.btn-outline {
  background: transparent; border: 1px solid #4a3828; color: #d4a853;
}
.btn-outline:hover { background: rgba(212, 168, 83, 0.1); }
.btn-danger { border-color: #6a3a3a; color: #c97a7a; }
.btn-danger:hover { background: rgba(201, 74, 74, 0.1); }

.monster-list { list-style: none; min-height: 60px; }
.monster-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px; background: #1a1410; border-radius: 6px;
  margin-bottom: 6px; font-size: 0.9rem;
}
.monster-list .remove-monster {
  background: none; border: none; color: #c97a7a; cursor: pointer;
  font-size: 1.1rem; padding: 0 4px;
}
.monster-list .remove-monster:hover { color: #e8a0a0; }
.empty-state { color: #6a5a4a; font-style: italic; padding: 20px 10px; text-align: center; }

/* === Gauge === */
.gauge-container { margin-bottom: 12px; }
.gauge-bar {
  height: 20px; background: #1a1410; border-radius: 10px;
  overflow: hidden; border: 1px solid #3a2a1a;
}
.gauge-fill {
  height: 100%; background: linear-gradient(90deg, #7a9a5a, #c9a84c, #c97a3a, #c94a4a);
  border-radius: 10px; transition: width 0.3s ease;
  min-width: 0;
}
.gauge-labels {
  display: flex; justify-content: space-between;
  font-size: 0.65rem; color: #6a5a4a; margin-top: 4px; padding: 0 2px;
}
.difficulty-text { font-size: 1.1rem; font-weight: 600; text-align: center; margin-bottom: 4px; }
.xp-summary { font-size: 0.85rem; color: #a89470; text-align: center; }

/* === Sliders === */
.adjustment-card { margin-top: 0; }
.slider-group { margin-bottom: 14px; }
.slider-group label { display: block; font-size: 0.85rem; color: #a89470; margin-bottom: 4px; font-weight: 500; }
.slider-group input[type="range"] {
  width: 100%; accent-color: #d4a853;
}

/* === Actions === */
.action-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 8px;
}

/* === Supporting Content === */
.supporting-content {
  max-width: 1000px; margin: 0 auto; padding: 40px 20px;
}
.supporting-content h2 {
  font-size: 1.5rem; color: #f5e6c8; margin-bottom: 24px;
}
.support-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.support-card {
  background: rgba(30, 22, 14, 0.7);
  border: 1px solid #2a1f14; border-radius: 10px;
  padding: 20px;
}
.support-card h3 { font-size: 1.05rem; color: #d4a853; margin-bottom: 12px; }
.support-card p, .support-card li { font-size: 0.9rem; color: #c0b090; margin-bottom: 10px; }
.support-card li { margin-bottom: 8px; }
.mistake-list { list-style: none; padding-left: 0; }
.mistake-list li { padding-left: 16px; position: relative; }
.mistake-list li::before { content: '⚠'; position: absolute; left: 0; color: #c97a3a; }

/* === FAQ === */
.faq-section {
  max-width: 800px; margin: 0 auto; padding: 20px 20px 60px;
}
.faq-section h2 { font-size: 1.5rem; color: #f5e6c8; margin-bottom: 20px; }
.faq-item {
  border: 1px solid #2a1f14; border-radius: 8px;
  margin-bottom: 10px; background: rgba(30, 22, 14, 0.5);
}
.faq-item summary {
  padding: 14px 18px; font-weight: 600; color: #e0d6c2;
  cursor: pointer; font-size: 0.95rem;
}
.faq-item summary:hover { color: #d4a853; }
.faq-item p { padding: 0 18px 14px; font-size: 0.9rem; color: #b8a68a; }

/* === Footer === */
.site-footer {
  border-top: 1px solid #2a1f14;
  padding: 24px 20px; text-align: center;
  font-size: 0.85rem; color: #6a5a4a;
}
.footer-inner { max-width: 800px; margin: 0 auto; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; list-style: none; margin: 10px 0; }
.footer-nav a { font-size: 0.85rem; }
.footer-version { margin-top: 8px; color: #4a3a2a; }

/* === Utility === */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* === Responsive === */
@media (max-width: 900px) {
  .forge-grid { grid-template-columns: 1fr 1fr; }
  .difficulty-col { grid-column: span 2; }
  .action-row { justify-content: center; }
}
@media (max-width: 600px) {
  .forge-grid { grid-template-columns: 1fr; }
  .difficulty-col { grid-column: span 1; }
  .hero h1 { font-size: 1.5rem; }
  .hero-sub { font-size: 0.95rem; }
  .field-group-inline { grid-template-columns: 1fr 1fr; }
  .field-group-inline button { grid-column: span 2; }
  .header-inner { flex-direction: column; gap: 8px; }
  .nav-list { gap: 12px; }
}

/* === Print === */
@media print {
  .site-header, .site-footer, .action-row, .adjustment-card, .supporting-content, .faq-section, .hero, .skip-link { display: none; }
  body { background: white; color: black; }
  .panel-card { border: 1px solid #ccc; background: white; }
  .forge-grid { display: block; }
  .forge-col { margin-bottom: 20px; }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
