.questScroll {
  --scroll-primary: #d4a574;
  --scroll-accent: #8b7355;
  --scroll-seal: #c9a86c;

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Georgia', serif;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  overflow: visible;
  background: transparent;
  color: #3e2723;
  padding: 0;
  transition: transform 0.3s ease;
}

.questScroll:hover {
  transform: translateY(-3px);
}

.questScroll:active {
  transform: translateY(-1px);
}

.questScroll:focus-visible {
  outline: 2px solid var(--scroll-seal);
  outline-offset: 4px;
}

/* Sizes */
.sm {
  min-width: 120px;
}

.sm .scrollBody {
  padding: 0.4rem 1rem;
  font-size: 0.7rem;
}

.sm .seal {
  width: 16px;
  height: 16px;
}

.md {
  min-width: 160px;
}

.md .scrollBody {
  padding: 0.6rem 1.5rem;
  font-size: 0.875rem;
}

.md .seal {
  width: 20px;
  height: 20px;
}

.lg {
  min-width: 200px;
}

.lg .scrollBody {
  padding: 0.8rem 2rem;
  font-size: 1rem;
}

.lg .seal {
  width: 24px;
  height: 24px;
}

/* Scroll top (rolled part) */
.scrollTop {
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 12px;
  background: linear-gradient(180deg, var(--scroll-accent) 0%, var(--scroll-primary) 100%);
  border-radius: 6px 6px 0 0;
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.2);
  z-index: 3;
}

.scrollTop::before,
.scrollTop::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--scroll-accent), var(--scroll-primary), var(--scroll-accent));
  border-radius: 50%;
}

.scrollTop::before {
  top: -4px;
}

.scrollTop::after {
  top: -8px;
}

/* Scroll body (main content area) */
.scrollBody {
  position: relative;
  background: linear-gradient(
    180deg,
    #f5e6d3 0%,
    #e8d4b8 20%,
    #f5e6d3 40%,
    #e8d4b8 60%,
    #f5e6d3 80%,
    #e8d4b8 100%
  );
  border-left: 2px solid var(--scroll-accent);
  border-right: 2px solid var(--scroll-accent);
  box-shadow: inset 0 0 20px rgba(139, 115, 85, 0.2);
  z-index: 2;
  transition: all 0.3s ease;
  clip-path: polygon(
    0% 0%,
    5% 2%,
    10% 0%,
    15% 1%,
    90% 0%,
    95% 2%,
    100% 0%,
    100% 100%,
    95% 98%,
    90% 100%,
    10% 100%,
    5% 98%,
    0% 100%
  );
}

.questScroll:hover .scrollBody {
  box-shadow: inset 0 0 30px rgba(139, 115, 85, 0.3);
}

/* Content */
.content {
  position: relative;
  z-index: 4;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
}

/* Scroll bottom (rolled part) */
.scrollBottom {
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 12px;
  background: linear-gradient(0deg, var(--scroll-accent) 0%, var(--scroll-primary) 100%);
  border-radius: 0 0 6px 6px;
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.2);
  z-index: 3;
}

.scrollBottom::before,
.scrollBottom::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--scroll-accent), var(--scroll-primary), var(--scroll-accent));
  border-radius: 50%;
}

.scrollBottom::before {
  bottom: -4px;
}

.scrollBottom::after {
  bottom: -8px;
}

/* Wax seal */
.seal {
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--scroll-seal), var(--scroll-accent));
  box-shadow:
    inset -2px -2px 4px rgba(0, 0, 0, 0.3),
    inset 2px 2px 4px rgba(255, 255, 255, 0.2),
    0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.questScroll:hover .seal {
  box-shadow:
    inset -2px -2px 4px rgba(0, 0, 0, 0.3),
    inset 2px 2px 4px rgba(255, 255, 255, 0.2),
    0 0 15px var(--scroll-seal);
  animation: seal-glow 1.5s ease-in-out infinite;
}

@keyframes seal-glow {
  0%, 100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.2);
  }
}

.sealInner {
  width: 50%;
  height: 50%;
  border: 1px solid rgba(62, 39, 35, 0.3);
  border-radius: 50%;
}

/* Wax drips */
.waxDrips {
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  pointer-events: none;
}

.drip {
  position: absolute;
  width: 4px;
  height: 8px;
  background: linear-gradient(180deg, var(--scroll-seal), var(--scroll-accent));
  border-radius: 0 0 4px 4px;
  opacity: 0.8;
  animation: drip-fall 3s ease-in-out infinite;
  animation-delay: var(--drip-delay, 0s);
}

.drip:nth-child(1) { top: -12px; right: 2px; }
.drip:nth-child(2) { top: -8px; right: 6px; height: 6px; }
.drip:nth-child(3) { top: -10px; right: 10px; height: 10px; }
.drip:nth-child(4) { bottom: -8px; right: 4px; height: 6px; }
.drip:nth-child(5) { bottom: -12px; right: 8px; }

@keyframes drip-fall {
  0%, 100% {
    transform: scaleY(1);
    opacity: 0.8;
  }
  50% {
    transform: scaleY(1.2);
    opacity: 1;
  }
}

/* Quest status styles */

/* Available - subtle glow */
.available .seal {
  background: radial-gradient(circle at 30% 30%, var(--scroll-seal), var(--scroll-accent));
}

/* Active - pulsing seal */
.active .seal {
  animation: seal-pulse 1s ease-in-out infinite;
}

@keyframes seal-pulse {
  0%, 100% {
    transform: translateY(-50%) scale(1);
    box-shadow:
      inset -2px -2px 4px rgba(0, 0, 0, 0.3),
      inset 2px 2px 4px rgba(255, 255, 255, 0.2),
      0 2px 8px rgba(0, 0, 0, 0.3),
      0 0 10px var(--scroll-seal);
  }
  50% {
    transform: translateY(-50%) scale(1.05);
    box-shadow:
      inset -2px -2px 4px rgba(0, 0, 0, 0.3),
      inset 2px 2px 4px rgba(255, 255, 255, 0.2),
      0 2px 12px rgba(0, 0, 0, 0.3),
      0 0 20px var(--scroll-seal);
  }
}

/* Completed - checkmark */
.completed .seal::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1b5e20;
  font-size: 0.7em;
  font-weight: bold;
}

.completed .scrollBody {
  background: linear-gradient(
    180deg,
    #c8e6c9 0%,
    #a5d6a7 20%,
    #c8e6c9 40%,
    #a5d6a7 60%,
    #c8e6c9 80%,
    #a5d6a7 100%
  );
}

/* Parchment texture */
.scrollBody::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='paper'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.04' numOctaves='5' /%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.9 0 0 0 0 0.85 0 0 0 0 0.75 0 0 0 1 0' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23paper)' /%3E%3C/svg%3E");
  opacity: 0.15;
  pointer-events: none;
  mix-blend-mode: multiply;
}

/* Unroll animation on hover */
.questScroll:hover .scrollTop {
  transform: translateY(-4px);
}

.questScroll:hover .scrollBottom {
  transform: translateY(4px);
}

.scrollTop,
.scrollBottom {
  transition: transform 0.3s ease;
}
