:root {
  --bg-color: #080412;
  --card-bg: rgba(23, 13, 45, 0.8);
  --card-border: rgba(168, 85, 247, 0.35);
  --accent-purple: #9333ea;
  --accent-neon: #c084fc;
  --accent-pink: #ec4899;
  --accent-cyan: #06b6d4;
  --text-main: #f3e8ff;
  --text-muted: #a855f7;
  --nav-bg: rgba(12, 7, 26, 0.92);
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  padding-bottom: 90px;
  overflow-x: hidden;
  position: relative;
}

body.theme-light {
  --bg-color: #fff7ef;
  --card-bg: rgba(255, 252, 247, 0.82);
  --card-border: rgba(244, 114, 182, 0.28);
  --accent-purple: #f472b6;
  --accent-neon: #ff4fa3;
  --accent-pink: #ec4899;
  --accent-cyan: #06b6d4;
  --text-main: #2b1420;
  --text-muted: #8b4563;
  --nav-bg: rgba(255, 250, 244, 0.9);
}

body.theme-light .header {
  background: rgba(255, 248, 238, 0.72);
}

body.theme-light .glow-bg {
  background: radial-gradient(circle, rgba(255, 79, 163, 0.28) 0%, rgba(255, 255, 255, 0) 70%);
}

body.theme-light .glow-bg-secondary {
  background: radial-gradient(circle, rgba(244, 114, 182, 0.18) 0%, rgba(255, 255, 255, 0) 70%);
}

body.theme-light .logo {
  background: linear-gradient(135deg, #ff8bc7 0%, #ff4fa3 55%, #7c2d12 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Ambient Cyberpunk Glow Orbs */
.glow-bg {
  position: fixed;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(147, 51, 234, 0.45) 0%, rgba(0, 0, 0, 0) 70%);
  filter: blur(60px);
  z-index: -1;
  pointer-events: none;
}

.glow-bg-secondary {
  position: fixed;
  bottom: 80px;
  right: -60px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.3) 0%, rgba(0, 0, 0, 0) 70%);
  filter: blur(50px);
  z-index: -1;
  pointer-events: none;
}

.app-container {
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: rgba(12, 7, 26, 0.7);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--card-border);
}

.catalog-mode .header {
  background: rgba(8, 4, 18, 0.42);
  border-bottom: 1px solid rgba(168, 85, 247, 0.16);
  padding: 22px 20px 12px;
}

.logo {
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 0%, var(--accent-neon) 60%, var(--accent-pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(192, 132, 252, 0.5));
}

.catalog-mode .logo {
  font-size: 30px;
  letter-spacing: 8px;
  -webkit-text-fill-color: #fff;
  color: #fff;
  text-shadow: 0 0 14px rgba(192, 132, 252, 0.85);
}

.tagline {
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 1.2px;
  display: block;
  font-weight: 700;
}

.catalog-mode .tagline {
  color: rgba(243, 232, 255, 0.74);
  letter-spacing: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-premium {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(147, 51, 234, 0.6);
  transition: transform 0.2s;
}

.btn-premium:active {
  transform: scale(0.96);
}

.btn-premium[data-subscription="general"] {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(192, 132, 252, 0.36);
}

.btn-premium[data-subscription="basic"] {
  background: linear-gradient(135deg, #4c1d95, #2563eb);
}

.btn-premium[data-subscription="premium"] {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
}

.btn-notification {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.admin-view {
  padding: 16px;
}

.admin-hero {
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(147, 51, 234, 0.18), rgba(6, 182, 212, 0.05)),
    var(--card-bg);
  padding: 18px;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  align-items: start;
  box-shadow: 0 0 26px rgba(147, 51, 234, 0.18);
}

.admin-back {
  width: 42px;
  height: 42px;
}

.admin-kicker {
  color: var(--accent-neon);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.admin-hero h2 {
  font-size: 26px;
  line-height: 1.05;
  margin-bottom: 6px;
}

.admin-hero span {
  color: rgba(243, 232, 255, 0.72);
  font-size: 13px;
}

.admin-top-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: 10px;
}

.admin-top-actions button {
  min-height: 40px;
  border: 1px solid rgba(192, 132, 252, 0.28);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font-weight: 800;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.admin-stat-card {
  min-height: 94px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at top right, rgba(192, 132, 252, 0.18), transparent 45%),
    var(--card-bg);
  padding: 14px;
}

.admin-stat-card span {
  display: block;
  min-height: 32px;
  color: rgba(243, 232, 255, 0.68);
  font-size: 12px;
  font-weight: 700;
}

.admin-stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  color: #fff;
  text-shadow: 0 0 14px rgba(192, 132, 252, 0.55);
}

.admin-control-grid {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.admin-control-card {
  width: 100%;
  min-height: 82px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.26), rgba(12, 7, 26, 0.78));
  color: var(--text-main);
  display: grid;
  grid-template-columns: 48px 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  text-align: left;
  padding: 14px;
  cursor: pointer;
}

.admin-control-card > span {
  grid-row: 1 / 3;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(147, 51, 234, 0.35);
  color: #fff;
  font-size: 22px;
}

.admin-control-card strong {
  font-size: 16px;
  font-weight: 800;
}

.admin-control-card small {
  color: rgba(243, 232, 255, 0.62);
  font-size: 12px;
  line-height: 1.35;
}

body.theme-light .admin-hero span,
body.theme-light .admin-stat-card span,
body.theme-light .admin-control-card small {
  color: rgba(43, 20, 32, 0.66);
}

body.theme-light .admin-stat-card strong {
  color: #2b1420;
}

/* Sub Nav */
.sub-nav {
  display: flex;
  justify-content: space-around;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sub-nav-item {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 12px;
  transition: all 0.2s;
}

.sub-nav-item.active {
  color: #fff;
  background: rgba(147, 51, 234, 0.3);
  box-shadow: 0 0 14px rgba(192, 132, 252, 0.4);
  border: 1px solid var(--card-border);
}

.empty-state-panel {
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  color: var(--text-muted);
  padding: 18px;
}

.saved-header-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.saved-header-row .section-title {
  margin-bottom: 6px;
}

#saved-slots-count {
  color: var(--text-muted);
  font-size: 15px;
}

.saved-create-btn {
  border: 1px solid var(--accent-purple);
  border-radius: 8px;
  background: rgba(82, 22, 140, 0.22);
  color: #ead8ff;
  min-height: 42px;
  padding: 0 16px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

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

.saved-character-card {
  position: relative;
  min-height: 220px;
  border: 1px solid rgba(168, 85, 247, 0.55);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(8, 8, 24, 0.82);
  cursor: pointer;
  box-shadow: 0 0 18px rgba(124, 58, 237, 0.18);
}

.saved-character-card img {
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
  display: block;
}

.saved-character-card::after {
  content: "";
  position: absolute;
  inset: 35% 0 0;
  background: linear-gradient(180deg, transparent, rgba(4, 2, 12, 0.94));
  pointer-events: none;
}

.saved-character-body {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 2;
}

.saved-character-body strong {
  display: block;
  color: #fff;
  font-size: 17px;
  line-height: 1.05;
  margin-bottom: 5px;
}

.saved-character-body span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.25;
}

.saved-character-meta {
  margin-top: 8px;
  color: #c7b8f8;
  font-size: 10px;
}

.saved-delete-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(216, 180, 254, 0.55);
  background: rgba(20, 8, 34, 0.78);
  color: #f1ddff;
  cursor: pointer;
  font-size: 18px;
}

.storage-panel {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  background: var(--card-bg);
}

.storage-icon {
  color: var(--accent-neon);
  font-size: 32px;
  text-shadow: var(--neon-glow);
}

.storage-panel b,
.storage-panel span {
  display: block;
}

.storage-panel span {
  color: var(--text-muted);
  margin-top: 5px;
  font-size: 12px;
}

@media (min-width: 620px) {
  .saved-characters-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.cabinet-saved-panel.section-container,
.cabinet-npc-panel.section-container {
  display: block;
}

.saved-characters-grid .empty-state-panel {
  grid-column: 1 / -1;
}

/* Personalities Carousel */
.personalities-carousel {
  display: flex;
  gap: 12px;
  padding: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.personality-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  cursor: pointer;
  min-width: 86px;
  width: 86px;
  position: relative;
  border: 0;
  padding: 0;
  background: transparent;
  font: inherit;
}

.avatar-wrapper {
  width: 100%;
  height: 128px;
  border-radius: 14px;
  background: rgba(147, 51, 234, 0.2);
  border: 2px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0;
  transition: all 0.25s ease;
  overflow: hidden;
  position: relative;
}

.avatar-wrapper::after {
  content: "";
  position: absolute;
  inset: 40% 0 0;
  background: linear-gradient(180deg, transparent, rgba(5, 3, 15, 0.88));
  pointer-events: none;
}

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

.avatar-empty-plus {
  color: var(--accent-neon);
  font-size: 36px;
  line-height: 1;
  text-shadow: 0 0 14px var(--accent-neon);
  z-index: 1;
}

.personality-card.active .avatar-wrapper {
  border-color: var(--accent-neon);
  box-shadow: 0 0 18px var(--accent-neon);
  transform: scale(1.05);
}

.personality-name {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 1;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  text-align: left;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.active-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent-neon);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-neon);
}

.create-card .avatar-wrapper {
  border-style: dashed;
  border-color: var(--accent-purple);
}

.create-text {
  margin-top: 8px;
  font-size: 10px;
  text-align: center;
  color: var(--text-muted);
  font-weight: 600;
}

/* Section Titles */
.section-container, .gameplay-section {
  padding: 16px;
}

.section-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #fff;

}

.section-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* Avatar Preview Card */
.avatar-preview-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
}

.preview-image-container {
  width: 100%;
  max-width: 220px;
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  background: rgba(147, 51, 234, 0.25);
  border: 2px solid var(--accent-neon);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(192, 132, 252, 0.5);
  position: relative;
}

.preview-image-container::before {
  content: "+";
  color: var(--accent-neon);
  font-size: 48px;
  line-height: 1;
  text-shadow: 0 0 18px var(--accent-neon);
}

.preview-image-container.has-image::before {
  display: none;
}

.preview-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-image-container img:not([src]) {
  display: none;
}

.romance-status {
  color: var(--accent-neon);
  font-size: 12px;
  font-weight: 800;
  margin: -4px 0 12px;
  text-transform: uppercase;
}

.btn-change-avatar {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  border: none;
  color: #fff;
  padding: 12px 20px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  width: 100%;
  box-shadow: 0 4px 15px rgba(147, 51, 234, 0.5);
  transition: transform 0.2s;
}

.btn-change-avatar:active {
  transform: scale(0.98);
}

.btn-delete-avatar {
  width: calc(100% - 32px);
  margin: 10px 16px 88px;
  border: 1px solid rgba(248, 113, 113, 0.36);
  border-radius: 10px;
  background: rgba(55, 10, 26, 0.35);
  color: rgba(254, 202, 202, 0.88);
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
  cursor: pointer;
}

/* Form Inputs Grid */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 560px) {
  .section-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(170px, 34%);
    column-gap: 16px;
    align-items: start;
  }

  .section-container .section-title,
  .section-container .section-subtitle {
    grid-column: 1 / -1;
  }

  .section-container .avatar-preview-card {
    grid-column: 2;
    grid-row: 3;
    margin-bottom: 0;
  }

  .section-container .settings-grid {
    grid-column: 1;
    grid-row: 3;
  }
}

.form-group {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  backdrop-filter: blur(10px);
}

.input-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.input-icon {
  font-size: 20px;
  color: var(--accent-neon);
}

.field-content {
  flex: 1;
}

.field-label {
  font-size: 10px;
  color: var(--text-muted);
  display: block;
  font-weight: 700;
  text-transform: uppercase;
}

.form-input {
  background: none;
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  width: 100%;
  outline: none;
}

.form-textarea {
  background: none;
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  width: 100%;
  min-height: 74px;
  resize: vertical;
  outline: none;
  line-height: 1.35;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.admin-wide {
  grid-column: 1 / -1;
}

.create-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.icon-back {
  background: none;
  border: none;
  color: var(--accent-neon);
  font-size: 42px;
  line-height: 1;
  cursor: pointer;
}

.create-top-grid {
  display: grid;
  grid-template-columns: minmax(130px, 0.9fr) minmax(0, 1.6fr);
  gap: 14px;
  margin-bottom: 14px;
}

.photo-uploader {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 12px;
  text-align: center;
  backdrop-filter: blur(10px);
}

.photo-preview {
  aspect-ratio: 3 / 4;
  border: 2px dashed var(--accent-purple);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--accent-neon);
  font-weight: 800;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  overflow: hidden;
}

.photo-preview.has-photo {
  border-style: solid;
  box-shadow: 0 0 18px rgba(192, 132, 252, 0.5);
}

.photo-plus {
  font-size: 54px;
  line-height: 1;
}

.photo-uploader p,
.context-text,
.range-labels {
  color: rgba(216, 202, 255, 0.7);
  font-size: 11px;
}

.photo-uploader p {
  margin-top: 10px;
}

.create-main-fields {
  align-content: start;
}

.create-fields {
  margin-bottom: 14px;
}

.behavior-panel {
  background: rgba(12, 7, 26, 0.45);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.style-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.style-option {
  min-height: 96px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}

.style-option span {
  font-size: 36px;
}

.style-option.active {
  border-color: var(--accent-purple);
  box-shadow: 0 0 18px rgba(147, 51, 234, 0.45);
  color: var(--accent-neon);
}

@media (max-width: 420px) {
  .create-top-grid {
    grid-template-columns: 1fr;
  }

  .style-options {
    grid-template-columns: 1fr;
  }
}

/* Sliders & Segmented */
.slider-group, .segmented-group {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 10px;
  backdrop-filter: blur(10px);
}

.slider-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 8px;
  font-weight: 700;
}

.slider-value {
  color: var(--accent-neon);
  font-weight: 800;
}

.custom-slider {
  width: 100%;
  accent-color: var(--accent-neon);
}

.segmented-control {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  padding: 3px;
  border-radius: 10px;
}

.segment-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 8px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
}

.segment-btn.active {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  color: #fff;
  box-shadow: 0 0 10px rgba(147, 51, 234, 0.5);
}

/* Save Button */
.btn-save-settings {
  margin: 16px;
  width: calc(100% - 32px);
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(147, 51, 234, 0.6);
}

/* Character Catalog */
.catalog-view {
  padding: 6px 14px 88px;
}

.catalog-hero {
  padding: 4px 6px 18px;
}

.catalog-logo {
  font-size: 36px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 8px;
  color: #fff;
  text-shadow: 0 0 14px rgba(192, 132, 252, 0.9);
}

.catalog-hero p {
  color: rgba(243, 232, 255, 0.78);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  margin-top: 8px;
}

.catalog-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 2px 14px;
  scrollbar-width: none;
}

.catalog-tabs::-webkit-scrollbar {
  display: none;
}

.catalog-tab {
  flex: 0 0 auto;
  border: 1px solid rgba(168, 85, 247, 0.28);
  background: rgba(8, 4, 18, 0.65);
  color: rgba(243, 232, 255, 0.72);
  border-radius: 16px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.catalog-tab.active {
  color: #fff;
  border-color: rgba(192, 132, 252, 0.75);
  background: linear-gradient(135deg, rgba(111, 28, 255, 0.92), rgba(147, 51, 234, 0.55));
  box-shadow: 0 0 18px rgba(147, 51, 234, 0.58);
}

.catalog-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 6px 12px;
}

.catalog-heading-row span {
  color: rgba(216, 202, 255, 0.68);
  font-size: 11px;
  font-weight: 700;
  text-align: right;
}

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

.npc-view {
  padding: 6px 14px 88px;
}

.npc-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 6px 14px;
}

.npc-sort-btn {
  border: 1px solid rgba(168, 85, 247, 0.24);
  border-radius: 14px;
  background: rgba(14, 12, 34, 0.86);
  color: rgba(243, 232, 255, 0.82);
  padding: 9px 12px;
  font-size: 11px;
  font-weight: 700;
}

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

.npc-card {
  position: relative;
  border: 1px solid rgba(168, 85, 247, 0.45);
  border-radius: 12px;
  overflow: hidden;
  min-height: 186px;
  aspect-ratio: 0.72;
  padding: 0;
  background: rgba(12, 7, 26, 0.85);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(91, 33, 182, 0.2);
}

.npc-card.active {
  border-color: var(--accent-neon);
  box-shadow: 0 0 20px rgba(192, 132, 252, 0.65);
}

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

.npc-card::after {
  content: "";
  position: absolute;
  inset: 34% 0 0;
  background: linear-gradient(180deg, rgba(8, 4, 18, 0), rgba(8, 4, 18, 0.96));
  pointer-events: none;
}

.npc-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  max-width: calc(100% - 54px);
  border-radius: 9px;
  background: rgba(34, 24, 73, 0.88);
  color: rgba(243, 232, 255, 0.86);
  padding: 5px 8px;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.npc-info {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(216, 180, 254, 0.78);
  border-radius: 50%;
  color: rgba(243, 232, 255, 0.9);
  font-size: 13px;
  font-weight: 800;
}

.npc-card-overlay {
  position: absolute;
  left: 10px;
  right: 38px;
  bottom: 14px;
  z-index: 2;
  text-align: left;
}

.npc-card-overlay strong {
  display: block;
  color: #fff;
  font-size: 16px;
  line-height: 1.05;
  font-weight: 800;
  text-transform: uppercase;
}

.npc-card-overlay span {
  display: block;
  color: rgba(243, 232, 255, 0.72);
  font-size: 8px;
  line-height: 1.28;
  font-weight: 700;
  margin-top: 7px;
}

.npc-add {
  position: absolute;
  right: 10px;
  bottom: 12px;
  z-index: 3;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(192, 132, 252, 0.8);
  border-radius: 7px;
  color: #fff;
  background: rgba(91, 33, 182, 0.66);
  box-shadow: 0 0 14px rgba(147, 51, 234, 0.52);
  font-size: 22px;
  line-height: 1;
}

.catalog-card {
  position: relative;
  border: 1px solid rgba(168, 85, 247, 0.45);
  border-radius: 12px;
  overflow: hidden;
  min-height: 178px;
  aspect-ratio: 0.72;
  padding: 0;
  background: rgba(12, 7, 26, 0.85);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(91, 33, 182, 0.2);
}

.catalog-card.active {
  border-color: var(--accent-neon);
  box-shadow: 0 0 20px rgba(192, 132, 252, 0.65);
}

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

.catalog-card::after {
  content: "";
  position: absolute;
  inset: 35% 0 0;
  background: linear-gradient(180deg, rgba(8, 4, 18, 0), rgba(8, 4, 18, 0.92));
  pointer-events: none;
}

.catalog-favorite {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 2;
  color: #fff;
  font-size: 22px;
  text-shadow: 0 0 10px rgba(8, 4, 18, 0.8);
}

.catalog-card.active .catalog-favorite {
  color: var(--accent-neon);
}

.catalog-card-overlay {
  position: absolute;
  left: 10px;
  right: 8px;
  bottom: 10px;
  z-index: 2;
  text-align: left;
}

.catalog-card-overlay strong {
  display: block;
  color: #fff;
  font-size: 17px;
  line-height: 1.05;
  font-weight: 800;
  text-transform: uppercase;
}

.catalog-card-overlay span {
  display: block;
  color: rgba(243, 232, 255, 0.72);
  font-size: 8px;
  line-height: 1.25;
  font-weight: 800;
  text-transform: uppercase;
  margin-top: 5px;
}

.catalog-empty {
  grid-column: 1 / -1;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 18px;
  color: rgba(243, 232, 255, 0.72);
  text-align: center;
}

.catalog-create-cta {
  width: 100%;
  margin-top: 18px;
  border: 1px solid rgba(192, 132, 252, 0.72);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(89, 24, 180, 0.86), rgba(74, 13, 116, 0.65));
  color: #fff;
  padding: 14px;
  display: grid;
  grid-template-columns: 48px 1fr 18px;
  align-items: center;
  gap: 12px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 0 22px rgba(147, 51, 234, 0.52);
}

.catalog-create-icon {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(192, 132, 252, 0.55);
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--accent-neon);
  font-size: 22px;
  box-shadow: inset 0 0 16px rgba(147, 51, 234, 0.35);
}

.catalog-create-cta b,
.catalog-create-cta small {
  display: block;
}

.catalog-create-cta b {
  font-size: 13px;
  letter-spacing: 0.2px;
}

.catalog-create-cta small {
  color: rgba(216, 202, 255, 0.7);
  font-size: 10px;
  margin-top: 3px;
}

.catalog-create-arrow {
  color: var(--accent-neon);
  font-size: 30px;
  line-height: 1;
}

.story-view {
  padding: 6px 14px 88px;
}

.story-tools {
  display: flex;
  gap: 8px;
  align-items: center;
}

.story-filter-btn {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(168, 85, 247, 0.24);
  border-radius: 50%;
  background: rgba(14, 12, 34, 0.86);
  color: var(--accent-neon);
  font-size: 20px;
  cursor: pointer;
}

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

.story-card {
  position: relative;
  min-height: 190px;
  aspect-ratio: 0.72;
  border: 1px solid rgba(168, 85, 247, 0.45);
  border-radius: 12px;
  overflow: hidden;
  padding: 0;
  background: rgba(12, 7, 26, 0.85);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(91, 33, 182, 0.2);
}

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

.story-card::after {
  content: "";
  position: absolute;
  inset: 32% 0 0;
  background: linear-gradient(180deg, rgba(8, 4, 18, 0), rgba(8, 4, 18, 0.95));
}

.story-badge,
.story-crown,
.story-unique,
.story-info,
.story-card-action,
.story-card-overlay {
  position: absolute;
  z-index: 2;
}

.story-badge {
  top: 10px;
  left: 10px;
  border-radius: 8px;
  padding: 5px 8px;
  color: #fff;
  background: rgba(22, 101, 52, 0.78);
  font-size: 8px;
  font-weight: 800;
}

.story-card.medium .story-badge {
  background: rgba(146, 64, 14, 0.82);
}

.story-card.full .story-badge {
  background: rgba(159, 18, 57, 0.82);
}

.story-crown,
.story-unique {
  top: 12px;
  right: 14px;
  color: #facc15;
  font-size: 20px;
  text-shadow: 0 0 12px rgba(250, 204, 21, 0.75);
}

.story-unique {
  color: #f0abfc;
}

.story-info {
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(216, 180, 254, 0.76);
  border-radius: 50%;
  color: rgba(243, 232, 255, 0.9);
  font-size: 13px;
  font-weight: 800;
}

.story-crown + .story-info,
.story-unique + .story-info {
  display: none;
}

.story-card-overlay {
  left: 12px;
  right: 40px;
  bottom: 18px;
  text-align: left;
}

.story-card-overlay strong {
  display: block;
  color: #fff;
  font-size: 15px;
  line-height: 1.15;
  font-weight: 800;
  text-transform: uppercase;
}

.story-card-overlay small {
  display: block;
  color: rgba(243, 232, 255, 0.72);
  font-size: 9px;
  line-height: 1.3;
  margin-top: 10px;
}

.story-card-action {
  right: 10px;
  bottom: 14px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(192, 132, 252, 0.8);
  border-radius: 7px;
  color: #fff;
  background: rgba(91, 33, 182, 0.66);
  box-shadow: 0 0 14px rgba(147, 51, 234, 0.52);
  font-size: 17px;
}

.story-card.locked img {
  filter: brightness(0.68) saturate(0.86);
}

.story-detail {
  border: 1px solid rgba(168, 85, 247, 0.28);
  border-radius: 18px;
  background: rgba(7, 14, 31, 0.62);
  overflow: hidden;
}

.story-back-link {
  margin: 20px 18px 10px;
  border: 0;
  background: transparent;
  color: #f0abfc;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.6px;
  cursor: pointer;
}

.story-detail-hero {
  position: relative;
  min-height: 420px;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: center;
  gap: 12px;
}

.story-detail-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(3, 7, 18, 0.98) 0%, rgba(3, 7, 18, 0.74) 42%, rgba(3, 7, 18, 0.08) 100%);
  pointer-events: none;
}

.story-detail-copy,
.story-detail-hero img {
  position: relative;
  z-index: 1;
}

.story-detail-copy h1 {
  color: #fff;
  font-size: 40px;
  line-height: 1.08;
  font-weight: 500;
  letter-spacing: 1px;
  margin: 28px 0 16px;
  text-shadow: 0 0 16px rgba(192, 132, 252, 0.5);
}

.story-detail-copy p,
.story-info-block p,
.story-tip p,
.story-feature-grid p {
  color: rgba(243, 232, 255, 0.75);
  line-height: 1.55;
}

.story-detail-hero img {
  width: 100%;
  height: 390px;
  object-fit: cover;
  border-radius: 12px;
}

.story-level-pill {
  display: inline-block;
  border-radius: 12px;
  padding: 8px 13px;
  background: rgba(22, 101, 52, 0.82);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.story-level-pill.medium {
  background: rgba(146, 64, 14, 0.85);
}

.story-level-pill.full {
  background: rgba(159, 18, 57, 0.85);
}

.story-separator {
  width: 80%;
  height: 1px;
  margin: 26px 0;
  background: linear-gradient(90deg, var(--accent-neon), transparent);
}

.story-meta-list {
  display: grid;
  gap: 16px;
}

.story-meta-list div {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 4px 12px;
  align-items: center;
}

.story-meta-list span {
  grid-row: span 2;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--accent-neon);
  background: rgba(30, 41, 59, 0.55);
}

.story-meta-list b {
  color: #fff;
  font-size: 11px;
}

.story-meta-list small {
  color: rgba(216, 202, 255, 0.82);
}

.story-info-block {
  border-top: 1px solid rgba(168, 85, 247, 0.16);
  padding: 22px 18px;
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 18px;
  align-items: center;
}

.story-info-block img {
  width: 100%;
  aspect-ratio: 1.45;
  object-fit: cover;
  border: 1px solid rgba(168, 85, 247, 0.58);
  border-radius: 12px;
}

.story-expects {
  border-top: 1px solid rgba(168, 85, 247, 0.16);
  padding: 22px 18px;
}

.story-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.story-feature-grid article {
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 12px;
  min-height: 138px;
  padding: 16px 12px;
  background: rgba(7, 14, 31, 0.7);
}

.story-feature-grid span {
  color: var(--accent-neon);
  font-size: 26px;
}

.story-feature-grid b {
  display: block;
  color: #fff;
  font-size: 12px;
  margin: 12px 0 8px;
  text-transform: uppercase;
}

.story-feature-grid p,
.story-tip p {
  font-size: 12px;
}

.story-tip {
  margin: 0 18px 18px;
  border: 1px solid rgba(192, 132, 252, 0.55);
  border-radius: 12px;
  padding: 16px;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  background: rgba(76, 29, 149, 0.12);
}

.story-tip span {
  color: var(--accent-neon);
  font-size: 34px;
}

.story-tip b {
  color: #f4d9ff;
  font-size: 13px;
  letter-spacing: 2px;
}

.story-actions {
  padding: 0 18px 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.story-actions button {
  min-height: 54px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.7px;
  cursor: pointer;
}

.primary-action {
  border: 1px solid rgba(192, 132, 252, 0.74);
  color: #fff;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.9), rgba(88, 28, 135, 0.75));
  box-shadow: 0 0 18px rgba(147, 51, 234, 0.35);
}

.primary-action:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.secondary-action {
  border: 1px solid rgba(168, 85, 247, 0.42);
  color: #f0abfc;
  background: rgba(8, 4, 18, 0.45);
}

.premium-view {
  padding: 16px;
}

.premium-panel {
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 18px;
  background: rgba(8, 13, 30, 0.72);
  padding: 16px;
  box-shadow: 0 0 28px rgba(147, 51, 234, 0.18);
}

.premium-title-row {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 10px;
  text-align: center;
  margin-bottom: 20px;
}

.premium-title-row h2 {
  color: #f4d9ff;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 1.5px;
}

.premium-title-row p {
  color: rgba(216, 202, 255, 0.86);
  font-size: 13px;
  margin-top: 8px;
}

.premium-back {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(168, 85, 247, 0.42);
  border-radius: 50%;
  color: var(--accent-neon);
  background: rgba(76, 29, 149, 0.36);
  font-size: 38px;
  line-height: 0.75;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(147, 51, 234, 0.25);
}

.premium-hero {
  position: relative;
  min-height: 220px;
  border: 1px solid rgba(168, 85, 247, 0.42);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(12, 7, 26, 0.85);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.premium-hero img {
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
  display: block;
}

.premium-hero::after {
  content: "";
  position: absolute;
  inset: 35% 0 0;
  background: linear-gradient(180deg, transparent, rgba(3, 2, 12, 0.95));
}

.premium-hero-content {
  position: absolute;
  z-index: 1;
  left: 18px;
  right: 18px;
  bottom: 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: end;
}

.premium-hero-content strong,
.premium-hero-content span {
  display: block;
}

.premium-hero-content strong {
  color: #fff;
  font-size: 22px;
  margin-bottom: 10px;
}

.premium-hero-content span {
  color: rgba(243, 232, 255, 0.8);
  font-size: 14px;
  line-height: 1.45;
}

.premium-activate,
.premium-select-plan {
  border: 1px solid rgba(192, 132, 252, 0.74);
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.9), rgba(88, 28, 135, 0.75));
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0.4px;
  box-shadow: 0 0 18px rgba(147, 51, 234, 0.35);
}

.premium-activate {
  min-width: 150px;
  padding: 14px 18px;
  font-size: 12px;
}

.premium-section-title {
  color: #e9b8ff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1.3px;
  margin: 28px 2px 16px;
}

.premium-benefits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.premium-benefits article,
.premium-plan-card {
  border: 1px solid rgba(168, 85, 247, 0.24);
  border-radius: 12px;
  background: rgba(7, 14, 31, 0.74);
  box-shadow: inset 0 0 30px rgba(15, 23, 42, 0.42);
}

.premium-benefits article {
  min-height: 134px;
  padding: 16px 10px;
  text-align: center;
  display: grid;
  align-content: start;
  gap: 10px;
}

.premium-benefits span {
  color: var(--accent-neon);
  font-size: 30px;
  line-height: 1;
}

.premium-benefits b {
  color: #fff;
  font-size: 13px;
  line-height: 1.25;
}

.premium-benefits small {
  color: rgba(216, 202, 255, 0.78);
  font-size: 10px;
  line-height: 1.45;
}

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

.premium-plan-card {
  position: relative;
  padding: 28px 12px 12px;
}

.premium-plan-card.featured {
  border-color: rgba(192, 132, 252, 0.9);
  box-shadow: 0 0 24px rgba(147, 51, 234, 0.28);
}

.premium-plan-badge {
  position: absolute;
  top: -1px;
  right: 10px;
  border-radius: 0 0 8px 8px;
  background: rgba(147, 51, 234, 0.9);
  color: #fff;
  padding: 5px 9px;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.premium-plan-card:nth-child(2) .premium-plan-badge {
  background: rgba(16, 185, 129, 0.35);
}

.premium-plan-card:nth-child(3) .premium-plan-badge {
  background: rgba(234, 179, 8, 0.24);
}

.premium-plan-card h4 {
  color: #e9b8ff;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 14px;
}

.premium-price-row {
  min-height: 46px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 16px;
}

.premium-price-row strong {
  color: #bd21ff;
  font-size: 23px;
  font-weight: 500;
}

.premium-price-row small,
.premium-price-row del {
  color: rgba(243, 232, 255, 0.62);
  font-size: 11px;
}

.premium-price-row em {
  background: var(--accent-purple);
  color: #fff;
  border-radius: 6px;
  padding: 3px 5px;
  font-size: 10px;
  font-style: normal;
}

.premium-plan-card ul {
  list-style: none;
  color: rgba(243, 232, 255, 0.78);
  font-size: 11px;
  line-height: 1.6;
  min-height: 100px;
}

.premium-select-plan {
  width: 100%;
  padding: 12px;
  margin-top: 14px;
  background: rgba(56, 14, 94, 0.62);
  font-size: 11px;
}

.premium-footer-links {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
  margin-top: 18px;
}

.premium-footer-links p {
  color: rgba(216, 202, 255, 0.62);
  font-size: 11px;
  line-height: 1.45;
}

.premium-footer-links div {
  display: grid;
  gap: 12px;
  justify-items: end;
}

.premium-footer-links button {
  border: none;
  background: transparent;
  color: rgba(216, 202, 255, 0.88);
  text-decoration: underline;
  font-size: 11px;
  cursor: pointer;
}

.settings-view {
  padding: 16px;
}

.settings-profile-panel,
.settings-list {
  border: 1px solid var(--card-border);
  border-radius: 18px;
  background: var(--card-bg);
  box-shadow: 0 0 28px rgba(147, 51, 234, 0.16);
  overflow: hidden;
}

.settings-profile-panel {
  padding: 18px;
}

.settings-profile-top {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 18px;
  align-items: center;
}

.settings-avatar-wrap {
  position: relative;
}

.settings-avatar-wrap img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-neon);
  box-shadow: 0 0 24px rgba(192, 132, 252, 0.5);
}

.settings-avatar-edit {
  position: absolute;
  right: 0;
  bottom: 6px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--accent-neon);
  background: var(--card-bg);
  color: var(--accent-neon);
  font-size: 18px;
  cursor: pointer;
}

.settings-name-input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text-main);
  font-size: 30px;
  font-weight: 700;
  outline: none;
}

.settings-subscription-line {
  margin-top: 12px;
  color: var(--accent-neon);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.settings-online-dot {
  display: inline-block;
  margin-top: 12px;
  padding: 7px 12px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.settings-online-dot::first-letter {
  color: #34d399;
}

.settings-motto {
  margin-top: 16px;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  background: rgba(255, 255, 255, 0.035);
}

.settings-motto span,
.settings-motto button {
  color: var(--accent-neon);
}

.settings-motto textarea {
  width: 100%;
  resize: none;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.35;
}

.settings-motto button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
}

.settings-counters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 22px -18px 18px;
  padding: 20px 18px;
  border-top: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
}

.settings-counters div {
  text-align: center;
}

.settings-counters strong,
.settings-counters span {
  display: block;
}

.settings-counters strong {
  color: var(--accent-neon);
  font-size: 30px;
  font-weight: 600;
}

.settings-counters span {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 5px;
}

.settings-achievements h3,
.settings-main-title {
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 14px;
}

.achievement-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.achievement-row button {
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  display: grid;
  justify-items: center;
  gap: 8px;
  font-size: 24px;
}

.achievement-row button::first-line {
  color: var(--accent-neon);
}

.achievement-row span {
  font-size: 9px;
  color: var(--text-muted);
  line-height: 1.2;
}

.settings-main-title {
  margin: 28px 0 14px;
}

.settings-list {
  display: grid;
  gap: 8px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.settings-row {
  min-height: 74px;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  background: var(--card-bg);
  color: var(--text-main);
  padding: 0 18px;
  display: grid;
  grid-template-columns: 38px 1fr auto auto;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
}

.settings-row-icon,
.settings-row i {
  color: var(--accent-neon);
  font-style: normal;
  font-size: 26px;
}

.settings-row b {
  color: var(--accent-neon);
  font-size: 15px;
  font-weight: 500;
}

.settings-row-exit,
.settings-row-exit .settings-row-icon,
.settings-row-exit i {
  color: #fb3f78;
}

.theme-switcher {
  display: flex;
  gap: 6px;
  justify-self: end;
}

.theme-switcher button {
  width: 52px;
  height: 42px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
}

.theme-switcher button.active {
  color: var(--accent-neon);
  border-color: var(--accent-neon);
  box-shadow: 0 0 18px rgba(236, 72, 153, 0.35);
}

.settings-version {
  text-align: center;
  color: var(--text-muted);
  opacity: 0.75;
  padding: 18px 0 4px;
  font-size: 12px;
}

body.theme-light .settings-profile-panel,
body.theme-light .settings-row,
body.theme-light .premium-panel,
body.theme-light .premium-benefits article,
body.theme-light .premium-plan-card {
  box-shadow: 0 12px 28px rgba(236, 72, 153, 0.13);
}

body.theme-light .premium-hero::after {
  background: linear-gradient(180deg, transparent, rgba(255, 248, 238, 0.72));
}

body.theme-light .sub-nav,
body.theme-light .bottom-nav,
body.theme-light .catalog-tabs,
body.theme-light .catalog-card,
body.theme-light .npc-card,
body.theme-light .story-card,
body.theme-light .story-detail,
body.theme-light .story-feature-grid article,
body.theme-light .story-tip,
body.theme-light .character-sheet-panel,
body.theme-light .section-container,
body.theme-light .gameplay-section,
body.theme-light .form-group,
body.theme-light .slider-group,
body.theme-light .segmented-group,
body.theme-light .storage-panel,
body.theme-light .saved-character-card {
  background-color: rgba(255, 252, 247, 0.82);
  color: var(--text-main);
}

body.theme-light .catalog-card-overlay,
body.theme-light .npc-card-overlay,
body.theme-light .story-card-overlay,
body.theme-light .saved-character-card::after {
  background: linear-gradient(180deg, transparent, rgba(255, 248, 238, 0.92));
}

body.theme-light .catalog-card-overlay strong,
body.theme-light .npc-card-overlay strong,
body.theme-light .story-card-overlay strong,
body.theme-light .story-detail-copy h1,
body.theme-light .story-meta-list b,
body.theme-light .story-feature-grid b,
body.theme-light .saved-character-body strong,
body.theme-light .premium-benefits b,
body.theme-light .premium-hero-content strong {
  color: var(--text-main);
}

body.theme-light .catalog-card-overlay span,
body.theme-light .npc-card-overlay span,
body.theme-light .story-card-overlay small,
body.theme-light .story-detail-copy p,
body.theme-light .story-info-block p,
body.theme-light .story-tip p,
body.theme-light .story-feature-grid p,
body.theme-light .saved-character-body span,
body.theme-light .premium-benefits small,
body.theme-light .premium-hero-content span {
  color: var(--text-muted);
}

@media (max-width: 430px) {
  .settings-view {
    padding: 12px;
  }

  .settings-profile-top {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .settings-profile-info {
    width: 100%;
  }

  .settings-name-input {
    text-align: center;
  }

  .achievement-row {
    grid-template-columns: repeat(3, 1fr);
  }

  .settings-row {
    font-size: 16px;
    grid-template-columns: 34px 1fr auto auto;
  }
}

@media (max-width: 430px) {
  .premium-view {
    padding: 12px;
  }

  .premium-panel {
    padding: 12px;
  }

  .premium-title-row {
    grid-template-columns: 38px 1fr 38px;
  }

  .premium-title-row h2 {
    font-size: 16px;
  }

  .premium-hero-content {
    grid-template-columns: 1fr;
  }

  .premium-activate {
    width: 100%;
  }

  .premium-benefits {
    grid-template-columns: repeat(2, 1fr);
  }

  .premium-plans,
  .premium-footer-links {
    grid-template-columns: 1fr;
  }

  .premium-plan-card ul {
    min-height: 0;
  }

  .premium-footer-links div {
    justify-items: start;
  }
}

.sheet-open {
  overflow: hidden;
}

.character-sheet {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: none;
}

.character-sheet.open {
  display: block;
}

.character-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 0, 8, 0.76);
  backdrop-filter: blur(12px);
}

.character-sheet-panel {
  position: absolute;
  inset: 12px;
  max-width: 480px;
  margin: 0 auto;
  border: 1px solid rgba(168, 85, 247, 0.42);
  border-radius: 18px;
  background: rgba(5, 7, 18, 0.96);
  box-shadow: 0 0 34px rgba(147, 51, 234, 0.34);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sheet-topbar {
  min-height: 54px;
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(168, 85, 247, 0.26);
  background: rgba(9, 13, 30, 0.72);
}

.sheet-close,
.sheet-x {
  border: none;
  background: transparent;
  color: var(--accent-neon);
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
}

.sheet-close {
  font-size: 42px;
  line-height: 1;
}

.sheet-x {
  font-size: 28px;
}

.sheet-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  gap: 2px;
  color: rgba(243, 232, 255, 0.62);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.sheet-tabs span {
  padding: 12px 2px;
  border-bottom: 2px solid transparent;
}

.sheet-tabs .active {
  color: #fff;
  border-bottom-color: var(--accent-pink);
  text-shadow: 0 0 12px rgba(192, 132, 252, 0.65);
}

.sheet-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 96px;
}

.sheet-hero {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 16px;
  align-items: start;
}

.sheet-identity h2 {
  color: #fff;
  font-size: 38px;
  line-height: 1;
  font-weight: 700;
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.28);
  margin: 8px 0 18px;
}

.sheet-identity h2::after {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-left: 12px;
  border-radius: 50%;
  background: var(--accent-purple);
  box-shadow: 0 0 10px var(--accent-purple);
  vertical-align: middle;
}

.sheet-identity p {
  color: rgba(243, 232, 255, 0.86);
  font-size: 13px;
  line-height: 1.5;
}

.sheet-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.sheet-tags span {
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 10px;
  background: rgba(147, 51, 234, 0.12);
  color: rgba(243, 232, 255, 0.86);
  padding: 8px 10px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.sheet-identity blockquote {
  margin: 0;
  border: 1px solid rgba(168, 85, 247, 0.24);
  border-radius: 12px;
  background: rgba(10, 16, 32, 0.68);
  color: rgba(243, 232, 255, 0.88);
  padding: 18px;
  font-size: 14px;
  line-height: 1.55;
}

.sheet-identity blockquote::before {
  content: "“";
  display: block;
  color: var(--accent-purple);
  font-size: 30px;
  line-height: 1;
  font-weight: 800;
}

.sheet-portrait-wrap {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(168, 85, 247, 0.42);
  background: rgba(12, 7, 26, 0.8);
}

.sheet-portrait-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sheet-heart {
  position: absolute;
  top: 12px;
  right: 14px;
  color: #fff;
  font-size: 34px;
  line-height: 1;
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.8);
}

.sheet-section {
  margin-top: 20px;
}

.sheet-section h3,
.sheet-card h3 {
  color: var(--accent-neon);
  font-size: 16px;
  letter-spacing: 0.8px;
  font-weight: 700;
  margin-bottom: 12px;
}

.sheet-section p {
  color: rgba(243, 232, 255, 0.86);
  font-size: 14px;
  line-height: 1.65;
}

.sheet-two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.sheet-card {
  border: 1px solid rgba(168, 85, 247, 0.24);
  border-radius: 14px;
  background: rgba(9, 15, 32, 0.68);
  padding: 14px;
}

.sheet-stat {
  display: grid;
  grid-template-columns: minmax(78px, 0.8fr) 1fr 40px;
  align-items: center;
  gap: 10px;
  color: rgba(243, 232, 255, 0.86);
  font-size: 12px;
  margin: 12px 0;
}

.sheet-stat-bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(39, 43, 70, 0.95);
  overflow: hidden;
}

.sheet-stat-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-neon));
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.8);
}

.sheet-stat b {
  color: #fff;
  text-align: right;
}

.sheet-preferences {
  display: grid;
  gap: 12px;
}

.sheet-preferences div {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sheet-preferences div:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.sheet-preferences b {
  color: #fff;
  font-size: 12px;
}

.sheet-preferences span {
  color: rgba(243, 232, 255, 0.72);
  font-size: 12px;
  line-height: 1.35;
}

.sheet-actions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px 16px;
  background: linear-gradient(180deg, rgba(5, 7, 18, 0), rgba(5, 7, 18, 0.98) 35%);
}

.sheet-chat-btn {
  width: 100%;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #6d28ff, rgba(147, 51, 234, 0.72));
  color: #fff;
  padding: 15px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.4px;
  box-shadow: 0 0 24px rgba(147, 51, 234, 0.65);
  cursor: pointer;
}

@media (max-width: 430px) {
  .character-sheet-panel {
    inset: 8px;
  }

  .sheet-content {
    padding: 14px 14px 92px;
  }

  .sheet-hero {
    grid-template-columns: 1fr;
  }

  .sheet-portrait-wrap {
    order: -1;
    max-height: 430px;
  }

  .sheet-two-columns {
    grid-template-columns: 1fr;
  }

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

  .story-card-overlay strong {
    font-size: 13px;
  }

  .story-card-overlay small {
    font-size: 7px;
  }

  .story-detail-hero,
  .story-info-block,
  .story-feature-grid,
  .story-actions {
    grid-template-columns: 1fr;
  }

  .story-detail-hero {
    min-height: 0;
  }

  .story-detail-hero::after {
    background: linear-gradient(180deg, rgba(3, 7, 18, 0.92), rgba(3, 7, 18, 0.68), rgba(3, 7, 18, 0.96));
  }

  .story-detail-copy h1 {
    font-size: 34px;
  }

  .story-detail-hero img {
    height: 300px;
  }

  .sheet-identity h2 {
    font-size: 34px;
  }
}

@media (max-width: 370px) {
  .catalog-grid,
  .npc-grid,
  .story-grid {
    gap: 10px 8px;
  }

  .catalog-card-overlay strong,
  .npc-card-overlay strong,
  .story-card-overlay strong {
    font-size: 14px;
  }

  .catalog-card-overlay span,
  .npc-card-overlay span,
  .story-card-overlay small {
    font-size: 7px;
  }

  .npc-badge {
    font-size: 7px;
    padding: 4px 6px;
  }
}

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0; right: 0;
  max-width: 480px;
  margin: 0 auto;
  height: 62px;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
}

.nav-item {
  color: var(--text-muted);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  gap: 3px;
  transition: all 0.2s ease;
}

.nav-item.active {
  color: var(--accent-neon);
  filter: drop-shadow(0 0 8px var(--accent-neon));
}

/* Toast Notification */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--card-bg);
  border: 1px solid var(--accent-neon);
  box-shadow: 0 0 15px rgba(192, 132, 252, 0.5);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 600;
  backdrop-filter: blur(10px);
  animation: slideDown 0.3s ease-out forwards;
  opacity: 0;
  transform: translateY(-20px);
}

@keyframes slideDown {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
