/* ===========================
   CAPTAIN JON - STYLES GÉNÉRAUX
   =========================== */

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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #0a1929 0%, #1a2f4a 50%, #0d1b2a 100%);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ===========================
   HEADER
   =========================== */

header {
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    border-bottom: 2px solid #1e3a5f;
    flex-shrink: 0;
}

h1 {
    color: #c5d8e8;
    font-size: 1.8em;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
    letter-spacing: 4px;
    font-weight: 700;
}

.subtitle {
    color: #7a9cb5;
    font-size: 0.85em;
    margin-top: 3px;
    letter-spacing: 1px;
}

/* ===========================
   MAIN CONTENT
   =========================== */

main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 10px;
}

/* ÉCRAN DE BIENVENUE */
.welcome-box {
    background: rgba(15, 25, 40, 0.85);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    max-width: 600px;
    text-align: center;
    border: 1px solid rgba(100, 130, 160, 0.3);
}

.welcome-box h2 {
    color: #c5d8e8;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.welcome-box p {
    color: #a0b8cc;
    line-height: 1.8;
    margin-bottom: 15px;
}

.welcome-box strong {
    color: #d4e4f0;
}

/* ===========================
   GAME LAYOUT - 3 COLONNES
   =========================== */

.game-layout {
    display: none;
    width: 100%;
    height: 100%;
    gap: 10px;
    flex-direction: row;
}

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

/* PANNEAU GAUCHE - ÉNIGMES (30%) */
.enigma-panel {
    width: 30%;
    background: rgba(15, 25, 40, 0.85);
    border-radius: 10px;
    border: 1px solid #1e3a5f;
    padding: 20px;
    overflow-y: auto;
}

#enigmaContainer {
    color: #c5d8e8;
}

.enigma-title {
    font-size: 1.3em;
    margin-bottom: 15px;
    color: #c5d8e8;
    text-align: center;
}

.enigma-description {
    color: #a0b8cc;
    margin-bottom: 15px;
    line-height: 1.6;
    text-align: center;
    font-size: 0.9em;
}

.enigma-input {
    text-align: center;
    margin: 15px 0;
}

.enigma-input input {
    padding: 10px 15px;
    width: 100%;
    max-width: 300px;
    border: 2px solid #1e3a5f;
    background: rgba(15, 25, 40, 0.8);
    color: #c5d8e8;
    border-radius: 5px;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.enigma-input input::placeholder {
    color: #7a9cb5;
}

.enigma-input button {
    padding: 10px 25px;
    background: #1e3a5f;
    color: #c5d8e8;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s;
}

.enigma-input button:hover {
    background: #2a4a6f;
}

.success-message {
    color: #6bff6b;
    font-weight: bold;
    margin-top: 10px;
    text-align: center;
    font-size: 0.9em;
}

.error-message {
    color: #ff6b6b;
    font-size: 0.85em;
    margin-left: 8px;
}

/* PANNEAU CENTRE - GRILLE (40%) */
.grid-panel {
    width: 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* PANNEAU DROITE - CONSOLE (30%) */
.console-panel {
    width: 30%;
    background: rgba(15, 25, 40, 0.85);
    border-radius: 10px;
    border: 1px solid #1e3a5f;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.console-title {
    color: #c5d8e8;
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
    border-bottom: 2px solid #1e3a5f;
    padding-bottom: 10px;
}

.console-messages {
    flex: 1;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
}

.console-message {
    color: #6bff6b;
    margin-bottom: 10px;
    font-size: 0.85em;
    line-height: 1.4;
}

.console-message::before {
    content: '> ';
    color: #7a9cb5;
}

.console-message.error {
    color: #ff6b6b;
}

.console-message.warning {
    color: #ffff6b;
}

.console-message.info {
    color: #6b9fff;
}

/* ===========================
   FOOTER - TOUT SUR UNE LIGNE
   =========================== */

footer {
    background: rgba(0, 0, 0, 0.6);
    border-top: 2px solid #1e3a5f;
    flex-shrink: 0;
}

.footer-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
    gap: 20px;
}

/* GAUCHE - CONNEXION + FORMULAIRE INLINE */
.footer-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.footer-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    color: #b0c4d8;
    background: rgba(30, 58, 95, 0.3);
    padding: 8px 15px;
    border-radius: 8px;
    border: 1px solid #1e3a5f;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.footer-icon-btn:hover {
    background: rgba(30, 58, 95, 0.6);
    color: #e8f1f8;
    transform: scale(1.05);
}

/* FORMULAIRE INLINE */
.login-form-inline {
    display: none;
    align-items: center;
    gap: 8px;
}

.login-form-inline.active {
    display: flex;
}

.login-form-inline input {
    padding: 6px 12px;
    width: 200px;
    border: 2px solid #1e3a5f;
    background: rgba(15, 25, 40, 0.8);
    color: #c5d8e8;
    border-radius: 5px;
    font-size: 0.85em;
}

.login-form-inline input::placeholder {
    color: #7a9cb5;
    font-style: italic;
}

.login-form-inline button {
    padding: 6px 15px;
    background: #1e3a5f;
    color: #c5d8e8;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.3s;
    white-space: nowrap;
}

.login-form-inline button:hover {
    background: #2a4a6f;
}

/* CENTRE - COMPÉTENCES */
.skills-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex: 1;
    flex-wrap: wrap;
}

.skill-item {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(30, 58, 95, 0.3);
    padding: 5px 12px;
    border-radius: 5px;
    border: 1px solid #1e3a5f;
}

.skill-icon {
    font-size: 1em;
}

.skill-label {
    color: #a0b8cc;
    font-size: 0.85em;
    font-weight: 600;
    white-space: nowrap;
}

/* DROITE - RÈGLES */
.footer-right {
    flex-shrink: 0;
}

/* ===========================
   SCROLLBAR CUSTOM
   =========================== */

.enigma-panel::-webkit-scrollbar,
.console-messages::-webkit-scrollbar {
    width: 8px;
}

.enigma-panel::-webkit-scrollbar-track,
.console-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.enigma-panel::-webkit-scrollbar-thumb,
.console-messages::-webkit-scrollbar-thumb {
    background: #1e3a5f;
    border-radius: 10px;
}

.enigma-panel::-webkit-scrollbar-thumb:hover,
.console-messages::-webkit-scrollbar-thumb:hover {
    background: #2a4a6f;
}

/* ===========================
   RESPONSIVE
   =========================== */

@media (max-width: 1024px) {
    .game-layout {
        flex-direction: column;
    }
    
    .enigma-panel,
    .grid-panel,
    .console-panel {
        width: 100%;
        height: 33.33%;
    }
    
    .footer-container {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .skills-bar {
        order: 3;
        width: 100%;
    }
}

/* ===========================
   ADMIN
   =========================== */

.admin-control {
    background: rgba(30, 58, 95, 0.3);
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    border: 1px solid #1e3a5f;
    transition: all 0.3s;
}

.admin-control:hover {
    background: rgba(30, 58, 95, 0.5);
    transform: translateX(5px);
}

.admin-control label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 1.1em;
    color: #c5d8e8;
}

.admin-control input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 15px;
    cursor: pointer;
    accent-color: #2d5016;
}

.admin-control input[type="checkbox"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}