/* ==========================================
   R0ZZIN STAT BLOCK SYSTEM
   Enhanced D&D-style character blocks
   ========================================== */

.stat-block {
  background: linear-gradient(135deg, #FDF1DC 0%, #F5E6D3 100%);
  border: 2px solid #2C2416;
  border-radius: 8px;
  padding: 20px;
  margin: 30px 0;
  box-shadow: 
    0 4px 16px rgba(44, 36, 22, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  font-family: 'Quattrocento', 'Georgia', serif;
  position: relative;
  overflow: hidden;
}

/* Decorative corner elements */
.stat-block::before,
.stat-block::after {
  content: '';
  position: absolute;
  width: 40px;
  height: 40px;
  border: 2px solid #A73335;
  opacity: 0.3;
}

.stat-block::before {
  top: 0;
  left: 0;
  border-right: none;
  border-bottom: none;
}

.stat-block::after {
  bottom: 0;
  right: 0;
  border-left: none;
  border-top: none;
}

/* Orange decorative border */
.orange-border {
  display: block;
  background: linear-gradient(90deg, #E69A28 0%, #F4C654 50%, #E69A28 100%);
  border: 1px solid #2C2416;
  height: 6px;
  padding: 0 10px 0;
  margin: -20px -20px 15px;
  box-sizing: border-box;
  position: relative;
}

.orange-border::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, rgba(230, 154, 40, 0.4) 0%, transparent 70%);
  border-radius: 50%;
}

/* Gradient dividers */
.gradient {
  background: linear-gradient(90deg, #A73335 0%, rgba(167, 51, 53, 0.1) 50%, #A73335 100%);
  height: 5px;
  margin: 15px 0;
  border-radius: 2px;
  position: relative;
  box-shadow: 0 2px 4px rgba(167, 51, 53, 0.3);
}

.gradient::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
}

/* Character name */
.name {
  font-size: 2.25em;
  font-family: 'Cinzel', 'Trajan Pro', serif;
  font-variant: small-caps;
  font-weight: bold;
  color: #A73335;
  text-shadow: 
    1px 1px 0 rgba(255, 255, 255, 0.5),
    2px 2px 4px rgba(44, 36, 22, 0.2);
  margin-bottom: 5px;
  letter-spacing: 0.05em;
}

/* Character type/size description */
.description {
  font-style: italic;
  color: #4A3F2F;
  font-size: 1.1em;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

/* Text utilities */
.bold {
  font-weight: bold;
  color: #2C2416;
}

.red {
  color: #A73335;
}

.gold {
  color: #E6A925;
}

.blue {
  color: #2B5F8E;
}

/* Ability score table */
.stat-block table {
  width: 100%;
  border: 0;
  border-collapse: separate;
  border-spacing: 8px 0;
  color: #A73335;
  margin: 15px 0;
  background: rgba(167, 51, 53, 0.03);
  border-radius: 6px;
  padding: 10px;
}

.stat-block th,
.stat-block td {
  width: 16.66%;
  text-align: center;
  padding: 8px 4px;
}

.stat-block th {
  font-family: 'Raleway', sans-serif;
  font-size: 0.85em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #2C2416;
  border-bottom: 2px solid #E6A925;
  padding-bottom: 6px;
}

.stat-block td {
  font-weight: bold;
  font-size: 1.2em;
  background: rgba(230, 169, 37, 0.1);
  border-radius: 4px;
  box-shadow: inset 0 1px 3px rgba(44, 36, 22, 0.1);
}

/* Stat modifiers */
.stat-modifier {
  display: block;
  font-size: 0.7em;
  color: #4A3F2F;
  margin-top: 2px;
}

/* Section headers (Actions, Traits, etc.) */
.actions {
  font-size: 1.75em;
  font-family: 'Cinzel', serif;
  font-variant: small-caps;
  margin: 20px 0 10px 0;
  color: #A73335;
  border-bottom: 2px solid #E6A925;
  padding-bottom: 5px;
  letter-spacing: 0.05em;
}

/* Horizontal rule */
.hr {
  background: linear-gradient(90deg, transparent, #A73335, transparent);
  height: 2px;
  margin: 15px 0;
  border: none;
  box-shadow: 0 1px 3px rgba(167, 51, 53, 0.3);
}

/* Individual attacks/abilities */
.attack {
  margin: 10px 0;
  padding: 10px;
  background: rgba(255, 255, 255, 0.3);
  border-left: 3px solid #E6A925;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.attack:hover {
  background: rgba(230, 169, 37, 0.1);
  transform: translateX(5px);
  box-shadow: 0 2px 8px rgba(44, 36, 22, 0.1);
}

.attackname {
  font-weight: bold;
  font-style: italic;
  color: #2B5F8E;
  font-size: 1.1em;
  margin-bottom: 5px;
  display: block;
}

/* Attack details */
.attack-detail {
  color: #4A3F2F;
  line-height: 1.6;
}

/* Damage types with color coding */
.damage-type {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
  font-weight: bold;
  margin: 0 2px;
}

.damage-fire { 
  background: #ff6b35; 
  color: white; 
}

.damage-cold { 
  background: #4ecdc4; 
  color: white; 
}

.damage-lightning { 
  background: #ffd93d; 
  color: #2C2416; 
}

.damage-poison { 
  background: #6bcf7f; 
  color: white; 
}

.damage-necrotic { 
  background: #2d3142; 
  color: white; 
}

.damage-radiant { 
  background: #f4d35e; 
  color: #2C2416; 
}

.damage-psychic { 
  background: #9b5de5; 
  color: white; 
}

/* Challenge rating badge */
.challenge-rating {
  display: inline-block;
  background: linear-gradient(135deg, #A73335 0%, #C94B4D 100%);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 1.1em;
  box-shadow: 0 3px 10px rgba(167, 51, 53, 0.3);
  margin: 10px 0;
}

.challenge-rating::before {
  content: 'CR ';
  font-size: 0.9em;
  opacity: 0.8;
}

/* Legendary actions section */
.legendary-actions {
  background: linear-gradient(135deg, rgba(230, 169, 37, 0.1) 0%, rgba(230, 169, 37, 0.05) 100%);
  border: 2px solid #E6A925;
  border-radius: 8px;
  padding: 15px;
  margin: 20px 0;
}

.legendary-actions .actions {
  margin-top: 0;
  color: #E6A925;
  border-color: #A73335;
}

/* Traits and special abilities */
.trait {
  margin: 12px 0;
  padding-left: 15px;
  border-left: 3px solid #2B5F8E;
}

.trait-name {
  font-weight: bold;
  color: #2B5F8E;
  font-variant: small-caps;
  letter-spacing: 0.05em;
}

/* Spell slots */
.spell-slots {
  display: flex;
  gap: 8px;
  margin: 10px 0;
  flex-wrap: wrap;
}

.spell-slot {
  width: 24px;
  height: 24px;
  border: 2px solid #5B4A7C;
  border-radius: 50%;
  background: white;
  position: relative;
}

.spell-slot.used {
  background: #5B4A7C;
}

.spell-slot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91, 74, 124, 0.3) 0%, transparent 70%);
}

/* Skill proficiencies */
.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0;
}

.skill-tag {
  background: rgba(43, 95, 142, 0.1);
  color: #2B5F8E;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.9em;
  border: 1px solid rgba(43, 95, 142, 0.3);
  font-weight: 600;
}

/* Resistances and immunities */
.resistance-immunity {
  margin: 10px 0;
  padding: 10px;
  background: rgba(58, 90, 64, 0.05);
  border-radius: 6px;
  border-left: 3px solid #3A5A40;
}

.resistance-immunity strong {
  color: #3A5A40;
  text-transform: uppercase;
  font-size: 0.9em;
  letter-spacing: 0.05em;
}

/* Compact stat block variant */
.stat-block-compact {
  padding: 15px;
  margin: 20px 0;
}

.stat-block-compact .name {
  font-size: 1.5em;
}

.stat-block-compact .actions {
  font-size: 1.3em;
  margin: 15px 0 8px 0;
}

/* Print optimization */
@media print {
  .stat-block {
    page-break-inside: avoid;
    box-shadow: none;
    border: 2px solid #000;
  }
  
  .stat-block::before,
  .stat-block::after {
    display: none;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .stat-block {
    padding: 15px;
  }
  
  .name {
    font-size: 1.75em;
  }
  
  .stat-block table {
    font-size: 0.9em;
  }
  
  .actions {
    font-size: 1.5em;
  }
}

/* Animation on load */
@keyframes statBlockReveal {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stat-block {
  animation: statBlockReveal 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Hover effects for interactive stat blocks */
.stat-block.interactive {
  cursor: pointer;
  transition: all 0.3s ease;
}

.stat-block.interactive:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 8px 24px rgba(44, 36, 22, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
