/* ========================================
   CSS Variables — Theme System
   ======================================== */
:root,
[data-theme="light"] {
  --color-bg: #f8f9fa;
  --color-text: #212529;
  --color-accent: #6366f1;
  --color-accent-hover: #4f46e5;
  --color-secondary: #10b981;
  --color-secondary-hover: #059669;
  --color-card: #ffffff;
  --color-border: #dee2e6;
  --color-muted: #6c757d;
  --color-danger: #ef4444;
  --color-danger-hover: #dc2626;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --ill-opacity: 0.65;
  --png-opacity: 0.95;
  --bg-opacity: 0.4;
}

[data-theme="dark"] {
  --color-bg: #0f172a;
  --color-text: #e2e8f0;
  --color-accent: #818cf8;
  --color-accent-hover: #6366f1;
  --color-secondary: #34d399;
  --color-secondary-hover: #10b981;
  --color-card: #1e293b;
  --color-border: #334155;
  --color-muted: #94a3b8;
  --color-danger: #f87171;
  --color-danger-hover: #ef4444;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
  --ill-opacity: 0.25;
  --png-opacity: 0.75;
  --bg-opacity: 0.85;
}

/* ========================================
   Illustration & PNG classes
   ======================================== */
.ill {
  opacity: var(--ill-opacity);
  pointer-events: none;
}

.png {
  opacity: var(--png-opacity);
  pointer-events: none;
}

/* ========================================
   Reset
   ======================================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--color-bg);
  background-image: url('../Illus/IMG_2707.JPG');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.2s, color 0.2s;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  opacity: var(--bg-opacity, 0.65);
  z-index: -1;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--color-accent-hover);
}

img {
  max-width: 100%;
  height: auto;
}

/* ========================================
   Header
   ======================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.header__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header__logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-accent);
}

.header__nav {
  display: flex;
  gap: 0.5rem;
}

.header__link {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 0.9rem;
  transition: background-color 0.2s, color 0.2s;
}

.header__link:hover,
.header__link.active {
  background: var(--color-accent);
  color: #fff;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ========================================
   Burger Menu
   ======================================== */
.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.burger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.burger.active span:nth-child(2) {
  opacity: 0;
}
.burger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ========================================
   Main
   ======================================== */
.main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  width: 100%;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  background: var(--color-accent);
  color: #fff;
}
.btn--primary:hover {
  background: var(--color-accent-hover);
}

.btn--secondary {
  background: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
}
.btn--secondary:hover {
  background: var(--color-accent);
  color: #fff;
}

.btn--danger {
  background: var(--color-danger);
  color: #fff;
}
.btn--danger:hover {
  background: var(--color-danger-hover);
}

.btn--icon {
  padding: 0.4rem;
  background: transparent;
  color: var(--color-text);
  border: none;
  font-size: 1.2rem;
}

.btn--large {
  padding: 0.75rem 2rem;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

.btn--small {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

/* ========================================
   Cards
   ======================================== */
.card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px) scale(1.02);
}

.card--grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* ========================================
   Forms
   ======================================== */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 500;
  font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 0.9rem;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

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

/* ========================================
   Hero Section
   ======================================== */
.hero {
  text-align: center;
  padding: 4rem 1rem;
}

.hero__title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero__subtitle {
  font-size: 1.15rem;
  color: var(--color-muted);
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ========================================
   Features Section
   ======================================== */
.features {
  padding: 3rem 0;
}

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

.feature-card {
  text-align: center;
  padding: 2rem 1.5rem;
  position: relative;
  overflow: hidden;
}

[data-theme="light"] .feature-card {
  background: rgba(255, 255, 255, 0.7);
}

[data-theme="light"] .feature-card__title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8), 0 0 20px rgba(0,0,0,0.4);
}

[data-theme="light"] .feature-card__desc {
  font-weight: 500;
  color: #f0f0f0;
  text-shadow: 0 2px 6px rgba(0,0,0,0.7), 0 0 15px rgba(0,0,0,0.3);
}

[data-theme="light"] .feature-card__icon {
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8), 0 0 20px rgba(0,0,0,0.4);
}

.feature-card__icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.feature-card__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.feature-card__desc {
  font-size: 0.9rem;
  color: var(--color-muted);
}

/* ========================================
   Page Sections
   ======================================== */
.page-header {
  margin-bottom: 2rem;
}

.page-header__title {
  font-size: 1.75rem;
  font-weight: 700;
}

.page-header__subtitle {
  color: var(--color-muted);
  margin-top: 0.25rem;
}

.section {
  margin-bottom: 3rem;
}

/* ========================================
   Modal
   ======================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 90%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.2s;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

/* Editor modal - full screen semi-transparent */
#editorModal {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(2px);
}

#editorModal .modal {
  transform: none;
  padding: 0;
  overflow: hidden;
}

.modal__title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.modal__actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* ========================================
   Auth Page
   ======================================== */
.auth-container {
  max-width: 420px;
  margin: 2rem auto;
}

.auth-container .card {
  padding: 2rem;
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--color-border);
}

.auth-tab {
  flex: 1;
  padding: 0.75rem;
  text-align: center;
  cursor: pointer;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  color: var(--color-muted);
}

.auth-tab.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.auth-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--color-danger);
  color: var(--color-danger);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

/* ========================================
   Chat Styles
   ======================================== */
.chat {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 140px);
}

.chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
}

.chat__message {
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius-md);
  background: var(--color-card);
  border: 1px solid var(--color-border);
}

.chat__message-author {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-accent);
  margin-bottom: 0.25rem;
}

.chat__message-text {
  font-size: 0.9rem;
}

.chat__message-time {
  font-size: 0.75rem;
  color: var(--color-muted);
  margin-top: 0.25rem;
}

.chat__input {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 0;
}

.chat__input input {
  flex: 1;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-card);
  color: var(--color-text);
  font-size: 0.9rem;
}

.chat__input input:focus {
  outline: none;
  border-color: var(--color-accent);
}

/* ========================================
   Generator Styles
   ======================================== */
.generator {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.generator__preview {
  aspect-ratio: 1;
  background: var(--color-card);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  overflow: hidden;
}

.generator__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.generator__controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.generator__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

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

/* ========================================
   Character Card
   ======================================== */
.character-card {
  text-align: center;
}

.character-card__image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  background: var(--color-bg);
}

.character-card__name {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.character-card__class {
  font-size: 0.85rem;
  color: var(--color-muted);
}

/* ========================================
   Adventure Card
   ======================================== */
.adventure-card__title {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.adventure-card__desc {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.adventure-card__meta {
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
}

.adventure-card__actions {
  display: flex;
  gap: 0.5rem;
}

.adventure-view__desc {
  font-size: 0.95rem;
  color: var(--color-muted);
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
  line-height: 1.6;
}

.adventure-view__content {
  font-size: 0.95rem;
  line-height: 1.8;
  white-space: pre-wrap;
}

.modal--large {
  max-width: 700px;
}

/* ========================================
   Vertical Carousel (Centered)
   ======================================== */
.adventures-header-card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: 24px 40px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 10;
  margin-bottom: -40px;
}

.carousel-centered {
  max-width: 600px;
  width: 100%;
  height: calc(100vh - 220px);
  min-height: 400px;
  position: relative;
  overflow: visible;
}

/* Disable page scroll on adventures page */
.page-scroll-lock {
  overflow: hidden;
  height: 100vh;
}

.carousel-drum {
  position: relative;
  height: 100%;
  overflow: visible;
}

.carousel-slide {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 50%;
  transform: translateY(-50%) scale(0.7);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  padding: 10px;
  will-change: transform, opacity;
  pointer-events: none;
}

.carousel-slide--active {
  transform: translateY(-50%) scale(1.4);
  opacity: 1;
  z-index: 5;
  pointer-events: auto;
}

.carousel-slide--prev {
  transform: translateY(-100%) scale(0.8);
  opacity: 0.65;
  z-index: 4;
  pointer-events: auto;
}

.carousel-slide--next {
  transform: translateY(0%) scale(0.8);
  opacity: 0.65;
  z-index: 3;
  pointer-events: auto;
}

.carousel-slide--far-prev {
  transform: translateY(-145%) scale(0.65);
  opacity: 0.4;
  z-index: 2;
}

.carousel-slide--far-next {
  transform: translateY(45%) scale(0.65);
  opacity: 0.4;
  z-index: 1;
}

/* Exit top - dissolve upward */
.carousel-slide--exit-top {
  transform: translateY(-200%) scale(0.4);
  opacity: 0;
  pointer-events: none;
}

/* Exit bottom - dissolve downward */
.carousel-slide--exit-bottom {
  transform: translateY(150%) scale(0.4);
  opacity: 0;
  pointer-events: none;
}

.carousel-slide__image {
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-border);
  position: relative;
}

.carousel-slide--active .carousel-slide__image {
  border-color: var(--color-accent);
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.carousel-slide__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-slide__placeholder {
  font-size: 4rem;
  opacity: 0.3;
}

.carousel-slide__info {
  padding: 12px 4px 4px;
  text-align: center;
}

.carousel-slide__title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 4px;
}

.carousel-slide__date {
  font-size: 0.8rem;
  color: var(--color-muted);
}

/* Hover actions on carousel slides */
.carousel-slide__hover-actions {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 10;
}

.carousel-slide__action {
  width: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  color: rgba(255,255,255,0.7);
  opacity: 0;
  transition: opacity 0.3s, background 0.3s, filter 0.3s;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

.carousel-slide__action--delete {
  background: rgba(239, 68, 68, 0.35);
}

.carousel-slide__action--delete:hover {
  background: rgba(239, 68, 68, 0.7);
  color: #fff;
}

.carousel-slide__action--open {
  background: rgba(99, 102, 241, 0.35);
}

.carousel-slide__action--open:hover {
  background: rgba(99, 102, 241, 0.7);
  color: #fff;
}

/* Hover zones for edge detection */
.carousel-slide__hover-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 60px;
  z-index: 11;
  pointer-events: auto;
}

.carousel-slide__hover-zone--left {
  left: 0;
}

.carousel-slide__hover-zone--right {
  right: 0;
}

.carousel-slide__hover-zone--left:hover ~ .carousel-slide__action--delete,
.carousel-slide__hover-zone--right:hover ~ .carousel-slide__action--open {
  opacity: 1;
  pointer-events: auto;
}

.carousel-slide:hover .carousel-slide__image img {
  opacity: 0.6;
}

.carousel-counter {
  font-size: 0.9rem;
  color: var(--color-muted);
  font-weight: 500;
}

.carousel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 2rem;
}

/* Right column - Editor */
.carousel-right {
  overflow-y: auto;
  scrollbar-width: none;
  order: 1;
  border-right: 1px solid var(--color-border);
}

.carousel-right::-webkit-scrollbar {
  display: none;
}

/* ========================================
   Scenario Editor (Full-screen)
   ======================================== */
.editor-view {
  width: 100%;
  max-width: 1200px;
  height: calc(100vh - 60px); /* viewport minus header */
  display: flex;
  flex-direction: column;
}

.editor-view__header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
  flex-shrink: 0;
}

.editor-view__body {
  display: flex;
  gap: 2rem;
  flex: 1;
  min-height: 0; /* important for flex scroll */
}

.editor-view__left {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-accent) transparent;
}

.editor-view__left::-webkit-scrollbar {
  width: 8px;
}

.editor-view__left::-webkit-scrollbar-track {
  background: transparent;
}

.editor-view__left::-webkit-scrollbar-thumb {
  background: var(--color-accent);
  border-radius: 4px;
}

.editor-view__left::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent-hover);
}

.editor-view__right {
  width: 350px;
  flex-shrink: 0;
  position: sticky;
  top: 70px;
  align-self: flex-start;
  max-height: calc(100vh - 130px);
}

.editor-view__placeholder {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.editor-back-btn {
  font-size: 1.5rem;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.editor-back-btn:hover {
  opacity: 1;
}

/* Page Editor Cards */
.page-editor-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.page-editor-card:hover,
.page-editor-card--selected {
  box-shadow: var(--shadow-lg);
  border-color: var(--color-accent);
}

.page-editor-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.page-editor-card__number {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-accent);
}

.page-editor-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.page-editor-card__image {
  width: 100%;
  height: 250px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-bg);
  border: 2px dashed var(--color-border);
  cursor: pointer;
  transition: border-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-editor-card__image:hover {
  border-color: var(--color-accent);
}

.page-editor-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-editor-card__add {
  color: var(--color-muted);
  font-size: 0.9rem;
}

.page-editor-card__text {
  width: 100%;
  min-height: 80px;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
}

.page-editor-card__text:focus {
  outline: none;
  border-color: var(--color-accent);
}

/* Legacy editor styles removed — replaced by .page-editor-card */

@media (max-width: 768px) {
  body {
    background-attachment: scroll;
  }

  .adventures-header-card {
    display: none;
  }

  .adventures-header-mobile {
    display: block !important;
    text-align: center;
    padding: 10px 0;
    position: relative;
    z-index: 10;
    background: transparent;
  }

  #adventures-container {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex !important;
    flex-direction: column !important;
    align-items: center;
    overflow: hidden;
  }

  .carousel-centered {
    width: 88%;
    max-width: 88%;
    height: 75vh;
    margin-top: 5px;
  }

  .carousel-drum {
    height: 100%;
    position: relative;
    width: 100%;
  }

  .carousel-slide {
    left: 0;
    right: 0;
    padding: 4px;
  }

  .carousel-slide__image {
    aspect-ratio: 4/3;
    max-height: 40vh;
  }

  .carousel-slide__title {
    font-size: 0.8rem;
  }

  .carousel-slide__date {
    font-size: 0.7rem;
  }

  .carousel-slide--active {
    transform: translateY(-50%) scale(1.05);
  }

  .carousel-slide--prev {
    transform: translateY(-100%) scale(0.7);
  }

  .carousel-slide--next {
    transform: translateY(0%) scale(0.7);
  }

  .carousel-slide--far-prev {
    transform: translateY(-130%) scale(0.55);
  }

  .carousel-slide--far-next {
    transform: translateY(30%) scale(0.55);
  }

  .hero .png {
    height: 120px !important;
  }

  .editor-panel {
    padding: 16px;
  }

  .editor-panel__header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .editor-page {
    flex-direction: column;
    min-height: auto;
  }

  .editor-page__left {
    width: 100%;
  }

  .editor-page__right {
    width: 100%;
  }
}

.adventures-header-mobile {
  display: none;
}

/* ========================================
   Wizard Steps
   ======================================== */
.wizard-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  gap: 0;
}

.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.wizard-step__number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  border: 2px solid var(--color-border);
  color: var(--color-muted);
  transition: all 0.2s;
}

.wizard-step.active .wizard-step__number {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

.wizard-step.completed .wizard-step__number {
  background: var(--color-secondary);
  border-color: var(--color-secondary);
  color: #fff;
}

.wizard-step__label {
  font-size: 0.8rem;
  color: var(--color-muted);
}

.wizard-step.active .wizard-step__label {
  color: var(--color-accent);
  font-weight: 500;
}

.wizard-step__line {
  width: 60px;
  height: 2px;
  background: var(--color-border);
  margin: 0 0.5rem;
  margin-bottom: 1.25rem;
}

.wizard-content {
  min-height: 300px;
}

/* ========================================
   Lobby Layout
   ======================================== */
.lobby-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 1.5rem;
  min-height: calc(100vh - 180px);
}

.lobby-left {
  overflow-y: auto;
}

.lobby-right {
  display: flex;
  flex-direction: column;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.chat-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-header h3 {
  margin: 0;
  font-size: 1rem;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.chat-input-area {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--color-border);
  align-items: center;
}

.chat-input-area .form-input {
  flex: 1;
}

@media (max-width: 768px) {
  .lobby-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .lobby-left {
    order: 1;
  }

  .lobby-right {
    order: 2;
    min-height: 400px;
  }
}

/* ========================================
   Footer
   ======================================== */
.footer {
  background: var(--color-card);
  border-top: 1px solid var(--color-border);
  padding: 1.5rem;
  text-align: center;
}

.footer__container {
  max-width: 1200px;
  margin: 0 auto;
}

.footer__text {
  font-size: 0.85rem;
  color: var(--color-muted);
}

/* ========================================
   Utilities
   ======================================== */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--color-muted);
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.flex {
  display: flex;
}

.flex--center {
  align-items: center;
  justify-content: center;
}

.flex--between {
  align-items: center;
  justify-content: space-between;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
  .header__nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--color-card);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    padding: 1rem;
    box-shadow: var(--shadow-md);
  }

  .header__nav.active {
    display: flex;
  }

  .burger {
    display: flex;
  }

  .auth-btn {
    display: none;
  }

  .header__nav.active ~ .header__actions .auth-btn {
    display: inline-flex;
  }

  .hero__title {
    font-size: 1.75rem;
  }

  .generator {
    grid-template-columns: 1fr;
  }

  .features__grid {
    grid-template-columns: 1fr;
  }

  .card--grid {
    grid-template-columns: 1fr;
  }

  .page-header.flex.flex--between {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .modal {
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
  }

  .modal--large {
    max-width: 100%;
  }

  .chat {
    height: calc(100vh - 160px);
  }

  .chat__input {
    flex-direction: column;
  }

  .chat__input input {
    width: 100%;
  }

  .chat__input button {
    width: 100%;
  }

  .character-card {
    padding: 1rem;
  }

  .character-card__image {
    aspect-ratio: 4/3;
  }

  .adventure-card__actions {
    flex-wrap: wrap;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 2rem 1rem;
  }

  .hero__subtitle {
    font-size: 1rem;
  }

  .hero__actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .hero__actions .btn {
    width: 100%;
  }

  .auth-container {
    margin: 1rem auto;
    padding: 0 0.5rem;
  }

  .auth-container .card {
    padding: 1.5rem;
  }

  .footer {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .header__container {
    padding: 0 0.75rem;
  }

  .header__logo {
    font-size: 1.1rem;
  }

  .main {
    padding: 1rem 0.75rem;
  }

  .btn--large {
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
  }

  .page-header__title {
    font-size: 1.4rem;
  }

  .card {
    padding: 1rem;
  }

  .modal {
    padding: 1.25rem;
    border-radius: var(--radius-md);
  }

  .modal__title {
    font-size: 1.1rem;
  }

  .modal__actions {
    flex-direction: column;
  }

  .modal__actions .btn {
    width: 100%;
  }

  .chat__message {
    padding: 0.6rem 0.75rem;
  }

  .chat__message-author {
    font-size: 0.8rem;
  }

  .chat__message-text {
    font-size: 0.85rem;
  }

  .generator__preview {
    aspect-ratio: 1;
  }

  .btn--small {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
  }

  .features {
    padding: 2rem 0;
  }

  .feature-card {
    padding: 1.5rem 1rem;
  }

  .feature-card__icon {
    font-size: 2rem;
  }

  .feature-card__title {
    font-size: 1rem;
  }

  .feature-card__desc {
    font-size: 0.85rem;
  }

  .wizard-steps {
    margin-bottom: 1.5rem;
  }

  .wizard-step__number {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }

  .wizard-step__line {
    width: 40px;
  }

  .wizard-content {
    min-height: 250px;
  }
}
