/* ─────────────────────────────────────────────────────────────────────────────
   SCA Rapier Melee Randomizer — style.css
   ───────────────────────────────────────────────────────────────────────────── */

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

/* ── BODY ── */
body {
  background: radial-gradient(ellipse at top, #1e120a 0%, #0a0603 100%);
  min-height: 100vh;
  font-family: 'IM Fell English', Georgia, serif;
  color: #2c1810;
  padding: 20px 16px 60px;
}

/* ── PAGE CONTAINER ── */
.page {
  max-width: 900px;
  margin: 0 auto;
}

/* ─────────────────────────────────────────────────────────────────────────────
   HEADER
   ───────────────────────────────────────────────────────────────────────────── */
.site-header {
  text-align: center;
  padding: 36px 20px 24px;
  color: #e8d5a3;
}

.ornament {
  display: block;
  font-size: 1.8rem;
  color: #c9a227;
  margin: 6px 0;
  letter-spacing: 0.3em;
}

.site-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(1.6rem, 5vw, 2.8rem);
  color: #f0e2b8;
  text-shadow: 0 0 30px rgba(201, 162, 39, 0.35);
  line-height: 1.2;
  margin: 10px 0 6px;
}

.site-subtitle {
  font-family: 'Cinzel', serif;
  font-size: clamp(0.85rem, 2.5vw, 1.15rem);
  color: #c9a227;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.site-eyebrow {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  color: #8a7050;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.site-tagline {
  font-style: italic;
  color: #8a7050;
  font-size: 0.9rem;
}

/* ─────────────────────────────────────────────────────────────────────────────
   CONTROLS
   ───────────────────────────────────────────────────────────────────────────── */
.controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 22px 0 28px;
}

.btn-roll {
  background: linear-gradient(160deg, #7a1515, #b52c2c);
  color: #f4e8c1;
  border: 2px solid #c9a227;
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 700;
  padding: 13px 30px;
  cursor: pointer;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-roll:hover {
  background: linear-gradient(160deg, #921a1a, #cc3535);
  transform: translateY(-2px);
  box-shadow: 0 7px 22px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-roll:active {
  transform: translateY(0);
}

.btn-copy {
  display: none; /* shown by JS after first roll */
  background: transparent;
  color: #e8d5a3;
  border: 2px solid #6b5020;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  padding: 13px 22px;
  cursor: pointer;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn-copy:hover {
  background: rgba(201, 162, 39, 0.12);
  border-color: #c9a227;
  color: #f0e2b8;
}

.btn-copy.copied {
  color: #7cc47a;
  border-color: #7cc47a;
}

/* ─────────────────────────────────────────────────────────────────────────────
   SCENARIO GRID
   ───────────────────────────────────────────────────────────────────────────── */
.scenario-grid {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.scenario-grid.visible {
  display: grid;
}

/* ─────────────────────────────────────────────────────────────────────────────
   CARDS — base
   ───────────────────────────────────────────────────────────────────────────── */
.card {
  background: linear-gradient(150deg, #f5e9c2, #e9d8a4);
  border: 1px solid rgba(201, 162, 39, 0.4);
  border-top: 3px solid var(--accent, #8b1a1a);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  padding: 16px 16px 14px;
  position: relative;
  transition: box-shadow 0.2s, opacity 260ms ease-in-out;
}

.card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
}

/* Grid helpers */
.span-2 { grid-column: span 2; }

/* ── Card typography ── */
.card-cat {
  font-family: 'Cinzel', serif;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent, #8b1a1a);
  margin-bottom: 5px;
}

.card-name {
  font-family: 'Cinzel', serif;
  font-size: 0.98rem;
  font-weight: 700;
  color: #2c1810;
  margin-bottom: 7px;
  line-height: 1.3;
  padding-right: 56px; /* room for lock + reroll buttons */
}

.card-desc {
  font-size: 0.82rem;
  line-height: 1.65;
  color: #4a2a1a;
}

.card-setup {
  font-size: 0.78rem;
  font-style: italic;
  color: #6b4a2a;
  margin-top: 7px;
  line-height: 1.5;
}

.card-setup strong {
  font-style: normal;
}

/* ── Lock & re-roll buttons ── */
.card-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 4px;
}

.btn-lock,
.btn-reroll {
  background: none;
  border: 1px solid rgba(139, 105, 20, 0.45);
  color: #8b6914;
  font-size: 0.68rem;
  padding: 2px 6px;
  cursor: pointer;
  font-family: 'Cinzel', serif;
  border-radius: 2px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  line-height: 1.4;
}

.btn-lock:hover,
.btn-reroll:hover {
  background: rgba(201, 162, 39, 0.18);
  border-color: #c9a227;
  color: #5a3a00;
}

.btn-lock.is-locked {
  background: rgba(139, 105, 20, 0.25);
  border-color: #8b6914;
  color: #5a3a00;
}

/* ─────────────────────────────────────────────────────────────────────────────
   THEME CARD
   ───────────────────────────────────────────────────────────────────────────── */
.card-theme {
  --accent: #8b6914;
  border-top-width: 4px;
  text-align: center;
  padding: 24px 24px 20px;
}

.theme-name {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(1.1rem, 3vw, 1.65rem);
  color: #2c1810;
  margin: 6px 0 4px;
  line-height: 1.25;
}

.theme-subtitle {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  color: #6b4a1a;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.theme-rule {
  border: none;
  border-top: 1px solid rgba(201, 162, 39, 0.5);
  margin: 0 auto 14px;
  width: 55%;
}

.theme-narrative {
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.75;
  color: #4a2a1a;
  /*max-width: 680px;*/
  margin: 0 auto;
}

/* ─────────────────────────────────────────────────────────────────────────────
   MODIFIERS CARD
   ───────────────────────────────────────────────────────────────────────────── */
.card-mods {
  --accent: #2a3a5c;
}

.mod-item {
  margin-top: 10px;
  padding-left: 10px;
  border-left: 2px solid #2a3a5c;
}

.mod-item:first-of-type {
  margin-top: 8px;
}

.mod-name {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: #2c1810;
}

.mod-desc {
  font-size: 0.78rem;
  line-height: 1.55;
  color: #4a2a1a;
}

/* ─────────────────────────────────────────────────────────────────────────────
   MARSHAL'S NOTES CARD
   ───────────────────────────────────────────────────────────────────────────── */
.card-notes {
  --accent: #7a5a10;
  background: linear-gradient(150deg, #f2e4b0, #e5d09a);
  display: none;
}

.card-notes.visible {
  display: block;
}

.notes-title {
  font-family: 'Cinzel', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #2c1810;
  margin-bottom: 10px;
}

.note-item {
  font-size: 1.15rem;
  font-style: italic;
  color: #5c3a10;
  line-height: 1.55;
  margin-bottom: 6px;
  padding-left: 16px;
  position: relative;
}

.note-item::before {
  content: '⚠';
  position: absolute;
  left: 0;
  color: #c9a227;
  font-style: normal;
}

/* ─────────────────────────────────────────────────────────────────────────────
   ANIMATIONS
   ───────────────────────────────────────────────────────────────────────────── */

/* Initial stagger — used when the whole grid appears for the first time */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Per-card refresh uses opacity transition defined on .card — no keyframes needed */

/* ─────────────────────────────────────────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 28px 20px;
  color: #5a3a18;
  font-size: 0.75rem;
  font-style: italic;
  line-height: 1.7;
}

/* ─────────────────────────────────────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 620px) {
  .scenario-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }

  .site-title {
    font-size: 1.4rem;
  }

  .btn-roll {
    font-size: 0.9rem;
    padding: 12px 20px;
  }
}
