@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Barlow:wght@400;500;600&display=swap');

:root { --cell: 52px; }



body {
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Override spécifique game page */
main.game-main {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 1.5rem 1rem;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
}

main h2 {
    font-size: 42px;
    margin-bottom: 8px;
    color: #f0ece3;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

main p {
    color: rgba(240,236,227,0.75);
    margin-bottom: 24px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.btn {
    display: inline-block;
    background: #e2b96f;
    color: #1a1a2e;
    padding: 12px 32px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
}

.btn:hover {
    background: #c9a050;
}


.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.6);
	display: none;
	justify-content: center;
	align-items: center;
    z-index: 9999;
}

.overlay.active {
    display: flex;
}

.modal {
    background: linear-gradient(145deg, #0f0f1e, #16213e);
    border: 1px solid rgba(226, 185, 111, 0.25);
    padding: 2rem 2.5rem;
    border-radius: 4px;
    width: 340px;
    color: #f0ece3;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.modal h2 {
    font-family: 'Bebas Neue', Arial, sans-serif;
    font-size: 1.5rem;
    letter-spacing: 0.15em;
    color: #e2b96f;
    margin-bottom: 1.2rem;
}

.modal ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.modal ul li {
    font-size: 0.88rem;
    color: rgba(240, 236, 227, 0.75);
    padding-left: 1rem;
    position: relative;
    line-height: 1.5;
}

.modal ul li::before {
    content: '—';
    position: absolute;
    left: 0;
    color: #e2b96f;
}

.modal a {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(240, 236, 227, 0.5);
    text-decoration: none;
    margin-top: 0;
    transition: color 0.2s;
}

.modal a:hover {
    color: #e2b96f;
}

/* ── Boutons haut (reset + new) ── */
#controls {
    display: flex;
    gap: 8px;
}

#controls button {
    font-family: 'Barlow', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 6px 16px;
    border: 1px solid rgba(226, 185, 111, 0.35);
    background: transparent;
    color: rgba(240, 236, 227, 0.7);
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 0;
}

#controls button:hover {
    background: rgba(226, 185, 111, 0.12);
    color: #e2b96f;
    border-color: #e2b96f;
}

/* ── Sélecteur taille ── */
#size-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.2rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(240, 236, 227, 0.45);
}

#size-row select {
    font-family: 'Barlow', sans-serif;
    font-size: 0.75rem;
    padding: 4px 8px;
    border: 1px solid rgba(226, 185, 111, 0.3);
    background: rgba(10, 15, 30, 0.8);
    color: #f0ece3;
    cursor: pointer;
    border-radius: 0;
}

/* ── Grille ── */
#grid-container {
    display: flex;
    margin-bottom: 1rem;
}

#grid {
    border-collapse: collapse;
    border: 2px solid rgba(226, 185, 111, 0.4);
    table-layout: fixed;
    background-color: #111;
    box-shadow: 0 0 40px rgba(0,0,0,0.6);
}

.cell {
    width: var(--cell);
    height: var(--cell);
    min-width: var(--cell); max-width: var(--cell);
    min-height: var(--cell); max-height: var(--cell);
    cursor: pointer;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    transition: filter 0.1s;
    border: none;
    box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.3);
    background-size: 101% 101%;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;
    padding: 0;
    box-sizing: border-box;
}
.cell:hover { filter: brightness(1.2); }

/* ── Voiture ── */
.car-img {
    width: 85%; height: 85%;
    object-fit: contain;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 2;
}

/* ── Croix ── */
.cell.has-x::after {
    content: '';
    display: block;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 45%; height: 45%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><line x1="8" y1="8" x2="56" y2="56" stroke="%23333" stroke-width="10" stroke-linecap="round"/><line x1="56" y1="8" x2="8" y2="56" stroke="%23333" stroke-width="10" stroke-linecap="round"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.45;
    pointer-events: none;
    z-index: 3;
}

/* ── Flash erreur ── */
.cell.error-flash { animation: flash 0.4s; }
@keyframes flash {
    0%,100% { filter: brightness(1); }
    50%      { filter: brightness(0.5) saturate(2); }
}

/* ── Message ── */
#msg {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    min-height: 20px;
    color: rgba(240, 236, 227, 0.4);
    margin: 0.5rem 0 0;
    text-align: center;
    background: none !important;
    text-shadow: none !important;
}
#msg.win {
    color: #86efac;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.15em;
}

#btn-hint, #btn-solution {
    font-family: 'Barlow', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 8px 20px;
    border: 2px solid #e2b96f;
    background: rgba(10, 15, 30, 0.75);
    color: #e2b96f;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 0;
    backdrop-filter: blur(6px);
}
#btn-hint:hover, #btn-solution:hover {
    background: #e2b96f;
    color: #1a1a2e;
}

/* ── Chrono ── */
#chrono {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2rem;
    color: #e2b96f;
    letter-spacing: 0.15em;
    text-align: center;
}

/* ── Leaderboard latéral ── */
#level-leaderboard {
    position: absolute;
    left: calc(100% + 1rem);
    top: 0;
    background: rgba(10, 15, 30, 0.72);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(226, 185, 111, 0.15);
    padding: 1rem 1.2rem;
    width: 150px;
}


#level-leaderboard .lb-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.15em;
    color: #e2b96f;
    margin-bottom: 0.8rem;
}
#level-leaderboard .lb-empty {
    font-size: 0.72rem;
    color: rgba(240, 236, 227, 0.35);
    text-align: center;
}

/* ── Conseil ── */
#conseil {
    font-size: 0.72rem;
    color: #e2b96f;
    letter-spacing: 0.08em;
    font-style: italic;
    text-align: center;
    background: rgba(10, 15, 30, 0.75);
    backdrop-filter: blur(6px);
    padding: 0.4rem 1rem;
    border: 1px solid rgba(226, 185, 111, 0.2);
}
/* ── Layout principal ── */
.game-outer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding-bottom: 2rem;
}

.game-middle {
    position: relative;
    display: flex;
    justify-content: center;
}

#game-wrap {
    padding: 0.8rem;
    font-family: 'Barlow', sans-serif;
    background: rgba(10, 15, 30, 0.72);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(226, 185, 111, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #f0ece3;
}

.game-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 1.5rem;
}

.game-bottom-btns {
    display: flex;
    gap: 8px;
}

body.game-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    zoom: 0.9;
}

body.game-page footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: rgba(10, 15, 30, 0.82);
    color: #aaa;
    text-align: center;
    font-size: 0.75rem;
}

main.game-main {
    max-width: 100% !important;
    width: 100% !important;
    padding: 1.5rem 1rem !important;
}

footer {
    padding: 15px;
    background: rgba(10, 15, 30, 0.82);
    color: #aaa;
    text-align: center;
    font-size: 0.75rem;
    flex-shrink: 0;
}