/* Shared site styles */
:root {
  --bg: #0a0a0a;
  --surface: #141210;
  --surface-2: #171512;
  --primary: #c9a36b;
  --primary-dark: #f5e8c8;
  --accent: #c9a36b;
  --accent-2: #c9a36b;
  --text: #f3e7c8;
  --muted: #b89a6a;
  --border: #3a342c;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  --radius: 18px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background:
    radial-gradient(circle at top, rgba(201, 163, 107, 0.08), transparent 18%),
    var(--bg);
  color: var(--text);
  font-family: 'Heebo', sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

.skip-link {
  position: absolute;
  right: 16px;
  top: -48px;
  z-index: 10000;
  background: #c9a36b;
  color: #111;
  padding: 8px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 12px;
}

.page-life-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

body > *:not(.page-life-canvas):not(#particle-canvas):not(.accessibility-trigger):not(.accessibility-panel):not(.cookie-notice):not(.auth-modal) {
  position: relative;
  z-index: 1;
}

button,
input {
  font: inherit;
}

.user-badge {
  margin-inline-start: auto;
  background: transparent;
  border: 0;
  color: #9f9788;
  border-radius: 999px;
  padding: 0;
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-logout {
  background: transparent;
  border: 0;
  color: #c9a36b;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  transition: color 0.18s ease, opacity 0.18s ease;
}

.user-logout:hover {
  color: #f5e8c8;
  opacity: 0.9;
}

.user-logout:focus-visible {
  outline: 1px solid #c9a36b;
  outline-offset: 2px;
}

.page-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 58px 28px 90px;
}

.site-footer {
  margin-top: 26px;
  border-top: 1px solid rgba(201, 163, 107, 0.18);
  padding-top: 18px;
  text-align: center;
  color: #a99672;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  color: #d8bb8b;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.footer-links a:hover {
  color: #f5e8c8;
  border-color: rgba(201, 163, 107, 0.65);
}

.footer-copy,
.footer-contact {
  margin-top: 8px;
  font-size: 0.88rem;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 42px;
}

.brand-wrap {
  display: flex;
  align-items: center;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: auto;
  height: 64px;
  display: block;
  flex: 0 0 auto;
}

.logo-text {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 26px;
  line-height: 1;
  color: var(--primary-dark);
  letter-spacing: 0.02em;
}

/* Hero section */
.hero-section {
  position: relative;
  overflow: hidden;
  background: rgba(8, 8, 8, 0.85);
  border: 1px solid rgba(201, 163, 107, 0.2);
  border-radius: 22px;
  padding: 44px 32px;
  box-shadow: var(--shadow);
  margin-bottom: 36px;
}

.hero-text {
  text-align: center;
  margin-bottom: 22px;
}

.hero-label {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.hero-text h2,
.section-title {
  font-family: 'Frank Ruhl Libre', serif;
}

.hero-text h2 {
  font-size: 2rem;
  line-height: 1.35;
  color: var(--primary-dark);
}

.hero-description {
  margin-top: 10px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.8;
}

.search-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 10px;
  max-width: 920px;
  margin: 0 auto;
}

.search-field {
  display: block;
}

.search-field-character,
.search-field-book {
  min-width: 0;
}

.discover-characters-button,
.search-submit-button {
  grid-column: 1 / -1;
}

.discover-characters-button {
  grid-column: auto;
  width: auto;
  justify-self: start;
  background: transparent;
  color: #dfc08a;
  border: 1px solid rgba(201, 163, 107, 0.55);
  box-shadow: none;
  padding: 11px 16px;
}

.discover-characters-button:hover {
  background: rgba(201, 163, 107, 0.08);
}

.search-submit-button {
  width: 100%;
}

.character-discovery {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(201, 163, 107, 0.18);
  border-radius: 18px;
  background: rgba(12, 12, 12, 0.74);
  animation: fadeInUp 0.24s ease;
}

.character-discovery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.character-discovery-title {
  color: #f5e8c8;
  font-weight: 700;
}

.character-discovery-clear {
  background: transparent;
  border: 0;
  color: #dfc08a;
  cursor: pointer;
  padding: 0;
}

.character-discovery-message {
  min-height: 20px;
  margin-bottom: 10px;
  color: #d8c29a;
  font-size: 0.88rem;
}

.character-discovery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.character-discovery-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(201, 163, 107, 0.2);
  border-radius: 14px;
  background: rgba(15, 15, 15, 0.85);
}

.character-discovery-item input {
  accent-color: #c9a36b;
}

.character-discovery-item.is-disabled {
  opacity: 0.45;
}

.result-area {
  display: block;
  min-height: 120px;
  margin-top: 18px;
}

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

.result-grid.is-single {
  grid-template-columns: minmax(0, min(420px, 100%));
  justify-content: center;
}

.result-grid.is-loading,
.result-grid:empty {
  min-height: 120px;
}

.result-grid .result-card {
  width: 100%;
  background: linear-gradient(180deg, #171512, #12120f);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.result-card-body {
  margin-top: 12px;
}

.result-card-message {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-card-message-text {
  color: #d8c29a;
  text-align: center;
  font-size: 0.95rem;
}

.result-card-error {
  margin-top: 10px;
  text-align: center;
  color: #f2a6a6;
  font-size: 0.86rem;
}

.result-card-actions {
  margin-top: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 14px;
}

.result-action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.result-action-label {
  font-size: 11px;
  color: #c9a36b;
  line-height: 1;
  text-align: center;
}

.result-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(201, 163, 107, 0.35);
  background: rgba(201, 163, 107, 0.1);
  color: #f5e8c8;
  cursor: pointer;
}

.result-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.search-message {
  min-height: 24px;
  text-align: center;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.usage-counter {
  min-height: 20px;
  text-align: center;
  margin-top: 6px;
  color: #8e8981;
  font-size: 0.79rem;
}

.search-input {
  width: 100%;
  padding: 15px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #0f0f0f;
  color: var(--text);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.search-input::placeholder {
  color: #7d7053;
}

.search-box button {
  background: var(--accent);
  color: #101010;
  border: none;
  border-radius: 999px;
  padding: 15px 22px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(201, 163, 107, 0.18);
  grid-column: 1 / -1;
  width: 100%;
}

.search-box .discover-characters-button {
  background: transparent;
  color: #dfc08a;
  border: 1px solid rgba(201, 163, 107, 0.55);
  box-shadow: none;
  grid-column: auto;
  width: auto;
  justify-self: start;
  padding: 11px 16px;
}

.search-box .discover-characters-button:hover {
  background: rgba(201, 163, 107, 0.08);
}

.result-area {
  display: block;
  min-height: 120px;
  margin-top: 18px;
}

.result-figure {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0f0f0f;
}

.result-card .result-figure {
  aspect-ratio: 1 / 1;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(201, 163, 107, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.result-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-watermark {
  position: absolute;
  bottom: 10px;
  left: 14px;
  right: 14px;
  text-align: center;
  font-size: 0.76rem;
  color: #e4c182;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  letter-spacing: 0.02em;
}

.result-caption {
  margin-top: 10px;
  text-align: center;
  color: var(--primary-dark);
  font-size: 0.98rem;
}

.result-meta {
  text-align: center;
  margin-top: 6px;
  color: #a89a83;
  font-style: italic;
  font-size: 0.86rem;
}

.result-character-caption-wrap {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(201, 163, 107, 0.2);
}

.result-character-caption {
  color: #b8a98a;
  text-align: center;
  font-style: italic;
  font-size: 0.84rem;
  line-height: 1.45;
}

.result-character-caption-extra {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-top: 0;
  color: #b8a98a;
  text-align: center;
  font-style: italic;
  font-size: 0.84rem;
  line-height: 1.45;
  transition: max-height 0.28s ease, opacity 0.28s ease, margin-top 0.28s ease;
}

.result-character-caption-wrap.is-expanded .result-character-caption-extra {
  max-height: 180px;
  opacity: 1;
  margin-top: 6px;
}

.result-character-caption-toggle {
  margin-top: 6px;
  display: inline-block;
  border: 0;
  background: transparent;
  color: #c9a36b;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.result-actions,
.result-fallback-shares {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
}

.result-action,
.result-fallback-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
}

.result-action {
  background: var(--accent);
  color: #101010;
  box-shadow: 0 6px 16px rgba(201, 163, 107, 0.18);
}

.result-fallback-btn {
  background: #1a1713;
  color: var(--text);
}

.share-feedback {
  min-height: 22px;
  margin-top: 10px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--primary-dark);
}

.result-placeholder,
.result-loading-card {
  position: absolute;
  inset: 0;
  min-height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 10, 0.3);
}

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

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

@media (max-width: 720px) {
  .result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

@media (max-width: 600px) {
  .result-grid {
    grid-template-columns: 1fr;
  }

  .result-watermark {
    font-size: 10px;
  }

  .result-caption {
    font-size: 16px;
  }
}

.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: -1;
}

.auth-modal-panel {
  position: relative;
  z-index: 10000;
  width: min(480px, 92vw);
  background: linear-gradient(180deg, #171512, #12110e);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.auth-modal-close {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  background: transparent;
  border: 0;
  color: #9f9788;
  font-size: 1.8rem;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.18s ease;
}

.auth-modal-close:hover {
  color: #c9a36b;
}

.auth-tabs-nav {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 2px solid #2a2420;
  position: relative;
}

.auth-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: #9f9788;
  padding: 14px 16px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: color 0.18s ease;
  position: relative;
  text-align: center;
}

.auth-tab-btn:hover {
  color: #c9a36b;
}

.auth-tab-btn.is-active {
  color: #c9a36b;
}

.auth-tab-btn.is-active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: #c9a36b;
}

.auth-panel {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.auth-panel.is-active {
  display: flex;
}

.auth-intro-text {
  color: #d9c399;
  font-size: 0.95rem;
  text-align: center;
  margin-bottom: 8px;
  line-height: 1.5;
}

.auth-label {
  color: #9f9788;
  font-size: 0.9rem;
  display: block;
  margin-top: 2px;
  margin-bottom: -8px;
}

.auth-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #3a3530;
  background: #0f0f0f;
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.18s ease;
}

.auth-input:focus {
  outline: none;
  border-color: #c9a36b;
}

.auth-input::placeholder {
  color: #6b5f50;
}

.auth-field-error {
  min-height: 16px;
  color: #f2a6a6;
  font-size: 0.79rem;
  margin-top: -8px;
}

.auth-consent-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #b8a073;
  font-size: 0.86rem;
  line-height: 1.5;
  margin-top: 4px;
  cursor: pointer;
}

.auth-consent-checkbox {
  margin-top: 3px;
  accent-color: #c9a36b;
  inline-size: 16px;
  block-size: 16px;
  flex: 0 0 auto;
  cursor: pointer;
}

.auth-consent-label a {
  color: #dfc08a;
  text-decoration: underline;
}

.auth-submit-btn {
  background: #c9a36b;
  color: #0a0a0a;
  border: none;
  border-radius: 8px;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.18s ease, opacity 0.18s ease;
  margin-top: 8px;
}

.auth-submit-btn:hover:not(:disabled) {
  background: #dfc08a;
}

.auth-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-confirmation {
  text-align: center;
  padding: 20px 0;
}

.auth-confirmation-emoji {
  font-size: 3rem;
  margin-bottom: 12px;
}

.auth-confirmation-greeting {
  color: #f5e8c8;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.auth-confirmation-message {
  color: #d9c399;
  font-size: 0.95rem;
  line-height: 1.5;
}

.auth-status-message {
  min-height: 20px;
  color: #f2a6a6;
  font-size: 0.85rem;
  text-align: center;
  margin-top: 12px;
}

.auth-step {
  display: none;
}

.cookie-notice {
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
  z-index: 100001;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(10, 10, 10, 0.94);
  border-top: 1px solid rgba(201, 163, 107, 0.3);
  color: #d8c29a;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.cookie-notice p {
  margin: 0;
  font-size: 0.86rem;
  text-align: center;
}

.cookie-notice a {
  color: #e6c586;
}

.cookie-notice-accept {
  border: 1px solid rgba(201, 163, 107, 0.45);
  background: rgba(201, 163, 107, 0.14);
  color: #f5e8c8;
  border-radius: 999px;
  padding: 7px 15px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  z-index: 100002;
}

.accessibility-trigger {
  position: fixed;
  left: 24px;
  bottom: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 0;
  background: #c9a36b;
  color: #111;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.42);
}

.accessibility-trigger svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.accessibility-trigger::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 60px;
  bottom: 14px;
  white-space: nowrap;
  background: rgba(8, 8, 8, 0.95);
  color: #f3e7c8;
  border: 1px solid rgba(201, 163, 107, 0.35);
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 0.75rem;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.accessibility-trigger:hover::after,
.accessibility-trigger:focus-visible::after {
  opacity: 1;
  transform: translateX(0);
}

.accessibility-panel {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  width: min(330px, 86vw);
  z-index: 9998;
  display: none;
  transform: translateX(-105%);
  transition: transform 0.26s ease;
  background: rgba(8, 8, 8, 0.96);
  border-right: 1px solid rgba(201, 163, 107, 0.28);
  box-shadow: 14px 0 34px rgba(0, 0, 0, 0.45);
  padding: 18px 14px 20px;
  flex-direction: column;
  gap: 14px;
}

.accessibility-panel.is-open {
  display: flex;
  transform: translateX(0);
}

.accessibility-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(201, 163, 107, 0.25);
  padding-bottom: 10px;
}

.accessibility-panel-header h2 {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 1.3rem;
  color: #f3e7c8;
}

.accessibility-close {
  border: 1px solid rgba(201, 163, 107, 0.4);
  background: transparent;
  color: #e2c287;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.accessibility-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.accessibility-toggle {
  width: 100%;
  border: 1px solid rgba(201, 163, 107, 0.28);
  background: #12120f;
  color: #f3e7c8;
  border-radius: 12px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}

.accessibility-toggle .accessibility-state {
  color: #b89a6a;
  font-size: 0.84rem;
}

.accessibility-toggle.is-active {
  background: rgba(201, 163, 107, 0.18);
  border-color: rgba(201, 163, 107, 0.62);
}

.accessibility-toggle.is-active .accessibility-state {
  color: #f5e8c8;
  font-weight: 700;
}

.accessibility-statement-link {
  margin-top: auto;
  color: #e4c182;
  text-decoration: underline;
  text-underline-offset: 2px;
}

body.acc-large-text {
  font-size: 120%;
}

body.acc-highlight-links a {
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 3px !important;
  background: rgba(201, 163, 107, 0.14) !important;
  border-radius: 4px;
  padding-inline: 2px;
}

body.acc-readable-font,
body.acc-readable-font button,
body.acc-readable-font input,
body.acc-readable-font textarea,
body.acc-readable-font select {
  font-family: Arial, sans-serif !important;
}

body.acc-line-spacing,
body.acc-line-spacing p,
body.acc-line-spacing li,
body.acc-line-spacing button,
body.acc-line-spacing input,
body.acc-line-spacing label {
  line-height: 1.8 !important;
}

body.acc-stop-animations *,
body.acc-stop-animations *::before,
body.acc-stop-animations *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

body.acc-stop-animations .page-life-canvas {
  opacity: 0 !important;
}

body.acc-high-contrast,
body.acc-high-contrast * {
  background: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

body.acc-high-contrast img,
body.acc-high-contrast .page-life-canvas {
  display: none !important;
}

body.acc-high-contrast a {
  color: #ffff00 !important;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Character carousel */
.characters-section,
.categories-section {
  padding: 10px 0;
}

.section-heading-wrap {
  margin-bottom: 14px;
}

.characters-section .section-heading-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.section-title {
  font-size: 1.2rem;
  color: var(--primary-dark);
  font-weight: 700;
}

.characters-section .section-title {
  font-size: 1.7rem;
  text-align: center;
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.characters-section .section-title::before,
.characters-section .section-title::after {
  content: '';
  display: inline-block;
  width: 82px;
  height: 1px;
  background: rgba(201, 163, 107, 0.7);
}

.character-carousel {
  --carousel-gap: 14px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  direction: ltr;
}

.carousel-viewport {
  overflow: hidden;
  width: 100%;
}

.carousel-track {
  display: flex;
  align-items: stretch;
  gap: var(--carousel-gap);
  transition: transform 0.55s ease, opacity 0.25s ease;
  will-change: transform;
}

.carousel-track.is-compact {
  justify-content: center;
}

.carousel-track.is-filtering {
  opacity: 0.08;
}

.carousel-card {
  position: relative;
  flex: 0 0 auto;
  min-height: 330px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(201, 163, 107, 0.2);
  background: #12120f;
  transform: scale(0.9);
  opacity: 0.45;
  transition: transform 0.55s ease, opacity 0.55s ease, border-color 0.55s ease;
}

.carousel-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.carousel-card-overlay {
  position: absolute;
  right: 0;
  left: 0;
  bottom: 0;
  padding: 18px 14px 12px;
  background: linear-gradient(180deg, rgba(10, 10, 10, 0), rgba(10, 10, 10, 0.88) 55%, rgba(10, 10, 10, 0.95));
  direction: rtl;
  text-align: right;
}

.carousel-name {
  font-size: 1rem;
  font-weight: 700;
  color: #f5e8c8;
  margin-bottom: 4px;
}

.carousel-source {
  font-size: 0.86rem;
  font-style: italic;
  color: #d6bc90;
}

.carousel-card.is-center {
  transform: scale(1);
  opacity: 1;
  border-color: #c9a36b;
  box-shadow: 0 0 0 1px rgba(201, 163, 107, 0.28), 0 14px 30px rgba(0, 0, 0, 0.42);
}

.carousel-card.is-side {
  transform: scale(0.92);
  opacity: 0.6;
}

.carousel-card.is-compact-card {
  transform: scale(1);
  opacity: 1;
}

.carousel-nav {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(20, 18, 16, 0.85);
  color: var(--primary-dark);
  font-size: 1.35rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.carousel-nav:hover {
  transform: translateY(-1px);
  border-color: #c9a36b;
}

.carousel-dots {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 0;
  background: #615641;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.carousel-dot.is-active {
  background: #c9a36b;
  transform: scale(1.35);
}

.category-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 11px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.category-chip:hover {
  background: #1b1814;
  border-color: #c9a36b;
}

.category-chip.is-active {
  background: var(--accent);
  color: #101010;
  border-color: #d8b47c;
}

/* Responsive behavior */
@media (max-width: 768px) {
  .page-shell {
    padding: 32px 16px 56px;
  }

  .site-header {
    gap: 8px;
  }

  .logo-icon {
    height: 64px;
  }

  .logo-text {
    font-size: 26px;
  }

  .site-header h1 {
    font-size: 2.2rem;
  }

  .cookie-notice {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-notice-accept {
    width: 100%;
  }

  .accessibility-panel {
    width: min(350px, 92vw);
  }

  .hero-section {
    padding: 28px 18px;
  }

  .carousel-card {
    min-height: 300px;
  }

  .carousel-nav {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .characters-section .section-title {
    font-size: 1.45rem;
  }

  .characters-section .section-title::before,
  .characters-section .section-title::after {
    width: 52px;
  }
}

@media (max-width: 480px) {
  .character-carousel {
    gap: 8px;
  }

  .carousel-card {
    min-height: 280px;
  }

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

  .search-box button,
  .search-box input {
    width: 100%;
  }
}
