:root {
  --bg-color: #1a1c1a;
  --card-bg: #2d302d;
  --text-main: #e0e5e0;
  --accent-color: #89b449; /* Sickly Green */
  --gothic-font: 'Cinzel Decorative', Georgia, serif;
  --ui-font: 'Inter', sans-serif;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--ui-font);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  transition: background 0.3s ease;
  overflow-x: hidden;
}

body.chaos-active {
  background-color: #0b1a08;
  animation: backgroundPulse 0.2s infinite alternate;
}

.wrapper {
  width: 100%;
  max-width: 550px;
  padding: 20px;
  box-sizing: border-box;
  text-align: center;
}

/* --- Hero Banner Display --- */
.hero-container {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #3d423d;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  margin-bottom: 20px;
  background: #111;
}

.hero-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  max-height: 220px;
  filter: grayscale(15%) brightness(85%);
  transition: filter 0.3s ease;
}

.hero-container:hover .hero-image {
  filter: grayscale(0%) brightness(100%);
}

h1 {
  font-family: var(--gothic-font);
  color: var(--accent-color);
  margin-bottom: 5px;
  font-size: 2rem;
}

.subtitle {
  color: #a0a5a0;
  margin-top: 0;
  font-size: 0.95rem;
}

.card {
  background: var(--card-bg);
  border: 2px solid #3d423d;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transition: all 0.3s ease;
}

/* Screen Shake Keyframes */
@keyframes screenShake {
  0% { transform: translate(2px, 1px) rotate(0deg); }
  20% { transform: translate(-3px, -2px) rotate(-1deg); }
  40% { transform: translate(1px, -1px) rotate(1deg); }
  60% { transform: translate(-2px, 2px) rotate(0deg); }
  80% { transform: translate(2px, 1px) rotate(-1deg); }
  100% { transform: translate(-1px, -2px) rotate(0deg); }
}

@keyframes backgroundPulse {
  0% { box-shadow: inset 0 0 50px rgba(137, 180, 73, 0.1); }
  100% { box-shadow: inset 0 0 100px rgba(137, 180, 73, 0.3); }
}

.shake {
  animation: screenShake 0.15s infinite;
  border-color: var(--accent-color);
}

.form-group {
  text-align: left;
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  color: #b0b5b0;
}

input, select {
  width: 100%;
  padding: 12px;
  background: #1e201e;
  border: 1px solid #444;
  border-radius: 6px;
  color: #fff;
  font-size: 1rem;
  box-sizing: border-box;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent-color);
}

button {
  width: 100%;
  padding: 15px;
  background: var(--accent-color);
  color: #111;
  border: none;
  font-weight: 600;
  font-size: 1.1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.1s, background 0.2s;
}

button:hover { background: #9bc758; }
button:active { transform: scale(0.98); }

/* --- Optimized Action & Sharing Grid --- */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 15px;
}

.share-row {
  display: flex;
  gap: 6px;
  width: 100%;
}

.share-row button, .btn-secondary {
  flex: 1;
  padding: 10px 8px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 4px;
}

button.btn-x {
  background: #111;
  color: #fff;
  border: 1px solid #333;
}
button.btn-x:hover { background: #000; border-color: #555; }

button.btn-copy {
  background: #4a5568;
  color: #fff;
}
button.btn-copy:hover { background: #5a6578; }
button.btn-copy.success { background: #2f855a !important; }

.btn-secondary {
  background: #333;
  color: #bbb;
  padding: 12px;
  font-size: 0.9rem;
}
.btn-secondary:hover { background: #444; color: #fff; }

/* --- Sleek Sponsor Link --- */
.sponsor-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.75rem;
  color: #a0a5a0;
 text-decoration: none;
  letter-spacing: 0.5px;
  border: 1px dashed #444;
  padding: 6px 12px;
  border-radius: 20px;
  transition: all 0.2s ease;
  background: rgba(0, 0, 0, 0.15);
}

.sponsor-link:hover {
  color: var(--accent-color);
  border-color: var(--accent-color);
  background: rgba(137, 180, 73, 0.05);
  transform: translateY(-1px);
}

.plague-icon { font-size: 5rem; margin-bottom: 15px; }
.brewing-text { font-family: var(--gothic-font); color: var(--accent-color); letter-spacing: 2px; }

/* Parchment Layout */
.certificate {
  background: #f4ebd0; 
  color: #2b261d;
  padding: 30px 20px;
  border: 8px double #8c764d;
  border-radius: 4px;
  margin-bottom: 25px;
}

.certificate h2 {
  font-family: var(--gothic-font);
  margin-top: 10px;
  font-size: 1.5rem;
  border-bottom: 1px solid #8c764d;
  padding-bottom: 5px;
}

.decree { font-style: italic; font-size: 0.9rem; }

#plagueOutput {
  font-family: var(--gothic-font);
  font-size: 1.6rem;
  color: #8a1c1c; 
  margin: 20px 0;
  line-height: 1.3;
}

#curseMessage {
  font-size: 0.95rem;
  font-weight: 600;
  border-top: 1px dashed #8c764d;
  padding-top: 15px;
}

.seal { font-size: 2rem; opacity: 0.8; }
.class-badge {
  display: inline-block;
  background: #8a1c1c;
  color: #fff;
  padding: 4px 10px;
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: bold;
  border-radius: 3px;
  margin-top: 10px;
}

.hidden { display: none !important; }