/* AnimeForge Adventures — Components (Full Redesign) */

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  background: linear-gradient(135deg, #F472B6 0%, #EC4899 50%, #DB2777 100%);
  color: white;
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--text-base);
  letter-spacing: 0.02em;
  box-shadow: 0 4px 20px rgba(244, 114, 182, 0.4), inset 0 1px 0 rgba(255,255,255,0.15);
  transition: all var(--transition-normal);
  min-height: 48px;
  min-width: 48px;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(244, 114, 182, 0.5), inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn-primary:hover::before { opacity: 1; }
.btn-primary:active { transform: translateY(0); }
.btn-primary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-sakura-dim), 0 4px 20px rgba(244, 114, 182, 0.4); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; filter: grayscale(0.3); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  background: transparent;
  border: 1.5px solid var(--accent-sakura);
  color: var(--accent-sakura);
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: var(--text-base);
  transition: all var(--transition-normal);
  min-height: 48px;
  min-width: 48px;
}

.btn-secondary:hover {
  background: var(--accent-sakura-dim);
  border-color: var(--accent-sakura);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(244, 114, 182, 0.15);
}

.btn-secondary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-sakura-dim); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  background: transparent;
  color: var(--text-secondary);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
  min-height: 44px;
  min-width: 44px;
}

.btn-ghost:hover { color: var(--text-primary); background: rgba(244, 114, 182, 0.08); }
.btn-ghost:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent-sakura); }

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 24px;
  position: relative;
  transition: all var(--transition-normal);
}

.card--interactive { cursor: pointer; }
.card--interactive:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-bloom);
  border-color: var(--border-strong);
}

.card--accented { border-color: var(--border-strong); }
.card--accented::before, .card--accented::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--accent-gold);
  border-style: solid;
  opacity: 0.6;
}
.card--accented::before { top: 10px; left: 10px; border-width: 2px 0 0 2px; }
.card--accented::after { bottom: 10px; right: 10px; border-width: 0 2px 2px 0; }

/* ===== DIALOGUE BOX ===== */
.dialogue-box {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  min-height: 200px;
  max-height: 300px;
  background: linear-gradient(180deg, rgba(11, 7, 18, 0.75) 0%, rgba(11, 7, 18, 0.95) 100%);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border-top: 2px solid rgba(244, 114, 182, 0.4);
  padding: 24px 32px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  z-index: var(--z-overlay);
  display: flex;
  flex-direction: column;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
}

.dialogue-box__speaker-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--accent-sakura);
  margin-bottom: var(--space-sm);
  text-shadow: 0 0 20px rgba(244, 114, 182, 0.3);
}

.dialogue-box__text {
  font-size: var(--text-lg);
  line-height: 1.8;
  flex: 1;
  overflow-y: auto;
  color: var(--text-primary);
}

.dialogue-box__advance {
  position: absolute;
  bottom: 20px;
  right: 28px;
  font-size: var(--text-2xl);
  color: var(--accent-sakura);
  animation: pulse-advance 1.2s ease-in-out infinite;
}

/* ===== CHOICE PANEL ===== */
.choice-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: var(--space-md) 0;
  max-height: 240px;
  overflow-y: auto;
}

.choice-panel__button {
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px 22px;
  color: var(--text-primary);
  font-weight: 500;
  text-align: left;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 48px;
  position: relative;
  overflow: hidden;
}

.choice-panel__button::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent-sakura);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.choice-panel__button:hover {
  border-color: var(--accent-sakura);
  background: rgba(244, 114, 182, 0.06);
  transform: translateX(4px);
}

.choice-panel__button:hover::before { opacity: 1; }
.choice-panel__button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-sakura-dim); }
.choice-panel__button-cost { font-size: var(--text-xs); color: var(--text-muted); margin-top: 4px; }

/* ===== STAT BARS ===== */
.stat-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.stat-bar__icon { font-size: var(--text-lg); width: 24px; text-align: center; }

.stat-bar__track {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.stat-bar__fill {
  height: 100%;
  border-radius: 999px;
  transition: width 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.stat-bar__fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 20px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
  border-radius: 999px;
}

.stat-bar__fill--energy { background: linear-gradient(90deg, #0EA5E9, var(--res-energy)); }
.stat-bar__fill--mood { background: linear-gradient(90deg, #EC4899, var(--res-mood)); }
.stat-bar__fill--money { background: linear-gradient(90deg, #D97706, var(--res-money)); }
.stat-bar__fill--rep { background: linear-gradient(90deg, #7C3AED, var(--res-rep)); }
.stat-bar__value { font-size: var(--text-xs); color: var(--text-secondary); min-width: 32px; text-align: right; font-weight: 600; }

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-overlay--active { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-bloom), 0 24px 48px rgba(0,0,0,0.4);
  padding: var(--space-xl) var(--space-xl) var(--space-lg);
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
}

.modal__title { font-family: var(--font-display); font-size: var(--text-2xl); margin-bottom: var(--space-md); }
.modal__body { color: var(--text-secondary); margin-bottom: var(--space-lg); line-height: 1.7; }
.modal__actions { display: flex; gap: var(--space-md); justify-content: flex-end; }

/* ===== TOASTS ===== */
.toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 22px;
  box-shadow: var(--shadow-card);
  font-size: var(--text-sm);
  color: var(--text-primary);
  transform: translateX(120%);
  transition: transform var(--transition-slow);
  max-width: 360px;
  backdrop-filter: blur(8px);
}

.toast--visible { transform: translateX(0); }
.toast--error { border-left: 3px solid #EF4444; }
.toast--success { border-left: 3px solid var(--accent-jade); }

/* ===== PROGRESS BAR ===== */
.progress-bar {
  display: flex;
  gap: 6px;
  margin-bottom: var(--space-xl);
}

.progress-bar__step {
  flex: 1;
  height: 5px;
  background: var(--bg-elevated);
  border-radius: 999px;
  transition: all var(--transition-normal);
}

.progress-bar__step--active {
  background: linear-gradient(90deg, var(--accent-sakura), #EC4899);
  box-shadow: 0 0 8px rgba(244, 114, 182, 0.4);
}

.progress-bar__step--completed { background: var(--accent-jade); }

/* ===== PILLS ===== */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: 500;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 36px;
}

.pill:hover {
  border-color: var(--accent-sakura);
  color: var(--accent-sakura);
  background: var(--accent-sakura-dim);
}

.pill--selected {
  background: linear-gradient(135deg, var(--accent-sakura), #EC4899);
  color: white;
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(244, 114, 182, 0.3);
}

/* ===== FORM GROUPS ===== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: var(--space-lg);
}

.form-group__label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.form-group__error { font-size: var(--text-xs); color: #F87171; font-weight: 500; }
.char-counter { font-size: var(--text-xs); color: var(--text-muted); text-align: right; }

/* ===== SKELETON ===== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-elevated) 50%, var(--bg-surface) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
