:root {
  --bg: #10070d;
  --bg-elevated: #25131d;
  --bg-panel: rgba(34, 17, 27, 0.86);
  --bg-panel-strong: rgba(48, 22, 34, 0.94);
  --border: rgba(244, 220, 224, 0.14);
  --border-strong: rgba(242, 203, 179, 0.36);
  --text: #fff4f0;
  --muted: #d0b7bd;
  --soft: #a1828e;
  --accent: #e6b4bd;
  --accent-strong: #ffe9df;
  --ember: #a91f3e;
  --gold: #e7bd83;
  --cobalt: #8ca7c8;
  --violet: #9b6e8d;
  --shadow: rgba(5, 1, 5, 0.58);
  --success: #d7efdc;
  --warning: #f0d39a;
  --danger: #ff9d9d;
  --danger-soft: rgba(169, 31, 62, 0.2);
  --glow: rgba(246, 205, 205, 0.16);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --transition: 180ms ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  font-family: 'Manrope', sans-serif;
  color: var(--text);
  background:
    radial-gradient(ellipse at 77% 12%, rgba(255, 229, 221, 0.16), transparent 19%),
    radial-gradient(ellipse at 15% 82%, rgba(169, 31, 62, 0.24), transparent 25%),
    radial-gradient(circle at 52% 42%, rgba(101, 24, 49, 0.24), transparent 38%),
    linear-gradient(135deg, #0d060b 0%, #1c0c17 48%, #10070d 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url('https://images.unsplash.com/photo-1511497584788-876760111969?auto=format&fit=crop&w=1800&q=80') center center / cover no-repeat fixed;
  opacity: 0.1;
  filter: grayscale(0.45) sepia(0.2) hue-rotate(292deg) saturate(1.25) brightness(0.42) contrast(1.2);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 79% 13%, rgba(255, 242, 233, 0.08) 0 2px, transparent 3px),
    radial-gradient(circle at 79% 13%, transparent 0 82px, rgba(255, 225, 222, 0.09) 83px, transparent 85px),
    linear-gradient(180deg, rgba(17, 5, 13, 0.18), rgba(17, 5, 13, 0.8));
  pointer-events: none;
  z-index: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1400px, calc(100% - 32px));
  min-height: 92vh;
  margin: 28px auto;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  border: 1px solid var(--border);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(38, 16, 29, 0.86), rgba(17, 8, 15, 0.84));
  box-shadow: 0 28px 64px var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  overflow: hidden;
  backdrop-filter: blur(16px);
}

.sidebar {
  padding: 28px 20px 24px;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(65, 26, 45, 0.58), rgba(20, 8, 17, 0.76));
  backdrop-filter: blur(14px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 8px 18px;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(145deg, rgba(255, 225, 222, 0.22), rgba(169, 31, 62, 0.16));
  color: var(--accent-strong);
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  box-shadow: inset 0 0 18px rgba(255, 247, 238, 0.05), 0 0 24px rgba(207, 83, 110, 0.18);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  mix-blend-mode: screen;
}

.welcome-brand .brand-mark {
  width: clamp(150px, 32vw, 220px);
  height: clamp(150px, 32vw, 220px);
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}

.brand-mark img[hidden] {
  display: none;
}

.brand-mark span {
  font-family: 'Cinzel', serif;
}

.brand-copy h1,
.section-intro h2,
.review-panel h3,
.complete-panel h2,
.summary-hero {
  font-family: 'Cinzel', serif;
  letter-spacing: 0.12em;
}

.brand-copy h1 {
  font-size: 1.35rem;
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.22em;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.66rem;
}

.progress-block {
  margin-top: 10px;
  padding: 16px 12px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(38, 15, 28, 0.66);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.76rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.progress-meta strong {
  color: var(--text);
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #a91f3e, #f1c6b5, #e7bd83);
  box-shadow: 0 0 16px rgba(220, 94, 119, 0.34);
  transition: width 220ms ease;
}

.step-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
}

.step-item {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  transition: var(--transition);
}

.step-item:hover {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.step-item.active {
  background: rgba(192, 185, 164, 0.06);
  border-color: rgba(192, 185, 164, 0.26);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(192, 185, 164, 0.12);
}

.step-item.done {
  color: var(--text);
}

.step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.step-item.active .step-index,
.step-item.done .step-index {
  background: rgba(192, 185, 164, 0.14);
  border-color: rgba(192, 185, 164, 0.26);
  color: var(--accent-strong);
}

.step-item .step-copy {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.step-item .step-label {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: inherit;
}

.step-item .step-title {
  margin-top: 4px;
  font-size: 0.85rem;
  color: inherit;
}

.step-status {
  font-size: 0.7rem;
  color: var(--success);
}

.main-panel {
  position: relative;
  padding: 24px 30px 24px;
  background: linear-gradient(180deg, rgba(12, 16, 21, 0.68), rgba(11, 13, 17, 0.72));
  backdrop-filter: blur(12px);
}

.status-banner {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(214, 141, 141, 0.3);
  background: var(--danger-soft);
  color: #f7d3d3;
  font-size: 0.95rem;
  box-shadow: 0 10px 30px rgba(214, 141, 141, 0.08);
}

.status-banner.hidden {
  display: none;
}

.step-content {
  min-height: 620px;
  animation: fadeIn 260ms ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-intro {
  margin-bottom: 22px;
}

.section-intro .eyebrow {
  margin-bottom: 12px;
}

.section-intro h2 {
  margin: 0;
  font-size: clamp(1.6rem, 2vw, 2.2rem);
  color: var(--text);
  line-height: 1.2;
}

.section-subtitle {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field-card,
.option-panel,
.codex-panel,
.review-panel,
.complete-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(16, 22, 27, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.field-card {
  padding: 18px 18px 16px;
}

.field-label {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.field-hint {
  font-size: 0.74rem;
  color: var(--soft);
  letter-spacing: 0.03em;
}

.input-shell,
.textarea-shell {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(7, 10, 13, 0.7);
  color: var(--text);
  padding: 14px 16px;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.input-shell:focus,
.textarea-shell:focus {
  outline: none;
  border-color: rgba(192, 185, 164, 0.5);
  box-shadow: 0 0 0 3px rgba(192, 185, 164, 0.06);
}

.input-shell {
  min-height: 52px;
}

.select-shell {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%),
    linear-gradient(to right, transparent, transparent);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px),
    100% 0;
  background-size: 6px 6px, 6px 6px, 2.5em 2.5em;
  background-repeat: no-repeat;
  padding-right: 44px;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.option-card {
  position: relative;
  display: block;
  width: 100%;
  padding: 14px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(10, 14, 18, 0.8);
  color: var(--text);
  text-align: left;
  transition: var(--transition);
}

.option-card:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
}

.option-card.selected {
  border-color: rgba(192, 185, 164, 0.55);
  background: linear-gradient(180deg, rgba(192, 185, 164, 0.08), rgba(255, 255, 255, 0.01));
  box-shadow: 0 0 0 1px rgba(192, 185, 164, 0.2), 0 12px 20px rgba(20, 24, 29, 0.3);
}

.option-card .option-name {
  display: block;
  font-weight: 600;
  color: var(--text);
}

.option-card .option-description {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.option-card .option-pill {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
}

.option-card.selected .option-pill {
  background: var(--accent-strong);
  box-shadow: 0 0 12px rgba(224, 215, 193, 0.5);
}

.selection-preview {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(192, 185, 164, 0.05);
  border: 1px solid rgba(192, 185, 164, 0.18);
  color: var(--muted);
  min-height: 54px;
}

.selection-preview strong {
  color: var(--text);
}

.codex-panel {
  padding: 18px;
}

.codex-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.codex-header .field-label {
  margin: 0;
}

.char-counter {
  color: var(--muted);
  font-size: 0.8rem;
}

.textarea-shell {
  min-height: 260px;
  resize: vertical;
  line-height: 1.7;
}

.consent-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.option-panel {
  padding: 18px;
}

.option-panel h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.option-panel .panel-copy {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.preference-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.preference-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 12px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(10, 14, 18, 0.8);
  color: var(--muted);
  transition: var(--transition);
}

.preference-item:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.preference-item.selected {
  border-color: rgba(192, 185, 164, 0.55);
  background: linear-gradient(180deg, rgba(192, 185, 164, 0.08), rgba(255, 255, 255, 0.02));
  color: var(--text);
}

.review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 18px;
}

.review-panel {
  padding: 22px 20px;
}

.summary-hero {
  margin: 0 0 20px;
  font-size: clamp(1.1rem, 1.4vw, 1.5rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.015);
}

.summary-label {
  color: var(--soft);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.summary-value {
  font-size: 1rem;
  color: var(--text);
}

.history-block {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.history-block h4,
.consent-summary h4 {
  margin: 0 0 12px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.74rem;
}

.history-text {
  color: var(--text);
  line-height: 1.8;
  white-space: pre-wrap;
}

.consent-summary {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(16, 22, 27, 0.9);
}

.image-upload-panel,
.review-image-panel {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(48, 21, 35, 0.82), rgba(22, 10, 19, 0.9));
}

.drop-zone {
  min-height: 330px;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 28px;
  border: 1px dashed rgba(239, 169, 173, 0.46);
  border-radius: 18px;
  background: rgba(13, 5, 11, 0.58);
  color: var(--muted);
  text-align: center;
  transition: var(--transition);
}

.drop-zone:hover,
.drop-zone:focus-within {
  border-color: var(--accent);
  background: rgba(169, 31, 62, 0.1);
}

.upload-placeholder,
.image-preview-wrap {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.upload-placeholder strong {
  color: var(--text);
  font-size: 1.05rem;
}

.upload-placeholder span,
.image-details span,
.image-note,
.review-ai-result {
  color: var(--muted);
  font-size: 0.84rem;
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--accent-strong);
  font-size: 1.6rem;
}

.upload-action {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.image-preview {
  width: min(100%, 340px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
}

.image-details {
  display: grid;
  gap: 3px;
  text-align: center;
}

.image-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.86rem;
}

.image-status span:last-child {
  margin-left: auto;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}

.image-status-approved { color: var(--success); }
.image-status-warning { color: var(--warning); }
.image-status-rejected,
.image-status-missing { color: var(--danger); }

.image-error {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 157, 157, 0.36);
  border-radius: 12px;
  background: var(--danger-soft);
  color: var(--danger);
  line-height: 1.5;
}

.image-note {
  margin: 16px 0 0;
  line-height: 1.6;
}

.review-image-panel {
  grid-column: 1 / -1;
}

.review-image-panel h4 {
  margin: 0 0 14px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.74rem;
}

.review-image {
  display: block;
  width: min(100%, 260px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
}

.review-image.missing {
  display: grid;
  place-items: center;
  min-height: 100px;
  color: var(--muted);
  border: 1px dashed var(--border);
}

.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(192, 185, 164, 0.18);
  background: rgba(192, 185, 164, 0.06);
  color: var(--text);
  font-size: 0.8rem;
}

.download-sheet {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 1200px;
  min-height: 1500px;
  padding: 64px 72px;
  background: linear-gradient(180deg, #080b10 0%, #0d1218 100%);
  color: var(--text);
  border: 1px solid rgba(219, 204, 171, 0.2);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
  font-family: 'Inter', sans-serif;
  z-index: -1;
}

.download-sheet__header {
  text-align: center;
  margin-bottom: 36px;
}

.download-sheet__title {
  margin: 0;
  font-family: 'Cinzel', serif;
  font-size: 4.2rem;
  letter-spacing: 0.18em;
  color: #f2e0b7;
  text-transform: uppercase;
}

.download-sheet__subtitle {
  margin-top: 10px;
  font-size: 1.15rem;
  letter-spacing: 0.25em;
  color: #c7bca8;
  text-transform: uppercase;
}

.download-sheet__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 26px;
  margin-bottom: 30px;
}

.download-sheet__item {
  border: 1px solid rgba(219, 204, 171, 0.15);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 16px;
  padding: 18px 18px 16px;
}

.download-sheet__label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.72rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: #9aa8b5;
}

.download-sheet__value {
  font-size: 1.05rem;
  color: #f7f4ef;
}

.download-sheet__section {
  margin-top: 28px;
  border-top: 1px solid rgba(219, 204, 171, 0.18);
  padding-top: 24px;
}

.download-sheet__section h3 {
  margin: 0 0 14px;
  color: #d9c6a1;
  font-size: 0.86rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.download-sheet__story {
  line-height: 1.8;
  color: #edf3f8;
  white-space: pre-wrap;
}

.download-sheet__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.download-sheet__badge {
  border: 1px solid rgba(219, 204, 171, 0.2);
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 0.78rem;
  color: #f5efe4;
  background: rgba(219, 204, 171, 0.05);
}

.complete-panel {
  max-width: 760px;
  margin: 0 auto;
  padding: 34px 28px 28px;
  text-align: center;
}

.complete-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(137, 215, 177, 0.1);
  border: 1px solid rgba(137, 215, 177, 0.28);
  color: var(--success);
  font-size: 2.2rem;
  margin-bottom: 18px;
}

.complete-panel h2 {
  margin: 0;
  font-size: clamp(1.6rem, 2vw, 2.4rem);
  letter-spacing: 0.12em;
}

.complete-panel p {
  margin: 18px auto 0;
  max-width: 520px;
  color: var(--muted);
  line-height: 1.7;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 26px;
}

.action-btn,
.secondary-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: var(--transition);
}

.action-btn {
  background: linear-gradient(180deg, rgba(192, 185, 164, 0.2), rgba(192, 185, 164, 0.08));
  border-color: rgba(192, 185, 164, 0.28);
  color: var(--text);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.18);
}

.action-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover {
  transform: translateY(-1px);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--border);
  color: var(--text);
}

.ghost-btn {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.action-bar {
  margin-top: 24px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.action-bar .left-group,
.action-bar .right-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Blood-red velvet with a soft celestial counterpoint. */
.brand-copy h1,
.section-intro h2,
.review-panel h3,
.complete-panel h2,
.summary-hero {
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: 0.1em;
  text-shadow: 0 0 22px rgba(255, 213, 215, 0.14);
}

.brand-copy h1 {
  color: var(--accent-strong);
}

.main-panel {
  background:
    radial-gradient(circle at 92% 3%, rgba(255, 231, 221, 0.08), transparent 20%),
    linear-gradient(180deg, rgba(26, 11, 20, 0.7), rgba(16, 7, 13, 0.78));
}

.field-card,
.option-panel,
.codex-panel,
.review-panel,
.complete-panel,
.consent-summary {
  background: linear-gradient(145deg, rgba(48, 21, 35, 0.82), rgba(22, 10, 19, 0.9));
  border-color: rgba(245, 214, 216, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 245, 238, 0.04), 0 16px 32px rgba(7, 1, 6, 0.16);
}

.input-shell,
.textarea-shell,
.option-card,
.preference-item,
.summary-item {
  background: rgba(13, 5, 11, 0.72);
  border-color: rgba(245, 214, 216, 0.15);
}

.input-shell:focus,
.textarea-shell:focus {
  border-color: rgba(255, 210, 207, 0.72);
  box-shadow: 0 0 0 3px rgba(209, 63, 91, 0.14), 0 0 22px rgba(209, 63, 91, 0.12);
}

.selection-preview,
.option-card.selected,
.preference-item.selected,
.step-item.active {
  background: linear-gradient(135deg, rgba(169, 31, 62, 0.22), rgba(255, 226, 218, 0.07));
  border-color: rgba(239, 169, 173, 0.5);
}

.step-item.active .step-index,
.step-item.done .step-index {
  background: linear-gradient(145deg, rgba(169, 31, 62, 0.7), rgba(231, 189, 131, 0.22));
  border-color: rgba(255, 218, 210, 0.42);
}

.step-status,
.complete-badge {
  color: var(--accent);
}

.complete-badge {
  background: radial-gradient(circle, rgba(255, 224, 218, 0.18), rgba(169, 31, 62, 0.2));
  border-color: rgba(255, 207, 204, 0.44);
  box-shadow: 0 0 28px rgba(207, 62, 91, 0.2);
}

.complete-badge.incomplete {
  color: var(--warning);
  border-color: rgba(240, 211, 154, 0.44);
  background: radial-gradient(circle, rgba(240, 211, 154, 0.16), rgba(169, 31, 62, 0.18));
}

.incomplete-list {
  max-width: 520px;
  margin: 22px auto 0;
  padding: 16px 20px;
  border: 1px solid rgba(240, 211, 154, 0.25);
  border-radius: 14px;
  background: rgba(240, 211, 154, 0.06);
  color: var(--warning);
  text-align: left;
}

.incomplete-list strong {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.incomplete-list ul {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.incomplete-list li + li {
  margin-top: 6px;
}

.action-btn {
  background: linear-gradient(135deg, #a91f3e, #c64d65 58%, #e7bd83);
  border-color: rgba(255, 224, 213, 0.4);
  color: #fff8f1;
  box-shadow: 0 10px 24px rgba(127, 15, 43, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.action-btn:hover {
  box-shadow: 0 14px 30px rgba(127, 15, 43, 0.42), 0 0 20px rgba(255, 191, 184, 0.14);
}

.action-btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  filter: saturate(0.45);
  box-shadow: none;
  transform: none;
}

.secondary-btn {
  background: rgba(255, 226, 218, 0.06);
  border-color: rgba(255, 217, 211, 0.24);
}

.badge {
  border-color: rgba(237, 179, 183, 0.28);
  background: rgba(169, 31, 62, 0.12);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .step-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .app-shell {
    width: min(100% - 20px, 1000px);
    margin: 12px auto;
  }

  .main-panel,
  .sidebar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .field-grid,
  .consent-grid,
  .review-layout,
  .summary-grid,
  .preference-list {
    grid-template-columns: 1fr;
  }

  .action-bar {
    flex-direction: column-reverse;
  }

  .action-bar .left-group,
  .action-bar .right-group {
    width: 100%;
    justify-content: stretch;
  }

  .action-bar button {
    flex: 1;
  }
}

.grimorio {
  --grim-ink: #100b13;
  --grim-panel: rgba(26, 17, 29, 0.9);
  --grim-page: #d7c2a0;
  --grim-gold: #c9a66a;
  --grim-line: rgba(205, 174, 123, 0.28);
  position: relative;
  isolation: isolate;
  margin: -24px -28px -36px;
  padding: 0 28px 30px;
  overflow: clip;
  background:
    radial-gradient(ellipse at 50% 3%, rgba(120, 71, 139, 0.2), transparent 35%),
    linear-gradient(180deg, rgba(14, 9, 18, 0.34), rgba(11, 8, 14, 0.5));
  color: #f3e8db;
}

.grimorio *,
.grimorio *::before,
.grimorio *::after {
  box-sizing: border-box;
}

.grimorio [hidden] {
  display: none !important;
}

.grimorio button,
.grimorio input,
.grimorio select {
  font: inherit;
}

.grimorio button {
  color: inherit;
}

.grimorio button:focus-visible,
.grimorio input:focus-visible,
.grimorio select:focus-visible,
.grimorio summary:focus-visible,
.grimorio a:focus-visible {
  outline: 2px solid #e6c585;
  outline-offset: 3px;
}

.grim-reading-progress {
  position: sticky;
  z-index: 15;
  top: 0;
  height: 24px;
  margin: 0 -28px;
  background: rgba(12, 8, 15, 0.92);
  border-bottom: 1px solid rgba(201, 166, 106, 0.15);
  backdrop-filter: blur(12px);
}

.grim-reading-progress__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, rgba(106, 65, 140, 0.42), rgba(201, 166, 106, 0.5));
  transition: width 180ms linear;
}

.grim-reading-progress__label {
  position: absolute;
  right: 14px;
  top: 4px;
  z-index: 1;
  color: #d8c69f;
  font: 0.62rem 'Cinzel', serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.grim-hero {
  position: relative;
  display: flex;
  min-height: 610px;
  padding: 74px 20px 56px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-align: center;
  border-bottom: 1px solid var(--grim-line);
  background:
    radial-gradient(ellipse at 50% 54%, rgba(106, 65, 140, 0.2), transparent 31%),
    radial-gradient(ellipse at 50% 100%, rgba(169, 31, 62, 0.12), transparent 47%);
}

.grim-hero::before,
.grim-hero::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.grim-hero::before {
  inset: 12px;
  border: 1px solid rgba(201, 166, 106, 0.18);
  clip-path: polygon(0 0, 20% 0, 20% 1px, 80% 1px, 80% 0, 100% 0, 100% 22%, calc(100% - 1px) 22%, calc(100% - 1px) 78%, 100% 78%, 100% 100%, 80% 100%, 80% calc(100% - 1px), 20% calc(100% - 1px), 20% 100%, 0 100%, 0 78%, 1px 78%, 1px 22%, 0 22%);
}

.grim-hero::after {
  width: min(670px, 86%);
  height: min(500px, 76%);
  border: 1px solid rgba(178, 140, 209, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 90px rgba(112, 62, 143, 0.12), inset 0 0 70px rgba(112, 62, 143, 0.07);
}

.grim-hero > *:not(.grim-hero__stars) {
  position: relative;
  z-index: 1;
}

.grim-hero__stars {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.grim-hero__stars i {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #e6c585;
  box-shadow: 0 0 12px 3px rgba(201, 166, 106, 0.28);
  animation: grim-spark 4.5s ease-in-out infinite alternate;
}

.grim-hero__stars i:nth-child(1) { left: 18%; top: 25%; }
.grim-hero__stars i:nth-child(2) { left: 76%; top: 19%; animation-delay: -1s; }
.grim-hero__stars i:nth-child(3) { left: 84%; top: 67%; animation-delay: -2.4s; }
.grim-hero__stars i:nth-child(4) { left: 23%; top: 77%; animation-delay: -3s; }
.grim-hero__stars i:nth-child(5) { left: 64%; top: 34%; animation-delay: -1.7s; }

.grim-hero__seal {
  position: relative;
  width: 72px;
  height: 72px;
  margin-bottom: 20px;
  border: 1px solid rgba(201, 166, 106, 0.55);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(104, 57, 134, 0.48), rgba(18, 12, 23, 0.86) 70%);
  box-shadow: 0 0 32px rgba(151, 96, 183, 0.2), inset 0 0 20px rgba(201, 166, 106, 0.12);
  animation: grim-seal-turn 28s linear infinite;
}

.grim-hero__seal::before,
.grim-hero__seal::after {
  position: absolute;
  content: "";
  inset: 6px;
  border: 1px solid rgba(201, 166, 106, 0.32);
  border-radius: 50%;
}

.grim-hero__seal::after {
  inset: -5px;
  border-style: dashed;
  border-color: rgba(177, 139, 201, 0.34);
}

.grim-hero__seal img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  opacity: 0.52;
  mix-blend-mode: screen;
}

.grim-hero__seal span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #e6c585;
  font-size: 1.65rem;
  text-shadow: 0 0 14px #9c78bf;
}

.grim-kicker {
  margin: 0 0 10px;
  color: #c6a978;
  font: 0.68rem 'Cinzel', serif;
  letter-spacing: 0.2em;
  line-height: 1.6;
  text-transform: uppercase;
}

.grim-hero h2 {
  max-width: 900px;
  margin: 0;
  color: #f4e3c9;
  font: 500 clamp(2.2rem, 5.2vw, 4.35rem)/1.08 'Cinzel', serif;
  letter-spacing: 0.075em;
  text-shadow: 0 6px 35px rgba(183, 133, 216, 0.3);
  text-transform: uppercase;
  animation: grim-title-open 900ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.grim-hero h2 span {
  color: #b896d1;
  font: italic 600 0.62em 'Cormorant Garamond', serif;
  letter-spacing: 0;
  text-transform: lowercase;
}

.grim-hero__subtitle {
  margin: 16px 0 0;
  color: #d4c3a9;
  font: 600 clamp(1.25rem, 2.3vw, 1.8rem) 'Cormorant Garamond', serif;
  letter-spacing: 0.07em;
}

.grim-hero__motto {
  max-width: 540px;
  margin: 10px 0 0;
  color: #b9aebd;
  font: italic 1.1rem 'Cormorant Garamond', serif;
}

.grim-open-book {
  position: relative;
  display: flex;
  width: min(450px, 86vw);
  height: 140px;
  margin: 29px auto 18px;
  perspective: 700px;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.65));
  animation: grim-book-open 1.15s cubic-bezier(0.22, 0.75, 0.22, 1) both;
}

.grim-open-book__page {
  position: relative;
  display: flex;
  width: 50%;
  padding: 18px 12px;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  border: 1px solid rgba(201, 166, 106, 0.68);
  color: rgba(83, 55, 75, 0.94);
  background:
    radial-gradient(ellipse at center, rgba(245, 226, 189, 0.96), rgba(169, 136, 94, 0.92)),
    #c5a77c;
}

.grim-open-book__page::after {
  position: absolute;
  content: "";
  inset: 8px;
  border: 1px solid rgba(85, 55, 63, 0.28);
  pointer-events: none;
}

.grim-open-book__page--left {
  border-radius: 80% 8px 8px 10%;
  transform: rotateY(8deg);
  transform-origin: right center;
  box-shadow: inset -14px 0 22px rgba(62, 33, 39, 0.23);
}

.grim-open-book__page--right {
  border-radius: 8px 80% 10% 8px;
  transform: rotateY(-8deg);
  transform-origin: left center;
  box-shadow: inset 14px 0 22px rgba(62, 33, 39, 0.23);
}

.grim-open-book__page span {
  color: rgba(68, 43, 74, 0.73);
  font: 0.8rem 'Cinzel', serif;
  letter-spacing: 0.22em;
}

.grim-open-book__page i {
  color: #573765;
  font-size: 2.6rem;
  font-style: normal;
  text-shadow: 0 0 16px rgba(92, 48, 132, 0.6);
}

.grim-open-book__page small {
  color: rgba(75, 51, 56, 0.8);
  font: italic 0.92rem 'Cormorant Garamond', serif;
}

.grim-open-book__spine {
  position: absolute;
  z-index: 2;
  top: 4px;
  bottom: 3px;
  left: calc(50% - 4px);
  width: 8px;
  border: 1px solid rgba(201, 166, 106, 0.7);
  border-radius: 50%;
  background: linear-gradient(90deg, #36243a, #a27a55 45%, #39263a);
}

.grim-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #aa9aaa;
  font-size: 0.72rem;
}

.grim-primary-button,
.grim-back-atlas {
  border: 1px solid rgba(201, 166, 106, 0.58);
  background: linear-gradient(135deg, rgba(86, 51, 111, 0.65), rgba(36, 20, 42, 0.92));
  color: #ead7b3 !important;
  font: 0.7rem 'Cinzel', serif !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.grim-primary-button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 4px;
  box-shadow: 0 0 20px rgba(126, 78, 159, 0.13);
}

.grim-primary-button:hover,
.grim-back-atlas:hover {
  transform: translateY(-2px);
  border-color: #e3c17b;
  box-shadow: 0 0 24px rgba(174, 124, 201, 0.24);
}

.grim-primary-button span {
  margin-left: 8px;
  color: #c8a9e3;
  font-size: 1rem;
}

.grim-decree {
  position: relative;
  display: grid;
  max-width: 1060px;
  margin: 36px auto 56px;
  padding: 26px 34px;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  border: 1px solid rgba(201, 166, 106, 0.52);
  background:
    linear-gradient(135deg, rgba(58, 39, 48, 0.88), rgba(29, 20, 34, 0.96)),
    radial-gradient(ellipse at 50% 0, rgba(174, 124, 201, 0.11), transparent 65%);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22), inset 0 0 35px rgba(214, 176, 118, 0.045);
}

.grim-decree::before,
.grim-decree::after {
  position: absolute;
  content: "✧";
  color: #c5a16b;
  font-size: 1rem;
}

.grim-decree::before { top: 8px; left: 10px; }
.grim-decree::after { right: 10px; bottom: 8px; }

.grim-decree__seal {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border: 1px solid rgba(201, 166, 106, 0.7);
  border-radius: 50%;
  color: #d5b275;
  background: radial-gradient(circle, rgba(128, 84, 150, 0.34), rgba(25, 16, 29, 0.9));
  box-shadow: 0 0 22px rgba(154, 104, 184, 0.18), inset 0 0 14px rgba(201, 166, 106, 0.11);
  font-size: 1.8rem;
  animation: grim-seal-pulse 4s ease-in-out infinite;
}

.grim-decree .grim-kicker {
  margin-bottom: 8px;
}

.grim-decree blockquote {
  margin: 0;
  color: #f0dfc8;
  font: 600 clamp(1.2rem, 2vw, 1.55rem)/1.45 'Cormorant Garamond', serif;
}

.grim-section {
  max-width: 1240px;
  margin: 0 auto;
  padding: 34px 0 48px;
  scroll-margin-top: 40px;
}

.grim-section-heading {
  max-width: 760px;
  margin: 0 auto 25px;
  text-align: center;
}

.grim-section-heading h2,
.grim-library-heading h2 {
  margin: 0;
  color: #f0e2d0;
  font: 600 clamp(1.6rem, 3.2vw, 2.5rem)/1.2 'Cinzel', serif;
  letter-spacing: 0.035em;
}

.grim-section-heading > p:last-child,
.grim-library-heading > p:last-child {
  margin: 12px auto 0;
  color: #b6aab8;
  font: 1.08rem/1.6 'Cormorant Garamond', serif;
}

.grim-atlas-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.grim-atlas-card {
  --affinity: #b18bd2;
  --affinity-glow: rgba(154, 105, 190, 0.2);
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(201, 166, 106, 0.22);
  background: linear-gradient(155deg, rgba(39, 28, 43, 0.94), rgba(20, 15, 24, 0.98));
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
  animation: grim-card-reveal 600ms both;
  animation-delay: calc(var(--card-index) * 28ms);
  transition: transform 260ms ease, border-color 260ms ease, box-shadow 260ms ease;
}

.grim-atlas-card:hover {
  z-index: 1;
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--affinity) 72%, #d2b178);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.36), 0 0 25px var(--affinity-glow);
}

.grim-atlas-art {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1.18 / 1;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #151019;
}

.grim-atlas-art::after {
  position: absolute;
  content: "";
  inset: 0;
  background: linear-gradient(180deg, transparent 53%, rgba(13, 9, 17, 0.84));
  pointer-events: none;
}

.grim-atlas-art img,
.grim-school-heading-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 650ms cubic-bezier(0.2, 0.75, 0.2, 1), filter 500ms ease;
}

.grim-atlas-art img {
  filter: saturate(0.9) brightness(0.8);
}

.grim-atlas-card:hover .grim-atlas-art img,
.grim-atlas-art:focus-visible img {
  transform: scale(1.1);
  filter: saturate(1.1) brightness(1.02) drop-shadow(0 0 12px var(--affinity));
}

.grim-rune {
  position: absolute;
  z-index: 1;
  top: 12px;
  right: 13px;
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--affinity) 64%, transparent);
  border-radius: 50%;
  color: var(--affinity);
  background: rgba(17, 11, 22, 0.72);
  box-shadow: 0 0 18px var(--affinity-glow);
  opacity: 0;
  transform: scale(0.72) rotate(-35deg);
  transition: opacity 250ms ease, transform 350ms ease;
}

.grim-atlas-card:hover .grim-rune,
.grim-atlas-art:focus-visible .grim-rune {
  opacity: 1;
  transform: scale(1) rotate(0);
}

.grim-art-open {
  position: absolute;
  z-index: 1;
  bottom: 9px;
  left: 12px;
  color: #f1dfbf;
  font: 0.58rem 'Cinzel', serif;
  letter-spacing: 0.13em;
  opacity: 0;
  text-transform: uppercase;
  transform: translateY(4px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.grim-atlas-card:hover .grim-art-open,
.grim-atlas-art:focus-visible .grim-art-open {
  opacity: 1;
  transform: translateY(0);
}

.grim-atlas-copy {
  padding: 14px 15px 12px;
}

.grim-atlas-title {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #f0dfca !important;
  font: 600 1.02rem 'Cinzel', serif !important;
  text-align: left;
  transition: color 180ms ease;
}

.grim-atlas-title:hover {
  color: var(--affinity) !important;
}

.grim-atlas-title span {
  color: var(--affinity);
  font: 1rem 'Manrope', sans-serif;
}

.grim-atlas-copy > p {
  min-height: 38px;
  margin: 8px 0 12px;
  color: #b9aeb9;
  font: 0.98rem/1.35 'Cormorant Garamond', serif;
}

.grim-atlas-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  color: #c5aa7d;
  font: 0.63rem 'Cinzel', serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.grim-glyph {
  color: var(--affinity);
  font-size: 1rem;
}

.grim-affinity--air { --affinity: #90bce0; --affinity-glow: rgba(91, 166, 223, 0.23); }
.grim-affinity--arcana { --affinity: #c19ae0; --affinity-glow: rgba(157, 103, 199, 0.23); }
.grim-affinity--curse { --affinity: #ad78d4; --affinity-glow: rgba(142, 70, 184, 0.23); }
.grim-affinity--blood { --affinity: #d7838b; --affinity-glow: rgba(171, 49, 75, 0.24); }
.grim-affinity--bone { --affinity: #d4c7a8; --affinity-glow: rgba(211, 194, 155, 0.2); }
.grim-affinity--earth { --affinity: #a7c786; --affinity-glow: rgba(93, 150, 71, 0.22); }
.grim-affinity--eldritch { --affinity: #72c6c1; --affinity-glow: rgba(57, 164, 160, 0.24); }
.grim-affinity--iron { --affinity: #c0c7d2; --affinity-glow: rgba(158, 177, 197, 0.21); }
.grim-affinity--fire { --affinity: #f1a36f; --affinity-glow: rgba(227, 94, 41, 0.24); }
.grim-affinity--light { --affinity: #ead08a; --affinity-glow: rgba(228, 195, 106, 0.23); }
.grim-affinity--mind { --affinity: #ce9adb; --affinity-glow: rgba(174, 101, 193, 0.23); }
.grim-affinity--sigil { --affinity: #98aee4; --affinity-glow: rgba(100, 124, 206, 0.23); }
.grim-affinity--summon { --affinity: #c193d7; --affinity-glow: rgba(139, 82, 178, 0.24); }
.grim-affinity--venom { --affinity: #a4d17d; --affinity-glow: rgba(109, 176, 69, 0.24); }
.grim-affinity--water { --affinity: #83c2dc; --affinity-glow: rgba(69, 158, 199, 0.24); }
.grim-affinity--white { --affinity: #e6d5aa; --affinity-glow: rgba(223, 191, 118, 0.23); }
.grim-affinity--exploration { --affinity: #90bce0; --affinity-glow: rgba(91, 166, 223, 0.23); }
.grim-affinity--combat { --affinity: #e39182; --affinity-glow: rgba(196, 74, 67, 0.2); }
.grim-affinity--intrigue { --affinity: #c19ae0; --affinity-glow: rgba(157, 103, 199, 0.23); }
.grim-affinity--survival { --affinity: #a7c786; --affinity-glow: rgba(93, 150, 71, 0.22); }
.grim-affinity--ritual { --affinity: #d3b27e; --affinity-glow: rgba(193, 149, 83, 0.2); }

.grim-search-section {
  padding-top: 25px;
  padding-bottom: 26px;
}

.grim-search-controls {
  display: grid;
  grid-template-columns: minmax(230px, 1.4fr) repeat(2, minmax(190px, 0.8fr));
  gap: 12px;
  align-items: end;
  padding: 17px;
  border: 1px solid rgba(201, 166, 106, 0.24);
  background: rgba(26, 18, 30, 0.76);
}

.grim-search-controls label {
  display: grid;
  gap: 7px;
  color: #c4b5c3;
  font: 0.65rem 'Cinzel', serif;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.grim-search-controls input,
.grim-search-controls select {
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(203, 175, 129, 0.32);
  border-radius: 3px;
  color: #eee2d5;
  background: #1d1521;
  font: 0.9rem 'Manrope', sans-serif;
}

.grim-search-controls input::placeholder {
  color: #847787;
}

.grim-search-controls select option {
  color: #eee2d5;
  background: #1d1521;
}

.grim-search-count {
  grid-column: 1 / -1;
  margin: 0;
  color: #c9ae80;
  font: 0.7rem 'Cinzel', serif;
}

.grim-search-empty {
  margin: 16px 0;
  color: #d7c2a0;
  font: italic 1.1rem 'Cormorant Garamond', serif;
  text-align: center;
}

.grim-recent-section {
  padding: 28px 22px 34px;
  border: 1px solid rgba(201, 166, 106, 0.3);
  background:
    radial-gradient(ellipse at 50% 0, rgba(130, 77, 160, 0.14), transparent 60%),
    rgba(24, 16, 28, 0.74);
}

.grim-recent-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grim-spell-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.grim-spell-card {
  min-width: 0;
  padding: 15px 16px 13px;
  border: 1px solid rgba(205, 184, 150, 0.17);
  border-left: 2px solid var(--affinity, #aa8bc3);
  background: linear-gradient(145deg, rgba(37, 28, 40, 0.9), rgba(21, 17, 25, 0.94));
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.grim-spell-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--affinity, #aa8bc3) 50%, transparent);
  background: linear-gradient(145deg, rgba(49, 35, 54, 0.96), rgba(22, 17, 27, 0.98));
}

.grim-spell-card--new {
  border-top: 1px solid rgba(201, 166, 106, 0.42);
  background: linear-gradient(145deg, rgba(56, 39, 57, 0.9), rgba(23, 17, 28, 0.96));
  box-shadow: inset 0 0 18px rgba(201, 166, 106, 0.045);
}

.grim-spell-card--new::before {
  content: "NUEVO REGISTRO";
  display: block;
  margin-bottom: 8px;
  color: #d1b273;
  font: 0.55rem 'Cinzel', serif;
  letter-spacing: 0.13em;
}

.grim-spell-name {
  display: flex;
  width: 100%;
  min-height: 30px;
  padding: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 7px;
  border: 0;
  background: transparent;
  color: #f1dfca !important;
  font: 600 0.92rem/1.35 'Cinzel', serif !important;
  text-align: left;
}

.grim-spell-name:hover {
  color: var(--affinity, #cfade1) !important;
}

.grim-spell-arrow {
  flex: 0 0 auto;
  color: #c2a271;
  font: 0.9rem 'Manrope', sans-serif;
  opacity: 0.7;
  transition: transform 180ms ease, opacity 180ms ease;
}

.grim-spell-name:hover .grim-spell-arrow {
  opacity: 1;
  transform: translate(2px, -2px);
}

.grim-spell-card > p {
  margin: 8px 0 12px;
  color: #b8acb8;
  font: 1rem/1.42 'Cormorant Garamond', serif;
}

.grim-spell-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.grim-school-tag,
.grim-status {
  display: inline-flex;
  min-height: 21px;
  align-items: center;
  padding: 3px 7px;
  border: 1px solid rgba(204, 181, 139, 0.2);
  color: #c3b39f;
  font: 0.55rem 'Cinzel', serif;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
}

.grim-status {
  border-color: rgba(178, 153, 198, 0.27);
  color: #c7a9da;
}

.grim-status.is-verified {
  border-color: rgba(160, 194, 152, 0.36);
  color: #b9d1a9;
}

.grim-small-note {
  margin: 14px 0 0;
  color: #b8abb7;
  font: 0.98rem/1.45 'Cormorant Garamond', serif;
}

.grim-utility-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.grim-utility-card {
  border: 1px solid rgba(201, 166, 106, 0.24);
  background: rgba(27, 19, 32, 0.84);
  transition: border-color 200ms ease, background 200ms ease;
}

.grim-utility-card[open] {
  border-color: color-mix(in srgb, var(--affinity) 56%, #c9a66a);
  background: rgba(37, 25, 42, 0.93);
}

.grim-utility-card summary {
  display: grid;
  min-height: 68px;
  padding: 12px 16px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.grim-utility-card summary::-webkit-details-marker,
.grim-initiation-step summary::-webkit-details-marker,
.grim-sources-details summary::-webkit-details-marker {
  display: none;
}

.grim-utility-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--affinity) 48%, transparent);
  border-radius: 50%;
  color: var(--affinity);
  background: color-mix(in srgb, var(--affinity) 10%, transparent);
  font-size: 1.3rem;
}

.grim-utility-title {
  color: #eadbc6;
  font: 600 0.88rem 'Cinzel', serif;
}

.grim-utility-count {
  color: #ac9da9;
  font-size: 0.66rem;
}

.grim-utility-card > p {
  margin: 0;
  padding: 0 17px 13px 70px;
  color: #b9adb8;
  font: 1rem/1.4 'Cormorant Garamond', serif;
}

.grim-utility-spells {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 9px;
  padding: 0 16px 16px 70px;
}

.grim-utility-spell {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(201, 166, 106, 0.16);
  background: rgba(12, 10, 15, 0.45);
}

.grim-utility-spell > button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #e4d3bf;
  font: 600 0.72rem 'Cinzel', serif;
  text-align: left;
  transition: border-color 180ms ease, color 180ms ease;
}

.grim-utility-spell > button:hover {
  color: #f1dcaf;
}

.grim-utility-spell > p {
  margin: 6px 0 8px;
  color: #b8acb8;
  font: 0.95rem/1.35 'Cormorant Garamond', serif;
}

.grim-utility-spell > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  color: #a99baa;
  font: 0.57rem 'Cinzel', serif;
}

.grim-utility-spell .grim-status {
  min-height: 18px;
  padding: 2px 5px;
  font-size: 0.48rem;
}

.grim-school-modal {
  --affinity: #b18bd2;
  --affinity-glow: rgba(154, 105, 190, 0.2);
  position: relative;
  width: min(1120px, 100%);
  max-height: min(90vh, 920px);
  max-height: min(90dvh, 920px);
  padding: 19px 22px 15px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 166, 106, 0.48) rgba(16, 11, 19, 0.55);
  border: 1px solid color-mix(in srgb, var(--affinity) 54%, #c9a66a);
  background:
    radial-gradient(ellipse at 0 0, var(--affinity-glow), transparent 55%),
    #17111d;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.72), 0 0 50px var(--affinity-glow);
  animation: grim-page-enter 300ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.grim-school-modal-heading {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 17px;
  align-items: center;
  padding: 0 42px 13px 0;
  border-bottom: 1px solid rgba(201, 166, 106, 0.25);
}

.grim-school-modal-heading > img {
  width: 104px;
  height: 104px;
  object-fit: cover;
  border: 1px solid color-mix(in srgb, var(--affinity) 58%, transparent);
  box-shadow: 0 0 26px var(--affinity-glow);
}

.grim-school-modal-heading .grim-kicker {
  margin-bottom: 3px;
}

.grim-school-modal-heading h3 {
  margin: 0;
  color: #f3e1c9;
  font: 600 clamp(1.5rem, 4vw, 2.4rem) 'Cinzel', serif;
}

.grim-school-modal-heading > div > p:not(.grim-kicker) {
  margin: 4px 0 6px;
  color: #d1c1d0;
  font: 1.05rem/1.35 'Cormorant Garamond', serif;
}

.grim-school-modal-hint {
  display: none;
}

.grim-school-modal-spells {
  display: grid;
  padding: 13px 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.grim-school-modal-spells .grim-spell-card {
  padding: 10px 12px 9px;
  background: rgba(29, 21, 33, 0.88);
}

.grim-school-modal-spells .grim-spell-name {
  min-height: 24px;
  font-size: 0.78rem !important;
}

.grim-school-modal-spells .grim-spell-card > p {
  display: -webkit-box;
  min-height: 0;
  margin: 4px 0 7px;
  overflow: hidden;
  font-size: 0.92rem;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.grim-school-modal-spells .grim-school-tag,
.grim-school-modal-spells .grim-status {
  min-height: 18px;
  padding: 2px 5px;
  font-size: 0.48rem;
}

.grim-school-modal-footer {
  display: grid;
  padding-top: 9px;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  border-top: 1px solid rgba(201, 166, 106, 0.22);
  color: #a997a6;
  font: 0.59rem 'Cinzel', serif;
  letter-spacing: 0.09em;
  text-align: center;
  text-transform: uppercase;
}

.grim-school-modal-footer button {
  padding: 7px 0;
  border: 0;
  background: transparent;
  color: #c4a4d5;
  font: inherit;
  text-align: left;
  text-transform: uppercase;
}

.grim-school-modal-footer button:last-of-type {
  text-align: right;
}

.grim-school-modal-footer button:hover {
  color: #eed9ac;
}

.grim-initiation-path {
  position: relative;
  display: grid;
  max-width: 980px;
  margin: 30px auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px 20px;
}

.grim-initiation-path::before,
.grim-initiation-path::after {
  position: absolute;
  content: "";
  z-index: -1;
  top: 34px;
  left: 11%;
  width: 78%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(191, 151, 206, 0.48), rgba(201, 166, 106, 0.5), transparent);
}

.grim-initiation-path::after {
  top: auto;
  bottom: 34px;
}

.grim-initiation-step {
  min-width: 0;
  border: 1px solid rgba(201, 166, 106, 0.2);
  background: rgba(27, 19, 32, 0.85);
}

.grim-initiation-step[open] {
  border-color: rgba(185, 143, 208, 0.56);
  box-shadow: 0 0 24px rgba(112, 69, 141, 0.13);
}

.grim-initiation-step summary {
  display: flex;
  min-height: 76px;
  padding: 11px 13px;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.grim-initiation-seal {
  display: grid;
  width: 47px;
  height: 47px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(201, 166, 106, 0.5);
  border-radius: 50%;
  color: #d5bd8a;
  background: radial-gradient(circle, rgba(106, 67, 133, 0.36), rgba(16, 12, 20, 0.95));
  font: 1rem 'Cinzel', serif;
  transition: box-shadow 200ms ease, color 200ms ease;
}

.grim-initiation-step[open] .grim-initiation-seal {
  color: #f0d998;
  box-shadow: 0 0 18px rgba(185, 143, 208, 0.38);
}

.grim-initiation-step summary small,
.grim-initiation-step summary strong {
  display: block;
}

.grim-initiation-step summary small {
  margin-bottom: 3px;
  color: #a897a9;
  font: 0.55rem 'Cinzel', serif;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.grim-initiation-step summary strong {
  color: #e4d3bf;
  font: 600 0.8rem 'Cinzel', serif;
  text-transform: uppercase;
}

.grim-initiation-step > p {
  margin: 0;
  padding: 2px 14px 15px;
  color: #bdb1bd;
  font: 1.02rem/1.45 'Cormorant Garamond', serif;
}

.grim-director-note {
  max-width: 980px;
  margin: 25px auto 0;
  padding: 17px 20px;
  border-left: 2px solid #b691cd;
  background: rgba(85, 56, 103, 0.18);
}

.grim-director-note strong {
  color: #dac2e7;
  font: 0.7rem 'Cinzel', serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.grim-director-note p {
  margin: 8px 0 0;
  color: #c4b6c4;
  font: 1rem/1.48 'Cormorant Garamond', serif;
}

.grim-case-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}

.grim-case-file {
  position: relative;
  min-width: 0;
  padding: 22px 19px 18px;
  border: 1px solid rgba(201, 166, 106, 0.37);
  background:
    linear-gradient(160deg, rgba(42, 28, 44, 0.94), rgba(20, 15, 23, 0.98)),
    radial-gradient(circle at 100% 0, rgba(160, 111, 181, 0.16), transparent 60%);
  box-shadow: inset 0 0 28px rgba(201, 166, 106, 0.035), 0 8px 21px rgba(0, 0, 0, 0.18);
}

.grim-case-file::before {
  position: absolute;
  content: "";
  inset: 6px;
  border: 1px solid rgba(201, 166, 106, 0.12);
  pointer-events: none;
}

.grim-case-number {
  display: flex;
  align-items: baseline;
  gap: 9px;
  color: #d8bd83;
  font: 1.35rem 'Cinzel', serif;
}

.grim-case-number span {
  color: #95849a;
  font-size: 0.54rem;
  letter-spacing: 0.14em;
}

.grim-case-file .grim-kicker {
  margin-top: 17px;
  margin-bottom: 4px;
  font-size: 0.58rem;
}

.grim-case-file h3 {
  margin: 0;
  color: #f0dfc8;
  font: 600 1.05rem/1.25 'Cinzel', serif;
}

.grim-case-story {
  min-height: 116px;
  margin: 13px 0;
  color: #c7bac5;
  font: 1.05rem/1.48 'Cormorant Garamond', serif;
}

.grim-case-tests,
.grim-case-risk {
  padding: 11px 0;
  border-top: 1px solid rgba(201, 166, 106, 0.17);
}

.grim-case-tests strong,
.grim-case-risk strong {
  color: #d0b67e;
  font: 0.58rem 'Cinzel', serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.grim-case-tests p,
.grim-case-risk p {
  margin: 5px 0 0;
  color: #c6b8c2;
  font: 0.96rem/1.4 'Cormorant Garamond', serif;
}

.grim-case-risk {
  border-top-color: rgba(170, 95, 119, 0.3);
}

.grim-case-risk strong {
  color: #d29aa8;
}

.grim-school-library {
  max-width: 1240px;
  margin: 0 auto;
  padding: 34px 0 30px;
}

.grim-library-heading {
  max-width: 760px;
  margin: 0 auto 28px;
  text-align: center;
}

.grim-all-school-spells {
  display: grid;
  gap: 22px;
}

.grim-school-section {
  --affinity: #b18bd2;
  position: relative;
  scroll-margin-top: 40px;
  padding: 22px;
  border: 1px solid rgba(201, 166, 106, 0.25);
  background:
    radial-gradient(ellipse at 0 0, var(--affinity-glow), transparent 45%),
    rgba(19, 15, 23, 0.87);
  animation: grim-page-enter 550ms ease both;
}

.grim-school-heading {
  display: grid;
  grid-template-columns: 98px minmax(0, 1fr) auto;
  gap: 19px;
  align-items: center;
  margin-bottom: 19px;
  padding-bottom: 17px;
  border-bottom: 1px solid rgba(201, 166, 106, 0.21);
}

.grim-school-heading-art {
  position: relative;
  width: 96px;
  height: 96px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--affinity) 52%, transparent);
  box-shadow: 0 0 20px var(--affinity-glow);
}

.grim-school-heading-art img {
  filter: saturate(0.82) brightness(0.8);
}

.grim-school-heading-art span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--affinity);
  font: 1.8rem 'Cinzel', serif;
  text-shadow: 0 0 16px #100b13;
}

.grim-school-heading-copy .grim-kicker {
  margin-bottom: 4px;
  font-size: 0.59rem;
}

.grim-school-heading h3 {
  margin: 0;
  color: #f0e0cb;
  font: 600 clamp(1.35rem, 2.7vw, 1.85rem) 'Cinzel', serif;
}

.grim-school-heading-copy > p:not(.grim-kicker) {
  margin: 6px 0;
  color: #b9aeb9;
  font: 1.02rem 'Cormorant Garamond', serif;
}

.grim-count {
  color: var(--affinity);
  font: 0.57rem 'Cinzel', serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.grim-back-atlas {
  min-height: 36px;
  padding: 0 11px;
  border-radius: 3px;
  white-space: nowrap;
}

.grim-school-turn {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  color: #988b9a;
  font: 0.57rem 'Cinzel', serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.grim-school-turn-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.grim-school-turn button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #c4a4d5;
  font: inherit;
  text-align: right;
  text-transform: uppercase;
}

.grim-school-turn button:hover {
  color: #eed9ac;
}

.grim-invocation-note {
  max-width: 900px;
  padding: 17px;
  border-left: 2px solid #b891cf;
  background: rgba(92, 56, 112, 0.12);
  color: #c7b9c9;
  font: 1.05rem/1.5 'Cormorant Garamond', serif;
}

.grim-invocation-note > p {
  margin: 0;
}

.grim-invocation-note aside {
  margin-top: 14px;
  padding-top: 11px;
  border-top: 1px solid rgba(185, 145, 207, 0.2);
}

.grim-invocation-note aside span {
  color: #d0b2e0;
  font: 0.62rem 'Cinzel', serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.grim-invocation-note aside p {
  margin: 5px 0 0;
}

.grim-sources {
  padding-bottom: 0;
}

.grim-sources-details {
  border: 1px solid rgba(201, 166, 106, 0.3);
  background: rgba(25, 18, 29, 0.88);
}

.grim-sources-details > summary {
  display: flex;
  min-height: 76px;
  padding: 15px 20px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.grim-sources-details > summary small,
.grim-sources-details > summary strong {
  display: block;
}

.grim-sources-details > summary small {
  margin-bottom: 5px;
  color: #c7a874;
  font: 0.57rem 'Cinzel', serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.grim-sources-details > summary strong {
  color: #eee0ce;
  font: 600 1.05rem 'Cinzel', serif;
}

.grim-sources-mark {
  color: #d1b47b;
  font: 1.5rem 'Manrope', sans-serif;
  transition: transform 200ms ease;
}

.grim-sources-details[open] .grim-sources-mark {
  transform: rotate(45deg);
}

.grim-sources-body {
  padding: 0 22px 22px;
  color: #c3b7c1;
  font: 1rem/1.55 'Cormorant Garamond', serif;
}

.grim-sources-body > p:first-child {
  margin-top: 0;
}

.grim-sources-body ol {
  display: grid;
  padding-left: 25px;
  gap: 11px;
}

.grim-sources-body li {
  padding-left: 5px;
}

.grim-sources-body li::marker {
  color: #d0b177;
  font-family: 'Cinzel', serif;
}

.grim-sources-body li p {
  margin: 3px 0;
}

.grim-sources-body a {
  color: #c5a4dc;
  overflow-wrap: anywhere;
}

.grim-sources-body h3 {
  margin: 22px 0 5px;
  color: #e3d1ba;
  font: 600 0.92rem 'Cinzel', serif;
}

.grim-sources-body ul {
  padding-left: 20px;
}

.grim-sources-body ul li + li {
  margin-top: 7px;
}

.grim-editorial-note {
  padding: 12px 14px;
  border-left: 2px solid #b891cf;
  background: rgba(99, 63, 117, 0.13);
}

.grim-footer {
  display: flex;
  min-height: 80px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #9c8c9f;
}

.grim-footer img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  opacity: 0.72;
}

.grim-footer p {
  font: 0.56rem 'Cinzel', serif;
  letter-spacing: 0.08em;
}

.grim-footer p span {
  color: #c9a66a;
}

.grim-footer button {
  padding: 7px 10px;
  border: 1px solid rgba(201, 166, 106, 0.28);
  background: transparent;
  color: #c7ab7b;
  font: 0.55rem 'Cinzel', serif;
  text-transform: uppercase;
}

.grim-modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  padding: clamp(8px, 2vh, 18px);
  place-items: center;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgba(8, 5, 11, 0.84);
  backdrop-filter: blur(9px);
  animation: grim-fade-in 180ms ease both;
}

.grim-art-modal,
.grim-spell-modal {
  --affinity: #c19ae0;
  --affinity-glow: rgba(157, 103, 199, 0.23);
  position: relative;
  width: min(720px, 100%);
  max-height: min(88vh, 760px);
  overflow: auto;
  border: 1px solid color-mix(in srgb, var(--affinity) 54%, #c9a66a);
  background:
    radial-gradient(ellipse at 50% 0, var(--affinity-glow), transparent 65%),
    #17111d;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.72), 0 0 50px var(--affinity-glow);
  animation: grim-page-enter 300ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.grim-art-modal {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(230px, 0.9fr);
}

.grim-art-modal > img {
  width: 100%;
  height: 100%;
  min-height: 330px;
  object-fit: cover;
}

.grim-modal-copy {
  display: flex;
  padding: 34px 28px;
  flex-direction: column;
  justify-content: center;
}

.grim-modal-copy h3,
.grim-spell-modal h3 {
  margin: 0 0 12px;
  color: #f3e1c9;
  font: 600 clamp(1.5rem, 4vw, 2.25rem) 'Cinzel', serif;
}

.grim-modal-copy > p:not(.grim-kicker) {
  color: #d1c1d0;
  font: 1.2rem/1.5 'Cormorant Garamond', serif;
}

.grim-modal-copy > span {
  margin-top: 12px;
  color: #9d8e9e;
  font-size: 0.72rem;
}

.grim-modal-close {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(201, 166, 106, 0.38);
  border-radius: 50%;
  color: #f0dfc7 !important;
  background: rgba(13, 10, 16, 0.82);
  font-size: 1.45rem !important;
  line-height: 1;
}

.grim-modal-close:hover {
  border-color: #d4b77a;
  background: rgba(73, 48, 82, 0.9);
}

.grim-spell-modal {
  width: min(600px, 100%);
  padding: 42px;
  text-align: center;
}

.grim-modal-book-art {
  position: relative;
  display: grid;
  width: 88px;
  height: 88px;
  margin: 0 auto 17px;
  place-items: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--affinity) 58%, transparent);
  border-radius: 50%;
  background: rgba(12, 9, 16, 0.68);
  box-shadow: 0 0 28px var(--affinity-glow);
}

.grim-modal-book-art::before {
  position: absolute;
  z-index: 1;
  content: "";
  inset: 5px;
  border: 1px solid color-mix(in srgb, var(--affinity) 55%, transparent);
  border-radius: 50%;
  pointer-events: none;
}

.grim-modal-book-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.54;
  filter: saturate(0.75) brightness(0.65);
}

.grim-modal-sigil {
  position: relative;
  z-index: 2;
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  color: var(--affinity);
  font: 1.7rem 'Cinzel', serif;
  animation: grim-sigil-float 3s ease-in-out infinite;
  text-shadow: 0 0 14px var(--affinity);
}

.grim-spell-modal.grim-affinity--air .grim-modal-sigil { animation-name: grim-air-gust; }
.grim-spell-modal.grim-affinity--arcana .grim-modal-sigil { animation-name: grim-arcane-orbit; }
.grim-spell-modal.grim-affinity--curse .grim-modal-sigil { animation-name: grim-curse-chain; }
.grim-spell-modal.grim-affinity--blood .grim-modal-sigil { animation-name: grim-blood-pulse; }
.grim-spell-modal.grim-affinity--bone .grim-modal-sigil { animation-name: grim-bone-ash; }
.grim-spell-modal.grim-affinity--earth .grim-modal-sigil { animation-name: grim-earth-tremor; }
.grim-spell-modal.grim-affinity--eldritch .grim-modal-sigil { animation-name: grim-eldritch-phase; }
.grim-spell-modal.grim-affinity--iron .grim-modal-sigil { animation-name: grim-metal-drift; }
.grim-spell-modal.grim-affinity--fire .grim-modal-sigil { animation-name: grim-fire-flicker; }
.grim-spell-modal.grim-affinity--light .grim-modal-sigil { animation-name: grim-light-halo; }
.grim-spell-modal.grim-affinity--mind .grim-modal-sigil { animation-name: grim-mental-wave; }
.grim-spell-modal.grim-affinity--sigil .grim-modal-sigil { animation-name: grim-sigil-rotate; }
.grim-spell-modal.grim-affinity--summon .grim-modal-sigil { animation-name: grim-summon-gate; }
.grim-spell-modal.grim-affinity--venom .grim-modal-sigil { animation-name: grim-venom-sway; }
.grim-spell-modal.grim-affinity--water .grim-modal-sigil { animation-name: grim-water-flow; }
.grim-spell-modal.grim-affinity--white .grim-modal-sigil { animation-name: grim-white-glow; }

.grim-spell-modal.grim-affinity--air .grim-modal-book-art { box-shadow: 0 0 28px var(--affinity-glow), inset 0 0 18px rgba(114, 182, 232, 0.2); }
.grim-spell-modal.grim-affinity--curse .grim-modal-book-art { box-shadow: 0 0 28px var(--affinity-glow), inset 0 0 18px rgba(113, 48, 147, 0.22); }
.grim-spell-modal.grim-affinity--blood .grim-modal-book-art { box-shadow: 0 0 28px var(--affinity-glow), inset 0 0 18px rgba(181, 38, 69, 0.22); }
.grim-spell-modal.grim-affinity--fire .grim-modal-book-art { box-shadow: 0 0 28px var(--affinity-glow), inset 0 0 18px rgba(239, 117, 54, 0.22); }
.grim-spell-modal.grim-affinity--water .grim-modal-book-art { box-shadow: 0 0 28px var(--affinity-glow), inset 0 0 18px rgba(66, 157, 202, 0.22); }
.grim-spell-modal.grim-affinity--venom .grim-modal-book-art { box-shadow: 0 0 28px var(--affinity-glow), inset 0 0 18px rgba(102, 166, 57, 0.22); }

@keyframes grim-air-gust { 0%, 100% { transform: translate(-2px, 2px) rotate(-8deg); } 50% { transform: translate(3px, -3px) rotate(8deg); } }
@keyframes grim-arcane-orbit { to { transform: rotate(360deg); } }
@keyframes grim-curse-chain { 0%, 100% { transform: translateY(-4px) scaleY(1.05); } 50% { transform: translateY(3px) scaleY(0.94); } }
@keyframes grim-blood-pulse { 0%, 100% { transform: scale(0.92); text-shadow: 0 0 8px var(--affinity); } 50% { transform: scale(1.12); text-shadow: 0 0 22px var(--affinity); } }
@keyframes grim-bone-ash { 0%, 100% { transform: translateY(3px) rotate(-5deg); opacity: 0.82; } 50% { transform: translateY(-5px) rotate(4deg); opacity: 1; } }
@keyframes grim-earth-tremor { 0%, 100% { transform: translate(0); } 30% { transform: translate(-2px, 1px); } 65% { transform: translate(2px, -1px); } }
@keyframes grim-eldritch-phase { 0%, 100% { filter: blur(0); transform: scale(0.95); } 50% { filter: blur(1px); transform: scale(1.12); } }
@keyframes grim-metal-drift { 0%, 100% { transform: translate(-2px, 1px) rotate(-4deg); } 50% { transform: translate(2px, -2px) rotate(5deg); } }
@keyframes grim-fire-flicker { 0%, 100% { transform: scaleY(0.93) skewX(-4deg); filter: brightness(0.9); } 50% { transform: scaleY(1.12) skewX(4deg); filter: brightness(1.25); } }
@keyframes grim-light-halo { 0%, 100% { transform: scale(0.9); text-shadow: 0 0 8px var(--affinity); } 50% { transform: scale(1.1); text-shadow: 0 0 24px var(--affinity); } }
@keyframes grim-mental-wave { 0%, 100% { transform: scale(0.9) rotate(-5deg); } 50% { transform: scale(1.08) rotate(5deg); } }
@keyframes grim-sigil-rotate { to { transform: rotate(180deg); } }
@keyframes grim-summon-gate { 0%, 100% { transform: scale(0.78); opacity: 0.75; } 50% { transform: scale(1.12); opacity: 1; } }
@keyframes grim-venom-sway { 0%, 100% { transform: rotate(-9deg) translateX(-2px); } 50% { transform: rotate(9deg) translateX(2px); } }
@keyframes grim-water-flow { 0%, 100% { transform: translateY(3px) scaleX(0.92); } 50% { transform: translateY(-3px) scaleX(1.08); } }
@keyframes grim-white-glow { 0%, 100% { opacity: 0.75; filter: brightness(0.9); } 50% { opacity: 1; filter: brightness(1.4); } }
}

.grim-spell-modal .grim-kicker {
  margin-bottom: 8px;
}

.grim-modal-description {
  max-width: 480px;
  margin: 0 auto 23px;
  color: #d3c4d2;
  font: 1.3rem/1.5 'Cormorant Garamond', serif;
}

.grim-modal-status {
  display: grid;
  padding: 14px;
  grid-template-columns: minmax(90px, 0.4fr) minmax(0, 1fr);
  gap: 10px 14px;
  border: 1px solid rgba(201, 166, 106, 0.18);
  background: rgba(10, 8, 13, 0.42);
  text-align: left;
}

.grim-modal-status > span {
  color: #a998aa;
  font: 0.59rem 'Cinzel', serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.grim-modal-status > strong {
  color: #e5d7c5;
  font: 0.76rem 'Manrope', sans-serif;
}

.grim-modal-status .grim-status {
  display: inline-flex;
  width: fit-content;
  font: 0.55rem 'Cinzel', serif;
}

.grim-modal-caveat {
  margin: 16px 0 0;
  color: #ad9eae;
  font: italic 1rem 'Cormorant Garamond', serif;
}

@keyframes grim-spark {
  from { opacity: 0.28; transform: scale(0.75); }
  to { opacity: 1; transform: scale(1.3); }
}

@keyframes grim-seal-turn {
  to { transform: rotate(360deg); }
}

@keyframes grim-seal-pulse {
  0%, 100% { box-shadow: 0 0 18px rgba(154, 104, 184, 0.16), inset 0 0 14px rgba(201, 166, 106, 0.08); }
  50% { box-shadow: 0 0 30px rgba(154, 104, 184, 0.34), inset 0 0 20px rgba(201, 166, 106, 0.18); }
}

@keyframes grim-title-open {
  from { opacity: 0; letter-spacing: 0.18em; transform: translateY(8px); }
  to { opacity: 1; letter-spacing: 0.075em; transform: translateY(0); }
}

@keyframes grim-book-open {
  0% { opacity: 0; transform: scaleX(0.55) translateY(12px); }
  70% { opacity: 1; transform: scaleX(1.04) translateY(0); }
  100% { transform: scaleX(1); }
}

@keyframes grim-card-reveal {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes grim-page-enter {
  from { opacity: 0; transform: translateY(9px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes grim-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@media (max-width: 1080px) {
  .grim-atlas-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grim-spell-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grim-school-heading {
    grid-template-columns: 84px minmax(0, 1fr) auto;
  }

  .grim-school-heading-art {
    width: 82px;
    height: 82px;
  }
}

@media (max-width: 760px) {
  .grimorio {
    margin: -20px -20px -30px;
    padding: 0 18px 22px;
  }

  .grim-reading-progress {
    margin: 0 -18px;
  }

  .grim-hero {
    min-height: 545px;
    padding: 65px 12px 40px;
  }

  .grim-hero::before {
    inset: 8px;
  }

  .grim-hero__seal {
    width: 60px;
    height: 60px;
  }

  .grim-open-book {
    height: 120px;
    margin-top: 24px;
  }

  .grim-open-book__page {
    padding: 15px 7px;
  }

  .grim-decree {
    margin: 25px auto 39px;
    padding: 22px 23px;
    grid-template-columns: 47px minmax(0, 1fr);
    gap: 14px;
  }

  .grim-decree__seal {
    width: 46px;
    height: 46px;
    font-size: 1.4rem;
  }

  .grim-atlas-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
  }

  .grim-atlas-copy {
    padding: 11px 11px 12px;
  }

  .grim-atlas-title {
    font-size: 0.85rem !important;
  }

  .grim-search-controls {
    grid-template-columns: 1fr 1fr;
  }

  .grim-search-controls label:first-child {
    grid-column: 1 / -1;
  }

  .grim-search-count {
    grid-column: 1 / -1;
  }

  .grim-recent-section {
    padding: 21px 14px 25px;
  }

  .grim-utility-grid {
    grid-template-columns: 1fr;
  }

  .grim-initiation-path {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .grim-initiation-path::before,
  .grim-initiation-path::after {
    display: none;
  }

  .grim-case-grid {
    grid-template-columns: 1fr;
  }

  .grim-case-story {
    min-height: 0;
  }

  .grim-school-section {
    padding: 16px;
  }

  .grim-school-heading {
    grid-template-columns: 66px minmax(0, 1fr);
    gap: 12px;
  }

  .grim-school-heading-art {
    width: 64px;
    height: 64px;
  }

  .grim-back-atlas {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .grim-spell-grid {
    grid-template-columns: 1fr;
  }

  .grim-spell-card > p {
    margin-top: 6px;
  }

  .grim-art-modal {
    grid-template-columns: 1fr;
  }

  .grim-art-modal > img {
    height: min(55vh, 390px);
    min-height: 220px;
  }

  .grim-modal-copy {
    padding: 22px;
  }

  .grim-spell-modal {
    padding: 38px 21px 24px;
  }

  .grim-footer {
    flex-wrap: wrap;
    padding: 13px 0;
  }
}

@media (max-width: 440px) {
  .grim-atlas-grid {
    grid-template-columns: 1fr;
  }

  .grim-atlas-art {
    aspect-ratio: 1.35 / 1;
  }

  .grim-search-controls {
    grid-template-columns: 1fr;
  }

  .grim-search-controls label:first-child {
    grid-column: auto;
  }

  .grim-initiation-path {
    grid-template-columns: 1fr;
  }

  .grim-utility-card summary {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .grim-utility-count {
    grid-column: 2;
  }

  .grim-utility-card > p,
  .grim-utility-spells {
    padding-left: 16px;
  }

  .grim-school-modal {
    width: min(680px, 100%);
    max-height: min(92vh, 900px);
    max-height: min(92dvh, 900px);
    padding: 14px 14px 11px;
  }

  .grim-school-modal-heading {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 11px;
    padding: 0 34px 10px 0;
  }

  .grim-school-modal-heading > img {
    width: 76px;
    height: 76px;
  }

  .grim-school-modal-heading .grim-kicker {
    font-size: 0.5rem;
  }

  .grim-school-modal-hint {
    display: block;
    margin: 8px 0 0;
    color: #b6a7b6;
    font: 0.78rem/1.3 'Manrope', sans-serif;
  }

  .grim-school-modal-spells {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 10px 0;
  }

  .grim-school-modal-spells .grim-spell-card {
    padding: 8px 9px;
  }

  .grim-school-modal-spells .grim-spell-name {
    min-height: 0;
    font-size: 0.7rem !important;
  }

  .grim-school-modal-spells .grim-spell-card > p {
    display: none;
  }

  .grim-school-modal-spells .grim-school-tag {
    display: none;
  }

  .grim-school-modal-footer {
    padding-top: 7px;
    font-size: 0.49rem;
  }

  .grim-modal-status {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .grim-modal-status > strong + span {
    margin-top: 7px;
  }

  .grim-footer p {
    font-size: 0.49rem;
  }
}

@media (max-width: 360px) {
  .grim-school-modal {
    padding: 10px 10px 8px;
  }

  .grim-school-modal-heading {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 8px;
    padding: 0 30px 7px 0;
  }

  .grim-school-modal-heading > img {
    width: 58px;
    height: 58px;
  }

  .grim-school-modal-heading > div > p:not(.grim-kicker) {
    display: none;
  }

  .grim-school-modal-hint {
    margin-top: 5px;
    font-size: 0.67rem;
  }

  .grim-school-modal-spells {
    gap: 5px;
    padding: 7px 0;
  }

  .grim-school-modal-spells .grim-spell-card {
    padding: 6px 7px;
  }

  .grim-school-modal-spells .grim-spell-name {
    font-size: 0.63rem !important;
  }

  .grim-school-modal-spells .grim-spell-arrow {
    display: none;
  }

  .grim-school-modal-spells .grim-status {
    min-height: 16px;
    padding: 1px 4px;
    font-size: 0.4rem;
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .grimorio *,
  .grimorio *::before,
  .grimorio *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* —— Layout de portal (misma paleta, nueva estructura) —— */

.app-root {
  position: relative;
  z-index: 1;
  width: min(1400px, calc(100% - 32px));
  margin: 28px auto 48px;
}

.app-root .app-shell {
  width: 100%;
  margin: 0;
}

.welcome-screen,
.delivery-screen,
.hub-layout {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(38, 16, 29, 0.86), rgba(17, 8, 15, 0.84));
  box-shadow: 0 28px 64px var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(16px);
}

.welcome-screen,
.delivery-screen {
  padding: clamp(32px, 6vw, 72px) clamp(22px, 5vw, 64px);
  min-height: 78vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.welcome-orb {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(169, 31, 62, 0.28), transparent 68%);
  top: -80px;
  right: -40px;
  pointer-events: none;
}

.welcome-brand {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.welcome-brand h1,
.welcome-screen h2 {
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: 0.22em;
  text-shadow: 0 0 22px rgba(255, 213, 215, 0.14);
}

.welcome-brand h1 {
  margin: 12px 0 0;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  color: var(--accent-strong);
}

.welcome-intro,
.welcome-note {
  max-width: 640px;
  color: var(--muted);
  line-height: 1.8;
}

.welcome-process {
  width: min(100%, 680px);
  margin: 28px 0 8px;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(48, 21, 35, 0.82), rgba(22, 10, 19, 0.9));
  text-align: left;
}

.welcome-process h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.journey-list,
.delivery-steps {
  margin: 16px 0 0;
  padding-left: 22px;
  color: var(--text);
  line-height: 1.8;
}

.welcome-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 28px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.choice-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 108px;
  padding: 16px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(13, 5, 11, 0.72);
  color: var(--muted);
  text-align: left;
  transition: var(--transition);
}

.choice-card strong {
  color: var(--text);
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
}

.race-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.race-step-block + .race-step-block {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.race-step-title {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.race-step-text {
  max-width: 70ch;
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.7;
}

.race-grid .choice-card span {
  line-height: 1.6;
  font-size: 0.92rem;
}

.codex-help {
  margin: -6px 0 14px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.choice-card:hover,
.choice-card.selected {
  border-color: rgba(239, 169, 173, 0.5);
  background: linear-gradient(135deg, rgba(169, 31, 62, 0.22), rgba(255, 226, 218, 0.07));
  color: var(--text);
  transform: translateY(-1px);
}

.block-gap {
  display: block;
  margin-top: 22px;
}

.field-span {
  grid-column: 1 / -1;
}

.path-nav {
  margin-bottom: 18px;
  color: var(--soft);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.7;
}

.path-nav .is-current {
  color: var(--accent-strong);
}

.progress-now {
  margin: 12px 0 0;
  color: var(--accent);
  font-size: 0.82rem;
}

.nav-side-link {
  width: 100%;
  margin-top: 18px;
}

.chapter-stack {
  display: grid;
  gap: 12px;
}

.lore-chapter {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(48, 21, 35, 0.82), rgba(22, 10, 19, 0.9));
  padding: 4px 18px 4px;
}

.lore-chapter summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 0;
}

.lore-chapter summary::-webkit-details-marker {
  display: none;
}

.lore-chapter .chapter-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--soft);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lore-chapter p,
.rule-block p {
  color: var(--muted);
  line-height: 1.7;
}

.lore-chapter[open] {
  padding-bottom: 18px;
}

.rule-intro {
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.rule-block {
  padding: 18px 0;
  border-bottom: 1px solid rgba(245, 214, 216, 0.08);
}

.rule-block:last-child {
  border-bottom: 0;
  padding-bottom: 4px;
}

.rule-block h3 {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
}

.rule-subtitle,
.rule-minor {
  margin: 16px 0 6px;
  color: var(--text);
}

.rule-subtitle {
  font-size: 0.95rem;
  font-weight: 600;
}

.rule-minor {
  color: var(--soft);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rule-block p,
.rule-intro p {
  margin: 8px 0;
  white-space: pre-line;
}

.rule-list {
  margin: 8px 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
}

.rule-list li + li {
  margin-top: 4px;
}

.rule-list li::marker {
  color: var(--accent-strong);
}

.rule-block .rule-note {
  margin: 14px 0 4px;
  padding: 12px 14px;
  border-left: 2px solid rgba(239, 169, 173, 0.6);
  border-radius: 0 12px 12px 0;
  background: rgba(169, 31, 62, 0.12);
  color: var(--text);
}

.rule-command code {
  display: inline-block;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(13, 5, 11, 0.72);
  color: var(--accent-strong);
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 0.88rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.accept-panel {
  display: grid;
  gap: 12px;
}

.accept-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(13, 5, 11, 0.72);
}

.accept-row input {
  margin-top: 4px;
  accent-color: var(--ember);
}

.ready-note,
.code-chip {
  margin-top: 18px;
  color: var(--accent);
}

.status-banner.status-ok {
  border-color: rgba(215, 239, 220, 0.28);
  background: rgba(215, 239, 220, 0.08);
  color: var(--success);
}

.drop-zone.is-busy {
  opacity: 0.72;
}

.hub-layout {
  padding: 0;
}

.hub-top {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(65, 26, 45, 0.58), rgba(20, 8, 17, 0.76));
}

.brand-inline {
  display: flex;
  align-items: center;
  gap: 14px;
  background: transparent;
  border: 0;
  color: inherit;
  text-align: left;
  padding: 0;
}

.brand-inline strong {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: 0.2em;
  font-size: 1.35rem;
  color: var(--accent-strong);
}

.hub-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hub-nav-item {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
}

.hub-nav-item.active,
.hub-nav-item:hover {
  border-color: rgba(239, 169, 173, 0.5);
  background: linear-gradient(135deg, rgba(169, 31, 62, 0.22), rgba(255, 226, 218, 0.07));
  color: var(--text);
}

.hub-main {
  padding: 24px 28px 36px;
}

.resume-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  padding: 14px 16px;
  border: 1px solid rgba(240, 211, 154, 0.25);
  border-radius: 14px;
  background: rgba(240, 211, 154, 0.06);
  color: var(--warning);
}

.hub-card-grid,
.entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.hub-link-card,
.entry-card {
  padding: 20px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(48, 21, 35, 0.82), rgba(22, 10, 19, 0.9));
  color: inherit;
  text-align: left;
}

.hub-link-card {
  min-height: 140px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hub-link-card.featured {
  border-color: rgba(239, 169, 173, 0.5);
}

.hub-link-card strong,
.entry-card h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem;
  letter-spacing: 0.06em;
}

.hub-link-card span,
.entry-card p {
  color: var(--muted);
  line-height: 1.6;
}

.entry-card.pending {
  grid-column: 1 / -1;
}

/* Insignia fija de Discord (arriba a la derecha en todas las pantallas) */
.discord-badge {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 15;
  display: flex;
  align-items: center;
  text-decoration: none;
}

.discord-badge-sign {
  position: relative;
  margin-right: -12px;
  padding: 7px 22px 8px 14px;
  border: 2px solid #b8894a;
  border-radius: 4px 0 0 4px;
  background:
    repeating-linear-gradient(100deg, rgba(255, 255, 255, 0.03) 0 3px, transparent 3px 9px),
    linear-gradient(180deg, #6a4422, #3a230f);
  box-shadow: inset 0 1px 0 rgba(255, 228, 180, 0.35), inset 0 -2px 0 rgba(0, 0, 0, 0.35), 0 8px 18px rgba(5, 1, 5, 0.55);
  color: #f6dfae;
  font-family: 'Metamorphous', 'Cinzel', serif;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 0 #1c0f05, 0 0 10px rgba(231, 189, 131, 0.35);
  white-space: nowrap;
  transition: transform var(--transition), color var(--transition);
}

.discord-badge-logo {
  position: relative;
  width: 84px;
  height: 84px;
  filter: drop-shadow(0 6px 14px rgba(5, 1, 5, 0.65));
  transition: transform 220ms ease, filter 220ms ease;
}

.discord-badge:hover .discord-badge-logo,
.discord-badge:focus-visible .discord-badge-logo {
  transform: rotate(-6deg) scale(1.08);
  filter: drop-shadow(0 6px 14px rgba(5, 1, 5, 0.65)) drop-shadow(0 0 14px rgba(88, 101, 242, 0.55));
}

.discord-badge.is-friendly-rivalry .discord-badge-logo {
  animation: discord-friendly-bump 550ms ease-in-out 2;
  filter: drop-shadow(0 6px 14px rgba(5, 1, 5, 0.65)) drop-shadow(0 0 14px rgba(164, 112, 221, 0.65));
}

.discord-badge:hover .discord-badge-sign,
.discord-badge:focus-visible .discord-badge-sign {
  color: #fff3d6;
  transform: translateX(-3px);
}

.discord-badge:focus-visible {
  outline: none;
}

@media (max-width: 760px) {
  .discord-badge {
    top: 6px;
    right: 6px;
    flex-direction: column-reverse;
  }

  .discord-badge-sign {
    margin: -8px 0 0;
    padding: 3px 5px 4px;
    border-width: 1px;
    border-radius: 4px;
    font-size: 0.56rem;
    letter-spacing: 0.02em;
  }

  .discord-badge-logo {
    width: 50px;
    height: 50px;
  }

  .discord-badge:hover .discord-badge-sign,
  .discord-badge:focus-visible .discord-badge-sign {
    transform: none;
  }
}

/* Los visores a pantalla completa viven dentro de #app (su propio contexto de apilamiento),
   así que la insignia se oculta mientras están abiertos. */
body.history-reading .discord-badge,
body.lightbox-open .discord-badge {
  display: none;
}

@media (max-width: 400px) {
  .brand-inline strong,
  .brand-copy h1 {
    font-size: 1.1rem;
    letter-spacing: 0.1em;
  }

  .welcome-brand {
    padding-top: 44px;
  }
}

@media print {
  .discord-badge {
    display: none;
  }
}

/* Mascota y guía de donaciones: componente flotante independiente del contenido. */
.maledicta-mascot,
.maledicta-mascot * {
  box-sizing: border-box;
}

.maledicta-mascot [hidden] {
  display: none !important;
}

.maledicta-mascot {
  position: fixed;
  z-index: 20;
  left: auto;
  top: auto;
  right: 14px;
  bottom: 32px;
  width: 108px;
  height: 136px;
  pointer-events: none;
  color: #fff3ec;
  font-family: 'Manrope', sans-serif;
}

.mascot-companion {
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  place-items: center;
  width: 100px;
  height: 126px;
  padding: 5px;
  border: 0;
  background: transparent;
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
  filter: drop-shadow(0 6px 12px rgba(4, 1, 8, .72));
}

.mascot-companion:active {
  cursor: grabbing;
}

.mascot-companion:focus-visible,
.mascot-close:focus-visible,
.mascot-nav-button:focus-visible,
.mascot-action-link:focus-visible {
  outline: 2px solid #f4cf90;
  outline-offset: 3px;
}

.mascot-companion img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: 50% 82%;
  animation: mascot-breathe 2.7s ease-in-out infinite;
  user-select: none;
}

.mascot-companion:hover img {
  animation: mascot-hop 560ms ease;
}

.mascot-support-link {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 78px;
  min-height: 21px;
  padding: 2px 7px;
  border: 1px solid rgba(255, 222, 189, .78);
  border-radius: 999px;
  background: linear-gradient(135deg, #253d68, #3f72a8);
  box-shadow: 0 3px 12px rgba(0, 0, 0, .45);
  color: #fff5e8;
  font-size: .58rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: background 250ms ease, box-shadow 250ms ease, opacity 180ms ease, transform 250ms ease, visibility 0s linear 180ms;
}

.mascot-support-link:hover {
  background: linear-gradient(135deg, #31568e, #6094c6);
  box-shadow: 0 0 16px rgba(121, 177, 235, .5);
  transform: translateY(-2px);
}

.maledicta-mascot.is-support-open .mascot-support-link {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  transition-delay: 0s;
}

.mascot-speech {
  position: fixed;
  z-index: 2;
  left: 0;
  top: 0;
  width: fit-content;
  min-width: min(120px, calc(100vw - 24px));
  max-width: min(300px, calc(100vw - 24px));
  overflow-wrap: anywhere;
  padding: 11px 13px;
  border: 1px solid rgba(241, 195, 129, .75);
  border-radius: 15px;
  background: linear-gradient(145deg, #fff2d9, #eac79a);
  box-shadow: 0 8px 26px rgba(6, 2, 10, .45);
  color: #352331;
  font-size: clamp(.65rem, 2vw, .79rem);
  font-weight: 700;
  line-height: 1.45;
  pointer-events: none;
  animation: mascot-bubble-in 180ms ease-out both;
}

.mascot-speech::after {
  position: absolute;
  width: 0;
  height: 0;
  border: 8px solid transparent;
  content: "";
}

.mascot-speech[data-anchor="top"] {
  border-radius: 15px 15px 4px 15px;
}

.mascot-speech[data-anchor="top"]::after {
  top: 100%;
  left: calc(var(--mascot-tail-offset) - 8px);
  border-top-color: #eac79a;
  border-bottom: 0;
}

.mascot-speech[data-anchor="bottom"] {
  border-radius: 15px 4px 15px 15px;
}

.mascot-speech[data-anchor="bottom"]::after {
  bottom: 100%;
  left: calc(var(--mascot-tail-offset) - 8px);
  border-bottom-color: #fff2d9;
  border-top: 0;
}

.mascot-speech[data-anchor="left"]::after {
  top: calc(var(--mascot-tail-offset) - 8px);
  left: 100%;
  border-left-color: #eac79a;
  border-right: 0;
}

.mascot-speech[data-anchor="right"]::after {
  top: calc(var(--mascot-tail-offset) - 8px);
  right: 100%;
  border-right-color: #fff2d9;
  border-left: 0;
}

.mascot-food {
  position: absolute;
  right: 8px;
  bottom: 20px;
  color: #ffd686;
  font-size: 24px;
  opacity: 0;
  pointer-events: none;
}

.mascot-mood-mark {
  position: absolute;
  top: 13px;
  left: 10px;
  z-index: 2;
  opacity: 0;
  color: #ffe3a2;
  font-family: 'Cormorant Garamond', serif;
  font-size: 23px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

.mascot-mood-mark::before {
  display: block;
  animation: mascot-mark-pop 300ms ease-out both;
}

.is-dizzy .mascot-mood-mark,
.is-cheerful .mascot-mood-mark,
.is-hungry .mascot-mood-mark,
.is-blushing .mascot-mood-mark,
.is-curious .mascot-mood-mark,
.is-surprised .mascot-mood-mark,
.is-dreamy .mascot-mood-mark,
.is-grateful .mascot-mood-mark,
.is-proud .mascot-mood-mark,
.is-playful .mascot-mood-mark {
  opacity: 1;
}

.is-dizzy .mascot-mood-mark::before { content: "↻"; animation: mascot-spin 700ms ease-in-out infinite; }
.is-cheerful .mascot-mood-mark::before { content: "✦"; color: #ffe092; }
.is-hungry .mascot-mood-mark::before { content: "♨"; color: #ffc96e; }
.is-blushing .mascot-mood-mark::before { content: "♥"; color: #ff9db7; }
.is-curious .mascot-mood-mark::before { content: "?"; color: #e5c4ff; }
.is-surprised .mascot-mood-mark::before { content: "!"; color: #ffdc8d; }
.is-dreamy .mascot-mood-mark::before { content: "✧"; color: #d7bcff; }
.is-grateful .mascot-mood-mark::before { content: "♡"; color: #ffb8d0; }
.is-proud .mascot-mood-mark::before { content: "✧"; color: #f5d490; }
.is-playful .mascot-mood-mark::before { content: "✦"; color: #e7b5ff; }

.mascot-zs {
  position: absolute;
  top: 0;
  right: 4px;
  z-index: 1;
  color: #d3b4ff;
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
}

.mascot-zs span {
  display: inline-block;
  margin-left: 2px;
  font-size: 12px;
  transform: translateY(-8px);
}

.maledicta-mascot.is-sleeping {
  bottom: 10px;
  width: 70px;
  height: 78px;
}

.is-sleeping .mascot-companion {
  width: 68px;
  height: 76px;
  bottom: 0;
  padding: 3px;
  cursor: pointer;
}

.is-sleeping .mascot-companion img {
  animation: mascot-sleep 2.8s ease-in-out infinite;
}

.is-sleeping .mascot-zs {
  opacity: 1;
  animation: mascot-zzz 2.5s ease-in-out infinite;
}

.is-sleeping.is-yawning .mascot-companion img {
  animation: mascot-yawn 900ms ease-in-out;
}

.is-excited .mascot-companion img,
.is-celebrating .mascot-companion img {
  animation: mascot-celebrate 650ms ease-in-out 2;
}

.is-dizzy .mascot-companion img {
  animation: mascot-dizzy 700ms ease-in-out;
}

.is-cheerful .mascot-companion img {
  animation: mascot-celebrate 650ms ease-in-out;
}

.is-hungry .mascot-food,
.is-rubbing-belly .mascot-food {
  opacity: 1;
  animation: mascot-heart 550ms ease-in-out 2;
}

.is-blushing .mascot-companion img {
  animation: mascot-blush 850ms ease-in-out;
}

.is-curious .mascot-companion img {
  animation: mascot-curious 900ms ease-in-out;
}

.is-surprised .mascot-companion img {
  animation: mascot-hop 560ms ease;
}

.is-grateful .mascot-companion img {
  animation: mascot-bow 850ms ease-in-out;
}

.is-playful .mascot-companion img {
  animation: mascot-hop 560ms ease-in-out;
}

.is-discord-duel .mascot-companion img {
  animation: mascot-friendly-clash 620ms ease-in-out 2;
}

.is-discord-duel .mascot-mood-mark {
  opacity: 1;
}

.is-discord-duel .mascot-mood-mark::before {
  content: "⚔";
  color: #e4c4ff;
}

.mascot-guide {
  position: fixed;
  right: 118px;
  bottom: 18px;
  z-index: 21;
  width: min(440px, calc(100vw - 28px));
  max-height: min(760px, calc(100dvh - 32px));
  overflow: auto;
  border: 1px solid rgba(198, 157, 226, .66);
  border-radius: 20px;
  background:
    radial-gradient(ellipse at 2% 5%, rgba(128, 62, 171, .18), transparent 34%),
    linear-gradient(155deg, rgba(33, 19, 42, .98), rgba(16, 10, 22, .99));
  box-shadow: 0 24px 70px rgba(0, 0, 0, .66), inset 0 0 0 1px rgba(255, 255, 255, .035);
  color: #fff4f0;
  pointer-events: auto;
  scrollbar-color: #78578b #1d1424;
  animation: mascot-panel-in 220ms ease-out both;
}

.mascot-guide-header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(210, 178, 222, .16);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.mascot-guide.is-guide-dragging .mascot-guide-header {
  cursor: grabbing;
}

.mascot-guide-emblem {
  display: grid;
  place-items: center;
  width: 40px;
  height: 42px;
  border: 1px solid #a87dc0;
  border-radius: 12px 12px 18px 18px;
  background: linear-gradient(145deg, #713e8d, #291936);
  color: #f5d894;
  font-family: 'Cinzel', serif;
  font-size: 24px;
  box-shadow: 0 0 18px rgba(178, 115, 214, .18);
}

.mascot-guide-header small,
.mascot-guide-header strong {
  display: block;
}

.mascot-guide-header small {
  margin-bottom: 2px;
  color: #d0a8e7;
  font-family: 'Cinzel', serif;
  font-size: .61rem;
  letter-spacing: .11em;
}

.mascot-guide-header strong {
  color: #fff2e8;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.07rem;
  line-height: 1.05;
}

.mascot-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(242, 207, 183, .44);
  border-radius: 50%;
  background: rgba(15, 8, 19, .72);
  color: #f6dcb6;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.mascot-region-warning {
  margin: 11px 13px 10px;
  padding: 10px 11px;
  border: 1px solid rgba(245, 188, 94, .72);
  border-radius: 12px;
  background: linear-gradient(115deg, rgba(138, 82, 25, .38), rgba(72, 39, 27, .32));
  box-shadow: inset 0 0 20px rgba(246, 190, 92, .055), 0 0 20px rgba(240, 178, 79, .08);
}

.mascot-region-warning strong {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  color: #ffdc9a;
  font-size: .7rem;
  letter-spacing: .025em;
  line-height: 1.45;
}

.mascot-region-warning strong span {
  display: inline-grid;
  flex: 0 0 17px;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #e7ae56;
  color: #28182b;
}

.mascot-region-warning p {
  margin: 5px 0 0 24px;
  color: #ecdcc6;
  font-size: .67rem;
  line-height: 1.45;
}

.mascot-progress {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  margin: 0 14px;
}

.mascot-progress-item {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 0;
  color: #9f8da8;
  text-align: center;
}

.mascot-progress-item::before {
  position: absolute;
  top: 13px;
  left: -50%;
  z-index: -1;
  width: 100%;
  height: 2px;
  background: rgba(201, 168, 219, .2);
  content: "";
}

.mascot-progress-item:first-child::before {
  display: none;
}

.mascot-progress-item > span {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid rgba(205, 176, 222, .38);
  border-radius: 50%;
  background: #241a2c;
  font-family: 'Cinzel', serif;
  font-size: .77rem;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.mascot-progress-item small {
  overflow: hidden;
  width: 100%;
  color: inherit;
  font-size: .53rem;
  line-height: 1.1;
  text-overflow: ellipsis;
}

.mascot-progress-item.is-current {
  color: #f2d5ff;
}

.mascot-progress-item.is-current > span,
.mascot-progress-item.is-done > span {
  border-color: #dfb5f5;
  background: linear-gradient(145deg, #8c57a8, #49305d);
  box-shadow: 0 0 15px rgba(192, 133, 225, .35);
  color: white;
  transform: scale(1.12);
}

.mascot-step-art {
  display: grid;
  place-items: center;
  min-height: 142px;
  margin: 10px 14px 0;
  overflow: hidden;
  border: 1px solid rgba(211, 176, 225, .16);
  border-radius: 14px;
  background:
    radial-gradient(ellipse at 50% 110%, rgba(134, 77, 165, .24), transparent 58%),
    rgba(8, 6, 12, .42);
}

.mascot-step-copy {
  padding: 12px 17px 4px;
}

.mascot-step-eyebrow {
  margin: 0 0 2px !important;
  color: #d5abea !important;
  font-family: 'Cinzel', serif;
  font-size: .62rem !important;
  letter-spacing: .13em;
}

.mascot-step-copy h2,
.mascot-finale h2 {
  margin: 0 0 5px;
  color: #f4d8ff;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  line-height: 1.05;
}

.mascot-step-copy > p:not(.mascot-step-eyebrow) {
  margin: 5px 0 9px;
  color: #e6d9e7;
  font-size: .76rem;
  line-height: 1.5;
}

.mascot-step-copy .mascot-step-note {
  padding: 7px 9px;
  border-left: 2px solid #c69bdf;
  background: rgba(142, 93, 171, .1);
  color: #ddc8e8 !important;
  font-size: .68rem !important;
}

.mascot-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 37px;
  margin: 2px 0 4px;
  padding: 7px 13px;
  border: 1px solid rgba(225, 192, 239, .48);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(101, 58, 124, .78), rgba(52, 33, 67, .92));
  color: #fff4ff;
  font-size: .73rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.mascot-action-link:hover {
  transform: translateY(-2px);
  filter: brightness(1.16);
  box-shadow: 0 7px 20px rgba(132, 71, 163, .25);
}

.mascot-action-link--bright {
  border-color: rgba(250, 220, 148, .76);
  background: linear-gradient(125deg, #9b612e, #694178 70%, #593264);
  color: #fff4d8;
}

.mascot-guide-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px 13px;
}

.mascot-nav-button {
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid rgba(206, 177, 220, .34);
  border-radius: 9px;
  background: rgba(25, 17, 32, .88);
  color: #e6d5ef;
  font-size: .7rem;
  font-weight: 700;
  transition: transform 150ms ease, border-color 150ms ease;
}

.mascot-nav-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #d4a9ea;
}

.mascot-nav-button:disabled {
  opacity: .42;
  cursor: not-allowed;
}

.mascot-nav-button--primary {
  border-color: rgba(234, 195, 250, .6);
  background: linear-gradient(120deg, #70418b, #4a2d62);
  color: #fff4ff;
}

.mascot-art {
  width: min(100% - 24px, 330px);
  animation: mascot-art-arrive 380ms ease-out both;
}

.mascot-art--register {
  display: grid;
  gap: 7px;
  width: min(100% - 72px, 250px);
  padding: 10px;
  border: 1px solid rgba(211, 180, 226, .32);
  border-radius: 11px;
  background: linear-gradient(150deg, #30223b, #1d1628);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .25);
}

.mascot-browser {
  display: flex;
  gap: 4px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, .11);
}

.mascot-browser span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #cf93ef;
}

.mascot-browser span:nth-child(2) { background: #eacb8f; }
.mascot-browser span:nth-child(3) { background: #dc888f; }

.mascot-art--register > strong {
  color: #f3d9ff;
  font-family: 'Cinzel', serif;
  font-size: .72rem;
}

.mascot-art--register > i {
  padding: 5px 7px;
  border: 1px solid rgba(227, 211, 235, .2);
  border-radius: 6px;
  color: #ad9bb8;
  font-size: .58rem;
  font-style: normal;
}

.mascot-art--register > b {
  padding: 6px;
  border-radius: 6px;
  background: #774a91;
  color: white;
  font-size: .6rem;
  text-align: center;
}

.mascot-art--register > b span { float: right; }

.mascot-art--regions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.mascot-region {
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 118px;
  padding: 11px 8px;
  border: 1px solid rgba(206, 186, 218, .24);
  border-radius: 14px;
  background: rgba(38, 29, 47, .8);
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.mascot-region small {
  color: #ac9bb3;
  font-size: .53rem;
  letter-spacing: .12em;
}

.mascot-region strong {
  color: #bca8c9;
  font-family: 'Cinzel', serif;
  font-size: 1.55rem;
}

.mascot-region em {
  color: #aa9bb0;
  font-size: .54rem;
  font-style: normal;
  text-align: center;
}

.mascot-region:hover {
  border-color: rgba(233, 202, 255, .66);
  box-shadow: 0 0 18px rgba(205, 159, 233, .2);
  transform: translateY(-3px);
}

.mascot-region--int {
  border-color: rgba(229, 191, 118, .78);
  background: linear-gradient(145deg, rgba(117, 74, 44, .46), rgba(75, 43, 74, .6));
  box-shadow: 0 0 24px rgba(236, 183, 107, .19);
  animation: mascot-int-pulse 1.8s ease-in-out infinite;
}

.mascot-region--int strong,
.mascot-region--int em {
  color: #ffe0a6;
}

.mascot-art--wallet {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.mascot-wallet {
  display: grid;
  gap: 7px;
  width: 154px;
  padding: 11px;
  border: 1px solid rgba(226, 189, 244, .42);
  border-radius: 12px 12px 19px 12px;
  background: linear-gradient(145deg, #644277, #302139);
  box-shadow: 0 8px 16px rgba(0, 0, 0, .25);
  transform: rotate(-3deg);
}

.mascot-wallet span,
.mascot-wallet strong { font-size: .58rem; }
.mascot-wallet span { color: #d3b3e4; letter-spacing: .08em; }
.mascot-wallet strong { color: #fff1d3; font-family: 'Cinzel', serif; }
.mascot-wallet b {
  padding: 6px 7px;
  border-radius: 6px;
  background: #d0a35f;
  color: #251b28;
  font-size: .55rem;
  text-align: center;
}

.mascot-art--wallet:hover .mascot-wallet {
  box-shadow: 0 0 24px rgba(205, 159, 233, .3);
  transform: rotate(0) translateY(-2px);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.mascot-payments {
  display: grid;
  gap: 7px;
  color: #eee1f1;
  font-size: .58rem;
}

.mascot-payments span {
  padding: 6px;
  border: 1px solid rgba(220, 190, 233, .22);
  border-radius: 6px;
  background: rgba(31, 23, 38, .82);
}

.mascot-payments small {
  max-width: 112px;
  color: #b7a6bb;
  font-size: .5rem;
  line-height: 1.3;
}

.mascot-art--portal {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100% - 40px, 300px);
  padding: 15px;
  border: 1px solid rgba(211, 174, 231, .38);
  border-radius: 14px;
  background: linear-gradient(120deg, rgba(105, 61, 128, .56), rgba(28, 19, 38, .94));
  box-shadow: 0 0 25px rgba(158, 95, 188, .14);
}

.mascot-portal-seal {
  display: grid;
  flex: 0 0 45px;
  place-items: center;
  width: 45px;
  height: 48px;
  border: 1px solid #c093dc;
  border-radius: 12px;
  background: #34203f;
  color: #f0d293;
  font-family: 'Cinzel', serif;
  font-size: 28px;
}

.mascot-art--portal > div { display: grid; gap: 3px; }
.mascot-art--portal small { color: #d2b4e1; font-size: .5rem; letter-spacing: .1em; }
.mascot-art--portal strong { color: #fff0d3; font-family: 'Cinzel', serif; font-size: .83rem; }
.mascot-art--portal em { color: #c3b0cb; font-size: .58rem; font-style: normal; }
.mascot-art--portal > b { margin-left: auto; color: #f6d48f; font-size: 1.3rem; }

.mascot-art--donation {
  display: grid;
  gap: 7px;
  width: min(100% - 42px, 290px);
  padding: 12px;
  border: 1px solid rgba(214, 182, 230, .32);
  border-radius: 12px;
  background: linear-gradient(145deg, #30223a, #1d1726);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .24);
}

.mascot-art--donation > strong {
  color: #f4d8ff;
  font-family: 'Cinzel', serif;
  font-size: .7rem;
}

.mascot-art--donation label {
  display: grid;
  gap: 3px;
  color: #c9b8d1;
  font-size: .53rem;
}

.mascot-art--donation input {
  width: 100%;
  padding: 6px 7px;
  border: 1px solid rgba(230, 207, 239, .2);
  border-radius: 6px;
  background: rgba(11, 8, 15, .55);
  color: #f2e7f4;
  font-size: .58rem;
}

.mascot-art--donation input::placeholder {
  color: #f0d08f;
}

.mascot-art--donation > small {
  color: #e8c788;
  font-size: .54rem;
}

.mascot-finale {
  padding: 24px 22px 18px;
  text-align: center;
  animation: mascot-art-arrive 350ms ease-out both;
}

.mascot-finale-stars {
  color: #f4d28d;
  font-size: 1.15rem;
  animation: mascot-star-shine 1.4s ease-in-out infinite alternate;
}

.mascot-finale-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: 6px auto 10px;
  border: 1px solid rgba(247, 214, 145, .6);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(193, 113, 187, .34), rgba(66, 42, 78, .65));
  color: #ffe09f;
  font-size: 2rem;
  animation: mascot-heart 900ms ease-in-out infinite;
}

.mascot-finale p {
  margin: 7px 0 10px;
  color: #e3d5e8;
  font-size: .73rem;
  line-height: 1.5;
}

@keyframes mascot-breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-2px) scale(1.015, .99); }
}

@keyframes mascot-sleep {
  0%, 100% { transform: translateY(2px) scale(1, .97) rotate(-2deg); }
  50% { transform: translateY(0) scale(1.02, .96) rotate(2deg); }
}

@keyframes mascot-hop {
  0%, 100% { transform: translateY(0) rotate(0); }
  45% { transform: translateY(-9px) rotate(-5deg); }
}

@keyframes mascot-celebrate {
  0%, 100% { transform: translateY(0) rotate(0) scale(1); }
  35% { transform: translateY(-13px) rotate(-7deg) scale(1.04); }
  70% { transform: translateY(-4px) rotate(7deg) scale(1.02); }
}

@keyframes mascot-yawn {
  0%, 100% { transform: rotate(0) scale(1); }
  35% { transform: rotate(-8deg) scale(1.03, .94); }
  70% { transform: rotate(7deg) scale(.97, 1.03); }
}

@keyframes mascot-dizzy {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-9deg) translateY(-2px); }
  45% { transform: rotate(9deg); }
  70% { transform: rotate(-6deg) translateY(-1px); }
}

@keyframes mascot-blush {
  0%, 100% { transform: rotate(0); }
  35% { transform: rotate(-5deg) translateY(-2px); }
  70% { transform: rotate(4deg); }
}

@keyframes mascot-curious {
  0%, 100% { transform: rotate(0); }
  40%, 70% { transform: rotate(-7deg) translateY(-2px); }
}

@keyframes mascot-bow {
  0%, 100% { transform: rotate(0) translateY(0); }
  45% { transform: rotate(10deg) translateY(3px) scale(.98); }
}

@keyframes mascot-spin {
  from { transform: rotate(0); }
  to { transform: rotate(360deg); }
}

@keyframes mascot-friendly-clash {
  0%, 100% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(-6px) rotate(-7deg); }
  50% { transform: translateX(4px) rotate(6deg) translateY(-4px); }
  75% { transform: translateX(-2px) rotate(-3deg); }
}

@keyframes discord-friendly-bump {
  0%, 100% { transform: rotate(0) scale(1); }
  30% { transform: rotate(7deg) scale(1.08); }
  65% { transform: rotate(-5deg) scale(1.04); }
}

@keyframes mascot-mark-pop {
  from { opacity: 0; transform: scale(.65) translateY(4px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes mascot-zzz {
  0%, 100% { transform: translateY(3px); opacity: .55; }
  50% { transform: translateY(-4px); opacity: 1; }
}

@keyframes mascot-heart {
  0%, 100% { transform: scale(.85); opacity: .65; }
  50% { transform: scale(1.16); opacity: 1; }
}

@keyframes mascot-bubble-in {
  from { opacity: 0; transform: translateY(5px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes mascot-panel-in {
  from { opacity: 0; transform: translateY(9px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes mascot-art-arrive {
  from { opacity: 0; transform: translateY(7px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes mascot-int-pulse {
  0%, 100% { box-shadow: 0 0 13px rgba(236, 183, 107, .13); }
  50% { box-shadow: 0 0 26px rgba(236, 183, 107, .38); }
}

@keyframes mascot-star-shine {
  from { opacity: .65; transform: scale(.96); }
  to { opacity: 1; transform: scale(1.05); }
}

@media (max-width: 560px) {
  .maledicta-mascot {
    right: 5px;
    bottom: 34px;
    width: 82px;
    height: 110px;
  }

  .mascot-companion {
    width: 78px;
    height: 105px;
    bottom: 0;
  }

  .mascot-support-link {
    min-width: 72px;
    min-height: 18px;
    padding: 2px 5px;
    font-size: .53rem;
  }

  .mascot-guide {
    right: 8px;
    bottom: 82px;
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 94px);
    border-radius: 17px;
  }

  .mascot-guide-header {
    padding: 10px 11px 9px;
  }

  .mascot-region-warning {
    margin: 8px 10px;
    padding: 8px 9px;
  }

  .mascot-progress {
    margin: 0 10px;
  }

  .mascot-step-art {
    min-height: 126px;
    margin: 8px 10px 0;
  }

  .mascot-step-copy {
    padding: 10px 13px 2px;
  }

  .mascot-guide-footer {
    padding: 8px 10px 10px;
  }

  .is-sleeping .mascot-companion {
    width: 61px;
    height: 70px;
  }

  .maledicta-mascot.is-sleeping {
    bottom: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .maledicta-mascot *,
  .maledicta-mascot *::before,
  .maledicta-mascot *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* Razas: códice con aspecto de libro medieval */
.codex-book {
  --parchment: #f3e4c6;
  --parchment-deep: #dcc196;
  --ink: #2e1d14;
  --ink-soft: #5e4330;
  --rubric: #8a1f1f;
  --gilt: #a8762f;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 34px;
  padding: 14px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 220, 190, 0.08), transparent 40%),
    linear-gradient(160deg, #4a1420, #24080f 70%);
  box-shadow: inset 0 0 0 2px rgba(168, 118, 47, 0.45), inset 0 0 0 8px #2a0a12, inset 0 0 0 9px rgba(168, 118, 47, 0.3), 0 26px 50px rgba(5, 1, 5, 0.55);
}

.codex-book--single {
  grid-template-columns: 1fr;
  max-width: 860px;
  margin-inline: auto;
}

.codex-page {
  position: relative;
  min-width: 0;
  padding: clamp(26px, 5vw, 52px) clamp(20px, 5vw, 50px);
  background:
    radial-gradient(ellipse at 50% 40%, transparent 55%, rgba(120, 78, 32, 0.28) 100%),
    radial-gradient(circle at 20% 15%, rgba(255, 250, 235, 0.55), transparent 45%),
    linear-gradient(180deg, var(--parchment), var(--parchment-deep));
  color: var(--ink);
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.12rem;
  line-height: 1.6;
}

.codex-page::before {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(110, 60, 30, 0.35);
  outline: 1px solid rgba(110, 60, 30, 0.2);
  outline-offset: 4px;
  pointer-events: none;
}

.codex-page--left {
  border-radius: 6px 2px 2px 6px;
  box-shadow: inset -26px 0 30px -18px rgba(70, 40, 15, 0.55);
}

.codex-page--right {
  border-radius: 2px 6px 6px 2px;
  box-shadow: inset 26px 0 30px -18px rgba(70, 40, 15, 0.55);
}

.codex-book--single .codex-page {
  border-radius: 6px;
}

.codex-page-head {
  margin-bottom: 18px;
  text-align: center;
}

.codex-kicker {
  display: block;
  color: var(--rubric);
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.codex-title {
  margin: 6px 0 0;
  color: var(--ink);
  font-family: 'Cinzel', serif;
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.codex-title--race {
  font-size: clamp(2rem, 6vw, 3.2rem);
  color: var(--rubric);
}

.codex-alias {
  margin: 0;
  color: var(--ink-soft);
  font-style: italic;
}

.codex-ornament {
  display: block;
  margin-top: 6px;
  color: var(--gilt);
  font-size: 1.4rem;
  line-height: 1;
}

.codex-group + .codex-group {
  margin-top: 30px;
}

.codex-group-title,
.codex-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 4px;
  color: var(--rubric);
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.codex-group-title::after,
.codex-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(138, 31, 31, 0.55), transparent);
}

.codex-group-note {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 1rem;
  font-style: italic;
  line-height: 1.45;
}

.codex-toc {
  margin: 0;
  padding: 0;
  list-style: none;
}

.codex-toc-link {
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  padding: 7px 6px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  transition: background var(--transition), color var(--transition);
}

.codex-toc-link:hover,
.codex-toc-link:focus-visible {
  background: rgba(138, 31, 31, 0.1);
  color: var(--rubric);
  outline: none;
}

.codex-toc-name {
  font-family: 'Cinzel', serif;
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.codex-toc-name::first-letter {
  color: var(--rubric);
  font-size: 1.25em;
}

.codex-toc-leader {
  flex: 1;
  min-width: 20px;
  border-bottom: 2px dotted rgba(94, 67, 48, 0.45);
  transform: translateY(-4px);
}

.codex-toc-chapter {
  color: var(--gilt);
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  font-weight: 700;
}

.codex-group--malditos .codex-group-title,
.codex-group--malditos .codex-toc-name {
  color: #5c0d14;
}

.codex-group--malditos .codex-toc-leader {
  border-bottom-color: rgba(92, 13, 20, 0.45);
}

.codex-identity {
  margin: 0 auto 18px;
  max-width: 60ch;
  color: var(--ink-soft);
  font-size: 1.2rem;
  font-style: italic;
  text-align: center;
}

.codex-identity span {
  display: block;
  color: var(--rubric);
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  font-style: normal;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.codex-lore p {
  max-width: 66ch;
  margin: 0 auto 22px;
  text-align: justify;
  hyphens: auto;
}

.codex-lore p:first-child::first-letter {
  float: left;
  margin: 6px 10px 0 0;
  padding: 2px 8px;
  border: 1px solid rgba(168, 118, 47, 0.6);
  background: linear-gradient(160deg, #8a1f1f, #4f0d12);
  color: #f6e3b8;
  font-family: 'Cinzel', serif;
  font-size: 3.1em;
  font-weight: 700;
  line-height: 1;
}

.codex-heading {
  margin-top: 26px;
  margin-bottom: 14px;
}

.codex-subheading {
  max-width: 66ch;
  margin: 24px auto 6px;
  color: var(--rubric);
  font-family: 'Cinzel', serif;
  font-size: 0.94rem;
  letter-spacing: 0.04em;
}

.codex-subheading:first-child {
  margin-top: 0;
}

.codex-page-subtitle {
  margin: 0 0 6px;
  color: var(--ink-soft);
  font-size: 1.05rem;
  font-style: italic;
  text-align: center;
}

.codex-lore-quote {
  max-width: 58ch;
  margin: 24px auto;
  padding: 18px 22px;
  border-left: 3px solid var(--gilt);
  background: rgba(255, 250, 235, 0.42);
  color: var(--ink-soft);
  font-size: 1.22rem;
  font-style: italic;
  line-height: 1.55;
  text-align: center;
}

.codex-race-figure {
  max-width: 66ch;
  margin: 18px auto 22px;
  overflow: hidden;
  border: 1px solid rgba(168, 118, 47, 0.72);
  border-radius: 5px;
  background: #28151a;
  box-shadow: 0 5px 16px rgba(46, 29, 20, 0.22), 0 0 0 4px rgba(243, 228, 198, 0.6);
}

.codex-race-figure img {
  display: block;
  width: 100%;
  max-height: 390px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center 52%;
}

.codex-race-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-width: 66ch;
  margin: 0 auto 22px;
}

.codex-race-detail {
  padding: 10px 12px;
  border: 1px solid rgba(168, 118, 47, 0.38);
  border-radius: 4px;
  background: rgba(255, 250, 235, 0.38);
}

.codex-race-detail--wide {
  grid-column: 1 / -1;
}

.codex-race-detail dt {
  color: var(--rubric);
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.codex-race-detail dd {
  margin: 3px 0 0;
  color: var(--ink);
}

.codex-species-items {
  display: grid;
  gap: 5px;
  margin: 9px 0 0;
  padding: 8px 0 0;
  border-top: 1px solid rgba(110, 60, 30, 0.2);
  list-style: none;
}

.codex-species-items strong {
  color: var(--rubric);
  font-family: 'Cinzel', serif;
  font-size: 0.84rem;
}

.codex-lore-points {
  max-width: 66ch;
  margin: 0 auto 22px;
  padding-left: 22px;
  list-style: none;
}

.codex-lore-points li {
  position: relative;
  margin-bottom: 10px;
  text-align: justify;
  hyphens: auto;
}

.codex-lore-points li::before {
  content: '❧';
  position: absolute;
  left: -22px;
  color: var(--rubric);
}

@media (max-width: 760px) {
  .codex-lore-points li {
    text-align: left;
  }
}

.codex-lore-numbered {
  display: grid;
  gap: 12px;
  max-width: 66ch;
  margin: 0 auto 22px;
  padding: 0;
  list-style: none;
  counter-reset: codex-principle;
}

.codex-lore-numbered li {
  position: relative;
  padding-left: 32px;
  color: var(--ink-soft);
  text-align: justify;
  counter-increment: codex-principle;
}

.codex-lore-numbered li::before {
  content: counter(codex-principle, decimal-leading-zero);
  position: absolute;
  left: 0;
  color: var(--rubric);
  font-family: 'Cinzel', serif;
  font-size: 0.82rem;
  font-weight: 700;
}

.codex-page-turn {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  max-width: 66ch;
  margin: 32px auto 0;
  padding: 14px 0 0;
  border-top: 1px solid rgba(110, 60, 30, 0.3);
}

.codex-page-turn-button {
  min-width: 0;
  max-width: 100%;
  justify-self: start;
  padding: 7px 10px;
  border: 1px solid rgba(138, 31, 31, 0.25);
  border-radius: 4px;
  background: rgba(255, 250, 235, 0.28);
  color: var(--rubric);
  font: inherit;
  font-size: 0.9rem;
  transition: background var(--transition), color var(--transition), opacity var(--transition);
}

.codex-page-turn-button--next {
  justify-self: end;
}

.codex-page-turn-button:hover,
.codex-page-turn-button:focus-visible {
  background: rgba(138, 31, 31, 0.1);
  outline: 1px solid rgba(138, 31, 31, 0.3);
}

.codex-page-turn-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.codex-page-count {
  color: var(--ink-soft);
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-align: center;
  white-space: nowrap;
}

.codex-abilities {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.codex-abilities li {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 14px;
  align-items: start;
}

.codex-level {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(168, 118, 47, 0.7);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #a83232, #5a0f15);
  box-shadow: 0 0 0 3px rgba(243, 228, 198, 0.9), 0 0 0 4px rgba(168, 118, 47, 0.45);
  color: #f6e3b8;
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  font-weight: 700;
}

.codex-level-label {
  display: block;
  color: var(--rubric);
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.codex-abilities strong {
  display: block;
  color: var(--ink);
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
}

.codex-abilities p {
  margin: 2px 0 0;
  color: var(--ink-soft);
}

.codex-pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 34px;
  padding-top: 16px;
  border-top: 1px solid rgba(110, 60, 30, 0.3);
}

.codex-pager-link {
  display: grid;
  gap: 2px;
  padding: 6px 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
}

.codex-pager-link--next {
  text-align: right;
}

.codex-pager-link span {
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-style: italic;
}

.codex-pager-link strong {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
}

.codex-pager-link:hover,
.codex-pager-link:focus-visible {
  background: rgba(138, 31, 31, 0.1);
  color: var(--rubric);
  outline: none;
}

.codex-back {
  margin-bottom: 16px;
}

@media (max-width: 760px) {
  .codex-book {
    grid-template-columns: 1fr;
    padding: 8px;
  }

  .codex-page--left,
  .codex-page--right {
    border-radius: 6px;
    box-shadow: none;
  }

  .codex-page--left {
    border-bottom: 1px dashed rgba(110, 60, 30, 0.35);
  }

  .codex-lore p {
    text-align: left;
  }

  .codex-lore-numbered li {
    text-align: left;
  }

  .codex-page-turn {
    gap: 4px;
  }

  .codex-race-details {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .codex-race-detail--wide {
    grid-column: auto;
  }

  .codex-page-turn-button {
    padding: 6px 5px;
    font-size: 0.78rem;
  }

  .codex-page-count {
    font-size: 0.66rem;
  }
}

/* Inicio: vista previa de la última noticia */
.news-preview {
  display: grid;
  gap: 8px;
  width: 100%;
  margin-bottom: 14px;
  padding: 22px 24px;
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 100% 0%, rgba(231, 189, 131, 0.14), transparent 45%),
    radial-gradient(circle at 0% 100%, rgba(169, 31, 62, 0.22), transparent 55%),
    linear-gradient(150deg, rgba(48, 21, 35, 0.92), rgba(16, 7, 13, 0.95));
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.news-preview:hover,
.news-preview:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(231, 189, 131, 0.6);
  box-shadow: 0 16px 34px rgba(7, 1, 6, 0.4), 0 0 0 3px rgba(231, 189, 131, 0.12);
  outline: none;
}

.news-preview-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  color: var(--soft);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.news-preview-badge {
  padding: 3px 10px;
  border: 1px solid rgba(231, 189, 131, 0.45);
  border-radius: 999px;
  background: rgba(169, 31, 62, 0.35);
  color: var(--gold);
}

.news-preview-title {
  color: var(--accent-strong);
  font-family: 'Cinzel', serif;
  font-size: clamp(1.15rem, 3vw, 1.55rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.news-preview-highlight {
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.news-preview-summary {
  display: -webkit-box;
  max-width: 80ch;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--muted);
  line-height: 1.6;
}

.news-preview-cta {
  color: var(--accent-strong);
  font-weight: 600;
}

.news-preview-cta span {
  display: inline-block;
  transition: transform var(--transition);
}

.news-preview:hover .news-preview-cta span {
  transform: translateX(4px);
}

/* Noticias: índice (tarjeta destacada + archivo) */
.news-visit-counter-wrap {
  display: flex;
  justify-content: flex-end;
  margin: -8px 0 14px;
}

.news-visit-counter-wrap[hidden] {
  display: none;
}

.news-visit-counter-dial {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(231, 189, 131, 0.42);
  border-radius: 5px;
  background: linear-gradient(180deg, #302328, #0b080a 52%, #21171a);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.9), 0 2px 6px rgba(5, 1, 5, 0.42);
}

.news-visit-digit {
  position: relative;
  display: grid;
  place-items: center;
  width: 0.68rem;
  height: 1.02rem;
  overflow: hidden;
  border: 1px solid rgba(231, 189, 131, 0.12);
  border-radius: 2px;
  background: linear-gradient(180deg, #35282b 0%, #171013 47%, #080608 53%, #291d20 100%);
  color: #fff0d3;
  font: 700 0.76rem/1 "Courier New", monospace;
  text-shadow: 0 0 5px rgba(255, 227, 181, 0.34);
}

.news-visit-digit::after {
  position: absolute;
  inset: 50% 0 auto;
  border-top: 1px solid rgba(0, 0, 0, 0.78);
  box-shadow: 0 1px rgba(255, 255, 255, 0.08);
  content: "";
}

.news-entry {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 16px;
  align-items: center;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, rgba(48, 21, 35, 0.86), rgba(16, 7, 13, 0.94));
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.news-entry:hover,
.news-entry:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(231, 189, 131, 0.55);
  box-shadow: 0 14px 30px rgba(7, 1, 6, 0.38), 0 0 0 3px rgba(231, 189, 131, 0.1);
  outline: none;
}

.news-entry-media {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(231, 189, 131, 0.3);
  border-radius: 14px;
  background: radial-gradient(circle at 50% 40%, rgba(169, 31, 62, 0.35), #0d060b 75%);
}

.news-entry-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.news-entry-media--seal img {
  width: 78%;
  height: 78%;
  mix-blend-mode: screen;
}

.news-entry-body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.news-entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  color: var(--soft);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.news-entry-kicker {
  color: var(--gold);
}

.news-entry-title {
  color: var(--accent-strong);
  font-family: 'Cinzel', serif;
  font-size: 1.08rem;
  letter-spacing: 0.05em;
  line-height: 1.3;
  text-transform: uppercase;
}

.news-entry-highlight {
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.news-entry-summary {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--muted);
  line-height: 1.6;
}

.news-entry-cta {
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 600;
}

.news-entry-cta span {
  display: inline-block;
  transition: transform var(--transition);
}

.news-entry:hover .news-entry-cta span {
  transform: translateX(4px);
}

/* La más reciente: más grande y con su imagen a la izquierda */
.news-entry--featured {
  grid-template-columns: minmax(200px, 300px) 1fr;
  gap: 24px;
  padding: 22px;
  border-color: var(--border-strong);
  border-left: 3px solid var(--gold);
  background:
    radial-gradient(circle at 100% 0%, rgba(231, 189, 131, 0.14), transparent 45%),
    radial-gradient(circle at 0% 100%, rgba(169, 31, 62, 0.22), transparent 55%),
    linear-gradient(150deg, rgba(48, 21, 35, 0.92), rgba(16, 7, 13, 0.95));
}

.news-entry--featured .news-entry-title {
  font-size: clamp(1.3rem, 3vw, 1.75rem);
}

.news-entry--featured .news-entry-summary {
  -webkit-line-clamp: 3;
}

.news-archive-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 30px 0 14px;
  color: var(--accent-strong);
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.news-archive-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(231, 189, 131, 0.45), transparent);
}

.news-archive-title small {
  padding: 2px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--soft);
  font-family: 'Manrope', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0;
}

.news-archive {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
  gap: 14px;
}

/* Página de una noticia: paso a la anterior / más reciente */
.news-pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  max-width: 880px;
  margin: 18px auto 0;
}

.news-pager-link {
  display: grid;
  gap: 2px;
  max-width: 48%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(16, 7, 13, 0.6);
  color: inherit;
  text-align: left;
  transition: border-color var(--transition), background var(--transition);
}

.news-pager-link--next {
  text-align: right;
}

.news-pager-link span {
  color: var(--soft);
  font-size: 0.78rem;
}

.news-pager-link strong {
  color: var(--accent-strong);
  font-family: 'Cinzel', serif;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
}

.news-pager-link:hover,
.news-pager-link:focus-visible {
  border-color: rgba(231, 189, 131, 0.55);
  background: rgba(169, 31, 62, 0.16);
  outline: none;
}

@media (max-width: 760px) {
  .news-entry,
  .news-entry--featured {
    grid-template-columns: 1fr;
  }

  .news-entry-media {
    aspect-ratio: 16 / 9;
  }

  .news-entry:not(.news-entry--featured) {
    grid-template-columns: 76px 1fr;
  }

  .news-entry:not(.news-entry--featured) .news-entry-media {
    aspect-ratio: 1;
  }

  .news-pager {
    flex-direction: column;
  }

  .news-pager-link {
    max-width: none;
  }
}

/* Noticias: proclamas del Staff */
.news-stack {
  display: grid;
  gap: 22px;
}

.news-proclamation {
  position: relative;
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 48px) clamp(18px, 5vw, 56px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 50% 0%, rgba(231, 189, 131, 0.12), transparent 55%),
    radial-gradient(circle at 50% 100%, rgba(169, 31, 62, 0.18), transparent 60%),
    linear-gradient(160deg, rgba(48, 21, 35, 0.92), rgba(16, 7, 13, 0.96));
  box-shadow: inset 0 0 0 6px rgba(16, 7, 13, 0.55), inset 0 0 0 7px rgba(231, 189, 131, 0.16), 0 24px 48px rgba(7, 1, 6, 0.32);
  text-align: center;
}

.news-proclamation-head h3 {
  margin: 4px 0 0;
  color: var(--accent-strong);
  font-family: 'Cinzel', serif;
  font-size: clamp(1.25rem, 3.6vw, 1.9rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.news-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 14px;
  margin-bottom: 18px;
  color: var(--soft);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.news-kicker {
  color: var(--gold);
}

.news-wordmark {
  margin: 0;
  background: linear-gradient(180deg, #ffe9df 0%, var(--gold) 55%, #9c5a2c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-family: 'Cinzel', serif;
  font-size: clamp(2rem, 8vw, 3.6rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.1;
  filter: drop-shadow(0 0 18px rgba(169, 31, 62, 0.45));
}

.news-divider,
.news-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.news-divider {
  justify-content: center;
  margin: 14px auto 6px;
  max-width: 320px;
  color: var(--gold);
  font-size: 0.7rem;
}

.news-divider::before,
.news-divider::after,
.news-section-title::before,
.news-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(231, 189, 131, 0.55), transparent);
}

.news-greeting {
  margin: 18px 0 6px;
  color: var(--accent-strong);
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem;
  font-weight: 700;
}

.news-lead,
.news-section p,
.news-closing p {
  max-width: 640px;
  margin: 8px auto;
  color: var(--muted);
  line-height: 1.75;
}

.news-highlight {
  display: grid;
  gap: 2px;
  margin: 26px auto;
  padding: 16px 20px;
  max-width: 560px;
  border-top: 1px solid rgba(231, 189, 131, 0.4);
  border-bottom: 1px solid rgba(231, 189, 131, 0.4);
  background: linear-gradient(90deg, transparent, rgba(169, 31, 62, 0.55) 18%, rgba(169, 31, 62, 0.55) 82%, transparent);
}

.news-highlight strong {
  color: var(--accent-strong);
  font-family: 'Cinzel', serif;
  font-size: clamp(1.6rem, 5vw, 2.3rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.news-highlight span {
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: clamp(0.85rem, 2.6vw, 1.05rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.news-section {
  margin-top: 22px;
}

.news-section-title {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-family: 'Cinzel', serif;
  font-size: clamp(0.9rem, 2.6vw, 1.1rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.news-section-title span {
  flex: 0 1 auto;
}

.news-emblems {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px 14px;
  margin: 18px 0 4px;
  padding: 0;
  list-style: none;
}

.news-emblem {
  --emblem: var(--gold);
  --emblem-deep: #5b3a24;
  display: grid;
  justify-items: center;
  gap: 8px;
  width: 104px;
}

.news-emblem--bronze { --emblem: #e7bd83; --emblem-deep: #6b4220; }
.news-emblem--emerald { --emblem: #8fd3a6; --emblem-deep: #1f4a33; }
.news-emblem--crimson { --emblem: #ff8a8a; --emblem-deep: #6e1424; }
.news-emblem--blood { --emblem: #ff6b6b; --emblem-deep: #4a0a14; }
.news-emblem--azure { --emblem: #9cc4f0; --emblem-deep: #1d3556; }
.news-emblem--violet { --emblem: #d2b0e0; --emblem-deep: #3d2450; }

.news-emblem-seal {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px solid rgba(231, 189, 131, 0.55);
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--emblem) 35%, transparent), var(--emblem-deep) 70%);
  box-shadow: 0 0 0 4px rgba(16, 7, 13, 0.7), 0 0 0 5px rgba(231, 189, 131, 0.22), 0 0 22px color-mix(in srgb, var(--emblem) 30%, transparent);
  color: var(--emblem);
}

.news-emblem-seal svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.news-emblem-name {
  color: var(--text);
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  line-height: 1.3;
  text-transform: uppercase;
}

.news-figure {
  margin: 6px auto 14px;
  max-width: 300px;
}

.news-figure img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 14px 22px rgba(5, 1, 5, 0.55)) drop-shadow(0 0 26px rgba(169, 31, 62, 0.25));
}

.news-closing {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(231, 189, 131, 0.2);
}

.news-closing .news-signature {
  color: var(--accent-strong);
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  font-style: italic;
  font-weight: 700;
}

.news-seal {
  display: block;
  width: 84px;
  height: 84px;
  margin: 12px auto 0;
  border-radius: 50%;
  mix-blend-mode: screen;
}

.news-cta {
  display: flex;
  justify-content: center;
  margin-top: 22px;
}

/* Botón de invitación a Discord */
.discord-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 6px 22px 6px 8px;
  border: 1px solid rgba(231, 189, 131, 0.5);
  border-radius: 999px;
  background: linear-gradient(135deg, #3a2a8a 0%, #5865f2 45%, #a91f3e 100%);
  box-shadow: 0 10px 26px rgba(88, 101, 242, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: #fff;
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
}

.discord-btn:hover,
.discord-btn:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 14px 32px rgba(88, 101, 242, 0.4), 0 0 0 3px rgba(231, 189, 131, 0.35);
  outline: none;
}

.discord-barbarian {
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  padding: 2px;
  border-radius: 50%;
  background: radial-gradient(circle, #2b1b22 0%, #10070d 100%);
  box-shadow: 0 0 0 2px rgba(231, 189, 131, 0.55);
}

.ability-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.ability-item {
  padding-left: 12px;
  border-left: 2px solid var(--soft);
}

.ability-item strong {
  color: var(--text);
  font-size: 0.9rem;
}

.ability-item p {
  margin: 4px 0 0;
}

.edited-notice,
.print-edited {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid rgba(239, 169, 173, 0.45);
  color: var(--soft);
  font-size: 0.85rem;
}

.danger-btn {
  color: #f3b1b7;
}

.entry-grid.compact {
  margin-top: 16px;
}

.history-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.history-volume {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 22px;
  border: 1px solid rgba(239, 169, 173, 0.35);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(120, 26, 47, 0.88), rgba(35, 12, 25, 0.96)),
    repeating-linear-gradient(90deg, rgba(255, 244, 240, 0.04) 0 1px, transparent 1px 8px);
  color: var(--text);
  text-align: left;
  box-shadow: 8px 10px 0 rgba(10, 4, 9, 0.18);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.history-volume:hover,
.history-volume:focus-visible {
  transform: translateY(-5px);
  border-color: var(--soft);
  box-shadow: 12px 15px 0 rgba(10, 4, 9, 0.28);
  outline: none;
}

.history-volume-number,
.history-volume-cta,
.history-reader-topbar,
.history-book-kicker,
.history-reader-footer {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.history-volume-number,
.history-volume-cta {
  color: var(--soft);
}

.history-volume strong {
  max-width: 17ch;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.7rem;
  line-height: 1.05;
}

.history-reader {
  position: fixed;
  z-index: 20;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  background: #160a12;
  color: var(--text);
}

body.history-reading {
  overflow: hidden;
}

.history-reader-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  min-height: 48px;
  box-sizing: border-box;
  padding: 6px clamp(16px, 4vw, 64px);
  border-bottom: 1px solid var(--border);
  background: rgba(16, 7, 13, 0.96);
}

.reader-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--soft);
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

.reader-control:first-child {
  color: var(--text);
  font-size: 1.15rem;
}

.reader-control:hover,
.reader-control:focus-visible {
  color: #fff4f0;
  outline: none;
}

.reader-location {
  color: var(--muted);
  text-align: center;
}

.history-book {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  box-sizing: border-box;
  min-height: 0;
  margin: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #f4e7d9;
  color: #33252a;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

.history-book-cover {
  min-width: 0;
  padding: 6px 20px 5px;
  border-bottom: 1px solid rgba(81, 45, 53, 0.24);
  background: linear-gradient(135deg, #ead6c4, #f8eee4);
  text-align: center;
}

.history-book-kicker,
.history-book-cover p {
  color: #8c5661;
}

.history-book-cover p {
  margin: 4px 0 0;
}

.history-book-cover h2 {
  max-width: 18ch;
  margin: 2px auto;
  color: #4b2933;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  line-height: 0.98;
}

.history-book-rule {
  display: block;
  width: 90px;
  height: 2px;
  margin: 0 auto 3px;
  background: #a35e6c;
}

.history-book-content {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overflow-anchor: none;
  padding: 42px clamp(22px, 7vw, 90px) 56px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.16rem;
  line-height: 1.55;
  scrollbar-color: #b47882 transparent;
}

.history-book-content p {
  max-width: 66ch;
  margin: 0 auto 1.15em;
}

.history-book-content p:has(+ p) {
  text-wrap: pretty;
}

.history-reader-footer {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px clamp(16px, 4vw, 48px);
  border-top: 1px solid rgba(81, 45, 53, 0.24);
  background: #ead6c4;
  color: #8c5661;
}

.history-reader-footer .secondary-btn {
  min-height: 38px;
  padding: 0 12px;
  border-color: rgba(81, 45, 53, 0.32);
  color: #4b2933;
}

.history-reader-footer .secondary-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}


.delivery-steps {
  max-width: 520px;
  text-align: left;
}

.print-sheet {
  display: none;
}

@media print {
  body * {
    visibility: hidden;
  }

  .print-sheet,
  .print-sheet * {
    visibility: visible;
  }

  .print-sheet {
    display: block;
    position: absolute;
    inset: 0;
    padding: 48px;
    background: #10070d;
    color: #fff4f0;
  }

  .print-sheet h1 {
    font-family: Georgia, serif;
    letter-spacing: 0.18em;
  }

  .print-sheet img {
    max-width: 240px;
  }

  .print-sheet dl {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
}

@media (max-width: 980px) {
  .hub-main {
    padding: 20px 16px 28px;
  }

  .path-nav {
    display: none;
  }
}

@media (max-width: 700px) {
  .app-root {
    width: min(100% - 20px, 1000px);
    margin: 12px auto 28px;
  }

  .welcome-screen,
  .delivery-screen {
    min-height: auto;
    padding: 28px 18px;
  }

  .choice-grid {
    grid-template-columns: 1fr;
  }
}

.boss-card-list {
  display: grid;
  gap: 22px;
}

.other-games-intro {
  margin-bottom: 22px;
}

.other-games-intro .news-kicker {
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.other-games-intro .news-lead {
  margin-bottom: 0;
}

.game-card-list {
  display: grid;
  gap: 22px;
}

.game-card {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) 3fr;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, rgba(39, 18, 28, 0.96), rgba(16, 8, 14, 0.96));
  box-shadow: 0 18px 42px rgba(5, 1, 5, 0.3);
}

.game-card-cover {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: clamp(28px, 5vw, 44px) 24px;
  border-right: 1px solid var(--border);
  background:
    radial-gradient(ellipse at 50% 35%, rgba(169, 31, 62, 0.22), transparent 62%),
    radial-gradient(circle at 50% 120%, rgba(231, 189, 131, 0.1), transparent 55%),
    #09070a;
  text-align: center;
}

.game-card-genre {
  padding: 4px 12px;
  border: 1px solid rgba(231, 189, 131, 0.4);
  border-radius: 999px;
  color: var(--gold);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.game-card-cover h3 {
  margin: 0;
  color: var(--accent-strong);
  font-family: 'Cinzel', serif;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  letter-spacing: 0.06em;
  line-height: 1.25;
  text-transform: uppercase;
  text-shadow: 0 0 22px rgba(169, 31, 62, 0.45);
}

.game-card-hook {
  max-width: 30ch;
  margin: 0;
  color: var(--muted);
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-style: italic;
}

.game-card-platform {
  color: var(--soft);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.game-card-info {
  padding: clamp(22px, 4vw, 36px);
}

.game-card-info h4 {
  margin: 0 0 8px;
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.game-card-info h4:not(:first-child) {
  margin-top: 20px;
}

.game-card-info p {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.7;
}

.game-card-features {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
}

.game-card-features li + li {
  margin-top: 4px;
}

.game-card-features li::marker {
  color: var(--gold);
}

.game-card-info .game-card-note {
  margin-top: 18px;
  padding: 10px 14px;
  border-left: 2px solid rgba(231, 189, 131, 0.6);
  border-radius: 0 10px 10px 0;
  background: rgba(169, 31, 62, 0.14);
  color: var(--text);
}

.game-card-info .game-card-thanks {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--soft);
  font-size: 0.9rem;
  font-style: italic;
}

.game-card-thanks span {
  display: block;
  margin-bottom: 2px;
  color: var(--gold);
  font-size: 0.7rem;
  font-style: normal;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

@media (max-width: 760px) {
  .game-card {
    grid-template-columns: 1fr;
  }

  .game-card-cover {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
}

.other-game-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 150px;
  min-height: 58px;
  padding: 0 24px;
  border: 1px solid rgba(255, 224, 213, 0.4);
  border-radius: 999px;
  background: linear-gradient(135deg, #a91f3e, #c64d65 58%, #e7bd83);
  box-shadow: 0 10px 24px rgba(127, 15, 43, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: #fff8f1;
  font-weight: 700;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.other-game-play:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(127, 15, 43, 0.42), 0 0 20px rgba(255, 191, 184, 0.14);
}

.boss-card {
  position: relative;
  padding: clamp(18px, 3vw, 30px);
  overflow: hidden;
  border: 1px solid rgba(231, 189, 131, 0.24);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(39, 18, 28, 0.96), rgba(16, 8, 14, 0.96));
  box-shadow: 0 18px 42px rgba(5, 1, 5, 0.28), inset 0 1px rgba(255, 239, 215, 0.04);
}

.boss-card::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--gold), var(--ember), transparent);
  content: "";
}

.boss-card-heading,
.boss-gallery-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.boss-card-heading h3 {
  margin: 0;
  color: var(--accent-strong);
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.65rem, 4vw, 2.4rem);
  line-height: 1.1;
}

.boss-health {
  display: grid;
  gap: 3px;
  flex: 0 0 auto;
  min-width: 108px;
  padding: 10px 14px;
  border: 1px solid rgba(231, 189, 131, 0.38);
  border-radius: 10px;
  background: rgba(169, 31, 62, 0.16);
  text-align: right;
}

.boss-health span,
.boss-creature > span,
.boss-facts dt {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.boss-health strong {
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 1.25rem;
}

.boss-creature {
  display: grid;
  gap: 5px;
  margin-top: 20px;
  padding: 12px 14px;
  border-left: 2px solid var(--ember);
  background: rgba(255, 255, 255, 0.025);
}

.boss-creature strong {
  overflow-wrap: anywhere;
}

.boss-details-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
  gap: 18px;
  margin-top: 18px;
}

.boss-loot,
.boss-facts {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(9, 4, 8, 0.32);
}

.boss-loot h4,
.boss-gallery-heading h4 {
  margin: 0;
  color: var(--accent-strong);
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
}

.boss-loot ul {
  display: grid;
  gap: 9px;
  margin: 13px 0 0;
  padding: 0;
  list-style: none;
}

.boss-loot li {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  color: var(--muted);
  line-height: 1.5;
}

.loot-chance {
  color: var(--gold);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.boss-facts {
  display: grid;
  align-content: start;
  gap: 16px;
}

.boss-facts div {
  display: grid;
  gap: 5px;
}

.boss-facts dd {
  margin: 0;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.boss-gallery {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.boss-gallery-heading > div {
  display: grid;
  gap: 2px;
}

.boss-gallery-heading > div span {
  color: var(--soft);
  font-size: 0.78rem;
}

.boss-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.boss-gallery-item {
  position: relative;
  min-width: 0;
  margin: 0;
}

.boss-gallery-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #120b10;
}

.boss-gallery-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease, filter 220ms ease;
}

.boss-gallery-image:hover img {
  transform: scale(1.045);
  filter: brightness(1.08);
}

.boss-gallery-caption {
  margin-top: 6px;
  color: var(--gold);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.boss-lightbox {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 2, 5, 0.92);
  backdrop-filter: blur(10px);
}

.boss-lightbox-panel {
  width: min(100%, 1100px);
  max-height: 100%;
  padding: 14px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: #160c12;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.boss-lightbox-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 10px;
  color: var(--muted);
}

.boss-lightbox-stage {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
  min-height: 180px;
}

.boss-lightbox-stage img {
  display: block;
  max-width: 100%;
  max-height: min(72vh, 760px);
  margin: auto;
  object-fit: contain;
}

.boss-lightbox-nav {
  width: 40px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 1.7rem;
}

.boss-lightbox-panel > p {
  margin: 8px 0 0;
  color: var(--soft);
  font-size: 0.8rem;
  text-align: center;
  overflow-wrap: anywhere;
}

@media (max-width: 700px) {
  .boss-card-heading {
    align-items: flex-start;
  }

  .boss-details-grid {
    grid-template-columns: 1fr;
  }

  .boss-gallery-heading {
    align-items: flex-start;
  }

  .boss-gallery-heading .secondary-btn {
    min-height: 36px;
    padding: 0 9px;
    font-size: 0.72rem;
  }

  .boss-gallery-grid {
    grid-template-columns: 1fr;
  }

  .boss-lightbox {
    padding: 10px;
  }

  .boss-lightbox-panel {
    padding: 10px;
  }

  .boss-lightbox-stage {
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    gap: 3px;
  }

  .boss-lightbox-nav {
    width: 32px;
    height: 40px;
  }
}
