@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Crimson+Text:ital,wght@0,400;0,600;1,400&family=Inter:wght@300;400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg0: #06060f;
  --bg1: #0c0c1e;
  --bg2: #13132a;
  --bg3: #1b1b38;
  --bg4: #242448;
  --surface: rgba(255,255,255,0.04);
  --surface-h: rgba(255,255,255,0.08);
  --border: rgba(255,255,255,0.07);
  --border-glow: rgba(124,58,237,0.5);
  --purple: #7c3aed;
  --purple-l: #a78bfa;
  --red: #ef4444;
  --gold: #d97706;
  --green: #22c55e;
  --blue: #3b82f6;
  --pink: #ec4899;
  --gray: #64748b;
  --text: #e2e8f0;
  --text2: #94a3b8;
  --text3: #4b5563;
  --ff-head: 'Cinzel', serif;
  --ff-body: 'Crimson Text', serif;
  --ff-ui: 'Inter', sans-serif;
  --r: 12px;
  --r-lg: 18px;
  --shadow: 0 4px 24px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 40px rgba(124,58,237,0.2);
}

html, body { height: 100%; }
body {
  background: var(--bg0);
  color: var(--text);
  font-family: var(--ff-ui);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg1); }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple); }

/* ─── Stars background ─── */
.stars-bg {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(124,58,237,0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(239,68,68,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(59,130,246,0.05) 0%, transparent 70%);
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text); font-family: var(--ff-ui); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all .2s; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--surface-h); border-color: rgba(255,255,255,0.15); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--purple), #5b21b6);
  border-color: transparent; color: #fff;
  box-shadow: 0 4px 15px rgba(124,58,237,0.4);
}
.btn-primary:hover { box-shadow: 0 6px 25px rgba(124,58,237,0.6); filter: brightness(1.1); }

.btn-danger { background: linear-gradient(135deg, #dc2626, #7f1d1d); border-color: transparent; color: #fff; box-shadow: 0 4px 15px rgba(220,38,38,0.4); }
.btn-danger:hover { box-shadow: 0 6px 25px rgba(220,38,38,0.6); filter: brightness(1.1); }

.btn-success { background: linear-gradient(135deg, #16a34a, #14532d); border-color: transparent; color: #fff; box-shadow: 0 4px 15px rgba(34,197,94,0.3); }
.btn-success:hover { box-shadow: 0 6px 25px rgba(34,197,94,0.5); filter: brightness(1.1); }

.btn-gold { background: linear-gradient(135deg, #d97706, #78350f); border-color: transparent; color: #fff; box-shadow: 0 4px 15px rgba(217,119,6,0.3); }
.btn-gold:hover { box-shadow: 0 6px 25px rgba(217,119,6,0.5); filter: brightness(1.1); }

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: 14px; }
.btn-xl { padding: 18px 36px; font-size: 18px; border-radius: 16px; }
.btn-icon { padding: 8px; width: 36px; height: 36px; justify-content: center; border-radius: 8px; }

/* ─── Cards ─── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
}
.card-glow { box-shadow: 0 0 30px rgba(124,58,237,0.15); border-color: rgba(124,58,237,0.25); }

/* ─── Inputs ─── */
.input, .textarea {
  width: 100%;
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-family: var(--ff-ui);
  font-size: 14px;
  padding: 10px 14px;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.input:focus, .textarea:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.2);
}
.textarea { resize: vertical; min-height: 120px; line-height: 1.6; }

/* ─── Badge ─── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.5px;
  text-transform: uppercase;
}
.badge-village { background: rgba(217,119,6,0.2); color: #fbbf24; border: 1px solid rgba(217,119,6,0.3); }
.badge-mafia   { background: rgba(239,68,68,0.2); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.badge-neutral { background: rgba(100,116,139,0.2); color: #94a3b8; border: 1px solid rgba(100,116,139,0.3); }

/* ─── Role colors ─── */
.role-villager    { --rc: #d97706; }
.role-mafia       { --rc: #ef4444; }
.role-cupid       { --rc: #ec4899; }
.role-guardian    { --rc: #3b82f6; }
.role-witch       { --rc: #a855f7; }
.role-woodcutter  { --rc: #22c55e; }
.role-serialkiller{ --rc: #64748b; }

/* ─── Toast ─── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--r); padding: 12px 18px;
  box-shadow: var(--shadow);
  font-size: 14px; max-width: 320px;
  animation: slideIn .3s ease;
}
.toast.success { border-color: rgba(34,197,94,0.4); color: #86efac; }
.toast.error   { border-color: rgba(239,68,68,0.4); color: #fca5a5; }
.toast.info    { border-color: rgba(124,58,237,0.4); color: #c4b5fd; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeOut {
  to { opacity: 0; transform: translateX(20px); }
}

/* ─── Separator ─── */
.sep { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ─── Utility ─── */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-muted  { color: var(--text2); }
.text-sm { font-size: 13px; }
.font-head { font-family: var(--ff-head); }
.hidden { display: none !important; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
