@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-void: #0b0e1a;
    --bg-panel: #141a2e;
    --bg-panel-alt: #1b2340;
    --bg-panel-hover: #232c4d;
    --border: #2b3457;
    --gold: #d4af6a;
    --gold-bright: #f1c979;
    --text: #e8e6da;
    --text-dim: #a9a6c0;
    --danger: #e0554f;
    --success: #4caf7d;
    --rarity-commun: #9fa6b2;
    --rarity-rare: #4f9dde;
    --rarity-epique: #b064e0;
    --rarity-legendaire: #e0a83c;
    --radius: 10px;
    --font-title: 'Cinzel', Georgia, serif;
    --font-body: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg-void);
    color: var(--text);
    font-family: var(--font-body);
    min-height: 100%;
    overflow-x: hidden;
}

img, svg { max-width: 100%; }

body {
    background-image:
        radial-gradient(circle at 15% 20%, rgba(212, 175, 106, 0.08), transparent 40%),
        radial-gradient(circle at 85% 0%, rgba(79, 157, 222, 0.10), transparent 45%);
    background-attachment: fixed;
}

h1, h2, h3, h4 { font-family: var(--font-title); color: var(--gold-bright); margin-top: 0; }

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

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.65em 1.4em;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-panel-alt);
    color: var(--text);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:hover { background: var(--bg-panel-hover); border-color: var(--gold); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--gold), #a97e3a); color: #1a1408; border-color: var(--gold); }
.btn-primary:hover { background: linear-gradient(135deg, var(--gold-bright), var(--gold)); }
.btn-danger { border-color: var(--danger); color: var(--danger); background: transparent; }
.btn-danger:hover { background: rgba(224, 85, 79, 0.15); }
.btn-success { border-color: var(--success); color: var(--success); background: transparent; }
.btn-success:hover { background: rgba(76, 175, 125, 0.15); }
.btn-sm { padding: 0.4em 0.9em; font-size: 0.85rem; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Page d'accueil ---------- */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1.5rem;
}
.hero .crest { font-size: 3rem; margin-bottom: 0.5rem; }
.hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    letter-spacing: 0.03em;
    margin-bottom: 0.3em;
    text-shadow: 0 0 30px rgba(241, 201, 121, 0.25);
}
.hero .tagline { color: var(--text-dim); font-size: 1.05rem; margin-bottom: 2rem; }
.lore {
    max-width: 640px;
    color: var(--text-dim);
    line-height: 1.7;
    margin: 0 auto 2.5rem;
}
.lore strong { color: var(--gold-bright); font-weight: 600; }

.access-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    max-width: 780px;
}
.access-card {
    flex: 1 1 300px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem 1.75rem;
    text-align: left;
    transition: border-color 0.2s, transform 0.2s;
}
.access-card:hover { border-color: var(--gold); transform: translateY(-3px); }
.access-card .icon { font-size: 2.2rem; margin-bottom: 0.75rem; display: block; }
.access-card h2 { font-size: 1.3rem; margin-bottom: 0.4rem; }
.access-card p { color: var(--text-dim); font-size: 0.92rem; line-height: 1.5; margin-bottom: 1.4rem; }

.footnote { margin-top: 3rem; color: #676c8c; font-size: 0.8rem; }

/* ---------- Formulaires (auth) ---------- */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.auth-box {
    width: 100%;
    max-width: 420px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
}
.auth-box h1 { font-size: 1.6rem; text-align: center; margin-bottom: 0.2em; }
.auth-box .subtitle { text-align: center; color: var(--text-dim); font-size: 0.9rem; margin-bottom: 1.8rem; }

.field { margin-bottom: 1.1rem; }
.field label { display: block; font-size: 0.85rem; color: var(--text-dim); margin-bottom: 0.35rem; }
.field input, .field select, .field textarea {
    width: 100%;
    padding: 0.65em 0.8em;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-void);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.95rem;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--gold);
}
.field-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.field-row .field { flex: 1; min-width: 0; }
.hint { font-size: 0.78rem; color: #676c8c; margin-top: 0.3rem; }

.auth-switch { text-align: center; margin-top: 1.4rem; font-size: 0.88rem; color: var(--text-dim); }

/* ---------- Flash messages ---------- */
.flash { padding: 0.8em 1.1em; border-radius: 8px; margin-bottom: 1.2rem; font-size: 0.9rem; }
.flash-success { background: rgba(76, 175, 125, 0.15); border: 1px solid var(--success); color: #9be8bf; }
.flash-error { background: rgba(224, 85, 79, 0.15); border: 1px solid var(--danger); color: #f3a29e; }
.flash-info { background: rgba(79, 157, 222, 0.15); border: 1px solid var(--rarity-rare); color: #b7dcf7; }

/* ---------- Rareté / badges ---------- */
.rarity-commun { color: var(--rarity-commun); }
.rarity-rare { color: var(--rarity-rare); }
.rarity-epique { color: var(--rarity-epique); }
.rarity-legendaire { color: var(--rarity-legendaire); }

.badge {
    display: inline-block;
    padding: 0.15em 0.6em;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border: 1px solid currentColor;
}

/* ---------- Tableaux scrollables (mobile) ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -0.2rem; padding: 0 0.2rem; }
.table-scroll table { min-width: 560px; }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
    .btn { padding: 0.7em 1.2em; }
    .btn-sm { padding: 0.5em 0.85em; min-height: 38px; }
    .field-row { flex-direction: column; gap: 0.8rem; }
    .field-row .field { flex: 1 1 100% !important; margin-bottom: 0; }

    .hero { padding: 2.2rem 1.1rem; min-height: auto; }
    .access-cards { gap: 1rem; }
    .access-card { padding: 1.5rem 1.3rem; }

    .auth-box { padding: 1.6rem 1.3rem; }

    .card { padding: 1.1rem 1.1rem; }
}
