/* ==== KAOS — theme commun du site de vote ==== */
:root {
    color-scheme: dark;
    --bg: #0b0a10;
    --bg-2: #110e18;
    --surface: #16131d;
    --surface-2: #1e1a27;
    --border: #2e2839;
    --text: #f3eee6;
    --muted: #a198ad;
    --accent: #ff6b35;        /* braise */
    --accent-hover: #ff8a55;
    --accent-ink: #1b0903;
    --accent-rgb: 255, 107, 53;
    --fire: linear-gradient(180deg, #ff9152 0%, #ff6b35 45%, #e0441c 100%);
    --arcane: #b16cff;        /* violet dragon (yeux, magie) */
    --arcane-rgb: 177, 108, 255;
    --gold: #f4c542;
    --silver: #c9cfda;
    --bronze: #d08a4c;
    --danger-bg: #3a1618;
    --danger: #ff8a8a;
    --success-bg: #13301b;
    --success: #7fe39a;
    --radius: 14px;
    --pixel: "Silkscreen", ui-monospace, monospace;
    --display: "Cinzel", Georgia, serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(1200px 500px at 50% -200px, rgba(var(--accent-rgb), 0.12), transparent 70%),
        var(--bg);
    color: var(--text);
    font: 16px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
code {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1px 6px;
    font-size: 0.9em;
}

.container { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 16px; }
.container.narrow { max-width: 460px; }
main { flex: 1; padding: 40px 0 64px; }

/* ---- En-tete ---- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(13, 15, 20, 0.85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.site-header .container {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 60px;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    font-family: var(--pixel);
    font-size: 1.15rem;
    letter-spacing: 0.5px;
}
.brand:hover { color: var(--text); }
.brand img { width: 28px; height: 28px; image-rendering: pixelated; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; min-width: 0; }
.nav a {
    color: var(--muted);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--text); background: var(--surface-2); }

/* ---- Pied de page ---- */
.site-footer {
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.85rem;
    padding: 20px 0;
}
.site-footer .container { display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }

/* ---- Typo ---- */
h1, h2, h3 { line-height: 1.2; margin: 0 0 8px; }
h1 { font-family: var(--pixel); font-weight: 700; font-size: clamp(1.6rem, 5vw, 2.3rem); letter-spacing: 0.5px; }
h2 { font-family: var(--pixel); font-weight: 400; font-size: 1.25rem; margin-top: 40px; }
.lead { color: var(--muted); margin: 0 0 24px; font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* ---- Boutons & formulaires ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: var(--accent);
    color: var(--accent-ink);
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25);
    transition: background 0.15s, transform 0.05s;
}
.btn:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn:active { transform: translateY(1px); }
.btn.secondary {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--text);
    box-shadow: none;
}
.btn.secondary:hover { border-color: var(--muted); color: var(--text); }
.btn.discord { background: #5865f2; color: #fff; }
.btn.discord:hover { background: #6b77f5; color: #fff; }
.btn.block { width: 100%; }
.btn.link {
    background: none;
    border: none;
    box-shadow: none;
    color: var(--muted);
    padding: 0;
    font-weight: 500;
    text-decoration: underline;
}
.btn.link:hover { color: var(--text); }

label { display: block; margin: 16px 0 6px; font-weight: 600; font-size: 0.92rem; }
input[type=text], input[type=email], input[type=password] {
    width: 100%;
    padding: 11px 14px;
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.2); }
form .btn { margin-top: 20px; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; min-width: 0; }
.inline-form .btn { margin-top: 0; }

.alert { padding: 11px 14px; border-radius: 10px; margin: 16px 0; font-size: 0.95rem; }
.alert.error { background: var(--danger-bg); color: var(--danger); }
.alert.success { background: var(--success-bg); color: var(--success); }

/* ---- Cartes ---- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.grid { display: grid; gap: 16px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) { .grid.cols-3 { grid-template-columns: 1fr; } }

/* ---- Accueil ---- */
.hero { text-align: center; padding: 24px 0 8px; }
.hero .logo { width: 72px; height: 72px; image-rendering: pixelated; margin-bottom: 12px; }
.hero h1 { font-size: clamp(2rem, 8vw, 3.2rem); }
.hero .lead { max-width: 520px; margin: 8px auto 28px; }
.hero-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }

.ip-box {
    display: inline-flex;
    align-items: stretch;
    max-width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.ip-box .ip {
    padding: 12px 16px;
    font-family: var(--pixel);
    font-size: 1.05rem;
    overflow-wrap: anywhere;
    display: flex;
    align-items: center;
}
.ip-box button {
    border: none;
    border-left: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    padding: 0 16px;
    cursor: pointer;
}
.ip-box button:hover { background: var(--border); }
.ip-box button.copied { color: var(--accent); }

.status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 0.92rem;
}
.status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.status.online .dot { background: var(--success); box-shadow: 0 0 0 4px rgba(127, 227, 154, 0.18); }
.status.offline .dot { background: var(--danger); }

.stat .value { font-family: var(--pixel); font-size: 1.9rem; color: var(--text); }
.stat .label { color: var(--muted); font-size: 0.9rem; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 40px; }
.section-head h2 { margin: 0; }

/* ---- Classement ---- */
.tabs { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 4px; margin-bottom: 24px; }
.tabs a { padding: 7px 14px; border-radius: 7px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.92rem; }
.tabs a.active { background: var(--surface-2); color: var(--text); }

.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: end; }
.podium .spot {
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 4px solid var(--rank-color);
    border-radius: var(--radius);
    padding: 18px 10px 16px;
    min-width: 0;
}
.podium .spot.r1 { --rank-color: var(--gold); order: 2; padding-top: 30px; }
.podium .spot.r2 { --rank-color: var(--silver); order: 1; }
.podium .spot.r3 { --rank-color: var(--bronze); order: 3; }
.podium .spot.empty { opacity: 0.45; }
.podium img { width: 64px; height: 64px; image-rendering: pixelated; border-radius: 6px; }
.podium .spot.r1 img { width: 80px; height: 80px; }
.podium .rank { font-family: var(--pixel); color: var(--rank-color); font-size: 1.1rem; }
.podium .name { font-weight: 700; margin-top: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .votes { color: var(--muted); font-size: 0.9rem; }

.ranking { list-style: none; margin: 16px 0 0; padding: 0; }
.ranking li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}
.ranking li:last-child { border-bottom: none; }
.ranking .pos { width: 2.2em; font-family: var(--pixel); color: var(--muted); }
.ranking img { width: 32px; height: 32px; image-rendering: pixelated; border-radius: 4px; }
.ranking .name { flex: 1; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ranking .votes { font-family: var(--pixel); }

.empty-state { text-align: center; padding: 36px 16px; color: var(--muted); }

/* ---- Vote ---- */
.vote-list { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
.vote-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    transition: border-color 0.15s, transform 0.1s;
}
.vote-list a:hover { border-color: var(--accent); transform: translateY(-1px); color: var(--text); }
.vote-list a .go { color: var(--accent); font-weight: 700; white-space: nowrap; }

/* Bouton de vote avec delai : fonce pendant le delai, se recolore de gauche a droite */
.vote-btn { position: relative; overflow: hidden; }
.vote-btn .name, .vote-btn .go { position: relative; z-index: 1; }
.vote-btn .fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: calc(var(--progress, 0) * 100%);
    background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.10), rgba(var(--accent-rgb), 0.22));
    border-right: 2px solid rgba(var(--accent-rgb), 0.55);
    transition: width 1s linear;
    display: none;
}
.vote-list a.vote-btn.cooling {
    background: #0b0d11;
    border-color: var(--border);
    color: var(--muted);
    cursor: not-allowed;
}
.vote-list a.vote-btn.cooling:hover { transform: none; border-color: var(--border); color: var(--muted); }
.vote-btn.cooling .fill { display: block; }
.vote-list a.vote-btn.cooling .go { color: var(--muted); font-family: var(--pixel); font-weight: 400; font-size: 0.95rem; }
.vote-btn.ready { animation: vote-ready 1.2s ease-out; }
.vote-btn.shake { animation: vote-shake 0.35s ease-in-out; }
@keyframes vote-ready {
    0% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.6); }
    100% { box-shadow: 0 0 0 14px rgba(var(--accent-rgb), 0); }
}
@keyframes vote-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { counter-increment: step; display: flex; gap: 12px; color: var(--muted); }
.steps li::before {
    content: counter(step);
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--accent);
    font-family: var(--pixel);
    display: grid;
    place-items: center;
    font-size: 0.85rem;
}

.player-chip { display: inline-flex; align-items: center; gap: 10px; }
.player-chip img { width: 40px; height: 40px; image-rendering: pixelated; border-radius: 6px; }

/* ---- Page d'erreur ---- */
.error-code { font-family: var(--pixel); font-size: 4rem; color: var(--accent); }

@media (max-width: 600px) {
    main { padding-top: 28px; }
    .site-header .container { padding-top: 8px; padding-bottom: 8px; gap: 6px; }
    .nav { margin-left: -12px; width: calc(100% + 12px); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .nav a { white-space: nowrap; padding: 6px 10px; }
    .hero-actions .btn { flex: 1 1 100%; }
    .podium { gap: 8px; }
    .podium img { width: 48px; height: 48px; }
    .podium .spot.r1 img { width: 60px; height: 60px; }
    .inline-form { flex-direction: column; }
}

/* ---- Tableau de bord du compte ---- */
.account-head { display: flex; align-items: center; gap: 16px; }
.account-head img { width: 64px; height: 64px; image-rendering: pixelated; border-radius: 8px; }
.account-head h1 { margin: 0 0 2px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 720px) { .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
.stat .unit { font-size: 1rem; color: var(--muted); }
.stat.highlight { border-color: rgba(var(--accent-rgb), 0.6); background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.10), var(--surface)); }
.stat.highlight .value { color: var(--accent); }

.activity { display: grid; grid-template-columns: repeat(30, 1fr); gap: 4px; }
.day { display: inline-block; aspect-ratio: 1; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--border); }
.day.l1 { background: rgba(var(--accent-rgb), 0.35); border-color: transparent; }
.day.l2 { background: rgba(var(--accent-rgb), 0.65); border-color: transparent; }
.day.l3 { background: var(--accent); border-color: transparent; }
.activity-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 10px; }
.activity-legend .day { width: 12px; }
@media (max-width: 520px) { .activity { grid-template-columns: repeat(15, 1fr); } }

.history { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.history li:last-child { border-bottom: none; }
.history .when { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 110px; }
.history .site { flex: 1; font-weight: 600; }
.badge { font-size: 0.8rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.badge.ok { background: var(--success-bg); color: var(--success); }
.badge.ko { background: var(--danger-bg); color: var(--danger); }

.account-actions { display: flex; gap: 20px; margin-top: 28px; flex-wrap: wrap; }
.account-actions form .btn { margin-top: 0; }

/* ---- Onglets et parametres du compte ---- */
.account-tabs { margin: 24px 0 20px; }
.settings-card + .settings-card { margin-top: 16px; }
.settings-card h3 { font-size: 1.05rem; margin: 0 0 12px; }
.settings-card form .btn { margin-top: 16px; }
.settings-card .inline-form .btn { margin-top: 0; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.settings-row form .btn { margin-top: 0; }

/* ---- Administration ---- */
.stat.warn { border-color: rgba(255, 138, 138, 0.45); }
.stat.warn .value { color: var(--danger); }
.table-card { padding: 4px 6px; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 0.85rem; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .danger { color: var(--danger); font-weight: 700; }
.table .nowrap { white-space: nowrap; }
.table form .btn { margin-top: 0; }
.player-cell { display: inline-flex; align-items: center; gap: 8px; }
.player-cell img { width: 24px; height: 24px; image-rendering: pixelated; border-radius: 3px; }
.small-tabs { margin: 0; }
.small-tabs a { padding: 5px 10px; font-size: 0.85rem; }

.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
.bar-fill { width: 100%; min-height: 2px; background: var(--accent); border-radius: 4px 4px 0 0; opacity: 0.85; }
.bar:hover .bar-fill { opacity: 1; }
.bar-value { font-size: 0.75rem; color: var(--muted); }
.bar-label { font-size: 0.72rem; color: var(--muted); }
.temp-password { border-color: rgba(var(--accent-rgb), 0.6); margin-bottom: 16px; }
.temp-password .ip { letter-spacing: 2px; }

/* ---- En-tete : zone compte ---- */
.site-header .nav { margin-left: auto; }
.auth { display: flex; align-items: center; gap: 8px; }
.auth-link { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-weight: 500; font-size: 0.95rem; white-space: nowrap; }
.auth-link:hover, .auth-link.active { color: var(--text); background: var(--surface-2); }
.btn.btn-sm { padding: 7px 14px; font-size: 0.9rem; border-radius: 8px; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.25); }
.btn.secondary.btn-sm { box-shadow: none; }
.logout-form { margin: 0; }
.logout-form .btn { margin-top: 0; }
.credit-pill, .cart-pill {
    display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
    padding: 5px 10px; border-radius: 999px; font-weight: 700; font-size: 0.88rem; text-decoration: none;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
}
.credit-pill:hover, .cart-pill:hover { border-color: var(--gold); color: var(--text); }
.coin { width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffe79a, var(--gold) 60%, #b8860b); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3); }
@media (max-width: 900px) {
    .site-header .container { flex-wrap: wrap; }
    .site-header .nav { order: 3; width: 100%; margin-left: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .auth { margin-left: auto; }
}

/* ---- Boutique ---- */
.shop-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.shop-head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.credit-pill.big { font-size: 1rem; padding: 8px 14px; }
.shop-tabs { display: flex; flex-wrap: wrap; width: fit-content; max-width: 100%; }
.shop-tabs .count { margin-left: 6px; font-size: 0.75rem; color: var(--muted); }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; margin-top: 8px; }
.shop-item { display: flex; flex-direction: column; gap: 6px; padding: 16px; transition: border-color 0.15s, transform 0.1s; }
.shop-item:hover { border-color: var(--accent); transform: translateY(-2px); }
.shop-item h3 { font-size: 1.05rem; margin: 0; }
.shop-item-img { aspect-ratio: 1; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; margin-bottom: 6px; }
.shop-item-img img { width: 70%; height: 70%; object-fit: contain; image-rendering: pixelated; }
.shop-item-img .placeholder { width: 40%; height: 40%; border-radius: 8px; background: var(--border); }
.shop-desc { margin: 0; flex: 1; }
.shop-item-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.shop-item-foot form .btn { margin-top: 0; }
.price { display: inline-flex; align-items: center; gap: 6px; font-family: var(--pixel); font-size: 1.1rem; }

.qty-form { display: flex; align-items: center; gap: 6px; }
.qty-form input { width: 70px; padding: 6px 8px; }
.qty-form .btn { margin-top: 0; }
.cart-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; align-items: start; }
.cart-bottom .settings-card + .settings-card { margin-top: 0; }
@media (max-width: 720px) { .cart-bottom { grid-template-columns: 1fr; } }
.sum-row { display: flex; justify-content: space-between; padding: 6px 0; }
.sum-row.promo { color: var(--success); }
.sum-row.total { font-weight: 700; font-size: 1.1rem; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; }
.sum-row.total span:last-child { display: inline-flex; align-items: center; gap: 6px; }
.summary .alert { margin-bottom: 0; }

.order-done { text-align: center; padding: 32px 24px; }
.order-done .table { text-align: left; }
.order-check { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; background: var(--success-bg); color: var(--success); display: grid; place-items: center; font-size: 1.8rem; font-weight: 700; }

.credits-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 760px) { .credits-layout { grid-template-columns: 1fr; } }
.presets { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.presets .btn { margin-top: 0; }
input[type=range] { width: 100%; accent-color: var(--accent); margin: 4px 0 12px; }
input[type=number], select, textarea { width: 100%; padding: 11px 14px; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 10px; }
textarea { resize: vertical; min-height: 70px; }
.quote { margin-top: 16px; }
.tiers { list-style: none; padding: 0; margin: 0 0 12px; }
.tiers li { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: 8px; }
.tiers li.current { background: var(--surface-2); outline: 1px solid var(--accent); }

/* ---- Formulaires admin ---- */
.admin-tabs { display: flex; flex-wrap: wrap; width: fit-content; max-width: 100%; }
.row-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-form input[type=text] { flex: 1; min-width: 140px; padding: 8px 10px; }
.row-form .btn { margin-top: 0; }
.narrow-input { width: 80px !important; padding: 8px 10px !important; }
.check { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; white-space: nowrap; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 16px; }
.form-grid.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 720px) { .form-grid, .form-grid.four { grid-template-columns: 1fr; } }
.credit-adjust summary { cursor: pointer; list-style: none; }
.credit-adjust summary::after { content: " ✎"; color: var(--muted); font-size: 0.8rem; }
.credit-adjust form { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; min-width: 180px; }
.credit-adjust input { padding: 6px 8px !important; font-size: 0.85rem; }
.credit-adjust .btn { margin-top: 0; }

/* En-tete plus large que le contenu : tout tient sur une ligne une fois connecte. */
.site-header .container { max-width: 1240px; flex-wrap: nowrap; }
.site-header .nav { gap: 2px; }
.site-header .nav a { padding: 6px 10px; }
.qty-form input[type=number] { width: 80px; padding: 6px 8px; }
@media (max-width: 1100px) {
    .site-header .container { flex-wrap: wrap; }
    .site-header .nav { order: 3; width: 100%; margin-left: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .auth { margin-left: auto; }
}

/* =====================================================================
   THEME DRAGON — couche de design globale (surcharge les styles de base)
   ===================================================================== */
body {
    background:
        radial-gradient(900px 500px at 15% -10%, rgba(var(--accent-rgb), 0.10), transparent 70%),
        radial-gradient(800px 600px at 100% 10%, rgba(var(--arcane-rgb), 0.08), transparent 70%),
        var(--bg);
    background-attachment: fixed;
}
::selection { background: rgba(var(--accent-rgb), 0.35); }
a { color: var(--accent-hover); }
a:hover { color: #ffb088; }

h1, h2 { font-family: var(--display); font-weight: 800; letter-spacing: 0.5px; }
h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); }
h3 { font-weight: 700; }

/* Titres de page centres */
main .container > h1:first-child { text-align: center; margin-bottom: 10px; }
main .container > h1:first-child + .lead { text-align: center; max-width: 640px; margin-left: auto; margin-right: auto; margin-bottom: 28px; }
main .container > .tabs, main .container > nav.tabs { display: flex; flex-wrap: wrap; justify-content: center; width: fit-content; max-width: 100%; margin-left: auto; margin-right: auto; }
.account-head { justify-content: center; text-align: left; }
.shop-head { flex-direction: column; align-items: center; text-align: center; }
.shop-head .lead { margin-left: auto; margin-right: auto; }

/* En-tete */
.site-header { background: rgba(11, 10, 16, 0.78); border-bottom: 1px solid rgba(var(--accent-rgb), 0.18); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4); }
.brand { font-family: var(--display); font-weight: 800; font-size: 1.25rem; letter-spacing: 1px; }
.brand img { width: 30px; height: 30px; filter: drop-shadow(0 0 6px rgba(var(--arcane-rgb), 0.55)); }
.nav a.active { color: var(--text); background: rgba(var(--accent-rgb), 0.12); box-shadow: inset 0 -2px 0 var(--accent); }

/* Boutons */
.btn {
    background: var(--fire);
    color: var(--accent-ink);
    border: 1px solid rgba(255, 180, 130, 0.35);
    box-shadow: 0 6px 18px -6px rgba(var(--accent-rgb), 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}
.btn:hover { background: var(--fire); color: var(--accent-ink); filter: brightness(1.08); transform: translateY(-2px); box-shadow: 0 10px 26px -6px rgba(var(--accent-rgb), 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.btn:active { transform: translateY(0); }
.btn.secondary { background: rgba(255, 255, 255, 0.04); color: var(--text); border: 1px solid var(--border); box-shadow: none; backdrop-filter: blur(6px); }
.btn.secondary:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(var(--accent-rgb), 0.5); color: var(--text); box-shadow: 0 6px 18px -8px rgba(var(--accent-rgb), 0.45); }
.btn.discord { background: linear-gradient(180deg, #6d78ff, #5865f2); border-color: rgba(160, 170, 255, 0.4); color: #fff; box-shadow: 0 6px 18px -6px rgba(88, 101, 242, 0.7); }
.btn.discord:hover { background: linear-gradient(180deg, #7c86ff, #5f6cf5); color: #fff; }
.btn.link { background: none; border: none; box-shadow: none; filter: none; transform: none; }
.btn.btn-lg { padding: 14px 26px; font-size: 1.05rem; border-radius: 12px; }

/* Cartes */
.card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)), var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.8);
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.2); outline: none; }

/* ---- Hero dragon ---- */
.hero-dragon {
    position: relative; overflow: hidden; margin-top: -40px; padding: 90px 0 110px;
    min-height: min(88vh, 760px); display: flex; align-items: center; text-align: center;
    background:
        radial-gradient(600px 380px at 50% 38%, rgba(var(--arcane-rgb), 0.20), transparent 70%),
        radial-gradient(900px 420px at 50% 115%, rgba(var(--accent-rgb), 0.35), transparent 70%),
        linear-gradient(180deg, #07060b 0%, #0e0a16 60%, var(--bg) 100%);
}
.embers { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-glow {
    position: absolute; left: 50%; top: 32%; width: 520px; height: 520px; transform: translate(-50%, -50%);
    border-radius: 50%; background: radial-gradient(circle, rgba(var(--arcane-rgb), 0.28), transparent 65%);
    filter: blur(10px); animation: pulse 6s ease-in-out infinite;
}
.hero-fade { position: absolute; left: 0; right: 0; bottom: 0; height: 120px; background: linear-gradient(180deg, transparent, var(--bg)); pointer-events: none; }
.hero-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.hero-emblem {
    width: 128px; height: 128px; image-rendering: pixelated;
    filter: drop-shadow(0 0 22px rgba(var(--arcane-rgb), 0.7)) drop-shadow(0 12px 18px rgba(0, 0, 0, 0.6));
    animation: float 5s ease-in-out infinite;
}
.eyebrow { text-transform: uppercase; letter-spacing: 3px; font-size: 0.78rem; font-weight: 700; color: var(--accent); margin: 18px 0 6px; }
.hero-title {
    font-family: var(--display); font-weight: 900; font-size: clamp(3rem, 12vw, 6.5rem); line-height: 1; margin: 0; letter-spacing: 4px;
    background: linear-gradient(180deg, #fff6e8 0%, #ffc38a 45%, #ff6b35 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    filter: drop-shadow(0 0 28px rgba(var(--accent-rgb), 0.45));
}
.hero-sub { color: #d9cfe6; font-size: clamp(1rem, 2.4vw, 1.2rem); max-width: 560px; margin: 14px auto 22px; }
.status-pill {
    display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
    background: rgba(0, 0, 0, 0.35); border: 1px solid var(--border); color: var(--muted); font-size: 0.9rem; backdrop-filter: blur(6px);
}
.status-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.status-pill.online { color: var(--text); }
.status-pill.online .dot { background: var(--success); box-shadow: 0 0 0 4px rgba(127, 227, 154, 0.2); animation: blink 2s ease-in-out infinite; }
.status-pill.offline .dot { background: var(--danger); }
.hero-ip { margin-top: 18px; background: rgba(0, 0, 0, 0.4); border-color: rgba(var(--accent-rgb), 0.35); backdrop-filter: blur(6px); }
.hero-ip .ip { font-size: 1.15rem; padding: 14px 18px; }
.hero-ip button { background: rgba(var(--accent-rgb), 0.15); color: var(--text); padding: 0 18px; }
.hero-ip button:hover { background: rgba(var(--accent-rgb), 0.3); }
.ip-box button.copied { color: var(--success); }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes pulse { 0%, 100% { opacity: 0.75; transform: translate(-50%, -50%) scale(1); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); } }
@keyframes blink { 0%, 100% { box-shadow: 0 0 0 4px rgba(127, 227, 154, 0.2); } 50% { box-shadow: 0 0 0 7px rgba(127, 227, 154, 0.05); } }

/* ---- Sections de la page d'accueil ---- */
.section { padding: 56px 0 8px; }
.section-title { text-align: center; max-width: 640px; margin: 0 auto 30px; }
.section-title .eyebrow { margin-top: 0; }
.section-title h2 { margin: 0 0 10px; }
.section-title p { margin: 0; }

.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step-card { text-align: center; padding: 28px 22px; }
.step-card h3 { margin: 14px 0 6px; }
.step-card p { margin: 0; }
.step-num {
    width: 46px; height: 46px; margin: 0 auto; border-radius: 12px; display: grid; place-items: center;
    font-family: var(--display); font-weight: 900; font-size: 1.3rem; color: var(--accent-ink);
    background: var(--fire); box-shadow: 0 6px 20px -6px rgba(var(--accent-rgb), 0.7);
}
.step-ip { display: inline-block; margin-top: 10px; font-family: var(--pixel); color: var(--accent-hover); }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature-card { padding: 24px; transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s, opacity 0.7s ease; }
.feature-card:hover { transform: translateY(-4px); border-color: rgba(var(--accent-rgb), 0.45); box-shadow: 0 18px 40px -20px rgba(var(--accent-rgb), 0.55); }
.feature-card h3 { margin: 14px 0 6px; font-size: 1.1rem; }
.feature-card p { margin: 0; font-size: 0.95rem; }
.feature-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; color: var(--accent); background: rgba(var(--accent-rgb), 0.12); border: 1px solid rgba(var(--accent-rgb), 0.3); }
.feature-icon svg { width: 26px; height: 26px; }

.numbers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; text-align: center; }
.number { padding: 26px 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.number .value {
    display: block; font-family: var(--display); font-weight: 900; font-size: clamp(2rem, 5vw, 2.8rem);
    background: linear-gradient(180deg, #ffe2c7, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.number .label { color: var(--muted); font-size: 0.9rem; }

.top-card { max-width: 640px; margin: 0 auto; padding: 8px; }
.ranking .pos.rank-1 { color: var(--gold); }
.ranking .pos.rank-2 { color: var(--silver); }
.ranking .pos.rank-3 { color: var(--bronze); }
.center-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }

.discord-band {
    display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 34px 36px; border-radius: 18px;
    background: radial-gradient(500px 200px at 0% 0%, rgba(88, 101, 242, 0.35), transparent 70%), linear-gradient(135deg, #1b1830, #141120);
    border: 1px solid rgba(120, 130, 255, 0.3);
}
.discord-band h2 { margin: 0 0 6px; }
.discord-band p { margin: 0; color: #cfd0f0; }

/* Apparition au defilement */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; transition-delay: var(--delay, 0ms); }
.reveal.in { opacity: 1; transform: none; }
.feature-card.reveal.in:hover { transform: translateY(-4px); transition-delay: 0ms; }

@media (max-width: 860px) {
    .steps-grid, .feature-grid { grid-template-columns: 1fr; }
    .numbers { grid-template-columns: repeat(2, 1fr); }
    .discord-band { flex-direction: column; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
    .hero-emblem, .hero-glow, .status-pill.online .dot { animation: none; }
    .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---- Pied de page ---- */
.site-footer { margin-top: 64px; padding: 40px 0 20px; background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.35)); border-top: 1px solid rgba(var(--accent-rgb), 0.15); }
.site-footer .container.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 28px; }
.footer-grid h4 { margin: 4px 0 12px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 2px; color: var(--text); }
.footer-grid a:not(.brand) { display: block; color: var(--muted); text-decoration: none; padding: 3px 0; font-size: 0.93rem; }
.footer-grid a:not(.brand):hover { color: var(--accent-hover); }
.footer-brand .brand { margin-bottom: 8px; display: inline-flex; }
.footer-brand p { margin: 0 0 10px; max-width: 300px; }
.footer-ip { font-family: var(--pixel); color: var(--accent-hover); }
.site-footer .container.footer-bottom { display: block; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border); text-align: center; font-size: 0.82rem; }
@media (max-width: 760px) {
    .site-footer .container.footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
}

/* Liens sous les formulaires etroits (connexion, inscription...) centres */
.container.narrow > p.muted.small { text-align: center; }

/* ---- Profil joueur ---- */
.player-link { color: inherit; text-decoration: none; }
.player-link:hover { color: var(--accent-hover); text-decoration: underline; }
.player-hero { display: flex; align-items: center; gap: 28px; padding: 26px 30px; flex-wrap: wrap; justify-content: center;
    background: radial-gradient(400px 200px at 10% 50%, rgba(var(--arcane-rgb), 0.18), transparent 70%), var(--surface); }
.player-skin img { height: 200px; image-rendering: pixelated; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.6)); }
.player-info { flex: 1; min-width: 220px; }
.player-name { text-align: left; margin: 4px 0 12px; font-size: clamp(2rem, 6vw, 3rem); }
.player-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.badge.rank-badge { background: rgba(244, 197, 66, 0.15); color: var(--gold); }
.badge.fire-badge { background: rgba(var(--accent-rgb), 0.15); color: var(--accent-hover); }
@media (max-width: 600px) { .player-info { text-align: center; } .player-name { text-align: center; } .player-badges { justify-content: center; } }

/* ---- Actualites ---- */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .news-grid { grid-template-columns: 1fr; } }
.news-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; text-decoration: none; color: var(--text); transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s, opacity 0.7s ease; }
.news-card:hover { color: var(--text); transform: translateY(-4px); border-color: rgba(var(--accent-rgb), 0.45); box-shadow: 0 18px 40px -20px rgba(var(--accent-rgb), 0.55); }
.news-card.reveal.in:hover { transform: translateY(-4px); transition-delay: 0ms; }
.news-thumb { aspect-ratio: 16 / 8; background: radial-gradient(circle at 50% 60%, rgba(var(--arcane-rgb), 0.3), transparent 60%), #0e0b15; background-size: cover; background-position: center; display: grid; place-items: center; border-bottom: 1px solid var(--border); }
.news-thumb img { width: 64px; height: 64px; image-rendering: pixelated; opacity: 0.85; filter: drop-shadow(0 0 12px rgba(var(--arcane-rgb), 0.6)); }
.news-content { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.news-content h3 { margin: 2px 0 2px; font-size: 1.1rem; }
.news-content p { margin: 0; flex: 1; }
.news-more { color: var(--accent-hover); font-weight: 600; font-size: 0.9rem; margin-top: 8px; }
.news-cover { width: 100%; border-radius: var(--radius); margin: 8px 0 18px; border: 1px solid var(--border); }
.news-body { padding: 24px 28px; font-size: 1.05rem; line-height: 1.75; }
.news-body p { margin: 0 0 16px; }
.news-body p:last-child { margin-bottom: 0; }

/* =====================================================================
   LES QUATRE TERRES — descente de l'accueil (ciel -> Eau -> Orage -> Feu -> Neant)
   ===================================================================== */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* ---- Ciel (le plus lumineux) ---- */
.hero-sky {
    position: relative; overflow: hidden; margin-top: -40px; padding: 56px 0 70px; text-align: center;
    background:
        radial-gradient(700px 420px at 50% 42%, rgba(255, 196, 120, 0.22), transparent 70%),
        radial-gradient(900px 500px at 50% 0%, rgba(177, 108, 255, 0.20), transparent 70%),
        linear-gradient(180deg, #2a2350 0%, #221c40 45%, #1a1834 100%);
}
.hero-logo {
    width: min(460px, 86vw); height: auto; margin: 0 auto;
    filter: drop-shadow(0 0 40px rgba(255, 190, 110, 0.35)) drop-shadow(0 20px 30px rgba(0, 0, 0, 0.5));
    animation: float 7s ease-in-out infinite;
}
.hero-quote { font-family: var(--display); font-size: clamp(1.05rem, 2.6vw, 1.35rem); font-style: italic; color: #f1e3c8; max-width: 620px; margin: 6px auto 20px; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6); }
.scroll-hint { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 34px; color: #cdbfe6; text-decoration: none; font-size: 0.85rem; letter-spacing: 1px; text-transform: uppercase; }
.scroll-hint:hover { color: #fff; }
.chevron { width: 14px; height: 14px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0) rotate(45deg); } 50% { transform: translateY(6px) rotate(45deg); } }

/* ---- Resume de la legende (transition ciel -> ocean) ---- */
.legend-intro {
    padding: 70px 0 90px; text-align: center;
    background: linear-gradient(180deg, #1a1834 0%, #152343 55%, #0d3354 100%);
}
.legend-intro .container { max-width: 720px; }
.legend-intro h2 { margin: 0 0 16px; }
.legend-intro p { color: #d6dcef; font-size: 1.05rem; line-height: 1.75; margin: 0 0 14px; }
.legend-intro strong { color: #ffd9a8; }
.legend-intro .legend-warning { font-family: var(--display); font-style: italic; color: #ffb27a; margin: 20px 0 24px; }

/* ---- La descente ---- */
.descent { position: relative; }
.land {
    position: relative; overflow: hidden; min-height: min(92vh, 820px); display: flex; align-items: center; padding: 90px 0;
    --land: var(--accent); --land-rgb: var(--accent-rgb);
}
.land-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1.15fr; gap: 56px; align-items: center; }
.land.flip .land-art { order: 2; }
.land-art { position: relative; display: grid; place-items: center; }
.land-art img { width: min(280px, 60vw); height: auto; image-rendering: pixelated; position: relative; animation: float 6s ease-in-out infinite; filter: drop-shadow(0 0 30px rgba(var(--land-rgb), 0.65)) drop-shadow(0 18px 24px rgba(0, 0, 0, 0.55)); }
.land-halo { position: absolute; width: 380px; height: 380px; border-radius: 50%; background: radial-gradient(circle, rgba(var(--land-rgb), 0.35), transparent 65%); filter: blur(6px); animation: pulse-soft 5s ease-in-out infinite; }
@keyframes pulse-soft { 0%, 100% { opacity: 0.7; transform: scale(1); } 50% { opacity: 1; transform: scale(1.08); } }
.land-depth { text-transform: uppercase; letter-spacing: 3px; font-size: 0.8rem; font-weight: 700; color: var(--land); margin: 0 0 8px; }
.land h2 { font-size: clamp(2rem, 5vw, 3.2rem); margin: 0 0 12px; line-height: 1.1;
    background: linear-gradient(180deg, #ffffff 0%, var(--land) 110%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.land-emoji { -webkit-text-fill-color: initial; color: initial; font-size: 0.8em; }
.land-tagline { font-family: var(--display); font-style: italic; font-size: 1.2rem; color: rgba(255, 255, 255, 0.9); margin: 0 0 14px; }
.land-desc { color: rgba(255, 255, 255, 0.72); font-size: 1.05rem; line-height: 1.75; margin: 0; max-width: 520px; }

.land-eau { --land: #4fd1ff; --land-rgb: 79, 209, 255;
    background: radial-gradient(800px 400px at 30% 30%, rgba(79, 209, 255, 0.18), transparent 70%), linear-gradient(180deg, #0d3354 0%, #0a2a47 55%, #081f36 100%); }
.land-orage { --land: #ffd23f; --land-rgb: 255, 210, 63;
    background: radial-gradient(800px 400px at 70% 25%, rgba(160, 170, 210, 0.16), transparent 70%), linear-gradient(180deg, #232636 0%, #1b1d2a 55%, #15161f 100%); }
.land-feu { --land: #ff6b35; --land-rgb: 255, 107, 53;
    background: radial-gradient(800px 420px at 30% 110%, rgba(255, 90, 30, 0.35), transparent 70%), linear-gradient(180deg, #2a0d07 0%, #200906 55%, #160503 100%); }
.land-neant { --land: #b16cff; --land-rgb: 177, 108, 255;
    background: radial-gradient(700px 420px at 70% 50%, rgba(157, 77, 255, 0.22), transparent 70%), linear-gradient(180deg, #0f0718 0%, #0a0512 55%, #06030b 100%); }

/* Eclairs de l'Orage */
.lightning { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(900px 500px at 65% 10%, rgba(255, 240, 180, 0.9), rgba(200, 210, 255, 0.25) 50%, transparent 75%); opacity: 0; }
.lightning.flash { animation: flash 0.9s ease-out; }
@keyframes flash { 0% { opacity: 0; } 4% { opacity: 0.55; } 9% { opacity: 0.05; } 14% { opacity: 0.35; } 30% { opacity: 0; } 100% { opacity: 0; } }

/* Couches de blocs entre les Terres */
.strata { height: 42px; background-repeat: repeat-x; background-size: 168px 42px; image-rendering: pixelated; position: relative; z-index: 2;
    box-shadow: inset 0 6px 8px -4px rgba(0, 0, 0, 0.6), inset 0 -6px 8px -4px rgba(0, 0, 0, 0.6); }
.strata-stone { background-image: url("/img/strata-stone.svg"); }
.strata-deepslate { background-image: url("/img/strata-deepslate.svg"); }
.strata-bedrock { background-image: url("/img/strata-bedrock.svg"); }
.strata-obsidian { background-image: url("/img/strata-obsidian.svg"); }

/* Jauge de profondeur (bord droit, visible pendant la descente) */
.depth-gauge { position: fixed; right: 22px; top: 50%; transform: translateY(-50%); z-index: 20; display: flex; flex-direction: column; gap: 22px; padding: 16px 10px; border-radius: 999px; opacity: 0; pointer-events: none; transition: opacity 0.4s; }
.depth-gauge::before { content: ""; position: absolute; left: 50%; top: 22px; bottom: 22px; width: 2px; transform: translateX(-50%); background: linear-gradient(180deg, #4fd1ff, #ffd23f, #ff6b35, #b16cff); opacity: 0.35; border-radius: 2px; }
.depth-gauge.visible { opacity: 1; pointer-events: auto; }
.gauge-stop { position: relative; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.gauge-dot { width: 12px; height: 12px; border-radius: 50%; background: #1b1726; border: 2px solid rgba(255, 255, 255, 0.35); transition: transform 0.25s, background 0.25s, box-shadow 0.25s; position: relative; z-index: 1; }
.gauge-label { position: absolute; right: 26px; white-space: nowrap; font-size: 0.8rem; font-weight: 700; color: #fff; background: rgba(0, 0, 0, 0.55); padding: 3px 9px; border-radius: 6px; opacity: 0; transform: translateX(6px); transition: opacity 0.25s, transform 0.25s; }
.gauge-stop:hover .gauge-label, .gauge-stop.active .gauge-label { opacity: 1; transform: none; }
.gauge-eau { --g: #4fd1ff; } .gauge-orage { --g: #ffd23f; } .gauge-feu { --g: #ff6b35; } .gauge-neant { --g: #b16cff; }
.gauge-stop.active .gauge-dot { background: var(--g); border-color: #fff; transform: scale(1.35); box-shadow: 0 0 14px var(--g); }

/* ---- Le sceau de KAOS (fin de la descente) ---- */
.seal { position: relative; overflow: hidden; padding: 110px 0 100px; text-align: center;
    background: radial-gradient(600px 360px at 50% 40%, rgba(255, 190, 110, 0.14), transparent 70%), linear-gradient(180deg, #06030b 0%, #080610 60%, var(--bg) 100%); }
.seal-inner { position: relative; z-index: 1; max-width: 700px; }
.seal-inner p { color: #d8cfe6; font-size: 1.08rem; line-height: 1.75; }
.seal-rune { position: relative; width: 170px; height: 170px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center;
    background: radial-gradient(circle, rgba(255, 200, 120, 0.25), rgba(40, 20, 60, 0.9) 60%); border: 2px solid rgba(255, 200, 120, 0.45);
    box-shadow: 0 0 40px rgba(255, 190, 110, 0.35), inset 0 0 30px rgba(177, 108, 255, 0.45); animation: seal-pulse 3.5s ease-in-out infinite; }
.seal-rune img { width: 96px; height: 96px; image-rendering: pixelated; filter: drop-shadow(0 0 14px rgba(177, 108, 255, 0.8)); }
.crack { position: absolute; background: linear-gradient(90deg, transparent, #ffd8a0, #fff, #ffd8a0, transparent); height: 2px; border-radius: 2px; box-shadow: 0 0 10px #ffc070; opacity: 0.85; }
.crack.c1 { width: 70px; top: 30%; left: 8%; transform: rotate(28deg); }
.crack.c2 { width: 60px; bottom: 26%; right: 6%; transform: rotate(-35deg); }
.crack.c3 { width: 46px; top: 58%; left: 18%; transform: rotate(-70deg); }
@keyframes seal-pulse { 0%, 100% { box-shadow: 0 0 40px rgba(255, 190, 110, 0.35), inset 0 0 30px rgba(177, 108, 255, 0.45); } 50% { box-shadow: 0 0 70px rgba(255, 190, 110, 0.55), inset 0 0 40px rgba(177, 108, 255, 0.7); } }
.seal h2 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); margin: 6px 0 14px; }

/* ---- Page de la legende ---- */
.legend-page { position: relative; margin-top: -40px; padding: 56px 0 20px;
    background: radial-gradient(900px 500px at 50% 0%, rgba(255, 196, 120, 0.14), transparent 70%), linear-gradient(180deg, #221c40 0%, var(--bg) 700px); }
.legend-page .container { position: relative; z-index: 1; }
.legend-logo { display: block; width: 220px; height: auto; margin: 0 auto 6px; filter: drop-shadow(0 0 30px rgba(255, 190, 110, 0.35)); }
.legend-quote { font-family: var(--display); font-style: italic; color: #f1e3c8 !important; }
.legend-chapter { margin: 36px 0 0; }
.legend-chapter h2 { margin: 0 0 16px; }
.legend-chapter p { font-size: 1.08rem; line-height: 1.85; color: #ddd4e8; margin: 0 0 14px; }
.legend-sep { text-align: center; color: var(--gold); font-size: 1.3rem; margin: 30px 0 0; opacity: 0.8; }
.legend-elements { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 22px 0 22px; }
.legend-element { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 16px 10px; border-radius: 12px; text-decoration: none; color: var(--text);
    background: var(--surface); border: 1px solid rgba(var(--el-rgb), 0.45); transition: transform 0.2s, box-shadow 0.2s; }
.legend-element:hover { color: var(--text); transform: translateY(-3px); box-shadow: 0 12px 30px -14px rgba(var(--el-rgb), 0.8); }
.legend-element img { width: 56px; height: 56px; image-rendering: pixelated; filter: drop-shadow(0 0 10px rgba(var(--el-rgb), 0.7)); }
.legend-element span { font-size: 0.82rem; color: var(--muted); }
.el-eau { --el-rgb: 79, 209, 255; } .el-orage { --el-rgb: 255, 210, 63; } .el-feu { --el-rgb: 255, 107, 53; } .el-neant { --el-rgb: 177, 108, 255; }
.legend-author { text-align: right; font-family: var(--display); font-style: italic; color: var(--muted); margin-top: 30px; }

@media (max-width: 860px) {
    .land { min-height: auto; padding: 70px 0; }
    .land-inner { grid-template-columns: 1fr; gap: 26px; text-align: center; }
    .land.flip .land-art { order: 0; }
    .land-desc { margin: 0 auto; }
    .land-art img { width: 190px; }
    .land-halo { width: 280px; height: 280px; }
    .depth-gauge { display: none; }
    .legend-elements { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
    .hero-logo, .land-art img, .land-halo, .seal-rune, .chevron { animation: none; }
    .lightning { display: none; }
}

.legend-page h1, .legend-page .legend-quote { text-align: center; margin-left: auto; margin-right: auto; }

/* =====================================================================
   ACCUEIL : UNE TERRE PAR ECRAN (Eau -> Orage -> Feu -> Neant -> bedrock)
   ===================================================================== */
body.home main { padding: 0; }
body.home .site-footer { margin-top: 0; }

/* Un coup de molette = une Terre (ordinateur uniquement, et si l'ecran est assez haut) */
@media (min-width: 900px) and (min-height: 640px) {
    html:has(body.home) { scroll-snap-type: y mandatory; scroll-padding-top: 61px; }
    body.home .world { scroll-snap-align: start; }
    body.home .world-bedrock { scroll-snap-align: none; }
    body.home .site-footer { scroll-snap-align: end; }
}

.world { position: relative; min-height: calc(100vh - 61px); min-height: calc(100svh - 61px); display: flex; align-items: center; padding: 70px 0 60px; isolation: isolate; }
.world-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; image-rendering: pixelated; image-rendering: crisp-edges; display: block; }
.world-shade { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.world-content { position: relative; z-index: 1; width: 100%; }
.world-content .section-title { margin-bottom: 26px; }
.world-content .section-title h2 { text-shadow: 0 3px 14px rgba(0, 0, 0, 0.75); }
.world-content .eyebrow { text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8); }
.world-badge { position: absolute; right: 18px; bottom: 16px; z-index: 1; font-size: 0.8rem; font-weight: 700; padding: 5px 12px; border-radius: 999px; background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(255, 255, 255, 0.15); color: #fff; backdrop-filter: blur(6px); }

/* Voile adapte a chaque decor pour garder le texte lisible */
.world-eau .world-shade { background: radial-gradient(ellipse 55% 60% at 50% 50%, rgba(8, 24, 48, 0.55), rgba(8, 24, 48, 0.1) 70%, transparent), linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 20, 50, 0.25)); }
.world-orage .world-shade { background: radial-gradient(ellipse 60% 60% at 50% 50%, rgba(10, 12, 20, 0.6), rgba(10, 12, 20, 0.2) 75%); }
.world-feu .world-shade { background: radial-gradient(ellipse 62% 62% at 50% 50%, rgba(20, 4, 2, 0.62), rgba(20, 4, 2, 0.2) 75%); }
.world-neant .world-shade { background: radial-gradient(ellipse 60% 62% at 50% 50%, rgba(4, 2, 10, 0.55), rgba(4, 2, 10, 0.15) 75%); }

/* Cartes en verre depoli par-dessus les decors */
.glass { background: rgba(12, 10, 20, 0.62) !important; border: 1px solid rgba(255, 255, 255, 0.12) !important; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.world-eau .glass { border-color: rgba(79, 209, 255, 0.35) !important; }
.world-orage .glass { border-color: rgba(255, 210, 63, 0.3) !important; }
.world-feu .glass { border-color: rgba(255, 107, 53, 0.35) !important; }
.world-neant .glass { border-color: rgba(177, 108, 255, 0.35) !important; }

/* Couleur d'accent de chaque Terre (eyebrow, numeros, icones) */
.world-eau { --w: #4fd1ff; } .world-orage { --w: #ffd23f; } .world-feu { --w: #ff6b35; } .world-neant { --w: #c38bff; }
.world .eyebrow { color: var(--w, var(--accent)); }
.world-orage .step-num { background: linear-gradient(180deg, #ffe27a, #e0a800); color: #1a1400; box-shadow: 0 6px 20px -6px rgba(255, 210, 63, 0.7); }
.world-feu .feature-icon { color: #ff9a5a; }
.world-neant .number .value { background: linear-gradient(180deg, #f1e2ff, #b16cff); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Accueil (Terre de l'Eau) */
.hero-content { display: flex; flex-direction: column; align-items: center; text-align: center; }
.world-eau .hero-logo { width: min(340px, 70vw, 40vh); height: auto; filter: drop-shadow(0 0 30px rgba(255, 220, 150, 0.45)) drop-shadow(0 14px 24px rgba(0, 0, 0, 0.55)); animation: float 7s ease-in-out infinite; }
.world-eau .hero-quote { margin: 6px auto 14px; }
.world-eau .hero-ip { margin-top: 14px; }
.world-eau .hero-actions { margin-top: 20px; }

/* Grille compacte des fonctionnalites (tient sur un ecran) */
.feature-grid.compact { gap: 14px; }
.feature-grid.compact .feature-card { display: flex; gap: 14px; align-items: flex-start; padding: 18px; }
.feature-grid.compact .feature-card h3 { margin: 2px 0 4px; font-size: 1.02rem; }
.feature-grid.compact .feature-card p { font-size: 0.9rem; }
.feature-grid.compact .feature-icon { flex: none; width: 42px; height: 42px; }

/* Chiffres + top voteurs (Terre du Neant) */
.world-neant .numbers { margin-bottom: 16px; }
.world-neant .number { padding: 18px 10px; border-radius: var(--radius); }
.world-neant .top-card { max-width: 620px; margin: 0 auto; padding: 10px 12px; }
.top-title { margin: 4px 8px 6px; font-weight: 700; }
.world-neant .center-actions { margin-top: 18px; }

/* Nuages de transition entre les Terres */
.cloud-divider { position: absolute; left: 0; right: 0; top: -34px; height: 68px; z-index: 3; pointer-events: none;
    background-repeat: repeat-x; background-size: 288px 72px; image-rendering: pixelated; animation: clouds-drift 60s linear infinite; }
.clouds-light { background-image: url("/img/clouds-light.svg"); }
.clouds-storm { background-image: url("/img/clouds-storm.svg"); }
.clouds-smoke { background-image: url("/img/clouds-smoke.svg"); }
.clouds-void { background-image: url("/img/clouds-void.svg"); }
@keyframes clouds-drift { from { background-position-x: 0; } to { background-position-x: 288px; } }

/* Le fond des mondes : bedrock */
.world-bedrock { min-height: auto; padding: 90px 0 50px;
    background: linear-gradient(180deg, rgba(4, 2, 8, 0.9), rgba(10, 10, 10, 0.55) 40%, rgba(10, 10, 10, 0.4)), url("/img/strata-bedrock.svg") repeat;
    background-size: auto, 256px 64px; image-rendering: pixelated; }
.world-bedrock .news-grid { margin-bottom: 28px; }
.world-bedrock .discord-band { background: radial-gradient(500px 200px at 0% 0%, rgba(88, 101, 242, 0.35), transparent 70%), rgba(18, 16, 30, 0.88); backdrop-filter: blur(6px); }
body.home .site-footer { background: linear-gradient(180deg, rgba(10, 10, 10, 0.55), rgba(0, 0, 0, 0.85)), url("/img/strata-bedrock.svg") repeat; background-size: auto, 256px 64px; border-top: none; image-rendering: pixelated; }
body.home .site-footer .footer-grid, body.home .site-footer .footer-bottom { image-rendering: auto; }

/* Titre de la descente sur la page Lore */
.lore-descent-title { text-align: center; padding: 60px 16px 20px; }
.lore-descent-title h2 { margin: 0; }

@media (max-width: 860px) {
    .world { min-height: auto; padding: 70px 0 64px; }
    .world-badge { display: none; }
    .feature-grid.compact { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .cloud-divider { animation: none; }
    .world-eau .hero-logo { animation: none; }
}
