/*
Theme Name: Jeu 2048 Français
Theme URI: https://votresite.com
Description: Thème WordPress pour le jeu 2048 avec mode Cupcake et partage social
Version: 1.0
Author: Votre Nom
Author URI: https://votresite.com
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: 2048-game
*/

/* ============================================
   GLOBAL STYLES
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: "Clear Sans", "Helvetica Neue", Arial, sans-serif;
    background: #faf8ef;
    color: #776e65;
    margin: 0;
    padding: 0;
    font-size: 16px;
    line-height: 1.6;
}

/* ============================================
   CONTAINER
   ============================================ */

.container {
    width: 100%;
    max-width: 800px; /* Changed from 500px to accommodate game container */
    margin: 0 auto;
    padding: 20px;
}
/* ============================================
   HEADING
   ============================================ */

.heading {
    text-align: left;
    margin-bottom: 30px;
}

.heading h1 {
    font-size: 80px;
    font-weight: bold;
    color: #776e65;
    margin: 0;
    line-height: 1;
}

.heading .tagline {
    font-size: 18px;
    color: #776e65;
    margin-top: 10px;
}

/* ============================================
   SCORES
   ============================================ */

.scores-container {
    display: flex;
    justify-content: center;
    align-items: center;  /* Add this: vertically align items */
    gap: 20px;
    margin: 20px 0;
}

.score-container, 
.best-container {
    background: #bbada0;
    padding: 15px 25px;
    border-radius: 3px;
    color: white;
    text-align: center;
    min-width: 120px;
    position: relative;
}

.score-container .title, 
.best-container .title {
    font-size: 13px;
    text-transform: uppercase;
    color: #eee4da;
    margin-bottom: 5px;
    font-weight: bold;
}

.score-container .score, 
.best-container .score {
    font-size: 25px;
    font-weight: bold;
    color: #ffffff;
}

/* ============================================
   RESTART BUTTON (In Flex Container)
   ============================================ */

.restart-button {
    background: #8f7a66;
    color: #f9f6f2;
    border: none;
    border-radius: 3px;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
    /* Remove display: block and margin: 20px auto */
    /* These don't work in flex containers */
}

.restart-button:hover {
    background: #9f8a76;
    transform: translateY(-2px);
}

.restart-button:active {
    transform: translateY(0);
}
/* ============================================
   GAME INTRO
   ============================================ */

.game-intro {
    text-align: center;
    margin: 20px 0;
    line-height: 1.65;
    color: #776e65;
}

.game-intro p {
    margin-bottom: 10px;
}

.game-intro strong {
    font-weight: bold;
    color: #776e65;
}

/* ============================================
   GAME MESSAGE (Win/Lose Overlay)
   ============================================ */

.game-message {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(238, 228, 218, 0.95);
    z-index: 1000;
    text-align: center;
    animation: fadeIn 0.8s;
}

.game-message.game-won,
.game-message.game-over {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.game-message > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.game-message p {
    font-size: 60px;
    font-weight: bold;
    color: #776e65;
    margin-bottom: 30px;
}

.game-message .score-message {
    font-size: 24px;
    margin-bottom: 20px;
    color: #776e65;
}

.game-message button {
    background: #8f7a66;
    color: #f9f6f2;
    border: none;
    border-radius: 3px;
    padding: 15px 30px;
    font-size: 18px;
    cursor: pointer;
    margin: 10px;
    font-weight: bold;
    transition: background 0.3s;
}

.game-message button:hover {
    background: #9f8a76;
}

/* ============================================
   SHARE BUTTONS
   ============================================ */

.share-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.share-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: white;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.share-btn:active {
    transform: translateY(0);
}

.share-btn.whatsapp {
    background: #25D366;
}

.share-btn.whatsapp:hover {
    background: #1eb854;
}

.share-btn.facebook {
    background: #1877f2;
}

.share-btn.facebook:hover {
    background: #0d68d4;
}

.share-btn.instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.share-btn.instagram:hover {
    background: linear-gradient(45deg, #e08424 0%, #d6582d 25%, #cc1834 50%, #bc1457 75%, #ac0979 100%);
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media screen and (max-width: 520px) {
    body {
        font-size: 14px;
    }

    .container {
        width: 100%;
        padding: 10px;
    }
    
    .heading h1 {
        font-size: 50px;
    }

    .heading .tagline {
        font-size: 16px;
    }
    
    .scores-container {
        gap: 10px;
    }
    
    .score-container, 
    .best-container {
        padding: 10px 15px;
        min-width: 90px;
    }

    .score-container .title,
    .best-container .title {
        font-size: 11px;
    }

    .score-container .score,
    .best-container .score {
        font-size: 20px;
    }

    .restart-button {
        padding: 12px 24px;
        font-size: 16px;
    }

    .game-intro {
        font-size: 14px;
    }

    .game-message p {
        font-size: 40px;
        margin-bottom: 20px;
    }

    .game-message .score-message {
        font-size: 18px;
    }

    .game-message button {
        padding: 12px 24px;
        font-size: 16px;
    }

    .share-buttons {
        gap: 10px;
    }

    .share-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

@media screen and (max-width: 360px) {
    .heading h1 {
        font-size: 40px;
    }

    .scores-container {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .score-container,
    .best-container {
        width: 100%;
        max-width: 200px;
    }

    .share-buttons {
        flex-direction: column;
        width: 100%;
    }

    .share-btn {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* ============================================
   FORCE BUTTON INLINE (TEMPORARY DEBUG)
   ============================================ */

.scores-container {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 20px !important;
}

.scores-container .restart-button {
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 !important;
    width: auto !important;
}

.top-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 500px;
    margin: 20px auto;
    gap: 20px;
}

.top-controls .left-side {
    flex-shrink: 0;
}

.top-controls .right-side {
    display: flex;
    gap: 20px;
}
