/* ============================================
               Beyond the Shell
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    background-attachment: fixed;
    color: #e8e8e8;
    text-align: center;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* En-tête */
header {
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    color: #e8e8e8;
    padding: 20px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.header-container h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: #64ffda;
    letter-spacing: -0.5px;
    text-shadow: 0 0 20px rgba(100, 255, 218, 0.3);
}

/* Navigation */
nav {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

nav a {
    color: #e8e8e8;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 10px 18px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(100, 255, 218, 0.2), transparent);
    transition: left 0.5s ease;
}

nav a:hover::before {
    left: 100%;
}

nav a:hover {
    color: #64ffda;
    background: rgba(100, 255, 218, 0.1);
    border-color: rgba(100, 255, 218, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(100, 255, 218, 0.2);
}

/* Conteneur principal */
.container {
    max-width: 500px;
    width: 90%;
    margin: 50px auto;
    padding: 40px;
    background: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Conteneur spécifique pour la page de jeu - LARGE */
body.game-page .game-container {
    max-width: 1200px;
    width: 95%;
    margin: 20px auto;
    padding: 0 20px;
    background: transparent;
    backdrop-filter: none;
    box-shadow: none;
    border-radius: 0;
    border: none;
}

/* Titres */
h1 {
    font-size: 2rem;
    margin-bottom: 25px;
    color: #64ffda;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-shadow: 0 0 20px rgba(100, 255, 218, 0.3);
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #e8e8e8;
    font-weight: 600;
}

h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #b0b0b0;
    font-weight: 500;
}

/* Paragraphes */
p {
    margin: 15px 0;
    color: #b0b0b0;
    line-height: 1.8;
}

a {
    color: #64ffda;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #4dd0e1;
    text-shadow: 0 0 10px rgba(100, 255, 218, 0.5);
}

/* Champs de formulaire */
input[type="text"],
input[type="password"],
input[type="file"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 14px 18px;
    margin: 12px 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(15, 20, 30, 0.6);
    color: #e8e8e8;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="file"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #64ffda;
    background: rgba(15, 20, 30, 0.8);
    box-shadow: 0 0 0 3px rgba(100, 255, 218, 0.1);
}

input[type="text"]::placeholder,
input[type="password"]::placeholder {
    color: rgba(184, 184, 184, 0.5);
}

/* Boutons */
input[type="submit"],
button,
.btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #64ffda, #4dd0e1);
    border: none;
    border-radius: 12px;
    color: #0f1419;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    text-transform: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(100, 255, 218, 0.3);
    font-family: 'Inter', sans-serif;
}

input[type="submit"]:hover,
button:hover,
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(100, 255, 218, 0.4);
    background: linear-gradient(135deg, #4dd0e1, #64ffda);
}

input[type="submit"]:active,
button:active,
.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #64ffda, #4dd0e1);
    color: #0f1419;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #e8e8e8;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(100, 255, 218, 0.3);
    color: #64ffda;
    box-shadow: 0 4px 15px rgba(100, 255, 218, 0.2);
}

.btn-upgrade {
    background: rgba(100, 255, 218, 0.1);
    border: 1px solid rgba(100, 255, 218, 0.3);
    color: #64ffda;
    box-shadow: 0 0 20px rgba(100, 255, 218, 0.1);
}

.btn-upgrade:hover {
    background: rgba(100, 255, 218, 0.2);
    box-shadow: 0 0 30px rgba(100, 255, 218, 0.2);
}

/* Images */
img {
    width: 100px;
    margin-bottom: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

img:hover {
    transform: scale(1.05);
}

img.big {
    width: 192px;
    margin-bottom: 16px;
}

/* SVG */
svg {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 15px rgba(100, 255, 218, 0.3));
}

/* Game UI */
.hud {
    max-width: 1200px;
    width: calc(100% - 40px);
    margin: 20px auto 0 auto;
    display: flex;
    gap: 15px;
    justify-content: space-between;
    align-items: center;
    background: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 18px 24px;
    font-size: 1rem;
    color: #e8e8e8;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    flex-wrap: wrap;
}

/* HUD dans la page de jeu - LARGE */
body.game-page .hud {
    max-width: 1200px;
    width: 100%;
}

.hud .tag {
    background: rgba(100, 255, 218, 0.1);
    border: 1px solid rgba(100, 255, 218, 0.3);
    border-radius: 10px;
    padding: 10px 16px;
    color: #64ffda;
    font-weight: 500;
}

.hud .boss {
    color: #ffb703;
    text-shadow: 0 0 15px rgba(255, 183, 3, 0.5);
}

.game-wrapper {
    max-width: 1200px;
    width: calc(100% - 40px);
    margin: 20px auto;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
}

/* Game wrapper dans la page de jeu - LARGE avec layout optimisé */
body.game-page .game-wrapper {
    max-width: 1200px;
    width: 100%;
    margin: 20px auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 20px;
    padding: 0;
}

/* Ligne 1: Héros et Ennemi côte à côte */
body.game-page .game-wrapper .panel.stats {
    grid-column: 1;
    grid-row: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    overflow: visible;
}

body.game-page .game-wrapper .panel.enemy {
    grid-column: 2;
    grid-row: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    overflow: visible;
}

/* Ligne 2: Actions pleine largeur */
body.game-page .game-wrapper .actions {
    grid-column: 1 / -1;
    grid-row: 2;
}

/* Ligne 3: Compétences et Journal côte à côte */
body.game-page .game-wrapper .panel.skills {
    grid-column: 1;
    grid-row: 3;
    text-align: left;
}

body.game-page .game-wrapper .panel.log-box {
    grid-column: 2;
    grid-row: 3;
}

.panel {
    background: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Panneaux dans la page de jeu - plus grands */
body.game-page .game-wrapper .panel {
    background: rgba(26, 26, 46, 0.7);
    padding: 20px;
    box-sizing: border-box;
    overflow: visible;
}

body.game-page .game-wrapper .panel.stats,
body.game-page .game-wrapper .panel.enemy {
    min-height: 280px;
    height: auto;
    overflow: visible;
    box-sizing: border-box;
}

body.game-page .game-wrapper .panel.skills {
    min-height: 400px;
}

body.game-page .game-wrapper .panel.log-box {
    min-height: 400px;
}

.panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.panel-title {
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 1.1rem;
    font-weight: 600;
    color: #64ffda;
}

/* Panel title dans la page de jeu - plus compact */
body.game-page .game-wrapper .panel-title {
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    font-size: 1rem;
}

.stats p,
.skills p {
    margin: 10px 0;
    color: #b0b0b0;
    line-height: 1.8;
}

/* Stats et skills dans la page de jeu - améliorés */
body.game-page .game-wrapper .stats p,
body.game-page .game-wrapper .skills p {
    margin: 12px 0;
    color: #e8e8e8;
    line-height: 1.8;
    font-size: 1.05rem;
}

body.game-page .game-wrapper .stats strong,
body.game-page .game-wrapper .skills strong {
    color: #64ffda;
    font-weight: 600;
    font-size: 1.1rem;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

/* Actions dans la page de jeu - LARGE et bien visible */
body.game-page .game-wrapper .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 0;
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: center;
    align-items: center;
    padding: 25px;
    background: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

body.game-page .game-wrapper .actions input[type="submit"],
body.game-page .game-wrapper .actions button {
    width: auto;
    min-width: 160px;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    flex: 1;
    max-width: 220px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

body.game-page .game-wrapper .actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

body.game-page .game-wrapper .actions button:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.actions input[type="submit"],
.actions button {
    width: auto;
    min-width: 120px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
}

.log-box {
    margin-top: 16px;
    padding: 16px;
    background: rgba(15, 20, 30, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 300px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: #b0b0b0;
    line-height: 1.6;
}

/* Log box dans la page de jeu - LARGE */
body.game-page .game-wrapper .log-box {
    margin-top: 0;
    padding: 20px;
    background: rgba(15, 20, 30, 0.7);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: none;
    min-height: 400px;
    height: 100%;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    color: #e8e8e8;
    line-height: 1.8;
}

body.game-page .game-wrapper .log-box div {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    animation: fadeIn 0.3s ease;
}

body.game-page .game-wrapper .log-box div:last-child {
    border-bottom: none;
}

.log-box::-webkit-scrollbar {
    width: 8px;
}

.log-box::-webkit-scrollbar-track {
    background: rgba(15, 20, 30, 0.3);
    border-radius: 4px;
}

.log-box::-webkit-scrollbar-thumb {
    background: rgba(100, 255, 218, 0.3);
    border-radius: 4px;
}

.log-box::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 255, 218, 0.5);
}

.grid-full {
    grid-column: 1 / -1;
}

body.game-page .game-wrapper .grid-full {
    grid-column: 1 / -1;
}

/* Le log-box n'est plus grid-full dans la page de jeu */
/* Le log-box est en colonne 2, ligne 3 */
body.game-page .game-wrapper .log-box {
    grid-column: 2;
    grid-row: 3;
}

.game-menu {
    max-width: 1200px;
    width: calc(100% - 40px);
    margin: 20px auto;
    background: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px 30px;
    text-align: left;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Game menu dans la page de jeu - LARGE */
body.game-page .game-menu {
    max-width: 1200px;
    width: 100%;
}

/* Messages et alertes */
.alert,
.message {
    padding: 16px 20px;
    border-radius: 12px;
    margin: 20px 0;
    border: 1px solid;
}

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    border-color: rgba(76, 175, 80, 0.3);
    color: #81c784;
}

.alert-error {
    background: rgba(244, 67, 54, 0.1);
    border-color: rgba(244, 67, 54, 0.3);
    color: #e57373;
}

.alert-info {
    background: rgba(33, 150, 243, 0.1);
    border-color: rgba(33, 150, 243, 0.3);
    color: #64b5f6;
}

/* Tableaux */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: rgba(26, 26, 46, 0.4);
    border-radius: 12px;
    overflow: hidden;
}

th,
td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

th {
    background: rgba(100, 255, 218, 0.1);
    color: #64ffda;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

tr:hover {
    background: rgba(100, 255, 218, 0.05);
}

/* Responsive */
/* Barres de vie pour la page de jeu */
body.game-page .hp-bar {
    width: 100%;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin: 8px 0;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

body.game-page .hp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #64ffda, #4dd0e1);
    border-radius: 12px;
    transition: width 0.5s ease;
    position: relative;
    box-shadow: 0 0 20px rgba(100, 255, 218, 0.4);
}

body.game-page .hp-bar-fill.enemy {
    background: linear-gradient(90deg, #ff6b6b, #ff5252);
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.4);
}

body.game-page .hp-bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 600;
    font-size: 0.75rem;
    color: #0f1419;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.5);
    z-index: 1;
}

body.game-page .hp-bar-fill.enemy .hp-bar-text {
    color: #fff;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}

body.game-page .combat-emoji {
    font-size: 3.5rem;
    line-height: 1;
    margin: 12px 0;
    display: block;
}

body.game-page .enemy-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ff6b6b;
    margin-bottom: 8px;
    text-align: center;
}

body.game-page .enemy-name.boss {
    color: #ffb703;
    text-shadow: 0 0 20px rgba(255, 183, 3, 0.5);
    font-size: 1.5rem;
}

@media (max-width: 1200px) {
    body.game-page .game-wrapper {
        grid-template-columns: 1fr 1fr;
    }

    body.game-page .game-wrapper .panel.skills {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {
    .game-wrapper {
        grid-template-columns: 1fr;
    }

    body.game-page .game-wrapper {
        grid-template-columns: 1fr;
    }

    body.game-page .game-wrapper .panel.stats,
    body.game-page .game-wrapper .panel.enemy,
    body.game-page .game-wrapper .panel.skills {
        grid-column: auto;
    }

    .grid-full {
        grid-column: auto;
    }

    body.game-page .game-wrapper .grid-full {
        grid-column: auto;
    }

    .header-container {
        flex-direction: column;
        align-items: center;
    }

    nav {
        justify-content: center;
    }

    .container {
        padding: 30px 20px;
        margin: 30px auto;
    }

    body.game-page .game-container {
        padding: 0 10px;
    }

    .hud {
        flex-direction: column;
        align-items: stretch;
    }

    body.game-page .game-wrapper .actions {
        flex-direction: column;
    }

    body.game-page .game-wrapper .actions input[type="submit"],
    body.game-page .game-wrapper .actions button {
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    .header-container h1 {
        font-size: 1.4rem;
    }

    nav a {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .container {
        width: 95%;
        padding: 25px 15px;
    }

    h1 {
        font-size: 1.6rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container,
.panel,
.game-menu {
    animation: fadeIn 0.5s ease;
}

/* Sélection de texte */
::selection {
    background: rgba(100, 255, 218, 0.3);
    color: #e8e8e8;
}

/* Scrollbar personnalisée */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 20, 30, 0.3);
}

::-webkit-scrollbar-thumb {
    background: rgba(100, 255, 218, 0.3);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 255, 218, 0.5);
}

