/* =========================================
            VARIABLES & BASE
   ========================================= */
:root {
    --bg-main: #1a2c38;
    --bg-panel: #0f212e;
    --bg-cell: #2f4553;
    --accent: #00e701;
    --text-main: #fff;
    --text-sec: #b1bad3;
    --red: #ff4d4d;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* =========================================
   BOUTONS DE CONNEXION / INSCRIPTION
   ========================================= */

.auth-btn {
    padding: 8px 18px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    border: none;
}

/* Bouton fantôme pour "Se connecter" */
.login-btn {
    background: transparent;
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.signup-btn {
    background: var(--accent);
    color: #121922;
}

.signup-btn:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px #007a00;
}

/* =========================================
        HEADER & MENU UTILISATEUR
   ========================================= */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--bg-panel);
    border-bottom: 2px solid var(--bg-cell);
}

.logo {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -1px;
}

.logo span {
    color: var(--accent);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.balance-box {
    background-color: var(--bg-main);
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
}

.user-menu {
    position: relative;
}

.avatar {
    width: 40px;
    height: 40px;
    background-color: #2fbf71;
    color: #1a2c38;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 18px;
    cursor: pointer;
    text-transform: uppercase;
    transition: transform 0.2s;
}

.avatar:hover {
    transform: scale(1.1);
}

.dropdown {
    position: absolute;
    top: 55px;
    right: 0;
    background-color: #1a2c38;
    border: 1px solid #213743;
    border-radius: 8px;
    width: 160px;
    display: none;
    flex-direction: column;
    box-shadow: 0 10px 25px rgba(0,0,0,0.8);
    z-index: 1000;
}

.dropdown.active {
    display: flex;
}

.dropdown-header {
    padding: 12px;
    border-bottom: 1px solid #213743;
    text-align: center;
    font-size: 14px;
    color: #fff;
    font-weight: bold;
}

.dropdown-btn {
    background: none;
    border: none;
    color: #ff4d4d;
    padding: 15px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: background 0.2s;
    border-radius: 0 0 8px 8px;
}

.dropdown-btn:hover {
    background-color: #213743;
}

.site-footer {
    background-color: #1a1a1a;
    color: #888;
    padding: 30px 0;
    margin-top: 50px;
    font-size: 0.85rem;
    text-align: center;
    border-top: 2px solid #333;
}

.footer-links {
    margin-bottom: 15px;
}

.footer-links a {
    color: #fff;
    margin: 0 10px;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-copy .disclaimer {
    font-size: 0.75rem;
    color: #555;
    margin-top: 10px;
}

.fc-box {
    color: #00ccff;
    border: 1px solid rgba(0, 204, 255, 0.3);
    background-color: rgba(0, 204, 255, 0.05);
}

a.fc-box {
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

a.fc-box:hover {
    transform: translateY(-2px);
    background-color: rgba(0, 204, 255, 0.15);
    box-shadow: 0 4px 10px rgba(0, 204, 255, 0.2);
}

.plus-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background-color: #00ccff;
    color: #121922;
    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
    margin-left: 8px;
    line-height: 1;
    padding-bottom: 5px;
    box-sizing: border-box;
}

.gc-box {
    color: #ffcc00; 
    border: 1px solid rgba(255, 204, 0, 0.3);
    background-color: rgba(255, 204, 0, 0.05);
}

/* =========================================
   PAGE D'ACCUEIL & CARTES JEUX
   ========================================= */
.games-grid {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap; /* Permet de passer à la ligne sur petit écran */
}

.game-card {
    background-color: var(--bg-panel);
    border: 2px solid var(--bg-cell);
    border-radius: 12px;
    padding: 30px 20px;
    width: 280px;
    text-align: center;
    text-decoration: none;
    color: var(--text-main);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.game-card:hover {
    transform: translateY(-8px); /* Fait léviter la carte */
    border-color: var(--accent);
    box-shadow: 0 10px 20px rgba(0, 231, 1, 0.1); /* Léger halo vert */
}

.game-icon {
    font-size: 50px;
    background-color: var(--bg-main);
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.game-info h3 {
    font-size: 22px;
    margin-bottom: 8px;
}

.game-info p {
    font-size: 14px;
    color: var(--text-sec);
    line-height: 1.4;
}

/* =========================================
        NAVIGATION & LAYOUT PRINCIPAL
   ========================================= */
.tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 20px;
}

.tab-btn {
    background-color: var(--bg-panel);
    color: var(--text-sec);
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.tab-btn.active {
    background-color: var(--bg-cell);
    color: var(--text-main);
    border-bottom: 3px solid var(--accent);
}

main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.game-section {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 500px;
}

.game-section.active {
    display: flex;
}

/* =========================================
        CONTRÔLES & BOUTONS
   ========================================= */
.controls {
    background-color: var(--bg-panel);
    padding: 20px;
    border-radius: 10px;
    width: 92%;
    margin-bottom: 30px;
}

label {
    color: var(--text-sec);
    font-size: 12px;
    font-weight: bold;
    display: block;
    margin-bottom: 8px;
}

input {
    background-color: var(--bg-main);
    border: 1px solid var(--bg-cell);
    color: white;
    padding: 12px;
    border-radius: 5px;
    width: 100%;
    margin-bottom: 15px;
    font-weight: bold;
    font-size: 16px;
}

.main-btn {
    width: 100%;
    padding: 15px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    border: none;
    text-align: center;
}

.main-btn.green {
    background-color: var(--accent);
    color: black;
}

.main-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* =========================================
            JEU : MINES
   ========================================= */
.grid-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    background-color: var(--bg-panel);
    padding: 10px;
    border-radius: 10px;
    width: 92%;
    aspect-ratio: 1;
    margin-bottom: 20px;
}

.cell {
    background-color: var(--bg-cell);
    border-radius: 8px;
    cursor: pointer;
    aspect-ratio: 1 / 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    line-height: 1;
    overflow: hidden;
    
    transition: background-color 0.2s, transform 0.1s;
}

.cell:active {
    transform: translateY(2px);
    border-bottom-width: 2px;
}

.cell.revealed-diamond {
    background-color: var(--bg-main);
    border: 2px solid #10ff8d;
    transform: scale(0.95);
}

.cell.revealed-mine {
    background-color: var(--red);
    border-bottom: none;
}

.cell.hidden-mine {
    background-color: var(--bg-main);
    opacity: 0.5;
    border-bottom: none;
}

.mines-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.m-btn {
    background-color: var(--bg-main);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    width: 18%;
    font-weight: bold;
    cursor: pointer;
}

.m-btn.active {
    background-color: #10ff8d;
    color: black;
}

/* =========================================
            JEU : BLACKJACK
   ========================================= */
.bj-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    min-height: 350px;
    justify-content: center;
}

.hand-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 130px;
    margin: 10px 0;
}

.score-bubble {
    background-color: var(--bg-cell);
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 10px;
}

.hand-container {
    display: flex;
    gap: 10px;
}

.card {
    width: 70px;
    height: 100px;
    background-color: white;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: black;
    font-weight: bold;
    font-size: 24px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    animation: slideDown 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card .suit {
    font-size: 20px;
}

.card.hidden {
    background-color: var(--bg-cell);
    border: 2px solid white;
    color: transparent;
}

.card.hidden .suit {
    display: none;
}

.card.red {
    color: var(--red);
}

.message-area {
    height: 40px;
    font-weight: bold;
    font-size: 16px;
    display: flex;
    align-items: center;
    color: var(--text-sec);
}

.bet-row {
    display: flex;
    gap: 5px;
}

.bet-row input {
    margin-bottom: 0;
    flex: 1;
}

.mod-btn {
    background-color: var(--bg-cell);
    color: var(--text-sec);
    border: none;
    padding: 0 15px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
}

.actions-grid {
    display: flex;
    gap: 10px;
    width: 100%;
}

.action-btn {
    flex: 1;
    background-color: var(--bg-cell);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* =========================================
   PARIS SPORTIFS
   ========================================= */
.matchs-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.match-card {
    background-color: var(--bg-panel);
    border: 1px solid var(--bg-cell);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.match-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-sec);
    margin-bottom: 15px;
    border-bottom: 1px solid var(--bg-main);
    padding-bottom: 8px;
}

.match-teams {
    display: flex;
    justify-content: space-around;
    align-items: center;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
}

.odds-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.odd-btn {
    flex: 1;
    background-color: var(--bg-main);
    border: 1px solid var(--bg-cell);
    color: white;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}

.odd-btn:hover:not(:disabled) {
    border-color: var(--accent);
}

.odd-btn.selected {
    background-color: var(--accent);
    color: black;
    border-color: var(--accent);
}

.odd-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.bet-slip {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    border-top: 1px solid var(--bg-main);
    padding-top: 15px;
}

/* Animation du chrono en direct */
@keyframes pulse-live {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

.live-minute {
    color: #ff4d4d;
    font-size: 13px;
    font-weight: bold;
    animation: pulse-live 2s infinite;
    margin-bottom: 5px;
}

.live-score-text {
    font-size: 26px;
    font-weight: 900;
    color: #fff;
    letter-spacing: 2px;
}

/* =========================================
   HISTORIQUE DES PARIS
   ========================================= */
.my-bets-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.bet-history-card {
    background-color: var(--bg-panel);
    border-left: 4px solid var(--text-sec);
    border-radius: 6px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.bet-history-card.en_cours {
    border-left-color: #ffaa00;
}

.bet-history-card.gagne {
    border-left-color: var(--accent);
}

.bet-history-card.perdu {
    border-left-color: var(--red);
}

.bet-history-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.bet-history-teams {
    font-weight: bold;
    font-size: 15px;
}

.bet-history-meta {
    font-size: 12px;
    color: var(--text-sec);
}

.bet-status-badge {
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.bet-status-badge.en_cours {
    background-color: rgba(255, 170, 0, 0.1);
    color: #ffaa00;
}

.bet-status-badge.gagne {
    background-color: rgba(0, 231, 1, 0.1);
    color: var(--accent);
}

.bet-status-badge.perdu {
    background-color: rgba(255, 77, 77, 0.1);
    color: var(--red);
}

/* =========================================
        ÉCRAN D'AUTHENTIFICATION
   ========================================= */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 33, 46, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.overlay.active {
    display: flex;
}

.login-box {
    background-color: var(--bg-main);
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 350px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}

.login-box h2 {
    margin-bottom: 20px;
    font-size: 22px;
}

.auth-form {
    text-align: left;
    margin-top: 20px;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    font-size: 12px;
    color: #98a7b5;
    margin-bottom: 5px;
    text-transform: uppercase;
    font-weight: bold;
}

.input-group input {
    width: 100%;
    padding: 12px;
    background-color: #0f212e;
    border: 2px solid #213743;
    border-radius: 5px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.input-group input:focus {
    border-color: #2fbf71;
}

.auth-switch {
    margin-top: 20px;
    font-size: 14px;
    color: #98a7b5;
}

.auth-switch a {
    color: #2fbf71;
    text-decoration: none;
    font-weight: bold;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* =========================================
        PARAMETRE DU PROFIL
   ========================================= */

.dropdown-header:hover {
    background-color: var(--bg-cell);
}

/* =========================================
        PAGE LEGAL
   ========================================= */

.legal-container {
    display: block !important;
    max-width: 800px !important;
    margin: 40px auto !important;
    padding: 30px !important;
    background-color: var(--bg-main);
    border-radius: 8px;
    color: #f0f0f0;
    text-align: left !important;
}

.legal-container h2, 
.legal-container h3, 
.legal-container p, 
.legal-container ul {
    display: block !important;
    width: 100% !important;
    float: none !important;
}

.legal-container h2 {
    margin-bottom: 20px;
    padding-bottom: 10px;
}

.legal-container h3 {
    color: var(--accent);
    margin-top: 30px;
    margin-bottom: 10px;
}

.legal-container p, .legal-container ul {
    line-height: 1.6;
    margin-bottom: 15px;
}

.legal-container ul {
    margin-left: 40px;
}

/* =========================================
            HISTORIQUE (Profil & Jeux)
   ========================================= */

.profil-section, 
.game-history-section {
    background-color: var(--bg-panel);
    max-width: 900px;
    margin: 40px auto;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.profil-section h3, 
.game-history-section h3 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 1.4rem;
    color: var(--text-main);
}

#historique-global-container,
#historique-blackjack-container {
    overflow-x: auto; 
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    white-space: nowrap;
}

.history-table th {
    background-color: rgba(255, 255, 255, 0.03); 
    padding: 15px 10px;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    color: #888;
    border-bottom: 2px solid #2a3441;
}

.history-table td {
    padding: 15px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.history-table tbody tr:hover td {
    background-color: rgba(255, 255, 255, 0.04);
    cursor: default;
}

.text-win {
    color: #00ff66; 
}

.text-loss {
    color: #ff4d4d; 
}

.text-tie {
    color: #a0a0a0; 
}

.history-date {
    color: #666;
    font-size: 0.8rem;
}

/* =========================================
   SECTION EXPLICATION DES JEUX
   ========================================= */

.explanation-section {
    background-color: var(--bg-panel);
    max-width: 900px;
    margin: 30px auto;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

#warning-game {
    background-color: rgba(255, 153, 0, 0.07);
    border-left: 4px solid #ff9900;
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 25px;
}

#warning-game h3 {
    margin: 0;
    color: #ff9900;
    font-size: 0.95rem;
    font-weight: bold;
    letter-spacing: 0.5px;
}

#expl-game h3 {
    color: var(--text-main);
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.2rem;
}

#expl-game p {
    color: var(--text-sec);
    line-height: 1.6;
    font-size: 0.95rem;
    margin: 0;
}