/* ===== Base ===== */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    background: #f4f4f9;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: #333;
    color: #fff;
}

header h1 { margin: 0; font-size: 24px; }
header img { height: 40px; width: auto; }

main {
    padding: 30px;
    max-width: 900px;
    margin: auto;
}

footer {
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
    color: #888;
}

h2 { text-align: center; }

/* ===== Home — sélection de langue ===== */
.container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 40px 20px;
}

.lang-card {
    flex: 0 0 200px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.lang-card:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0,0,0,0.2); }
.lang-card img   { width: 40px; height: auto; margin-right: 10px; }

.fr { background: #007BFF; }
.en { background: #28A745; }
.es { background: #FFC107; color: #333; }
.dk { background: #DC3545; }
.de { background: #6F42C1; }
.it { background: #17A2B8; }
.pt { background: #FD7E14; }
.eu { background: #155724; }
.br { background: #6C757D; }

/* ===== Index — liste des jeux ===== */
.game-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 30px;
}

.lang-select {
    background: #fff;
    color: #333;
    border: none;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 14px;
    cursor: pointer;
}

.jeu {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.2s;
    padding: 5px 0;
}

.jeu:hover { transform: scale(1.05); }
.jeu h2    { font-size: 18px; margin: 10px 0; color: #333; }
.jeu a     { text-decoration: none; color: inherit; display: block; padding: 10px; }

.today-card { background: #fff7d1; }
.no-today   { background: #ffe6e6; }

.pagination { text-align: center; margin: 20px 0; }
.pagination a { margin: 0 4px; }
.pagination .current { font-weight: bold; }

/* ===== Jeu ===== */
form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

input[type=text] {
    flex: 1;
    padding: 8px;
    border: 1px solid #aaa;
    border-radius: 6px;
}

span { border-radius: 5px; padding: 2px 5px; display: inline-block; }

button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: #007BFF;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover { background: #0056b3; }

.word-list         { margin: 15px 0; font-size: 14px; color: #333; }
.word-list li,
.word-list ul      { list-style: none; padding-left: 0; }

.known             { color: black; }
.known.new         { background: #BBFCDA; }
.unknown           { background: #CDCDCD; cursor: pointer; }
.unknown.new       { color: #ff7f00 !important; }

.text-content {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

a.back-link { display: inline-block; margin-bottom: 20px; color: #007BFF; text-decoration: none; }
a.back-link:hover { text-decoration: underline; }

.game-actions {
    display: flex;
    gap: 20px;
    align-items: center;
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 10px;
    flex-wrap: wrap;
    justify-content: space-between;
}

.game-form {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 0;
}

.game-form label      { flex: 1 1 100%; font-weight: bold; margin: auto; }
.game-form input[type="text"] {
    padding: 6px;
    border: 1px solid #aaa;
    border-radius: 6px;
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
}

.btn          { padding: 6px 12px; border: none; border-radius: 6px; cursor: pointer; font-weight: bold; transition: background 0.2s, transform 0.2s; }
.btn-primary  { background: #007BFF; color: #fff; }
.btn-primary:hover  { background: #0056b3; transform: scale(1.05); }
.btn-danger   { background: #dc3545; color: #fff; }
.btn-danger:hover   { background: #b02a37; transform: scale(1.05); }
.btn-secondary { background: #6c757d; color: #fff; }

.session-id  { margin-bottom: 10px; font-size: 14px; font-style: italic; color: #333; }
.leave-form  { text-align: right; }
#join        { margin: auto; text-align: center; }

/* ===== Mot masqué / overlay ===== */
.wrapper {
    position: relative;
    display: inline-block;
    cursor: pointer;
    padding: 0;
    margin-bottom: 2px;
}

.overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    background: #000;
}

.wrapper.active .overlay { opacity: 1; pointer-events: auto; }

/* ===== Options (mobile) ===== */
.options  { display: none; }

.bmc-btn-container { margin: 10px !important; }
.bmc-btn           { padding: 10px 24px !important; height: auto !important; }
.bmc-btn-text      { font-size: 1.3rem !important; }

/* ===== Responsive ===== */
@media screen and (max-width: 500px) {
    .game-grid { grid-template-columns: repeat(2, 1fr); }
    .lang-select { max-width: 60px; }
    .desktop { display: none; }
    header { padding: 5px 15px; }

    .container { padding: 10px 20px; }
    .lang-card { flex: 0 0 150px; height: 50px; font-size: 16px; }

    .game-actions    { flex-direction: column; align-items: stretch; }
    .game-form       { flex-direction: column; align-items: stretch; }
    .game-form input[type="text"],
    .game-form button { width: 100%; margin-right: 0; }
    .game-options    { display: none; }
    .game-options.show, .options { display: block; }
    #join input      { margin: 10px 0; }

    .bmc-btn-text {
        display: inline-block !important;
        max-width: 250px !important;
        white-space: normal !important;
        line-height: 1.3rem !important;
    }
}

/* Legals */
.legals h2 { text-align: left; }
.legals ul  { margin: 0.5rem 0 0.5rem 1.5rem; }

/* Single-column grid (today card) */
.game-grid--single { grid-template-columns: 1fr; padding-bottom: 0; }

/* Close count display */
.close-count { color: rgb(255 255 255); }
