/* Rayndar - Pixel RPG Dark Fantasy Theme */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Roboto+Mono:wght@400;500;700&display=swap');

:root {
  /* Dark Fantasy Palette - Black, Purple, Gray */
  --gold-accent: #ffd700;
  --gold-light: #ffe44d;
  --gold-dark: #ccaa00;

  --purple-dark: #4a1a6b;
  --purple-medium: #6b2a9e;
  --purple-light: #8b4ac8;
  --purple-bright: #a56bdb;

  --gray-darkest: #1a1a1a;
  --gray-darker: #2a2a2a;
  --gray-dark: #3a3a3a;
  --gray-medium: #5a5a5a;
  --gray-light: #8a8a8a;
  --gray-lighter: #aaaaaa;

  --cyan-magic: #00d4ff;
  --red-danger: #ff3366;
  --green-success: #00ff88;

  /* Pixel Perfect Backgrounds */
  --bg-darkest: #0a0a0a;
  --bg-dark: #151515;
  --bg-medium: #202020;
  --bg-card: #1a1a1a;

  /* Text */
  --text-white: #f0f0f0;
  --text-gray: #c0c0c0;
  --text-dim: #909090;

  /* Borders - Pixel style */
  --border-pixel: #4a4a4a;
  --border-light: #6a6a6a;
}

/* Global Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Roboto Mono', monospace;
  background: var(--bg-darkest);
  background-image:
    radial-gradient(circle at 20% 30%, rgba(75, 26, 107, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(0, 212, 255, 0.08) 0%, transparent 50%),
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,.4) 2px, rgba(0,0,0,.4) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0,0,0,.3) 2px, rgba(0,0,0,.3) 4px);
  background-attachment: fixed;
  color: var(--text-white);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Animated Stardust Background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(2px 2px at 20% 30%, rgba(255, 215, 0, 0.8), transparent),
    radial-gradient(2px 2px at 60% 70%, rgba(0, 212, 255, 0.6), transparent),
    radial-gradient(1px 1px at 50% 50%, rgba(139, 74, 200, 0.7), transparent),
    radial-gradient(1px 1px at 80% 10%, rgba(255, 215, 0, 0.5), transparent),
    radial-gradient(2px 2px at 90% 60%, rgba(0, 212, 255, 0.4), transparent),
    radial-gradient(1px 1px at 15% 90%, rgba(255, 215, 0, 0.6), transparent),
    radial-gradient(2px 2px at 35% 20%, rgba(139, 74, 200, 0.5), transparent);
  background-size: 200% 200%;
  background-position: 0% 0%;
  animation: stardust 60s ease-in-out infinite;
  opacity: 0.6;
}

/* Glowing orbs animation */
body::after {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle at 30% 40%, rgba(139, 74, 200, 0.15) 0%, transparent 30%),
    radial-gradient(circle at 70% 60%, rgba(0, 212, 255, 0.1) 0%, transparent 25%),
    radial-gradient(circle at 50% 80%, rgba(255, 215, 0, 0.08) 0%, transparent 20%);
  animation: orbGlow 40s ease-in-out infinite;
}

@keyframes stardust {
  0%, 100% {
    background-position: 0% 0%, 10% 10%, 20% 20%, 30% 30%, 40% 40%, 50% 50%, 60% 60%;
    opacity: 0.6;
  }
  25% {
    background-position: 100% 50%, 90% 60%, 80% 70%, 70% 80%, 60% 90%, 50% 100%, 40% 50%;
    opacity: 0.8;
  }
  50% {
    background-position: 50% 100%, 60% 90%, 70% 80%, 80% 70%, 90% 60%, 100% 50%, 20% 30%;
    opacity: 0.5;
  }
  75% {
    background-position: 0% 50%, 10% 60%, 20% 70%, 30% 80%, 40% 90%, 50% 100%, 80% 70%;
    opacity: 0.7;
  }
}

@keyframes orbGlow {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 1;
  }
  33% {
    transform: translate(30px, -30px) rotate(120deg);
    opacity: 0.7;
  }
  66% {
    transform: translate(-30px, 30px) rotate(240deg);
    opacity: 0.8;
  }
}

/* Ensure content stays above animated background */
.container,
nav,
header,
footer {
  position: relative;
  z-index: 1;
}

/* Pixel border helper */
.pixel-border {
  border: 4px solid var(--border-pixel);
  border-image: repeating-linear-gradient(
    45deg,
    var(--border-pixel) 0,
    var(--border-pixel) 4px,
    var(--border-light) 4px,
    var(--border-light) 8px
  ) 4;
}

/* Typography - Readable Pixel Style */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Press Start 2P', monospace;
  line-height: 1.6;
  margin-bottom: 1rem;
  color: var(--gold-accent);
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.9), 0 0 20px rgba(255, 215, 0, 0.3);
  letter-spacing: 0.05em;
}

h1 {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  text-transform: uppercase;
  border: 4px solid var(--purple-medium);
  padding: 1.5rem;
  margin-bottom: 2rem;
  background: linear-gradient(180deg, var(--bg-medium) 0%, var(--bg-dark) 100%);
  box-shadow:
    inset 0 0 0 2px var(--purple-dark),
    0 8px 0 rgba(0, 0, 0, 0.6),
    0 0 30px rgba(107, 42, 158, 0.4);
  position: relative;
}

h1::before,
h1::after {
  content: '⚔';
  color: var(--purple-light);
  margin: 0 1rem;
  filter: drop-shadow(0 0 10px var(--purple-bright));
}

h2 {
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  margin-top: 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px dashed var(--border-pixel);
  color: var(--purple-bright);
}

h2::before {
  content: '▶';
  color: var(--cyan-magic);
  margin-right: 0.5rem;
}

h3 {
  font-size: clamp(0.8rem, 2vw, 1rem);
  color: var(--text-white);
}

h4 {
  font-size: 0.7rem;
  color: var(--cyan-magic);
  margin-bottom: 0.5rem;
}

p, li {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-gray);
  margin-bottom: 0.75rem;
}

strong {
  color: var(--text-white);
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
}

/* Navigation - Pixel Menu Bar */
nav {
  background: linear-gradient(180deg, var(--gray-darker) 0%, var(--bg-dark) 100%);
  border-bottom: 4px solid var(--purple-dark);
  border-top: 4px solid var(--purple-medium);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow:
    0 4px 0 rgba(0, 0, 0, 0.7),
    inset 0 -2px 0 rgba(139, 74, 200, 0.3),
    0 0 20px rgba(107, 42, 158, 0.3);
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.75rem;
  max-width: 1400px;
  margin: 0 auto;
}

nav a {
  font-family: 'Press Start 2P', monospace;
  color: var(--text-white);
  text-decoration: none;
  padding: 0.5rem 1rem;
  font-size: 0.5rem;
  text-transform: uppercase;
  background: var(--bg-darkest);
  border: 3px solid var(--border-pixel);
  box-shadow:
    inset 0 0 0 1px rgba(139, 74, 200, 0.2),
    3px 3px 0 rgba(0, 0, 0, 0.6);
  transition: all 0.1s ease;
  position: relative;
  letter-spacing: 0.05em;
}

nav a:hover {
  background: var(--purple-dark);
  border-color: var(--purple-medium);
  color: var(--gold-light);
  transform: translate(2px, 2px);
  box-shadow:
    inset 0 0 0 1px var(--purple-light),
    1px 1px 0 rgba(0, 0, 0, 0.6),
    0 0 15px rgba(139, 74, 200, 0.5);
}

nav a:active {
  transform: translate(3px, 3px);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3);
}

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

/* Header - Dark Fantasy Banner Style */
header {
  text-align: center;
  padding: 2rem 1rem;
  margin-bottom: 2rem;
  background: linear-gradient(180deg, var(--bg-medium) 0%, var(--bg-dark) 50%, var(--bg-medium) 100%);
  border: 4px solid var(--border-pixel);
  border-left: 8px solid var(--purple-medium);
  border-right: 8px solid var(--purple-medium);
  box-shadow:
    inset 0 0 0 2px var(--purple-dark),
    0 8px 0 rgba(0, 0, 0, 0.5),
    0 0 30px rgba(107, 42, 158, 0.3);
  position: relative;
}

header::before,
header::after {
  content: '═══════════════════';
  display: block;
  color: var(--border-pixel);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
}

header::before {
  margin-bottom: 1rem;
}

header::after {
  margin-top: 1rem;
}

.subtitle {
  font-family: 'Roboto Mono', monospace;
  color: var(--cyan-magic);
  font-size: 1.5rem;
  font-style: italic;
  margin-top: 0.5rem;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.8), 0 0 15px rgba(0, 212, 255, 0.5);
}

/* Cards - Dark Quest Panel Style */
.card {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-medium) 100%);
  border: 4px solid var(--border-pixel);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow:
    inset 0 0 0 2px var(--gray-darkest),
    6px 6px 0 rgba(0, 0, 0, 0.6);
  transition: all 0.2s ease;
  position: relative;
}

.card::before {
  content: '╔═══════════════════════════════════╗';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  color: var(--border-light);
  font-size: 0.5rem;
  text-align: center;
  opacity: 0.3;
}

.card:hover {
  transform: translate(-2px, -2px);
  box-shadow:
    inset 0 0 0 2px var(--purple-dark),
    8px 8px 0 rgba(0, 0, 0, 0.6),
    0 0 25px rgba(139, 74, 200, 0.4);
  border-color: var(--purple-medium);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px dashed var(--border-pixel);
}

.card-icon {
  font-size: 1.5rem;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.5));
}

/* Grid Layout */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* Lists - Pixel Bullet Style */
.feature-list {
  list-style: none;
  padding: 0;
}

.feature-list li {
  padding: 0.75rem;
  padding-left: 2rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(90deg, rgba(107, 42, 158, 0.2) 0%, transparent 100%);
  border-left: 4px solid var(--purple-medium);
  position: relative;
  font-size: 1.05rem;
}

.feature-list li::before {
  content: '■';
  position: absolute;
  left: 0.75rem;
  color: var(--purple-light);
  font-size: 0.8rem;
}

.feature-list li:hover {
  background: linear-gradient(90deg, rgba(107, 42, 158, 0.3) 0%, rgba(107, 42, 158, 0.1) 100%);
  transform: translateX(4px);
}

/* Badges - Pixel Status Tags */
.badge {
  font-family: 'Press Start 2P', monospace;
  display: inline-block;
  padding: 0.3rem 0.75rem;
  font-size: 0.45rem;
  font-weight: normal;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 2px solid;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.4);
  transition: all 0.1s ease;
}

.badge:hover {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.4);
}

.badge-golden {
  background: var(--gold-accent);
  color: var(--bg-darkest);
  border-color: var(--gold-dark);
}

.badge-pale {
  background: var(--cyan-magic);
  color: var(--bg-darkest);
  border-color: #00a8cc;
}

.badge-fire {
  background: var(--red-danger);
  color: white;
  border-color: #cc0033);
}

.badge-shadow {
  background: var(--purple-dark);
  color: white;
  border-color: var(--purple-medium);
}

.badge-magic {
  background: var(--purple-light);
  color: white;
  border-color: var(--purple-bright);
}

.badge-nature {
  background: var(--green-success);
  color: var(--bg-darkest);
  border-color: #00cc66;
}

/* Cheatsheet - Dark Codex Style */
.cheatsheet {
  background: linear-gradient(180deg, var(--gray-dark) 0%, var(--bg-medium) 10%, var(--bg-medium) 90%, var(--gray-dark) 100%);
  border: 4px solid var(--purple-medium);
  padding: 1.5rem;
  margin: 2rem 0;
  box-shadow:
    inset 0 0 0 2px var(--purple-dark),
    8px 8px 0 rgba(0, 0, 0, 0.6),
    0 0 25px rgba(139, 74, 200, 0.3);
  position: relative;
  color: var(--text-white);
}

.cheatsheet::before {
  content: '';
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  right: 0.5rem;
  bottom: 0.5rem;
  border: 1px dashed rgba(0, 0, 0, 0.1);
  pointer-events: none;
}

.cheatsheet h3 {
  color: var(--gold-accent);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  text-align: center;
  padding-bottom: 0.5rem;
  border-bottom: 3px double var(--gold-accent);
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.8), 0 0 15px rgba(255, 215, 0, 0.4);
}

.cheatsheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.cheatsheet-item {
  background: rgba(42, 42, 42, 0.8);
  padding: 1rem;
  border: 2px solid var(--gray-medium);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.4);
}

.cheatsheet-item h4 {
  color: var(--cyan-magic);
  font-size: 0.6rem;
  margin-bottom: 0.5rem;
  border-bottom: 2px solid var(--cyan-magic);
  padding-bottom: 0.25rem;
}

.cheatsheet-item p {
  font-size: 1rem;
  color: var(--text-gray);
  margin-bottom: 0.25rem;
  line-height: 1.5;
}

.cheatsheet-item strong {
  color: var(--purple-bright);
}

/* Tables - Pixel Grid */
.quick-table,
.monster-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1rem 0;
  font-size: 1rem;
  background: var(--bg-card);
  border: 4px solid var(--border-pixel);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.4);
}

.quick-table th,
.monster-table th {
  background: linear-gradient(180deg, var(--purple-medium) 0%, var(--purple-dark) 100%);
  color: var(--gold-light);
  padding: 0.75rem;
  text-align: left;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 3px solid var(--purple-dark);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.8);
}

.quick-table td,
.monster-table td {
  padding: 0.75rem;
  border-bottom: 2px solid var(--border-pixel);
  color: var(--text-gray);
  font-size: 1.1rem;
}

.quick-table tr:hover,
.monster-table tr:hover {
  background: rgba(107, 42, 158, 0.2);
}

.quick-table tr:last-child td,
.monster-table tr:last-child td {
  border-bottom: none;
}

/* Campaign Warning - Pixel Alert Box */
.campaign-warning {
  background: linear-gradient(135deg, var(--red-danger) 0%, #cc0033 100%);
  border: 4px solid var(--purple-medium);
  padding: 2rem;
  margin: 2rem 0;
  text-align: center;
  box-shadow:
    inset 0 0 0 3px var(--red-danger),
    0 8px 0 rgba(0, 0, 0, 0.6);
  position: relative;
  animation: pixelPulse 2s ease-in-out infinite;
}

@keyframes pixelPulse {
  0%, 100% {
    box-shadow:
      inset 0 0 0 3px var(--red-danger),
      0 8px 0 rgba(0, 0, 0, 0.6);
  }
  50% {
    box-shadow:
      inset 0 0 0 3px var(--purple-medium),
      0 8px 0 rgba(0, 0, 0, 0.6),
      0 0 30px rgba(255, 51, 102, 0.6);
  }
}

.campaign-warning h2 {
  color: var(--gold-light);
  margin-top: 0;
  border: none;
  font-size: 1.2rem;
  animation: pixelShake 0.5s ease-in-out infinite;
}

@keyframes pixelShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

.campaign-warning p {
  font-size: 1.15rem;
  color: var(--text-white);
}

/* Links - Pixel Underline */
a {
  color: var(--purple-bright);
  text-decoration: none;
  border-bottom: 2px dotted var(--purple-bright);
  transition: all 0.2s ease;
  font-weight: normal;
}

a:hover {
  color: var(--cyan-magic);
  border-bottom: 2px solid var(--cyan-magic);
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

/* Footer - Pixel Bottom Bar */
footer {
  text-align: center;
  padding: 2rem;
  margin-top: 3rem;
  background: linear-gradient(180deg, var(--bg-medium) 0%, var(--bg-darkest) 100%);
  border-top: 4px solid var(--purple-dark);
  box-shadow: inset 0 4px 0 rgba(139, 74, 200, 0.1);
}

footer p {
  color: var(--text-dim);
  font-size: 1rem;
}

/* Info/Warning Boxes */
.info-box {
  background: rgba(0, 212, 255, 0.15);
  border: 3px solid var(--cyan-magic);
  border-left: 8px solid var(--cyan-magic);
  padding: 1rem;
  margin: 1rem 0;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5);
}

.info-box h4 {
  color: var(--cyan-magic);
  margin-top: 0;
}

.warning-box {
  background: rgba(255, 215, 0, 0.15);
  border: 3px solid var(--gold-accent);
  border-left: 8px solid var(--gold-accent);
  padding: 1rem;
  margin: 1rem 0;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5);
}

.warning-box h4 {
  color: var(--gold-accent);
  margin-top: 0;
}

/* Two Column Layout */
.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

/* Stat Cards - HP/MP Style */
.stat-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-medium) 100%);
  border: 3px solid var(--border-pixel);
  padding: 1.5rem;
  text-align: center;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.6);
  transition: all 0.2s ease;
}

.stat-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.6);
  border-color: var(--purple-medium);
}

.stat-value {
  font-family: 'Press Start 2P', monospace;
  font-size: 2rem;
  color: var(--gold-accent);
  display: block;
  margin-bottom: 0.5rem;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.8), 0 0 15px rgba(255, 215, 0, 0.4);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-gray);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Quick Reference Box */
.quick-ref {
  background: linear-gradient(135deg, rgba(107, 42, 158, 0.2) 0%, rgba(107, 42, 158, 0.1) 100%);
  border-left: 6px solid var(--purple-medium);
  border: 3px solid var(--purple-medium);
  padding: 1.5rem;
  margin: 1.5rem 0;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
}

.quick-ref h4 {
  color: var(--purple-bright);
  margin-top: 0;
  font-size: 0.7rem;
}

.quick-ref ul {
  list-style: none;
  padding: 0;
}

.quick-ref li {
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--border-pixel);
  font-size: 1.1rem;
}

.quick-ref li:last-child {
  border-bottom: none;
}

/* Glow effects */
.glow-golden {
  color: var(--gold-light);
  text-shadow: 0 0 15px var(--gold-accent), 0 0 30px rgba(255, 215, 0, 0.5);
}

.glow-pale {
  color: var(--cyan-magic);
  text-shadow: 0 0 15px var(--cyan-magic), 0 0 30px rgba(0, 212, 255, 0.5);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .container {
    padding: 1.5rem;
  }

  .grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  nav ul {
    gap: 0.25rem;
    padding: 0.5rem;
  }

  nav a {
    padding: 0.5rem 0.75rem;
    font-size: 0.45rem;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .cheatsheet-grid,
  .two-col {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 1rem;
    padding: 1rem;
  }

  h1::before,
  h1::after {
    display: none;
  }

  h2 {
    font-size: 0.9rem;
  }

  h3 {
    font-size: 0.75rem;
  }

  .card,
  .cheatsheet {
    padding: 1rem;
  }

  .quick-table,
  .monster-table {
    font-size: 0.9rem;
  }

  .quick-table th,
  .monster-table th {
    font-size: 0.5rem;
    padding: 0.5rem;
  }

  .quick-table td,
  .monster-table td {
    padding: 0.5rem;
    font-size: 1rem;
  }

  header {
    padding: 1.5rem 1rem;
  }

  .subtitle {
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  nav a {
    padding: 0.4rem 0.6rem;
    font-size: 0.4rem;
  }

  h1 {
    font-size: 0.85rem;
    padding: 0.75rem;
  }

  h2 {
    font-size: 0.75rem;
  }

  .badge {
    font-size: 0.4rem;
    padding: 0.25rem 0.5rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }
}

/* Scrollbar - Pixel Style */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg-darkest);
  border: 2px solid var(--border-pixel);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--purple-medium), var(--purple-dark));
  border: 2px solid var(--bg-darkest);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--purple-light), var(--purple-medium));
}

/* Print Styles */
@media print {
  body {
    background: white;
    color: black;
  }

  nav, footer {
    display: none;
  }

  .card, .cheatsheet {
    page-break-inside: avoid;
    border: 2px solid #000;
    box-shadow: none;
  }

  a {
    color: #000;
    text-decoration: underline;
  }
}

/* Pixel animations for fun */
@keyframes pixelFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-4px); }
}

.card-icon {
  animation: pixelFloat 2s ease-in-out infinite;
}

/* Pixel Art Decorative Elements */
.pixel-decoration {
  position: absolute;
  font-size: 3rem;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
  filter: drop-shadow(0 0 10px currentColor);
  animation: pixelFloat 4s ease-in-out infinite;
}

.pixel-decoration.dragon {
  content: '🐉';
  color: var(--red-danger);
  top: 10%;
  right: 5%;
  font-size: 4rem;
  animation: dragonFloat 8s ease-in-out infinite;
}

.pixel-decoration.sword {
  content: '⚔️';
  color: var(--cyan-magic);
  bottom: 10%;
  left: 5%;
  transform: rotate(-45deg);
  animation: swordSway 6s ease-in-out infinite;
}

.pixel-decoration.shield {
  content: '🛡️';
  color: var(--purple-medium);
  top: 15%;
  left: 8%;
  animation: shieldBob 5s ease-in-out infinite;
}

.pixel-decoration.scroll {
  content: '📜';
  color: var(--gold-accent);
  top: 60%;
  right: 8%;
  animation: scrollFloat 7s ease-in-out infinite;
}

.pixel-decoration.wizard {
  content: '🧙';
  color: var(--purple-bright);
  bottom: 20%;
  right: 10%;
  animation: wizardHover 10s ease-in-out infinite;
}

.pixel-decoration.monster {
  content: '👹';
  color: var(--red-danger);
  top: 40%;
  left: 3%;
  animation: monsterPulse 4s ease-in-out infinite;
}

.pixel-decoration.treasure {
  content: '💎';
  color: var(--gold-accent);
  bottom: 30%;
  right: 12%;
  animation: treasureSparkle 3s ease-in-out infinite;
}

.pixel-decoration.castle {
  content: '🏰';
  color: var(--gray-light);
  top: 5%;
  left: 15%;
  font-size: 3.5rem;
  animation: castleStand 12s ease-in-out infinite;
}

@keyframes dragonFloat {
  0%, 100% {
    transform: translateY(0px) translateX(0px) rotate(0deg);
    opacity: 0.15;
  }
  50% {
    transform: translateY(-20px) translateX(10px) rotate(5deg);
    opacity: 0.25;
  }
}

@keyframes swordSway {
  0%, 100% {
    transform: rotate(-45deg) translateY(0px);
    opacity: 0.15;
  }
  50% {
    transform: rotate(-40deg) translateY(-10px);
    opacity: 0.2;
  }
}

@keyframes shieldBob {
  0%, 100% {
    transform: translateY(0px) scale(1);
    opacity: 0.15;
  }
  50% {
    transform: translateY(-8px) scale(1.05);
    opacity: 0.22;
  }
}

@keyframes scrollFloat {
  0%, 100% {
    transform: translateY(0px) rotate(-2deg);
    opacity: 0.18;
  }
  50% {
    transform: translateY(-15px) rotate(2deg);
    opacity: 0.28;
  }
}

@keyframes wizardHover {
  0%, 100% {
    transform: translateY(0px);
    opacity: 0.2;
    filter: drop-shadow(0 0 10px var(--purple-bright));
  }
  50% {
    transform: translateY(-12px);
    opacity: 0.3;
    filter: drop-shadow(0 0 20px var(--purple-bright));
  }
}

@keyframes monsterPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.15;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.25;
  }
}

@keyframes treasureSparkle {
  0%, 100% {
    transform: scale(1) rotate(0deg);
    opacity: 0.2;
    filter: drop-shadow(0 0 5px var(--gold-accent));
  }
  50% {
    transform: scale(1.15) rotate(10deg);
    opacity: 0.35;
    filter: drop-shadow(0 0 15px var(--gold-accent));
  }
}

@keyframes castleStand {
  0%, 100% {
    opacity: 0.12;
  }
  50% {
    opacity: 0.18;
  }
}

/* Page-specific decoration containers */
.page-decorations {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* Inline pixel art elements */
.pixel-char {
  display: inline-block;
  font-size: 1.2em;
  margin: 0 0.2rem;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.5));
  animation: pixelFloat 3s ease-in-out infinite;
}

.pixel-char.bounce {
  animation: pixelBounce 2s ease-in-out infinite;
}

@keyframes pixelBounce {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* Corner decorations */
.corner-decoration {
  position: fixed;
  font-size: 2.5rem;
  opacity: 0.2;
  pointer-events: none;
  z-index: 0;
}

.corner-decoration.top-left {
  top: 80px;
  left: 20px;
}

.corner-decoration.top-right {
  top: 80px;
  right: 20px;
}

.corner-decoration.bottom-left {
  bottom: 20px;
  left: 20px;
}

.corner-decoration.bottom-right {
  bottom: 20px;
  right: 20px;
}

/* Hide decorations on small screens */
@media (max-width: 768px) {
  .pixel-decoration,
  .corner-decoration {
    display: none;
  }
}

/* Pixel Art RPG Immersive Effects */
.pixel-scanline {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15),
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 2px
  );
  animation: scanlineMove 8s linear infinite;
  opacity: 0.3;
}

@keyframes scanlineMove {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(10px);
  }
}

/* Pixel borders and frames */
.pixel-frame {
  position: relative;
  padding: 1.5rem;
  background: var(--bg-card);
}

.pixel-frame::before,
.pixel-frame::after {
  content: '';
  position: absolute;
  background: var(--purple-medium);
}

.pixel-frame::before {
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
}

.pixel-frame::after {
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
}

/* RPG Dialog Box Style */
.rpg-dialog {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-medium) 100%);
  border: 4px solid var(--purple-medium);
  padding: 1.5rem;
  margin: 1.5rem 0;
  position: relative;
  box-shadow:
    inset 0 0 0 2px var(--purple-dark),
    8px 8px 0 rgba(0, 0, 0, 0.6),
    0 0 30px rgba(139, 74, 200, 0.3);
}

.rpg-dialog::before {
  content: '▼';
  position: absolute;
  bottom: -12px;
  left: 30px;
  color: var(--purple-medium);
  font-size: 1.5rem;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.8));
}

/* Pixel health/mana bar style */
.pixel-bar {
  width: 100%;
  height: 24px;
  background: var(--bg-darkest);
  border: 3px solid var(--border-pixel);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5);
}

.pixel-bar-fill {
  height: 100%;
  background: linear-gradient(180deg, var(--green-success) 0%, #00cc66 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.3);
  transition: width 0.3s ease;
}

.pixel-bar-fill.mana {
  background: linear-gradient(180deg, var(--cyan-magic) 0%, #00a8cc 100%);
}

/* Floating pixel particle effect */
.pixel-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--gold-accent);
  opacity: 0;
  animation: particleFloat 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes particleFloat {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  25% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(-200px) translateX(50px);
    opacity: 0;
  }
}

/* Pixel art character sprites (inline decorative) */
.sprite {
  display: inline-block;
  font-size: 2em;
  image-rendering: pixelated;
  animation: spriteIdle 2s ease-in-out infinite;
}

@keyframes spriteIdle {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

/* Glitch effect for special elements */
.pixel-glitch {
  position: relative;
  animation: glitchAnim 3s infinite;
}

@keyframes glitchAnim {
  0%, 90%, 100% {
    transform: translate(0);
    opacity: 1;
  }
  92% {
    transform: translate(-2px, 2px);
    opacity: 0.8;
  }
  94% {
    transform: translate(2px, -2px);
    opacity: 0.9;
  }
  96% {
    transform: translate(-2px, -2px);
    opacity: 0.85;
  }
}

/* Menu hover effects - more pronounced */
nav a {
  position: relative;
  overflow: hidden;
}

nav a::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(139, 74, 200, 0.4) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease;
}

nav a:hover::after {
  width: 200px;
  height: 200px;
}

/* Pixel coin/loot indicator */
.pixel-loot {
  display: inline-block;
  font-size: 1.2em;
  animation: lootBounce 1.5s ease-in-out infinite;
  filter: drop-shadow(0 0 5px var(--gold-accent));
}

@keyframes lootBounce {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-10px) rotate(10deg);
  }
  75% {
    transform: translateY(-5px) rotate(-5deg);
  }
}

/* Retro pixel grid overlay */
.pixel-grid-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  background-image:
    linear-gradient(rgba(139, 74, 200, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 74, 200, 0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 0.5;
}

/* Character stat display */
.stat-display {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-darkest);
  border: 3px solid var(--border-pixel);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.6);
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  color: var(--gold-accent);
}

.stat-display .icon {
  font-size: 1.2em;
  animation: pixelFloat 2s ease-in-out infinite;
}

/* Atmospheric lighting effects */
.light-ray {
  position: fixed;
  width: 200px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.05), transparent);
  pointer-events: none;
  z-index: 0;
  animation: lightRayMove 15s linear infinite;
}

@keyframes lightRayMove {
  0% {
    left: -200px;
  }
  100% {
    left: 100%;
  }
}

/* Form Styles for Homebrew Class Submission */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  color: var(--purple-bright);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input[type="text"],
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-darkest);
  border: 3px solid var(--border-pixel);
  color: var(--text-white);
  font-family: 'Roboto Mono', monospace;
  font-size: 1rem;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5);
  transition: all 0.2s ease;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--purple-medium);
  box-shadow: inset 0 0 0 1px var(--purple-dark), 0 0 15px rgba(139, 74, 200, 0.3);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

/* Button Styles */
.btn-primary,
.btn-secondary,
.btn-delete {
  font-family: 'Press Start 2P', monospace;
  padding: 0.75rem 1.5rem;
  font-size: 0.5rem;
  text-transform: uppercase;
  border: 3px solid;
  cursor: pointer;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.6);
  transition: all 0.1s ease;
  letter-spacing: 0.05em;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

.btn-primary {
  background: var(--purple-medium);
  color: var(--text-white);
  border-color: var(--purple-dark);
}

.btn-primary:hover {
  background: var(--purple-light);
  border-color: var(--purple-medium);
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6), 0 0 15px rgba(139, 74, 200, 0.5);
}

.btn-primary:active {
  transform: translate(4px, 4px);
  box-shadow: none;
}

.btn-secondary {
  background: var(--gray-dark);
  color: var(--text-white);
  border-color: var(--gray-medium);
}

.btn-secondary:hover {
  background: var(--gray-medium);
  border-color: var(--gray-light);
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6);
}

.btn-secondary:active {
  transform: translate(4px, 4px);
  box-shadow: none;
}

.btn-delete {
  background: var(--red-danger);
  color: var(--text-white);
  border-color: #cc0033;
  margin-top: 1rem;
}

.btn-delete:hover {
  background: #ff5577;
  border-color: var(--red-danger);
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6), 0 0 15px rgba(255, 51, 102, 0.5);
}

.btn-delete:active {
  transform: translate(4px, 4px);
  box-shadow: none;
}

/* Homebrew Card Styling */
.homebrew-card {
  border-color: var(--purple-bright);
  background: linear-gradient(135deg, rgba(107, 42, 158, 0.15) 0%, var(--bg-card) 50%, var(--bg-medium) 100%);
}

.homebrew-card:hover {
  border-color: var(--cyan-magic);
  box-shadow:
    inset 0 0 0 2px rgba(0, 212, 255, 0.3),
    8px 8px 0 rgba(0, 0, 0, 0.6),
    0 0 30px rgba(0, 212, 255, 0.4);
}
