/* ==================== LOGIN PAGE — Dark Gold Copper Theme ==================== */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Philosopher:wght@400;700&display=swap');

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

/* ────────────────────────────────────────────
   BACKGROUND — Ultra-dark warm, subtle gradient
   ──────────────────────────────────────────── */
body {
    font-family: var(--font-body, 'Philosopher', sans-serif);
    min-height: 100vh;
    min-height: 100dvh;
    min-height: var(--app-dvh, 100vh);
    display: flex;
    justify-content: flex-start;
    align-items: center;
    background: #050302;
    position: relative;
    overflow: hidden;
    /* Safe areas for notch/browser chrome */
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Dark warm tinted overlay — sits above both BG layers, below embers */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 2;
    background:
        radial-gradient(
            ellipse 90% 80% at 40% 50%,
            rgba(14, 10, 4, 0.55) 0%,
            rgba(10, 7, 3, 0.72) 40%,
            rgba(5, 3, 1, 0.88) 100%
        );
    pointer-events: none;
}

body::after {
    display: none !important;
}

/* ────────────────────────────────────────────
   BACKGROUND LAYER — Empty scene (breathing blur)
   ──────────────────────────────────────────── */
.login-bg-empty {
    position: fixed;
    inset: 0;
    z-index: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}
.login-bg-empty img {
    width: 100vw;
    height: auto;
    max-height: 74vh;
    object-fit: contain;
    animation: bgBreathe 6s ease-in-out infinite;
}
@keyframes bgBreathe {
    0%, 100% { filter: blur(2.5px) brightness(0.85); }
    50%      { filter: blur(0.5px) brightness(1.0); }
}

/* ────────────────────────────────────────────
   CHARACTERS LAYER — Slow drift + zoom + gold glow
   ──────────────────────────────────────────── */
.login-bg-characters {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    /* PNG has real alpha — no blend mode needed */
}
.login-bg-characters img {
    width: auto;
    height: auto;
    max-height: 74vh;
    object-fit: contain;
    /* 35% larger */
    scale: 1.15;
    /* Gold edge glow around visible character silhouettes */
    filter: drop-shadow(0 0 6px rgba(212, 168, 41, 0.45))
            drop-shadow(0 0 14px rgba(212, 168, 41, 0.25))
            drop-shadow(0 0 28px rgba(180, 130, 30, 0.15));
    animation: charDrift 28s ease-in-out infinite;
    transform-origin: center center;
}
@keyframes charDrift {
    0%       { transform: translateX(12px) scale(1); }
    50%      { transform: translateX(-12px) scale(1.015); }
    100%     { transform: translateX(12px) scale(1); }
}

/* ────────────────────────────────────────────
   EMBER PARTICLE CANVASES
   ──────────────────────────────────────────── */
.ember-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Behind container — blurred (depth-of-field far layer) */
.ember-back {
    z-index: 3;
    filter: blur(3px);
    mix-blend-mode: screen;
    opacity: 0.9;
}

/* In front of container — sharp foreground embers */
.ember-front {
    z-index: 10;
    filter: blur(0.5px);
    mix-blend-mode: screen;
}

/* ────────────────────────────────────────────
   CONTAINER
   ──────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: 480px;
    padding: var(--spacing-lg, 24px);
    margin-left: clamp(24px, 6vw, 100px);
    position: relative;
    z-index: 5;
}

/* ────────────────────────────────────────────
   LOGIN BOX — Oscillating heat-glow emanation
   ──────────────────────────────────────────── */
.login-box {
    background: rgba(14, 12, 8, 0.88);
    border-radius: 16px;
    padding: 44px 38px 36px;
    border: 1px solid rgba(212, 168, 41, 0.18);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    position: relative;
    animation: fadeInScale 0.9s cubic-bezier(0.22, 1, 0.36, 1);
    /* Multi-layer oscillating glow */
    box-shadow:
        0 0 30px rgba(212, 168, 41, 0.08),
        0 0 60px rgba(212, 168, 41, 0.06),
        0 0 120px rgba(212, 168, 41, 0.04),
        0 8px 40px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(230, 190, 70, 0.08);
}

/* Animated glow halo around the box */
.login-box::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 18px;
    background: transparent;
    box-shadow:
        0 0 40px rgba(212, 168, 41, 0.12),
        0 0 80px rgba(212, 168, 41, 0.08),
        0 0 160px rgba(180, 130, 30, 0.06);
    animation: heatPulse 4s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

/* Inner radiant glow (top-center warmth) */
.login-box::after {
    content: '';
    position: absolute;
    top: -1px;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(212, 168, 41, 0.5) 30%,
        rgba(235, 195, 75, 0.7) 50%,
        rgba(212, 168, 41, 0.5) 70%,
        transparent 100%
    );
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(212, 168, 41, 0.4);
    animation: borderGlow 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes heatPulse {
    0%, 100% {
        box-shadow:
            0 0 40px rgba(212, 168, 41, 0.10),
            0 0 80px rgba(212, 168, 41, 0.06),
            0 0 160px rgba(180, 130, 30, 0.04);
    }
    50% {
        box-shadow:
            0 0 50px rgba(212, 168, 41, 0.20),
            0 0 100px rgba(212, 168, 41, 0.12),
            0 0 200px rgba(180, 130, 30, 0.08);
    }
}

@keyframes borderGlow {
    0%, 100% {
        opacity: 0.5;
        box-shadow: 0 0 15px rgba(212, 168, 41, 0.3);
    }
    50% {
        opacity: 1;
        box-shadow: 0 0 30px rgba(212, 168, 41, 0.6);
    }
}

@keyframes fadeInScale {
    from {
        transform: scale(0.92) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* ────────────────────────────────────────────
   TITLE — "Welcome to" small + "Little Monsters Realm" glow
   ──────────────────────────────────────────── */
h1 {
    text-align: center;
    margin-bottom: 32px;
    line-height: 1.2;
    position: relative;
}

h1::before,
h1::after {
    display: none;
}

.login-brand-title {
    line-height: 0;
}

.login-brand-logo {
    display: block;
    width: min(100%, 340px);
    height: auto;
    max-height: 142px;
    margin: 0 auto;
    object-fit: contain;
    filter:
        drop-shadow(0 3px 2px rgba(0, 0, 0, 0.72))
        drop-shadow(0 0 14px rgba(212, 168, 41, 0.2));
}

.title-welcome {
    display: block;
    font-family: var(--sp-font-heading, 'Cinzel', serif);
    font-size: 0.85rem;
    font-weight: 400;
    color: rgba(212, 180, 100, 0.6);
    letter-spacing: 5px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.title-game {
    font-family: var(--sp-font-title, 'Cinzel Decorative', 'Cinzel', serif);
    font-size: 2.4rem;
    font-weight: 700;
    color: #5eadff;
    letter-spacing: 3px;
    text-shadow:
        0 0 12px rgba(94, 173, 255, 0.6),
        0 0 30px rgba(94, 173, 255, 0.3),
        0 0 60px rgba(60, 140, 255, 0.15),
        0 2px 0 rgba(0, 0, 0, 0.5);
    animation: titleGlow 4s ease-in-out infinite;
}

.title-realm {
    font-family: var(--sp-font-title, 'Cinzel Decorative', 'Cinzel', serif);
    font-size: 1.5rem;
    font-weight: 600;
    color: rgba(140, 190, 255, 0.7);
    letter-spacing: 6px;
    text-shadow:
        0 0 8px rgba(94, 173, 255, 0.3),
        0 0 20px rgba(94, 173, 255, 0.1);
    animation: titleGlow 4s ease-in-out infinite;
    animation-delay: 0.5s;
}

@keyframes titleGlow {
    0%, 100% {
        text-shadow:
            0 0 12px rgba(94, 173, 255, 0.5),
            0 0 30px rgba(94, 173, 255, 0.25),
            0 0 60px rgba(60, 140, 255, 0.1),
            0 2px 0 rgba(0, 0, 0, 0.5);
    }
    50% {
        text-shadow:
            0 0 18px rgba(94, 173, 255, 0.8),
            0 0 45px rgba(94, 173, 255, 0.4),
            0 0 90px rgba(60, 140, 255, 0.2),
            0 2px 0 rgba(0, 0, 0, 0.5);
    }
}

/* ────────────────────────────────────────────
   FORM HEADINGS
   ──────────────────────────────────────────── */
h2 {
    font-family: var(--sp-font-heading, 'Cinzel', serif);
    color: rgba(220, 190, 100, 0.8);
    font-size: 1.4em;
    text-align: center;
    margin-bottom: var(--spacing-lg, 20px);
    text-shadow: 0 0 8px rgba(212, 168, 41, 0.15);
    letter-spacing: 1px;
}

/* ────────────────────────────────────────────
   FORM CONTAINERS
   ──────────────────────────────────────────── */
.form-container {
    display: none;
}

.form-container.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ────────────────────────────────────────────
   INPUT FIELDS
   ──────────────────────────────────────────── */
.input-group {
    margin-bottom: var(--spacing-lg, 20px);
}

.input-group label {
    display: block;
    color: rgba(212, 180, 100, 0.7);
    font-family: var(--sp-font-heading, 'Cinzel', serif);
    font-size: 0.85em;
    margin-bottom: 8px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    width: 100%;
    padding-right: 50px;
}

.toggle-password {
    position: absolute;
    right: 15px;
    font-size: 1.3em;
    cursor: pointer;
    user-select: none;
    transition: all 0.25s ease;
    opacity: 0.5;
    filter: grayscale(100%);
}

.toggle-password:hover {
    opacity: 1;
    transform: scale(1.1);
    filter: grayscale(0%);
}

.toggle-password.active {
    opacity: 1;
    filter: grayscale(0%);
}

.input-group input {
    width: 100%;
    padding: 14px 18px;
    font-family: var(--sp-font-body, 'Philosopher', sans-serif);
    font-size: 1em;
    background: rgba(20, 15, 8, 0.7);
    border: 1px solid rgba(212, 168, 41, 0.15);
    border-radius: 10px;
    color: #f5e6c8;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
}

.input-group input::placeholder {
    color: rgba(180, 150, 60, 0.3);
}

.input-group input:focus {
    border-color: rgba(212, 168, 41, 0.5);
    box-shadow:
        inset 0 2px 8px rgba(0, 0, 0, 0.4),
        0 0 16px rgba(212, 168, 41, 0.15);
}

/* ────────────────────────────────────────────
   BUTTON
   ──────────────────────────────────────────── */
.btn-primary {
    width: 100%;
    padding: 14px;
    font-family: var(--sp-font-heading, 'Cinzel', serif);
    font-size: 1.1em;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(180deg, #c89420 0%, #9a6e15 60%, #6b4c10 100%);
    border: 1px solid rgba(212, 168, 41, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.35s ease;
    box-shadow:
        0 4px 20px rgba(200, 148, 32, 0.25),
        0 0 30px rgba(200, 148, 32, 0.08);
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    margin-top: var(--spacing-md, 16px);
}

.btn-primary:hover {
    background: linear-gradient(180deg, #daa830 0%, #b07e1a 60%, #856014 100%);
    transform: translateY(-3px);
    box-shadow:
        0 8px 30px rgba(200, 148, 32, 0.4),
        0 0 50px rgba(200, 148, 32, 0.15);
}

.btn-primary:active {
    transform: translateY(-1px);
}

/* ────────────────────────────────────────────
   LINKS
   ──────────────────────────────────────────── */
.forgot-password {
    text-align: center;
    margin-top: var(--spacing-md, 16px);
    margin-bottom: var(--spacing-md, 16px);
}

.forgot-password a {
    color: rgba(212, 180, 100, 0.5);
    text-decoration: none;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.forgot-password a:hover {
    color: #d4a829;
    text-shadow: 0 0 8px rgba(212, 168, 41, 0.3);
}

.switch-form {
    text-align: center;
    margin-top: var(--spacing-lg, 20px);
    color: rgba(200, 175, 100, 0.5);
    font-size: 0.95em;
}

.switch-form a {
    color: #d4a829;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    text-shadow: 0 0 5px rgba(212, 168, 41, 0.15);
}

.switch-form a:hover {
    color: #e8c34a;
    text-shadow: 0 0 12px rgba(212, 168, 41, 0.4);
}

.form-description {
    text-align: center;
    color: rgba(200, 175, 100, 0.5);
    font-size: 0.9em;
    margin-bottom: var(--spacing-lg, 20px);
    line-height: 1.5;
    padding: 0 var(--spacing-md, 16px);
}

/* ────────────────────────────────────────────
   SERVER / LOCAL-CACHE ACCOUNT NOTICE
   ──────────────────────────────────────────── */
.server-notice {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    width: min(100%, 430px);
    margin: -6px auto 20px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.44);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow:
        0 8px 22px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.server-notice-icon {
    flex: 0 0 auto;
    font-size: 0.95em;
    line-height: 1.45;
    filter: drop-shadow(0 0 5px rgba(255, 196, 57, 0.45));
}

.server-notice-text {
    margin: 0;
    color: #fff;
    font-size: 0.76em;
    line-height: 1.45;
    text-align: left;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
}

.server-notice-text strong {
    color: #fff;
    font-weight: 700;
}

/* ────────────────────────────────────────────
   ERROR / SUCCESS MESSAGES
   ──────────────────────────────────────────── */
.error-message {
    color: #f87171;
    background: rgba(248, 113, 113, 0.12);
    padding: var(--spacing-md, 16px);
    border-radius: 10px;
    margin-bottom: var(--spacing-md, 16px);
    text-align: center;
    font-weight: bold;
    border: 1px solid rgba(248, 113, 113, 0.25);
    display: none;
}

.error-message.show {
    display: block;
    animation: shake 0.5s ease;
}

.success-message {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.12);
    padding: var(--spacing-md, 16px);
    border-radius: 10px;
    margin-bottom: var(--spacing-md, 16px);
    text-align: center;
    font-weight: bold;
    border: 1px solid rgba(74, 222, 128, 0.25);
    display: none;
}

.success-message.show {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* ────────────────────────────────────────────
   DEV SKIP BUTTON
   ──────────────────────────────────────────── */
.dev-skip-btn {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 9999;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.2);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.dev-skip-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

/* ────────────────────────────────────────────
   MOBILE — Full-width centered login box
   ──────────────────────────────────────────── */
@media (max-width: 768px) {
    body {
        justify-content: center;
        align-items: center;
        min-height: 100dvh;
        min-height: var(--app-dvh, 100vh);
    }

    .login-bg-empty,
    .login-bg-characters {
        align-items: flex-start;
    }

    .login-bg-empty img {
        max-height: var(--app-dvh, 100vh);
        width: 100%;
        height: auto;
        object-fit: cover;
    }

    .login-bg-characters img {
        max-height: var(--app-dvh, 100vh);
        width: auto;
        height: 100%;
        object-fit: cover;
        scale: 1;
    }

    .container {
        margin-left: auto;
        margin-right: auto;
        max-width: 94vw;
        padding: 16px;
    }

    .login-box {
        padding: 28px 20px 24px;
        border-radius: 14px;
    }

    h1 {
        margin-bottom: 20px;
    }

    .login-brand-logo {
        width: min(100%, 300px);
        max-height: 125px;
    }

    .title-game {
        font-size: 1.8rem;
        letter-spacing: 2px;
    }

    .title-realm {
        font-size: 1.1rem;
        letter-spacing: 4px;
    }

    h2 {
        font-size: 1.2em;
        margin-bottom: 14px;
    }

    .input-group {
        margin-bottom: 14px;
    }

    .input-group input {
        padding: 12px 14px;
        font-size: 1em;
    }

    .btn-primary {
        padding: 12px;
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .container {
        max-width: 100vw;
        padding: 10px;
    }

    .login-box {
        padding: 22px 16px 20px;
        border-radius: 12px;
    }

    .login-brand-logo {
        width: min(100%, 260px);
        max-height: 108px;
    }

    .title-game {
        font-size: 1.5rem;
    }

    .title-realm {
        font-size: 0.95rem;
    }

    h2 {
        font-size: 1.05em;
    }

    .input-group input {
        padding: 10px 12px;
        font-size: 0.95em;
    }

    .btn-primary {
        padding: 10px;
        font-size: 0.9em;
    }

    .switch-form,
    .forgot-password {
        font-size: 0.85em;
    }
}

/* Very short viewport (browser chrome eating space) */
@media (max-height: 600px) {
    .login-box {
        padding: 18px 16px 16px;
    }

    h1 {
        margin-bottom: 12px;
    }

    .login-brand-logo {
        width: min(100%, 235px);
        max-height: 98px;
    }

    .title-game {
        font-size: 1.3rem;
    }

    .input-group {
        margin-bottom: 10px;
    }

    .input-group input {
        padding: 8px 12px;
    }

    .btn-primary {
        padding: 8px;
        margin-top: 8px;
    }

    .forgot-password,
    .switch-form {
        margin-top: 8px;
    }
}

/* ---------------------------------------------------------------------------
   Connexion par Discord (Phase 1 — comptes réels)
   Le bouton se cache tout seul si Supabase n'est pas configuré (login.js).
--------------------------------------------------------------------------- */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 14px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.18);
}

.btn-discord {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid rgba(88, 101, 242, 0.55);
    border-radius: 8px;
    background: #5865f2;
    color: #fff;
    font: inherit;
    font-weight: 600;
    transition: background 0.18s ease, transform 0.12s ease, opacity 0.18s ease;
}

.btn-discord:hover { background: #4752c4; }
.btn-discord:active { transform: translateY(1px); }
.btn-discord:disabled { opacity: 0.6; }

.btn-discord svg {
    width: 22px;
    height: 17px;
    flex: none;
}

/* ────────────────────────────────────────────
   CLOSED ALPHA — clé réservée, acceptation des Conditions
   ──────────────────────────────────────────── */
.terms-check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 4px 0 12px;
    font-size: 0.85rem;
    line-height: 1.45;
    color: rgba(232, 220, 200, 0.75);
    cursor: pointer;
}

.terms-check input {
    flex: none;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: #d4a829;
}

.terms-check a,
.alpha-need-key a {
    color: #aee0ff;
    text-decoration: underline;
}

.alpha-key-badge,
.alpha-need-key {
    margin: 0 0 14px;
    padding: 10px 12px;
    font-size: 0.85rem;
    line-height: 1.45;
    text-align: center;
    border-radius: 4px;
}

.alpha-key-badge {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: rgba(232, 220, 200, 0.8);
    background: rgba(94, 173, 255, 0.08);
    border: 1px solid rgba(94, 173, 255, 0.45);
}

.alpha-key-badge strong {
    font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
    letter-spacing: 0.08em;
    color: #ffe7a0;
}

.alpha-need-key {
    color: #ffb4a8;
    background: rgba(255, 120, 100, 0.08);
    border: 1px solid rgba(255, 138, 122, 0.45);
}

.alpha-key-badge[hidden],
.alpha-need-key[hidden],
.alpha-only[hidden] {
    display: none;
}

/* ════════════════════════════════════════════════════════════════════════
   THÈME CUIVRE & CRISTAL — même langage que la page Closed Alpha et l'écran
   « Playing on another device » : cadre cuivre-or à coins coupés, titres en
   or dégradé, lingot d'or pour l'action principale, touches de cristal bleu.
   Ajouté en fin de fichier : il remplace l'ancien habillage sans rien casser
   des sélecteurs utilisés par login.js.
   ════════════════════════════════════════════════════════════════════════ */
:root {
    --lg-gold: #d4a829;
    --lg-gold-light: #f5d74e;
    --lg-gold-pale: #ffe7a0;
    --lg-copper: #b87333;
    --lg-parchment: #e8dcc8;
    --lg-dim: rgba(232, 220, 200, 0.7);
    --lg-crystal: #5eadff;
    --lg-crystal-light: #aee0ff;
}

body {
    overflow-x: hidden;
    overflow-y: auto;
}

/* Ordinateur : cadré à gauche, les monstres du décor restent visibles à droite.
   Téléphone : centré (voir la règle max-width: 768px plus bas). */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 460px;
    margin: 0 auto 0 clamp(24px, 6vw, 100px);
    padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

/* ---------------------------------------------------------------- logo */
.container > .login-brand-title {
    margin: 0;
    animation: fadeInScale 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.container > .login-brand-title .login-brand-logo {
    width: min(84vw, 400px);
    max-height: none;
    filter:
        drop-shadow(0 4px 3px rgba(0, 0, 0, 0.75))
        drop-shadow(0 0 22px rgba(212, 168, 41, 0.28));
    animation: lgLogoFloat 7s ease-in-out infinite;
}

.login-divider {
    position: relative;
    width: min(70%, 280px);
    height: 16px;
    margin: 10px auto 16px;
}

.login-divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--lg-copper) 20%, var(--lg-gold-light) 50%, var(--lg-copper) 80%, transparent);
}

.login-gem {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 12px;
    height: 12px;
    transform: translate(-50%, -50%) rotate(45deg);
    border: 1px solid var(--lg-gold-light);
    background: linear-gradient(135deg, #e8f6ff 0%, var(--lg-crystal-light) 30%, var(--lg-crystal) 65%, #1f5fa8 100%);
    box-shadow: 0 0 10px rgba(94, 173, 255, 0.9), 0 0 22px rgba(94, 173, 255, 0.45);
    animation: lgGem 2.8s ease-in-out infinite;
}

/* ---------------------------------------------------------------- carte */
.login-box {
    --cut: 8px;
    width: 100%;
    padding: 30px 28px 26px;
    border: 0;
    border-radius: 0;
    background: linear-gradient(160deg, rgba(34, 24, 14, 0.94) 0%, rgba(14, 10, 6, 0.95) 60%, rgba(26, 17, 9, 0.94) 100%);
    clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% calc(100% - var(--cut)),
        calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 calc(100% - var(--cut)), 0 var(--cut));
    box-shadow: none;
    /* Pas de filter ici : ça dédoublait LOGIN / EMAIL (background-clip + ombre). */
    filter: none;
    animation: fadeInScale 0.9s 0.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Cadre cuivre et or, dessiné le long des coins coupés. */
.login-box::before {
    inset: 0;
    z-index: 0;
    padding: 2px;
    border-radius: 0;
    background: linear-gradient(135deg, #d4a84a, #b87333 30%, #8a5222 50%, #b87333 70%, #d4a84a);
    clip-path: inherit;
    box-shadow: none;
    filter: drop-shadow(0 18px 36px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 18px rgba(212, 168, 41, 0.18));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    animation: none;
}

.login-box::after { display: none; }

.login-box > * { position: relative; z-index: 1; }

/* ---------------------------------------------------------------- titres */
h2 {
    margin-bottom: 18px;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1.45em;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-shadow: none;
    background: linear-gradient(180deg, var(--lg-gold-pale) 0%, var(--lg-gold-light) 40%, var(--lg-gold) 70%, var(--lg-copper) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.form-description {
    color: var(--lg-dim);
}

/* ---------------------------------------------------------------- champs */
.input-group { margin-bottom: 16px; }

.input-group label {
    color: rgba(245, 215, 78, 0.72);
    font-size: 0.78em;
    letter-spacing: 0.18em;
}

.input-group input {
    min-height: 48px;
    padding: 12px 14px;
    color: var(--lg-parchment);
    background: rgba(5, 3, 2, 0.72);
    border: 1px solid rgba(212, 168, 41, 0.42);
    border-radius: 4px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.45);
}

.input-group input::placeholder { color: rgba(232, 220, 200, 0.32); }

.input-group input:focus {
    border-color: var(--lg-crystal);
    box-shadow:
        inset 0 2px 8px rgba(0, 0, 0, 0.45),
        0 0 0 3px rgba(94, 173, 255, 0.18),
        0 0 18px rgba(94, 173, 255, 0.22);
}

/* ---------------------------------------------------------------- bouton principal : lingot d'or */
.btn-primary {
    min-height: 50px;
    margin-top: 6px;
    padding: 12px 22px;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1em;
    letter-spacing: 0.12em;
    color: #1a1006;
    text-shadow: 0 1px 0 rgba(255, 231, 160, 0.6);
    background: linear-gradient(180deg, var(--lg-gold-pale) 0%, var(--lg-gold-light) 18%, var(--lg-gold) 55%, var(--lg-copper) 100%);
    border: 1px solid var(--lg-gold-light);
    border-radius: 0;
    clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 12px 100%, 0 50%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -2px 0 rgba(90, 58, 26, 0.45);
    filter: drop-shadow(0 0 6px rgba(94, 173, 255, 0.45)) drop-shadow(0 0 14px rgba(94, 173, 255, 0.18));
    transition: filter 0.2s ease, transform 0.12s ease;
}

.btn-primary:hover,
.btn-primary:focus-visible {
    outline: none;
    background: linear-gradient(180deg, var(--lg-gold-pale) 0%, var(--lg-gold-light) 18%, var(--lg-gold) 55%, var(--lg-copper) 100%);
    transform: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -2px 0 rgba(90, 58, 26, 0.45);
    filter: brightness(1.08) drop-shadow(0 0 10px rgba(94, 173, 255, 0.85)) drop-shadow(0 0 20px rgba(94, 173, 255, 0.4));
}

.btn-primary:active { transform: translateY(1px) scale(0.99); }
.btn-primary:disabled { cursor: wait; filter: saturate(0.6) brightness(0.8); }

/* ---------------------------------------------------------------- Discord : bronze, logo en couleur */
.auth-divider {
    color: rgba(245, 215, 78, 0.55);
    font-family: 'Cinzel', Georgia, serif;
    letter-spacing: 0.2em;
}

.auth-divider::before,
.auth-divider::after {
    background: linear-gradient(90deg, transparent, rgba(184, 115, 51, 0.8), transparent);
}

.btn-discord {
    min-height: 48px;
    font-family: 'Cinzel', Georgia, serif;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--lg-gold-pale);
    background: linear-gradient(180deg, rgba(60, 42, 20, 0.95), rgba(26, 17, 9, 0.95));
    border: 1px solid rgba(212, 168, 41, 0.55);
    border-radius: 4px;
    transition: filter 0.2s ease, border-color 0.2s ease, transform 0.12s ease;
}

.btn-discord svg { color: #8c96ff; filter: drop-shadow(0 0 6px rgba(88, 101, 242, 0.7)); }

.btn-discord:hover,
.btn-discord:focus-visible {
    outline: none;
    background: linear-gradient(180deg, rgba(72, 50, 24, 0.95), rgba(30, 20, 10, 0.95));
    border-color: var(--lg-crystal);
    filter: drop-shadow(0 0 10px rgba(94, 173, 255, 0.45));
}

/* ---------------------------------------------------------------- liens */
.forgot-password a { color: var(--lg-dim); }
.forgot-password a:hover { color: var(--lg-crystal-light); }

.switch-form { color: var(--lg-dim); }

.switch-form a {
    color: var(--lg-crystal-light);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-shadow: none;
}

.switch-form a:hover { color: #fff; text-shadow: 0 0 10px rgba(94, 173, 255, 0.6); }

/* ---------------------------------------------------------------- avertissement : encadré cristal */
.server-notice {
    width: 100%;
    margin: 0 0 20px;
    padding: 11px 14px;
    border-radius: 4px;
    background: rgba(94, 173, 255, 0.07);
    border: 1px solid rgba(94, 173, 255, 0.42);
    box-shadow: inset 0 0 18px rgba(94, 173, 255, 0.06);
}

.server-notice-icon {
    position: relative;
    flex: none;
    width: 10px;
    height: 10px;
    margin: 6px 4px 0 2px;
    font-size: 0;
    transform: rotate(45deg);
    border: 1px solid var(--lg-gold-light);
    background: linear-gradient(135deg, #e8f6ff 0%, var(--lg-crystal-light) 30%, var(--lg-crystal) 65%, #1f5fa8 100%);
    box-shadow: 0 0 8px rgba(94, 173, 255, 0.8);
}

.server-notice-text { color: var(--lg-dim); }
.server-notice-text strong { color: var(--lg-gold-pale); }

/* ---------------------------------------------------------------- messages */
.error-message { color: #ff8a7a; }
.success-message { color: #7fe0a8; }

/* ---------------------------------------------------------------- animations */
@keyframes lgLogoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes lgGem {
    0%, 100% { box-shadow: 0 0 8px rgba(94, 173, 255, 0.7), 0 0 18px rgba(94, 173, 255, 0.3); }
    50% { box-shadow: 0 0 14px rgba(174, 224, 255, 1), 0 0 30px rgba(94, 173, 255, 0.6); }
}

@media (max-width: 768px) {
    /* Place sous la carte : le bouton de réglages est fixé en bas à gauche. */
    body { justify-content: center; }
    .container { max-width: 100%; margin: 0 auto; padding-bottom: calc(max(24px, env(safe-area-inset-bottom)) + 72px); }
    .login-box { --cut: 7px; padding: 24px 18px 20px; }
    .container > .login-brand-title .login-brand-logo { width: min(80vw, 320px); }
}

@media (max-height: 700px) {
    .container > .login-brand-title .login-brand-logo { width: min(70vw, 260px); }
    .login-divider { margin: 6px auto 10px; }
}

/* ---------------------------------------------------------------- fond pleine largeur
   Le décor (1536×672) occupe toute la largeur de l'écran à ses proportions,
   centré verticalement : sur un écran plus haut que large relativement, des
   bandes noires apparaissent en haut et en bas (le fond de page est noir).
   Les personnages (2065×672) gardent la même hauteur que le décor : ils ne
   débordent plus et restent calés sur la scène. */
:root {
    --lg-bg-h: calc(100vw * 672 / 1536);
}

.login-bg-empty,
.login-bg-characters {
    display: block;
    overflow: hidden;
}

.login-bg-empty img,
.login-bg-characters img {
    position: absolute;
    left: 50%;
    top: 50%;
    translate: -50% -50%;
    width: auto;
    max-width: none;
    height: var(--lg-bg-h);
    max-height: none;
    object-fit: initial;
}

.login-bg-characters img { scale: 1; }

/* Téléphone (portrait) : une bande de 44 % de la largeur serait minuscule.
   Le décor reprend toute la hauteur, comme avant. */
@media (max-aspect-ratio: 4 / 5) {
    :root { --lg-bg-h: var(--app-dvh, 100dvh); }
}

@media (prefers-reduced-motion: reduce) {
    .container > .login-brand-title .login-brand-logo,
    .login-gem { animation: none; }
}

/* « Remember me » : case cuivrée, discrète, sous le mot de passe. */
.remember-me {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0 12px;
    color: rgba(232, 220, 200, 0.8);
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}
.remember-me input {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    margin: 0;
    border: 1px solid rgba(212, 168, 74, 0.8);
    border-radius: 3px;
    background: rgba(10, 7, 4, 0.8);
    display: grid;
    place-content: center;
    cursor: pointer;
}
.remember-me input::before {
    content: '';
    width: 10px;
    height: 10px;
    transform: scale(0);
    transition: transform 0.12s ease;
    background: linear-gradient(135deg, #ffe7a0, #d4a829);
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0, 43% 62%);
}
.remember-me input:checked::before {
    transform: scale(1);
}
.remember-me input:focus-visible {
    outline: 2px solid rgba(94, 173, 255, 0.8);
    outline-offset: 2px;
}
