:root {
    color-scheme: dark;
}

html {
    scroll-behavior: smooth;
}

html,
body {
    background-color: #4caf50;
    font-family: Arial, sans-serif;
    margin: 0;
    color: black;
    text-align: center;
}

h1,
p {
    margin: 0;
    padding: 0;
    line-height: 1.2;
}

header {
    padding: 20px 10px 8px;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.menu-btn {
    position: absolute;
    left: 15px;
    font-size: 25px;
    background: none;
    border: none;
    color: #d1d5db;
    cursor: pointer;
    transition: 0.3s;
}

.menu-btn:hover {
    color: #22c55e;
}

.nav h1 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 40px;
    color: #d4af37;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.7);
}

.logo {
    color: #c19a6b;
    text-shadow: 0 0 6px rgba(193, 154, 107, 0.3);
}

header p {
    color: #d1d5db;
    margin-top: 10px;
}

/* SECTIONS */
.section {
    padding: 6px 10px;
    scroll-margin-top: 20px;
}

/* BOXES */
.box {
    background: #0b0b0b;
    color: white;
    margin: 6px auto;
    padding: 14px;
    max-width: 500px;
    border-radius: 15px;
    border: 1px solid rgba(34, 197, 94, 0.25);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.08);
}

/* TITRES */
h2 {
    margin-bottom: 10px;
}

/* LISTES */
.list {
    margin: 0;
    padding-left: 22px;
    text-align: left;
    color: white;
}

.list li {
    margin-bottom: 8px;
    line-height: 1.4;
}

/* ARABIC TEXT */
.ar-text {
    direction: rtl;
    text-align: center;
    line-height: 1.9;
    padding: 0 10px;
}

.ar-text p {
    margin: 0 auto;
    max-width: 90%;
}

/* BUTTONS */
.btn {
    display: block;
    text-align: center;
    margin: 10px 8px 0;
    padding: 12px 20px;
    background: #303030;
    color: white;
    border-radius: 10px;
    border: 1px solid rgba(34, 197, 94, 0.5);
    cursor: pointer;
    transition: 0.3s;
    text-decoration: none;
}

.btn:hover {
    background: #3a3a3a;
    color: white;
    box-shadow: none;
}

.secondary-btn {
    border: 1px solid #d4af37;
    color: #d4af37;
    background: transparent;
}

/* SIDE MENU */
.side-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: #0b0b0b;
    overflow-x: hidden;
    transition: width 0.3s ease;
    padding-top: 40px;
    z-index: 1001;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.5);
    opacity: 0;
}

.side-menu.open {
    width: 250px;
    opacity: 1;
}

.side-menu a {
    display: block;
    padding: 15px 25px;
    font-size: 18px;
    color: white;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: 0.2s;
    text-align: left;
    padding-left: 30px;
    letter-spacing: 0.5px;
}

.side-menu a:hover {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
}

.side-menu a.active {
    color: #22c55e;
    font-weight: bold;
}

/* OVERLAY */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* CARTES CLIQUABLES */
.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.card-link .box {
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
    cursor: pointer;
}

.card-link .box:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 14px rgba(34, 197, 94, 0.18);
}

/* FOUNDER INFO */
.small-founder,
.founder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    max-width: 90%;
}

.founder-img-small {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid rgba(34, 197, 94, 0.3);
    margin-bottom: 10px;
}

.founder-text {
    font-size: 14px;
    color: #ccc;
    line-height: 1.5;
}

footer {
    background-color: #f9e79f; /* jaune adouci */
    color: #1a1a1a;
    text-align: center;
    font-size: 12px; /* un peu plus compact */
    padding: 8px 10px; /* réduit */
    margin: 20px;
    border-radius: 15px;
    line-height: 1.3; /* rapproche les lignes */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* lignes */
.footer-line {
    margin: 2px 0; /* très compact */
}

/* liens */
footer a {
    color: #1a1a1a;
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    text-decoration: underline;
}

/* MODE CLAIR / SOMBRE */
@media (prefers-color-scheme: light) {
    header p,
    .nav h1 {
        color: #333;
    }

    footer p,
    footer a {
        color: #333;
    }
}

@media (prefers-color-scheme: dark) {
    header p,
    .nav h1 {
        color: #f5f5f5;
    }

    footer p,
    footer a {
        color: #333;
    }
}

/* PAGE CONDITIONS */
.conditions-page {
    background-color: #4caf50;
    padding: 20px;
}

.conditions-page .content {
    background-color: #ffffff;
    color: #333;
    max-width: 800px;
    margin: auto;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* LIEN TITRE FORM */
.form-link-title {
    color: inherit;
    text-decoration: none;
}

.form-link-title:hover {
    text-decoration: underline;
}

/* FORMULAIRE DE CONTACT */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
    width: 100%;
}

.contact-form input,
.contact-form textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 14px;
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 10px;
    background-color: #1a1a1a;
    color: white;
    font-size: 16px;
    font-family: Arial, sans-serif;
    -webkit-appearance: none;
    appearance: none;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: #bdbdbd;
}

.contact-form textarea {
    resize: vertical;
    min-height: 140px;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 6px rgba(212, 175, 55, 0.25);
}

.contact-form .btn {
    width: 100%;
    margin-top: 10px;
    background: #303030;
    border: 1px solid rgba(34, 197, 94, 0.5);
    color: white;
}

.contact-form .btn:hover {
    background: #3a3a3a;
}

/* FORMULAIRE COMMUNAUTÉ */
.community-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
    width: 100%;
}

.community-form input,
.community-form textarea,
.community-form select {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 14px;
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 10px;
    background-color: #1a1a1a;
    color: white;
    font-size: 16px;
    font-family: Arial, sans-serif;
    -webkit-appearance: none;
    appearance: none;
}

.community-form input::placeholder,
.community-form textarea::placeholder {
    color: #bdbdbd;
}

.community-form select {
    cursor: pointer;
}

.community-form textarea {
    resize: vertical;
    min-height: 160px;
}

.community-form input:focus,
.community-form textarea:focus,
.community-form select:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 6px rgba(212, 175, 55, 0.25);
}

.community-form .btn {
    width: 100%;
    margin-top: 10px;
    background: #303030;
    border: 1px solid rgba(34, 197, 94, 0.5);
    color: white;
}

.community-form .btn:hover {
    background: #3a3a3a;
}

.community-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

/* APERCU COMMUNAUTE */
.filter-bar {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.filter {
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid #d4af37;
    color: #d4af37;
}

.filter.active {
    background: #d4af37;
    color: black;
}

.post {
    background: #0b0b0b;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: white;
    max-width: 500px;
    margin: 6px auto;
}

.post-meta {
    color: #d4af37;
    font-size: 14px;
    margin-bottom: 10px;
}

.post h3 {
    margin-bottom: 10px;
}

.comment {
    margin-top: 10px;
    padding: 10px;
    background: #151515;
    border-radius: 10px;
    font-size: 14px;
}

.post-stats {
    margin-top: 10px;
    color: #aaa;
}

.image-box {
    margin: 15px 0;
    padding: 30px;
    border: 1px dashed #d4af37;
    border-radius: 10px;
    text-align: center;
}

/* PAGE HISTOIRE */
.chess-legends {
    margin-top: 15px;
    padding-left: 20px;
    color: #ddd;
    text-align: left;
}

.chess-legends li {
    margin-bottom: 10px;
    line-height: 1.5;
}

.section .box h2 {
    color: #d4af37;
}

/* IMAGE HISTOIRE EN ACCUEIL */
.history-image {
    display: flex;
    justify-content: center;
    margin: 2px 0 6px;
}

.history-image img {
    display: block;
    width: 100%;
    max-width: 380px;
    height: 180px;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
    cursor: pointer;
}

.history-image img:hover {
    transform: scale(1.03);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

/* ANIMATION AU SCROLL */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition:
        opacity 0.6s ease,
        transform 0.6s ease;
    will-change: opacity, transform;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.close-menu-btn {
    position: absolute;
    top: 15px;
    right: 20px;

    background: transparent;
    border: none;

    color: #ffffff;
    font-size: 28px;
    font-weight: bold;

    cursor: pointer;
    z-index: 1001;
    line-height: 1;
}

.close-menu-btn:hover {
    color: #00ff88; /* vert ChessUnity */
}

.close-menu-btn {
    transition:
        color 0.2s ease,
        transform 0.2s ease;
}

.close-menu-btn:hover {
    color: #00ff88;
    transform: scale(1.2);
}

.hero-image-link {
    position: relative;
    display: block;
    width: 90%;
    max-width: 520px;
    margin: 0 auto 20px auto;
    text-decoration: none;
    overflow: hidden;
    border-radius: 20px;
}

.hero-image {
    display: block;
    width: 100%;
    height: 175px;
    object-fit: cover;
    object-position: center;
    border-radius: 20px;
}

.image-badge {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 2;
    display: inline-block;
    background: rgba(0, 0, 0, 0.72);
    color: #f5c542;
    padding: 8px 12px;
    border-radius: 18px;
    font-size: 0.85rem;
    font-weight: bold;
    line-height: 1;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    white-space: nowrap;
}
