
:root {
  --bg:         #0c0906;
  --bg-2:       #13100b;
  --bg-3:       #1c1710;
  --bg-input:   #160f08;
  --accent:     #7a1a0a;
  --accent-h:   #9a2a10;
  --accent-d:   #4a0a04;
  --text:       #e8d8b8;
  --text-muted: #7a6a52;
  --border:     #2a1e10;
  --border-2:   #3a2818;
  --radius:     6px;
  --gold:       #c9a84c;
  --gold-dim:   #8b6a2a;
  --parchment:  #f0e6c8;
}

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

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

body { animation: pageIn 0.35s ease; }
/* No fill-mode: after animation ends, styles are removed → no stacking context on body */

h1, h2, h3, .cinzel { font-family: 'Cinzel', serif; }

a { color: var(--text-muted); text-decoration: none; }
a:hover { color: var(--text); }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 52px;
  background: var(--bg-2);
  border-bottom: 0.5px solid var(--border);
}

.nav-brand {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  color: var(--text);
  letter-spacing: 3px;
  text-transform: uppercase;
  transition: color 0.2s, opacity 0.2s;
}
.nav-brand:hover { color: var(--text); }

.nav-links { display: flex; gap: 16px; align-items: center; }
.nav-links span { color: var(--text-muted); font-size: 13px; }

@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, transform 0.1s;
  position: relative;
  overflow: hidden;
}
.btn:active { transform: scale(0.97); }

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255,255,255,0.12);
  transform: scale(0);
  opacity: 1;
  pointer-events: none;
}
.btn.rippling::after {
  animation: ripple 0.5s ease-out forwards;
}

.btn-primary   { background: var(--accent);    color: var(--text); }
.btn-primary:hover { background: var(--accent-h); color: var(--text); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 0.5px solid var(--border-2);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-icon { padding: 7px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

input[type="text"],
input[type="password"],
input[type="email"],
select,
textarea {
  background: var(--bg-3);
  border: 0.5px solid var(--border-2);
  border-radius: var(--radius);
  color: var(--text);
  padding: 9px 12px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(107,15,15,0.15);
}

.errorlist { list-style: none; color: #e05555; font-size: 12px; }

.card {
  background: var(--bg-2);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.messages { padding: 8px 24px 0; }
.message {
  padding: 10px 16px;
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: 13px;
}
.message.error   { background: #2a1010; border: 0.5px solid var(--accent); }
.message.success { background: #101a10; border: 0.5px solid #204a20; color: #709070; }

.divider { border: none; border-top: 0.5px solid var(--border); margin: 16px 0; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-d); }

.profile-menu { position: relative; }

.profile-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0.5px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px 5px 6px;
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.2s, background 0.2s;
}
.profile-trigger:hover,
.profile-trigger.active {
  border-color: var(--accent);
  background: var(--bg-2);
}

.profile-avatar {
  width: 26px; height: 26px;
  border-radius: 4px;
  background: var(--accent-d);
  border: 0.5px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}

.profile-name {
  font-size: 13px;
  font-weight: 400;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.profile-caret {
  font-size: 8px;
  color: var(--text-muted);
  transition: transform 0.2s;
  margin-left: 2px;
}
.profile-trigger.active .profile-caret { transform: rotate(180deg); }

.profile-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 220px;
  background: var(--bg-2);
  border: 0.5px solid var(--border-2);
  border-radius: 8px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.7);
  z-index: 200;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.profile-dropdown.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 0.5px solid var(--border);
}

.dropdown-avatar-lg {
  width: 36px; height: 36px;
  border-radius: 6px;
  background: var(--accent-d);
  border: 0.5px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}

.dropdown-header-name {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.dropdown-header-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  letter-spacing: 0.3px;
}

.dropdown-body { padding: 6px; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  text-align: left;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  transition: background 0.12s, color 0.12s;
  text-decoration: none;
}

.dropdown-item:hover { background: rgba(255,255,255,0.03); color: var(--text); }

.dropdown-item-icon {
  width: 20px; height: 20px;
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
}

.dropdown-divider {
  border: none;
  height: 0.5px;
  background: var(--border);
  margin: 4px 6px;
}

.dropdown-item-danger { color: #8b5050; }
.dropdown-item-danger:hover { background: rgba(107,15,15,0.15); color: #c07070; }
.dropdown-item-danger .dropdown-item-icon { background: rgba(107,15,15,0.12); color: #8b5050; }

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.auth-box {
  width: 360px;
  background: var(--bg-2);
  border: 0.5px solid var(--border-2);
  border-radius: 8px;
  padding: 36px 32px;
}

.auth-box h1 {
  font-size: 20px;
  color: var(--text);
  text-align: center;
  margin-bottom: 6px;
  letter-spacing: 3px;
}

.auth-box .subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 28px;
}

.auth-form { display: flex; flex-direction: column; gap: 16px; }
