/* ==========================================================================
   scrabble.css — Scrabble
   Thème : tuiles en bois clair, coins de plateau colorés (rose/rouge/bleu)
   ========================================================================== */

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

body {
    font-family: 'Verdana', 'Helvetica', Arial, sans-serif;
    line-height: 1.6;
    color: #2a2018;
    background: #f0e3c8;
    background-image:
        repeating-linear-gradient(0deg, transparent 0 80px, rgba(140,90,40,.04) 80px 81px),
        radial-gradient(ellipse at top, #f5ead3 0%, #e8d9b6 100%);
    min-height: 100vh;
}

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

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #5e3a1f;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95em;
}

/* HERO ====================================================================== */
.scrab-hero {
    background: linear-gradient(135deg, #faf3e0 0%, #ecd9b3 100%);
    border: 3px solid #5e3a1f;
    border-radius: 8px;
    padding: 45px 30px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 8px 20px rgba(80,50,20,.25), inset 0 2px 6px rgba(255,255,255,.6);
    position: relative;
}

.scrab-hero h1 {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.scrab-hero .tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: linear-gradient(180deg, #f5e0a8 0%, #e0c172 100%);
    border: 2px solid #8a5a1f;
    border-radius: 6px;
    font-size: 2.2em;
    font-weight: 900;
    color: #2a2018;
    box-shadow: 2px 3px 6px rgba(0,0,0,.3), inset 0 1px 2px rgba(255,255,255,.6);
    position: relative;
    text-transform: uppercase;
}

.scrab-hero .tile::after {
    content: attr(data-pts);
    position: absolute;
    bottom: 4px;
    right: 6px;
    font-size: 0.4em;
    font-weight: 600;
}

.scrab-hero .tagline {
    font-style: italic;
    font-size: 1.1em;
    color: #5e3a1f;
}

/* SECTIONS ================================================================== */
.section {
    background: #fffbf2;
    margin-bottom: 24px;
    padding: 30px 36px;
    border-radius: 6px;
    border: 1px solid #d8c39a;
    box-shadow: 0 4px 12px rgba(80,50,20,.1);
}

.section h2 {
    font-size: 1.85em;
    color: #5e3a1f;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px dotted #c9a868;
}

.section h3 {
    color: #8a5a1f;
    font-size: 1.3em;
    margin-top: 22px;
    margin-bottom: 10px;
}

.section p { margin-bottom: 12px; text-align: justify; }
.section ul, .section ol { margin: 8px 0 14px 28px; }
.section li { margin-bottom: 6px; }

/* GRILLE TUILES ============================================================ */
.tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 8px;
    margin: 20px 0;
}
.tile-card {
    aspect-ratio: 1;
    background: linear-gradient(180deg, #f5e0a8 0%, #e0c172 100%);
    border: 2px solid #8a5a1f;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: #2a2018;
    box-shadow: 1px 2px 4px rgba(0,0,0,.25), inset 0 1px 2px rgba(255,255,255,.5);
    position: relative;
    text-transform: uppercase;
}
.tile-card .letter { font-size: 1.6em; line-height: 1; }
.tile-card .pts {
    position: absolute;
    bottom: 3px;
    right: 5px;
    font-size: 0.7em;
    font-weight: 700;
}
.tile-card .count {
    position: absolute;
    top: 3px;
    left: 5px;
    font-size: 0.65em;
    font-weight: 600;
    color: #8a5a1f;
}

/* MINI-PLATEAU AVEC CASES BONUS ============================================ */
.scrabble-board {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    gap: 1px;
    background: #5e3a1f;
    border: 3px solid #5e3a1f;
    max-width: 480px;
    margin: 20px auto;
    aspect-ratio: 1;
}
.scrabble-board > div {
    background: #f5ead3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55em;
    font-weight: 700;
    text-align: center;
    line-height: 1;
    color: #fff;
    padding: 1px;
}
.scrabble-board .tw { background: #d33; }
.scrabble-board .dw { background: #f88; color: #2a2018; }
.scrabble-board .tl { background: #2a87b8; }
.scrabble-board .dl { background: #8fcae0; color: #2a2018; }
.scrabble-board .star { background: #f88; color: #2a2018; }

/* CALCULATEUR ============================================================== */
.calc {
    background: #faf3e0;
    border: 2px dashed #8a5a1f;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}
.calc input {
    padding: 10px 14px;
    font-size: 1.2em;
    border: 2px solid #8a5a1f;
    border-radius: 4px;
    text-transform: uppercase;
    font-family: inherit;
    width: 280px;
    max-width: 100%;
    background: #fff;
}
.calc button {
    background: #8a5a1f;
    color: #fff;
    border: none;
    padding: 10px 22px;
    font-size: 1.05em;
    font-weight: 700;
    cursor: pointer;
    border-radius: 4px;
    margin-left: 8px;
    font-family: inherit;
}
.calc button:hover { background: #5e3a1f; }
.calc .result {
    margin-top: 14px;
    font-size: 1.3em;
    font-weight: 700;
    color: #5e3a1f;
}

/* TABLES ==================================================================== */
.section table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}
.section th {
    background: #5e3a1f;
    color: #f5ead3;
    padding: 10px 12px;
    text-align: left;
}
.section td {
    padding: 9px 12px;
    border-bottom: 1px solid #e0d3b3;
}
.section tr:nth-child(even) td { background: #f5ead3; }

.tip {
    background: #fff8db;
    border-left: 4px solid #d4a017;
    padding: 14px 18px;
    margin: 14px 0;
    border-radius: 0 4px 4px 0;
}

footer {
    text-align: center;
    padding: 30px 0 12px;
    color: #5e3a1f;
    font-style: italic;
}

@media (max-width: 720px) {
    .scrab-hero .tile { width: 42px; height: 42px; font-size: 1.5em; }
    .section { padding: 22px 20px; }
}
