/* ============================================================
   D&D PARTY GENERATOR — STYLESHEET
   Load order:  impheim.css  →  tool-page.css  →  this file
   ============================================================ */

/* ---- Local tokens ---- */
:root {
  --gold-dnd:     #f0c040;
  --gold-dnd-dim: #c8a030;
  --card-border:  rgba(255, 255, 255, 0.08);
}

/* ---- Print: party-specific layout ---- */
@media print {
  .page-header { padding: 6px 0; text-align: center; width: 100%; }
  h1 { font-size: 1.5em; }
  .party-name { animation: none !important; min-height: 1.5em; }
  .party {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: .6rem !important;
    width: 100% !important;
    padding: 0 !important;
    justify-content: unset !important;
  }
  .card {
    width: auto !important;
    box-shadow: none !important;
    border: 1px solid rgba(255,255,255,.12) !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .stats { flex-wrap: wrap; }
}

/* ---- PARTY NAME ---- */
.party-name {
  font-family: var(--font-d);
  font-size: 1.25em; font-weight: 600; letter-spacing: 2px;
  text-align: center; margin-bottom: 30px;
  background: linear-gradient(90deg, #e09828, #ffd050, #e09828);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 6s linear infinite;
  min-height: 2em;
}
@keyframes shimmer {
  0%   { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* ---- PARTY GRID ---- */
.party {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 20px; width: 100%; padding: 0 10px;
}

/* ---- CARD ---- */
.card {
  width: clamp(280px, 18vw, 480px);
  border-radius: 20px; overflow: hidden;
  border: 1px solid var(--card-border);
  box-shadow:
    0 6px 28px rgba(0,0,0,.55),
    inset 0 1px 0 rgba(255,255,255,.055),
    inset 0 -1px 0 rgba(0,0,0,.3);
  transition: transform .38s cubic-bezier(.34,1.56,.64,1), box-shadow .28s ease;
  position: relative;
  font-size: clamp(14px, 0.9vw, 22px);
  padding: 0;
  background: initial;
}
.card:hover {
  transform: translateY(-12px) scale(1.018);
  box-shadow:
    0 24px 60px rgba(0,0,0,.7),
    0 0 0 1.5px var(--accent),
    0 0 30px color-mix(in srgb, var(--accent) 25%, transparent),
    inset 0 1px 0 rgba(255,255,255,.07);
}
.card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--accent); z-index: 2;
  box-shadow: 0 0 14px var(--accent), 0 0 4px rgba(255,255,255,.4);
}

/* ---- PORTRAIT ---- */
.portrait { width: 100%; aspect-ratio: 205 / 230; position: relative; overflow: hidden; }
.portrait svg { width: 100%; height: 100%; }
.portrait::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.52) 100%);
  pointer-events: none;
}

/* ---- CARD INFO ---- */
.info { padding: 0.9em 1.1em 1.15em; background: inherit; }
.name {
  font-family: var(--font-d);
  font-size: 1.08em; font-weight: 700; color: var(--gold-dnd);
  margin-bottom: 0.4em; letter-spacing: 0.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.class-badge {
  display: inline-block; font-size: 0.84em; font-weight: 600;
  letter-spacing: 0.4px; padding: 0.2em 0.7em 0.25em;
  border-radius: 20px; background: rgba(0,0,0,.35);
  border: 1px solid var(--accent); color: var(--accent-text);
  margin-bottom: 0.5em; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 100%;
  font-family: 'Palatino Linotype', Georgia, serif;
}
.bg-line   { font-size: 0.9em;  color: rgba(220,210,240,.88); margin-bottom: 0.2em; font-family: 'Palatino Linotype', Georgia, serif; }
.age-line  { font-size: 0.84em; color: rgba(220,210,240,.72); margin-bottom: 0.2em; }
.mark-line { font-size: 0.8em;  color: rgba(220,210,240,.62); font-style: italic; margin-bottom: 0.6em; line-height: 1.4; }

/* ---- STATS ---- */
.stats { display: flex; justify-content: center; gap: 0.3em; flex-wrap: wrap; margin-bottom: 0.75em; }
.stat {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
  padding: 0.2em 0.45em; border-radius: 6px;
  font-size: 0.75em; color: rgba(220,210,240,.90); letter-spacing: 0.3px;
  font-family: var(--font-d);
}
.stat.high { background: rgba(255,255,255,.13); border-color: rgba(255,255,255,.22); }

/* ---- TRAITS ---- */
.traits {
  text-align: left; border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 0.7em; margin-top: 0.1em;
  display: flex; flex-direction: column; gap: 0.45em;
}
.trait { font-size: 0.86em; line-height: 1.5; color: rgba(220,210,240,.92); font-family: 'Palatino Linotype', Georgia, serif; }
.trait b {
  font-family: var(--font-d);
  font-weight: 600; font-style: normal;
  text-transform: uppercase; font-size: 0.72em;
  letter-spacing: 0.9px; margin-right: 0.2em;
}

/* ---- CARD ENTRANCE ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px) scale(.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1);   }
}
.card.anim { animation: fadeUp .48s cubic-bezier(.34,1.56,.64,1) both; }

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
  .card { width: 90vw; max-width: 380px; font-size: 15px; }
}
