.hs-card {
  position: relative;
  width: 180px;
  aspect-ratio: 3/4;
  border-radius: var(--radius-lg);
  background: var(--gradient-card);
  border: 3px solid var(--color-gold);
  box-shadow: var(--shadow-lg), var(--shadow-gold);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s var(--transition-bounce), box-shadow 0.3s ease;
}

.hs-card:hover {
  transform: translateY(-15px) scale(1.08);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(255, 215, 0, 0.5);
}

.hs-card.protagonist {
  border-color: var(--color-gold);
  box-shadow: var(--shadow-lg), 0 0 15px rgba(255, 215, 0, 0.3);
}

.hs-card.antagonist {
  border-color: var(--color-crimson);
  box-shadow: var(--shadow-lg), 0 0 15px rgba(139, 0, 0, 0.3);
}

.hs-card.supporter {
  border-color: var(--color-silver);
  box-shadow: var(--shadow-lg), 0 0 15px rgba(192, 192, 192, 0.3);
}

.hs-card.npc {
  border-color: var(--color-gray);
}

.hs-card-avatar {
  width: 100%;
  height: 65%;
  overflow: hidden;
  background: linear-gradient(135deg, #2a2a4a 0%, #1a1a2e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hs-card-avatar img {
  width: 80%;
  height: 80%;
  object-fit: contain;
}

.hs-card-avatar .avatar-placeholder {
  font-size: 64px;
  opacity: 0.5;
}

.hs-card-name {
  position: absolute;
  bottom: 25%;
  left: 0;
  right: 0;
  padding: var(--spacing-sm) var(--spacing-md);
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.8) 100%);
  font-family: var(--font-title);
  font-size: 14px;
  font-weight: bold;
  color: var(--color-gold);
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.hs-card-gems {
  position: absolute;
  bottom: var(--spacing-sm);
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: var(--spacing-sm);
}

.hs-card-gems .gem {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #333 0%, #222 100%);
  border: 2px solid var(--color-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.parchment {
  position: relative;
  background: var(--color-parchment);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  background-blend-mode: multiply;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg), inset 0 0 50px rgba(139, 90, 43, 0.2);
  padding: var(--spacing-xl);
  color: #2a1810;
}

.parchment::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(139, 90, 43, 0.3) 100%);
  pointer-events: none;
}

.parchment-edge {
  position: absolute;
  width: 30px;
  height: 30px;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0 Q15 5 30 0 L30 30 Q15 25 0 30 Z' fill='%23f4e4bc'/%3E%3C/svg%3E") no-repeat;
}

.parchment-edge.top-left {
  top: -5px;
  left: -5px;
  transform: rotate(-45deg);
}

.parchment-edge.top-right {
  top: -5px;
  right: -5px;
  transform: rotate(45deg);
}

.parchment-edge.bottom-left {
  bottom: -5px;
  left: -5px;
  transform: rotate(-135deg);
}

.parchment-edge.bottom-right {
  bottom: -5px;
  right: -5px;
  transform: rotate(135deg);
}

.scroll {
  position: relative;
  background: var(--color-parchment);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.scroll-handle {
  height: 20px;
  background: linear-gradient(90deg, #8B4513 0%, #A0522D 50%, #8B4513 100%);
  border-radius: 10px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.scroll-handle.top {
  margin-bottom: -10px;
  z-index: 1;
}

.scroll-handle.bottom {
  margin-top: -10px;
  z-index: 1;
}

.scroll-content {
  padding: var(--spacing-xl);
  min-height: 100px;
}

.scroll.collapsed .scroll-content {
  max-height: 0;
  padding: 0 var(--spacing-xl);
  opacity: 0;
  transition: all 0.6s ease-out;
}

.scroll.expanded .scroll-content {
  max-height: 500px;
  opacity: 1;
  transition: all 0.6s ease-out;
}

.wax-seal-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--spacing-md);
}

.wax-seal {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #C41E3A 0%, #8B0000 50%, #5C0000 100%);
  box-shadow: 
    0 4px 8px rgba(0, 0, 0, 0.4),
    inset 0 2px 4px rgba(255, 255, 255, 0.2),
    0 0 0 3px var(--color-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.wax-seal:hover {
  transform: scale(1.05);
}

.wax-seal:active {
  animation: waxSealPress 0.3s ease;
}

.wax-seal-icon {
  font-size: 32px;
  color: var(--color-gold);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.wax-seal-text {
  font-family: var(--font-title);
  font-size: 14px;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.book-3d {
  position: relative;
  width: 150px;
  height: 200px;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.5s var(--transition-bounce);
}

.book-3d:hover {
  transform: translateY(-20px) rotateY(-30deg);
}

.book-cover {
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #4a3728 0%, #2a1810 100%);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.book-cover::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 10px;
  background: linear-gradient(90deg, rgba(0,0,0,0.3) 0%, transparent 100%);
}

.book-cover img {
  width: 80%;
  height: 70%;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.book-spine {
  position: absolute;
  left: -15px;
  width: 15px;
  height: 100%;
  background: linear-gradient(90deg, #3a2718 0%, #2a1810 100%);
  transform: rotateY(-90deg) translateX(-7.5px);
  transform-origin: right center;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.book-pages {
  position: absolute;
  right: -10px;
  width: 10px;
  height: 95%;
  top: 2.5%;
  background: repeating-linear-gradient(
    90deg,
    #f5f5f0 0px,
    #f5f5f0 1px,
    #e8e8e0 1px,
    #e8e8e0 2px
  );
  transform: rotateY(90deg) translateX(5px);
  transform-origin: left center;
}

.book-title {
  position: absolute;
  bottom: 10%;
  left: 10%;
  right: 10%;
  font-family: var(--font-title);
  font-size: 12px;
  color: var(--color-gold);
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.book-tag {
  position: absolute;
  padding: 2px 8px;
  background: var(--color-gold);
  color: #1a1a2e;
  font-size: 10px;
  font-weight: bold;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) var(--spacing-xl);
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary {
  background: var(--gradient-gold);
  color: #1a1a2e;
  box-shadow: var(--shadow-md), var(--shadow-gold);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg), var(--shadow-gold-strong);
}

.btn-secondary {
  background: transparent;
  color: var(--color-gold);
  border: 2px solid var(--color-gold);
}

.btn-secondary:hover {
  background: rgba(255, 215, 0, 0.1);
  transform: translateY(-3px);
}

.btn-3d {
  position: relative;
  background: linear-gradient(180deg, #FFD700 0%, #B8860B 100%);
  color: #1a1a2e;
  border: none;
  border-radius: var(--radius-md);
  box-shadow: 
    0 4px 0 #8B6914,
    0 6px 10px rgba(0, 0, 0, 0.4);
  transition: all 0.1s ease;
}

.btn-3d:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 6px 0 #8B6914,
    0 8px 15px rgba(0, 0, 0, 0.4);
}

.btn-3d:active {
  transform: translateY(2px);
  box-shadow: 
    0 2px 0 #8B6914,
    0 4px 5px rgba(0, 0, 0, 0.4);
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(15, 15, 35, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-xl);
  z-index: var(--z-sticky);
}

.navbar-brand {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: bold;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

.navbar-link {
  color: var(--color-text);
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: 14px;
  transition: color 0.3s ease;
}

.navbar-link:hover {
  color: var(--color-gold);
}

.particles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--color-gold);
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat linear infinite;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 215, 0, 0.3);
  border-top-color: var(--color-gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--gradient-card);
  border: 2px solid var(--color-gold);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  max-width: 500px;
  width: 90%;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-label {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-family: var(--font-title);
  font-size: 14px;
  color: var(--color-gold);
}

.form-input {
  width: 100%;
  padding: var(--spacing-md);
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 215, 0, 0.3);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  transition: all 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

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

.chapter-toc {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0;
}

.chapter-toc-item {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  background: rgba(139, 90, 43, 0.05);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.chapter-toc-item:hover {
  background: rgba(139, 90, 43, 0.15);
}

.chapter-toc-item .chapter-number {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  color: #D4AF37;
  min-width: 80px;
  flex-shrink: 0;
}

.chapter-toc-item .chapter-dots {
  flex: 1;
  border-bottom: 2px dotted rgba(139, 90, 43, 0.4);
  margin: 0 10px;
  height: 1px;
}

.chapter-toc-item .chapter-title {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  color: #2a1810;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.chapter-toc-item .chapter-status-icon {
  font-size: 14px;
  margin-left: 10px;
  flex-shrink: 0;
}

.chapter-toc-item.read .chapter-status-icon {
  color: #D4AF37;
}

.chapter-toc-item.current {
  background: rgba(139, 90, 43, 0.2);
  border-left: 3px solid #D4AF37;
}

.chapter-toc-item.current .chapter-status-icon {
  color: #8B4513;
  font-size: 16px;
  animation: inkDropPulse 2s ease-in-out infinite;
}

.chapter-toc-item.locked {
  opacity: 0.6;
  cursor: not-allowed;
}

.chapter-toc-item.locked .chapter-status-icon {
  color: #8B0000;
  font-size: 14px;
}

.chapter-toc-item.locked .chapter-title {
  color: #6a4a2a;
}

.chapter-toc-item.locked::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 50px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  background: radial-gradient(circle at 30% 30%, #C41E3A 0%, #8B0000 50%, #5C0000 100%);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  opacity: 0.8;
}

.hs-card-mini {
  width: 150px;
  height: 200px;
  aspect-ratio: 3/4;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(22, 33, 62, 0.95) 100%);
  border: 2px solid #FFD700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
  position: relative;
}

.hs-card-mini:hover {
  transform: translateY(-15px) rotate(-3deg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 215, 0, 0.3);
  z-index: 10;
}

.hs-card-mini.protagonist {
  border-color: #FFD700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.hs-card-mini.antagonist {
  border-color: #8B0000;
  box-shadow: 0 0 10px rgba(139, 0, 0, 0.2);
}

.hs-card-mini.antagonist:hover {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(139, 0, 0, 0.4);
}

.hs-card-mini.supporter {
  border-color: #C0C0C0;
  box-shadow: 0 0 10px rgba(192, 192, 192, 0.2);
}

.hs-card-mini.supporter:hover {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(192, 192, 192, 0.3);
}

.hs-card-mini.npc {
  border-color: #666666;
}

.hs-card-mini.plot-card {
  background: linear-gradient(135deg, rgba(80, 20, 20, 0.95) 0%, rgba(60, 10, 10, 0.95) 100%);
  border-color: #8B0000;
}

.hs-card-mini.plot-card:hover {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(139, 0, 0, 0.4);
}

.modal-card-content {
  position: relative;
  max-width: 400px;
  width: 90%;
  transform: scale(0.9);
  transition: transform 0.4s ease;
}

.modal-overlay.active .modal-card-content {
  transform: scale(1);
}

.modal-close-btn {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: #f4e4bc;
  font-size: 30px;
  cursor: pointer;
  z-index: 100;
  transition: transform 0.3s ease;
}

.modal-close-btn:hover {
  transform: scale(1.2);
}
