/* Custom styles for The Five Cities */

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Body background texture — subtle radial gradients in corners for depth */
body {
  background-color: #0f1117;
  background-image:
    radial-gradient(ellipse 60% 50% at 0% 0%, rgba(99, 102, 241, 0.07) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(79, 70, 229, 0.06) 0%, transparent 70%);
}

/* Fantasy heading font application */
h1, h2, h3 {
  font-feature-settings: "liga" 1, "kern" 1;
}

/* ── Section headers with decorative underline ── */
.section-header {
  position: relative;
  display: inline-block;
  padding-bottom: 0.5rem;
}
.section-header::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, rgba(99, 102, 241, 0.7), transparent);
  border-radius: 1px;
}

/* Card hover lift with glow */
.hover-lift {
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 24px rgba(99, 102, 241, 0.15);
}

/* Enhanced card hover glow (applied via Tailwind groups too) */
a.bg-card:hover,
div.bg-card:hover {
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.1);
}

/* ── Party page — class accent bars ── */
.accent-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  border-radius: 0.75rem 0 0 0.75rem;
}
.accent-bar-druid    { background: linear-gradient(to bottom, #22c55e, #16a34a); }
.accent-bar-barbarian{ background: linear-gradient(to bottom, #ef4444, #b91c1c); }
.accent-bar-artificer{ background: linear-gradient(to bottom, #eab308, #ca8a04); }
.accent-bar-monk     { background: linear-gradient(to bottom, #94a3b8, #64748b); }
.accent-bar-warlock  { background: linear-gradient(to bottom, #a855f7, #7c3aed); }

/* ── Ability score boxes — hover glow ── */
.ability-box {
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.ability-box:hover {
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
  transform: translateY(-1px);
}

/* ── Dice roll animation ── */
@keyframes rollBounce {
  0%   { transform: scale(0.7) rotate(-8deg); opacity: 0.4; }
  60%  { transform: scale(1.1) rotate(4deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.roll-animate {
  animation: rollBounce 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Die button — larger, more satisfying press */
.die-btn {
  transition: transform 0.1s ease, border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.die-btn:hover {
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.2);
}
.die-btn:active {
  transform: scale(0.90) !important;
}

@keyframes dieBounce {
  0%   { transform: scale(1); }
  35%  { transform: scale(0.88); }
  70%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}
.die-btn.pressed {
  animation: dieBounce 0.25s ease forwards;
}

/* NPC tag tweaks */
.filter-btn.active {
  font-weight: 600;
}

/* Timeline */
.timeline-item:last-child .timeline-line {
  display: none;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #0f1117;
}
::-webkit-scrollbar-thumb {
  background: #2d3148;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #4f46e5;
}

/* Selection color */
::selection {
  background: rgba(99, 102, 241, 0.35);
  color: white;
}

/* Focus ring */
button:focus-visible, a:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Gradient text utility */
.text-gradient {
  background: linear-gradient(135deg, #818cf8, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Map container */
.map-container svg text {
  user-select: none;
}

/* Mobile nav transition */
#mobile-menu {
  transition: all 0.2s ease;
}

/* ── Mobile-specific overrides ── */
@media (max-width: 640px) {
  /* Tighter page padding */
  .sm-px-4 { padding-left: 1rem; padding-right: 1rem; }

  /* Tables scroll horizontally */
  .table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Dice buttons — 2 columns on very small screens, bigger tap targets */
  .dice-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
