/* ═══════════════════════════════════════════
   AETHELGARD RPG — Stili Fantasy v2
   Stelle parallax, animazioni, glow, card
   ═══════════════════════════════════════════ */

/* ── Font ─────────────────────────────────── */
.font-medieval { font-family: 'MedievalSharp', cursive; }
.font-sans     { font-family: 'Inter', system-ui, sans-serif; }

/* ── Stelle animate (parallax) ──────────── */
.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #fbbf24;
  border-radius: 50%;
  animation: twinkle 2s ease-in-out infinite alternate;
  will-change: transform;
}

.star-sm { width: 1px; height: 1px; opacity: 0.6; }
.star-lg { width: 3px; height: 3px; opacity: 0.9; }

@keyframes twinkle {
  0%   { opacity: 0.2; transform: scale(1); }
  100% { opacity: 1;   transform: scale(1.5); }
}

/* ── Sfondo cielo ───────────────────────── */
#sky-bg {
  background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
  overflow: hidden;
}

/* ── Landing background ─────────────────── */
.landing-bg {
  background-image: url('../images/aetheria_city_night.jpg');
  background-size: cover;
  background-position: center;
}

.landing-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,14,23,0.4) 0%, rgba(10,14,23,0.85) 60%, rgba(10,14,23,0.98) 100%);
  z-index: 0;
}

.landing-content {
  z-index: 1;
}

/* ── Landing title glow ─────────────────── */
.landing-title {
  text-shadow: 0 0 20px rgba(212,168,83,0.3), 0 0 60px rgba(212,168,83,0.15), 0 0 120px rgba(212,168,83,0.05);
  letter-spacing: 0.05em;
}

.landing-subtitle {
  animation-delay: 0.3s;
}

/* ── Landing buttons ────────────────────── */
.landing-btn {
  padding: 0.75rem 2.5rem;
  border-radius: 0.75rem;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.landing-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left 0.5s;
}

.landing-btn:hover::before {
  left: 100%;
}

.landing-btn-primary {
  background: linear-gradient(135deg, #d4a853 0%, #c2983f 100%);
  color: #0a0e17;
  box-shadow: 0 4px 20px rgba(212,168,83,0.3), 0 0 0 1px rgba(212,168,83,0.2);
}

.landing-btn-primary:hover {
  box-shadow: 0 8px 32px rgba(212,168,83,0.5), 0 0 0 1px rgba(212,168,83,0.4);
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.landing-btn-secondary {
  background: transparent;
  color: #d4a853;
  border: 1.5px solid rgba(212,168,83,0.4);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.landing-btn-secondary:hover {
  background: rgba(212,168,83,0.1);
  border-color: rgba(212,168,83,0.8);
  box-shadow: 0 8px 32px rgba(212,168,83,0.2), 0 0 0 1px rgba(212,168,83,0.3);
  transform: translateY(-2px);
}

/* ── Loader ──────────────────────────────── */
#app-loader {
  background: #0a0e17;
}

.loader-title {
  text-shadow: 0 0 20px rgba(212,168,83,0.3);
  animation: loaderPulse 2s ease-in-out infinite;
}

@keyframes loaderPulse {
  0%, 100% { opacity: 0.8; text-shadow: 0 0 20px rgba(212,168,83,0.2); }
  50%      { opacity: 1;  text-shadow: 0 0 40px rgba(212,168,83,0.5); }
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 2px solid rgba(212,168,83,0.2);
  border-top-color: #d4a853;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

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

/* ── Modali ──────────────────────────────── */
.modal-box {
  background: linear-gradient(180deg, #111827 0%, #0d1117 100%);
  border: 1px solid rgba(212,168,83,0.25);
  border-radius: 1.25rem;
  box-shadow: 0 0 0 1px rgba(212,168,83,0.05), 0 24px 80px rgba(0,0,0,0.6), 0 0 60px rgba(212,168,83,0.05);
  animation: modalSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.modal-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,168,83,0.5), transparent);
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  width: 2rem; height: 2rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: rgba(156, 163, 175, 0.6);
  font-size: 1.25rem;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  background: none;
}

.modal-close:hover {
  color: #fff;
  background: rgba(255,255,255,0.05);
}

/* Modal crystal icon */
.modal-crystal {
  width: 48px; height: 48px;
  margin: 0 auto 0.75rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(212,168,83,0.15), rgba(168,85,247,0.1));
  border: 1px solid rgba(212,168,83,0.2);
  font-size: 1.5rem;
  color: #d4a853;
  text-shadow: 0 0 12px rgba(212,168,83,0.4);
}

/* ── Input oro bottom-border ─────────────── */
.input-gold {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid rgba(212,168,83,0.25);
  border-radius: 0;
  padding: 0.75rem 0;
  color: #e5e7eb;
  font-size: 0.9375rem;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.input-gold::placeholder {
  color: rgba(156, 163, 175, 0.5);
  font-style: italic;
}

.input-gold:focus {
  border-bottom-color: #d4a853;
  box-shadow: 0 2px 0 -1px rgba(212,168,83,0.3);
}

/* ── Bottone submit gradient ─────────────── */
.btn-gold-gradient {
  width: 100%;
  padding: 0.875rem;
  background: linear-gradient(135deg, #d4a853 0%, #c2983f 50%, #d4a853 100%);
  background-size: 200% 100%;
  color: #0a0e17;
  border: none;
  border-radius: 0.75rem;
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 16px rgba(212,168,83,0.25);
  position: relative;
  overflow: hidden;
}

.btn-gold-gradient:hover {
  background-position: 100% 0;
  box-shadow: 0 6px 24px rgba(212,168,83,0.4);
  transform: translateY(-1px);
}

.btn-gold-gradient:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Link modali ─────────────────────────── */
.modal-link {
  color: rgba(212,168,83,0.7);
  text-decoration: none;
  border-bottom: 1px solid rgba(212,168,83,0.2);
  padding-bottom: 1px;
  transition: all 0.2s;
  font-size: 0.8125rem;
}

.modal-link:hover {
  color: #d4a853;
  border-bottom-color: rgba(212,168,83,0.6);
}

.modal-link-alt {
  color: rgba(156, 163, 175, 0.6);
  font-size: 0.6875rem;
  transition: color 0.2s;
  background: none; border: none; cursor: pointer;
}

.modal-link-alt:hover {
  color: rgba(209, 213, 219, 0.9);
}

/* ── Verify modal email icon ─────────────── */
.verify-icon {
  width: 64px; height: 64px;
  margin: 0 auto 1rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(212,168,83,0.1), rgba(168,85,247,0.05));
  border: 1.5px solid rgba(212,168,83,0.2);
  font-size: 2rem;
  animation: verifyPulse 2s ease-in-out infinite;
}

@keyframes verifyPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212,168,83,0.2); }
  50%      { box-shadow: 0 0 20px 4px rgba(212,168,83,0.1); }
}

/* ── Toast eleganti ──────────────────────── */
#toast-container {
  position: fixed;
  top: 1rem; right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 0.875rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  color: #fff;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  max-width: 320px;
}

.toast::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 3px; height: 100%;
}

.toast-success {
  background: rgba(16, 30, 20, 0.95);
  border: 1px solid rgba(74, 222, 128, 0.25);
}
.toast-success::before { background: linear-gradient(180deg, #4ade80, #22c55e); }

.toast-error {
  background: rgba(30, 16, 16, 0.95);
  border: 1px solid rgba(248, 113, 113, 0.25);
}
.toast-error::before { background: linear-gradient(180deg, #f87171, #ef4444); }

.toast-info {
  background: rgba(16, 20, 35, 0.95);
  border: 1px solid rgba(96, 165, 250, 0.25);
}
.toast-info::before { background: linear-gradient(180deg, #60a5fa, #3b82f6); }

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastFadeOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(40px); }
}

.toast.hiding {
  animation: toastFadeOut 0.3s ease-in forwards;
}

/* ── Card fantasy ────────────────────────── */
.card-fantasy {
  background: linear-gradient(180deg, #111827 0%, #0d1117 100%);
  border: 1px solid rgba(212,168,83,0.1);
  border-radius: 1rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card-fantasy::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,168,83,0.15), transparent);
  opacity: 0;
  transition: opacity 0.4s;
}

.card-fantasy:hover {
  border-color: rgba(212,168,83,0.25);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 20px rgba(212,168,83,0.05);
  transform: translateY(-2px);
}

.card-fantasy:hover::before {
  opacity: 1;
}

/* ── Animazioni globali ──────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ── Scrollbar minimal dark ──────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #111827; }
::-webkit-scrollbar-thumb { background: #374151; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #4b5563; }

#mainContent::-webkit-scrollbar { width: 6px; }
#mainContent::-webkit-scrollbar-track { background: #0d1117; }
#mainContent::-webkit-scrollbar-thumb { background: #374151; border-radius: 3px; }
#mainContent::-webkit-scrollbar-thumb:hover { background: #4b5563; }

/* ── Sidebar hover fluida ───────────────── */
#sidebar button,
#sidebar a {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

#sidebar button::after,
#sidebar a::after {
  content: '';
  position: absolute;
  left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 0;
  background: linear-gradient(180deg, #d4a853, #a855f7);
  border-radius: 2px;
  transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#sidebar button:hover,
#sidebar a:hover {
  background: rgba(212,168,83,0.08);
  color: #d4a853;
}

#sidebar button:hover::after,
#sidebar a:hover::after {
  height: 60%;
}

/* ── Fade-in pannelli dashboard ─────────── */
#mainContent > * {
  animation: panelFadeIn 0.3s ease-out;
}

@keyframes panelFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Hover cards wizard ─────────────────── */
.race-card:hover,
.class-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(212,168,83,0.15), 0 0 0 1px rgba(212,168,83,0.1);
}

/* ── Stat progress bars ──────────────────── */
.stat-bar-bg {
  background: rgba(26,31,46,0.8);
  border-radius: 9999px;
  height: 6px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Chat bubbles ────────────────────────── */
.chat-bubble {
  max-width: 80%;
  padding: 0.625rem 1rem;
  border-radius: 1rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  position: relative;
  word-wrap: break-word;
}

.chat-bubble-own {
  background: linear-gradient(135deg, rgba(212,168,83,0.15), rgba(212,168,83,0.05));
  border: 1px solid rgba(212,168,83,0.15);
  border-bottom-right-radius: 0.25rem;
  color: #f3f4f6;
  margin-left: auto;
}

.chat-bubble-other {
  background: rgba(17,24,39,0.8);
  border: 1px solid rgba(255,255,255,0.06);
  border-bottom-left-radius: 0.25rem;
  color: #d1d5db;
}

.chat-bubble-system {
  background: rgba(168,85,247,0.08);
  border: 1px solid rgba(168,85,247,0.15);
  color: #c4b5fd;
  text-align: center;
  font-style: italic;
  font-size: 0.75rem;
}

.chat-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(212,168,83,0.2), rgba(168,85,247,0.1));
  border: 1px solid rgba(212,168,83,0.2);
  color: #d4a853;
}

/* ── Topbar brand ────────────────────────── */
.topbar-brand {
  display: flex; align-items: center; gap: 0.75rem;
}

.topbar-brand img {
  width: 36px; height: 36px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(212,168,83,0.25);
}

.topbar-brand span {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.125rem;
  color: #d4a853;
  letter-spacing: 0.02em;
}

/* ── Location header immersive ──────────── */
.location-header {
  position: relative;
  background: linear-gradient(135deg, rgba(212,168,83,0.08), rgba(168,85,247,0.03));
  border: 1px solid rgba(212,168,83,0.12);
  border-radius: 1rem;
  overflow: hidden;
}

.location-header::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 200px; height: 100%;
  background: radial-gradient(ellipse at top right, rgba(212,168,83,0.06), transparent 70%);
  pointer-events: none;
}

/* ── Transizioni interattive ────────────── */
button, a, input, select, textarea {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Responsive ──────────────────────────── */
@media (max-width: 640px) {
  .race-card, .class-card { padding: 1rem; }
  .landing-title { font-size: 2.5rem !important; }
  .landing-subtitle { font-size: 0.75rem !important; letter-spacing: 0.15em !important; }
  .landing-btn { padding: 0.625rem 1.75rem; font-size: 0.875rem; }
}
