:root {
    --bg-1: #272525;
    --bg-2: #272525ee;
    --card-bg: rgba(255, 255, 255, 0.03);
    --accent: #ff8800;
    --muted: rgba(255, 255, 255, 0.75);
    --btn-bg: rgba(255, 255, 255, 0.06);
    --btn-hover: #ff880048;
    /* --btn-hover: rgba(255, 255, 255, 0.12); */
}

* {
    box-sizing: border-box
}

html {
    height: 100%;
    margin: 0;
}

body {
    min-height: 100%;
    margin: 0;
    font-family: Inter, system-ui, Segoe UI, Roboto, "Helvetica Neue", Arial;
    background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 100%) fixed;
    color: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

/* Header */
.hero {
    text-align: center;
    margin: 12px 0 22px;
}

.hero h1 {
    margin: 0;
    font-size: clamp(20px, 3.5vw, 36px);
    color: var(--accent);
    letter-spacing: 0.4px;
}

.hero .subtitle {
    color: var(--muted);
    margin-top: 8px
}

/* Layout */
.content {
    width: 100%;
    max-width: 1100px;
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 20px;
    align-items: start;
    flex: 1;
    margin: 20px 0;
}

@media (min-width: 600px) {
    .content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .content {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Card */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.visitor-count {
    font-size: 2.5em;
    font-weight: bold;
    color: var(--accent);
    text-align: center;
    font-family: 'Inter', monospace;
    margin: 10px 0;
    text-shadow: 0 0 10px rgba(255, 136, 0, 0.3);
}

.card h2 {
    margin: 0 0 10px 0;
    color: #fff;
    font-size: 18px
}

.card p {
    color: var(--muted);
    margin: 0 0 12px 0
}

/* Buttons */
.card .buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card .buttons button,
.card .buttons a {
    width: 100%;
    text-align: center;
}

.buttons {
    display: flex;
    flex-direction: column;
    gap: 8px
}

.btn {
    display: inline-block;
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--btn-bg);
    color: #fff;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: background .18s, transform .08s;
}

.btn:hover {
    background: var(--btn-hover);
    transform: translateY(-2px)
}

.donate .donate-btn {
    width: 100%;
    background: linear-gradient(90deg, #ff7b7b, #ff1b2e);
    color: #fff;
    font-weight: 600;
    text-align: center;
}

/* Footer */
.footer {
    margin-top: 22px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 18px
}

/* Responsive tweaks */
@media (min-width:900px) {
    .buttons {
        flex-direction: row;
        flex-wrap: wrap
    }

    .btn {
        min-width: 160px
    }
}

/* --- LAYOUT GLOBAL --- */

/* Conteneur principal qui garde les cartes centrées */
.main-container {
    width: 100%;
    max-width: 1100px; /* Largeur d'origine pour garder vos 3 colonnes compactes */
    margin: 0 auto;    /* Centre le bloc principal */
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Grille des cartes (votre design actuel) */
.content {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 20px;
}

/* Style de base de la sidebar (mobile/tablette) */
.sidebar-right {
    width: 100%;
    margin-top: 20px; /* Espace si elle est en dessous */
    background: var(--card-bg);
    border-radius: 12px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--muted);
}

/* Mise en forme du Markdown */
#markdown-content {
    line-height: 1.5;
    font-size: 0.95em;
}
#markdown-content h1, #markdown-content h2 { margin-top: 0; color: var(--accent); font-size: 1.3em; }
#markdown-content ul { padding-left: 20px; }


/* --- RESPONSIVE DES CARTES --- */
@media (min-width: 600px) { .content { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .content { grid-template-columns: repeat(3, 1fr); } }


/* --- MODE "WIDGET FLOTTANT" À DROITE --- */
@media (min-width: 1500px) {
    .sidebar-right {
        position: fixed;
        right: 20px;
        
        /* --- CENTRAGE VERTICAL --- */
        top: 50%;                  /* Le haut de la boite se met au milieu de l'écran */
        transform: translateY(-50%); /* On remonte la boite de la moitié de sa hauteur */
        /* ------------------------- */

        width: 300px;
        margin-top: 0;
        
        /* On limite la hauteur à 90% de l'écran pour garder une marge si le texte est long */
        max-height: 90vh; 
        overflow-y: auto;
        
        box-shadow: -5px 5px 20px rgba(0,0,0,0.5);
        z-index: 1000;
        
        scrollbar-width: thin;
        scrollbar-color: var(--accent) var(--bg-1);
    }
}