/* Rappelz Mon — thème noir & or, CSS pur (aucune dépendance/build). */

* { box-sizing: border-box; }

:root {
    --bg: #07060a;
    --bg-alt: #0c0a08;
    --surface: #141210;
    --surface-2: #1b1815;
    --border: rgba(212, 175, 55, 0.16);
    --border-strong: rgba(212, 175, 55, 0.34);

    --gold: #d4af37;
    --gold-bright: #f2d47e;
    --gold-dim: #8a6d24;

    --ink: #f4efe2;
    --ink-muted: #a89f8c;
    --ink-faint: #6f6858;

    --danger: #e2574c;
    --danger-bg: rgba(226, 87, 76, 0.12);
    --danger-border: rgba(226, 87, 76, 0.35);

    --success: #4bbf8a;
    --success-bg: rgba(75, 191, 138, 0.12);
    --success-border: rgba(75, 191, 138, 0.35);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --font-display: Georgia, "Iowan Old Style", "Times New Roman", serif;
}

html { background: var(--bg); }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background:
        radial-gradient(60rem 30rem at 85% -10%, rgba(212, 175, 55, 0.10), transparent 60%),
        radial-gradient(50rem 26rem at -10% 10%, rgba(212, 175, 55, 0.05), transparent 55%),
        var(--bg);
    background-attachment: fixed;
    color: var(--ink);
    line-height: 1.5;
}

a { color: var(--gold-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: 0.01em; color: var(--ink); }
h1 { font-size: 1.7rem; margin: 0 0 1rem; }
h2 { font-size: 1.25rem; margin: 0 0 1rem; }

/* ---------- En-tête ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(7, 6, 10, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(212, 175, 55, 0.06);
}

.site-header__inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: 0.02em;
}

.brand svg {
    width: 20px;
    height: 20px;
    color: var(--gold);
    flex-shrink: 0;
}

.brand span {
    background: linear-gradient(135deg, var(--gold-bright), var(--gold) 55%, var(--gold-dim));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.site-header nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.site-header nav a {
    color: var(--ink-muted);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 999px;
    transition: color 0.15s ease, background 0.15s ease;
}

.site-header nav a:hover {
    color: var(--ink);
    background: rgba(212, 175, 55, 0.08);
    text-decoration: none;
}

.site-header nav a.active {
    color: #12100c;
    background: linear-gradient(135deg, var(--gold-bright), var(--gold));
}

.btn--nav {
    padding: 6px 16px;
    font-size: 0.85rem;
}

.user-menu {
    position: relative;
    margin-left: 4px;
}

.user-menu__trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 6px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--ink);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.user-menu__trigger:hover {
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.04);
}

.user-menu__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-bright), var(--gold));
    color: #171208;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
}

.user-menu__trigger svg {
    width: 14px;
    height: 14px;
    color: var(--ink-muted);
    transition: transform 0.15s ease;
}

.user-menu.is-open .user-menu__trigger svg {
    transform: rotate(180deg);
}

.user-menu__panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    box-shadow: 0 16px 32px -12px rgba(0, 0, 0, 0.6);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    z-index: 50;
}

.user-menu.is-open .user-menu__panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu__meta {
    padding: 10px 12px 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
    font-size: 0.82rem;
    color: var(--ink-muted);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-menu__meta strong {
    color: var(--ink);
    font-size: 0.92rem;
}

.user-menu__role {
    display: inline-flex;
    align-self: flex-start;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--ink-muted);
}

.user-menu__role--admin {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: var(--success);
}

.user-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 600;
}

.user-menu__item svg {
    width: 16px;
    height: 16px;
    color: var(--ink-muted);
    flex-shrink: 0;
}

.user-menu__item:hover {
    background: rgba(212, 175, 55, 0.08);
    text-decoration: none;
}

.user-menu__item.active {
    color: var(--gold-bright);
}

.user-menu__item--danger:hover {
    background: var(--danger-bg);
}

.user-menu__item--danger svg {
    color: var(--danger);
}

/* ---------- Pied de page ---------- */

.site-footer {
    border-top: 1px solid var(--border);
}

.site-footer__inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 18px 20px;
    text-align: center;
    color: var(--ink-faint);
    font-size: 0.82rem;
}

/* ---------- Structure ---------- */

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 28px 20px 70px;
    flex: 1;
}

/* ---------- Bandeau d'accueil ---------- */

.hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 36px 32px;
    margin-bottom: 24px;
    background:
        radial-gradient(120% 160% at 100% -20%, rgba(212, 175, 55, 0.16), transparent 60%),
        linear-gradient(165deg, var(--surface), var(--bg-alt));
}

.hero::after {
    content: "";
    position: absolute;
    top: -60px;
    right: -60px;
    width: 220px;
    height: 220px;
    border: 1px solid rgba(212, 175, 55, 0.18);
    border-radius: 28%;
    transform: rotate(24deg);
    pointer-events: none;
}

.hero h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.hero p {
    color: var(--ink-muted);
    max-width: 40rem;
    margin: 0;
}

/* ---------- Cartes ---------- */

.card {
    position: relative;
    background: linear-gradient(180deg, var(--surface), var(--bg-alt));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 22px;
    box-shadow: 0 20px 40px -28px rgba(0, 0, 0, 0.8);
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 24px;
    right: 24px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.5), transparent);
}

/* ---------- Tableaux ---------- */

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--gold-dim);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

tbody tr { transition: background 0.12s ease; }
tbody tr:hover { background: rgba(212, 175, 55, 0.05); }
tbody tr:last-child td { border-bottom: none; }

form.inline { display: inline; }

input, textarea, select, button {
    font-family: inherit;
    font-size: 1rem;
}

/* ---------- Formulaires ---------- */

.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; color: var(--ink-muted); font-size: 0.88rem; }
.field input, .field textarea, .field select {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--bg-alt);
    color: var(--ink);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus, .field textarea:focus, .field select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
}

.field input::placeholder, .field textarea::placeholder { color: var(--ink-faint); }

/* ---------- Boutons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, var(--gold-bright), var(--gold));
    color: #171208;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    text-decoration: none;
    box-shadow: 0 8px 18px -8px rgba(212, 175, 55, 0.55);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px -8px rgba(212, 175, 55, 0.7);
    text-decoration: none;
}

.btn--danger {
    background: linear-gradient(135deg, #ef6a5f, var(--danger));
    color: #fff;
    box-shadow: 0 8px 18px -8px rgba(226, 87, 76, 0.5);
}

.btn--danger:hover { box-shadow: 0 12px 22px -8px rgba(226, 87, 76, 0.65); }

.btn--secondary {
    background: rgba(255, 255, 255, 0.04);
    color: var(--ink);
    border: 1px solid var(--border-strong);
    box-shadow: none;
}

.btn--secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: none;
    transform: none;
}

/* ---------- Messages flash ---------- */

.flash {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
    border: 1px solid;
    border-left-width: 3px;
}

.flash--success { background: var(--success-bg); border-color: var(--success-border); color: var(--success); }
.flash--error { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }

.auth-card {
    max-width: 400px;
    margin: 48px auto;
}

/* ---------- Tuiles de statistiques ---------- */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.stat-tile {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: linear-gradient(180deg, var(--surface), var(--bg-alt));
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: 0 16px 30px -26px rgba(0, 0, 0, 0.9);
}

.stat-tile__icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 175, 55, 0.12);
    color: var(--gold);
}

.stat-tile__icon svg { width: 18px; height: 18px; }

.stat-tile__label {
    color: var(--ink-muted);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.stat-tile__value {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.25;
}

.stat-tile__value small {
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink-muted);
    margin-top: 2px;
}

.text-muted { color: var(--ink-muted); }
.error-list { color: var(--danger); margin-bottom: 14px; padding-left: 20px; }
.error-list li + li { margin-top: 4px; }

/* ---------- Badges ---------- */

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--ink-muted);
}

.badge--admin { background: rgba(212, 175, 55, 0.14); border-color: var(--border-strong); color: var(--gold-bright); }
.badge--cheap { background: var(--success-bg); border-color: var(--success-border); color: var(--success); }
.badge--expensive { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }

.variation-up { color: var(--danger); }
.variation-down { color: var(--success); }

/* ---------- Images d'objets ---------- */

.item-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--bg-alt);
}

.item-image {
    max-width: 160px;
    max-height: 160px;
    object-fit: contain;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-strong);
    background: var(--bg-alt);
    float: right;
    margin-left: 16px;
}

details summary { cursor: pointer; font-size: 0.9rem; color: var(--ink-muted); }

/* ---------- Contenu wiki ---------- */

.wiki-content { margin-top: 16px; line-height: 1.7; }
.wiki-content h1, .wiki-content h2, .wiki-content h3 { color: var(--gold-bright); margin-top: 24px; margin-bottom: 8px; }
.wiki-content p { margin-bottom: 12px; }
.wiki-content ul, .wiki-content ol { margin-bottom: 12px; padding-left: 24px; }
.wiki-content ul { list-style: disc; }
.wiki-content ol { list-style: decimal; }
.wiki-content blockquote {
    border-left: 3px solid var(--gold-dim);
    padding-left: 16px;
    color: var(--ink-muted);
    font-style: italic;
    margin: 12px 0;
}
.wiki-content code {
    background: var(--surface-2);
    color: var(--gold-bright);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
}
.wiki-content pre {
    background: var(--surface-2);
    padding: 12px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 12px 0;
    border: 1px solid var(--border);
}
.wiki-content pre code { background: transparent; padding: 0; }
