/* ==========================================================================
   echecs.css — Échecs (sous-page ludothèque)
   Thème : marbre noir et blanc, élégance classique
   ========================================================================== */

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

body {
    font-family: 'Cormorant Garamond', 'Garamond', 'Times New Roman', serif;
    line-height: 1.7;
    color: #1a1a1a;
    background: #f0ece4;
    background-image:
        repeating-linear-gradient(45deg, transparent 0 60px, rgba(0,0,0,0.02) 60px 61px),
        radial-gradient(ellipse at top, #f5f1e8 0%, #e8e2d3 100%);
    min-height: 100vh;
}

.echecs-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 20px;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #4a4a4a;
    text-decoration: none;
    font-size: 0.95em;
    border-bottom: 1px solid transparent;
    transition: border-color .2s;
}
.back-link:hover { border-bottom-color: #4a4a4a; }

/* HERO ====================================================================== */
.echecs-hero {
    background: linear-gradient(135deg, #1a1a1a 0%, #2c2c2c 100%);
    color: #f5f1e8;
    padding: 60px 40px;
    border-radius: 6px;
    text-align: center;
    margin-bottom: 35px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(0,0,0,.4);
}

/* damier décoratif en filigrane */
.echecs-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(45deg, rgba(255,255,255,.04) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255,255,255,.04) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255,255,255,.04) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.04) 75%);
    background-size: 40px 40px;
    background-position: 0 0, 0 20px, 20px -20px, -20px 0;
    opacity: .6;
}

.echecs-hero h1 {
    font-size: 3.2em;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 10px;
    position: relative;
    text-shadow: 2px 2px 8px rgba(0,0,0,.6);
}

.echecs-hero .pieces {
    font-size: 2em;
    letter-spacing: 0.5em;
    margin: 15px 0;
    position: relative;
    color: #d4af37;
}

.echecs-hero .tagline {
    font-style: italic;
    font-size: 1.25em;
    opacity: .9;
    position: relative;
}

/* SECTIONS ================================================================== */
.section {
    background: #fff;
    margin-bottom: 25px;
    padding: 35px 40px;
    border-radius: 4px;
    border-left: 4px solid #1a1a1a;
    box-shadow: 0 4px 14px rgba(0,0,0,.08);
}

.section h2 {
    font-size: 2em;
    color: #1a1a1a;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #d4af37;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section h3 {
    font-size: 1.4em;
    color: #2c2c2c;
    margin-top: 22px;
    margin-bottom: 10px;
    font-weight: 600;
}

.section p {
    margin-bottom: 14px;
    text-align: justify;
}

.section ul, .section ol {
    margin: 10px 0 15px 30px;
}

.section li { margin-bottom: 6px; }

/* ÉCHIQUIER décoratif ======================================================= */
.mini-board {
    display: grid;
    grid-template-columns: repeat(8, 32px);
    grid-template-rows: repeat(8, 32px);
    border: 3px solid #1a1a1a;
    margin: 20px auto;
    width: max-content;
    box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
.mini-board .sq {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.mini-board .light { background: #f0d9b5; }
.mini-board .dark  { background: #b58863; }

/* GRILLE PIECES ============================================================= */
.pieces-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin: 20px 0;
}
.piece-tile {
    background: linear-gradient(135deg, #fafafa 0%, #ececec 100%);
    border: 1px solid #d4af37;
    border-radius: 4px;
    padding: 18px;
    text-align: center;
    transition: transform .25s, box-shadow .25s;
}
.piece-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,.15);
}
.piece-tile .symbol {
    font-size: 3em;
    color: #1a1a1a;
}
.piece-tile h4 {
    margin: 10px 0 6px;
    color: #1a1a1a;
    font-size: 1.15em;
}
.piece-tile .value {
    color: #d4af37;
    font-weight: 700;
    font-size: 0.95em;
}

/* TABLE ===================================================================== */
.section table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
    font-size: 0.95em;
}
.section th, .section td {
    padding: 10px 12px;
    border-bottom: 1px solid #e0d8c4;
    text-align: left;
}
.section th {
    background: #1a1a1a;
    color: #d4af37;
    font-weight: 700;
    letter-spacing: 1px;
}
.section tr:nth-child(even) td { background: #faf7ee; }

/* ENCARTS =================================================================== */
.quote {
    border-left: 4px solid #d4af37;
    padding: 12px 20px;
    font-style: italic;
    color: #444;
    background: #faf7ee;
    margin: 18px 0;
}
.tip {
    background: #fff8e1;
    border: 1px solid #d4af37;
    padding: 14px 18px;
    border-radius: 4px;
    margin: 14px 0;
}
.warning {
    background: #fdecea;
    border-left: 4px solid #c0392b;
    padding: 12px 18px;
    margin: 14px 0;
}

/* INTERACTIVE ============================================================== */
.demo-controls {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
}
.demo-controls button {
    background: #1a1a1a;
    color: #d4af37;
    border: 1px solid #d4af37;
    padding: 9px 18px;
    cursor: pointer;
    font-family: inherit;
    border-radius: 3px;
    transition: background .2s;
}
.demo-controls button:hover { background: #2c2c2c; }

footer {
    text-align: center;
    padding: 30px 0 10px;
    color: #777;
    font-size: 0.9em;
    font-style: italic;
}

@media (max-width: 720px) {
    .echecs-hero h1 { font-size: 2.2em; }
    .section { padding: 25px 20px; }
    .mini-board { grid-template-columns: repeat(8, 26px); grid-template-rows: repeat(8, 26px); }
    .mini-board .sq { font-size: 18px; }
}
