@font-face {
    font-family: 'Cinzel';
    font-style: normal;
    font-weight: 600 700;
    font-display: swap;
    src: url('/fonts/cinzel-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122;
}
@font-face {
    font-family: 'Cinzel';
    font-style: normal;
    font-weight: 600 700;
    font-display: swap;
    src: url('/fonts/cinzel-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url('/fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url('/fonts/inter-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --bg: #100c08;
    --bg-panel: #1b140d;
    --bg-panel-alt: #241b12;
    --border: #4a3820;
    --gold: #c9a860;
    --gold-bright: #f0d78c;
    --text: #e8ddc7;
    --text-dim: #a89878;
    --alliance: #5a8fd6;
    --horde: #c0392b;
    --success: #6fae5c;
    --error: #c0392b;
    --radius: 6px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background:
        radial-gradient(ellipse at top, rgba(36, 27, 18, 0.55) 0%, rgba(16, 12, 8, 0.88) 65%),
        linear-gradient(180deg, rgba(16, 12, 8, 0.4) 0%, rgba(16, 12, 8, 0.75) 100%),
        url('/images/background.jpg') center 30% / cover no-repeat fixed;
    color: var(--text);
    font-family: 'Inter', system-ui, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, .brand {
    font-family: 'Cinzel', serif;
    color: var(--gold-bright);
    letter-spacing: 0.02em;
}

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

.topbar {
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.35);
}

.topbar__inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand { font-size: 1.3rem; font-weight: 700; }
.brand span { color: var(--text-dim); font-weight: 400; }

.nav { display: flex; gap: 1.25rem; align-items: center; }
.nav__logout { color: var(--text-dim); }

.btn {
    display: inline-block;
    padding: 0.5rem 1.1rem;
    border-radius: var(--radius);
    border: 1px solid var(--gold);
    background: linear-gradient(180deg, #3a2c17, #2a2010);
    color: var(--gold-bright);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn:hover { border-color: var(--gold-bright); color: #fff8e0; }
.btn--ghost { background: transparent; }
.btn--danger { border-color: var(--error); color: #ffb3ab; }

.page {
    flex: 1;
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

.footer {
    text-align: center;
    padding: 1.25rem;
    color: var(--text-dim);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
}

.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    border: 1px solid;
}
.flash--success { background: rgba(111, 174, 92, 0.12); border-color: var(--success); color: #bfe6b0; }
.flash--error { background: rgba(192, 57, 43, 0.12); border-color: var(--error); color: #f2b7b0; }

.hero {
    text-align: center;
    padding: 3rem 0 2rem;
}
.hero h1 { font-size: 2.4rem; margin-bottom: 0.5rem; }
.hero p { color: var(--text-dim); font-size: 1.05rem; }

.status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-panel);
    margin-top: 1.25rem;
    font-size: 0.9rem;
}
.status__dot { width: 10px; height: 10px; border-radius: 50%; }
.status__dot--on { background: var(--success); box-shadow: 0 0 8px var(--success); }
.status__dot--off { background: var(--error); box-shadow: 0 0 8px var(--error); }

.card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    max-width: 420px;
    margin: 0 auto;
}

.card--wide { max-width: 100%; }

.card--danger { border-color: var(--error); background: rgba(192, 57, 43, 0.06); }

.form-row { margin-bottom: 1.1rem; }
.form-row label { display: block; margin-bottom: 0.35rem; font-size: 0.9rem; color: var(--text-dim); }
.form-row input, .form-row select, .form-row textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
}
.form-row textarea { resize: vertical; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { outline: none; border-color: var(--gold); }
.form-error { color: #f2b7b0; font-size: 0.85rem; margin-top: 0.3rem; }

.password-strength { margin: 0.5rem 0 1.1rem; }
.password-strength__bar {
    height: 6px;
    border-radius: 999px;
    background: var(--bg);
    border: 1px solid var(--border);
    overflow: hidden;
}
.password-strength__fill { height: 100%; width: 0; transition: width 0.15s ease, background-color 0.15s ease; }
.password-strength__fill.weak { background: var(--error); }
.password-strength__fill.medium { background: var(--gold); }
.password-strength__fill.strong { background: var(--success); }
.password-strength__label { font-size: 0.8rem; color: var(--text-dim); margin-top: 0.3rem; min-height: 1.1em; }
.password-strength__rules {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
    font-size: 0.82rem;
    color: var(--text-dim);
}
.password-strength__rules li { padding: 0.15rem 0 0.15rem 1.3rem; position: relative; }
.password-strength__rules li::before {
    content: '\2717';
    position: absolute;
    left: 0;
    color: var(--error);
}
.password-strength__rules li.ok { color: var(--text); }
.password-strength__rules li.ok::before { content: '\2713'; color: var(--success); }

.char-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.recovery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.char-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.char-card--link {
    display: block;
    transition: border-color 0.15s, transform 0.15s;
}
.char-card--link:hover { border-color: var(--gold); transform: translateY(-2px); }

.char-card__name { font-family: 'Cinzel', serif; font-size: 1.15rem; color: var(--gold-bright); }
.char-card__meta { color: var(--text-dim); font-size: 0.88rem; margin: 0.35rem 0 0.9rem; }
.char-card__faction { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.char-card__faction--alliance { background: var(--alliance); }
.char-card__faction--horde { background: var(--horde); }
.char-card__online { color: var(--success); font-size: 0.8rem; }
.char-card__offline { color: var(--text-dim); font-size: 0.8rem; }

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.detail-header__identity { display: flex; align-items: center; gap: 1rem; }

.char-avatar {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 3px solid var(--border);
    box-shadow: 0 0 0 2px var(--bg) inset;
}
.char-avatar--alliance { border-color: var(--alliance); }
.char-avatar--horde { border-color: var(--horde); }

/* Cercle interne separe (plutot que overflow:hidden sur .char-avatar) pour ne pas
   rogner le badge de genre, qui deborde volontairement du cercle. */
.char-avatar__circle {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: rgba(16, 12, 8, 0.75);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}

.char-avatar__icon {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.char-avatar__gender {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--text);
}

.paperdoll-card {
    background:
        radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--class-color, var(--gold)) 22%, transparent) 0%, transparent 65%),
        var(--bg-panel);
    border-color: color-mix(in srgb, var(--class-color, var(--border)) 45%, var(--border));
}

.paperdoll {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem 2rem;
    align-items: start;
    margin: 1rem 0;
}
.paperdoll__column { display: flex; flex-direction: column; gap: 0.6rem; }
.paperdoll__column--right { align-items: flex-end; }
.paperdoll__column--right .equip-slot__wrap { flex-direction: row-reverse; text-align: right; }

.paperdoll__center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding-top: 0.5rem;
}

.paperdoll__weapons {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.equip-slot__wrap { display: flex; align-items: center; gap: 0.5rem; }
.equip-slot__label { font-size: 0.72rem; color: var(--text-dim); white-space: nowrap; }

.equip-slot {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-panel);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.equip-slot--filled { border-color: var(--gold); }
.equip-slot--empty { opacity: 0.35; }
.equip-slot a, .bag-slot a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.bag-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.bag-slot {
    position: relative;
    width: 40px;
    height: 40px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-panel);
    overflow: hidden;
}
.bag-slot__count {
    position: absolute;
    bottom: 0;
    right: 2px;
    font-size: 0.65rem;
    color: var(--gold-bright);
    text-shadow: 0 1px 1px #000;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-box {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
}

.stat-box__value { font-family: 'Cinzel', serif; font-size: 1.4rem; color: var(--gold-bright); }
.stat-box__label { color: var(--text-dim); font-size: 0.8rem; margin-top: 0.25rem; }

.money { font-weight: 600; }
.money__gold { color: #e8c547; }
.money__silver { color: #c0c0c0; }
.money__copper { color: #b87333; }

.back-link { display: inline-block; margin-bottom: 1rem; color: var(--text-dim); }

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}
@media (max-width: 720px) {
    .two-col { grid-template-columns: 1fr; }
    .paperdoll { grid-template-columns: 1fr; justify-items: center; }
    .paperdoll__column--right { align-items: center; }
    .paperdoll__column--right .equip-slot__wrap { flex-direction: row; text-align: left; }
}

.info-list { list-style: none; margin: 0; padding: 0; }
.info-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
}
.info-list li:last-child { border-bottom: none; }
.info-list .label { color: var(--text-dim); }

.activity-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.activity-table th {
    text-align: left;
    color: var(--text-dim);
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
}
.activity-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
}
.activity-table tr:last-child td { border-bottom: none; }

.badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
}
.badge--ok { background: rgba(111, 174, 92, 0.15); color: var(--success); }
.badge--fail { background: rgba(192, 57, 43, 0.15); color: #f2867a; }
.badge--info { background: rgba(201, 168, 96, 0.15); color: var(--gold); }

.empty-state { text-align: center; color: var(--text-dim); padding: 2.5rem 0; }

.account-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-panel-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-dim);
}

form.inline { display: inline; }
